dbaccess/source/core/dataaccess/datasource.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 9ceeb4619ba762c47589023d99c43c774caab441
Author: Tamas Bunth <tamas.bu...@collabora.co.uk>
Date:   Tue Jun 26 13:45:40 2018 +0200

    HSQLDB Migration: overwrite backup xml
    
    Change-Id: I080568f2d278e8a7153188497e3987217d9d188f
    Reviewed-on: https://gerrit.libreoffice.org/56464
    Tested-by: Jenkins
    Reviewed-by: Tamás Bunth <btom...@gmail.com>

diff --git a/dbaccess/source/core/dataaccess/datasource.cxx 
b/dbaccess/source/core/dataaccess/datasource.cxx
index 29d5816bc043..597c5a6d560b 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -599,8 +599,12 @@ Reference< XConnection > 
ODatabaseSource::buildLowLevelConnection(const OUString
         {
             // back up content xml file if migration was successful
             Reference<XStorage> xRootStorage = 
m_pImpl->getOrCreateRootStorage();
+
+            constexpr char BACKUP_XML_NAME[] = "content_before_migration.xml";
+            if(xRootStorage->isStreamElement(BACKUP_XML_NAME))
+                xRootStorage->removeElement(BACKUP_XML_NAME);
             xRootStorage->copyElementTo("content.xml", xRootStorage,
-                    "content_before_migration.xml");
+                BACKUP_XML_NAME);
 
             m_pImpl->m_sConnectURL = "sdbc:embedded:firebird";
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to