summaryrefslogtreecommitdiff
path: root/sw/source/ui/app/apphdl.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-12-22 12:44:24 +0100
committerMichael Stahl <mst@openoffice.org>2010-12-22 12:44:24 +0100
commitb9cdf2916f3b5bba0e1eaefb176e5e36cf472b00 (patch)
treea7dbb459cd9ffb216b2dcb0c95f1b049ba9d2794 /sw/source/ui/app/apphdl.cxx
parentf9ab560c8b9bb08d3ad7e6b72ea8a8ecbedcdf47 (diff)
sw34bf03: #i116192#: fix regression:
SwDoc::SetFixFields must be called when creating document from template. apparently the SFX_EVENT_DOCCREATED event is not sent in this case. so use SFX_EVENT_LOADFINISHED and check whether the medium has a template.
Diffstat (limited to 'sw/source/ui/app/apphdl.cxx')
-rw-r--r--sw/source/ui/app/apphdl.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index ed4d630de6c1..f24f806a3638 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -701,12 +701,22 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
SwWrtShell* pWrtSh = pDocSh ? pDocSh->GetWrtShell() : 0;
switch( rEvHint.GetEventId() )
{
- case SFX_EVENT_DOCCREATED:
+ case SFX_EVENT_LOADFINISHED:
OSL_ASSERT(!pWrtSh);
- pDocSh->GetDoc()->SetFixFields(false, 0);
+ // if it is a new document created from a template,
+ // update fixed fields
+ if (pDocSh->GetMedium())
+ {
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(),
+ pTemplateItem, SfxBoolItem,
+ SID_TEMPLATE, sal_False);
+ if (pTemplateItem && pTemplateItem->GetValue())
+ {
+ pDocSh->GetDoc()->SetFixFields(false, 0);
+ }
+ }
break;
case SFX_EVENT_CREATEDOC:
- // alle FIX-Date/Time Felder auf akt. setzen
if( pWrtSh )
{
SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);