cui/source/tabpages/align.cxx | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-)
New commits: commit cf4e87469baf13fb2766d0f2593fcc2b9b33bc9b Author: Armin Le Grand <armin.le.gr...@me.com> AuthorDate: Tue Feb 4 14:32:49 2020 +0100 Commit: Armin Le Grand <armin.le.gr...@me.com> CommitDate: Tue Feb 4 16:38:28 2020 +0100 tdf#130428 SfxItemState::UNKNOWN replacements It's possible to remove seven usages in align.cxx which cannot happen due to AlignmentTabPage forcing used ItemIDs to be member of the used ItemSet. Checked that in the debugger. Safe, is all set and ceated when the Dialog and the TabPage gets created (see AlignmentTabPage::GetRange()) Change-Id: If8e7285b46792fb9035555a4fcd2ac6ec94a45ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87975 Tested-by: Jenkins Reviewed-by: Armin Le Grand <armin.le.gr...@me.com> diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index a0ecb03c7f69..c972313d9849 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -390,9 +390,13 @@ namespace SfxItemState eState = pSet->GetItemState(nWhich); switch (eState) { - case SfxItemState::UNKNOWN: - rBtn.hide(); - rTriState.bTriStateEnabled = false; + default: + // tdf#130428 SfxItemState::UNKNOWN cannot happen here, see s_pRanges. Input is (see below): + // SID_ATTR_ALIGN_STACKED + // SID_ATTR_ALIGN_ASIANVERTICAL + // SID_ATTR_ALIGN_LINEBREAK + // SID_ATTR_ALIGN_HYPHENATION + // SID_ATTR_ALIGN_SHRINKTOFIT break; case SfxItemState::DISABLED: case SfxItemState::READONLY: @@ -430,8 +434,8 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs) SfxItemState eState = pCoreAttrs->GetItemState(nWhich); switch (eState) { - case SfxItemState::UNKNOWN: - m_xLbHorAlign->hide(); + default: + //tdf#130428 SfxItemState::UNKNOWN cannot happen here, see s_pRanges. Input is SID_ATTR_ALIGN_HOR_JUSTIFY: break; case SfxItemState::DISABLED: case SfxItemState::READONLY: @@ -473,9 +477,8 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs) eState = pCoreAttrs->GetItemState(nWhich); switch (eState) { - case SfxItemState::UNKNOWN: - m_xEdIndent->hide(); - m_xFtIndent->hide(); + default: + //tdf#130428 SfxItemState::UNKNOWN cannot happen here, see s_pRanges. Input is SID_ATTR_ALIGN_INDENT: break; case SfxItemState::DISABLED: case SfxItemState::READONLY: @@ -497,9 +500,8 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs) eState = pCoreAttrs->GetItemState(nWhich); switch (eState) { - case SfxItemState::UNKNOWN: - m_xLbVerAlign->hide(); - m_xFtVerAlign->hide(); + default: + //tdf#130428 SfxItemState::UNKNOWN cannot happen here, see s_pRanges. Input is SID_ATTR_ALIGN_VER_JUSTIFY: break; case SfxItemState::DISABLED: case SfxItemState::READONLY: @@ -538,9 +540,8 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs) eState = pCoreAttrs->GetItemState(nWhich); switch (eState) { - case SfxItemState::UNKNOWN: - m_xNfRotate->hide(); - m_xCtrlDialWin->hide(); + default: + //tdf#130428 SfxItemState::UNKNOWN cannot happen here, see s_pRanges. Input is SID_ATTR_ALIGN_DEGREES: break; case SfxItemState::DISABLED: case SfxItemState::READONLY: @@ -563,8 +564,8 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs) eState = pCoreAttrs->GetItemState(nWhich); switch (eState) { - case SfxItemState::UNKNOWN: - m_xVsRefEdge->hide(); + default: + //tdf#130428 SfxItemState::UNKNOWN cannot happen here, see s_pRanges. Input is SID_ATTR_ALIGN_LOCKPOS: break; case SfxItemState::DISABLED: case SfxItemState::READONLY: @@ -602,8 +603,8 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs) eState = pCoreAttrs->GetItemState(nWhich); switch (eState) { - case SfxItemState::UNKNOWN: - m_xLbFrameDir->hide(); + default: + //tdf#130428 SfxItemState::UNKNOWN cannot happen here, see s_pRanges. Input is SID_ATTR_FRAMEDIRECTION: break; case SfxItemState::DISABLED: case SfxItemState::READONLY: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits