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

List:       koffice
Subject:    [Bug 138768] [PATCH] Proper adding of single characters in KOffice
From:       <boud () valdyas ! org>
Date:       2006-12-14 7:31:43
Message-ID: 20061214073143.11127.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=138768         




------- Additional Comments From boud valdyas org  2006-12-14 08:31 -------
SVN commit 613598 by rempt:

Commit Enrique's patch for replacing strings with chars. Thanks!
CCBUG: 138768


 M  +1 -1      filters/generic_wrapper/generic_filter.cc  
 M  +4 -4      filters/kpresenter/ooimpress/ooimpressexport.cc  
 M  +1 -1      filters/kpresenter/ooimpress/ooimpressimport.cc  
 M  +7 -7      filters/kpresenter/ooimpress/stylefactory.cc  
 M  +10 -10    filters/krita/gmagick/kis_image_magick_converter.cc  
 M  +3 -3      filters/kspread/latex/export/formula.cc  
 M  +1 -1      filters/kword/kword1.3/import/kword13parser.cpp  
 M  +1 -1      karbon/core/vpath.cc  
 M  +1 -1      kivio/kiviopart/kiviosdk/kivio_group_stencil.cpp  
 M  +2 -2      kivio/kiviopart/kiviosdk/kivio_py_stencil_spawner.cpp  
 M  +2 -2      kivio/kiviopart/kiviosdk/kivio_sml_stencil_spawner.cpp  
 M  +7 -7      kivio/kiviopart/ui/kivioaddstencilsetpanel.cpp  
 M  +2 -2      kplato/kptview.cc  
 M  +1 -0      libs/flake/KoCreatePathTool.cpp  
 M  +3 -0      libs/flake/KoSelection.cpp  
 M  +4 -0      libs/kofficecore/KoOasisStyles.cpp  
 M  +1 -0      libs/kofficeui/KoPageLayoutDia.cpp  
 M  +1 -1      libs/kofficeui/KoRuler.cpp  
 M  +1 -0      libs/kopainter/KoDualColorButton.cpp  
 M  +2 -2      libs/kopainter/kogradientmanager.cc  
 M  +2 -2      libs/kross/python/cxx/cxx_extensions.cxx  
 M  +1 -1      libs/kross/python/pythonscript.cpp  


--- trunk/koffice/filters/generic_wrapper/generic_filter.cc #613597:613598
 @ -95,7 +95,7  @
     }
     else
     {
-        QString exec = m_exec + " " + KProcess::quote(m_chain->inputFile()) + " "
+        QString exec = m_exec + ' ' + KProcess::quote(m_chain->inputFile()) + ' '
                        + KProcess::quote(m_chain->outputFile());
         system(QFile::encodeName(exec));
 
--- trunk/koffice/filters/kpresenter/ooimpress/ooimpressexport.cc #613597:613598
 @ -546,12 +546,12  @
             if ( helplines.tagName()=="Vertical" )
             {
                 int tmpX = ( int ) ( KoUnit::toMM( \
                helplines.attribute("value").toDouble() )*100 );
-                m_helpLine+="V"+QString::number( tmpX );
+                m_helpLine+='V'+QString::number( tmpX );
             }
             else if ( helplines.tagName()=="Horizontal" )
             {
                 int tmpY = ( int ) ( KoUnit::toMM( \
                helplines.attribute("value").toDouble() )*100 );
-                m_helpLine+="H"+QString::number( tmpY );
+                m_helpLine+='H'+QString::number( tmpY );
             }
             else if ( helplines.tagName()=="HelpPoint" )
             {
 @ -890,7 +890,7  @
         if (pos!=-1)
         {
             const QString extension( returnstr.mid(pos+1) );
-            pictureName +="."+extension;
+            pictureName +='.'+extension;
         }
 
         if ( m_storeinp->open( returnstr ) )
 @ -907,7 +907,7  @
             }
         }
     }
-    image.setAttribute( "xlink:href", "#" + pictureName );
+    image.setAttribute( "xlink:href", '#' + pictureName );
 
 // set the geometry
     set2DGeometry( source, image );
--- trunk/koffice/filters/kpresenter/ooimpress/ooimpressimport.cc #613597:613598
 @ -632,7 +632,7  @
                 {
                     // We don't care about styles as they are not supported in \
kpresenter.  // Only add a linebreak for every child.
-                    note += t.text() + "\n";
+                    note += t.text() + '\n';
                 }
                 QDomElement notesElement = doc.createElement( "Note" );
                 notesElement.setAttribute( "note", note );
--- trunk/koffice/filters/kpresenter/ooimpress/stylefactory.cc #613597:613598
 @ -1123,16 +1123,16  @
         switch ( direction )
         {
         case 1:
-            m_shadow_offset_x = "-" + distance;
-            m_shadow_offset_y = "-" + distance;
+            m_shadow_offset_x = '-' + distance;
+            m_shadow_offset_y = '-' + distance;
             break;
         case 2:
             m_shadow_offset_x = "0cm";
-            m_shadow_offset_y = "-" + distance;
+            m_shadow_offset_y = '-' + distance;
             break;
         case 3:
             m_shadow_offset_x = distance;
-            m_shadow_offset_y = "-" + distance;
+            m_shadow_offset_y = '-' + distance;
             break;
         case 4:
             m_shadow_offset_x = distance;
 @ -1147,11 +1147,11  @
             m_shadow_offset_y = distance;
             break;
         case 7:
-            m_shadow_offset_x = "-" + distance;
+            m_shadow_offset_x = '-' + distance;
             m_shadow_offset_y = distance;
             break;
         case 8:
-            m_shadow_offset_x = "-" + distance;
+            m_shadow_offset_x = '-' + distance;
             m_shadow_offset_y = "0cm";
             break;
         }
 @ -1377,7 +1377,7  @
     {
         QDomElement s = shadow.toElement();
         QString distance = QString( "%1pt" ).arg( s.attribute( "distance" ) );
-        m_text_shadow = distance + " " + distance;
+        m_text_shadow = distance + ' ' + distance;
     }
 
     if ( !indents.isNull() )
--- trunk/koffice/filters/krita/gmagick/kis_image_magick_converter.cc #613597:613598
 @ -1038,17 +1038,17  @
                 kDebug(41008) << "Found import filter for: " << name << "\n";
 
                 if (!description.isEmpty() && !description.contains('/')) {
-                    all += "*." + name.lower() + " *." + name + " ";
-                    s += "*." + name.lower() + " *." + name + "|";
+                    all += "*." + name.lower() + " *." + name + ' ';
+                    s += "*." + name.lower() + " *." + name + '|';
                     s += i18n(description.utf8());
-                    s += "\n";
+                    s += '\n';
                 }
             }
         }
 // #endif
 
-        all += "|" + i18n("All Images");
-        all += "\n";
+        all += '|' + i18n("All Images");
+        all += '\n';
 
         return all + s;
     }
 @ -1117,18 +1117,18  @
                 description = mi -> description;
 
                 if (!description.isEmpty() && !description.contains('/')) {
-                    all += "*." + name.lower() + " *." + name + " ";
-                    s += "*." + name.lower() + " *." + name + "|";
+                    all += "*." + name.lower() + " *." + name + ' ';
+                    s += "*." + name.lower() + " *." + name + '|';
                     s += i18n(description.utf8());
-                    s += "\n";
+                    s += '\n';
                 }
             }
         }
 // #endif
 
 
-        all += "|" + i18n("All Images");
-        all += "\n";
+        all += '|' + i18n("All Images");
+        all += '\n';
 
         return all + s;
     }
--- trunk/koffice/filters/kspread/latex/export/formula.cc #613597:613598
 @ -89,7 +89,7  @
 		switch( p.nodeType() )
 		{
 			case QDomNode::TextNode:
-				_formula = _formula + QString(p.toText().data()) + " ";
+				_formula = _formula + QString(p.toText().data()) + ' ';
 				break;
 		/*	case TT_Space:
 				_formula = _formula + p->zText;
 @ -100,11 +100,11  @
 				//printf("%*s\n", indent, "");
 				break;*/
 			case QDomNode::ElementNode:
-				_formula = _formula + "<" + p.nodeName();
+				_formula = _formula + '<' + p.nodeName();
 				QDomNamedNodeMap attr = p.attributes();
 				for(unsigned int index = 0; index < attr.length(); index++)
 				{ // The attributes
-					_formula = _formula + " " + attr.item(index).nodeName();
+					_formula = _formula + ' ' + attr.item(index).nodeName();
 					_formula = _formula + "=\"" + attr.item(index).nodeValue() + "\"";
 				}
 				if(p.childNodes().length() == 0)
--- trunk/koffice/filters/kword/kword1.3/import/kword13parser.cpp #613597:613598
 @ -492,7 +492,7  @
 bool KWord13Parser::startElement( const QString&, const QString&, const QString& \
name, const QXmlAttributes& attributes )  {
     kDebug(30520) << indent << "<" << name << ">" << endl; // DEBUG
-    indent += "*"; //DEBUG
+    indent += '*'; //DEBUG
     if (parserStack.isEmpty())
     {
         kError(30520) << "Stack is empty!! Aborting! (in KWordParser::startElement)" \
                << endl;
--- trunk/koffice/karbon/core/vpath.cc #613597:613598
 @ -742,7 +742,7  @
 	}
 
 	if( isClosed() )
-		d += "Z";
+		d += 'Z';
 }
 
 // TODO: remove this backward compatibility function after koffice 1.3.x
--- trunk/koffice/kivio/kiviopart/kiviosdk/kivio_group_stencil.cpp #613597:613598
 @ -628,7 +628,7  @
   }
   
   KivioStencil* pStencil = m_pGroupList->at(id);
-  QString name = QString::number(id) + "-" + pStencil->getTextBoxName(p);
+  QString name = QString::number(id) + '-' + pStencil->getTextBoxName(p);
   return name;
 }
 
--- trunk/koffice/kivio/kiviopart/kiviosdk/kivio_py_stencil_spawner.cpp \
#613597:613598  @ -144,10 +144,10  @
 
     // Now load the xpm
     QFileInfo finfo(file);
-    QString pixFile = finfo.dirPath(true) + "/" + finfo.baseName() + ".xpm";
+    QString pixFile = finfo.dirPath(true) + '/' + finfo.baseName() + ".xpm";
 
     if(!m_icon.load( pixFile )) {
-      QString pixFile = finfo.dirPath(true) + "/" + finfo.baseName() + ".png";
+      QString pixFile = finfo.dirPath(true) + '/' + finfo.baseName() + ".png";
       m_icon.load( pixFile );
     }
 
--- trunk/koffice/kivio/kiviopart/kiviosdk/kivio_sml_stencil_spawner.cpp \
#613597:613598  @ -152,10 +152,10  @
 
   // Now load the xpm
   QFileInfo finfo(file);
-  QString pixFile = finfo.dirPath(true) + "/" + finfo.baseName() + ".xpm";
+  QString pixFile = finfo.dirPath(true) + '/' + finfo.baseName() + ".xpm";
 
   if(!m_icon.load( pixFile )) {
-    QString pixFile = finfo.dirPath(true) + "/" + finfo.baseName() + ".png";
+    QString pixFile = finfo.dirPath(true) + '/' + finfo.baseName() + ".png";
     m_icon.load( pixFile );
   }
 
--- trunk/koffice/kivio/kiviopart/ui/kivioaddstencilsetpanel.cpp #613597:613598
 @ -115,7 +115,7  @
           li->setPixmap(0, loadIcon("icon", colFInfo->absoluteFilePath()));
         }
         
