From 36baacbf86f81de457af40a4a91b294136bf8ddc Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Wed, 18 Aug 2021 22:21:41 +0200 Subject: tdf#143567: Distinguish bitmap vs. pattern fill style By the time fill style state change (SID_ATTR_FILL_STYLE) happens, the actual bitmap fill may or may not be known. If it is not known, it is impossible to tell whether it is a regular bitmap or a pattern. That's why this toolbar sometimes incorrectly reports bitmap fill instead of pattern one To solve the problem, we adjust fill style listbox selection only later, by the time we know for sure the fill IS a pattern Change-Id: I0aa95c49601d77dca29ab54ad4c056a76a90e049 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120687 Tested-by: Jenkins Reviewed-by: Katarina Behrens (cherry picked from commit 1b06e7e9e8c467de3450077fe8b90be6b7f73e4b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120991 Reviewed-by: Adolfo Jayme Barrientos --- svx/source/tbxctrls/fillctrl.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index ed86f9f3bda1..948a89f6d3d2 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -142,13 +142,6 @@ void SvxFillToolBoxControl::StateChanged( mpLbFillType->set_sensitive(true); drawing::FillStyle eXFS = mpStyleItem->GetValue(); mnLastXFS = sal::static_int_cast< sal_Int32 >(eXFS); - - if (eXFS == drawing::FillStyle_BITMAP && - mpBitmapItem && mpBitmapItem->isPattern() ) - { - mnLastXFS = sal::static_int_cast(PATTERN); - } - mpLbFillType->set_active(mnLastXFS); if(drawing::FillStyle_NONE == eXFS) @@ -555,6 +548,9 @@ void SvxFillToolBoxControl::Update() } else if (mpBitmapItem && mpBitmapItem->isPattern() && pSh->GetItem(SID_PATTERN_LIST)) { + mnLastXFS = sal::static_int_cast(PATTERN); + mpLbFillType->set_active(mnLastXFS); + SvxFillAttrBox::Fill(*mpLbFillAttr, pSh->GetItem(SID_PATTERN_LIST)->GetPatternList()); const OUString aString(mpBitmapItem->GetName()); -- cgit