[Libreoffice-commits] core.git: 8 commits - helpcontent2 include/svx sd/source svx/source translations

David Tardon dtardon at redhat.com
Mon May 2 04:57:01 UTC 2016


 helpcontent2                            |    2 
 include/svx/svdundo.hxx                 |    9 ++++
 sd/source/ui/dlg/unchss.cxx             |   50 ++++++++++------------
 sd/source/ui/func/undoback.cxx          |   56 ++++++++++++++++++++-----
 sd/source/ui/inc/unchss.hxx             |   11 ++---
 sd/source/ui/inc/undoback.hxx           |   15 ++++--
 svx/source/svdraw/svdobj.cxx            |    7 +--
 svx/source/svdraw/svdundo.cxx           |   70 ++++++++++++++++++++++++++++++++
 svx/source/unodraw/UnoNameItemTable.cxx |   17 ++-----
 svx/source/unodraw/UnoNameItemTable.hxx |    3 -
 translations                            |    2 
 11 files changed, 175 insertions(+), 67 deletions(-)

New commits:
commit c4ed5807bda4d100c3fc053fbb3f738d3c2d24e3
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 14:22:50 2016 +0200

    drop cruft
    
    Change-Id: Ib3364e97407061ee7710cb87f1f33a2736ed9c0e

diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index 4d06781..4fd35e2 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -29,7 +29,6 @@ class SdPage;
 class SfxItemSet;
 class SfxPoolItem;
 
-// SdBackgroundObjUndoAction
 class SdBackgroundObjUndoAction : public SdUndoAction
 {
 private:
@@ -44,8 +43,6 @@ private:
     void                    restoreFillBitmap(SfxItemSet &rItemSet);
 
 public:
-
-
                             SdBackgroundObjUndoAction(
                                 SdDrawDocument& rDoc,
                                 SdPage& rPage,
commit ee4f35090657fdce572c5bc6238aceb4098a6e4e
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 14:21:52 2016 +0200

    use unique_ptr
    
    Change-Id: I55ff9ae568a0d44c8ee8be922adf40e12038e436

diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index b1e0310..08ff102 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "undoback.hxx"
+
 #include "sdpage.hxx"
 #include "sdresid.hxx"
 #include "strings.hrc"
@@ -36,7 +37,7 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
     const SfxItemSet& rItemSet)
 :   SdUndoAction(&rDoc),
     mrPage(rPage),
-    mpItemSet(new SfxItemSet(rItemSet)),
+    mpItemSet(o3tl::make_unique<SfxItemSet>(rItemSet)),
     mbHasFillBitmap(false)
 {
     OUString aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) );
@@ -44,22 +45,16 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
     saveFillBitmap(*mpItemSet);
 }
 
-SdBackgroundObjUndoAction::~SdBackgroundObjUndoAction()
-{
-    delete mpItemSet;
-}
-
 void SdBackgroundObjUndoAction::ImplRestoreBackgroundObj()
 {
-    SfxItemSet* pNew = new SfxItemSet(mrPage.getSdrPageProperties().GetItemSet());
+    std::unique_ptr<SfxItemSet> pNew = o3tl::make_unique<SfxItemSet>(mrPage.getSdrPageProperties().GetItemSet());
     mrPage.getSdrPageProperties().ClearItem();
     if (bool(mpFillBitmapItem))
         restoreFillBitmap(*mpItemSet);
     mpFillBitmapItem.reset();
     mbHasFillBitmap = false;
     mrPage.getSdrPageProperties().PutItemSet(*mpItemSet);
-    delete mpItemSet;
-    mpItemSet = pNew;
+    mpItemSet = std::move(pNew);
     saveFillBitmap(*mpItemSet);
 
     // tell the page that it's visualization has changed
diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index 36df9f8..4d06781 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX
 
 #include <memory>
+
 #include "sdundo.hxx"
 
 class SdDrawDocument;
@@ -34,7 +35,7 @@ class SdBackgroundObjUndoAction : public SdUndoAction
 private:
 
     SdPage&                 mrPage;
-    SfxItemSet*             mpItemSet;
+    std::unique_ptr<SfxItemSet> mpItemSet;
     std::unique_ptr<SfxPoolItem> mpFillBitmapItem;
     bool                    mbHasFillBitmap;
 
@@ -49,7 +50,6 @@ public:
                                 SdDrawDocument& rDoc,
                                 SdPage& rPage,
                                 const SfxItemSet& rItemSet);
-    virtual                 ~SdBackgroundObjUndoAction();
 
     virtual void            Undo() override;
     virtual void            Redo() override;
commit a084962e8c3deaeb3c1b6b9119215b48cf27e76e
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 14:14:53 2016 +0200

    fix typo
    
    Change-Id: I841a9c12664950b2f1fe8cdf43e3d815f292eb3d

diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index 704b551..b1e0310 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -33,10 +33,10 @@
 SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
     SdDrawDocument& rDoc,
     SdPage& rPage,
-    const SfxItemSet& rItenSet)
+    const SfxItemSet& rItemSet)
 :   SdUndoAction(&rDoc),
     mrPage(rPage),
-    mpItemSet(new SfxItemSet(rItenSet)),
+    mpItemSet(new SfxItemSet(rItemSet)),
     mbHasFillBitmap(false)
 {
     OUString aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) );
diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index 35370ca..36df9f8 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -48,7 +48,7 @@ public:
                             SdBackgroundObjUndoAction(
                                 SdDrawDocument& rDoc,
                                 SdPage& rPage,
-                                const SfxItemSet& rItenSet);
+                                const SfxItemSet& rItemSet);
     virtual                 ~SdBackgroundObjUndoAction();
 
     virtual void            Undo() override;
commit b876bbe2cacce8af379b10d82da6c7e7d229b361
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Apr 26 09:17:11 2016 +0200

    rbhz#1326602 avoid exp. bg bitmaps from deleted slides
    
    ODF export uses SvxUnoBitmapTable (impl. of
    com.sun.star.drawing.BitmapTable) to create fill bitmap styles. That
    returns all XATTR_FILLBITMAP items that are in the document's pool. So
    we ensure that bitmaps that are only used on deleted (either explicitly
    or by undoing their insertion) slides are not in the pool.
    
    Change-Id: I54c594a94989158f22b156fe660c1e716b988b3e

diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index 5f3ee5f..dc09f22 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -22,6 +22,7 @@
 
 #include <sal/config.h>
 
+#include <memory>
 #include <vector>
 
 #include <svl/solar.hrc>
@@ -33,6 +34,7 @@
 #include <svx/svxdllapi.h>
 
 class SfxItemSet;
+class SfxPoolItem;
 class SfxStyleSheet;
 class SdrView;
 class SdrPageView;
@@ -584,6 +586,8 @@ class SVX_DLLPUBLIC SdrUndoDelPage : public SdrUndoPageList
     // When deleting a MasterPage, we remember all relations of the
     // Character Page with the MasterPage in this UndoGroup.
     SdrUndoGroup*               pUndoGroup;
+    std::unique_ptr<SfxPoolItem> mpFillBitmapItem;
+    bool mbHasFillBitmap;
 
 public:
     SdrUndoDelPage(SdrPage& rNewPg);
@@ -597,6 +601,11 @@ public:
 
     virtual void SdrRepeat(SdrView& rView) override;
     virtual bool CanSdrRepeat(SdrView& rView) const override;
+
+private:
+    void queryFillBitmap(const SfxItemSet &rItemSet);
+    void clearFillBitmap();
+    void restoreFillBitmap();
 };
 
 /**
diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index 126101f..704b551 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -21,8 +21,14 @@
 #include "sdpage.hxx"
 #include "sdresid.hxx"
 #include "strings.hrc"
+
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+#include <o3tl/make_unique.hxx>
+
 #include <svl/itemset.hxx>
 
+#include <svx/xfillit0.hxx>
 
 SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
     SdDrawDocument& rDoc,
@@ -30,10 +36,12 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
     const SfxItemSet& rItenSet)
 :   SdUndoAction(&rDoc),
     mrPage(rPage),
-    mpItemSet(new SfxItemSet(rItenSet))
+    mpItemSet(new SfxItemSet(rItenSet)),
+    mbHasFillBitmap(false)
 {
     OUString aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) );
     SetComment( aString );
+    saveFillBitmap(*mpItemSet);
 }
 
 SdBackgroundObjUndoAction::~SdBackgroundObjUndoAction()
@@ -45,9 +53,14 @@ void SdBackgroundObjUndoAction::ImplRestoreBackgroundObj()
 {
     SfxItemSet* pNew = new SfxItemSet(mrPage.getSdrPageProperties().GetItemSet());
     mrPage.getSdrPageProperties().ClearItem();
+    if (bool(mpFillBitmapItem))
+        restoreFillBitmap(*mpItemSet);
+    mpFillBitmapItem.reset();
+    mbHasFillBitmap = false;
     mrPage.getSdrPageProperties().PutItemSet(*mpItemSet);
     delete mpItemSet;
     mpItemSet = pNew;
+    saveFillBitmap(*mpItemSet);
 
     // tell the page that it's visualization has changed
     mrPage.ActionChanged();
@@ -65,7 +78,33 @@ void SdBackgroundObjUndoAction::Redo()
 
 SdUndoAction* SdBackgroundObjUndoAction::Clone() const
 {
-    return new SdBackgroundObjUndoAction(*mpDoc, mrPage, *mpItemSet);
+    std::unique_ptr<SdBackgroundObjUndoAction> pCopy = o3tl::make_unique<SdBackgroundObjUndoAction>(*mpDoc, mrPage, *mpItemSet);
+    if (mpFillBitmapItem)
+        pCopy->mpFillBitmapItem.reset(mpFillBitmapItem->Clone());
+    pCopy->mbHasFillBitmap = mbHasFillBitmap;
+    return pCopy.release();
+}
+
+void SdBackgroundObjUndoAction::saveFillBitmap(SfxItemSet &rItemSet)
+{
+    const SfxPoolItem *pItem = nullptr;
+    if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET)
+        mpFillBitmapItem.reset(pItem->Clone());
+    if (bool(mpFillBitmapItem))
+    {
+        if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET)
+            mbHasFillBitmap = static_cast<const XFillStyleItem*>(pItem)->GetValue() == css::drawing::FillStyle_BITMAP;
+        rItemSet.ClearItem(XATTR_FILLBITMAP);
+        if (mbHasFillBitmap)
+            rItemSet.ClearItem(XATTR_FILLSTYLE);
+    }
+}
+
+void SdBackgroundObjUndoAction::restoreFillBitmap(SfxItemSet &rItemSet)
+{
+    rItemSet.Put(*mpFillBitmapItem);
+    if (mbHasFillBitmap)
+        rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index 3b1553b..35370ca 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -20,11 +20,13 @@
 #ifndef INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX
 #define INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX
 
+#include <memory>
 #include "sdundo.hxx"
 
 class SdDrawDocument;
 class SdPage;
 class SfxItemSet;
+class SfxPoolItem;
 
 // SdBackgroundObjUndoAction
 class SdBackgroundObjUndoAction : public SdUndoAction
@@ -33,8 +35,12 @@ private:
 
     SdPage&                 mrPage;
     SfxItemSet*             mpItemSet;
+    std::unique_ptr<SfxPoolItem> mpFillBitmapItem;
+    bool                    mbHasFillBitmap;
 
     void                    ImplRestoreBackgroundObj();
+    void                    saveFillBitmap(SfxItemSet &rItemSet);
+    void                    restoreFillBitmap(SfxItemSet &rItemSet);
 
 public:
 
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index e3cc478..675edb8 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <com/sun/star/drawing/FillStyle.hpp>
 
 #include <svl/lstner.hxx>
 
@@ -27,6 +28,7 @@
 #include <svx/svdlayer.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/svdview.hxx>
+#include <svx/xfillit0.hxx>
 #include "svx/svdstr.hrc"
 #include "svdglob.hxx"
 #include <svx/scene3d.hxx>
@@ -1445,9 +1447,24 @@ SdrUndoPageList::~SdrUndoPageList()
 SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg)
     : SdrUndoPageList(rNewPg)
     , pUndoGroup(nullptr)
+    , mbHasFillBitmap(false)
 {
     bItsMine = true;
 
+    // keep fill bitmap separately to remove it from pool if not used elsewhere
+    if (mrPage.IsMasterPage())
+    {
+        SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
+        if (pStyleSheet)
+            queryFillBitmap(pStyleSheet->GetItemSet());
+    }
+    else
+    {
+        queryFillBitmap(mrPage.getSdrPageProperties().GetItemSet());
+    }
+    if (bool(mpFillBitmapItem))
+        clearFillBitmap();
+
     // now remember the master page relationships
     if(mrPage.IsMasterPage())
     {
@@ -1482,6 +1499,8 @@ SdrUndoDelPage::~SdrUndoDelPage()
 
 void SdrUndoDelPage::Undo()
 {
+    if (bool(mpFillBitmapItem))
+        restoreFillBitmap();
     ImpInsertPage(nPageNum);
     if (pUndoGroup!=nullptr)
     {
@@ -1495,6 +1514,8 @@ void SdrUndoDelPage::Undo()
 void SdrUndoDelPage::Redo()
 {
     ImpRemovePage(nPageNum);
+    if (bool(mpFillBitmapItem))
+        clearFillBitmap();
     // master page relations are dissolved automatically
     DBG_ASSERT(!bItsMine,"RedoDeletePage: mrPage already belongs to UndoAction.");
     bItsMine=true;
@@ -1523,6 +1544,55 @@ bool SdrUndoDelPage::CanSdrRepeat(SdrView& /*rView*/) const
     return false;
 }
 
+void SdrUndoDelPage::queryFillBitmap(const SfxItemSet& rItemSet)
+{
+    const SfxPoolItem *pItem = nullptr;
+    if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET)
+        mpFillBitmapItem.reset(pItem->Clone());
+    if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET)
+        mbHasFillBitmap = static_cast<const XFillStyleItem*>(pItem)->GetValue() == css::drawing::FillStyle_BITMAP;
+}
+
+void SdrUndoDelPage::clearFillBitmap()
+{
+    if (mrPage.IsMasterPage())
+    {
+        SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
+        assert(bool(pStyleSheet)); // who took away my stylesheet?
+        SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
+        rItemSet.ClearItem(XATTR_FILLBITMAP);
+        if (mbHasFillBitmap)
+            rItemSet.ClearItem(XATTR_FILLSTYLE);
+    }
+    else
+    {
+        SdrPageProperties &rPageProps = mrPage.getSdrPageProperties();
+        rPageProps.ClearItem(XATTR_FILLBITMAP);
+        if (mbHasFillBitmap)
+            rPageProps.ClearItem(XATTR_FILLSTYLE);
+    }
+}
+
+void SdrUndoDelPage::restoreFillBitmap()
+{
+    if (mrPage.IsMasterPage())
+    {
+        SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
+        assert(bool(pStyleSheet)); // who took away my stylesheet?
+        SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
+        rItemSet.Put(*mpFillBitmapItem);
+        if (mbHasFillBitmap)
+            rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
+    }
+    else
+    {
+        SdrPageProperties &rPageProps = mrPage.getSdrPageProperties();
+        rPageProps.PutItem(*mpFillBitmapItem);
+        if (mbHasFillBitmap)
+            rPageProps.PutItem(XFillStyleItem(css::drawing::FillStyle_BITMAP));
+    }
+}
+
 
 void SdrUndoNewPage::Undo()
 {
commit 859c00663f79d81b28f08a7c24a7aebddd8b7ffe
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 10:11:46 2016 +0200

    add member prefix
    
    Change-Id: Ic53e0c564176649b6cba84ea898c3c2f69fcad8c

diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx
index 97a37cf..397af1c 100644
--- a/sd/source/ui/dlg/unchss.cxx
+++ b/sd/source/ui/dlg/unchss.cxx
@@ -41,18 +41,18 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
                       SdUndoAction(pTheDoc)
 {
     DBG_ASSERT(pTheStyleSheet, "Undo without StyleSheet ???");
-    pStyleSheet = pTheStyleSheet;
+    mpStyleSheet = pTheStyleSheet;
 
     // Create ItemSets; Attention, it is possible that the new one is from a,
     // different pool. Therefore we clone it with its items.
-    pNewSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges());
-    SdrModel::MigrateItemSet( pTheNewItemSet, pNewSet.get(), pTheDoc );
+    mpNewSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges());
+    SdrModel::MigrateItemSet( pTheNewItemSet, mpNewSet.get(), pTheDoc );
 
