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

Noel Grandin noel.grandin at collabora.co.uk
Wed Dec 13 06:52:34 UTC 2017


 include/svx/contdlg.hxx                    |    3 
 include/svx/galmisc.hxx                    |    2 
 include/svx/svdmodel.hxx                   |   26 ++--
 include/svx/svdmrkv.hxx                    |    4 
 include/svx/svdpntv.hxx                    |    6 -
 include/svx/svdview.hxx                    |    6 -
 sd/source/core/drawdoc.cxx                 |    2 
 sd/source/ui/animations/motionpathtag.cxx  |    4 
 sd/source/ui/animations/motionpathtag.hxx  |    4 
 sd/source/ui/annotations/annotationtag.cxx |    4 
 sd/source/ui/annotations/annotationtag.hxx |    4 
 sd/source/ui/func/smarttag.cxx             |    4 
 sd/source/ui/inc/View.hxx                  |    4 
 sd/source/ui/inc/smarttag.hxx              |    4 
 sd/source/ui/view/sdview.cxx               |    8 -
 svx/source/dialog/_contdlg.cxx             |    5 
 svx/source/gallery2/galmisc.cxx            |    5 
 svx/source/svdraw/svddrgv.cxx              |    2 
 svx/source/svdraw/svdmodel.cxx             |  154 ++++++++++++-----------------
 svx/source/svdraw/svdmrkv1.cxx             |    8 -
 20 files changed, 112 insertions(+), 147 deletions(-)

New commits:
commit 4c0026725cd6485f0024fd305dc35b8948c06e81
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 14:55:17 2017 +0200

    sal_uIntPtr->sal_Int32 in GalleryProgress
    
    to match the underlying type on mxProgressBar->setValue
    
    Change-Id: Ib04569235830f16b6507180e0f27816f8cfc50ff
    Reviewed-on: https://gerrit.libreoffice.org/46347
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
index 513c36bd1478..602c8283550f 100644
--- a/include/svx/galmisc.hxx
+++ b/include/svx/galmisc.hxx
@@ -127,7 +127,7 @@ class SVX_DLLPUBLIC GalleryProgress
                                     GalleryProgress( GraphicFilter* pFilter = nullptr );
                                     ~GalleryProgress();
 
-    void                            Update( sal_uIntPtr nVal, sal_uIntPtr nMaxVal );
+    void                            Update( sal_Int32 nVal, sal_Int32 nMaxVal );
 };
 
 class Gallery;
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index a410aa30d8f2..7e5c291d3491 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -369,10 +369,11 @@ GalleryProgress::~GalleryProgress()
 {
 }
 
-void GalleryProgress::Update( sal_uIntPtr nVal, sal_uIntPtr nMaxVal )
+void GalleryProgress::Update( sal_Int32 nVal, sal_Int32 nMaxVal )
 {
     if( mxProgressBar.is() && nMaxVal )
-        mxProgressBar->setValue( std::min( (sal_uIntPtr)( (double) nVal / nMaxVal * GALLERY_PROGRESS_RANGE ), (sal_uIntPtr) GALLERY_PROGRESS_RANGE ) );
+        mxProgressBar->setValue( std::min<sal_Int32>( (double) nVal / nMaxVal * GALLERY_PROGRESS_RANGE,
+                                                      GALLERY_PROGRESS_RANGE ) );
 }
 
 
commit fd88c4b45426600bd09fc47f8df9ac1cb8030e95
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 13:44:53 2017 +0200

    use std::unique_ptr in SdrModel
    
    Change-Id: I1475a12b600fdb693bad71d27dc628992b92588a
    Reviewed-on: https://gerrit.libreoffice.org/46346
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 6649b83f62e0..1293ed60c762 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -157,22 +157,22 @@ protected:
     Fraction       aUIUnitFact;  // see above
     int            nUIUnitDecimalMark; // see above
 
-    SdrLayerAdmin*  pLayerAdmin;
+    std::unique_ptr<SdrLayerAdmin> pLayerAdmin;
     SfxItemPool*    pItemPool;
     comphelper::IEmbeddedHelper*
                     m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell
-    SdrOutliner*    pDrawOutliner;  // an Outliner for outputting text
-    SdrOutliner*    pHitTestOutliner;// an Outliner for the HitTest
-    SdrOutliner*    pChainingOutliner; // an Outliner for chaining overflowing text
+    std::unique_ptr<SdrOutliner> pDrawOutliner;  // an Outliner for outputting text
+    std::unique_ptr<SdrOutliner> pHitTestOutliner;// an Outliner for the HitTest
+    std::unique_ptr<SdrOutliner> pChainingOutliner; // an Outliner for chaining overflowing text
     sal_Int32       mnDefTextHgt;    // Default text height in logical units
     VclPtr<OutputDevice>  pRefOutDev;     // ReferenceDevice for the EditEngine
     rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool;
     SfxStyleSheet*  pDefaultStyleSheet;
     SfxStyleSheet* mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; // #i119287#
     sfx2::LinkManager* pLinkManager;   // LinkManager
