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

Noel Grandin noel at peralex.com
Mon Jun 27 05:20:42 UTC 2016


 include/svx/svddrgv.hxx        |   40 ------------------------------------
 include/svx/svdedtv.hxx        |    2 -
 include/svx/svdedxv.hxx        |    4 ---
 include/svx/svdetc.hxx         |    7 ++----
 svx/source/svdraw/svdcrtv.cxx  |   45 +++++++++++++++++++----------------------
 svx/source/svdraw/svddrgmt.cxx |   14 ------------
 svx/source/svdraw/svddrgv.cxx  |    6 -----
 svx/source/svdraw/svdedtv.cxx  |    2 -
 svx/source/svdraw/svdedxv.cxx  |    1 
 svx/source/svdraw/svdetc.cxx   |    1 
 svx/source/svdraw/svdoedge.cxx |   14 +++---------
 svx/source/svdraw/svdview.cxx  |    9 ++------
 12 files changed, 32 insertions(+), 113 deletions(-)

New commits:
commit 78ca0ce54a2cd79736247ea8cf69ad5fc797ee1a
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Jun 24 15:56:44 2016 +0200

    loplugin:singlevalfields in svx(part3)
    
    Change-Id: I6b7a33b5f1297309a7225cac8150dbf1175506b6
    Reviewed-on: https://gerrit.libreoffice.org/26642
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/svx/svddrgv.hxx b/include/svx/svddrgv.hxx
index 91fd524..b96fb27 100644
--- a/include/svx/svddrgv.hxx
+++ b/include/svx/svddrgv.hxx
@@ -48,9 +48,7 @@ protected:
     bool                        mbDragLimit : 1;      // Limit on SnapRect instead of BoundRect
     bool                        mbDragHdl : 1;        // TRUE: RefPt is slid
     bool                        mbDragStripes : 1;    // Persistent
-    bool                        mbMirrRefDragObj : 1; // Persistent - During the drag, show the mirror axis of the mirrored objects as Xor
     bool                        mbSolidDragging : 1;  // allow solid create/drag of objects
-    bool                        mbMouseHideWhileDraggingPoints : 1;
     bool                        mbResizeAtCenter : 1;
     bool                        mbCrookAtCenter : 1;
     bool                        mbDragWithCopy : 1;
@@ -58,10 +56,6 @@ protected:
     bool                        mbInsObjPointMode : 1;
     bool                        mbInsGluePointMode : 1;
     bool                        mbNoDragXorPolys : 1;
-    bool                        mbAutoVertexCon : 1;  // automatic generation of connectors at the vertices
-    bool                        mbAutoCornerCon : 1;  // automatic generation of connectors at the corners
-    bool                        mbRubberEdgeDragging : 1;
-    bool                        mbDetailedEdgeDragging : 1;
 
 private:
     SVX_DLLPRIVATE void ImpClearVars();
@@ -145,14 +139,6 @@ public:
     void SetDragStripes(bool bOn);
     bool IsDragStripes() const { return mbDragStripes; }
 
-    // hide handles during dragging
-    //HMHvoid SetDragHdlHide(bool bOn);
-    //HMHBOOL IsDragHdlHide() const { return bNoDragHdl; }
-
-    // Hide the mouse when dragging polygon points or glue points.
-    // Default=false
-    bool IsMouseHideWhileDraggingPoints() const { return mbMouseHideWhileDraggingPoints; }
-
     // As a general rule, the contours of the selected objects
     // are displayed as Xor-polygons. If this flag is set, only one
     // Xor-Frame is drawn (e.g. in case of multiple selection).
@@ -178,32 +164,6 @@ public:
     void SetSolidDragging(bool bOn);
     bool IsSolidDragging() const;
 
-    // Dragging/Creation of connectors:
-    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    // Stick Connectors to vertices
-    // Default=true=Yes
-    bool IsAutoVertexConnectors() const { return mbAutoVertexCon; }
-
-    // Stick Connectors to Corners
-    // Default=false=No
-    bool IsAutoCornerConnectors() const { return mbAutoCornerCon; }
-
-    // Dragging of connected objects (Nodes):
-    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    // DetailedEdgeDraggingLimit: like RubberEdgeDraggingLimit,
-    // but this limit refers to the detailed depiction, i.e. not
-    // only rubber bands but total recalculations are visible while
-    // dragging. This detailed depiction is only possible in MoveDrag.
-    // Default value: 10
-    bool IsDetailedEdgeDragging() const { return mbDetailedEdgeDragging; }
-
-    // EdgeDraggingLimit: If more than nEdgeObjCount edges are affected,
-    // they are not shown in the interactive dragging.
-    // This here talks about the "rubber bands", which take less computing time
-    // than the complete recalculations in the DetailedEdgeDragging.
-    // default value: 100
-    bool IsRubberEdgeDragging() const { return mbRubberEdgeDragging; }
-
     // Connector handling is thus as follows (when using default settings):
     // - If at most 10 Connectors are affected, they are recalculated
     //   on each MouseMove.
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 6b5caa9..71c1fd2 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -96,8 +96,6 @@ protected:
     bool                        bOneOrMoreMovable : 1;        // at least one object is moveable
     bool                        bMoreThanOneNoMovRot : 1;     // more then one object is not movable nor turnable (Crook)
     bool                        bContortionPossible : 1;      // all polygones (grouped if necessary)
-    bool                        bAllPolys : 1;                // all polygones (not grouped)
-    bool                        bOneOrMorePolys : 1;          // at least one polygon (not grouped)
     bool                        bMoveAllowed : 1;
     bool                        bResizeFreeAllowed : 1;
     bool                        bResizePropAllowed : 1;
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 519ba6e..78ed1e0 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -84,7 +84,6 @@ protected:
     bool                        bTextEditOnlyOneView : 1;  // a single OutlinerView (f. spellchecking)
     bool                        bTextEditNewObj : 1;       // current edited object was just recreated
     bool                        bQuickTextEditMode : 1;    // persistent(->CrtV). Default=TRUE
-    bool                        bMacroMode : 1;            // persistent(->CrtV). Default=TRUE
     bool                        bMacroDown : 1;
 
     rtl::Reference< sdr::SelectionController > mxSelectionController;
@@ -242,9 +241,6 @@ public:
 
     // Object-MacroModus (e.g. rect as button or sth. like that):
 
-    // Persistent. Default TRUE. SvDraw evaluates the flag e.g. at SdrView::GetPreferredPointer().
-    // Has only effect, if the document has draw-objects with macrofunctionality (SdrObject::HasMacro()==sal_True).
-    bool IsMacroMode() const { return bMacroMode; }
     bool BegMacroObj(const Point& rPnt, short nTol, SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin);
     void BegMacroObj(const Point& rPnt, SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin) { BegMacroObj(rPnt,-2,pObj,pPV,pWin); }
     void MovMacroObj(const Point& rPnt);
diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx
index 577a1d9..9beca6f 100644
--- a/include/svx/svdetc.hxx
+++ b/include/svx/svdetc.hxx
@@ -64,10 +64,9 @@ SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel&
 class SVX_DLLPUBLIC SdrEngineDefaults
 {
 friend class SdrAttrObj;
-    Color      aFontColor;
+    Color            aFontColor;
     sal_uIntPtr      nFontHeight;
-    MapUnit    eMapUnit;
-    Fraction   aMapFraction;
+    Fraction         aMapFraction;
 
 private:
     static SdrEngineDefaults& GetDefaults();
@@ -87,7 +86,7 @@ public:
     // The MapMode is needed for the global Outliner.
     // Incidentally, every newly instantiated SdrModel is assigned this MapMode by default.
     // Default MapUnit is MAP_100TH_MM
-    static MapUnit    GetMapUnit()                         { return GetDefaults().eMapUnit; }
+    static MapUnit    GetMapUnit()                         { return MAP_100TH_MM; }
 
     // Default MapFraction is 1/1.
     static Fraction   GetMapFraction()                     { return GetDefaults().aMapFraction; }
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index 7b070cb..6e1c619 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -80,31 +80,28 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S
             maObjects.append(*pNew);
 
             // glue points
-            if(rView.IsAutoVertexConnectors())
+            for(sal_uInt16 i(0); i < 4; i++)
             {
-                for(sal_uInt16 i(0); i < 4; i++)
-                {
-                    SdrGluePoint aGluePoint(rObject.GetVertexGluePoint(i));
-                    const Point& rPosition = aGluePoint.GetAbsolutePos(rObject);
-
-                    basegfx::B2DPoint aTopLeft(rPosition.X() - aHalfLogicSize.Width(), rPosition.Y() - aHalfLogicSize.Height());
-                    basegfx::B2DPoint aBottomRight(rPosition.X() + aHalfLogicSize.Width(), rPosition.Y() + aHalfLogicSize.Height());
-
-                    basegfx::B2DPolygon aTempPoly;
-                    aTempPoly.append(aTopLeft);
-                    aTempPoly.append(basegfx::B2DPoint(aBottomRight.getX(), aTopLeft.getY()));
-                    aTempPoly.append(aBottomRight);
-                    aTempPoly.append(basegfx::B2DPoint(aTopLeft.getX(), aBottomRight.getY()));
-                    aTempPoly.setClosed(true);
-
-                    basegfx::B2DPolyPolygon aTempPolyPoly;
-                    aTempPolyPoly.append(aTempPoly);
-
-                    pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled(
-                        aTempPolyPoly);
-                    xTargetOverlay->add(*pNew);
-                    maObjects.append(*pNew);
-                }
+                SdrGluePoint aGluePoint(rObject.GetVertexGluePoint(i));
+                const Point& rPosition = aGluePoint.GetAbsolutePos(rObject);
+
+                basegfx::B2DPoint aTopLeft(rPosition.X() - aHalfLogicSize.Width(), rPosition.Y() - aHalfLogicSize.Height());
+                basegfx::B2DPoint aBottomRight(rPosition.X() + aHalfLogicSize.Width(), rPosition.Y() + aHalfLogicSize.Height());
+
+                basegfx::B2DPolygon aTempPoly;
+                aTempPoly.append(aTopLeft);
+                aTempPoly.append(basegfx::B2DPoint(aBottomRight.getX(), aTopLeft.getY()));
+                aTempPoly.append(aBottomRight);
+                aTempPoly.append(basegfx::B2DPoint(aTopLeft.getX(), aBottomRight.getY()));
+                aTempPoly.setClosed(true);
+
+                basegfx::B2DPolyPolygon aTempPolyPoly;
+                aTempPolyPoly.append(aTempPoly);
+
+                pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled(
+                    aTempPolyPoly);
+                xTargetOverlay->add(*pNew);
+                maObjects.append(*pNew);
             }
         }
     }
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 2a636e1..2e5b105 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -841,11 +841,6 @@ bool SdrDragMethod::DoAddConnectorOverlays()
         return false;
     }
 
-    if(!getSdrDragView().IsRubberEdgeDragging() && !getSdrDragView().IsDetailedEdgeDragging())
-    {
-        return false;
-    }
-
     if(getSdrDragView().IsDraggingPoints() || getSdrDragView().IsDraggingGluePoints())
     {
         return false;
@@ -858,13 +853,6 @@ bool SdrDragMethod::DoAddConnectorOverlays()
         return false;
     }
 
