diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-30 15:23:29 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-30 15:54:54 +0200 |
commit | 3d69f625fc6387b25f4e0035996a8f4387af2cbc (patch) | |
tree | 5f2ea25ddf88616f68a1c330946dd2483c43ed07 /dbaccess | |
parent | 6ac306587437b1e6c2677f6438d94a8d9529237f (diff) |
dbaccess: allow storing to storage without a root one
In case of embedding a Base document, there is no root storage and
attachResource() is not called with a parameter to be able to make one,
all we can (and have to) do is to store the component to the target
store given as a parameter to storeToStorage().
With this, a .odb embedded in a .odt no longer lost on export. Import is
still broken, though.
Change-Id: I1d92a1d28f27f49609ef70fbf16effb592b9edf5
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/databasedocument.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 5eab51cdd71a..172128732ba8 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1233,8 +1233,9 @@ void ODatabaseDocument::impl_storeToStorage_throw( const Reference< XStorage >& // copy own storage to target storage if ( impl_isInitialized() ) { - Reference< XStorage > xCurrentStorage( m_pImpl->getOrCreateRootStorage(), UNO_QUERY_THROW ); - if ( xCurrentStorage != _rxTargetStorage ) + Reference< XStorage > xCurrentStorage = m_pImpl->getOrCreateRootStorage(); + // Root storage may be empty in case of embedding. + if ( xCurrentStorage.is() && xCurrentStorage != _rxTargetStorage ) xCurrentStorage->copyToStorage( _rxTargetStorage ); } |