--- as_reportpanel.cpp 2003/02/21 23:44:36 1.12
+++ as_reportpanel.cpp 2003/02/24 17:39:04 1.13
@@ -478,11 +478,11 @@
//
QString Reportpanel::getWeektotals(QDate Dayref, int nWeeks)
{
- using namespace std; // Needed for hash tables with hmap
- map<string, string> Hashtasks; // Hashtable for storing tasks
- map<string, string> Hashhours; // Hashtable for storing hours
- map<string, string>::iterator Taskiter; // The hashtable task iterator
- map<string, string>::iterator Houriter; // The hashtable hour iterator
+ using namespace std; // Needed for maps and hash
+ map<string, string> Hashtasks; // Hashtable to store tasks
+ multimap<string, string> Hashhours; // Hashtable to store hours
+ map<string, string>::iterator Taskiter; // Hashtable task iterator
+ multimap<string, string>::iterator Houriter; // Hashtable hour iterator
QString Totals; // Data totals to return for writing
QString Tempstring; // Temporary processing string
@@ -527,7 +527,7 @@
// Reverse copy the tasks hashtable to both sort and index by amount key
for (Taskiter = Hashtasks.begin(); Taskiter != Hashtasks.end(); Taskiter++)
- Hashhours[Taskiter->second] = Taskiter->first;
+ Hashhours.insert(pair<string, string>(Taskiter->second, Taskiter->first));
// Write the actual data totals to the outgoing string in reverse order
for (Houriter = Hashhours.begin(); Houriter != Hashhours.end(); Houriter++)
@@ -596,11 +596,11 @@
//
QString Reportpanel::getMonthtotals(QDate Dayref, int nMonths)
{
- using namespace std; // Needed for hash tables with hmap
- map<string, string> Hashtasks; // Hashtable for storing tasks
- map<string, string> Hashhours; // Hashtable for storing hours
- map<string, string>::iterator Taskiter; // The hashtable task iterator
- map<string, string>::iterator Houriter; // The hashtable hour iterator
+ using namespace std; // Needed for maps and hash
+ map<string, string> Hashtasks; // Hashtable to store tasks
+ multimap<string, string> Hashhours; // Hashtable to store hours
+ map<string, string>::iterator Taskiter; // Hashtable task iterator
+ multimap<string, string>::iterator Houriter; // Hashtable hour iterator
QString Totals; // Data totals to return for writing
QString Tempstring; // Temporary processing string
@@ -647,7 +647,7 @@
// Reverse copy the tasks hashtable to both sort and index by amount key
for (Taskiter = Hashtasks.begin(); Taskiter != Hashtasks.end(); Taskiter++)
- Hashhours[Taskiter->second] = Taskiter->first;
+ Hashhours.insert(pair<string, string>(Taskiter->second, Taskiter->first));
// Write the actual data totals to the outgoing string in reverse order
for (Houriter = Hashhours.begin(); Houriter != Hashhours.end(); Houriter++)
|