summaryrefslogtreecommitdiff
path: root/sc/source/ui/optdlg
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-11-26 17:42:39 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-11-26 17:42:39 +0000
commit82d45ae2dfd94d2f544f4f420be8001f783f5716 (patch)
tree1b02d596156bea5ed0cccb911bb3f61c38d86457 /sc/source/ui/optdlg
parentdad0110b62f279f41323dfbbf7ce4881a6468d37 (diff)
INTEGRATION: CWS calcprintdlg (1.7.174); FILE MERGED
2007/11/09 17:45:32 tbe 1.7.174.2: #i82071# Flaws in print logic 2007/11/08 11:47:21 pb 1.7.174.1: fix: #i82071# consider new item SID_PRINT_SELECTEDSHEET
Diffstat (limited to 'sc/source/ui/optdlg')
-rw-r--r--sc/source/ui/optdlg/tpprint.cxx34
1 files changed, 25 insertions, 9 deletions
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index 5d6035930a29..f62dfe3ebf4b 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: tpprint.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: rt $ $Date: 2007-04-26 09:54:28 $
+ * last change: $Author: ihi $ $Date: 2007-11-26 18:42:39 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -38,7 +38,7 @@
#undef SC_DLLIMPLEMENTATION
-
+#include <svtools/eitem.hxx>
#include "tpprint.hxx"
#include "printopt.hxx"
@@ -108,8 +108,17 @@ void ScTpPrintOptions::Reset( const SfxItemSet& rCoreSet )
aOptions = SC_MOD()->GetPrintOptions();
}
+ if ( SFX_ITEM_SET == rCoreSet.GetItemState( SID_PRINT_SELECTEDSHEET, FALSE , &pItem ) )
+ {
+ BOOL bChecked = ( (const SfxBoolItem*)pItem )->GetValue();
+ aSelectedSheetsCB.Check( bChecked );
+ }
+ else
+ {
+ aSelectedSheetsCB.Check( !aOptions.GetAllSheets() );
+ }
+
aSkipEmptyPagesCB.Check( aOptions.GetSkipEmpty() );
- aSelectedSheetsCB.Check( !aOptions.GetAllSheets() );
aSkipEmptyPagesCB.SaveValue();
aSelectedSheetsCB.SaveValue();
}
@@ -118,19 +127,26 @@ void ScTpPrintOptions::Reset( const SfxItemSet& rCoreSet )
BOOL ScTpPrintOptions::FillItemSet( SfxItemSet& rCoreAttrs )
{
- if ( aSkipEmptyPagesCB.GetSavedValue() != aSkipEmptyPagesCB.IsChecked()
- || aSelectedSheetsCB.GetSavedValue() != aSelectedSheetsCB.IsChecked() )
+ rCoreAttrs.ClearItem( SID_PRINT_SELECTEDSHEET );
+
+ bool bSkipEmptyChanged = ( aSkipEmptyPagesCB.GetSavedValue() != aSkipEmptyPagesCB.IsChecked() );
+ bool bSelectedSheetsChanged = ( aSelectedSheetsCB.GetSavedValue() != aSelectedSheetsCB.IsChecked() );
+
+ if ( bSkipEmptyChanged || bSelectedSheetsChanged )
{
ScPrintOptions aOpt;
-
aOpt.SetSkipEmpty( aSkipEmptyPagesCB.IsChecked() );
aOpt.SetAllSheets( !aSelectedSheetsCB.IsChecked() );
-
rCoreAttrs.Put( ScTpPrintItem( SID_SCPRINTOPTIONS, aOpt ) );
+ if ( bSelectedSheetsChanged )
+ {
+ rCoreAttrs.Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, aSelectedSheetsCB.IsChecked() ) );
+ }
return TRUE;
}
else
+ {
return FALSE;
+ }
}
-