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

Noel Grandin noelgrandin at gmail.com
Tue May 2 20:01:29 UTC 2017


 sw/inc/doc.hxx             |    1 +
 sw/inc/docary.hxx          |    2 +-
 sw/source/core/tox/tox.cxx |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 925dabe8fd42d85e5d8e610dc75252372161d1b3
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue May 2 19:03:46 2017 +0200

    Revert "SwTOXTypes can just be a std::vector typedef"
    
    This reverts commit f894da4e687302702d14218138f96ed1c4983124.
    
    the default behaviour of SwVectorModifyBase is to free the
    elements in it's destructor
    
    Change-Id: I7a34fe5cc3cb8ffbcbb92068f4bb816dfd9acd43
    Reviewed-on: https://gerrit.libreoffice.org/37168
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 61d57940d2f9..f75ed2775890 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -117,6 +117,7 @@ class SwSectionData;
 class SwSelBoxes;
 class SwTableAutoFormatTable;
 class SwTOXBaseSection;
+class SwTOXTypes;
 class SwTabCols;
 class SwTable;
 class SwTableAutoFormat;
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 255bc8127ff7..6d25e85dcc74 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -300,7 +300,7 @@ public:
     void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 };
 
-typedef std::vector<SwTOXType*> SwTOXTypes;
+class SwTOXTypes : public SwVectorModifyBase<SwTOXType*> {};
 
 class SW_DLLPUBLIC SwNumRuleTable : public SwVectorModifyBase<SwNumRule*> {
 public:
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 5b00f54c474a..cb26ad4a6d1b 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -457,7 +457,7 @@ void SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource )
 {
     maMSTOCExpression = rSource.maMSTOCExpression;
     SwTOXType* pType = const_cast<SwTOXType*>(rSource.GetTOXType());
-    if( pDoc && std::find(pDoc->GetTOXTypes().begin(), pDoc->GetTOXTypes().end(), pType) == pDoc->GetTOXTypes().end())
+    if( pDoc && !pDoc->GetTOXTypes().Contains( pType ))
     {
         // type not in pDoc, so create it now
         const SwTOXTypes& rTypes = pDoc->GetTOXTypes();


More information about the Libreoffice-commits mailing list