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 | |
parent | 101cf8871e3bd135ae45f76fdfb69f6392d0fcbf (diff) |
fwk160: #i107138# fix the saveCompleted handling
Diffstat (limited to 'embeddedobj')
-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" ), |