summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-08 17:10:31 +0000
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-02-19 14:13:12 +0100
commite5d027bac2255eb57bb040d97d8e55a45d6e91d9 (patch)
treeacffe80efcb3cf969df327a98723f037428e99dd
parentbe8a083cf11da380071e2f870f3a0bd5ab41715d (diff)
Resolves: tdf#130486 setting distributed results that justified cannot be set
Change-Id: If80c935b7e33b5c7146eb562daf2303688160653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88274 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 818598e609ad9160af52ae8b02d772ca29f9ad7b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88396 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--cui/source/tabpages/align.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index cdd87f0cf2a4..24dbf87bf2a3 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -84,16 +84,19 @@ void lcl_MaybeResetAlignToDistro(
}
}
-void lcl_SetJustifyMethodToItemSet(SfxItemSet& rSet, sal_uInt16 nWhichJM, const weld::ComboBox& rLB, sal_uInt16 nListPos)
+void lcl_SetJustifyMethodToItemSet(SfxItemSet& rSet, const SfxItemSet& rOldSet, sal_uInt16 nWhichJM, const weld::ComboBox& rLB, sal_uInt16 nListPos)
{
SvxCellJustifyMethod eJM = SvxCellJustifyMethod::Auto;
if (rLB.get_active() == nListPos)
eJM = SvxCellJustifyMethod::Distribute;
// tdf#129300 If it would create no change, don't force it
- const SvxJustifyMethodItem& rOldItem = static_cast<const SvxJustifyMethodItem&>(rSet.Get(nWhichJM));
+ const SvxJustifyMethodItem& rOldItem = static_cast<const SvxJustifyMethodItem&>(rOldSet.Get(nWhichJM));
if (rOldItem.GetValue() == eJM)
+ {
+ rSet.InvalidateItem(nWhichJM);
return;
+ }
SvxJustifyMethodItem aItem(eJM, nWhichJM);
rSet.Put(aItem);
@@ -172,6 +175,8 @@ std::unique_ptr<SfxTabPage> AlignmentTabPage::Create(weld::Container* pPage, wel
bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
{
+ const SfxItemSet& rOldSet = GetItemSet();
+
bool bChanged = SfxTabPage::FillItemSet(rSet);
if (m_xLbHorAlign->get_value_changed_from_saved())
@@ -305,12 +310,12 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
// method to 'distribute' to distinguish from the normal justification.
sal_uInt16 nWhichHorJM = GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD);
- lcl_SetJustifyMethodToItemSet(*rSet, nWhichHorJM, *m_xLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED);
+ lcl_SetJustifyMethodToItemSet(*rSet, rOldSet, nWhichHorJM, *m_xLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED);
if (!bChanged)
bChanged = HasAlignmentChanged(*rSet, nWhichHorJM);
sal_uInt16 nWhichVerJM = GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD);
- lcl_SetJustifyMethodToItemSet(*rSet, nWhichVerJM, *m_xLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED);
+ lcl_SetJustifyMethodToItemSet(*rSet, rOldSet, nWhichVerJM, *m_xLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED);
if (!bChanged)
bChanged = HasAlignmentChanged(*rSet, nWhichVerJM);