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

Stephan Bergmann sbergman at redhat.com
Wed Oct 9 05:00:07 PDT 2013


 svtools/source/contnr/imivctl1.cxx |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

New commits:
commit 143bb92761f54cb7b8e41e5ac83bd274d4f7079b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 9 12:06:41 2013 +0200

    Make CalcFocusRect look right
    
    ...at least for its (only, it appears) uses at the left of the "Insert -
    Hyperlink" dialog and at the left of a Database window.  As aBmpRect and
    aTextRect never extend aBoundRect (and aTextRect always leaving a gap left and
    right towards aBoundRect, it appears, with the text abbreviated with an ellipsis
    if it would be too wide), there should be no need to eventually adjust "the
    focus rectangle [to] not touch the text," and for calculating the top of the
    focus rect aBoundRect can be used just as well as aBmpRect.  (Though for
    calculating the bottom, aBoundRect apparently stretches "too far" compareed to
    aTextRect; whatever...  The offsets look somewhat "magic" anyway, but appear to
    produce the desired visual results.)
    
    Change-Id: Ic324561294fb6172c0d02a697fc261717e01c87c
    Reviewed-on: https://gerrit.libreoffice.org/6165
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 0685bc3..74d7fe5 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2704,18 +2704,11 @@ const Size& SvxIconChoiceCtrl_Impl::GetItemSize( SvxIconChoiceCtrlEntry*,
 
 Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry )
 {
-    Rectangle aBmpRect( CalcBmpRect( pEntry ) );
     Rectangle aTextRect( CalcTextRect( pEntry ) );
     Rectangle aBoundRect( GetEntryBoundRect( pEntry ) );
-    Rectangle aFocusRect( aBoundRect.Left(), aBmpRect.Top() - 1,
-                          aBoundRect.Right() - 4, aTextRect.Bottom() + 1 );
-    // the focus rectangle should not touch the text
-    if( aFocusRect.Left() > ::std::numeric_limits<long>::min() && aFocusRect.Left() - 1 >= pEntry->aRect.Left() )
-        aFocusRect.Left()--;
-    if( aFocusRect.Right() < ::std::numeric_limits<long>::max() && aFocusRect.Right() + 1 <= pEntry->aRect.Right() )
-        aFocusRect.Right()++;
-
-    return aFocusRect;
+    return Rectangle(
+        aBoundRect.Left(), aBoundRect.Top() - 1, aBoundRect.Right() - 1,
+        aTextRect.Bottom() + 1);
 }
 
 // the hot spot is the inner 50 % of the rectangle


More information about the Libreoffice-commits mailing list