diff options
author | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-12-06 03:27:48 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-12-06 09:39:12 +0100 |
commit | b97726f4b66aa85db8cb2ab27b8413066930cf4f (patch) | |
tree | d7b876c4055f632abf07364b40f48579f3f632fa /sw | |
parent | impress210: #i41995# fixed import of path animation from sxi files (diff) | |
download | core-b97726f4b66aa85db8cb2ab27b8413066930cf4f.tar.gz core-b97726f4b66aa85db8cb2ab27b8413066930cf4f.zip |
impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents
# HG changeset patch
# User Christian Lippka ORACLE <christian.lippka@oracle.com>
# Date 1299763312 -3600
# Node ID 6b1140cdac81a77836e5be80033f328a0956c94a
# Parent 8edc33ef50a3b6ebbc4e88d574b6b1ba57b1dbaa
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 7bd5e2dd9abe..b891b4ec85d1 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -591,6 +591,8 @@ private: sal_Bool mbStartIdleTimer; // idle timer mode start/stop + bool mbSetDrawDefaults; // set draw pool defaults for freshly created documents + static SwAutoCompleteWord *pACmpltWords; // List of all words for AutoComplete //---------------- private methods ------------------------------ @@ -2043,6 +2045,13 @@ public: */ void dumpAsXml( xmlTextWriterPtr writer = NULL ); #endif + + /// 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(); }; // This method is called in Dtor of SwDoc and deletes cache of ContourObjects. diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 75c90adf81e9..2d5671c41f73 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -658,6 +658,8 @@ void SwDoc::InitDrawModel() pViewSh = (ViewShell*)pViewSh->GetNext(); }while( pViewSh != pCurrentView ); } + + UpdateDrawDefaults(); } /** method to notify drawing page view about the invisible layers */ @@ -1034,4 +1036,17 @@ 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(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 9587561953ad..cba769405977 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -279,7 +279,8 @@ SwDoc::SwDoc() mbLastBrowseMode( 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 98eb84865095..8321abd82adc 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -339,6 +339,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(); + // #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. |