dbaccess/source/core/dataaccess/databasedocument.cxx | 10 ++++++++++ dbaccess/source/core/dataaccess/databasedocument.hxx | 2 ++ officecfg/registry/data/org/openoffice/Office/Embedding.xcu | 12 ++++++++++++ postprocess/CustomTarget_registry.mk | 1 + 4 files changed, 25 insertions(+)
New commits: commit df44a6f767a1c4ad18e6b5b6638d6699d852ddb7 Author: Miklos Vajna <[email protected]> Date: Wed Apr 29 14:44:57 2015 +0200 officecfg, postprocess: allow embedding of Base documents Don't advertise them on the UI, though. With this, Insert -> Object -> OLE Object -> Create from file can insert a Base document into a Writer document model. Change-Id: I18fdf98af8fb4f8b6ef0c3a910aaefba9e516dfd diff --git a/officecfg/registry/data/org/openoffice/Office/Embedding.xcu b/officecfg/registry/data/org/openoffice/Office/Embedding.xcu index e39af5d..2352f41 100644 --- a/officecfg/registry/data/org/openoffice/Office/Embedding.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Embedding.xcu @@ -255,6 +255,18 @@ <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS</value> </prop> </node> + <node oor:name="F203786B-A78D-4E89-9D3D-94A108989E7F" oor:op="replace" install:module="base"> + <prop oor:name="ObjectFactory"> + <value>com.sun.star.embed.OOoEmbeddedObjectFactory</value> + </prop> + <prop oor:name="ObjectDocumentServiceName"> + <value>com.sun.star.sdb.OfficeDatabaseDocument</value> + </prop> + <prop oor:name="ObjectMiscStatus"/> + <prop oor:name="ObjectVerbs"> + <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS</value> + </prop> + </node> <node oor:name="D7896D52-B7AF-4820-9DFE-D404D015960F" oor:op="replace" install:module="reportbuilder"> <prop oor:name="ObjectFactory"> <value>com.sun.star.embed.OOoEmbeddedObjectFactory</value> diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk index e12640f..6168c59 100644 --- a/postprocess/CustomTarget_registry.mk +++ b/postprocess/CustomTarget_registry.mk @@ -41,6 +41,7 @@ postprocess_FILES_base := \ $(call gb_XcuFilterOthersTarget_get_target,fcfg_database_others.xcu) \ $(call gb_XcuFilterTypesTarget_get_target,fcfg_database_types.xcu) \ $(postprocess_MOD)/org/openoffice/Office/Common-base.xcu \ + $(postprocess_MOD)/org/openoffice/Office/Embedding-base.xcu \ $(postprocess_MOD)/org/openoffice/Setup-base.xcu postprocess_DEPS_calc := main commit fa2304aef2ea65cbbb15e3694a61c05999032d20 Author: Miklos Vajna <[email protected]> Date: Wed Apr 29 14:44:16 2015 +0200 dbaccess: attachResource() and load() calls are swapped in case of embedding Change-Id: I34600202f0f5c988222f7d4f305ba90df09cd614 diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 5062648..5eab51c 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -173,6 +173,7 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& ,m_bClosing( false ) ,m_bAllowDocumentScripting( false ) ,m_bHasBeenRecovered( false ) + ,m_bEmbedded(false) { OSL_TRACE( "DD: ctor: %p: %p", this, m_pImpl.get() ); @@ -593,6 +594,9 @@ void SAL_CALL ODatabaseDocument::load( const Sequence< PropertyValue >& _Argumen // note that we do *not* call impl_setInitialized() here: The initialization is only complete // when the XModel::attachResource has been called, not sooner. + // however, in case of embedding, XModel::attachResource is already called. + if (m_bEmbedded) + impl_setInitialized(); impl_setModified_nothrow( false, aGuard ); // <- SYNCHRONIZED @@ -756,6 +760,12 @@ void SAL_CALL ODatabaseDocument::recoverFromFile( const OUString& i_SourceLocati // XModel sal_Bool SAL_CALL ODatabaseDocument::attachResource( const OUString& _rURL, const Sequence< PropertyValue >& _rArguments ) throw (RuntimeException, std::exception) { + if (_rURL.isEmpty() && _rArguments.getLength() == 1 && _rArguments[0].Name == "SetEmbedded") + { + m_bEmbedded = true; + return true; + } + DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit ); bool bRet = false; try diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx index 5b2b3e8..693ad29 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.hxx +++ b/dbaccess/source/core/dataaccess/databasedocument.hxx @@ -200,6 +200,8 @@ class ODatabaseDocument :public ModelDependentComponent // ModelDepe bool m_bClosing; bool m_bAllowDocumentScripting; bool m_bHasBeenRecovered; + /// If XModel::attachResource() was called to inform us that the document is embedded into an other one. + bool m_bEmbedded; enum StoreType { SAVE, SAVE_AS }; /** stores the document to the given URL, rebases it to the respective new storage, if necessary, resets _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
