diff options
author | Katarina Behrens <bubli@bubli.org> | 2021-08-18 22:21:41 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-08-26 03:45:19 +0200 |
commit | 36baacbf86f81de457af40a4a91b294136bf8ddc (patch) | |
tree | 3cebf5aa4e198d8a54ffd2b8c4707cdd3342728c | |
parent | tdf#142394 return to using CAIRO_OPERATOR_SOURCE in drawBitmap (diff) | |
download | core-36baacbf86f81de457af40a4a91b294136bf8ddc.tar.gz core-36baacbf86f81de457af40a4a91b294136bf8ddc.zip |
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>
(cherry picked from commit 1b06e7e9e8c467de3450077fe8b90be6b7f73e4b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120991
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | svx/source/tbxctrls/fillctrl.cxx | 10 |
1 files 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<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()); |