-    std::deque<SfxUndoAction*>* pUndoStack;
-    std::deque<SfxUndoAction*>* pRedoStack;
-    SdrUndoGroup*       pAktUndoGroup;  // for deeper
+    std::unique_ptr<std::deque<std::unique_ptr<SfxUndoAction>>> pUndoStack;
+    std::unique_ptr<std::deque<std::unique_ptr<SfxUndoAction>>> pRedoStack;
+    std::unique_ptr<SdrUndoGroup> pAktUndoGroup;  // for deeper
     sal_uInt16          nUndoLevel;     // undo nesting
     bool                bMyPool:1;        // to clean up pMyPool from 303a
     bool                mbUndoEnabled:1;  // If false no undo is recorded or we are during the execution of an undo action
@@ -190,14 +190,14 @@ protected:
     sal_uInt16          nDefaultTabulator;
     sal_uInt32          nMaxUndoCount;
 
-    TextChain*          pTextChain;
+    std::unique_ptr<TextChain> pTextChain;
 
 
 public:
     std::shared_ptr<SvxForbiddenCharactersTable> mpForbiddenCharactersTable;
     SdrSwapGraphicsMode nSwapGraphicsMode;
 
-    SdrOutlinerCache*   mpOutlinerCache;
+    std::unique_ptr<SdrOutlinerCache> mpOutlinerCache;
     //get a vector of all the SdrOutliner belonging to the model
     std::vector<SdrOutliner*> GetActiveOutliners() const;
     std::unique_ptr<SdrModelImpl>       mpImpl;
@@ -222,7 +222,7 @@ private:
     SdrModel(const SdrModel& rSrcModel) = delete;
     void operator=(const SdrModel& rSrcModel) = delete;
     bool operator==(const SdrModel& rCmpModel) const = delete;
-    SVX_DLLPRIVATE void ImpPostUndoAction(SdrUndoAction* pUndo);
+    SVX_DLLPRIVATE void ImpPostUndoAction(std::unique_ptr<SdrUndoAction> pUndo);
     SVX_DLLPRIVATE void ImpSetUIUnit();
     SVX_DLLPRIVATE void ImpSetOutlinerDefaults( SdrOutliner* pOutliner, bool bInit = false );
     SVX_DLLPRIVATE void ImpReformatAllTextObjects();
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 620607507790..e2ba0daef116 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -282,7 +282,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
     // NewOrLoadCompleted, because only then do all the templates exist.
     pHitTestOutliner->SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()) );
 
