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

List:       koffice-devel
Subject:    patch to fix bug #44928
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2002-08-29 7:52:41
[Download RAW message or body]

Here is a (bit nasty) workaround to fix KSpread bug #44928 (printing doesn't 
fill the page).

Problem: open Page Layout Dialog, change bottom border to 0, then click OK 
RIGHT AFTERWARDS. Then if you open the dialog again, bottom border is not 0. 
It's still the previous value sitting in there.

Reason: in kspread_dlg_paperlayout.cc, borders are taken from 
KoPageLayoutDia::layout(). when bottom border is changed and right-after OK 
button is clicked, KoPageLayoutDia::bottomChanged() is not emitted correctly 
(at least before calling KoPageLayoutDia::layout()). Hence, the layout that 
is passed is the previous value. (Perhaps problem in KDoubleNumInput ?)

Possible solution: called bottomChanged() and friends before taking the layout 
from KoPageLayoutDia::layout(). Note the use of #define trick since they're 
private. Proper solution would be making bottomChanged() and friends 
protected so KSpreadPaperLayout can easily call them.

Please review.
["print.patch" (text/x-diff)]

Index: kspread_dlg_paperlayout.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_dlg_paperlayout.cc,v
retrieving revision 1.3
diff -u -3 -p -r1.3 kspread_dlg_paperlayout.cc
--- kspread_dlg_paperlayout.cc	2002/07/06 14:42:03	1.3
+++ kspread_dlg_paperlayout.cc	2002/08/29 08:59:44
@@ -123,6 +123,12 @@ void KSpreadPaperLayout::slotOk()
         m_table->doc()->undoBuffer()->appendUndo( undo );
     }
 
+    // get new values for borders
+    leftChanged();
+    rightChanged();
+    topChanged();
+    bottomChanged();
+
     KoPageLayout pl = getLayout();
     KoHeadFoot hf = getHeadFoot();
     KoUnit::Unit unit = m_table->doc()->getUnit();
Index: kspread_dlg_paperlayout.h
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_dlg_paperlayout.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 kspread_dlg_paperlayout.h
--- kspread_dlg_paperlayout.h	2002/07/06 14:18:48	1.2
+++ kspread_dlg_paperlayout.h	2002/08/29 08:59:44
@@ -20,6 +20,7 @@
 #define __kspread_dlg_paperlayout__
 
 #include <kdialogbase.h>
+#define private protected
 #include <koPageLayoutDia.h>
 class KSpreadTable;
 class QCheckBox;

_______________________________________________
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