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

Michael Stahl Michael.Stahl at cib.de
Wed Apr 4 14:22:49 UTC 2018


 sw/source/filter/ww8/ww8graf.cxx |   10 +++++++---
 sw/source/filter/ww8/ww8par.cxx  |    6 +++++-
 sw/source/filter/ww8/ww8par.hxx  |    3 ++-
 3 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit cdc0d49ea70570ae71e19ebbf5bd24fc0f5083eb
Author: Michael Stahl <Michael.Stahl at cib.de>
Date:   Wed Apr 4 14:15:53 2018 +0200

    sw: convert DELETEZ to unique_ptr in ww8graf.cxx
    
    Change-Id: I8d4aafb9cc1312eea91dd858d457e4cb732b9c3a
    Reviewed-on: https://gerrit.libreoffice.org/52377
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index ebbe33bb390c..ed673656a093 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -945,7 +945,9 @@ OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(OUString &rString, WW8_CP
     if (nLen > 0)
     {
         if (!m_pDrawEditEngine)
-            m_pDrawEditEngine = new EditEngine(nullptr);
+        {
+            m_pDrawEditEngine.reset(new EditEngine(nullptr));
+        }
 
         //replace dos line endings with editeng ones, replace any extra chars with
         //placeholders to keep the inserted string len in sync with the attribute cps
@@ -1009,7 +1011,9 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
                         GetRangeAsDrawingString(aString, nStartCp, nEndCp, eType) > 0;
 
     if (!m_pDrawEditEngine)
-        m_pDrawEditEngine = new EditEngine(nullptr);
+    {
+        m_pDrawEditEngine.reset(new EditEngine(nullptr));
+    }
     if( pObjSiz )
         m_pDrawEditEngine->SetPaperSize( *pObjSiz );
 
@@ -3124,7 +3128,7 @@ void SwWW8ImplReader::GrafikCtor()  // For SVDraw and VCControls and Escher
 
 void SwWW8ImplReader::GrafikDtor()
 {
-    DELETEZ(m_pDrawEditEngine); // maybe created by graphic
+    m_pDrawEditEngine.reset(); // maybe created by graphic
     m_xWWZOrder.reset();       // same
 }
 
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d0efff84cbcb..33ff69accc43 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -49,6 +49,7 @@
 #include <editeng/opaqitem.hxx>
 #include <editeng/charhiddenitem.hxx>
 #include <editeng/fontitem.hxx>
+#include <editeng/editeng.hxx>
 #include <svx/unoapi.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdoashp.hxx>
@@ -4171,7 +4172,6 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage,
     , m_pStandardFormatColl(nullptr)
     , m_pDrawModel(nullptr)
     , m_pDrawPg(nullptr)
-    , m_pDrawEditEngine(nullptr)
     , m_pNumFieldType(nullptr)
     , m_pAtnNames(nullptr)
     , m_sBaseURL(rBaseURL)
@@ -4259,6 +4259,10 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage,
     mpCursor = m_rDoc.CreateUnoCursor(rPos);
 }
 
+SwWW8ImplReader::~SwWW8ImplReader()
+{
+}
+
 void SwWW8ImplReader::DeleteStack(SwFltControlStack* pStck)
 {
     if( pStck )
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index d24057bb3504..0fa4d4b499ef 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1239,7 +1239,7 @@ private:
 
     SdrModel* m_pDrawModel;
     SdrPage* m_pDrawPg;
-    EditEngine* m_pDrawEditEngine;
+    std::unique_ptr<EditEngine> m_pDrawEditEngine;
     std::unique_ptr<wwZOrderer> m_xWWZOrder;
 
     SwFieldType* m_pNumFieldType;   // for number circle
@@ -1683,6 +1683,7 @@ private:
     SwWW8ImplReader(const SwWW8ImplReader &) = delete;
     SwWW8ImplReader& operator=(const SwWW8ImplReader&) = delete;
 public:     // really private, but can only be done public
+    ~SwWW8ImplReader();
     sal_uInt16 GetToggleAttrFlags() const;
     sal_uInt16 GetToggleBiDiAttrFlags() const;
     void SetToggleAttrFlags(sal_uInt16 nFlags);


More information about the Libreoffice-commits mailing list