-    SetCalcFieldValueHdl( pHitTestOutliner );
+    SetCalcFieldValueHdl( pHitTestOutliner.get() );
 
     try
     {
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 7f57ab72850b..2b56e8703aa5 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -192,25 +192,25 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
     pItemPool->SetPoolDefaultItem( makeSdrTextWordWrapItem( false ) );
 
     SetTextDefaults();
-    pLayerAdmin=new SdrLayerAdmin;
+    pLayerAdmin.reset(new SdrLayerAdmin);
     pLayerAdmin->SetModel(this);
     ImpSetUIUnit();
 
     // can't create DrawOutliner OnDemand, because I can't get the Pool,
     // then (only from 302 onwards!)
-    pDrawOutliner = SdrMakeOutliner(OutlinerMode::TextObject, *this);
-    ImpSetOutlinerDefaults(pDrawOutliner, true);
+    pDrawOutliner.reset(SdrMakeOutliner(OutlinerMode::TextObject, *this));
+    ImpSetOutlinerDefaults(pDrawOutliner.get(), true);
 
-    pHitTestOutliner = SdrMakeOutliner(OutlinerMode::TextObject, *this);
-    ImpSetOutlinerDefaults(pHitTestOutliner, true);
+    pHitTestOutliner.reset(SdrMakeOutliner(OutlinerMode::TextObject, *this));
+    ImpSetOutlinerDefaults(pHitTestOutliner.get(), true);
 
     /* Start Text Chaining related code */
     // Initialize Chaining Outliner
-    pChainingOutliner = SdrMakeOutliner( OutlinerMode::TextObject, *this );
-    ImpSetOutlinerDefaults(pChainingOutliner, true);
+    pChainingOutliner.reset(SdrMakeOutliner( OutlinerMode::TextObject, *this ));
+    ImpSetOutlinerDefaults(pChainingOutliner.get(), true);
 
     // Make a TextChain
-    pTextChain = new TextChain;
+    pTextChain.reset(new TextChain);
     /* End Text Chaining related code */
 
     ImpCreateTables();
@@ -245,25 +245,25 @@ SdrModel::~SdrModel()
 
     Broadcast(SdrHint(SdrHintKind::ModelCleared));
 
-    delete mpOutlinerCache;
+    mpOutlinerCache.reset();
 
     ClearUndoBuffer();
 #ifdef DBG_UTIL
     SAL_WARN_IF(pAktUndoGroup, "svx", "In the Dtor of the SdrModel there is an open Undo left: \""
                     << pAktUndoGroup->GetComment() << '\"');
 #endif
-    delete pAktUndoGroup;
+    pAktUndoGroup.reset();
 
     ClearModel(true);
 
-    delete pLayerAdmin;
+    pLayerAdmin.reset();
 
-    delete pTextChain;
+    pTextChain.reset();
     // Delete DrawOutliner only after deleting ItemPool, because ItemPool
     // references Items of the DrawOutliner!
-    delete pChainingOutliner;
-    delete pHitTestOutliner;
-    delete pDrawOutliner;
+    pChainingOutliner.reset();
+    pHitTestOutliner.reset();
+    pDrawOutliner.reset();
 
     // delete StyleSheetPool, derived classes should not do this since
     // the DrawingEngine may need it in its destructor
@@ -315,9 +315,8 @@ void SdrModel::SetMaxUndoActionCount(sal_uInt32 nCount)
 {
     if (nCount<1) nCount=1;
     nMaxUndoCount=nCount;
-    if (pUndoStack!=nullptr) {
+    if (pUndoStack) {
         while (pUndoStack->size()>nMaxUndoCount) {
-            delete pUndoStack->back();
             pUndoStack->pop_back();
         }
     }
@@ -325,22 +324,8 @@ void SdrModel::SetMaxUndoActionCount(sal_uInt32 nCount)
 
 void SdrModel::ClearUndoBuffer()
 {
-    if (pUndoStack!=nullptr) {
-        while (!pUndoStack->empty()) {
-            delete pUndoStack->back();
-            pUndoStack->pop_back();
-        }
-        delete pUndoStack;
-        pUndoStack=nullptr;
-    }
-    if (pRedoStack!=nullptr) {
-        while (!pRedoStack->empty()) {
-            delete pRedoStack->back();
-            pRedoStack->pop_back();
-        }
-        delete pRedoStack;
-        pRedoStack=nullptr;
-    }
+    pUndoStack.reset();
+    pRedoStack.reset();
 }
 
 bool SdrModel::HasUndoActions() const
@@ -361,17 +346,17 @@ void SdrModel::Undo()
     }
     else
     {
-        SfxUndoAction* pDo = HasUndoActions() ? pUndoStack->front() : nullptr;
-        if(pDo!=nullptr)
+        if(HasUndoActions())
         {
+            SfxUndoAction* pDo = pUndoStack->front().get();
             const bool bWasUndoEnabled = mbUndoEnabled;
             mbUndoEnabled = false;
             pDo->Undo();
-            if(pRedoStack==nullptr)
-                pRedoStack=new std::deque<SfxUndoAction*>;
-            SfxUndoAction* p = pUndoStack->front();
+            if(!pRedoStack)
+                pRedoStack.reset(new std::deque<std::unique_ptr<SfxUndoAction>>);
+            SfxUndoAction* p = pUndoStack->front().release();
             pUndoStack->pop_front();
-            pRedoStack->push_front(p);
+            pRedoStack->emplace_front(p);
             mbUndoEnabled = bWasUndoEnabled;
         }
     }
@@ -385,17 +370,17 @@ void SdrModel::Redo()
     }
     else
     {
-        SfxUndoAction* pDo = HasRedoActions() ? pRedoStack->front() : nullptr;
-        if(pDo!=nullptr)
+        if(HasRedoActions())
         {
+            SfxUndoAction* pDo = pRedoStack->front().get();
             const bool bWasUndoEnabled = mbUndoEnabled;
             mbUndoEnabled = false;
             pDo->Redo();
-            if(pUndoStack==nullptr)
-                pUndoStack=new std::deque<SfxUndoAction*>;
-            SfxUndoAction* p = pRedoStack->front();
+            if(!pUndoStack)
+                pUndoStack.reset(new std::deque<std::unique_ptr<SfxUndoAction>>);
+            SfxUndoAction* p = pRedoStack->front().release();
             pRedoStack->pop_front();
-            pUndoStack->push_front(p);
+            pUndoStack->emplace_front(p);
             mbUndoEnabled = bWasUndoEnabled;
         }
     }
@@ -409,9 +394,9 @@ void SdrModel::Repeat(SfxRepeatTarget& rView)
     }
     else
     {
-        SfxUndoAction* pDo = HasUndoActions() ? pUndoStack->front() : nullptr;
-        if(pDo!=nullptr)
+        if(HasUndoActions())
         {
+            SfxUndoAction* pDo =  pUndoStack->front().get();
             if(pDo->CanRepeat(rView))
             {
                 pDo->Repeat(rView);
@@ -420,33 +405,28 @@ void SdrModel::Repeat(SfxRepeatTarget& rView)
     }
 }
 
-void SdrModel::ImpPostUndoAction(SdrUndoAction* pUndo)
+void SdrModel::ImpPostUndoAction(std::unique_ptr<SdrUndoAction> pUndo)
 {
     DBG_ASSERT( mpImpl->mpUndoManager == nullptr, "svx::SdrModel::ImpPostUndoAction(), method not supported with application undo manager!" );
     if( IsUndoEnabled() )
     {
         if (aUndoLink.IsSet())
         {
-            aUndoLink.Call(pUndo);
+            aUndoLink.Call(pUndo.release());
         }
         else
         {
-            if (pUndoStack==nullptr)
-                pUndoStack=new std::deque<SfxUndoAction*>;
-            pUndoStack->push_front(pUndo);
+            if (!pUndoStack)
+                pUndoStack.reset(new std::deque<std::unique_ptr<SfxUndoAction>>);
+            pUndoStack->emplace_front(std::move(pUndo));
             while (pUndoStack->size()>nMaxUndoCount)
             {
-                delete pUndoStack->back();
                 pUndoStack->pop_back();
             }
             if (pRedoStack!=nullptr)
                 pRedoStack->clear();
         }
     }
-    else
-    {
-        delete pUndo;
-    }
 }
 
 void SdrModel::BegUndo()
@@ -461,9 +441,9 @@ void SdrModel::BegUndo()
     }
     else if( IsUndoEnabled() )
     {
-        if(pAktUndoGroup==nullptr)
+        if(!pAktUndoGroup)
         {
-            pAktUndoGroup = new SdrUndoGroup(*this);
+            pAktUndoGroup.reset(new SdrUndoGroup(*this));
             nUndoLevel=1;
         }
         else
@@ -540,15 +520,13 @@ void SdrModel::EndUndo()
             {
                 if(pAktUndoGroup->GetActionCount()!=0)
                 {
-                    SdrUndoAction* pUndo=pAktUndoGroup;
-                    pAktUndoGroup=nullptr;
-                    ImpPostUndoAction(pUndo);
+                    SdrUndoAction* pUndo=pAktUndoGroup.release();
+                    ImpPostUndoAction(std::unique_ptr<SdrUndoAction>(pUndo));
                 }
                 else
                 {
                     // was empty
-                    delete pAktUndoGroup;
-                    pAktUndoGroup=nullptr;
+                    pAktUndoGroup.reset();
                 }
             }
         }
