[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - svx/source vcl/source

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 17 05:41:05 UTC 2019


 svx/source/tbxctrls/tbxcolorupdate.cxx |   22 ++++------------------
 vcl/source/window/toolbox.cxx          |    3 ---
 2 files changed, 4 insertions(+), 21 deletions(-)

New commits:
commit 918194c26ced8627d4f94840a4fb52ed70185446
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Sep 16 22:41:59 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Sep 17 07:40:27 2019 +0200

    Revert "tdf#126966: Use larger buttons for the colours in the sidebar on iOS"
    
    Nah, that was the wrong way to attack this. It had the side effect
    that the text colour selection controls disappeared completely from
    view in the sidebar after either had been used once. (And the controls
    with their pop-down subdialog with a combobox for selection of
    palette, and the scrollable palettes, are so broken anyway on iOS that
    the whole thing most likely should be rewritten completely, but that's
    another thing.)
    
    Anyway, after this revert I will look for some better approach. This
    is a much harder problem than I expected. (So what else is new, that
    is a rather common scenario around here.)
    
    This reverts commit 57255d4bc47dcabdcc0734d564059326910c5609.
    
    Change-Id: Ie31cf6b8f106541bde4f3476bd187ab7a7b5fe18
    Reviewed-on: https://gerrit.libreoffice.org/79027
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>

diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index 6e96e9b03edd..974834034de3 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+
 #include <svx/tbxcolorupdate.hxx>
 #include <svx/svxids.hrc>
 #include <svx/xdef.hxx>
@@ -70,14 +71,7 @@ namespace svx
     {
         Image aImage(mpTbx->GetItemImage(mnBtnId));
         Size aItemSize(mbWideButton ? mpTbx->GetItemContentSize(mnBtnId) : aImage.GetSizePixel());
-#ifdef IOS // tdf#126966
-        // Oddly enough, it is in the "not wide button" case that we want the larger ones, hmm.
-        if (!mbWideButton)
-        {
-            aItemSize.setWidth(aItemSize.getWidth() * 3);
-            aItemSize.setHeight(aItemSize.getHeight() * 3);
-        }
-#endif
+
         const bool bSizeChanged = (maBmpSize != aItemSize);
         const bool bDisplayModeChanged = (mbWasHiContrastMode != mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode());
         Color aColor(rColor);
@@ -98,17 +92,9 @@ namespace svx
         long nWidth = std::min(aItemSize.Width(), aSource.GetSizePixel().Width());
         long nHeight = std::min(aItemSize.Height(), aSource.GetSizePixel().Height());
 
-        // Be sure to center the image if necessary.
-        Point aDestination(0, 0);
-        if (aItemSize.getWidth() > aSource.GetSizePixel().getWidth())
-            aDestination.Move((aItemSize.getWidth() - aSource.GetSizePixel().getWidth()) / 2, 0);
-        if (aItemSize.getHeight() > aSource.GetSizePixel().getHeight())
-            aDestination.Move(0, (aItemSize.getHeight() - aSource.GetSizePixel().getHeight()) / 2);
-
-        tools::Rectangle aRectDestination(aDestination, Size(nWidth, nHeight));
-        tools::Rectangle aRectSource(Point(0, 0), Size(nWidth, nHeight));
+        tools::Rectangle aRect(Point(0, 0), Size(nWidth, nHeight));
 
-        aBmpEx.CopyPixel( aRectDestination, aRectSource, &aSource );
+        aBmpEx.CopyPixel( aRect, aRect, &aSource );
 
         Bitmap              aBmp( aBmpEx.GetBitmap() );
         BitmapWriteAccess*  pBmpAcc = aBmp.IsEmpty() ? nullptr : aBmp.AcquireWriteAccess();
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index dda813ae3d90..bbc4ddf7c9a1 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1427,9 +1427,6 @@ bool ToolBox::ImplCalcItem()
     long            nMinWidth   = 6;
     long            nMinHeight  = 6;
     long            nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
-#ifdef IOS
-    nDropDownArrowWidth *= 3;
-#endif
 
     // set defaults if image or text is needed but empty
     nDefWidth  = GetDefaultImageSize().Width();


More information about the Libreoffice-commits mailing list