-    pOldSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pStyleSheet->GetItemSet().GetRanges());
-    SdrModel::MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet.get(), pTheDoc );
+    mpOldSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), mpStyleSheet->GetItemSet().GetRanges());
+    SdrModel::MigrateItemSet( &mpStyleSheet->GetItemSet(), mpOldSet.get(), pTheDoc );
 
-    aComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT);
-    OUString aName(pStyleSheet->GetName());
+    maComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT);
+    OUString aName(mpStyleSheet->GetName());
 
     // delete layout name and separator
     sal_Int32 nPos = aName.indexOf(SD_LT_SEPARATOR);
@@ -91,36 +91,36 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
     }
 
     // replace placeholder with template name
-    aComment = aComment.replaceFirst("$", aName);
+    maComment = maComment.replaceFirst("$", aName);
 }
 
 void StyleSheetUndoAction::Undo()
 {
-    SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() );
-    SdrModel::MigrateItemSet( pOldSet.get(), &aNewSet, mpDoc );
+    SfxItemSet aNewSet( mpDoc->GetItemPool(), mpOldSet->GetRanges() );
+    SdrModel::MigrateItemSet( mpOldSet.get(), &aNewSet, mpDoc );
 
-    pStyleSheet->GetItemSet().Set(aNewSet);
-    if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
-        static_cast<SdStyleSheet*>(pStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+    mpStyleSheet->GetItemSet().Set(aNewSet);
+    if( mpStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
+        static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
     else
-        pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+        mpStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
 }
 
 void StyleSheetUndoAction::Redo()
 {
-    SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() );
-    SdrModel::MigrateItemSet( pNewSet.get(), &aNewSet, mpDoc );
+    SfxItemSet aNewSet( mpDoc->GetItemPool(), mpOldSet->GetRanges() );
+    SdrModel::MigrateItemSet( mpNewSet.get(), &aNewSet, mpDoc );
 
-    pStyleSheet->GetItemSet().Set(aNewSet);
-    if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
-        static_cast<SdStyleSheet*>(pStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+    mpStyleSheet->GetItemSet().Set(aNewSet);
+    if( mpStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
+        static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
     else
-        pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+        mpStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
 }
 
 OUString StyleSheetUndoAction::GetComment() const
 {
-    return aComment;
+    return maComment;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/unchss.hxx b/sd/source/ui/inc/unchss.hxx
index ed72911..170534a 100644
--- a/sd/source/ui/inc/unchss.hxx
+++ b/sd/source/ui/inc/unchss.hxx
@@ -30,11 +30,11 @@ class SdDrawDocument;
 
 class StyleSheetUndoAction : public SdUndoAction
 {
-    SfxStyleSheet*  pStyleSheet;
+    SfxStyleSheet*  mpStyleSheet;
 
-    std::unique_ptr<SfxItemSet> pNewSet;
-    std::unique_ptr<SfxItemSet> pOldSet;
-    OUString        aComment;
+    std::unique_ptr<SfxItemSet> mpNewSet;
+    std::unique_ptr<SfxItemSet> mpOldSet;
+    OUString        maComment;
 
 public:
     StyleSheetUndoAction(SdDrawDocument* pTheDoc,
commit 10b818d4b68f5df490c9c8f499e3a7aa83d7e5bb
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 10:08:27 2016 +0200

    use unique_ptr
    
    Change-Id: I38d5c436985b0a68530be01c7482a68cf4e99018

diff --git a/helpcontent2 b/helpcontent2
index 743ed49..1ca8cf9 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 743ed49ef0759b6cbd65d707ae9b8bba90e81a4d
+Subproject commit 1ca8cf973396ef4f41dd3474b79d79fe84105b93
diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx
index 1c24d1e..97a37cf 100644
--- a/sd/source/ui/dlg/unchss.cxx
+++ b/sd/source/ui/dlg/unchss.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <o3tl/make_unique.hxx>
+
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
 #include <svl/smplhint.hxx>
@@ -43,11 +45,11 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
 
     // Create ItemSets; Attention, it is possible that the new one is from a,
     // different pool. Therefore we clone it with its items.
-    pNewSet = new SfxItemSet(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges());
-    SdrModel::MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc );
+    pNewSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges());
+    SdrModel::MigrateItemSet( pTheNewItemSet, pNewSet.get(), pTheDoc );
 
-    pOldSet = new SfxItemSet(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pStyleSheet->GetItemSet().GetRanges());
-    SdrModel::MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc );
+    pOldSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pStyleSheet->GetItemSet().GetRanges());
+    SdrModel::MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet.get(), pTheDoc );
 
     aComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT);
     OUString aName(pStyleSheet->GetName());
