diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-09-10 18:42:41 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-09-10 18:45:23 +0200 |
commit | f3d791f7545d7eb1c518dca80037e76586a11e86 (patch) | |
tree | c4926ac7dc4c295bd378676bdc80caa1ad750112 /sw/source/uibase | |
parent | 71f75fcac9d3696010f7cda16115c4392559ff4b (diff) |
sw: [loplugin:externandnotdefined]
It turns out that document compare / merge and master document
insert file are all the callers of SwFindDocShell() so move the fix-up
there...
Change-Id: I912a464c3acab8d0adb7b5b659d62f629a15cb70
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 38adecf52f48..5caaaf7dc655 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1488,6 +1488,15 @@ SfxInPlaceClient* SwDocShell::GetIPClient( const ::svt::EmbeddedObjectRef& xObjR return pResult; } +static bool lcl_MergePortions(SwNode *const& pNode, void *) +{ + if (pNode->IsTxtNode()) + { + pNode->GetTxtNode()->FileLoadedInitHints(); + } + return true; +} + int SwFindDocShell( SfxObjectShellRef& xDocSh, SfxObjectShellLock& xLockRef, const OUString& rFileName, @@ -1572,10 +1581,15 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, pMed->SetFilter( pSfxFlt ); // If the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure - xLockRef = new SwDocShell( SFX_CREATE_MODE_INTERNAL ); + SwDocShell *const pNew(new SwDocShell(SFX_CREATE_MODE_INTERNAL)); + xLockRef = pNew; xDocSh = (SfxObjectShell*)xLockRef; if( xDocSh->DoLoad( pMed ) ) + { + SwDoc const& rDoc(*pNew->GetDoc()); + const_cast<SwDoc&>(rDoc).GetNodes().ForEach(&lcl_MergePortions); return 2; + } } } |