@@ -601,13 +579,13 @@ void SdrModel::AddUndo(SdrUndoAction* pUndo)
     }
     else
     {
-        if (pAktUndoGroup!=nullptr)
+        if (pAktUndoGroup)
         {
             pAktUndoGroup->AddAction(pUndo);
         }
         else
         {
-            ImpPostUndoAction(pUndo);
+            ImpPostUndoAction(std::unique_ptr<SdrUndoAction>(pUndo));
         }
     }
 }
@@ -787,8 +765,8 @@ void SdrModel::ImpSetOutlinerDefaults( SdrOutliner* pOutliner, bool bInit )
 void SdrModel::SetRefDevice(OutputDevice* pDev)
 {
     pRefOutDev=pDev;
-    ImpSetOutlinerDefaults( pDrawOutliner );
-    ImpSetOutlinerDefaults( pHitTestOutliner );
+    ImpSetOutlinerDefaults( pDrawOutliner.get() );
+    ImpSetOutlinerDefaults( pHitTestOutliner.get() );
     RefDeviceChanged();
 }
 
@@ -1038,8 +1016,8 @@ void SdrModel::SetScaleUnit(MapUnit eMap, const Fraction& rFrac)
         aObjUnit=rFrac;
         pItemPool->SetDefaultMetric(eObjUnit);
         ImpSetUIUnit();
-        ImpSetOutlinerDefaults( pDrawOutliner );
-        ImpSetOutlinerDefaults( pHitTestOutliner );
+        ImpSetOutlinerDefaults( pDrawOutliner.get() );
+        ImpSetOutlinerDefaults( pHitTestOutliner.get() );
         ImpReformatAllTextObjects();
     }
 }
@@ -1050,8 +1028,8 @@ void SdrModel::SetScaleUnit(MapUnit eMap)
         eObjUnit=eMap;
         pItemPool->SetDefaultMetric(eObjUnit);
         ImpSetUIUnit();
-        ImpSetOutlinerDefaults( pDrawOutliner );
-        ImpSetOutlinerDefaults( pHitTestOutliner );
+        ImpSetOutlinerDefaults( pDrawOutliner.get() );
+        ImpSetOutlinerDefaults( pHitTestOutliner.get() );
         ImpReformatAllTextObjects();
     }
 }
