svx/source/svdraw/svdorect.cxx |   52 ++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 28 deletions(-)

New commits:
commit 87fb1507750269d43d518de895931fb4483a84ae
Author:     Regina Henschel <rb.hensc...@t-online.de>
AuthorDate: Thu Nov 8 10:17:55 2018 +0100
Commit:     Regina Henschel <rb.hensc...@t-online.de>
CommitDate: Sat Nov 10 12:56:27 2018 +0100

    tdf#121258 Use correct kind of handles for legacy rectangle
    
    Text box and rectangle have the same kind and number of handles in
    'Edit Point' mode. Only that a text box has an additional handle for
    its blinking frame. The error was, that this special one was not
    skipped for a rectangle.
    
    Change-Id: Iae7af3eb196e61e32ecd5a39ba0ec553bbdaaa48
    Reviewed-on: https://gerrit.libreoffice.org/63070
    Tested-by: Jenkins
    Reviewed-by: Regina Henschel <rb.hensc...@t-online.de>

diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index e182c7e64960..d9b74ea3aaa9 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -312,26 +312,26 @@ sal_uInt32 SdrRectObj::GetHdlCount() const
 
 void SdrRectObj::AddToHdlList(SdrHdlList& rHdlList) const
 {
-    sal_Int32 nCount = IsTextFrame() ? 10 : 9;
-    for(sal_Int32 nHdlNum = 0; nHdlNum < nCount; ++nHdlNum)
+    // A text box has an additional (pseudo-)handle for the blinking frame.
+    if(IsTextFrame())
+    {
+        OSL_ENSURE(!IsTextEditActive(), "Do not use a ImpTextframeHdl for 
highlighting text in active text edit, this will collide with EditEngine paints 
(!)");
+        // hack for calc grid sync to ensure the hatched area
+        // for a textbox is displayed at correct position
+        std::unique_ptr<SdrHdl> pH(new ImpTextframeHdl(maRect + 
GetGridOffset()));
+        pH->SetObj(const_cast<SdrRectObj*>(this));
+        pH->SetRotationAngle(aGeo.nRotationAngle);
+        rHdlList.AddHdl(std::move(pH));
+    }
+
+    for(sal_Int32 nHdlNum = 1; nHdlNum <= 9; ++nHdlNum)
     {
-        std::unique_ptr<SdrHdl> pH;
         Point aPnt;
         SdrHdlKind eKind = SdrHdlKind::Move;
 
         switch(nHdlNum)
         {
-            case 0:
-            {
-                OSL_ENSURE(!IsTextEditActive(), "Do not use a ImpTextframeHdl 
for highlighting text in active text edit, this will collide with EditEngine 
paints (!)");
-                // hack for calc grid sync to ensure the hatched area
-                // for a textbox is displayed at correct position
-                pH.reset(new ImpTextframeHdl(maRect + GetGridOffset() ));
-                pH->SetObj(const_cast<SdrRectObj*>(this));
-                pH->SetRotationAngle(aGeo.nRotationAngle);
-                break;
-            }
-            case 1:
+            case 1: // Handle for changing the corner radius
             {
                 long a = GetEckenradius();
                 long b = std::max(maRect.GetWidth(),maRect.GetHeight())/2; // 
rounded up, because GetWidth() adds 1
@@ -352,22 +352,18 @@ void SdrRectObj::AddToHdlList(SdrHdlList& rHdlList) const
             case 9: aPnt=maRect.BottomRight();  eKind = 
SdrHdlKind::LowerRight; break;
         }
 
-        if(!pH)
+        if(aGeo.nShearAngle)
         {
-            if(aGeo.nShearAngle)
-            {
-                ShearPoint(aPnt,maRect.TopLeft(),aGeo.nTan);
-            }
-
-            if(aGeo.nRotationAngle)
-            {
-                RotatePoint(aPnt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos);
-            }
-
-            pH.reset(new SdrHdl(aPnt,eKind));
-            pH->SetObj(const_cast<SdrRectObj*>(this));
-            pH->SetRotationAngle(aGeo.nRotationAngle);
+            ShearPoint(aPnt,maRect.TopLeft(),aGeo.nTan);
         }
+        if(aGeo.nRotationAngle)
+        {
+            RotatePoint(aPnt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos);
+        }
+
+        std::unique_ptr<SdrHdl> pH(new SdrHdl(aPnt,eKind));
+        pH->SetObj(const_cast<SdrRectObj*>(this));
+        pH->SetRotationAngle(aGeo.nRotationAngle);
         rHdlList.AddHdl(std::move(pH));
     }
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to