summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2023-05-07 18:05:56 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-05-08 13:33:11 +0200
commitf31bda6971e6f69e2f0c170df4a0dd206aa2f720 (patch)
tree6a6ac778c577eb7f1f8ec69f679876b1d1308895 /editeng/source
parent63b8e8bda29efbdde0e0bd7f7d2b18d5a9b7b135 (diff)
tdf#154282 - Prevent crash for LeftParaMargin and RightParaMargin
Prevent crash for LeftParaMargin and RightParaMargin by returning both values for the hardcoded 0 in SfxDispatchController_Impl::StateChanged. Change-Id: I7705bd5e22d6cd7fbbe702d7ddbf17e2899b851e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151472 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/items/frmitems.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index de1515380ed5..250b61e33753 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -756,6 +756,15 @@ bool SvxTextLeftMarginItem::QueryValue(uno::Any& rVal, sal_uInt8 nMemberId) cons
nMemberId &= ~CONVERT_TWIPS;
switch (nMemberId)
{
+ // tdf#154282 - return both values for the hardcoded 0 in SfxDispatchController_Impl::StateChanged
+ case 0:
+ {
+ css::frame::status::LeftRightMarginScale aLRSpace;
+ aLRSpace.TextLeft = static_cast<sal_Int32>(bConvert ? convertTwipToMm100(GetTextLeft()) : GetTextLeft());
+ aLRSpace.ScaleLeft = static_cast<sal_Int16>(m_nPropLeftMargin);
+ rVal <<= aLRSpace;
+ break;
+ }
case MID_TXT_LMARGIN :
rVal <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100(GetTextLeft()) : GetTextLeft());
break;
@@ -1102,6 +1111,15 @@ bool SvxRightMarginItem::QueryValue(uno::Any& rVal, sal_uInt8 nMemberId) const
nMemberId &= ~CONVERT_TWIPS;
switch (nMemberId)
{
+ // tdf#154282 - return both values for the hardcoded 0 in SfxDispatchController_Impl::StateChanged
+ case 0:
+ {
+ css::frame::status::LeftRightMarginScale aLRSpace;
+ aLRSpace.Right = static_cast<sal_Int32>(bConvert ? convertTwipToMm100(m_nRightMargin) : m_nRightMargin);
+ aLRSpace.ScaleRight = static_cast<sal_Int16>(m_nPropRightMargin);
+ rVal <<= aLRSpace;
+ break;
+ }
case MID_R_MARGIN:
rVal <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100(m_nRightMargin) : m_nRightMargin);
break;