diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2010-12-01 15:29:44 +0100 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2010-12-01 15:29:44 +0100 |
commit | b927224032e0ca68961cb6730c02de04f56633a5 (patch) | |
tree | bca66047ae52646445c6d6343a4b892d0c0b93b3 /embeddedobj/source/commonembedding | |
parent | fwk160: Sync to DEV300_m94 (diff) | |
download | core-b927224032e0ca68961cb6730c02de04f56633a5.tar.gz core-b927224032e0ca68961cb6730c02de04f56633a5.zip |
fwk160: #i107138# fix the saveCompleted handling
Diffstat (limited to 'embeddedobj/source/commonembedding')
-rw-r--r-- | embeddedobj/source/commonembedding/persistence.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 0312d28315a6..f6ac51c0ebe6 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -978,7 +978,21 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( if ( m_bWaitSaveCompleted ) { if ( nEntryConnectionMode == embed::EntryInitModes::NO_INIT ) - saveCompleted( ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ) ); + { + // saveCompleted is expected, handle it accordingly + if ( m_xNewParentStorage == xStorage && m_aNewEntryName.equals( sEntName ) ) + { + saveCompleted( sal_True ); + return; + } + + // if a completely different entry is provided, switch first back to the old persistence in saveCompleted + // and then switch to the target persistence + sal_Bool bSwitchFurther = ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ); + saveCompleted( sal_False ); + if ( !bSwitchFurther ) + return; + } else throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object waits for saveCompleted() call!\n" ), |