summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
authorKatarina Behrens <bubli@bubli.org>2021-08-18 22:21:41 +0200
committerKatarina Behrens <bubli@bubli.org>2021-08-19 12:27:39 +0200
commit1b06e7e9e8c467de3450077fe8b90be6b7f73e4b (patch)
tree7abed0fa7dac954ea11f44ca161f85551f6c67be /svx/source/tbxctrls
parent97b61ea3297e04e64aab1e1a4ec50202e9f86fff (diff)
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 <bubli@bubli.org>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 3711d7fc4053..6c93563a0b20 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -142,13 +142,6 @@ void SvxFillToolBoxControl::StateChangedAtToolBoxControl(
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<sal_Int32>(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<sal_Int32>(PATTERN);
+ mpLbFillType->set_active(mnLastXFS);
+
SvxFillAttrBox::Fill(*mpLbFillAttr, pSh->GetItem(SID_PATTERN_LIST)->GetPatternList());
const OUString aString(mpBitmapItem->GetName());