summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-04-29 14:44:16 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-29 15:15:38 +0200
commitfa2304aef2ea65cbbb15e3694a61c05999032d20 (patch)
tree6641eabf6cc4ac9de10bb0e7f0bf7e5cbbdbf59d /dbaccess
parentc9af632056fedcf9327ba23aafbe4b0300b1abae (diff)
dbaccess: attachResource() and load() calls are swapped in case of embedding
Change-Id: I34600202f0f5c988222f7d4f305ba90df09cd614
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx10
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.hxx2
2 files changed, 12 insertions, 0 deletions
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 5062648b9e3f..5eab51cdd71a 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 5b2b3e839e39..693ad296f7c8 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