-    const bool bDetail(getSdrDragView().IsDetailedEdgeDragging() && getMoveOnly());
-
-    if(!bDetail && !getSdrDragView().IsRubberEdgeDragging())
-    {
-        return false;
-    }
-
     // one more migrated from SdrEdgeObj::NspToggleEdgeXor
     if( dynamic_cast< const SdrDragObjOwn* >(this) != nullptr || dynamic_cast< const SdrDragMovHdl* >(this) != nullptr )
     {
@@ -877,7 +865,7 @@ bool SdrDragMethod::DoAddConnectorOverlays()
 drawinglayer::primitive2d::Primitive2DContainer SdrDragMethod::AddConnectorOverlays()
 {
     drawinglayer::primitive2d::Primitive2DContainer aRetval;
-    const bool bDetail(getSdrDragView().IsDetailedEdgeDragging() && getMoveOnly());
+    const bool bDetail(getMoveOnly());
     const SdrMarkList& rMarkedNodes = getSdrDragView().GetEdgesOfMarkedNodes();
 
     for(size_t a = 0; a < rMarkedNodes.GetMarkCount(); ++a)
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index c9dbcfa..fc0a7f8 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -59,7 +59,6 @@ void SdrDragView::ImpClearVars()
     mbDragSpecial=false;
     mpCurrentSdrDragMethod=nullptr;
     mbDragStripes=false;
-    mbMirrRefDragObj=true;
     mbDragWithCopy=false;
     mpInsPointUndo=nullptr;
     mbInsGluePoint=false;
@@ -68,14 +67,9 @@ void SdrDragView::ImpClearVars()
     mnDragXorPolyLimit=100;
     mnDragXorPointLimit=500;
     mbNoDragXorPolys=false;
-    mbAutoVertexCon=true;
-    mbAutoCornerCon=false;
-    mbRubberEdgeDragging=true;
-    mbDetailedEdgeDragging=true;
     mnDetailedEdgeDraggingLimit=10;
     mbResizeAtCenter=false;
     mbCrookAtCenter=false;
-    mbMouseHideWhileDraggingPoints=false;
 
     // init using default
     mbSolidDragging = getOptionsDrawinglayer().IsSolidDragCreate();
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index b3f97e6..6e8b88d 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -61,8 +61,6 @@ void SdrEditView::ImpResetPossibilityFlags()
     bOneOrMoreMovable       =false;
     bMoreThanOneNoMovRot    =false;
     bContortionPossible     =false;
-    bAllPolys               =false;
-    bOneOrMorePolys         =false;
     bMoveAllowed            =false;
     bResizeFreeAllowed      =false;
     bResizePropAllowed      =false;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index c5f6085..a0fcb81 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -70,7 +70,6 @@
 void SdrObjEditView::ImpClearVars()
 {
     bQuickTextEditMode=true;
-    bMacroMode=true;
     pTextEditOutliner=nullptr;
     pTextEditOutlinerView=nullptr;
     pTextEditPV=nullptr;
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 439371b..1ca4870 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -391,7 +391,6 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol)
 SdrEngineDefaults::SdrEngineDefaults():
     aFontColor(COL_AUTO),
     nFontHeight(847),             // 847/100mm = ca. 24 Point
-    eMapUnit(MAP_100TH_MM),
     aMapFraction(1,1)
 {
 }
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 04621c9..6a88a87 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -2146,18 +2146,12 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO
                         bOk = true;
                     } else if (bVertex && !bUserFnd) {
                         nConNum=nConNum-nConAnz;
-                        if (rPV.GetView().IsAutoVertexConnectors()) {
-                            SdrGluePoint aPt(pObj->GetVertexGluePoint(nConNum));
-                            aConPos=aPt.GetAbsolutePos(*pObj);
-                            bOk = true;
-                        } else i+=3;
+                        SdrGluePoint aPt(pObj->GetVertexGluePoint(nConNum));
+                        aConPos=aPt.GetAbsolutePos(*pObj);
+                        bOk = true;
                     } else if (bCorner && !bUserFnd) {
                         nConNum-=nConAnz+4;
-                        if (rPV.GetView().IsAutoCornerConnectors()) {
-                            SdrGluePoint aPt(pObj->GetCornerGluePoint(nConNum));
-                            aConPos=aPt.GetAbsolutePos(*pObj);
-                            bOk = true;
-                        } else i+=3;
+                        i+=3;
                     }
                     else if (bCenter && !bUserFnd && !bEdge)
                     {
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index bc0475c..41497aa 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <editeng/eeitem.hxx>
+#include <editeng/outlobj.hxx>
 
 #include "svx/svdstr.hrc"
 #include "svdglob.hxx"
@@ -398,7 +399,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
     {
         eHit=SDRHIT_HELPLINE; // help line in foreground hit: can be moved now
     }
-    if (IsMacroMode() && eHit==SDRHIT_UNMARKEDOBJECT)
+    if (eHit==SDRHIT_UNMARKEDOBJECT)
     {
         bool bRoot=pObj->HasMacro();
         bool bDeep=pObj!=pHitObj && pHitObj->HasMacro();
@@ -443,7 +444,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
         }
     }
     // check for URL field
-    if (IsMacroMode() && eHit==SDRHIT_UNMARKEDOBJECT)
+    if (eHit==SDRHIT_UNMARKEDOBJECT)
     {
         SdrTextObj* pTextObj=dynamic_cast<SdrTextObj*>( pHitObj );
         if (pTextObj!=nullptr && pTextObj->HasText())
@@ -934,7 +935,6 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
     }
     return bRet;
 }
-#include <editeng/outlobj.hxx>
 
 Pointer SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier, bool bLeftDown) const
 {
@@ -945,9 +945,6 @@ Pointer SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice*
     }
     if (mpCurrentSdrDragMethod)
     {
-        if ((IsDraggingPoints() || IsDraggingGluePoints()) && IsMouseHideWhileDraggingPoints())
-            return Pointer(PointerStyle::Null);
-
         return mpCurrentSdrDragMethod->GetSdrDragPointer();
     }
     if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsSetPageOrg()) return Pointer(PointerStyle::Arrow);


More information about the Libreoffice-commits mailing list