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

Caolán McNamara caolanm at redhat.com
Fri Jul 29 09:50:59 UTC 2016


 svx/source/stbctrls/pszctrl.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 3a0aad2f5de3c78d0a3f0d6977903fbd41aa1d8f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 29 10:49:27 2016 +0100

    Related: tdf#90450 don't overwrite text in size/pos statusbar item
    
    there still isn't enough space for it in writer, but at least
    what is there can be read.
    
    I'd love to get this info out of the status bar and into some
    overlay shown in the selection when moving the object.
    
    Change-Id: I688690a57253d3774c06f5edcb0931503c6d2ac6

diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index a071173..0f27306 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -377,9 +377,12 @@ void SvxPosSizeStatusBarControl::Paint( const UserDrawEvent& rUsrEvt )
         OUString aStr = GetMetricStr_Impl( pImpl->aPos.X());
         aStr += " / ";
         aStr += GetMetricStr_Impl( pImpl->aPos.Y());
-        pDev->DrawRect(
-            Rectangle( aPnt, Point( nSizePosX, rRect.Bottom() ) ) );
-        pDev->DrawText( aPnt, aStr );
+        Rectangle aRect(aPnt, Point(nSizePosX, rRect.Bottom()));
+        pDev->DrawRect(aRect);
+        vcl::Region aOrigRegion(pDev->GetClipRegion());
+        pDev->SetClipRegion(vcl::Region(aRect));
+        pDev->DrawText(aPnt, aStr);
+        pDev->SetClipRegion(aOrigRegion);
 
         // draw the size, when available
         aPnt.X() = nSizePosX;
@@ -393,8 +396,12 @@ void SvxPosSizeStatusBarControl::Paint( const UserDrawEvent& rUsrEvt )
             aStr = GetMetricStr_Impl( pImpl->aSize.Width() );
             aStr += " x ";
             aStr += GetMetricStr_Impl( pImpl->aSize.Height() );
-            pDev->DrawRect( Rectangle( aDrwPnt, rRect.BottomRight() ) );
-            pDev->DrawText( aPnt, aStr );
+            aRect = Rectangle(aDrwPnt, rRect.BottomRight());
+            pDev->DrawRect(aRect);
+            aOrigRegion = pDev->GetClipRegion();
+            pDev->SetClipRegion(vcl::Region(aRect));
+            pDev->DrawText(aPnt, aStr);
+            pDev->SetClipRegion(aOrigRegion);
         }
         else
             pDev->DrawRect( Rectangle( aPnt, rRect.BottomRight() ) );


More information about the Libreoffice-commits mailing list