summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-09-20 12:48:17 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-09-20 12:48:17 +0000
commit1f490073cedbc0be1c99514abb919226ad2fcd15 (patch)
tree2803835f096590b78b1cc3fe24401fdf66ebf07e
parentaea104474498c362aba48bb06f9a695e3c8ef72d (diff)
INTEGRATION: CWS calc21 (1.3.122); FILE MERGED
2004/08/31 11:46:42 dr 1.3.122.1: #103832# apply page styles to several sheets
-rw-r--r--sc/source/ui/undo/undostyl.cxx39
1 files changed, 24 insertions, 15 deletions
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index 5d3a812e5..6dbd20b08 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: undostyl.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obo $ $Date: 2004-06-04 11:52:00 $
+ * last change: $Author: rt $ $Date: 2004-09-20 13:48:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -281,13 +281,15 @@ BOOL ScUndoModifyStyle::CanRepeat(SfxRepeatTarget& rTarget) const
//
// apply page style
//
+ScUndoApplyPageStyle::ApplyStyleEntry::ApplyStyleEntry( SCTAB nTab, const String& rOldStyle ) :
+ mnTab( nTab ),
+ maOldStyle( rOldStyle )
+{
+}
-ScUndoApplyPageStyle::ScUndoApplyPageStyle( ScDocShell* pDocSh, SCTAB nT,
- const String& rOld, const String& rNew ) :
+ScUndoApplyPageStyle::ScUndoApplyPageStyle( ScDocShell* pDocSh, const String& rNewStyle ) :
ScSimpleUndo( pDocSh ),
- nTab( nT ),
- aOldStyle( rOld ),
- aNewStyle( rNew )
+ maNewStyle( rNewStyle )
{
}
@@ -295,6 +297,11 @@ ScUndoApplyPageStyle::~ScUndoApplyPageStyle()
{
}
+void ScUndoApplyPageStyle::AddSheetAction( SCTAB nTab, const String& rOldStyle )
+{
+ maEntries.push_back( ApplyStyleEntry( nTab, rOldStyle ) );
+}
+
String ScUndoApplyPageStyle::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_APPLYPAGESTYLE );
@@ -303,20 +310,22 @@ String ScUndoApplyPageStyle::GetComment() const
void ScUndoApplyPageStyle::Undo()
{
BeginUndo();
-
- pDocShell->GetDocument()->SetPageStyle( nTab, aOldStyle );
-
- ScPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab ).UpdatePages();
+ for( ApplyStyleVec::const_iterator aIt = maEntries.begin(), aEnd = maEntries.end(); aIt != aEnd; ++aIt )
+ {
+ pDocShell->GetDocument()->SetPageStyle( aIt->mnTab, aIt->maOldStyle );
+ ScPrintFunc( pDocShell, pDocShell->GetPrinter(), aIt->mnTab ).UpdatePages();
+ }
EndUndo();
}
void ScUndoApplyPageStyle::Redo()
{
BeginRedo();
-
- pDocShell->GetDocument()->SetPageStyle( nTab, aNewStyle );
-
- ScPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab ).UpdatePages();
+ for( ApplyStyleVec::const_iterator aIt = maEntries.begin(), aEnd = maEntries.end(); aIt != aEnd; ++aIt )
+ {
+ pDocShell->GetDocument()->SetPageStyle( aIt->mnTab, maNewStyle );
+ ScPrintFunc( pDocShell, pDocShell->GetPrinter(), aIt->mnTab ).UpdatePages();
+ }
EndRedo();
}