kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0096-Make-CalcFocusRect-look-right.patch

f0633d
From bfb51322f2bee76d7e70588050c38655a432aef0 Mon Sep 17 00:00:00 2001
f0633d
From: Stephan Bergmann <sbergman@redhat.com>
f0633d
Date: Wed, 9 Oct 2013 12:06:41 +0200
f0633d
Subject: [PATCH 096/109] Make CalcFocusRect look right
f0633d
f0633d
...at least for its (only, it appears) uses at the left of the "Insert -
f0633d
Hyperlink" dialog and at the left of a Database window.  As aBmpRect and
f0633d
aTextRect never extend aBoundRect (and aTextRect always leaving a gap left and
f0633d
right towards aBoundRect, it appears, with the text abbreviated with an ellipsis
f0633d
if it would be too wide), there should be no need to eventually adjust "the
f0633d
focus rectangle [to] not touch the text," and for calculating the top of the
f0633d
focus rect aBoundRect can be used just as well as aBmpRect.  (Though for
f0633d
calculating the bottom, aBoundRect apparently stretches "too far" compareed to
f0633d
aTextRect; whatever...  The offsets look somewhat "magic" anyway, but appear to
f0633d
produce the desired visual results.)
f0633d
f0633d
Change-Id: Ic324561294fb6172c0d02a697fc261717e01c87c
f0633d
Reviewed-on: https://gerrit.libreoffice.org/6165
f0633d
Reviewed-by: Eike Rathke <erack@redhat.com>
f0633d
Tested-by: Eike Rathke <erack@redhat.com>
f0633d
(cherry picked from commit 143bb92761f54cb7b8e41e5ac83bd274d4f7079b)
f0633d
Signed-off-by: Eike Rathke <erack@redhat.com>
f0633d
---
f0633d
 svtools/source/contnr/imivctl1.cxx | 13 +++----------
f0633d
 1 file changed, 3 insertions(+), 10 deletions(-)
f0633d
f0633d
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
f0633d
index 01f733d..b0ea082 100644
f0633d
--- a/svtools/source/contnr/imivctl1.cxx
f0633d
+++ b/svtools/source/contnr/imivctl1.cxx
f0633d
@@ -2703,18 +2703,11 @@ const Size& SvxIconChoiceCtrl_Impl::GetItemSize( SvxIconChoiceCtrlEntry*,
f0633d
 
f0633d
 Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry )
f0633d
 {
f0633d
-    Rectangle aBmpRect( CalcBmpRect( pEntry ) );
f0633d
     Rectangle aTextRect( CalcTextRect( pEntry ) );
f0633d
     Rectangle aBoundRect( GetEntryBoundRect( pEntry ) );
f0633d
-    Rectangle aFocusRect( aBoundRect.Left(), aBmpRect.Top() - 1,
f0633d
-                          aBoundRect.Right() - 4, aTextRect.Bottom() + 1 );
f0633d
-    // the focus rectangle should not touch the text
f0633d
-    if( aFocusRect.Left() > ::std::numeric_limits<long>::min() && aFocusRect.Left() - 1 >= pEntry->aRect.Left() )
f0633d
-        aFocusRect.Left()--;
f0633d
-    if( aFocusRect.Right() < ::std::numeric_limits<long>::max() && aFocusRect.Right() + 1 <= pEntry->aRect.Right() )
f0633d
-        aFocusRect.Right()++;
f0633d
-
f0633d
-    return aFocusRect;
f0633d
+    return Rectangle(
f0633d
+        aBoundRect.Left(), aBoundRect.Top() - 1, aBoundRect.Right() - 1,
f0633d
+        aTextRect.Bottom() + 1);
f0633d
 }
f0633d
 
f0633d
 // the hot spot is the inner 50 % of the rectangle
f0633d
-- 
f0633d
1.8.4.2
f0633d