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

Noel Grandin noel.grandin at collabora.co.uk
Wed Oct 4 06:39:55 UTC 2017


 include/svx/svdglev.hxx        |    4 ++--
 include/svx/svdpntv.hxx        |    4 +---
 include/svx/svxdlg.hxx         |    2 --
 sd/source/ui/view/drviews7.cxx |    2 +-
 svx/source/svdraw/svdglev.cxx  |   32 ++++++++++++++++++--------------
 5 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit e5c91797d355ed2d6ce65e460880443d8de94d1a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Oct 3 15:38:57 2017 +0200

    convert SDR_TRISTATE to TriState
    
    Change-Id: Iac440d313006d01667e433bea97925ccaa9282da
    Reviewed-on: https://gerrit.libreoffice.org/43084
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdglev.hxx b/include/svx/svdglev.hxx
index d085464f6d65..10645f0a5aaa 100644
--- a/include/svx/svdglev.hxx
+++ b/include/svx/svdglev.hxx
@@ -48,12 +48,12 @@ public:
     // which one wished to check,set or delete
     // possible values for nThisEsc are:
     // SdrEscapeDirection::LEFT, SdrEscapeDirection::RIGHT, SdrEscapeDirection::TOP and SdrEscapeDirection::BOTTOM
-    SDR_TRISTATE IsMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc) const;
+    TriState IsMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc) const;
     void SetMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc, bool bOn);
 
     // check/set, if the GluePoints are relative to the
     // object size (Percent=sal_True) or not (Percent=sal_False)
-    SDR_TRISTATE IsMarkedGluePointsPercent() const;
+    TriState IsMarkedGluePointsPercent() const;
     void SetMarkedGluePointsPercent(bool bOn);
 
     // bVert=FALSE: check/set hotizontal alignment
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 96c24a3b04f8..fede2d744bb1 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -69,9 +69,7 @@ enum class SdrAnimationMode
 };
 
 
-// Typedefs and defines
-typedef unsigned char SDR_TRISTATE;
-#define FUZZY                   (2)
+// defines
 #define SDR_ANYFORMAT           (0xFFFFFFFF)
 #define SDR_ANYITEM             (0xFFFF)
 #define SDRVIEWWIN_NOTFOUND     (0xFFFF)
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 437e847b0682..70af2889ba9f 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -479,7 +479,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
         SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_VERTALIGN_BOTTOM ) )
     {
         // percent
-        SDR_TRISTATE eState = mpDrawView->IsMarkedGluePointsPercent();
+        TriState eState = mpDrawView->IsMarkedGluePointsPercent();
         if( eState == TRISTATE_INDET )
             rSet.InvalidateItem( SID_GLUE_PERCENT );
         else
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx
index 9c1ca2fed77e..01445226af17 100644
--- a/svx/source/svdraw/svdglev.cxx
+++ b/svx/source/svdraw/svdglev.cxx
@@ -85,26 +85,26 @@ void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, co
 
 static void ImpGetEscDir(SdrGluePoint & rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnThisEsc, const void* pnRet, const void*)
 {
-    sal_uInt16& nRet=*const_cast<sal_uInt16 *>(static_cast<sal_uInt16 const *>(pnRet));
-    if (nRet!=FUZZY) {
+    TriState& nRet=*const_cast<TriState *>(static_cast<TriState const *>(pnRet));
+    if (nRet!=TRISTATE_INDET) {
         SdrEscapeDirection nEsc = rGP.GetEscDir();
         bool bOn = bool(nEsc & *static_cast<SdrEscapeDirection const *>(pnThisEsc));
         bool& bFirst=*const_cast<bool *>(static_cast<bool const *>(pbFirst));
         if (bFirst) {
-            nRet = bOn ? 1 : 0;
+            nRet = bOn ? TRISTATE_TRUE : TRISTATE_FALSE;
             bFirst = false;
         }
-        else if (nRet != (bOn ? 1 : 0)) nRet=FUZZY;
+        else if (nRet != (bOn ? TRISTATE_TRUE : TRISTATE_FALSE)) nRet=TRISTATE_INDET;
     }
 }
 
-SDR_TRISTATE SdrGlueEditView::IsMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc) const
+TriState SdrGlueEditView::IsMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc) const
 {
     ForceUndirtyMrkPnt();
     bool bFirst=true;
-    sal_uInt16 nRet=0;
+    TriState nRet=TRISTATE_FALSE;
     const_cast<SdrGlueEditView*>(this)->ImpDoMarkedGluePoints(ImpGetEscDir,true,&bFirst,&nThisEsc,&nRet);
-    return (SDR_TRISTATE)nRet;
+    return nRet;
 }
 
 static void ImpSetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pnThisEsc, const void* pbOn, const void*, const void*)
@@ -128,22 +128,26 @@ void SdrGlueEditView::SetMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc, boo
 
 static void ImpGetPercent(SdrGluePoint & rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnRet, const void*, const void*)
 {
-    sal_uInt16& nRet=*const_cast<sal_uInt16 *>(static_cast<sal_uInt16 const *>(pnRet));
-    if (nRet!=FUZZY) {
+    TriState& nRet=*const_cast<TriState *>(static_cast<TriState const *>(pnRet));
+    if (nRet!=TRISTATE_INDET) {
         bool bOn=rGP.IsPercent();
         bool& bFirst=*const_cast<bool *>(static_cast<bool const *>(pbFirst));
-        if (bFirst) { nRet=sal_uInt16(bOn); bFirst=false; }
-        else if ((nRet!=0)!=bOn) nRet=FUZZY;
+        if (bFirst) {
+            nRet = bOn ? TRISTATE_TRUE : TRISTATE_FALSE;
+            bFirst = false;
+        }
+        else if ((nRet!=TRISTATE_FALSE)!=bOn)
+            nRet=TRISTATE_INDET;
     }
 }
 
-SDR_TRISTATE SdrGlueEditView::IsMarkedGluePointsPercent() const
+TriState SdrGlueEditView::IsMarkedGluePointsPercent() const
 {
     ForceUndirtyMrkPnt();
     bool bFirst=true;
-    sal_uInt16 nRet=sal_uInt16(true);
+    TriState nRet = TRISTATE_TRUE;
     const_cast<SdrGlueEditView*>(this)->ImpDoMarkedGluePoints(ImpGetPercent,true,&bFirst,&nRet);
-    return (SDR_TRISTATE)nRet;
+    return nRet;
 }
 
 static void ImpSetPercent(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbOn, const void*, const void*, const void*)
commit c96fb68d9527ef5a30dfcb7ba5b04122ee2e94ee
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Oct 3 14:24:28 2017 +0200

    PLinkStub is dead
    
    since
        commit 1d852b32d7ad89b2317c04958060f366f8922ca4
        Date:   Thu Jul 16 09:49:37 2015 +0200
        loplugin:unusedmethods svx
    
    Change-Id: I1c039fd71571a069531684857ae971e6acb4f49c
    Reviewed-on: https://gerrit.libreoffice.org/43081
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 12f7f70372eb..547cd76276cb 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -98,8 +98,6 @@ public:
     virtual SfxBindings& GetBindings() = 0;
 };
 
-typedef sal_IntPtr (*PLinkStub)( void*, void* );
-
 class AbstractSearchProgress :public VclAbstractRefreshableDialog
 {
 protected:


More information about the Libreoffice-commits mailing list