[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kugar/lib
From:       Adam Treat <treat () kde ! org>
Date:       2005-06-17 19:36:59
Message-ID: 1119037019.073449.3105.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 426595 by treat:

* Make the borders work and fixes for formatting of currencies.

 M  +5 -4      mfieldobject.cpp  
 M  +5 -5      mreportengine.cpp  


--- trunk/koffice/kugar/lib/mfieldobject.cpp #426594:426595
@@ -100,7 +100,8 @@
                 text = txt;
       break;
     case MFieldObject::Currency:
-      text.setNum(txt.toDouble(), 'f', 2);
+      int prec = precision < 2 ? precision : 2;
+      text.setNum(txt.toDouble(), 'f', prec);
             if (comma) formatCommas();
             formatNegValue();
             text = QString(currency + text);
@@ -155,8 +156,8 @@
 
 /** Formats the string representation of a number with comma separators */
 void MFieldObject::formatCommas(){
-    text = text.replace(".", ",");
-/*    QString tmp;
+//     text = text.replace(".", ",");
+    QString tmp;
     int i, j;
     int offset;
 
@@ -188,7 +189,7 @@
     if (offset) tmp = "-" + tmp;
 
     // Set the new string to the field
-    text = tmp;*/
+    text = tmp;
 }
 
 /** Copies member data from one object to another.
--- trunk/koffice/kugar/lib/mreportengine.cpp #426594:426595
@@ -337,7 +337,7 @@
                     if (footer)
                     {
                         qWarning("drawing detail footer: %d",  footer->getLevel());
-                        
+
                         footer->setPageNumber(currPage);
                         footer->setReportDate(currDate);
                         footer->setCalcFieldData(&grandTotal);
@@ -846,13 +846,13 @@
   label->setBorderWidth(attr->namedItem("BorderWidth").nodeValue().toInt());
   label->setBorderStyle(attr->namedItem("BorderStyle").nodeValue().toInt());
   if (!attr->namedItem("DrawBottom").isNull())
-      label->setDrawBottom(attr->namedItem("DrawBottom").nodeValue().toInt());
+      label->setDrawBottom(attr->namedItem("DrawBottom").nodeValue() == "true");
   if (!attr->namedItem("DrawTop").isNull())
-      label->setDrawTop(attr->namedItem("DrawTop").nodeValue().toInt());
+      label->setDrawTop(attr->namedItem("DrawTop").nodeValue() == "true");
   if (!attr->namedItem("DrawLeft").isNull())
-      label->setDrawLeft(attr->namedItem("DrawLeft").nodeValue().toInt());
+      label->setDrawLeft(attr->namedItem("DrawLeft").nodeValue() == "true");
   if (!attr->namedItem("DrawRight").isNull())
-      label->setDrawRight(attr->namedItem("DrawRight").nodeValue().toInt());
+      label->setDrawRight(attr->namedItem("DrawRight").nodeValue() == "true");
   label->setFont(attr->namedItem("FontFamily").nodeValue(),
                  attr->namedItem("FontSize").nodeValue().toInt(),
                  attr->namedItem("FontWeight").nodeValue().toInt(),
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic