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

List:       kde-commits
Subject:    koffice/kspread
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2005-01-31 22:45:28
Message-ID: 20050131224528.0B3C01D039 () office ! kde ! org
[Download RAW message or body]

CVS commit by ariya: 

prevent KFontAction to annoy Fontconfig, this will fix the crash 
when starting from a template

BUG: 59291


  M +14 -1     kspread_view.cc   1.801


--- koffice/kspread/kspread_view.cc  #1.800:1.801
@@ -58,4 +58,5 @@
 #include <kconfig.h>
 #include <kfind.h>
+#include <kfontdialog.h>
 #include <kreplace.h>
 #include <kfinddialog.h>
@@ -1439,6 +1440,18 @@ void ViewPrivate::updateButton( KSpreadC
     toolbarLock = TRUE;
 
+    // workaround for bug #59291 (crash upon starting from template)
+    // certain Qt and Fontconfig combination fail miserably if can not 
+    // find the font name (e.g. not installed in the system)
+    QStringList fontList;
+    KFontChooser::getFontList( fontList, 0 );
+    QString fontFamily = cell->textFontFamily( column,row );
+    for ( QStringList::Iterator it = fontList.begin(); it != fontList.end(); ++it )
+      if ((*it).lower() == fontFamily.lower())
+      {
+        actions->selectFont->setFont( fontFamily );
+        break;
+      }
+    
     actions->selectFontSize->setFontSize( cell->textFontSize( column, row ) );
-    actions->selectFont->setFont( cell->textFontFamily( column,row ) );
     actions->bold->setChecked( cell->textFontBold( column, row ) );
     actions->italic->setChecked( cell->textFontItalic(  column, row) );


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

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