summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@me.com>2020-02-04 14:32:49 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2020-02-04 16:38:28 +0100
commitcf4e87469baf13fb2766d0f2593fcc2b9b33bc9b (patch)
tree5dc17034ca878945d3322ab5579a455a9dc2142c /cui
parentd571a509aa324db9a425110a67ea142d157256b2 (diff)
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.Grand@me.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/align.cxx37
1 files changed, 19 insertions, 18 deletions
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: