Kaydet (Commit) ddaca012 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwDocShell: re-store embedded data source def only when location changes

Change-Id: Ic667491026e9e88a72253aa079c77b8079cac588
üst 3bd57cc2
...@@ -1091,6 +1091,11 @@ void SwUiWriterTest::testEmbeddedDataSource() ...@@ -1091,6 +1091,11 @@ void SwUiWriterTest::testEmbeddedDataSource()
mxComponent->dispose(); mxComponent->dispose();
mxComponent.clear(); mxComponent.clear();
CPPUNIT_ASSERT(!xDatabaseContext->hasByName("calc-data-source")); 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() void SwUiWriterTest::testUnoCursorPointer()
......
...@@ -420,7 +420,8 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium ) ...@@ -420,7 +420,8 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium )
CalcLayoutForOLEObjects(); // format for OLE objets 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, // We have an embedded data source definition, need to re-store it,
// otherwise relative references will break when the new file is in a // otherwise relative references will break when the new file is in a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment