sw/inc/charatr.hxx | 68 +++++++++--------- sw/inc/hintids.hxx | 98 +++++++++++++-------------- sw/qa/extras/uiwriter/uiwriter.cxx | 18 ++-- sw/source/core/doc/dbgoutsw.cxx | 1 sw/source/core/doc/fmtcol.cxx | 6 - sw/source/core/doc/tblafmt.cxx | 36 ++++----- sw/source/core/text/txtdrop.cxx | 4 - sw/source/core/text/txtfrm.cxx | 1 sw/source/core/txtnode/fntcache.cxx | 2 sw/source/core/txtnode/ndhints.cxx | 1 sw/source/core/txtnode/thints.cxx | 1 sw/source/core/unocore/unomap.cxx | 11 +++ sw/source/core/unocore/unomap1.cxx | 27 +++++++ sw/source/filter/html/wrthtml.cxx | 3 sw/source/filter/ww8/docxattributeoutput.cxx | 2 sw/source/filter/ww8/rtfattributeoutput.cxx | 3 sw/source/filter/ww8/rtfexport.cxx | 25 +----- sw/source/filter/ww8/wrtw8num.cxx | 2 sw/source/filter/ww8/wrtw8sty.cxx | 2 sw/source/filter/ww8/ww8par5.cxx | 4 - sw/source/ui/config/optpage.cxx | 16 ++-- sw/source/ui/misc/insfnote.cxx | 6 - sw/source/uibase/lingu/hhcwrp.cxx | 2 sw/source/uibase/shells/basesh.cxx | 6 - sw/source/uibase/shells/textsh1.cxx | 6 - sw/source/uibase/shells/txtattr.cxx | 13 +-- 26 files changed, 195 insertions(+), 169 deletions(-)
New commits: commit 35f5274ece0fcbb70753a71619b526ed0d4cbd6b Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Thu Nov 23 15:27:13 2017 +0200 TypedWhichId for RES_CHRATR constants Change-Id: Id6c45c237e9c8c55597d97b647b443eab9d1880a Reviewed-on: https://gerrit.libreoffice.org/45147 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/charatr.hxx b/sw/inc/charatr.hxx index ebc3f7de8892..3516772c2d82 100644 --- a/sw/inc/charatr.hxx +++ b/sw/inc/charatr.hxx @@ -52,73 +52,73 @@ // implementation of the character attribute methods of SwAttrSet inline const SvxPostureItem &SwAttrSet::GetPosture(bool bInP) const - { return static_cast<const SvxPostureItem&>(Get( RES_CHRATR_POSTURE,bInP)); } + { return Get( RES_CHRATR_POSTURE,bInP); } inline const SvxPostureItem &SwAttrSet::GetCJKPosture(bool bInP) const - { return static_cast<const SvxPostureItem&>(Get( RES_CHRATR_CJK_POSTURE,bInP)); } + { return Get( RES_CHRATR_CJK_POSTURE,bInP); } inline const SvxPostureItem &SwAttrSet::GetCTLPosture(bool bInP) const - { return static_cast<const SvxPostureItem&>(Get( RES_CHRATR_CTL_POSTURE,bInP)); } + { return Get( RES_CHRATR_CTL_POSTURE,bInP); } inline const SvxWeightItem &SwAttrSet::GetWeight(bool bInP) const - { return static_cast<const SvxWeightItem&>(Get( RES_CHRATR_WEIGHT,bInP)); } + { return Get( RES_CHRATR_WEIGHT,bInP); } inline const SvxWeightItem &SwAttrSet::GetCJKWeight(bool bInP) const - { return static_cast<const SvxWeightItem&>(Get( RES_CHRATR_CJK_WEIGHT,bInP)); } + { return Get( RES_CHRATR_CJK_WEIGHT,bInP); } inline const SvxWeightItem &SwAttrSet::GetCTLWeight(bool bInP) const - { return static_cast<const SvxWeightItem&>(Get( RES_CHRATR_CTL_WEIGHT,bInP)); } + { return Get( RES_CHRATR_CTL_WEIGHT,bInP); } inline const SvxShadowedItem &SwAttrSet::GetShadowed(bool bInP) const - { return static_cast<const SvxShadowedItem&>(Get( RES_CHRATR_SHADOWED,bInP)); } + { return Get( RES_CHRATR_SHADOWED,bInP); } inline const SvxAutoKernItem &SwAttrSet::GetAutoKern(bool bInP) const - { return static_cast<const SvxAutoKernItem&>(Get( RES_CHRATR_AUTOKERN,bInP)); } + { return Get( RES_CHRATR_AUTOKERN,bInP); } inline const SvxWordLineModeItem &SwAttrSet::GetWordLineMode(bool bInP) const - { return static_cast<const SvxWordLineModeItem&>(Get( RES_CHRATR_WORDLINEMODE,bInP)); } + { return Get( RES_CHRATR_WORDLINEMODE,bInP); } inline const SvxContourItem &SwAttrSet::GetContour(bool bInP) const - { return static_cast<const SvxContourItem&>(Get( RES_CHRATR_CONTOUR,bInP)); } + { return Get( RES_CHRATR_CONTOUR,bInP); } inline const SvxKerningItem &SwAttrSet::GetKerning(bool bInP) const - { return static_cast<const SvxKerningItem&>(Get( RES_CHRATR_KERNING,bInP)); } + { return Get( RES_CHRATR_KERNING,bInP); } inline const SvxUnderlineItem &SwAttrSet::GetUnderline(bool bInP) const - { return static_cast<const SvxUnderlineItem&>(Get( RES_CHRATR_UNDERLINE,bInP)); } + { return Get( RES_CHRATR_UNDERLINE,bInP); } inline const SvxOverlineItem &SwAttrSet::GetOverline(bool bInP) const - { return static_cast<const SvxOverlineItem&>(Get( RES_CHRATR_OVERLINE,bInP)); } + { return Get( RES_CHRATR_OVERLINE,bInP); } inline const SvxCrossedOutItem &SwAttrSet::GetCrossedOut(bool bInP) const - { return static_cast<const SvxCrossedOutItem&>(Get( RES_CHRATR_CROSSEDOUT,bInP)); } + { return Get( RES_CHRATR_CROSSEDOUT,bInP); } inline const SvxFontHeightItem &SwAttrSet::GetSize(bool bInP) const - { return static_cast<const SvxFontHeightItem&>(Get( RES_CHRATR_FONTSIZE,bInP)); } + { return Get( RES_CHRATR_FONTSIZE,bInP); } inline const SvxFontHeightItem &SwAttrSet::GetCJKSize(bool bInP) const - { return static_cast<const SvxFontHeightItem&>(Get( RES_CHRATR_CJK_FONTSIZE,bInP)); } + { return Get( RES_CHRATR_CJK_FONTSIZE,bInP); } inline const SvxFontHeightItem &SwAttrSet::GetCTLSize(bool bInP) const - { return static_cast<const SvxFontHeightItem&>(Get( RES_CHRATR_CTL_FONTSIZE,bInP)); } + { return Get( RES_CHRATR_CTL_FONTSIZE,bInP); } inline const SvxFontItem &SwAttrSet::GetFont(bool bInP) const - { return static_cast<const SvxFontItem&>(Get( RES_CHRATR_FONT,bInP)); } + { return Get( RES_CHRATR_FONT,bInP); } inline const SvxFontItem &SwAttrSet::GetCJKFont(bool bInP) const - { return static_cast<const SvxFontItem&>(Get( RES_CHRATR_CJK_FONT,bInP)); } + { return Get( RES_CHRATR_CJK_FONT,bInP); } inline const SvxFontItem &SwAttrSet::GetCTLFont(bool bInP) const - { return static_cast<const SvxFontItem&>(Get( RES_CHRATR_CTL_FONT,bInP)); } + { return Get( RES_CHRATR_CTL_FONT,bInP); } inline const SvxColorItem &SwAttrSet::GetColor(bool bInP) const - { return static_cast<const SvxColorItem&>(Get( RES_CHRATR_COLOR,bInP)); } + { return Get( RES_CHRATR_COLOR,bInP); } inline const SvxLanguageItem &SwAttrSet::GetLanguage(bool bInP) const - { return static_cast<const SvxLanguageItem&>(Get( RES_CHRATR_LANGUAGE,bInP)); } + { return Get( RES_CHRATR_LANGUAGE,bInP); } inline const SvxLanguageItem &SwAttrSet::GetCJKLanguage(bool bInP) const - { return static_cast<const SvxLanguageItem&>(Get( RES_CHRATR_CJK_LANGUAGE,bInP)); } + { return Get( RES_CHRATR_CJK_LANGUAGE,bInP); } inline const SvxLanguageItem &SwAttrSet::GetCTLLanguage(bool bInP) const - { return static_cast<const SvxLanguageItem&>(Get( RES_CHRATR_CTL_LANGUAGE,bInP)); } + { return Get( RES_CHRATR_CTL_LANGUAGE,bInP); } inline const SvxEscapementItem &SwAttrSet::GetEscapement(bool bInP) const - { return static_cast<const SvxEscapementItem&>(Get( RES_CHRATR_ESCAPEMENT,bInP)); } + { return Get( RES_CHRATR_ESCAPEMENT,bInP); } inline const SvxCaseMapItem &SwAttrSet::GetCaseMap(bool bInP) const - { return static_cast<const SvxCaseMapItem&>(Get( RES_CHRATR_CASEMAP,bInP)); } + { return Get( RES_CHRATR_CASEMAP,bInP); } inline const SvxNoHyphenItem &SwAttrSet::GetNoHyphenHere(bool bInP) const - { return static_cast<const SvxNoHyphenItem&>(Get( RES_CHRATR_NOHYPHEN,bInP)); } + { return Get( RES_CHRATR_NOHYPHEN,bInP); } inline const SvxBlinkItem &SwAttrSet::GetBlink(bool bInP) const - { return static_cast<const SvxBlinkItem&>(Get( RES_CHRATR_BLINK,bInP)); } + { return Get( RES_CHRATR_BLINK,bInP); } inline const SvxEmphasisMarkItem &SwAttrSet::GetEmphasisMark( bool bInP ) const - { return static_cast<const SvxEmphasisMarkItem&>(Get( RES_CHRATR_EMPHASIS_MARK, bInP )); } + { return Get( RES_CHRATR_EMPHASIS_MARK, bInP ); } inline const SvxTwoLinesItem &SwAttrSet::Get2Lines( bool bInP ) const - { return static_cast<const SvxTwoLinesItem&>(Get( RES_CHRATR_TWO_LINES, bInP )); } + { return Get( RES_CHRATR_TWO_LINES, bInP ); } inline const SvxCharScaleWidthItem &SwAttrSet::GetCharScaleW( bool bInP ) const - { return static_cast<const SvxCharScaleWidthItem&>(Get( RES_CHRATR_SCALEW, bInP )); } + { return Get( RES_CHRATR_SCALEW, bInP ); } inline const SvxCharRotateItem &SwAttrSet::GetCharRotate( bool bInP ) const - { return static_cast<const SvxCharRotateItem&>(Get( RES_CHRATR_ROTATE, bInP )); } + { return Get( RES_CHRATR_ROTATE, bInP ); } inline const SvxCharReliefItem &SwAttrSet::GetCharRelief( bool bInP ) const - { return static_cast<const SvxCharReliefItem&>(Get( RES_CHRATR_RELIEF, bInP )); } + { return Get( RES_CHRATR_RELIEF, bInP ); } inline const SvxCharHiddenItem &SwAttrSet::GetCharHidden( bool bInP ) const - { return static_cast<const SvxCharHiddenItem&>(Get( RES_CHRATR_HIDDEN, bInP )); } + { return Get( RES_CHRATR_HIDDEN, bInP ); } // implementation of the character attribute methods of SwFormat diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 6334a6007857..9d6111abcbe3 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -23,6 +23,7 @@ #include <sal/types.h> #include <svx/xdef.hxx> #include "swdllapi.h" +#include <svl/typedwhich.hxx> #include <vector> // For SwTextHints without end index the following char is added: @@ -52,56 +53,53 @@ // Ranges for the IDs of the format-attributes. // Which-values for character-format attributes. -enum RES_CHRATR -{ -RES_CHRATR_BEGIN = HINT_BEGIN, - RES_CHRATR_CASEMAP = RES_CHRATR_BEGIN, // 1 - RES_CHRATR_CHARSETCOLOR, // 2 - RES_CHRATR_COLOR, // 3 - RES_CHRATR_CONTOUR, // 4 - RES_CHRATR_CROSSEDOUT, // 5 - RES_CHRATR_ESCAPEMENT, // 6 - RES_CHRATR_FONT, // 7 - RES_CHRATR_FONTSIZE, // 8 - RES_CHRATR_KERNING, // 9 - RES_CHRATR_LANGUAGE, // 10 - RES_CHRATR_POSTURE, // 11 - RES_CHRATR_PROPORTIONALFONTSIZE, // 12 - RES_CHRATR_SHADOWED, // 13 - RES_CHRATR_UNDERLINE, // 14 - RES_CHRATR_WEIGHT, // 15 - RES_CHRATR_WORDLINEMODE, // 16 - RES_CHRATR_AUTOKERN, // 17 - RES_CHRATR_BLINK, // 18 - RES_CHRATR_NOHYPHEN, // 19 - RES_CHRATR_NOLINEBREAK, // 20 - RES_CHRATR_BACKGROUND, // 21 - RES_CHRATR_CJK_FONT, // 22 - RES_CHRATR_CJK_FONTSIZE, // 23 - RES_CHRATR_CJK_LANGUAGE, // 24 - RES_CHRATR_CJK_POSTURE, // 25 - RES_CHRATR_CJK_WEIGHT, // 26 - RES_CHRATR_CTL_FONT, // 27 - RES_CHRATR_CTL_FONTSIZE, // 28 - RES_CHRATR_CTL_LANGUAGE, // 29 - RES_CHRATR_CTL_POSTURE, // 30 - RES_CHRATR_CTL_WEIGHT, // 31 - RES_CHRATR_ROTATE, // 32 - RES_CHRATR_EMPHASIS_MARK, // 33 - RES_CHRATR_TWO_LINES, // 34 - RES_CHRATR_SCALEW, // 35 - RES_CHRATR_RELIEF, // 36 - RES_CHRATR_HIDDEN, // 37 - RES_CHRATR_OVERLINE, // 38 - RES_CHRATR_RSID, // 39 - RES_CHRATR_BOX, // 40 - RES_CHRATR_SHADOW, // 41 - RES_CHRATR_HIGHLIGHT, // 42 - RES_CHRATR_GRABBAG, // 43 - RES_CHRATR_BIDIRTL, // 44 - RES_CHRATR_IDCTHINT, // 45 -RES_CHRATR_END -}; +#define RES_CHRATR_BEGIN HINT_BEGIN +#define RES_CHRATR_CASEMAP TypedWhichId<SvxCaseMapItem>(RES_CHRATR_BEGIN) // 1 +#define RES_CHRATR_CHARSETCOLOR TypedWhichId<SvxCharSetColorItem>(2) +#define RES_CHRATR_COLOR TypedWhichId<SvxColorItem>(3) +#define RES_CHRATR_CONTOUR TypedWhichId<SvxContourItem>(4) +#define RES_CHRATR_CROSSEDOUT TypedWhichId<SvxCrossedOutItem>(5) +#define RES_CHRATR_ESCAPEMENT TypedWhichId<SvxEscapementItem>(6) +#define RES_CHRATR_FONT TypedWhichId<SvxFontItem>(7) +#define RES_CHRATR_FONTSIZE TypedWhichId<SvxFontHeightItem>(8) +#define RES_CHRATR_KERNING TypedWhichId<SvxKerningItem>(9) +#define RES_CHRATR_LANGUAGE TypedWhichId<SvxLanguageItem>(10) +#define RES_CHRATR_POSTURE TypedWhichId<SvxPostureItem>(11) +#define RES_CHRATR_PROPORTIONALFONTSIZE TypedWhichId<SvxPropSizeItem>(12) +#define RES_CHRATR_SHADOWED TypedWhichId<SvxShadowedItem>(13) +#define RES_CHRATR_UNDERLINE TypedWhichId<SvxUnderlineItem>(14) +#define RES_CHRATR_WEIGHT TypedWhichId<SvxWeightItem>(15) +#define RES_CHRATR_WORDLINEMODE TypedWhichId<SvxWordLineModeItem>(16) +#define RES_CHRATR_AUTOKERN TypedWhichId<SvxAutoKernItem>(17) +#define RES_CHRATR_BLINK TypedWhichId<SvxBlinkItem>(18) +#define RES_CHRATR_NOHYPHEN TypedWhichId<SvxNoHyphenItem>(19) +#define RES_CHRATR_NOLINEBREAK TypedWhichId<SvxNoLinebreakItem>(20) +#define RES_CHRATR_BACKGROUND TypedWhichId<SvxBrushItem>(21) +#define RES_CHRATR_CJK_FONT TypedWhichId<SvxFontItem>(22) +#define RES_CHRATR_CJK_FONTSIZE TypedWhichId<SvxFontHeightItem>(23) +#define RES_CHRATR_CJK_LANGUAGE TypedWhichId<SvxLanguageItem>(24) +#define RES_CHRATR_CJK_POSTURE TypedWhichId<SvxPostureItem>(25) +#define RES_CHRATR_CJK_WEIGHT TypedWhichId<SvxWeightItem>(26) +#define RES_CHRATR_CTL_FONT TypedWhichId<SvxFontItem>(27) +#define RES_CHRATR_CTL_FONTSIZE TypedWhichId<SvxFontHeightItem>(28) +#define RES_CHRATR_CTL_LANGUAGE TypedWhichId<SvxLanguageItem>(29) +#define RES_CHRATR_CTL_POSTURE TypedWhichId<SvxPostureItem>(30) +#define RES_CHRATR_CTL_WEIGHT TypedWhichId<SvxWeightItem>(31) +#define RES_CHRATR_ROTATE TypedWhichId<SvxCharRotateItem>(32) +#define RES_CHRATR_EMPHASIS_MARK TypedWhichId<SvxEmphasisMarkItem>(33) +#define RES_CHRATR_TWO_LINES TypedWhichId<SvxTwoLinesItem>(34) +#define RES_CHRATR_SCALEW TypedWhichId<SvxCharScaleWidthItem>(35) +#define RES_CHRATR_RELIEF TypedWhichId<SvxCharReliefItem>(36) +#define RES_CHRATR_HIDDEN TypedWhichId<SvxCharHiddenItem>(37) +#define RES_CHRATR_OVERLINE TypedWhichId<SvxOverlineItem>(38) +#define RES_CHRATR_RSID TypedWhichId<SvxRsidItem>(39) +#define RES_CHRATR_BOX TypedWhichId<SvxBoxItem>(40) +#define RES_CHRATR_SHADOW TypedWhichId<SvxShadowedItem>(41) +#define RES_CHRATR_HIGHLIGHT TypedWhichId<SvxBrushItem>(42) +#define RES_CHRATR_GRABBAG TypedWhichId<SfxGrabBagItem>(43) +#define RES_CHRATR_BIDIRTL TypedWhichId<SfxInt16Item>(44) +#define RES_CHRATR_IDCTHINT TypedWhichId<SfxInt16Item>(45) +#define RES_CHRATR_END (46) // this Attribute used only in a TextNodes SwpAttr-Array enum RES_TXTATR diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 0504bbc27b59..8c8f71f198c5 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -3220,14 +3220,14 @@ void SwUiWriterTest::testTdf99689TableOfContents() // next node should contain superscript SwTextNode* pNext = static_cast<SwTextNode*> (pDoc->GetNodes().GoNext( &aIdx )); CPPUNIT_ASSERT( pNext->HasHints() ); - sal_Int32 nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); - CPPUNIT_ASSERT_EQUAL(RES_CHRATR_ESCAPEMENT, static_cast<RES_CHRATR>(nAttrType) ); + sal_uInt16 nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(RES_CHRATR_ESCAPEMENT), nAttrType ); // next node should contain subscript pNext = static_cast<SwTextNode*> (pDoc->GetNodes().GoNext( &aIdx )); CPPUNIT_ASSERT( pNext->HasHints() ); nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); - CPPUNIT_ASSERT_EQUAL(RES_CHRATR_ESCAPEMENT, static_cast<RES_CHRATR>(nAttrType) ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(RES_CHRATR_ESCAPEMENT), nAttrType ); } void SwUiWriterTest::testTdf99689TableOfFigures() @@ -3245,14 +3245,14 @@ void SwUiWriterTest::testTdf99689TableOfFigures() // next node should contain subscript SwTextNode* pNext = static_cast<SwTextNode*> (pDoc->GetNodes().GoNext( &aIdx )); CPPUNIT_ASSERT( pNext->HasHints() ); - sal_Int32 nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); - CPPUNIT_ASSERT_EQUAL(RES_CHRATR_ESCAPEMENT, static_cast<RES_CHRATR>(nAttrType) ); + sal_uInt16 nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(RES_CHRATR_ESCAPEMENT), nAttrType ); // next node should contain superscript pNext = static_cast<SwTextNode*> (pDoc->GetNodes().GoNext( &aIdx )); CPPUNIT_ASSERT( pNext->HasHints() ); nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); - CPPUNIT_ASSERT_EQUAL(RES_CHRATR_ESCAPEMENT, static_cast<RES_CHRATR>(nAttrType) ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(RES_CHRATR_ESCAPEMENT), nAttrType ); } void SwUiWriterTest::testTdf99689TableOfTables() @@ -3270,14 +3270,14 @@ void SwUiWriterTest::testTdf99689TableOfTables() // next node should contain superscript SwTextNode* pNext = static_cast<SwTextNode*> (pDoc->GetNodes().GoNext( &aIdx )); CPPUNIT_ASSERT( pNext->HasHints() ); - sal_Int32 nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); - CPPUNIT_ASSERT_EQUAL(RES_CHRATR_ESCAPEMENT, static_cast<RES_CHRATR>(nAttrType) ); + sal_uInt16 nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(RES_CHRATR_ESCAPEMENT), nAttrType ); // next node should contain subscript pNext = static_cast<SwTextNode*> (pDoc->GetNodes().GoNext( &aIdx )); CPPUNIT_ASSERT( pNext->HasHints() ); nAttrType = lcl_getAttributeIDFromHints( pNext->GetSwpHints() ); - CPPUNIT_ASSERT_EQUAL(RES_CHRATR_ESCAPEMENT, static_cast<RES_CHRATR>(nAttrType) ); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(RES_CHRATR_ESCAPEMENT), nAttrType ); } void SwUiWriterTest::testTdf83798() diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index f1850e1ed752..342ab3834daf 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -19,6 +19,7 @@ #ifdef DBG_UTIL +#include <editeng/nlbkitem.hxx> #include <rtl/ustring.hxx> #include <svl/poolitem.hxx> #include <svl/itemiter.hxx> diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 0dc68ed2b2f1..0491f1d07428 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -160,9 +160,9 @@ void SwTextFormatColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew const SfxItemSet* pParent = GetAttrSet().GetParent(); pNewLRSpace = static_cast<const SvxLRSpaceItem*>(&pParent->Get( RES_LR_SPACE )); pNewULSpace = static_cast<const SvxULSpaceItem*>(&pParent->Get( RES_UL_SPACE )); - aFontSizeArr[0] = static_cast<const SvxFontHeightItem*>(&pParent->Get( RES_CHRATR_FONTSIZE )); - aFontSizeArr[1] = static_cast<const SvxFontHeightItem*>(&pParent->Get( RES_CHRATR_CJK_FONTSIZE )); - aFontSizeArr[2] = static_cast<const SvxFontHeightItem*>(&pParent->Get( RES_CHRATR_CTL_FONTSIZE )); + aFontSizeArr[0] = &pParent->Get( RES_CHRATR_FONTSIZE ); + aFontSizeArr[1] = &pParent->Get( RES_CHRATR_CJK_FONTSIZE ); + aFontSizeArr[2] = &pParent->Get( RES_CHRATR_CTL_FONTSIZE ); // #i66431# - modify has to be propagated, because of new parent format. bNewParent = true; } diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 7491f33a78a8..ba5d238f1a62 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -741,24 +741,24 @@ void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos, if( UPDATE_CHAR & eFlags ) { - pFormat->SetFont( static_cast<const SvxFontItem&>(rSet.Get( RES_CHRATR_FONT )) ); - pFormat->SetHeight( static_cast<const SvxFontHeightItem&>(rSet.Get( RES_CHRATR_FONTSIZE )) ); - pFormat->SetWeight( static_cast<const SvxWeightItem&>(rSet.Get( RES_CHRATR_WEIGHT )) ); - pFormat->SetPosture( static_cast<const SvxPostureItem&>(rSet.Get( RES_CHRATR_POSTURE )) ); - pFormat->SetCJKFont( static_cast<const SvxFontItem&>(rSet.Get( RES_CHRATR_CJK_FONT )) ); - pFormat->SetCJKHeight( static_cast<const SvxFontHeightItem&>(rSet.Get( RES_CHRATR_CJK_FONTSIZE )) ); - pFormat->SetCJKWeight( static_cast<const SvxWeightItem&>(rSet.Get( RES_CHRATR_CJK_WEIGHT )) ); - pFormat->SetCJKPosture( static_cast<const SvxPostureItem&>(rSet.Get( RES_CHRATR_CJK_POSTURE )) ); - pFormat->SetCTLFont( static_cast<const SvxFontItem&>(rSet.Get( RES_CHRATR_CTL_FONT )) ); - pFormat->SetCTLHeight( static_cast<const SvxFontHeightItem&>(rSet.Get( RES_CHRATR_CTL_FONTSIZE )) ); - pFormat->SetCTLWeight( static_cast<const SvxWeightItem&>(rSet.Get( RES_CHRATR_CTL_WEIGHT )) ); - pFormat->SetCTLPosture( static_cast<const SvxPostureItem&>(rSet.Get( RES_CHRATR_CTL_POSTURE )) ); - pFormat->SetUnderline( static_cast<const SvxUnderlineItem&>(rSet.Get( RES_CHRATR_UNDERLINE )) ); - pFormat->SetOverline( static_cast<const SvxOverlineItem&>(rSet.Get( RES_CHRATR_OVERLINE )) ); - pFormat->SetCrossedOut( static_cast<const SvxCrossedOutItem&>(rSet.Get( RES_CHRATR_CROSSEDOUT )) ); - pFormat->SetContour( static_cast<const SvxContourItem&>(rSet.Get( RES_CHRATR_CONTOUR )) ); - pFormat->SetShadowed( static_cast<const SvxShadowedItem&>(rSet.Get( RES_CHRATR_SHADOWED )) ); - pFormat->SetColor( static_cast<const SvxColorItem&>(rSet.Get( RES_CHRATR_COLOR )) ); + pFormat->SetFont( rSet.Get( RES_CHRATR_FONT ) ); + pFormat->SetHeight( rSet.Get( RES_CHRATR_FONTSIZE ) ); + pFormat->SetWeight( rSet.Get( RES_CHRATR_WEIGHT ) ); + pFormat->SetPosture( rSet.Get( RES_CHRATR_POSTURE ) ); + pFormat->SetCJKFont( rSet.Get( RES_CHRATR_CJK_FONT ) ); + pFormat->SetCJKHeight( rSet.Get( RES_CHRATR_CJK_FONTSIZE ) ); + pFormat->SetCJKWeight( rSet.Get( RES_CHRATR_CJK_WEIGHT ) ); + pFormat->SetCJKPosture( rSet.Get( RES_CHRATR_CJK_POSTURE ) ); + pFormat->SetCTLFont( rSet.Get( RES_CHRATR_CTL_FONT ) ); + pFormat->SetCTLHeight( rSet.Get( RES_CHRATR_CTL_FONTSIZE ) ); + pFormat->SetCTLWeight( rSet.Get( RES_CHRATR_CTL_WEIGHT ) ); + pFormat->SetCTLPosture( rSet.Get( RES_CHRATR_CTL_POSTURE ) ); + pFormat->SetUnderline( rSet.Get( RES_CHRATR_UNDERLINE ) ); + pFormat->SetOverline( rSet.Get( RES_CHRATR_OVERLINE ) ); + pFormat->SetCrossedOut( rSet.Get( RES_CHRATR_CROSSEDOUT ) ); + pFormat->SetContour( rSet.Get( RES_CHRATR_CONTOUR ) ); + pFormat->SetShadowed( rSet.Get( RES_CHRATR_SHADOWED ) ); + pFormat->SetColor( rSet.Get( RES_CHRATR_COLOR ) ); pFormat->SetAdjust( static_cast<const SvxAdjustItem&>(rSet.Get( RES_PARATR_ADJUST )) ); } if( UPDATE_BOX & eFlags ) diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index cb3638dad4a1..7ec194348087 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -216,7 +216,7 @@ bool SwTextNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDesce rFontHeight = pFont->GetSize(pFont->GetActual()).Height(); else { - const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get(RES_CHRATR_FONTSIZE)); + const SvxFontHeightItem& rItem = rSet.Get(RES_CHRATR_FONTSIZE); rFontHeight = rItem.GetHeight(); } } @@ -230,7 +230,7 @@ bool SwTextNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDesce { const sal_uInt16 nLines = rDrop.GetLines(); - const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get( RES_CHRATR_FONTSIZE )); + const SvxFontHeightItem& rItem = rSet.Get( RES_CHRATR_FONTSIZE ); rFontHeight = rItem.GetHeight(); rDropHeight = nLines * rFontHeight; rDropDescent = rFontHeight / 5; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index aa09788b7202..9eeeb829df72 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -28,6 +28,7 @@ #include <editeng/ulspitem.hxx> #include <editeng/brushitem.hxx> #include <editeng/pgrditem.hxx> +#include <editeng/rsiditem.hxx> #include <unotools/configmgr.hxx> #include <swmodule.hxx> #include <SwSmartTagMgr.hxx> diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 22171d0245c1..fbb4ee5f4951 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -83,7 +83,7 @@ long EvalGridWidthAdd( const SwTextGridItem *const pGrid, const SwDrawTextInfo & SfxStyleSheetBase* pStyle = pBasePool->Find(SwResId(STR_POOLCOLL_STANDARD), SfxStyleFamily::Para); SfxItemSet& aTmpSet = pStyle->GetItemSet(); - const SvxFontHeightItem &aDefaultFontItem = static_cast<const SvxFontHeightItem&>(aTmpSet.Get(RES_CHRATR_CJK_FONTSIZE)); + const SvxFontHeightItem &aDefaultFontItem = aTmpSet.Get(RES_CHRATR_CJK_FONTSIZE); const SwDoc* pDoc = rInf.GetShell()->GetDoc(); const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc); diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx index 0099a379c118..fb360de42e62 100644 --- a/sw/source/core/txtnode/ndhints.cxx +++ b/sw/source/core/txtnode/ndhints.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <editeng/rsiditem.hxx> #include <txatbase.hxx> #include <ndhints.hxx> #include <txtatr.hxx> diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 92c8de9a89db..e77276f1fc35 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -21,6 +21,7 @@ #include <hintids.hxx> #include <editeng/xmlcnitm.hxx> +#include <editeng/rsiditem.hxx> #include <svl/whiter.hxx> #include <svl/itemiter.hxx> #include <svl/stylepool.hxx> diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 3219ebaaa0f1..61b6dcd9feb2 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -84,9 +84,20 @@ #include <unomid.h> #include <cmdid.h> #include <unofldmid.h> +#include <editeng/colritem.hxx> +#include <editeng/contouritem.hxx> +#include <editeng/crossedoutitem.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/fontitem.hxx> +#include <editeng/langitem.hxx> #include <editeng/memberids.h> +#include <editeng/postitem.hxx> #include <editeng/unoipset.hxx> #include <editeng/unoprnms.hxx> +#include <editeng/shdditem.hxx> +#include <editeng/twolinesitem.hxx> +#include <editeng/udlnitem.hxx> +#include <editeng/wghtitem.hxx> #include <svx/xdef.hxx> #include "unomapproperties.hxx" diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx index 120b12202857..d610e76d09f0 100644 --- a/sw/source/core/unocore/unomap1.cxx +++ b/sw/source/core/unocore/unomap1.cxx @@ -83,9 +83,36 @@ #include <unomid.h> #include <cmdid.h> #include <unofldmid.h> +#include <editeng/autokernitem.hxx> +#include <editeng/blinkitem.hxx> +#include <editeng/boxitem.hxx> +#include <editeng/brushitem.hxx> +#include <editeng/charhiddenitem.hxx> +#include <editeng/charreliefitem.hxx> +#include <editeng/charrotateitem.hxx> +#include <editeng/charscaleitem.hxx> +#include <editeng/colritem.hxx> +#include <editeng/cmapitem.hxx> +#include <editeng/contouritem.hxx> +#include <editeng/crossedoutitem.hxx> +#include <editeng/emphasismarkitem.hxx> +#include <editeng/escapementitem.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/fontitem.hxx> +#include <editeng/kernitem.hxx> +#include <editeng/langitem.hxx> #include <editeng/memberids.h> +#include <editeng/nhypitem.hxx> +#include <editeng/postitem.hxx> +#include <editeng/rsiditem.hxx> +#include <editeng/shdditem.hxx> +#include <editeng/twolinesitem.hxx> +#include <editeng/udlnitem.hxx> #include <editeng/unoipset.hxx> #include <editeng/unoprnms.hxx> +#include <editeng/wghtitem.hxx> +#include <editeng/wrlmitem.hxx> +#include <svl/grabbagitem.hxx> #include <svx/xdef.hxx> #include "unomapproperties.hxx" diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index bd3822284981..1c1a215fd064 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -864,8 +864,7 @@ static void OutBodyColor( const sal_Char* pTag, const SwFormat *pFormat, else if( bRefItemSet ) { // The item was still set in the HTML template so we output the default - pColorItem = static_cast<const SvxColorItem*>(&rItemSet.GetPool() - ->GetDefaultItem( RES_CHRATR_COLOR )); + pColorItem = &rItemSet.GetPool()->GetDefaultItem( RES_CHRATR_COLOR ); } if( pColorItem ) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 9bb78246e2a6..d46c2d205119 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6139,7 +6139,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut case style::NumberingType::NUMBER_LOWER_ZH: aType="taiwaneseCountingThousand"; if (pOutSet) { - const SvxLanguageItem rLang = static_cast<const SvxLanguageItem&>( pOutSet->Get( RES_CHRATR_CJK_LANGUAGE) ); + const SvxLanguageItem rLang = pOutSet->Get( RES_CHRATR_CJK_LANGUAGE); const LanguageType eLang = rLang.GetLanguage(); if (LANGUAGE_CHINESE_SIMPLIFIED == eLang) { diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index f8a7959ae161..7b2c4a34670f 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1440,8 +1440,7 @@ void RtfAttributeOutput::NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, nVal = 35; if (pOutSet) { - const SvxLanguageItem rlang - = static_cast<const SvxLanguageItem&>(pOutSet->Get(RES_CHRATR_CJK_LANGUAGE)); + const SvxLanguageItem rlang = pOutSet->Get(RES_CHRATR_CJK_LANGUAGE); if (LANGUAGE_CHINESE_SIMPLIFIED == rlang.GetLanguage()) { nVal = 39; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index e4e51b6a23b4..779719756a85 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -669,8 +669,7 @@ void RtfExport::ExportDocument_Impl() .WriteChar('1') .WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSI); Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_DEFF); - OutULong(m_aFontHelper.GetId( - static_cast<const SvxFontItem&>(m_pDoc->GetAttrPool().GetDefaultItem(RES_CHRATR_FONT)))); + OutULong(m_aFontHelper.GetId(m_pDoc->GetAttrPool().GetDefaultItem(RES_CHRATR_FONT))); // If this not exist, MS don't understand our ansi characters (0x80-0xff). Strm().WriteCharPtr("\\adeflang1025"); @@ -1174,15 +1173,12 @@ void RtfExport::OutColorTable() { auto pCol = static_cast<const SvxColorItem*>(GetDfltAttr(RES_CHRATR_COLOR)); InsColor(pCol->GetValue()); - if (nullptr - != (pCol - = static_cast<const SvxColorItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_COLOR)))) + if ((pCol = rPool.GetPoolDefaultItem(RES_CHRATR_COLOR))) InsColor(pCol->GetValue()); nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (nullptr - != (pCol = static_cast<const SvxColorItem*>(rPool.GetItem2(RES_CHRATR_COLOR, n)))) + if ((pCol = rPool.GetItem2(RES_CHRATR_COLOR, n))) InsColor(pCol->GetValue()); } @@ -1191,9 +1187,7 @@ void RtfExport::OutColorTable() nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (nullptr - != (pUnder = static_cast<const SvxUnderlineItem*>( - rPool.GetItem2(RES_CHRATR_UNDERLINE, n)))) + if ((pUnder = rPool.GetItem2(RES_CHRATR_UNDERLINE, n))) InsColor(pUnder->GetColor()); } @@ -1202,9 +1196,7 @@ void RtfExport::OutColorTable() nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (nullptr - != (pOver - = static_cast<const SvxOverlineItem*>(rPool.GetItem2(RES_CHRATR_OVERLINE, n)))) + if ((pOver = rPool.GetItem2(RES_CHRATR_OVERLINE, n))) InsColor(pOver->GetColor()); } } @@ -1265,15 +1257,12 @@ void RtfExport::OutColorTable() { const SvxBoxItem* pCharBox; - if (nullptr - != (pCharBox - = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_BOX)))) + if ((pCharBox = rPool.GetPoolDefaultItem(RES_CHRATR_BOX))) InsColorLine(*pCharBox); nMaxItem = rPool.GetItemCount2(RES_CHRATR_BOX); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (nullptr - != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_CHRATR_BOX, n)))) + if ((pCharBox = rPool.GetItem2(RES_CHRATR_BOX, n))) InsColorLine(*pCharBox); } } diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 035b839166f9..49bf605bae2d 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -204,7 +204,7 @@ static sal_uInt8 GetLevelNFC( sal_uInt16 eNumType, const SfxItemSet *pOutSet) case SVX_NUM_NUMBER_LOWER_ZH: nRet = 35; if ( pOutSet ) { - const SvxLanguageItem rLang = static_cast<const SvxLanguageItem&>( pOutSet->Get( RES_CHRATR_CJK_LANGUAGE) ); + const SvxLanguageItem rLang = pOutSet->Get( RES_CHRATR_CJK_LANGUAGE); const LanguageType eLang = rLang.GetLanguage(); if (LANGUAGE_CHINESE_SIMPLIFIED ==eLang) { nRet = 39; diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 8a86fef5c6c2..ff371d39f342 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -855,7 +855,7 @@ void wwFontHelper::InitFontTable(const SwDoc& rDoc) pFont->GetFamily(), pFont->GetCharSet())); const SfxItemPool& rPool = rDoc.GetAttrPool(); - if (nullptr != (pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_FONT)))) + if (nullptr != (pFont = rPool.GetPoolDefaultItem(RES_CHRATR_FONT))) { GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), pFont->GetFamily(), pFont->GetCharSet())); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 4ceee387fe45..e6dee54d5d50 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -439,8 +439,8 @@ short SwWW8ImplReader::GetTimeDatePara(OUString const & rStr, sal_uInt32& rForma if (aResult.pSprm && aResult.nRemainingData >= 1 && *aResult.pSprm) bRTL = true; } - RES_CHRATR eLang = bRTL ? RES_CHRATR_CTL_LANGUAGE : RES_CHRATR_LANGUAGE; - const SvxLanguageItem *pLang = static_cast<const SvxLanguageItem*>(GetFormatAttr( static_cast< sal_uInt16 >(eLang))); + sal_uInt16 eLang = bRTL ? RES_CHRATR_CTL_LANGUAGE : RES_CHRATR_LANGUAGE; + const SvxLanguageItem *pLang = static_cast<const SvxLanguageItem*>(GetFormatAttr(eLang)); OSL_ENSURE(pLang, "impossible"); rLang = pLang ? pLang->GetValue() : LANGUAGE_ENGLISH_US; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index b30f1bc72127..1ce7ae23e78d 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -709,12 +709,12 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* ) m_pWrtShell->StartAllAction(); SfxPrinter* pPrinter = m_pWrtShell->getIDocumentDeviceAccess().getPrinter( false ); bool bMod = false; - const sal_uInt16 nFontWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + const sal_uInt16 nFontWhich = m_nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONT : - FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT); - const sal_uInt16 nFontHeightWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT; + const sal_uInt16 nFontHeightWhich = m_nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONTSIZE : - FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE); + FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE; if(sStandard != m_sShellStd) { vcl::Font aFont( sStandard, Size( 0, 10 ) ); @@ -890,9 +890,9 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont(); m_sShellStd = sStdBackup = rFont.GetFamilyName(); - const sal_uInt16 nFontHeightWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + const sal_uInt16 nFontHeightWhich = m_nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONTSIZE : - FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE ); + FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE; const SvxFontHeightItem& rFontHeightStandard = static_cast<const SvxFontHeightItem& >(pColl->GetFormatAttr(nFontHeightWhich)); nStandardHeight = (sal_Int32)rFontHeightStandard.GetHeight(); @@ -904,9 +904,9 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) const SvxFontHeightItem& rFontHeightTitle = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr( nFontHeightWhich )); nTitleHeight = (sal_Int32)rFontHeightTitle.GetHeight(); - const sal_uInt16 nFontWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >( + const sal_uInt16 nFontWhich = m_nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONT : - FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT); + FONT_GROUP_CJK == m_nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT; pColl = m_pWrtShell->GetTextCollFromPool(RES_POOLCOLL_NUMBUL_BASE); const SvxFontItem& rFontLS = !m_nFontGroup ? pColl->GetFont() : FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont(); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index cc8f13e5273c..0cd368d5eb98 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -60,7 +60,7 @@ void SwInsFootNoteDlg::Apply() rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>{} ); rSh.GetCurAttr( aSet ); - const SvxFontItem &rFont = static_cast<const SvxFontItem &>( aSet.Get( RES_CHRATR_FONT )); + const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); SvxFontItem aFont( rFont.GetFamily(), m_aFontName, rFont.GetStyleName(), rFont.GetPitch(), eCharSet, RES_CHRATR_FONT ); @@ -103,7 +103,7 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl, Button*, void) SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>{} ); rSh.GetCurAttr( aSet ); - const SvxFontItem &rFont = static_cast<const SvxFontItem &>( aSet.Get( RES_CHRATR_FONT ) ); + const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); SfxAllItemSet aAllSet( rSh.GetAttrPool() ); aAllSet.Put( SfxBoolItem( FN_PARAM_1, false ) ); @@ -232,7 +232,7 @@ void SwInsFootNoteDlg::Init() rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>{} ); rSh.GetCurAttr( aSet ); - const SvxFontItem &rFont = static_cast<const SvxFontItem &>( aSet.Get( RES_CHRATR_FONT ) ); + const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); aFont = m_pNumberCharEdit->GetFont(); m_aFontName = rFont.GetFamilyName(); diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index 2f45e766b341..431d9a42f73c 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -490,7 +490,7 @@ void SwHHCWrapper::ReplaceUnit( OSL_ENSURE( pTargetFont, "target font missing?" ); if (pTargetFont && pNewUnitLanguage) { - SvxFontItem aFontItem(static_cast<const SvxFontItem&>( aSet.Get( RES_CHRATR_CJK_FONT ) )); + SvxFontItem aFontItem( aSet.Get( RES_CHRATR_CJK_FONT ) ); aFontItem.SetFamilyName( pTargetFont->GetFamilyName()); aFontItem.SetFamily( pTargetFont->GetFamilyType()); aFontItem.SetStyleName( pTargetFont->GetStyleName()); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index c4b6d11ac96f..0b2ef68570cf 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2045,13 +2045,13 @@ void SwBaseShell::ExecTextCtrl( SfxRequest& rReq ) sal_Int32 nWesternSize = pStdFont->GetFontHeight(FONT_STANDARD, FONT_GROUP_DEFAULT, - static_cast<const SvxLanguageItem&>(aLangSet.Get( RES_CHRATR_LANGUAGE)).GetLanguage()); + aLangSet.Get( RES_CHRATR_LANGUAGE).GetLanguage()); sal_Int32 nCJKSize = pStdFont->GetFontHeight(FONT_STANDARD, FONT_GROUP_CJK, - static_cast<const SvxLanguageItem&>(aLangSet.Get( RES_CHRATR_CJK_LANGUAGE)).GetLanguage()); + aLangSet.Get( RES_CHRATR_CJK_LANGUAGE).GetLanguage()); sal_Int32 nCTLSize = pStdFont->GetFontHeight(FONT_STANDARD, FONT_GROUP_CTL, - static_cast<const SvxLanguageItem&>(aLangSet.Get( RES_CHRATR_CTL_LANGUAGE)).GetLanguage()); + aLangSet.Get( RES_CHRATR_CTL_LANGUAGE).GetLanguage()); switch(nScripts) { diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 0bae10101af7..4e210a2d2c84 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1554,7 +1554,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) { SfxItemSet aSet( GetPool() ); rSh.GetCurAttr( aSet ); - const SvxColorItem& aColorItem = static_cast< const SvxColorItem& >( aSet.Get(RES_CHRATR_COLOR) ); + const SvxColorItem& aColorItem = aSet.Get(RES_CHRATR_COLOR); std::unique_ptr<SfxPoolItem> pNewItem(aColorItem.CloneSetWhich(SID_ATTR_CHAR_COLOR2)); rSet.Put( *pNewItem ); } @@ -1564,14 +1564,14 @@ void SwTextShell::GetState( SfxItemSet &rSet ) // Always use the visible background SfxItemSet aSet( GetPool() ); rSh.GetCurAttr( aSet ); - const SvxBrushItem& aBrushItem = static_cast< const SvxBrushItem& >( aSet.Get(RES_CHRATR_HIGHLIGHT) ); + const SvxBrushItem& aBrushItem = aSet.Get(RES_CHRATR_HIGHLIGHT); if( aBrushItem.GetColor() != COL_TRANSPARENT ) { rSet.Put( SvxColorItem(aBrushItem.GetColor(), nWhich) ); } else { - const SvxBrushItem& aBrushItem2 = static_cast< const SvxBrushItem& >( aSet.Get(RES_CHRATR_BACKGROUND) ); + const SvxBrushItem& aBrushItem2 = aSet.Get(RES_CHRATR_BACKGROUND); rSet.Put( SvxColorItem(aBrushItem2.GetColor(), nWhich) ); } } diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index b62232a7251c..2dee9246a730 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -91,8 +91,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq) { case STATE_TOGGLE: { - short nTmpEsc = static_cast<const SvxEscapementItem&>( - aSet.Get( RES_CHRATR_ESCAPEMENT )).GetEsc(); + short nTmpEsc = aSet.Get( RES_CHRATR_ESCAPEMENT ).GetEsc(); eEscape = nWhich == FN_SET_SUPER_SCRIPT ? SvxEscapement::Superscript: SvxEscapement::Subscript; @@ -137,7 +136,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq) { case STATE_TOGGLE: { - SvxCaseMap eTmpCaseMap = static_cast<const SvxCaseMapItem&>(aSet.Get(RES_CHRATR_CASEMAP)).GetCaseMap(); + SvxCaseMap eTmpCaseMap = aSet.Get(RES_CHRATR_CASEMAP).GetCaseMap(); if (eTmpCaseMap == SvxCaseMap::SmallCaps) eCaseMap = SvxCaseMap::NotMapped; } @@ -162,8 +161,8 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq) break; case FN_UNDERLINE_DOUBLE: { - FontLineStyle eUnderline = static_cast<const SvxUnderlineItem&>( - aSet.Get(RES_CHRATR_UNDERLINE)).GetLineStyle(); + FontLineStyle eUnderline = + aSet.Get(RES_CHRATR_UNDERLINE).GetLineStyle(); switch( eState ) { case STATE_TOGGLE: @@ -697,8 +696,8 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) eState = aCoreSet.GetItemState(RES_CHRATR_UNDERLINE); if( eState >= SfxItemState::DEFAULT ) { - FontLineStyle eUnderline = static_cast<const SvxUnderlineItem&>( - aCoreSet.Get(RES_CHRATR_UNDERLINE)).GetLineStyle(); + FontLineStyle eUnderline = + aCoreSet.Get(RES_CHRATR_UNDERLINE).GetLineStyle(); rSet.Put(SfxBoolItem(nSlot, eUnderline == LINESTYLE_DOUBLE)); } else _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits