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

List:       koffice-devel
Subject:    [PATCH] #2 KoPageFormat::formatFromString changes for KSpread
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2001-10-30 19:29:21
[Download RAW message or body]

The attached patch is for the file kspread/kspread_doc.cc

It only works with my previous patch for lib/kofficeui/koGlobal.cc

If this patch is accepted, I will send another patch to clean up the method 
KSpreadDoc::setPaperLayout


["patch_kspread_doc_cc.txt" (text/x-diff)]

--- kspread_doc.cc.orig	Wed Oct 17 21:57:16 2001
+++ kspread_doc.cc	Tue Oct 30 15:35:27 2001
@@ -458,26 +458,25 @@
 void KSpreadDoc::setPaperLayout( float _leftBorder, float _topBorder, float \
                _rightBorder, float _bottomBorder,
                               const char * _paper, const char* _orientation )
 {
-    KoFormat f = paperFormat();
     KoOrientation o = orientation();
 
     QString paper( _paper );
-    if ( paper[0].isDigit() ) // Custom format
+
+    KoFormat f = KoPageFormat::formatFromString( paper );
+
+    if ( f == PG_CUSTOM ) // Custom format
     {
       m_paperWidth = 0.0;
       m_paperHeight = 0.0;
-      f = PG_CUSTOM;
       m_paperWidth = atof( _paper );
       int i = paper.find( 'x' );
       if ( i != -1 )
-        m_paperHeight = paper.toDouble() + i + 1;
+        m_paperHeight = paper.toDouble() + i + 1; // FIXME: that is surely not what \
the programmer has meant!  if ( m_paperWidth < 10.0 )
         m_paperWidth = PG_A4_WIDTH;
       if ( m_paperHeight < 10.0 )
         m_paperWidth = PG_A4_HEIGHT;
     }
-    else
-        f = KoPageFormat::formatFromString( paper );
 
     if ( strcmp( "Portrait", _orientation ) == 0L )
         o = PG_PORTRAIT;


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel


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

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