summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/sfxbasemodel.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/sfxbasemodel.cxx')
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx33
1 files changed, 22 insertions, 11 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 4793f8d074..a830b0067b 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2632,17 +2632,28 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
if ( bCopyTo )
{
xOldDocProps = getDocumentProperties();
- xOldDocInfo = getDocumentInfo();
- Reference<util::XCloneable> xCloneable(xOldDocInfo,
- UNO_QUERY_THROW);
- Reference<document::XDocumentInfo> xNewDocInfo(
- xCloneable->createClone(), UNO_QUERY_THROW);
- Reference<document::XDocumentPropertiesSupplier> xDPS(
- xNewDocInfo, UNO_QUERY_THROW);
- Reference<document::XDocumentProperties> xNewDocProps(
- xDPS->getDocumentProperties());
- m_pData->m_xDocumentProperties = xNewDocProps;
- m_pData->m_xDocumentInfo = xNewDocInfo;
+ if (m_pData->m_xDocumentInfo.is())
+ {
+ xOldDocInfo = getDocumentInfo();
+ const Reference<util::XCloneable> xCloneable(xOldDocInfo,
+ UNO_QUERY_THROW);
+ const Reference<document::XDocumentInfo> xNewDocInfo(
+ xCloneable->createClone(), UNO_QUERY_THROW);
+ const Reference<document::XDocumentPropertiesSupplier> xDPS(
+ xNewDocInfo, UNO_QUERY_THROW);
+ const Reference<document::XDocumentProperties> xNewDocProps(
+ xDPS->getDocumentProperties());
+ m_pData->m_xDocumentProperties = xNewDocProps;
+ m_pData->m_xDocumentInfo = xNewDocInfo;
+ }
+ else // try not to create DocumentInfo if it does not exist...
+ {
+ const Reference<util::XCloneable> xCloneable(xOldDocProps,
+ UNO_QUERY_THROW);
+ const Reference<document::XDocumentProperties> xNewDocProps(
+ xCloneable->createClone(), UNO_QUERY_THROW);
+ m_pData->m_xDocumentProperties = xNewDocProps;
+ }
}
sal_Bool bRet = m_pData->m_pObjectShell->APISaveAs_Impl( sURL, aParams );