summaryrefslogtreecommitdiff
path: root/sw/source/core/ole
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2011-01-03 13:40:23 +0100
committerMikhail Voytenko <mav@openoffice.org>2011-01-03 13:40:23 +0100
commit07fa2a259a3c76b1cadc138d6e4bb23172210347 (patch)
treed6d623fa049f44127d3db430894cc2ab913dd281 /sw/source/core/ole
parentf1dc19695c083ec5f1356a2c082f2c4feb53aa33 (diff)
fwk162: #i115902# review usage of SfxObjectShellRef, SfxObjecShellLock; remove unused some methods
Diffstat (limited to 'sw/source/core/ole')
-rw-r--r--sw/source/core/ole/ndole.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 1cd0fdd02830..db341c9991ba 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -437,16 +437,14 @@ Size SwOLENode::GetTwipSize() const
SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
{
// Falls bereits eine SvPersist-Instanz existiert, nehmen wir diese
- SfxObjectShell* p = pDoc->GetPersist();
- if( !p )
+ SfxObjectShell* pPersistShell = pDoc->GetPersist();
+ if( !pPersistShell )
{
- // TODO/LATER: reicht hier nicht ein EmbeddedObjectContainer? Was passiert mit
- // diesem Dokument?
- ASSERT( pDoc->GetRefForDocShell(),
- "wo ist die Ref-Klasse fuer die DocShell?")
- p = new SwDocShell( pDoc, SFX_CREATE_MODE_INTERNAL );
- *pDoc->GetRefForDocShell() = p;
- p->DoInitNew( NULL );
+ // TODO/LATER: is EmbeddedObjectContainer not enough?
+ // the created document will be closed by pDoc ( should use SfxObjectShellLock )
+ pPersistShell = new SwDocShell( pDoc, SFX_CREATE_MODE_INTERNAL );
+ pDoc->SetTmpDocShell( pPersistShell );
+ pPersistShell->DoInitNew( NULL );
}
// Wir hauen das Ding auf SvPersist-Ebene rein
@@ -454,7 +452,7 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
::rtl::OUString aNewName/*( Sw3Io::UniqueName( p->GetStorage(), "Obj" ) )*/;
SfxObjectShell* pSrc = GetDoc()->GetPersist();
- p->GetEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
+ pPersistShell->GetEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
pSrc->GetEmbeddedObjectContainer(),
pSrc->GetEmbeddedObjectContainer().GetEmbeddedObject( aOLEObj.aName ),
aNewName );