[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 26 10:46:53 UTC 2018


 sc/inc/dbdata.hxx              |    3 ++-
 sc/source/core/tool/dbdata.cxx |    6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit cd81c31a6c5313c53269721749f7bcdc11a103ad
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Sep 20 18:12:03 2018 +0200
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Wed Sep 26 12:46:31 2018 +0200

    Resolves: tdf#119954 do not copy the old parent, init with new parent instead
    
    The parent is always the ScDBCollection that contains the
    ScDBCollection::NamedDBs container, not the one the
    ScDBCollection::NamedDBs was copy-constructed from.
    
    Change-Id: Ia409347f3aeb9ad7a5e68da7af727adfac98d6a2
    Reviewed-on: https://gerrit.libreoffice.org/60833
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 7ea5d339dc4d8412f436f3affa589bfbd0b1ef68)
    Reviewed-on: https://gerrit.libreoffice.org/60841
    Tested-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 4523bb64c206..ab0cf85b9cb4 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -240,7 +240,8 @@ public:
         DBsType m_DBs;
         ScDBCollection& mrParent;
         NamedDBs(ScDBCollection& rParent, ScDocument& rDoc);
-        NamedDBs(const NamedDBs& r);
+        NamedDBs(const NamedDBs& r, ScDBCollection& rParent);
+        NamedDBs(const NamedDBs&) = delete;
         virtual ~NamedDBs() override;
         NamedDBs & operator=(NamedDBs const&) = delete;
         void initInserted( ScDBData* p );
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 4c331d839664..66a0d1922eee 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -1071,9 +1071,9 @@ ScRangeList& ScDBDataContainerBase::GetDirtyTableColumnNames()
 ScDBCollection::NamedDBs::NamedDBs(ScDBCollection& rParent, ScDocument& rDoc) :
     ScDBDataContainerBase(rDoc), mrParent(rParent) {}
 
-ScDBCollection::NamedDBs::NamedDBs(const NamedDBs& r)
+ScDBCollection::NamedDBs::NamedDBs(const NamedDBs& r, ScDBCollection& rParent)
     : ScDBDataContainerBase(r.mrDoc)
-    , mrParent(r.mrParent)
+    , mrParent(rParent)
 {
     for (auto const& it : r.m_DBs)
     {
@@ -1287,7 +1287,7 @@ ScDBCollection::ScDBCollection(ScDocument* pDocument) :
     pDoc(pDocument), nEntryIndex(1), maNamedDBs(*this, *pDocument) {}
 
 ScDBCollection::ScDBCollection(const ScDBCollection& r) :
-    pDoc(r.pDoc), nEntryIndex(r.nEntryIndex), maNamedDBs(r.maNamedDBs), maAnonDBs(r.maAnonDBs) {}
+    pDoc(r.pDoc), nEntryIndex(r.nEntryIndex), maNamedDBs(r.maNamedDBs, *this), maAnonDBs(r.maAnonDBs) {}
 
 const ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
 {


More information about the Libreoffice-commits mailing list