-        loadStencilSet(li, dir + "/" + colFInfo->fileName());
+        loadStencilSet(li, dir + '/' + colFInfo->fileName());
       }
       
       ++colIt;
 @ -138,7 +138,7  @
       if( setFInfo->fileName() != ".." && setFInfo->fileName() != "." )
       {
         K3ListViewItem* tmp = new K3ListViewItem(li, \
                KivioStencilSpawnerSet::readTitle(setFInfo->absoluteFilePath()),
-          dir + "/" + setFInfo->fileName());
+          dir + '/' + setFInfo->fileName());
         tmp->setPixmap(0, loadIcon("icon", setFInfo->absoluteFilePath()));
 
         if(m_currentDir == setFInfo->absoluteFilePath()) {
 @ -155,10 +155,10  @
   {
     QString fs;
 
-    if( QFile::exists(dir + "/" + name + ".xpm") ) {
-      fs = dir + "/" + name + ".xpm";
-    } else if( QFile::exists(dir + "/" + name + ".png") ) {
-      fs = dir + "/" + name + ".png";
+    if( QFile::exists(dir + '/' + name + ".xpm") ) {
+      fs = dir + '/' + name + ".xpm";
+    } else if( QFile::exists(dir + '/' + name + ".png") ) {
+      fs = dir + '/' + name + ".png";
     } else {
       return QPixmap();
     }
 @ -188,7 +188,7  @
 
     for(QStringList::Iterator it = files.begin(); it != files.end(); ++it)
     {
-      spawner = spawnerSet->loadFile(m_currentDir + "/" + (*it));
+      spawner = spawnerSet->loadFile(m_currentDir + '/' + (*it));
 
       if(spawner) {
         stencil = spawner->newStencil();
--- trunk/koffice/kplato/kptview.cc #613597:613598
 @ -1000,7 +1000,7  @
     QAction *ca = 0;
     foreach( Schedule *sch, getProject().schedules().values() ) {
         if ( ! sch->isDeleted() ) {
-            QString n = sch->name() + " (" + sch->typeToString( true ) + ")";
+            QString n = sch->name() + " (" + sch->typeToString( true ) + ')';
             KAction *act = new KToggleAction( n, actionCollection(), n );
             m_scheduleActions.insert( act, sch );
             m_scheduleActionGroup->addAction( act );
 @ -1850,7 +1850,7  @
     if ( s == 0 || getProject().notScheduled() ) {
         m_estlabel->setText( i18n( "Not scheduled" ) );
     } else {
-        m_estlabel->setText( s->name() + " ("+ s->typeToString( true ) + ")"  );
+        m_estlabel->setText( s->name() + " ("+ s->typeToString( true ) + ')'  );
     }
 }
 
--- trunk/koffice/libs/flake/KoCreatePathTool.cpp #613597:613598
 @ -112,6 +112,7  @
 
 void KoCreatePathTool::mouseDoubleClickEvent( KoPointerEvent *event )
 {
+    Q_UNUSED(event);
     //qDebug() << "KoCreatePathTool::mouseDoubleClickEvent" << m_shape << "point = " \
<< event->point;  if ( m_shape )
     {
--- trunk/koffice/libs/flake/KoSelection.cpp #613597:613598
 @ -38,6 +38,9  @
 
 void KoSelection::paint( QPainter &painter, const KoViewConverter &converter)
 {
+    Q_UNUSED(painter);
+    Q_UNUSED(converter);
+
 /*    if ( count() == 0 )
         return;
     painter.setRenderHint( QPainter::Antialiasing, false );
--- trunk/koffice/libs/kofficecore/KoOasisStyles.cpp #613597:613598
 @ -658,6 +658,8  @
 QString KoOasisStyles::saveOasisTimeStyle( KoGenStyles &mainStyles, const QString & \
                _format, bool klocaleFormat,
                                            const QString & _prefix, const QString & \
_suffix )  {
+    Q_UNUSED(_prefix);
+    Q_UNUSED(_suffix);
     kDebug(30003)<<"QString KoOasisStyles::saveOasisTimeStyle( KoGenStyles \
&mainStyles, const QString & _format ) :"<<_format<<endl;  QString format( _format );
     KoGenStyle currentStyle( KoGenStyle::STYLE_NUMERIC_TIME );
 @ -808,6 +810,8  @
 QString KoOasisStyles::saveOasisDateStyle( KoGenStyles &mainStyles, const QString & \
                _format, bool klocaleFormat,
                                            const QString & _prefix, const QString & \
_suffix )  {
+    Q_UNUSED(_prefix);
+    Q_UNUSED(_suffix);
     kDebug(30003)<<"QString KoOasisStyles::saveOasisDateStyle( KoGenStyles \
&mainStyles, const QString & _format ) :"<<_format<<endl;  QString format( _format );
 
--- trunk/koffice/libs/kofficeui/KoPageLayoutDia.cpp #613597:613598
 @ -135,6 +135,7  @
 
 void KoPagePreview::resizeEvent ( QResizeEvent * event )
 {
+    Q_UNUSED(event);
     updateZoomedSize();
 }
 
--- trunk/koffice/libs/kofficeui/KoRuler.cpp #613597:613598
 @ -263,7 +263,7  @
             }
         }
     } else {
-        int textOffset = 0;
+        //int textOffset = 0;
 
         if(d->m_offset > 0) {
             painter.translate(0, d->m_offset);
--- trunk/koffice/libs/kopainter/KoDualColorButton.cpp #613597:613598
 @ -154,6 +154,7  @
 
 void KoDualColorButton::dropEvent( QDropEvent *event )
 {
+    Q_UNUSED(event);
 /*  QColor color = KColorMimeData::fromMimeData( event->mimeData() );
 
   if ( color.isValid() ) {
--- trunk/koffice/libs/kopainter/kogradientmanager.cc #613597:613598
 @ -97,7 +97,7  @
 	file->close();
 
 	QTextStream fileContent(m_data, QIODevice::ReadOnly);
-	fileContent.setEncoding(QTextStream::UnicodeUTF8);
+	fileContent.setAutoDetectUnicode(true);
 
 	QString header = fileContent.readLine();
 
 @ -253,7 +253,7  @
 
 	// load stops
 	QDomNodeList list = element.childNodes();
-	for( uint i = 0; i < list.count(); ++i )
+	for( int i = 0; i < list.count(); ++i )
 	{
 		if( list.item( i ).isElement() )
 		{
--- trunk/koffice/libs/kross/python/cxx/cxx_extensions.cxx #613597:613598
 @ -1317,7 +1317,7  @
 void ExtensionExceptionType::init( ExtensionModuleBase &module, const std::string& \
name )  {
 	std::string module_name( module.fullName() );
-	module_name += ".";
+	module_name += '.';
 	module_name += name;
 
 	set( PyErr_NewException( const_cast<char *>( module_name.c_str() ), NULL, NULL ), \
true );  @ -1326,7 +1326,7  @
 void ExtensionExceptionType::init( ExtensionModuleBase &module, const std::string& \
name, ExtensionExceptionType &parent)  {
  	std::string module_name( module.fullName() );
- 	module_name += ".";
+ 	module_name += '.';
  	module_name += name;
 
 	set( PyErr_NewException( const_cast<char *>( module_name.c_str() ), parent.ptr(), \
                NULL ), true );
--- trunk/koffice/libs/kross/python/pythonscript.cpp #613597:613598
 @ -265,7 +265,7  @
     #ifdef KROSS_PYTHON_SCRIPT_CALLFUNC_DEBUG
         QString s;
         foreach(QVariant v, args)
-            s += v.toString() + ",";
+            s += v.toString() + ',';
         krossdebug( QString("PythonScript::callFunction() name=%1 \
args=[%2]").arg(name).arg(s) );  #endif
____________________________________
koffice mailing list
koffice@kde.org
To unsubscribe please visit:
https://mail.kde.org/mailman/listinfo/koffice


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

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