sw/qa/extras/uiwriter/uiwriter.cxx |    5 +++++
 sw/source/uibase/app/docsh.cxx     |    3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit ddaca012d2715e5270dfeef43452e07aa7a9508c
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Thu Jun 11 12:43:17 2015 +0200

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

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index d368f94..b416777 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 1901355..55e3b74 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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to