[Libreoffice-commits] core.git: dbaccess/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Apr 30 06:55:24 PDT 2015
dbaccess/source/core/dataaccess/databasedocument.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 3d69f625fc6387b25f4e0035996a8f4387af2cbc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Apr 30 15:23:29 2015 +0200
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
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 5eab51c..1721287 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 );
}
More information about the Libreoffice-commits
mailing list