@@ -95,7 +97,7 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
 void StyleSheetUndoAction::Undo()
 {
     SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() );
-    SdrModel::MigrateItemSet( pOldSet, &aNewSet, mpDoc );
+    SdrModel::MigrateItemSet( pOldSet.get(), &aNewSet, mpDoc );
 
     pStyleSheet->GetItemSet().Set(aNewSet);
     if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
@@ -107,7 +109,7 @@ void StyleSheetUndoAction::Undo()
 void StyleSheetUndoAction::Redo()
 {
     SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() );
-    SdrModel::MigrateItemSet( pNewSet, &aNewSet, mpDoc );
+    SdrModel::MigrateItemSet( pNewSet.get(), &aNewSet, mpDoc );
 
     pStyleSheet->GetItemSet().Set(aNewSet);
     if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
@@ -116,12 +118,6 @@ void StyleSheetUndoAction::Redo()
         pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
 }
 
-StyleSheetUndoAction::~StyleSheetUndoAction()
-{
-    delete pNewSet;
-    delete pOldSet;
-}
-
 OUString StyleSheetUndoAction::GetComment() const
 {
     return aComment;
diff --git a/sd/source/ui/inc/unchss.hxx b/sd/source/ui/inc/unchss.hxx
index 88b9e33..ed72911 100644
--- a/sd/source/ui/inc/unchss.hxx
+++ b/sd/source/ui/inc/unchss.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_SD_SOURCE_UI_INC_UNCHSS_HXX
 #define INCLUDED_SD_SOURCE_UI_INC_UNCHSS_HXX
 
+#include <memory>
+
 #include "sdundo.hxx"
 
 class SfxItemSet;
@@ -30,8 +32,8 @@ class StyleSheetUndoAction : public SdUndoAction
 {
     SfxStyleSheet*  pStyleSheet;
 
-    SfxItemSet*     pNewSet;
-    SfxItemSet*     pOldSet;
+    std::unique_ptr<SfxItemSet> pNewSet;
+    std::unique_ptr<SfxItemSet> pOldSet;
     OUString        aComment;
 
 public:
@@ -39,7 +41,6 @@ public:
                          SfxStyleSheet*  pTheStyleSheet,
                          const SfxItemSet* pTheNewItemSet);
 
-    virtual ~StyleSheetUndoAction();
     virtual void Undo() override;
     virtual void Redo() override;
 
diff --git a/translations b/translations
index 0732bbf..b0a83a0 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 0732bbfc5365529452255fc0263416c0455b127b
+Subproject commit b0a83a046ece7e828d6a7a2d1304661a8367012c
commit ffacf4ba0f8c77cd66561962ab540f3e6b726649
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Apr 27 16:35:40 2016 +0200

    change brackets to match the rest of the file
    
    Change-Id: Ib859d8a012522e4f07f503ded0ee80e725a24ab8

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 612855e..4ffef62 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -448,11 +448,12 @@ void SdrObject::SetPage(SdrPage* pNewPage)
     SdrPage* pOldPage = pPage;
 
     pPage=pNewPage;
-    if (pPage!=nullptr) {
+    if (pPage!=nullptr)
+    {
         SdrModel* pMod=pPage->GetModel();
-        if (pMod!=pModel && pMod!=nullptr) {
+        if (pMod!=pModel && pMod!=nullptr)
             SetModel(pMod);
-        }}
+    }
 
     // The creation of the UNO shape in SdrObject::getUnoShape is influenced
     // by pPage, so when the page changes we need to discard the cached UNO
commit 5db489719d95e66dcf4fc8ff5c0cc518a6da9dad
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Apr 26 09:46:57 2016 +0200

    use unique_ptr
    
    Change-Id: I047a2436ce5603a8642aa621694560aca669b2f1

diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx
index 0dc2369..1ecba10 100644
--- a/svx/source/unodraw/UnoNameItemTable.cxx
+++ b/svx/source/unodraw/UnoNameItemTable.cxx
@@ -19,6 +19,9 @@
 
 
 #include <set>
+
+#include <o3tl/make_unique.hxx>
+
 #include <svl/itempool.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -59,14 +62,6 @@ bool SvxUnoNameItemTable::isValid( const NameOrIndex* pItem ) const
 
 void SvxUnoNameItemTable::dispose()
 {
-    ItemPoolVector::iterator aIter = maItemSetVector.begin();
-    const ItemPoolVector::iterator aEnd = maItemSetVector.end();
-
-    while( aIter != aEnd )
-    {
-        delete (*aIter++);
-    }
-
     maItemSetVector.clear();
 }
 
@@ -85,13 +80,12 @@ sal_Bool SAL_CALL SvxUnoNameItemTable::supportsService( const  OUString& Service
 
 void SAL_CALL SvxUnoNameItemTable::ImplInsertByName( const OUString& aName, const uno::Any& aElement )
 {
-    SfxItemSet* pInSet = new SfxItemSet( *mpModelPool, mnWhich, mnWhich );
-    maItemSetVector.push_back( pInSet );
+    maItemSetVector.push_back( o3tl::make_unique< SfxItemSet >( *mpModelPool, mnWhich, mnWhich ) );
 
     std::unique_ptr<NameOrIndex> pNewItem(createItem());
     pNewItem->SetName( aName );
     pNewItem->PutValue( aElement, mnMemberId );
-    pInSet->Put( *pNewItem, mnWhich );
+    maItemSetVector.back()->Put( *pNewItem, mnWhich );
 }
 
 // XNameContainer
@@ -133,7 +127,6 @@ void SAL_CALL SvxUnoNameItemTable::removeByName( const OUString& aApiName )
         const NameOrIndex *pItem = static_cast<const NameOrIndex *>(&((*aIter)->Get( mnWhich ) ));
         if (sName.equals(pItem->GetName()))
         {
-            delete (*aIter);
             maItemSetVector.erase( aIter );
             return;
         }
diff --git a/svx/source/unodraw/UnoNameItemTable.hxx b/svx/source/unodraw/UnoNameItemTable.hxx
index 1b19d4d..6bf5ba1 100644
--- a/svx/source/unodraw/UnoNameItemTable.hxx
+++ b/svx/source/unodraw/UnoNameItemTable.hxx
@@ -25,6 +25,7 @@
 
 #include <cppuhelper/implbase.hxx>
 
+#include <memory>
 #include <vector>
 #include <svl/lstner.hxx>
 #include <svx/xit.hxx>
@@ -35,7 +36,7 @@ class SdrModel;
 class SfxItemPool;
 class SfxItemSet;
 
-typedef std::vector< SfxItemSet* > ItemPoolVector;
+typedef std::vector< std::unique_ptr< SfxItemSet > > ItemPoolVector;
 class SvxUnoNameItemTable : public cppu::WeakImplHelper< css::container::XNameContainer, css::lang::XServiceInfo >,
                             public SfxListener
 {


More information about the Libreoffice-commits mailing list