[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/source

Caolán McNamara caolanm at redhat.com
Tue Oct 17 09:35:59 UTC 2017


 sw/source/filter/ww8/ww8par.cxx |    6 +++---
 sw/source/filter/ww8/ww8par.hxx |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a2ca21fada002b895202abd2cbb4997b112627f8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 16 14:23:22 2017 +0100

    ofz: returning SfxPoolItem belonging to local
    
    Change-Id: Ib9760efb1231ef057dfd62d06095c15e3bf73a87
    Reviewed-on: https://gerrit.libreoffice.org/43426
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 9190f05c6ca2..162b4203763a 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1496,9 +1496,9 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos,
             if (pNd->IsTextNode())
             {
                 const sal_Int32 nPos = rPos.nContent.GetIndex();
-                SfxItemSet aSet(pDoc->GetAttrPool(), nWhich, nWhich);
-                if (pNd->GetTextNode()->GetAttr(aSet, nPos, nPos))
-                    pItem = aSet.GetItem(nWhich);
+                m_xScratchSet.reset(new SfxItemSet(pDoc->GetAttrPool(), nWhich, nWhich));
+                if (pNd->GetTextNode()->GetAttr(*m_xScratchSet, nPos, nPos))
+                    pItem = m_xScratchSet->GetItem(nWhich);
             }
 
             if (!pItem)
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 4c7944c28c0b..31425907dc6d 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -357,6 +357,7 @@ class SwWW8FltControlStack : public SwFltControlStack
 {
 private:
     SwWW8ImplReader& rReader;
+    std::unique_ptr<SfxItemSet> m_xScratchSet;
     sal_uInt16 nToggleAttrFlags;
     sal_uInt16 nToggleBiDiAttrFlags;
     SwWW8FltControlStack(const SwWW8FltControlStack&) = delete;


More information about the Libreoffice-commits mailing list