Related: tdf#134360 table row/height widgets can get stuck insensitive
Change-Id: I1be53f33f60c510757c67f1da8f863539ecbffdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97547
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx
index 4d76cc0..46f75cd 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.cxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.cxx
@@ -45,6 +45,9 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState
{
case SID_ATTR_TABLE_ROW_HEIGHT:
{
bool bDisabled = eState == SfxItemState::DISABLED;
m_xRowHeightEdit->set_sensitive(!bDisabled);
if (pState && eState >= SfxItemState::DEFAULT)
{
const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(pState);
@@ -55,18 +58,16 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState
m_xRowHeightEdit->set_value(nNewHeight, FieldUnit::TWIP);
}
}
else if (eState == SfxItemState::DISABLED)
{
m_xRowHeightEdit->set_sensitive(false);
}
else
{
else if (eState != SfxItemState::DISABLED)
m_xRowHeightEdit->set_text("");
}
break;
}
case SID_ATTR_TABLE_COLUMN_WIDTH:
{
bool bDisabled = eState == SfxItemState::DISABLED;
m_xColumnWidthEdit->set_sensitive(!bDisabled);
if (pState && eState >= SfxItemState::DEFAULT)
{
const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(pState);
@@ -77,14 +78,9 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState
m_xColumnWidthEdit->set_value(nNewWidth, FieldUnit::TWIP);
}
}
else if (eState == SfxItemState::DISABLED)
{
m_xColumnWidthEdit->set_sensitive(false);
}
else
{
else if (eState != SfxItemState::DISABLED)
m_xColumnWidthEdit->set_text("");
}
break;
}
}