summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-09-07 12:16:24 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2022-02-23 16:00:28 +0100
commitf4a62e5479b47d90d6de518f38a97ac0b5322c54 (patch)
treeff1a90880f5ed9de959a66b447b0b182c32fea94 /svx
parent4751853b19dabfb57963c58183b0c3557328b3b8 (diff)
SdrLayerID must be based on sal_Int16
... which is the type corresponding to the related published property "LayerID" of com.sun.star.drawing.Shape service. Without this, the code asserts on values passed to the published API from external sources to be in the 8-bit limits, which is incorrect. Change-Id: I0449a7dd313f7e6c4adbc1c1f7b8c50b6a51434e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121760 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/sxlayitm.hxx6
-rw-r--r--svx/source/uitest/sdrobject.cxx2
-rw-r--r--svx/source/unodraw/unoshape.cxx2
3 files changed, 5 insertions, 5 deletions
diff --git a/svx/inc/sxlayitm.hxx b/svx/inc/sxlayitm.hxx
index a52c47f3d9af..be444bec33dd 100644
--- a/svx/inc/sxlayitm.hxx
+++ b/svx/inc/sxlayitm.hxx
@@ -24,10 +24,10 @@
#include <svl/intitem.hxx>
#include <svx/svdtypes.hxx>
-class SdrLayerIdItem final : public SfxUInt16Item {
+class SdrLayerIdItem final : public SfxInt16Item {
public:
- SdrLayerIdItem(SdrLayerID nId): SfxUInt16Item(SDRATTR_LAYERID,sal_uInt8(nId)) {}
- SdrLayerID GetValue() const { return SdrLayerID(SfxUInt16Item::GetValue()); }
+ SdrLayerIdItem(SdrLayerID nId): SfxInt16Item(SDRATTR_LAYERID,nId.get()) {}
+ SdrLayerID GetValue() const { return SdrLayerID(SfxInt16Item::GetValue()); }
virtual SdrLayerIdItem* Clone(SfxItemPool* pPool=nullptr) const override;
};
diff --git a/svx/source/uitest/sdrobject.cxx b/svx/source/uitest/sdrobject.cxx
index 0d287de2a8a7..bc72ee2a8c93 100644
--- a/svx/source/uitest/sdrobject.cxx
+++ b/svx/source/uitest/sdrobject.cxx
@@ -28,7 +28,7 @@ StringMap SdrUIObject::get_state()
aMap["Description"] = pObject->GetDescription();
aMap["Title"] = pObject->GetTitle();
aMap["Z-Order"] = OUString::number(pObject->GetOrdNum());
- aMap["Layer"] = OUString::number(sal_uInt8(pObject->GetLayer()));
+ aMap["Layer"] = OUString::number(pObject->GetLayer().get());
aMap["IsGroupObject"] = OUString::boolean(pObject->IsGroupObject());
aMap["IsPolyObject"] = OUString::boolean(pObject->IsPolyObj());
aMap["PointCount"] = OUString::number(pObject->GetPointCount());
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 86c2cb74af5f..4591c49c5899 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -2778,7 +2778,7 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn
break;
}
case SDRATTR_LAYERID:
- rValue <<= sal_uInt16(sal_uInt8(GetSdrObject()->GetLayer()));
+ rValue <<= GetSdrObject()->GetLayer().get();
break;
case SDRATTR_LAYERNAME: