summaryrefslogtreecommitdiff
blob: 0b5093bfab88c760e7e0402ceec75719f8b81602 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
--- kmymoney2-0.7.1.backup/kmymoney2/reports/querytable.cpp	2005-03-19 16:21:11.000000000 +0100
+++ kmymoney2-0.7.1/kmymoney2/reports/querytable.cpp	2005-05-28 17:06:09.000000000 +0200
@@ -40,6 +40,7 @@
 #include "reportdebug.h"
 #include "querytable.h"
 
+
 namespace reports {
 
 // this should be in mymoneysplit.h
@@ -752,6 +753,11 @@
 //   MyMoneyMoney::signPosition savesignpos = MyMoneyMoney::negativeMonetarySignPosition();
   unsigned char savethsep = MyMoneyMoney::thousandSeparator();
 
+#ifndef CSV_SEPARATOR 
+#define CSV_SEPARATOR "\t";
+#endif
+  String g_csvSep = CSV_SEPARATOR;
+
   MyMoneyMoney grandtotal;
 
   result="";
@@ -829,7 +835,7 @@
     if ( i18nName.isEmpty() )
       i18nName = *it_column;
     result += "<th>" + i18nName + "</th>";
-    csv += i18nName + ",";
+    csv += i18nName + g_csvSep;
     ++it_column;
   }
 
@@ -899,7 +905,7 @@
             "colspan=\"" + QString::number(columns.count()-1) + "\">"+
             i18n("Total")+" " + (*it_group).oldName() + "</td>"
             "<td>" + subtotal_html + "</td></tr>\n";
-          csv += "\"" + i18n("Total") + " " + (*it_group).oldName() + "\"," + subtotal_csv + "\n";
+          csv += "\"" + i18n("Total") + " " + (*it_group).oldName() + "\"" + g_csvSep + subtotal_csv + "\n";
         }
         --it_group;
       }
@@ -936,7 +942,7 @@
 
         MyMoneyMoney::setThousandSeparator('\0');
 
-        csv += MyMoneyMoney(data).formatMoney() + ",";
+        csv += MyMoneyMoney(data).formatMoney() + g_csvSep;
 
         MyMoneyMoney::setThousandSeparator(savethsep);
       }
@@ -948,7 +954,7 @@
 
         MyMoneyMoney::setThousandSeparator('\0');
 
-        csv += (*it_row)["currency"] + " " + MyMoneyMoney(data).formatMoney() + ",";
+        csv += (*it_row)["currency"] + " " + MyMoneyMoney(data).formatMoney() + g_csvSep;
 
         MyMoneyMoney::setThousandSeparator(savethsep);
 
@@ -964,7 +970,7 @@
       {
         result += QString("<td class=\"left\">%1</td>")
           .arg(data);
-        csv += "\""+ data + "\",";
+        csv += "\""+ data + "\"" + g_csvSep;
       }
       ++it_column;
     }
@@ -1001,7 +1007,7 @@
         "colspan=\"" + QString::number(columns.count()-1) + "\">"+
         i18n("Total")+" " + (*it_group).oldName() + "</td>"
         "<td>" + subtotal_html + "</td></tr>\n";
-      csv += "\"" + i18n("Total") + " " + (*it_group).oldName() + "\"," + subtotal_csv + "\n";
+      csv += "\"" + i18n("Total") + " " + (*it_group).oldName() + "\"" + g_csvSep + subtotal_csv + "\n";
       --it_group;
     }
 
@@ -1019,7 +1025,7 @@
       "colspan=\"" + QString::number(columns.count()-1) + "\">"+
       i18n("Grand Total") + "</td>"
       "<td>" + grandtotal_html + "</td></tr>\n";
-    csv += "\"" + i18n("Grand Total") + "\"," + grandtotal_csv + "\n";
+    csv += "\"" + i18n("Grand Total") + "\"" + g_csvSep + grandtotal_csv + "\n";
   }
   result += "</table>\n";
 }
--- kmymoney2-0.7.1.backup/kmymoney2/reports/pivottable.cpp	2005-03-19 16:21:11.000000000 +0100
+++ kmymoney2-0.7.1/kmymoney2/reports/pivottable.cpp	2005-05-28 17:06:08.000000000 +0200
@@ -739,6 +739,11 @@
 {
   DEBUG_ENTER(__PRETTY_FUNCTION__);
 
+#ifndef CSV_SEPARATOR 
+#define CSV_SEPARATOR "\t";
+#endif
+  String g_csvSep = CSV_SEPARATOR;
+
   char saveseparator = MyMoneyMoney::thousandSeparator();
   MyMoneyMoney::setThousandSeparator('\0');
 
@@ -760,10 +765,10 @@
 
   unsigned column = 1;
   while ( column < m_numColumns )
-    result += QString(",%1").arg(QString(m_columnHeadings[column++]));
+    result += g_csvSep + QString("%1").arg(QString(m_columnHeadings[column++]));
 
   if ( m_config_f.isShowingRowTotals() )
-    result += QString(",%1").arg(i18n("Total"));
+    result += g_csvSep + QString("%1").arg(i18n("Total"));
 
   result += "\n";
 
@@ -804,10 +809,10 @@
         QString rowdata;
         unsigned column = 1;
         while ( column < m_numColumns )
-          rowdata += QString(",%1").arg(it_row.data()[column++].formatMoney());
+          rowdata += g_csvSep + QString("%1").arg(it_row.data()[column++].formatMoney());
 
         if ( m_config_f.isShowingRowTotals() )
-          rowdata += QString(",%1").arg((*it_row).m_total.formatMoney());
+          rowdata += g_csvSep + QString("%1").arg((*it_row).m_total.formatMoney());
 
         //
         // Row Header
@@ -865,10 +870,10 @@
       {
         unsigned column = 1;
         while ( column < m_numColumns )
-          result += QString(",%1").arg((*it_innergroup).m_total[column++].formatMoney());
+          result += g_csvSep + QString("%1").arg((*it_innergroup).m_total[column++].formatMoney());
 
         if (  m_config_f.isShowingRowTotals() )
-          result += QString(",%1").arg((*it_innergroup).m_total.m_total.formatMoney());
+          result += g_csvSep + QString("%1").arg((*it_innergroup).m_total.m_total.formatMoney());
 
         result += "\n";
       }
@@ -886,10 +891,10 @@
       result += QString("%1 %2").arg(i18n("Total")).arg(it_outergroup.key());
       unsigned column = 1;
       while ( column < m_numColumns )
-        result += QString(",%1").arg((*it_outergroup).m_total[column++].formatMoney());
+        result += g_csvSep + QString("%1").arg((*it_outergroup).m_total[column++].formatMoney());
 
       if (  m_config_f.isShowingRowTotals() )
-        result += QString(",%1").arg((*it_outergroup).m_total.m_total.formatMoney());
+        result += g_csvSep + QString("%1").arg((*it_outergroup).m_total.m_total.formatMoney());
 
       result += "\n";
     }
@@ -905,10 +910,10 @@
     result += i18n("Grand Total");
     unsigned totalcolumn = 1;
     while ( totalcolumn < m_numColumns )
-      result += QString(",%1").arg(m_grid.m_total[totalcolumn++].formatMoney());
+      result += g_csvSep + QString("%1").arg(m_grid.m_total[totalcolumn++].formatMoney());
 
     if (  m_config_f.isShowingRowTotals() )
-      result += QString(",%1").arg(m_grid.m_total.m_total.formatMoney());
+      result += g_csvSep + QString("%1").arg(m_grid.m_total.m_total.formatMoney());
 
     result += "\n";
   }