diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-12-23 10:01:58 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-12-23 10:01:58 +0100 |
commit | 48de44881b95b2ce90759e0485d3a96fe1c1f4db (patch) | |
tree | 9616f3de0aa7b09e04de84f07534ccc05ef412de /embeddedobj | |
parent | eb77ace518782bcbc0ac29c03b58ca3811e25cf8 (diff) | |
parent | 794c821e4d48c34aa376cdc7b6ab2cb029d9574d (diff) |
undoapi: merged after pulling DEV300_m96. Most probably still not buildable:A number of changes which happened in the CWS need to be redone due to the new build system
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/prj/build.lst | 2 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/miscobj.cxx | 9 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/persistence.cxx | 22 |
3 files changed, 28 insertions, 5 deletions
diff --git a/embeddedobj/prj/build.lst b/embeddedobj/prj/build.lst index a61305e19221..c2f366c4deec 100644 --- a/embeddedobj/prj/build.lst +++ b/embeddedobj/prj/build.lst @@ -1,4 +1,4 @@ -eo embeddedobj : offuh sal cppu cppuhelper comphelper tools unotools vos NULL +eo embeddedobj : offuh sal cppu cppuhelper comphelper tools unotools vos LIBXSLT:libxslt NULL eo embeddedobj usr1 - all eo_mkout NULL eo embeddedobj\inc nmake - all eo_inc NULL eo embeddedobj\source\commonembedding nmake - all eo_commonembed eo_inc NULL diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index 9aa7df919e3e..f4c0c90162ed 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -39,6 +39,7 @@ #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/interfacecontainer.h> +#include <comphelper/mimeconfighelper.hxx> #include "closepreventer.hxx" #include "intercept.hxx" @@ -240,6 +241,14 @@ void OCommonEmbeddedObject::LinkInit_Impl( OSL_ENSURE( m_aLinkURL.getLength() && m_aLinkFilterName.getLength(), "Filter and URL must be provided!\n" ); + m_bReadOnly = sal_True; + if ( m_aLinkFilterName.getLength() ) + { + ::comphelper::MimeConfigurationHelper aHelper( m_xFactory ); + ::rtl::OUString aExportFilterName = aHelper.GetExportFilterFromImportFilter( m_aLinkFilterName ); + m_bReadOnly = !( aExportFilterName.equals( m_aLinkFilterName ) ); + } + m_aDocMediaDescriptor = GetValuableArgs_Impl( aMediaDescr, sal_False ); uno::Reference< frame::XDispatchProviderInterceptor > xDispatchInterceptor; diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 0312d28315a6..6929f93d9c7b 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -229,11 +229,11 @@ static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference< } catch( const uno::Exception& ) { - // some of our embedded object implementations (in particular chart) do neither support - // the EmbeddedObject, nor the EmbeddedScriptSupport argument. Also, they do not support - // XInitialization, which means the default factory from cppuhelper will throw an + // if an embedded object implementation does not support XInitialization, + // the default factory from cppuhelper will throw an // IllegalArgumentException when we try to create the instance with arguments. // Okay, so we fall back to creating the instance without any arguments. + OSL_ASSERT("Consider implementing interface XInitialization to avoid duplicate construction"); xDocument = _rxFactory->createInstance( _rDocumentServiceName ); } @@ -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" ), |