diff options
author | Armin Le Grand (Collabora) <Armin.Le.Grand@me.com> | 2024-12-20 16:12:50 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-12-20 20:00:17 +0100 |
commit | 5de080cae9bf09a2e360974e7b31567272c89798 (patch) | |
tree | efc7d04f03957342798c5f13cacc3dbd741e637e | |
parent | 7db48ca86b9ab88d07430bccfdb50a22597ab5ce (diff) |
tdf#164285 secure access to SID_ATTR_TRANSFORM_SIZE_POINT
Change-Id: Ice52f9be8ecc1887de48f3538b5627514518aef1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178936
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 6a098d3568a0..acf0b6885028 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1580,8 +1580,6 @@ static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP) void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin) { - const bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); - tools::Rectangle aRect(GetMarkedObjRect()); if(GetSdrPageView()) @@ -1664,11 +1662,24 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin bChgSiz=true; bChgHgt=true; } - if (bChgSiz) { - if (bTiledRendering && SfxItemState::SET != rAttr.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT)) + + if (bChgSiz) + { + // tdf#164285 the item was accessed even when not being set if + // false == comphelper::LibreOfficeKit::isActive(). For SlotIDs + // like SID_ATTR_TRANSFORM_SIZE_POINT this will crash by asserting + // due to SlotIDs having no defaults (see + // SfxItemPool::GetUserOrPoolDefaultItem line 725) + if (const SfxUInt16Item* pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_SIZE_POINT)) + eSizePoint = static_cast<RectPoint>(pPoolItem->GetValue()); + else if (comphelper::LibreOfficeKit::isActive()) + // for TiledRendering the default which is set at the start of + // this method to RectPoint::MM seems purposely being changed to + // RectPoint::LT here - from a change 6 years ago. Note that this + // will make chosing another definition point in the UI for the + // PosSizeDialog except TopLeft not working when + // comphelper::LibreOfficeKit *is* active. eSizePoint = RectPoint::LT; - else - eSizePoint = static_cast<RectPoint>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue()); } // rotation |