diff options
-rw-r--r-- | editeng/source/items/paraitem.cxx | 44 | ||||
-rw-r--r-- | include/editeng/lspcitem.hxx | 12 | ||||
-rw-r--r-- | include/editeng/svxenum.hxx | 9 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/annotsh.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtex.cxx | 6 |
8 files changed, 47 insertions, 44 deletions
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index dce9a3ecc066..e27e3a281553 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -68,6 +68,16 @@ SfxPoolItem* SvxParaVertAlignItem::CreateDefault() { return new SvxParaVertAlig SfxPoolItem* SvxParaGridItem::CreateDefault() { return new SvxParaGridItem(true, 0);} +enum class SvxSpecialLineSpace +{ + User, + OneLine, + OnePointFiveLines, + TwoLines, + End +}; + + SvxLineSpacingItem::SvxLineSpacingItem( sal_uInt16 nHeight, const sal_uInt16 nId ) : SfxEnumItemInterface( nId ) { @@ -269,7 +279,7 @@ SvStream& SvxLineSpacingItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion* sal_uInt16 SvxLineSpacingItem::GetValueCount() const { - return SVX_LINESPACE_END; // SVX_LINESPACE_TWO_LINES + 1 + return (sal_uInt16)SvxSpecialLineSpace::End; // SvxSpecialLineSpace::TwoLines + 1 } @@ -277,20 +287,21 @@ OUString SvxLineSpacingItem::GetValueTextByPos( sal_uInt16 nPos ) const { //! load strings from resource OUString aText; - switch ( nPos ) + switch ( (SvxSpecialLineSpace)nPos ) { - case SVX_LINESPACE_USER: + case SvxSpecialLineSpace::User: aText = "User"; break; - case SVX_LINESPACE_ONE_LINE: + case SvxSpecialLineSpace::OneLine: aText = "One line"; break; - case SVX_LINESPACE_ONE_POINT_FIVE_LINES: + case SvxSpecialLineSpace::OnePointFiveLines: aText = "1.5 line"; break; - case SVX_LINESPACE_TWO_LINES: + case SvxSpecialLineSpace::TwoLines: aText = "Two lines"; break; + default: break; } return aText; } @@ -298,25 +309,26 @@ OUString SvxLineSpacingItem::GetValueTextByPos( sal_uInt16 nPos ) const sal_uInt16 SvxLineSpacingItem::GetEnumValue() const { - sal_uInt16 nVal; + SvxSpecialLineSpace nVal; switch ( nPropLineSpace ) { - case 100: nVal = SVX_LINESPACE_ONE_LINE; break; - case 150: nVal = SVX_LINESPACE_ONE_POINT_FIVE_LINES; break; - case 200: nVal = SVX_LINESPACE_TWO_LINES; break; - default: nVal = SVX_LINESPACE_USER; break; + case 100: nVal = SvxSpecialLineSpace::OneLine; break; + case 150: nVal = SvxSpecialLineSpace::OnePointFiveLines; break; + case 200: nVal = SvxSpecialLineSpace::TwoLines; break; + default: nVal = SvxSpecialLineSpace::User; break; } - return nVal; + return (sal_uInt16)nVal; } void SvxLineSpacingItem::SetEnumValue( sal_uInt16 nVal ) { - switch ( nVal ) + switch ( (SvxSpecialLineSpace)nVal ) { - case SVX_LINESPACE_ONE_LINE: nPropLineSpace = 100; break; - case SVX_LINESPACE_ONE_POINT_FIVE_LINES: nPropLineSpace = 150; break; - case SVX_LINESPACE_TWO_LINES: nPropLineSpace = 200; break; + case SvxSpecialLineSpace::OneLine: nPropLineSpace = 100; break; + case SvxSpecialLineSpace::OnePointFiveLines: nPropLineSpace = 150; break; + case SvxSpecialLineSpace::TwoLines: nPropLineSpace = 200; break; + default: break; } } diff --git a/include/editeng/lspcitem.hxx b/include/editeng/lspcitem.hxx index da1fb3df6dc1..da548636c0ef 100644 --- a/include/editeng/lspcitem.hxx +++ b/include/editeng/lspcitem.hxx @@ -34,10 +34,10 @@ class SvXMLUnitConverter; #define LINE_SPACE_DEFAULT_HEIGHT 200 class EDITENG_DLLPUBLIC SvxLineSpacingItem : public SfxEnumItemInterface { - short nInterLineSpace; - sal_uInt16 nLineHeight; - sal_uInt16 nPropLineSpace; - SvxLineSpace eLineSpace; + short nInterLineSpace; + sal_uInt16 nLineHeight; + sal_uInt16 nPropLineSpace; + SvxLineSpace eLineSpace; SvxInterLineSpace eInterLineSpace; public: @@ -48,7 +48,7 @@ public: // writer? => Rather have a crooked vales as the default, but the // programmer sees that there's something special happening. - SvxLineSpacingItem( sal_uInt16 nHeight /*= LINE_SPACE_DEFAULT_HEIGHT*/, const sal_uInt16 nId ); + SvxLineSpacingItem( sal_uInt16 nLineHeight /*= LINE_SPACE_DEFAULT_HEIGHT*/, const sal_uInt16 nId ); // "pure virtual Methods" from SfxPoolItem virtual bool operator==( const SfxPoolItem& ) const override; @@ -95,7 +95,7 @@ public: inline SvxInterLineSpace GetInterLineSpaceRule() const { return eInterLineSpace; } virtual sal_uInt16 GetValueCount() const override; - virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const override; + virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const override; virtual sal_uInt16 GetEnumValue() const override; virtual void SetEnumValue( sal_uInt16 nNewVal ) override; }; diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx index 6044dbd4718b..617dcecd9bd1 100644 --- a/include/editeng/svxenum.hxx +++ b/include/editeng/svxenum.hxx @@ -84,15 +84,6 @@ enum SvxAdjust SVX_ADJUST_END }; -enum SvxSpecialLineSpace -{ - SVX_LINESPACE_USER, - SVX_LINESPACE_ONE_LINE, - SVX_LINESPACE_ONE_POINT_FIVE_LINES, - SVX_LINESPACE_TWO_LINES, - SVX_LINESPACE_END -}; - enum class SvxBreak { NONE, diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index d79e28050c9a..e62888f94a30 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1279,7 +1279,7 @@ static void lcl_ModifyRTLDefaults( SfxItemSet& rSet ) // PaperSize width is limited to USHRT_MAX in RTL mode (because of EditEngine's // sal_uInt16 values in EditLine), so the text may be wrapped and line spacing must be // increased to not see the beginning of the next line. - SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL ); + SvxLineSpacingItem aItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ); aItem.SetPropLineSpace( 200 ); rSet.Put( aItem ); } diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index c93267e1bbdf..6c6165bdc2ac 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -692,7 +692,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) case SID_ATTR_PARA_LINESPACE_10: { - SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_LINE, EE_PARA_SBL ); + SvxLineSpacingItem aItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ); aItem.SetPropLineSpace( 100 ); aNewAttr.Put( aItem ); } @@ -700,7 +700,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) case SID_ATTR_PARA_LINESPACE_15: { - SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL ); + SvxLineSpacingItem aItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ); aItem.SetPropLineSpace( 150 ); aNewAttr.Put( aItem ); } @@ -708,7 +708,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) case SID_ATTR_PARA_LINESPACE_20: { - SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL ); + SvxLineSpacingItem aItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ); aItem.SetPropLineSpace( 200 ); aNewAttr.Put( aItem ); } diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 3cf7623ca2d6..07ef59768610 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -511,21 +511,21 @@ void TextObjectBar::Execute( SfxRequest &rReq ) break; case SID_ATTR_PARA_LINESPACE_10: { - SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_LINE, EE_PARA_SBL ); + SvxLineSpacingItem aItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ); aItem.SetPropLineSpace( 100 ); aNewAttr.Put( aItem ); } break; case SID_ATTR_PARA_LINESPACE_15: { - SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL ); + SvxLineSpacingItem aItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ); aItem.SetPropLineSpace( 150 ); aNewAttr.Put( aItem ); } break; case SID_ATTR_PARA_LINESPACE_20: { - SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL ); + SvxLineSpacingItem aItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ); aItem.SetPropLineSpace( 200 ); aNewAttr.Put( aItem ); } diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 1422bfa0b845..8fff09ef6d3e 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -320,21 +320,21 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case SID_ATTR_PARA_LINESPACE_10: { - SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL); + SvxLineSpacingItem aItem(LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL); aItem.SetPropLineSpace(100); aNewAttr.Put(aItem); } break; case SID_ATTR_PARA_LINESPACE_15: { - SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL); + SvxLineSpacingItem aItem(LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL); aItem.SetPropLineSpace(150); aNewAttr.Put(aItem); } break; case SID_ATTR_PARA_LINESPACE_20: { - SvxLineSpacingItem aItem(SVX_LINESPACE_TWO_LINES, EE_PARA_SBL); + SvxLineSpacingItem aItem(LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL); aItem.SetPropLineSpace(200); aNewAttr.Put(aItem); } diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index e233e0861c85..a894e3b98324 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -267,21 +267,21 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) break; case SID_ATTR_PARA_LINESPACE_10: { - SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL); + SvxLineSpacingItem aItem(LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL); aItem.SetPropLineSpace(100); aNewAttr.Put(aItem); } break; case SID_ATTR_PARA_LINESPACE_15: { - SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL); + SvxLineSpacingItem aItem(LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL); aItem.SetPropLineSpace(150); aNewAttr.Put(aItem); } break; case SID_ATTR_PARA_LINESPACE_20: { - SvxLineSpacingItem aItem(SVX_LINESPACE_TWO_LINES, EE_PARA_SBL); + SvxLineSpacingItem aItem(LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL); aItem.SetPropLineSpace(200); aNewAttr.Put(aItem); } |