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

List:       kde-commits
Subject:    koffice/kexi/plugins/reportspgz/backend/renderer
From:       Adam Pigg <adam () piggz ! co ! uk>
Date:       2009-01-17 14:21:24
Message-ID: 1232202084.566728.6027.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 912490 by piggz:

Allow the conrol source of a field to contain a $ at the beginning to represent what follows as a string

 M  +5 -2      orprerender.cpp  


--- trunk/koffice/kexi/plugins/reportspgz/backend/renderer/orprerender.cpp #912489:912490
@@ -588,13 +588,16 @@
             QString str = QString::null;
 
             QString cs = f->_controlSource->value().toString();
-            if (cs.left(1) == "=") {
+            if (cs.left(1) == "=") { //Everything after = is treated as code
                 if (!cs.contains("PageTotal")) {
-                    str = _handler->evaluate(f->entityName()).toString();
+                    QVariant v = _handler->evaluate(f->entityName());
+                    str = v.toString();
                 } else {
                     str = cs.mid(1);
                     _postProcText.append(tb);
                 }
+            } else if (cs.left(1) == "$") { //Everything past $ is treated as a string
+                str = cs.mid(1);
             } else {
                 QString qry = "Data Source";
                 QString clm = f->_controlSource->value().toString();
[prev in list] [next in list] [prev in thread] [next in thread] 

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