SvxLineSpacingItem does not need to be an SfxEnumItemInterface

Change-Id: Ic7c483b3ed4664a96da63cfdcd04d30cb87d50cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186276
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2025-06-09 09:34:50 +02:00
parent 49897bc7db
commit ff055c9e1e
2 changed files with 2 additions and 38 deletions
+1 -33
View File
@@ -79,7 +79,7 @@ enum class SvxSpecialLineSpace
}
SvxLineSpacingItem::SvxLineSpacingItem( sal_uInt16 nHeight, const sal_uInt16 nId )
: SfxEnumItemInterface( nId )
: SfxPoolItem(nId)
{
nPropLineSpace = 100;
nInterLineSpace = 0;
@@ -319,38 +319,6 @@ bool SvxLineSpacingItem::GetPresentation
return true;
}
sal_uInt16 SvxLineSpacingItem::GetValueCount() const
{
return sal_uInt16(SvxSpecialLineSpace::End); // SvxSpecialLineSpace::TwoLines + 1
}
sal_uInt16 SvxLineSpacingItem::GetEnumValue() const
{
SvxSpecialLineSpace nVal;
switch ( nPropLineSpace )
{
case 100: nVal = SvxSpecialLineSpace::OneLine; break;
case 150: nVal = SvxSpecialLineSpace::OnePointFiveLines; break;
case 200: nVal = SvxSpecialLineSpace::TwoLines; break;
default: nVal = SvxSpecialLineSpace::User; break;
}
return static_cast<sal_uInt16>(nVal);
}
void SvxLineSpacingItem::SetEnumValue( sal_uInt16 nVal )
{
ASSERT_CHANGE_REFCOUNTED_ITEM;
switch ( static_cast<SvxSpecialLineSpace>(nVal) )
{
case SvxSpecialLineSpace::OneLine: nPropLineSpace = 100; break;
case SvxSpecialLineSpace::OnePointFiveLines: nPropLineSpace = 150; break;
case SvxSpecialLineSpace::TwoLines: nPropLineSpace = 200; break;
default: break;
}
}
// class SvxAdjustItem ---------------------------------------------------
ItemInstanceManager* SvxAdjustItem::getItemInstanceManager() const
+1 -5
View File
@@ -31,7 +31,7 @@
*/
#define LINE_SPACE_DEFAULT_HEIGHT 200
class EDITENG_DLLPUBLIC SvxLineSpacingItem final : public SfxEnumItemInterface
class EDITENG_DLLPUBLIC SvxLineSpacingItem final : public SfxPoolItem
{
short nInterLineSpace;
sal_uInt16 nLineHeight;
@@ -96,10 +96,6 @@ public:
void SetInterLineSpaceRule(SvxInterLineSpaceRule e) { ASSERT_CHANGE_REFCOUNTED_ITEM; eInterLineSpaceRule = e; }
SvxInterLineSpaceRule GetInterLineSpaceRule() const { return eInterLineSpaceRule; }
virtual sal_uInt16 GetValueCount() const override;
virtual sal_uInt16 GetEnumValue() const override;
virtual void SetEnumValue( sal_uInt16 nNewVal ) override;
};
#endif