[Libreoffice-commits] core.git: sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 20:00:40 UTC 2018


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

New commits:
commit 7ea5d339dc4d8412f436f3affa589bfbd0b1ef68
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Sep 20 18:12:03 2018 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Thu Sep 20 22:00:14 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

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 dbd0a8509d84..5fa7728c261c 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -1072,9 +1072,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)
     {
@@ -1288,7 +1288,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