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 17:23:29 +0200 |
commit | 3c17bb91f29d431f99a742bd14ffc9612f25a7af (patch) | |
tree | e83143b5fbceacac2248da6120a2b728d73f1aa9 /svx/source/tbxctrls | |
parent | 02e20dfa733d050e9d37285ad36323b2aad46ffe (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/+/96738
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/tbxctrls')
-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() |