@@ -1061,8 +1039,8 @@ void SdrModel::SetScaleFraction(const Fraction& rFrac)
     if (aObjUnit!=rFrac) {
         aObjUnit=rFrac;
         ImpSetUIUnit();
-        ImpSetOutlinerDefaults( pDrawOutliner );
-        ImpSetOutlinerDefaults( pHitTestOutliner );
+        ImpSetOutlinerDefaults( pDrawOutliner.get() );
+        ImpSetOutlinerDefaults( pHitTestOutliner.get() );
         ImpReformatAllTextObjects();
     }
 }
@@ -1845,8 +1823,8 @@ void SdrModel::SetForbiddenCharsTable(const std::shared_ptr<SvxForbiddenCharacte
 {
     mpForbiddenCharactersTable = xForbiddenChars;
 
-    ImpSetOutlinerDefaults( pDrawOutliner );
-    ImpSetOutlinerDefaults( pHitTestOutliner );
+    ImpSetOutlinerDefaults( pDrawOutliner.get() );
+    ImpSetOutlinerDefaults( pHitTestOutliner.get() );
 }
 
 
@@ -1855,8 +1833,8 @@ void SdrModel::SetCharCompressType( CharCompressType nType )
     if( nType != mnCharCompressType )
     {
         mnCharCompressType = nType;
-        ImpSetOutlinerDefaults( pDrawOutliner );
-        ImpSetOutlinerDefaults( pHitTestOutliner );
+        ImpSetOutlinerDefaults( pDrawOutliner.get() );
+        ImpSetOutlinerDefaults( pHitTestOutliner.get() );
     }
 }
 
@@ -1865,8 +1843,8 @@ void SdrModel::SetKernAsianPunctuation( bool bEnabled )
     if( mbKernAsianPunctuation != bEnabled )
     {
         mbKernAsianPunctuation = bEnabled;
-        ImpSetOutlinerDefaults( pDrawOutliner );
-        ImpSetOutlinerDefaults( pHitTestOutliner );
+        ImpSetOutlinerDefaults( pDrawOutliner.get() );
+        ImpSetOutlinerDefaults( pHitTestOutliner.get() );
     }
 }
 
@@ -1875,8 +1853,8 @@ void SdrModel::SetAddExtLeading( bool bEnabled )
     if( mbAddExtLeading != bEnabled )
     {
         mbAddExtLeading = bEnabled;
-        ImpSetOutlinerDefaults( pDrawOutliner );
-        ImpSetOutlinerDefaults( pHitTestOutliner );
+        ImpSetOutlinerDefaults( pDrawOutliner.get() );
+        ImpSetOutlinerDefaults( pHitTestOutliner.get() );
     }
 }
 
@@ -1897,8 +1875,8 @@ void SdrModel::ReformatAllTextObjects()
 
 SdrOutliner* SdrModel::createOutliner( OutlinerMode nOutlinerMode )
 {
-    if( nullptr == mpOutlinerCache )
-        mpOutlinerCache = new SdrOutlinerCache(this);
+    if( !mpOutlinerCache )
+        mpOutlinerCache.reset(new SdrOutlinerCache(this));
 
     return mpOutlinerCache->createOutliner( nOutlinerMode );
 }
@@ -1906,8 +1884,8 @@ SdrOutliner* SdrModel::createOutliner( OutlinerMode nOutlinerMode )
 std::vector<SdrOutliner*> SdrModel::GetActiveOutliners() const
 {
     std::vector< SdrOutliner* > aRet(mpOutlinerCache ? mpOutlinerCache->GetActiveOutliners() : std::vector< SdrOutliner* >());
-    aRet.push_back(pDrawOutliner);
-    aRet.push_back(pHitTestOutliner);
+    aRet.push_back(pDrawOutliner.get());
+    aRet.push_back(pHitTestOutliner.get());
 
     return aRet;
 }
@@ -1988,7 +1966,7 @@ void SdrModel::PageListChanged()
 
 TextChain *SdrModel::GetTextChain() const
 {
-    return pTextChain;
+    return pTextChain.get();
 }
 
 const SdrPage* SdrModel::GetMasterPage(sal_uInt16 nPgNum) const
commit 71048589d4a653614d2fa35294a324111ef2759f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 13:16:26 2017 +0200

    sal_uIntPtr->sal_uInt32 in SdrModel
    
    to match the underlying field
    
    Change-Id: I4145df0fc308c09eca29f779a0ff241e4301db0b
    Reviewed-on: https://gerrit.libreoffice.org/46345
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index d7924d795a80..6649b83f62e0 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -457,9 +457,9 @@ public:
     void SetUndoComment(const OUString& rComment);
     void SetUndoComment(const OUString& rComment, const OUString& rObjDescr);
 
-    // The Undo management is only done if not NotifyUndoAction-Handler is set.
-    // Default is 16. Minimal MaxUndoActionCount is 1!
-    void  SetMaxUndoActionCount(sal_uIntPtr nCount);
+    // The Undo management is only done if NotifyUndoAction-Handler is not set.
+    // Default is 16. Minimal MaxUndoActionCount is 1.
+    void  SetMaxUndoActionCount(sal_uInt32 nCount);
     void  ClearUndoBuffer();
 
     bool HasUndoActions() const;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 1290930214a8..7f57ab72850b 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -311,7 +311,7 @@ void SdrModel::SetReadOnly(bool bYes)
 }
 
 
-void SdrModel::SetMaxUndoActionCount(sal_uIntPtr nCount)
+void SdrModel::SetMaxUndoActionCount(sal_uInt32 nCount)
 {
     if (nCount<1) nCount=1;
     nMaxUndoCount=nCount;
commit 719af6a334ecf1a0bbe5a752e5baf553b685e83c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 12:10:36 2017 +0200

    dead flags param in CreateAutoContour
    
    was being used recursively
    
    Change-Id: I2ab920ee62c663f6cdc93ae2ef7eafd142fa0c94
    Reviewed-on: https://gerrit.libreoffice.org/46344
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/contdlg.hxx b/include/svx/contdlg.hxx
index fdd59977101d..cf9946c921d3 100644
--- a/include/svx/contdlg.hxx
+++ b/include/svx/contdlg.hxx
@@ -80,8 +80,7 @@ public:
                                 const tools::PolyPolygon* pPolyPoly, void* pEditingObj );
 
     static tools::PolyPolygon  CreateAutoContour(  const Graphic& rGraphic,
-                                            const tools::Rectangle* pRect = nullptr,
-                                            const sal_uIntPtr nFlags = 0 );
+                                            const tools::Rectangle* pRect = nullptr );
 };
 
 #endif // INCLUDED_SVX_CONTDLG_HXX
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index ee3f962d63c7..692e8face2cd 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -103,8 +103,7 @@ void SvxContourDlg::SetSuperClass( SvxSuperContourDlg& rSuperClass )
 }
 
 tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
-                                                     const tools::Rectangle* pRect,
-                                                     const sal_uIntPtr nFlags )
+                                                     const tools::Rectangle* pRect )
 {
     Bitmap  aBmp;
     XOutFlags nContourFlags = XOutFlags::ContourHorz;
@@ -132,7 +131,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
                     // offset of the sub-image within the total animation
                     aTransMap.SetOrigin( Point( rStepBmp.aPosPix.X(), rStepBmp.aPosPix.Y() ) );
                     pVDev->SetMapMode( aTransMap );
-                    pVDev->DrawPolyPolygon( CreateAutoContour( rStepBmp.aBmpEx, pRect, nFlags ) );
+                    pVDev->DrawPolyPolygon( CreateAutoContour( rStepBmp.aBmpEx, pRect ) );
                 }
 
                 aTransMap.SetOrigin( Point() );
commit 9f066938fb336688658b06652b701905988ae98c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 12:07:12 2017 +0200

    SDRVIEWWIN_NOTFOUND is dead
    
    ever since
        commit 90b152881e398ef1493130c3fb08bf646fbb807d
        Date:   Sun Jan 16 19:11:44 2011 +0100
        Remove some dead code in 'view'
    
    Change-Id: Ic760605462960f6a5d2dd9280152081311c765cb
    Reviewed-on: https://gerrit.libreoffice.org/46343
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index b996c3fe1778..24bdb25d7d41 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -69,10 +69,6 @@ enum class SdrAnimationMode
 };
 
 
-// defines
-#define SDRVIEWWIN_NOTFOUND     (0xFFFF)
-
-
 class SdrPaintView;
 
 namespace sdr
commit eb4c35b3104f4ca758e3a8eb86e194a5b8681aa7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 12:02:03 2017 +0200

    SDR_ANYITEM is dead
    
    ever since initial import in
        commit a4288059c2511f3a6cf3897ed6191dc3e6a1da63
        Date:   Wed Apr 11 15:27:24 2007 +0000
        INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
    
    Change-Id: I1e51f58b0e6062a6a3179ce7fad3170c19758f50
    Reviewed-on: https://gerrit.libreoffice.org/46342
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 0235d320fb31..b996c3fe1778 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -70,7 +70,6 @@ enum class SdrAnimationMode
 
 
 // defines
-#define SDR_ANYITEM             (0xFFFF)
 #define SDRVIEWWIN_NOTFOUND     (0xFFFF)
 
 
commit 6c1f20789ece150d8903d5d18f256ede233ddc75
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 11:55:57 2017 +0200

    SDR_ANYFORMAT is unused
    
    since
        commit 595f46344e18fd6275ff7b862269e4c131449591
        Date:   Mon Feb 29 13:37:14 2016 +0200
        loplugin:unuseddefaultparam in svx (part1)
    
    Change-Id: I1c951df4fb75418036ca9c42a3c63daec879f3b4
    Reviewed-on: https://gerrit.libreoffice.org/46341
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 09b91178299a..0235d320fb31 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -70,7 +70,6 @@ enum class SdrAnimationMode
 
 
 // defines
-#define SDR_ANYFORMAT           (0xFFFFFFFF)
 #define SDR_ANYITEM             (0xFFFF)
 #define SDRVIEWWIN_NOTFOUND     (0xFFFF)
 
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index 5d87ebcb5adb..0fc3672b562c 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -259,12 +259,6 @@ public:
 //     bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin);
 //     bool Command(const CommandEvent& rCEvt, vcl::Window* pWin);
 //
-//   Exchange (Clipboard currently without SdrPrivateData):
-//   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//     sal_Bool Cut(sal_uIntPtr nFormat=SDR_ANYFORMAT);
-//     sal_Bool Yank(sal_uIntPtr nFormat=SDR_ANYFORMAT);
-//     sal_Bool Paste(vcl::Window* pWin=NULL, sal_uIntPtr nFormat=SDR_ANYFORMAT);
-//
 //   SfxItems:
 //   ~~~~~~~~~
 //     sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
commit fbb6ff11c843feeb591fcdd93b77db7077439ce8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 12 11:52:30 2017 +0200

    sal_uIntPtr->sal_Int32 in SdrMarkView
    
    Change-Id: Iec5c9e45ec753de98142615fdde16f61c393a6e2
    Reviewed-on: https://gerrit.libreoffice.org/46311
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 3fba52b0453e..1741f7c8ca38 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -305,9 +305,9 @@ public:
     void SetMarkHdlSizePixel(sal_uInt16 nSiz);
 
     virtual bool HasMarkablePoints() const;
-    virtual sal_uIntPtr GetMarkablePointCount() const;
+    virtual sal_Int32 GetMarkablePointCount() const;
     virtual bool HasMarkedPoints() const;
-    virtual sal_uIntPtr GetMarkedPointCount() const;
+    virtual sal_Int32 GetMarkedPointCount() const;
 
     // There might be points which can't be marked:
     virtual bool IsPointMarkable(const SdrHdl& rHdl) const;
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index c99e729f9fe7..cdc7dac65b24 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -752,7 +752,7 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
     return true;
 }
 
-sal_uLong MotionPathTag::GetMarkablePointCount() const
+sal_Int32 MotionPathTag::GetMarkablePointCount() const
 {
     if( mpPathObj && isSelected() )
     {
@@ -764,7 +764,7 @@ sal_uLong MotionPathTag::GetMarkablePointCount() const
     }
 }
 
-sal_uLong MotionPathTag::GetMarkedPointCount() const
+sal_Int32 MotionPathTag::GetMarkedPointCount() const
 {
     if( mpMark )
     {
diff --git a/sd/source/ui/animations/motionpathtag.hxx b/sd/source/ui/animations/motionpathtag.hxx
index 54ba50d03617..0e785cece1e2 100644
--- a/sd/source/ui/animations/motionpathtag.hxx
+++ b/sd/source/ui/animations/motionpathtag.hxx
@@ -50,8 +50,8 @@ public:
     virtual bool KeyInput( const KeyEvent& rKEvt ) override;
 
     // callbacks from sdr view
-    virtual sal_uLong GetMarkablePointCount() const override;
-    virtual sal_uLong GetMarkedPointCount() const override;
+    virtual sal_Int32 GetMarkablePointCount() const override;
+    virtual sal_Int32 GetMarkedPointCount() const override;
     virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark) override;
     virtual void CheckPossibilities() override;
     virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override;
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index b607a3a4bfad..bd3de09cabfe 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -420,12 +420,12 @@ void AnnotationTag::CheckPossibilities()
 {
 }
 
-sal_uLong AnnotationTag::GetMarkablePointCount() const
+sal_Int32 AnnotationTag::GetMarkablePointCount() const
 {
     return 0;
 }
 
-sal_uLong AnnotationTag::GetMarkedPointCount() const
+sal_Int32 AnnotationTag::GetMarkedPointCount() const
 {
     return 0;
 }
diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx
index 9be1541bf988..3f5870227269 100644
--- a/sd/source/ui/annotations/annotationtag.hxx
+++ b/sd/source/ui/annotations/annotationtag.hxx
@@ -50,8 +50,8 @@ public:
     virtual bool Command( const CommandEvent& rCEvt ) override;
 
     // callbacks from sdr view
-    virtual sal_uLong GetMarkablePointCount() const override;
-    virtual sal_uLong GetMarkedPointCount() const override;
+    virtual sal_Int32 GetMarkablePointCount() const override;
+    virtual sal_Int32 GetMarkedPointCount() const override;
     virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark) override;
     virtual void CheckPossibilities() override;
     virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override;
diff --git a/sd/source/ui/func/smarttag.cxx b/sd/source/ui/func/smarttag.cxx
index 53a2e545af16..f72830c15383 100644
--- a/sd/source/ui/func/smarttag.cxx
+++ b/sd/source/ui/func/smarttag.cxx
@@ -85,12 +85,12 @@ bool SmartTag::getContext( SdrViewContext& /*rContext*/ )
     return false;
 }
 
