Related: tdf#153008 bump XFillBmpPosOffsetXItem to sal_Int32

and XFillBmpPosOffsetYItem. To avoid sal_uInt16 overflows on large input
values.

Lets use sal_Int32 instead of sal_uInt32 given the amount of existing
casting to sal_Int32 of XFillBmpPosOffset[X|Y]Item::GetValue()

Change-Id: I8329c11b75c9ad01011e10130257963737ffe553
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168398
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Attila Szűcs <attila.szucs@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara 2024-06-04 09:48:57 +01:00
parent 4cd2737d82
commit 367ba88092
3 changed files with 10 additions and 12 deletions

View file

@ -23,10 +23,10 @@
#include <svl/intitem.hxx>
#include <svx/svxdllapi.h>
class SVXCORE_DLLPUBLIC XFillBmpPosOffsetXItem final : public SfxUInt16Item
class SVXCORE_DLLPUBLIC XFillBmpPosOffsetXItem final : public SfxInt32Item
{
public:
XFillBmpPosOffsetXItem( sal_uInt16 nOffPosX = 0 );
XFillBmpPosOffsetXItem( sal_Int32 nOffPosX = 0 );
SVX_DLLPRIVATE virtual XFillBmpPosOffsetXItem* Clone( SfxItemPool* pPool = nullptr ) const override;
@ -36,10 +36,10 @@ public:
OUString &rText, const IntlWrapper& ) const override;
};
class SVXCORE_DLLPUBLIC XFillBmpPosOffsetYItem final : public SfxUInt16Item
class SVXCORE_DLLPUBLIC XFillBmpPosOffsetYItem final : public SfxInt32Item
{
public:
XFillBmpPosOffsetYItem( sal_uInt16 nOffPosY = 0 );
XFillBmpPosOffsetYItem( sal_Int32 nOffPosY = 0 );
SVX_DLLPRIVATE virtual XFillBmpPosOffsetYItem* Clone( SfxItemPool* pPool = nullptr ) const override;

View file

@ -161,8 +161,8 @@
// class Svx3DShadeModeItem : public SfxUInt16Item
// class SdrEdgeLineDeltaCountItem: public SfxUInt16Item
// class SvxViewLayoutItem: public SfxUInt16Item
// class XFillBmpPosOffsetXItem : public SfxUInt16Item
// class XFillBmpPosOffsetYItem : public SfxUInt16Item
// class XFillBmpPosOffsetXItem : public SfxInt32Item
// class XFillBmpPosOffsetYItem : public SfxInt32Item
// class XFillBmpTileOffsetXItem : public SfxUInt16Item
// class XFillBmpTileOffsetYItem : public SfxUInt16Item
// class XFillTransparenceItem: public SfxUInt16Item

View file

@ -631,9 +631,8 @@ void XFillBmpStretchItem::dumpAsXml(xmlTextWriterPtr pWriter) const
(void)xmlTextWriterEndElement(pWriter);
}
XFillBmpPosOffsetXItem::XFillBmpPosOffsetXItem( sal_uInt16 nOffPosX ) :
SfxUInt16Item( XATTR_FILLBMP_POSOFFSETX, nOffPosX )
XFillBmpPosOffsetXItem::XFillBmpPosOffsetXItem(sal_Int32 nOffPosX)
: SfxInt32Item(XATTR_FILLBMP_POSOFFSETX, nOffPosX)
{
}
@ -654,9 +653,8 @@ bool XFillBmpPosOffsetXItem::GetPresentation
return true;
}
XFillBmpPosOffsetYItem::XFillBmpPosOffsetYItem( sal_uInt16 nOffPosY ) :
SfxUInt16Item( XATTR_FILLBMP_POSOFFSETY, nOffPosY )
XFillBmpPosOffsetYItem::XFillBmpPosOffsetYItem(sal_Int32 nOffPosY)
: SfxInt32Item(XATTR_FILLBMP_POSOFFSETY, nOffPosY)
{
}