diff options
author | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-03-10 14:21:52 +0100 |
---|---|---|
committer | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-03-10 14:21:52 +0100 |
commit | be5df7cfe68e5cf185ecb9754118a1f067c0deb2 (patch) | |
tree | a837df2f6b23ab9a30c20b93cc72f3cc1de00341 /sw | |
parent | fb3e8f4852851cb6387a523d9aa21f7615df74f4 (diff) |
impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/doc.hxx | 9 | ||||
-rw-r--r-- | sw/source/core/doc/docdraw.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/app/docshini.cxx | 2 |
4 files changed, 28 insertions, 1 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 8ac03ff109bd..a5331ebef810 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -599,6 +599,8 @@ private: sal_Bool mbStartIdleTimer ; // idle timer mode start/stop + bool mbSetDrawDefaults; ; // set draw pool defaults for freshly created documents + static SwAutoCompleteWord *pACmpltWords; // Liste aller Worte fuers AutoComplete //---------------- private Methoden ------------------------------ @@ -2092,6 +2094,13 @@ public: ::sw::UndoManager & GetUndoManager(); ::sw::UndoManager const& GetUndoManager() const; SfxObjectShell* CreateCopy(bool bCallInitNew) const; + + /// must be called only in SwDocShell::InitNew, causes UpdateDrawDefaults to be called when drawing layer is created + void SetDrawDefaults(); + +private: + /// method to set new graphics pool defaults, must only be called by SetDrawDefaults! + void UpdateDrawDefaults(); }; diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 051efd2b0948..1eb27e101c61 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -689,6 +689,8 @@ void SwDoc::InitDrawModel() pLayout->SetDrawPage( pDrawModel->GetPage( 0 ) ); pLayout->GetDrawPage()->SetSize( pLayout->Frm().SSize() ); } + + UpdateDrawDefaults(); } /** method to notify drawing page view about the invisible layers @@ -1081,3 +1083,16 @@ namespace docfunc } // <-- +void SwDoc::SetDrawDefaults() +{ + mbSetDrawDefaults = true; + UpdateDrawDefaults(); +} + +void SwDoc::UpdateDrawDefaults() +{ + // drawing layer defaults that are set for new documents (if InitNew was called) + if ( pDrawModel && mbSetDrawDefaults ) + pDrawModel->SetDrawingLayerPoolDefaults(); +} + diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index cdf031aeb923..c64017875fd5 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -300,7 +300,8 @@ SwDoc::SwDoc() mbProtectForm(false), n32DummyCompatabilityOptions1(0), n32DummyCompatabilityOptions2(0), - mbStartIdleTimer(sal_False) + mbStartIdleTimer(sal_False), + mbSetDrawDefaults(false) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" ); diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 6c8e73931105..17eead88c233 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -351,6 +351,8 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) //#i16874# AutoKerning as default for new documents pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) ); + pDoc->SetDrawDefaults(); + // --> OD 2005-02-10 #i42080# - Due to the several calls of method <SetDefault(..)> // at the document instance, the document is modified. Thus, reset this // status here. Note: In method <SubInitNew()> this is also done. |