diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-19 15:06:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-19 21:12:13 +0200 |
commit | a3dec7a0b3714ff74c32c8cedc62a9aae6fb6b9b (patch) | |
tree | b6cb367eeb3361bcbaf9028f3f8128b65e800181 /svx | |
parent | 92dbbf840c1da7628bcdd9e8f67375efc2a2fa14 (diff) |
tdf#134084 use the desired image size, not the current image size
when updating the color bar
Change-Id: I6bf76a38adc034a25c0c31833c14f2b6afe3ec6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96739
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbxcolorupdate.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 31948678b7a7..f21ad6b9c0d0 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -120,8 +120,22 @@ namespace svx { if (mbWideButton) return mpTbx->GetItemContentSize(mnBtnId); - Image aImage(mpTbx->GetItemImage(mnBtnId)); - return aImage.GetSizePixel(); + vcl::ImageType eImageType = GetImageSize(); + int nHeight(16); + switch (eImageType) + { + case vcl::ImageType::Size16: + nHeight = 16; + break; + case vcl::ImageType::Size26: + nHeight = 26; + break; + case vcl::ImageType::Size32: + nHeight = 32; + break; + } + int nWidth = nHeight; + return Size(nWidth, nHeight); } ToolboxButtonColorUpdaterBase::~ToolboxButtonColorUpdaterBase() |