-sal_uLong SmartTag::GetMarkablePointCount() const
+sal_Int32 SmartTag::GetMarkablePointCount() const
 {
     return 0;
 }
 
-sal_uLong SmartTag::GetMarkedPointCount() const
+sal_Int32 SmartTag::GetMarkedPointCount() const
 {
     return 0;
 }
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 63b124b33f42..271a8850f707 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -185,9 +185,9 @@ public:
 
     virtual SdrViewContext GetContext() const override;
     virtual bool HasMarkablePoints() const override;
-    virtual sal_uLong GetMarkablePointCount() const override;
+    virtual sal_Int32 GetMarkablePointCount() const override;
     virtual bool HasMarkedPoints() const override;
-    virtual sal_uLong GetMarkedPointCount() const override;
+    virtual sal_Int32 GetMarkedPointCount() const override;
     virtual bool IsPointMarkable(const SdrHdl& rHdl) const override;
     virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark=false) override;
     virtual void CheckPossibilities() override;
diff --git a/sd/source/ui/inc/smarttag.hxx b/sd/source/ui/inc/smarttag.hxx
index 47006f8b75b0..821f2e45f364 100644
--- a/sd/source/ui/inc/smarttag.hxx
+++ b/sd/source/ui/inc/smarttag.hxx
@@ -68,8 +68,8 @@ public:
     ::sd::View& getView() const { return mrView; }
 
 protected:
-    virtual sal_uLong GetMarkablePointCount() const;
-    virtual sal_uLong GetMarkedPointCount() const;
+    virtual sal_Int32 GetMarkablePointCount() const;
+    virtual sal_Int32 GetMarkedPointCount() const;
     virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark);
     virtual void CheckPossibilities();
     virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark);
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index a850126f0891..28c80e6204b0 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -1133,9 +1133,9 @@ bool View::HasMarkablePoints() const
         return FmFormView::HasMarkablePoints();
 }
 
-sal_uLong View::GetMarkablePointCount() const
+sal_Int32 View::GetMarkablePointCount() const
 {
-    sal_uLong nCount = FmFormView::GetMarkablePointCount();
+    sal_Int32 nCount = FmFormView::GetMarkablePointCount();
     nCount += maSmartTags.GetMarkablePointCount();
     return nCount;
 }
@@ -1148,9 +1148,9 @@ bool View::HasMarkedPoints() const
         return FmFormView::HasMarkedPoints();
 }
 
-sal_uLong View::GetMarkedPointCount() const
+sal_Int32 View::GetMarkedPointCount() const
 {
-    sal_uLong nCount = FmFormView::GetMarkedPointCount();
+    sal_Int32 nCount = FmFormView::GetMarkedPointCount();
     nCount += maSmartTags.GetMarkedPointCount();
     return nCount;
 }
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 252dfd456b9b..19cafe3e0b30 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -519,7 +519,7 @@ bool SdrDragView::EndDragObj(bool bCopy)
     // #i73341# If inserting GluePoint, do not insist on last points being different
     if(mpCurrentSdrDragMethod && maDragStat.IsMinMoved() && (IsInsertGluePoint() || maDragStat.GetNow() != maDragStat.GetPrev()))
     {
-        sal_uIntPtr nSavedHdlCount=0;
+        sal_Int32 nSavedHdlCount=0;
 
         if (bEliminatePolyPoints)
         {
diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx
index b83a99f82c84..e1f41bf58e96 100644
--- a/svx/source/svdraw/svdmrkv1.cxx
+++ b/svx/source/svdraw/svdmrkv1.cxx
@@ -47,10 +47,10 @@ bool SdrMarkView::HasMarkablePoints() const
     return bRet;
 }
 
-sal_uIntPtr SdrMarkView::GetMarkablePointCount() const
+sal_Int32 SdrMarkView::GetMarkablePointCount() const
 {
     ForceUndirtyMrkPnt();
-    sal_uIntPtr nCount=0;
+    sal_Int32 nCount=0;
     if (!ImpIsFrameHandles()) {
         const size_t nMarkCount=GetMarkedObjectCount();
         if (nMarkCount<=static_cast<size_t>(mnFrameHandlesLimit)) {
@@ -83,10 +83,10 @@ bool SdrMarkView::HasMarkedPoints() const
     return bRet;
 }
 
-sal_uIntPtr SdrMarkView::GetMarkedPointCount() const
+sal_Int32 SdrMarkView::GetMarkedPointCount() const
 {
     ForceUndirtyMrkPnt();
-    sal_uIntPtr nCount=0;
+    sal_Int32 nCount=0;
     if (!ImpIsFrameHandles()) {
         size_t nMarkCount=GetMarkedObjectCount();
         if (nMarkCount<=static_cast<size_t>(mnFrameHandlesLimit)) {


More information about the Libreoffice-commits mailing list