diff options
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh.cxx | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index d368f94b1fc4..b416777669eb 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1091,6 +1091,11 @@ void SwUiWriterTest::testEmbeddedDataSource() mxComponent->dispose(); mxComponent.clear(); CPPUNIT_ASSERT(!xDatabaseContext->hasByName("calc-data-source")); + + // Now open again the saved result, and instead of 'save as', just 'save'. + mxComponent = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument"); + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + xStorable->store(); } void SwUiWriterTest::testUnoCursorPointer() diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 190135579344..55e3b7439c06 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -420,7 +420,8 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium ) CalcLayoutForOLEObjects(); // format for OLE objets - if (!m_pDoc->GetDBManager()->getEmbeddedName().isEmpty()) + bool bURLChanged = !GetMedium() || GetMedium()->GetURLObject() != rMedium.GetURLObject(); + if (!m_pDoc->GetDBManager()->getEmbeddedName().isEmpty() && bURLChanged) { // We have an embedded data source definition, need to re-store it, // otherwise relative references will break when the new file is in a |