diff options
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/html/htmldrawreader.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfldw.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/svxcss1.cxx | 66 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlithlp.cxx | 6 |
17 files changed, 83 insertions, 85 deletions
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index f96d295d2513..5ccea69bb624 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1205,8 +1205,7 @@ HTMLOnOffState HTMLEndPosLst::GetHTMLItemState( const SfxPoolItem& rItem ) break; case RES_CHRATR_ESCAPEMENT: - switch( (SvxEscapement) - static_cast<const SvxEscapementItem&>(rItem).GetEnumValue() ) + switch( static_cast<SvxEscapement>(static_cast<const SvxEscapementItem&>(rItem).GetEnumValue()) ) { case SvxEscapement::Superscript: case SvxEscapement::Subscript: @@ -2778,7 +2777,7 @@ static Writer& OutHTML_SvxEscapement( Writer& rWrt, const SfxPoolItem& rHt ) return rWrt; const SvxEscapement eEscape = - (SvxEscapement)static_cast<const SvxEscapementItem&>(rHt).GetEnumValue(); + static_cast<SvxEscapement>(static_cast<const SvxEscapementItem&>(rHt).GetEnumValue()); const sal_Char *pStr = nullptr; switch( eEscape ) { @@ -2830,7 +2829,7 @@ static Writer& OutHTML_SwFlyCnt( Writer& rWrt, const SfxPoolItem& rHt ) const SdrObject *pSdrObj = nullptr; SwHTMLFrameType eType = - (SwHTMLFrameType)rHTMLWrt.GuessFrameType( rFormat, pSdrObj ); + static_cast<SwHTMLFrameType>(rHTMLWrt.GuessFrameType( rFormat, pSdrObj )); AllHtmlFlags nMode = aHTMLOutFrameAsCharTable[eType][rHTMLWrt.m_nExportMode]; rHTMLWrt.OutFrameFormat( nMode, rFormat, pSdrObj ); return rWrt; diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index f6d64cdf2646..a6514534d4b5 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -60,14 +60,14 @@ static HTMLOptionEnum<SdrTextAniKind> aHTMLMarqBehaviorTable[] = { OOO_STRING_SVTOOLS_HTML_BEHAV_scroll, SdrTextAniKind::Scroll }, { OOO_STRING_SVTOOLS_HTML_BEHAV_alternate, SdrTextAniKind::Alternate }, { OOO_STRING_SVTOOLS_HTML_BEHAV_slide, SdrTextAniKind::Slide }, - { nullptr, (SdrTextAniKind)0 } + { nullptr, SdrTextAniKind(0) } }; static HTMLOptionEnum<SdrTextAniDirection> aHTMLMarqDirectionTable[] = { { OOO_STRING_SVTOOLS_HTML_AL_left, SdrTextAniDirection::Left }, { OOO_STRING_SVTOOLS_HTML_AL_right, SdrTextAniDirection::Right }, - { nullptr, (SdrTextAniDirection)0 } + { nullptr, SdrTextAniDirection(0) } }; void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 0ee651f50568..d02e48de9082 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -54,7 +54,7 @@ static HTMLOptionEnum<SwFieldIds> aHTMLFieldTypeTable[] = { OOO_STRING_SW_HTML_FT_docinfo, SwFieldIds::DocInfo }, { OOO_STRING_SW_HTML_FT_docstat, SwFieldIds::DocStat }, { OOO_STRING_SW_HTML_FT_filename, SwFieldIds::Filename }, - { nullptr, (SwFieldIds)0 } + { nullptr, SwFieldIds(0) } }; static HTMLNumFormatTableEntry aHTMLDateFieldFormatTable[] = @@ -99,7 +99,7 @@ static HTMLOptionEnum<SvxNumType> aHTMLPageNumFieldFormatTable[] = { OOO_STRING_SW_HTML_FF_page, SVX_NUM_PAGEDESC }, { OOO_STRING_SW_HTML_FF_ulettern, SVX_NUM_CHARS_UPPER_LETTER_N }, { OOO_STRING_SW_HTML_FF_llettern, SVX_NUM_CHARS_LOWER_LETTER_N }, - { nullptr, (SvxNumType)0 } + { nullptr, SvxNumType(0) } }; static HTMLOptionEnum<SwExtUserSubType> aHTMLExtUsrFieldSubTable[] = @@ -119,14 +119,14 @@ static HTMLOptionEnum<SwExtUserSubType> aHTMLExtUsrFieldSubTable[] = { OOO_STRING_SW_HTML_FS_fax, EU_FAX }, { OOO_STRING_SW_HTML_FS_email, EU_EMAIL }, { OOO_STRING_SW_HTML_FS_state, EU_STATE }, - { nullptr, (SwExtUserSubType)0 } + { nullptr, SwExtUserSubType(0) } }; static HTMLOptionEnum<SwAuthorFormat> aHTMLAuthorFieldFormatTable[] = { { OOO_STRING_SW_HTML_FF_name, AF_NAME }, { OOO_STRING_SW_HTML_FF_shortcut, AF_SHORTCUT }, - { nullptr, (SwAuthorFormat)0 } + { nullptr, SwAuthorFormat(0) } }; static HTMLOptionEnum<SwPageNumSubType> aHTMLPageNumFieldSubTable[] = @@ -134,7 +134,7 @@ static HTMLOptionEnum<SwPageNumSubType> aHTMLPageNumFieldSubTable[] = { OOO_STRING_SW_HTML_FS_random, PG_RANDOM }, { OOO_STRING_SW_HTML_FS_next, PG_NEXT }, { OOO_STRING_SW_HTML_FS_prev, PG_PREV }, - { nullptr, (SwPageNumSubType)0 } + { nullptr, SwPageNumSubType(0) } }; // UGLY: these are extensions of nsSwDocInfoSubType (in inc/docufld.hxx) @@ -178,7 +178,7 @@ static HTMLOptionEnum<SwDocStatSubType> aHTMLDocStatFieldSubTable[] = { OOO_STRING_SW_HTML_FS_tbl, DS_TBL }, { OOO_STRING_SW_HTML_FS_grf, DS_GRF }, { OOO_STRING_SW_HTML_FS_ole, DS_OLE }, - { nullptr, (SwDocStatSubType)0 } + { nullptr, SwDocStatSubType(0) } }; static HTMLOptionEnum<SwFileNameFormat> aHTMLFileNameFieldFormatTable[] = @@ -187,7 +187,7 @@ static HTMLOptionEnum<SwFileNameFormat> aHTMLFileNameFieldFormatTable[] = { OOO_STRING_SW_HTML_FF_pathname, FF_PATHNAME }, { OOO_STRING_SW_HTML_FF_path, FF_PATH }, { OOO_STRING_SW_HTML_FF_name_noext, FF_NAME_NOEXT }, - { nullptr, (SwFileNameFormat)0 } + { nullptr, SwFileNameFormat(0) } }; SvxNumType SwHTMLParser::GetNumType( const OUString& rStr, SvxNumType nDfltType ) @@ -308,7 +308,7 @@ void SwHTMLParser::NewField() pFormatOption->GetEnum( nFormat, aHTMLAuthorFieldFormatTable ); if( bFixed ) { - nFormat = (SwAuthorFormat)(static_cast<int>(nFormat) | AF_FIXED); + nFormat = static_cast<SwAuthorFormat>(static_cast<int>(nFormat) | AF_FIXED); bInsOnEndTag = true; } @@ -502,7 +502,7 @@ void SwHTMLParser::NewField() pFormatOption->GetEnum( nFormat, aHTMLFileNameFieldFormatTable ); if( bFixed ) { - nFormat = (SwFileNameFormat)(static_cast<int>(nFormat) | FF_FIXED); + nFormat = static_cast<SwFileNameFormat>(static_cast<int>(nFormat) | FF_FIXED); bInsOnEndTag = true; } diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index 5d1d22114fb7..e1abdba1735d 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -41,7 +41,7 @@ const sal_Char *SwHTMLWriter::GetNumFormat( sal_uInt16 nFormat ) { const sal_Char *pFormatStr = nullptr; - switch( (SvxNumType)nFormat ) + switch( static_cast<SvxNumType>(nFormat) ) { case SVX_NUM_CHARS_UPPER_LETTER: pFormatStr = OOO_STRING_SW_HTML_FF_uletter; break; case SVX_NUM_CHARS_LOWER_LETTER: pFormatStr = OOO_STRING_SW_HTML_FF_lletter; break; @@ -83,7 +83,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, { case SwFieldIds::ExtUser: pTypeStr = OOO_STRING_SW_HTML_FT_sender; - switch( (SwExtUserSubType)pField->GetSubType() ) + switch( static_cast<SwExtUserSubType>(pField->GetSubType()) ) { case EU_COMPANY: pSubStr = OOO_STRING_SW_HTML_FS_company; break; case EU_FIRSTNAME: pSubStr = OOO_STRING_SW_HTML_FS_firstname; break; @@ -109,7 +109,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, case SwFieldIds::Author: pTypeStr = OOO_STRING_SW_HTML_FT_author; - switch( (SwAuthorFormat)nFormat & 0xff) + switch( static_cast<SwAuthorFormat>(nFormat) & 0xff) { case AF_NAME: pFormatStr = OOO_STRING_SW_HTML_FF_name; break; case AF_SHORTCUT: pFormatStr = OOO_STRING_SW_HTML_FF_shortcut; break; @@ -131,7 +131,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, case SwFieldIds::PageNumber: { pTypeStr = OOO_STRING_SW_HTML_FT_page; - SwPageNumSubType eSubType = (SwPageNumSubType)pField->GetSubType(); + SwPageNumSubType eSubType = static_cast<SwPageNumSubType>(pField->GetSubType()); switch( eSubType ) { case PG_RANDOM: pSubStr = OOO_STRING_SW_HTML_FS_random; break; @@ -141,7 +141,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, OSL_ENSURE( pSubStr, "unknown sub type for SwPageNumberField" ); pFormatStr = SwHTMLWriter::GetNumFormat( static_cast< sal_uInt16 >(nFormat) ); - if( (SvxNumType)nFormat==SVX_NUM_CHAR_SPECIAL ) + if( static_cast<SvxNumType>(nFormat)==SVX_NUM_CHAR_SPECIAL ) { aValue = static_cast<const SwPageNumberField *>(pField)->GetUserString(); } @@ -240,7 +240,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, case SwFieldIds::Filename: pTypeStr = OOO_STRING_SW_HTML_FT_filename; - switch( (SwFileNameFormat)(nFormat & ~FF_FIXED) ) + switch( static_cast<SwFileNameFormat>(nFormat & ~FF_FIXED) ) { case FF_NAME: pFormatStr = OOO_STRING_SW_HTML_FF_name; break; case FF_PATHNAME: pFormatStr = OOO_STRING_SW_HTML_FF_pathname; break; diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 68d3046e1eef..757a08378df4 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -205,7 +205,7 @@ sal_uInt16 SwHTMLWriter::GuessFrameType( const SwFrameFormat& rFrameFormat, else if( pNd->IsOLENode() ) { // applet, plugin, floating frame - eType = (SwHTMLFrameType)GuessOLENodeFrameType( *pNd ); + eType = static_cast<SwHTMLFrameType>(GuessOLENodeFrameType( *pNd )); } else { @@ -301,7 +301,7 @@ void SwHTMLWriter::CollectFlyFrames() const SdrObject *pSdrObj = nullptr; const SwPosition *pAPos; const SwContentNode *pACNd; - SwHTMLFrameType eType = (SwHTMLFrameType)GuessFrameType( rFrameFormat, pSdrObj ); + SwHTMLFrameType eType = static_cast<SwHTMLFrameType>(GuessFrameType( rFrameFormat, pSdrObj )); AllHtmlFlags nMode; const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor(); diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 71d461ba7bff..c40d30bf543d 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -91,7 +91,7 @@ static HTMLOptionEnum<FormSubmitMethod> aHTMLFormMethodTable[] = { { OOO_STRING_SVTOOLS_HTML_METHOD_get, FormSubmitMethod_GET }, { OOO_STRING_SVTOOLS_HTML_METHOD_post, FormSubmitMethod_POST }, - { nullptr, (FormSubmitMethod)0 } + { nullptr, FormSubmitMethod(0) } }; static HTMLOptionEnum<FormSubmitEncoding> aHTMLFormEncTypeTable[] = @@ -99,7 +99,7 @@ static HTMLOptionEnum<FormSubmitEncoding> aHTMLFormEncTypeTable[] = { OOO_STRING_SVTOOLS_HTML_ET_url, FormSubmitEncoding_URL }, { OOO_STRING_SVTOOLS_HTML_ET_multipart, FormSubmitEncoding_MULTIPART }, { OOO_STRING_SVTOOLS_HTML_ET_text, FormSubmitEncoding_TEXT }, - { nullptr, (FormSubmitEncoding)0 } + { nullptr, FormSubmitEncoding(0) } }; enum HTMLWordWrapMode { HTML_WM_OFF, HTML_WM_HARD, HTML_WM_SOFT }; @@ -111,7 +111,7 @@ static HTMLOptionEnum<HTMLWordWrapMode> aHTMLTextAreaWrapTable[] = { OOO_STRING_SVTOOLS_HTML_WW_soft, HTML_WM_SOFT }, { OOO_STRING_SVTOOLS_HTML_WW_physical, HTML_WM_HARD }, { OOO_STRING_SVTOOLS_HTML_WW_virtual, HTML_WM_SOFT }, - { nullptr, (HTMLWordWrapMode)0 } + { nullptr, HTMLWordWrapMode(0) } }; static SvMacroItemId aEventTypeTable[] = diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index cf12af48e9c9..cd2548cd0a26 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1088,7 +1088,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, { auto aTmp2 = xPropSet->getPropertyValue( "FontFamily" ); if( auto n = o3tl::tryAccess<sal_Int16>(aTmp2) ) - eFamily = (FontFamily)*n; + eFamily = static_cast<FontFamily>(*n); } SvxFontItem aItem( eFamily, *aFName, aEmptyOUStr, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT ); aItemSet.Put( aItem ); @@ -1112,7 +1112,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, aTmp = xPropSet->getPropertyValue( "FontSlant" ); if( auto n = o3tl::tryAccess<sal_Int16>(aTmp) ) { - FontItalic eItalic = (FontItalic)*n; + FontItalic eItalic = static_cast<FontItalic>(*n); if( eItalic != ITALIC_DONTKNOW && eItalic != ITALIC_NONE ) aItemSet.Put( SvxPostureItem( eItalic, RES_CHRATR_POSTURE ) ); } @@ -1122,7 +1122,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, aTmp = xPropSet->getPropertyValue( "FontLineStyle" ); if( auto n = o3tl::tryAccess<sal_Int16>(aTmp) ) { - FontLineStyle eUnderline = (FontLineStyle)*n; + FontLineStyle eUnderline = static_cast<FontLineStyle>(*n); if( eUnderline != LINESTYLE_DONTKNOW && eUnderline != LINESTYLE_NONE ) aItemSet.Put( SvxUnderlineItem( eUnderline, RES_CHRATR_UNDERLINE ) ); @@ -1133,7 +1133,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, aTmp = xPropSet->getPropertyValue( "FontStrikeout" ); if( auto n = o3tl::tryAccess<sal_Int16>(aTmp) ) { - FontStrikeout eStrikeout = (FontStrikeout)*n; + FontStrikeout eStrikeout = static_cast<FontStrikeout>(*n); if( eStrikeout != STRIKEOUT_DONTKNOW && eStrikeout != STRIKEOUT_NONE ) aItemSet.Put( SvxCrossedOutItem( eStrikeout, RES_CHRATR_CROSSEDOUT ) ); diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index ce3651553e0c..53800ef351f2 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -103,24 +103,24 @@ static CSS1PropertyEnum const aFontStyleTable[] = static CSS1PropertyEnum const aFontVariantTable[] = { - { "normal", (sal_uInt16)SvxCaseMap::NotMapped }, - { "small-caps", (sal_uInt16)SvxCaseMap::SmallCaps }, + { "normal", sal_uInt16(SvxCaseMap::NotMapped) }, + { "small-caps", sal_uInt16(SvxCaseMap::SmallCaps) }, { nullptr, 0 } }; static CSS1PropertyEnum const aTextTransformTable[] = { - { "uppercase", (sal_uInt16)SvxCaseMap::Uppercase }, - { "lowercase", (sal_uInt16)SvxCaseMap::Lowercase }, - { "capitalize", (sal_uInt16)SvxCaseMap::Capitalize }, + { "uppercase", sal_uInt16(SvxCaseMap::Uppercase) }, + { "lowercase", sal_uInt16(SvxCaseMap::Lowercase) }, + { "capitalize", sal_uInt16(SvxCaseMap::Capitalize) }, { nullptr, 0 } }; static CSS1PropertyEnum const aDirectionTable[] = { - { "ltr", (sal_uInt16)SvxFrameDirection::Horizontal_LR_TB }, - { "rtl", (sal_uInt16)SvxFrameDirection::Horizontal_RL_TB }, - { "inherit", (sal_uInt16)SvxFrameDirection::Environment }, + { "ltr", sal_uInt16(SvxFrameDirection::Horizontal_LR_TB) }, + { "rtl", sal_uInt16(SvxFrameDirection::Horizontal_RL_TB) }, + { "inherit", sal_uInt16(SvxFrameDirection::Environment) }, { nullptr, 0 } }; @@ -151,10 +151,10 @@ static CSS1PropertyEnum const aBGVertPosTable[] = static CSS1PropertyEnum const aTextAlignTable[] = { - { "left", (sal_uInt16)SvxAdjust::Left }, - { "center", (sal_uInt16)SvxAdjust::Center }, - { "right", (sal_uInt16)SvxAdjust::Right }, - { "justify", (sal_uInt16)SvxAdjust::Block }, + { "left", sal_uInt16(SvxAdjust::Left) }, + { "center", sal_uInt16(SvxAdjust::Center) }, + { "right", sal_uInt16(SvxAdjust::Right) }, + { "justify", sal_uInt16(SvxAdjust::Block) }, { nullptr, 0 } }; @@ -184,9 +184,9 @@ static CSS1PropertyEnum const aBorderStyleTable[] = static CSS1PropertyEnum const aFloatTable[] = { - { "left", (sal_uInt16)SvxAdjust::Left }, - { "right", (sal_uInt16)SvxAdjust::Right }, - { "none", (sal_uInt16)SvxAdjust::End }, + { "left", sal_uInt16(SvxAdjust::Left) }, + { "right", sal_uInt16(SvxAdjust::Right) }, + { "none", sal_uInt16(SvxAdjust::End) }, { nullptr, 0 } }; @@ -1162,7 +1162,7 @@ static void ParseCSS1_font_weight( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aFontWeightTable, pExpr->GetString(), nWeight ) ) { - SvxWeightItem aWeight( (FontWeight)nWeight, aItemIds.nWeight ); + SvxWeightItem aWeight( static_cast<FontWeight>(nWeight), aItemIds.nWeight ); if( rParser.IsSetWesternProps() ) rItemSet.Put( aWeight ); if( rParser.IsSetCJKProps() ) @@ -1230,7 +1230,7 @@ static void ParseCSS1_font_style( const CSS1Expression *pExpr, sal_uInt16 nItalic; if( SvxCSS1Parser::GetEnum( aFontStyleTable, rValue, nItalic ) ) { - eItalic = (FontItalic)nItalic; + eItalic = static_cast<FontItalic>(nItalic); if( !bCaseMap && ITALIC_NONE==eItalic ) { // for 'normal' we must also exclude case-map @@ -1288,7 +1288,7 @@ static void ParseCSS1_font_variant( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aFontVariantTable, pExpr->GetString(), nCaseMap ) ) { - rItemSet.Put( SvxCaseMapItem( (SvxCaseMap)nCaseMap, + rItemSet.Put( SvxCaseMapItem( static_cast<SvxCaseMap>(nCaseMap), aItemIds.nCaseMap ) ); } break; @@ -1315,7 +1315,7 @@ static void ParseCSS1_text_transform( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aTextTransformTable, pExpr->GetString(), nCaseMap ) ) { - rItemSet.Put( SvxCaseMapItem( (SvxCaseMap)nCaseMap, + rItemSet.Put( SvxCaseMapItem( static_cast<SvxCaseMap>(nCaseMap), aItemIds.nCaseMap ) ); } break; @@ -1532,17 +1532,17 @@ static void ParseCSS1_background( const CSS1Expression *pExpr, } if( SvxCSS1Parser::GetEnum( aBGRepeatTable, rValue, nEnum ) ) { - eRepeat = (SvxGraphicPosition)nEnum; + eRepeat = static_cast<SvxGraphicPosition>(nEnum); } else if( SvxCSS1Parser::GetEnum( aBGHoriPosTable, rValue, nEnum ) ) { // <position>, horizontal - MergeHori( ePos, (SvxGraphicPosition)nEnum ); + MergeHori( ePos, static_cast<SvxGraphicPosition>(nEnum) ); } else if( SvxCSS1Parser::GetEnum( aBGVertPosTable, rValue, nEnum ) ) { // <position>, vertical - MergeVert( ePos, (SvxGraphicPosition)nEnum ); + MergeVert( ePos, static_cast<SvxGraphicPosition>(nEnum) ); } else if( !bColor ) { @@ -1719,7 +1719,7 @@ static void ParseCSS1_list_style_type( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aNumberStyleTable, rValue, nEnum ) ) { rPropInfo.m_bNumbering = true; - rPropInfo.m_nNumberingType = (SvxNumType)nEnum; + rPropInfo.m_nNumberingType = static_cast<SvxNumType>(nEnum); } if( SvxCSS1Parser::GetEnum( aBulletStyleTable, rValue, nEnum ) ) { @@ -1755,15 +1755,15 @@ static void ParseCSS1_font( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aFontStyleTable, rValue, nEnum ) ) { - eItalic = (FontItalic)nEnum; + eItalic = static_cast<FontItalic>(nEnum); } else if( SvxCSS1Parser::GetEnum( aFontVariantTable, rValue, nEnum ) ) { - eCaseMap = (SvxCaseMap)nEnum; + eCaseMap = static_cast<SvxCaseMap>(nEnum); } else if( SvxCSS1Parser::GetEnum( aFontWeightTable, rValue, nEnum ) ) { - eWeight = (FontWeight)nEnum; + eWeight = static_cast<FontWeight>(nEnum); } } else @@ -2000,7 +2000,7 @@ static void ParseCSS1_text_align( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aTextAlignTable, pExpr->GetString(), nAdjust ) ) { - rItemSet.Put( SvxAdjustItem( (SvxAdjust)nAdjust, + rItemSet.Put( SvxAdjustItem( static_cast<SvxAdjust>(nAdjust), aItemIds.nAdjust ) ); } } @@ -2582,7 +2582,7 @@ static void ParseCSS1_border_xxx( const CSS1Expression *pExpr, } else if( SvxCSS1Parser::GetEnum( aBorderStyleTable, rValue, nValue ) ) { - eStyle = (CSS1BorderStyle)nValue; + eStyle = static_cast<CSS1BorderStyle>(nValue); } else if( pExpr->GetColor( aColor ) ) { @@ -2782,7 +2782,7 @@ static void ParseCSS1_border_style( const CSS1Expression *pExpr, SvxCSS1Parser::GetEnum( aBorderStyleTable, pExpr->GetString(), nValue ) ) { - rPropInfo.GetBorderInfo( nLine )->eStyle = (CSS1BorderStyle)nValue; + rPropInfo.GetBorderInfo( nLine )->eStyle = static_cast<CSS1BorderStyle>(nValue); } rPropInfo.CopyBorderInfo( n, SVX_CSS1_BORDERINFO_STYLE ); @@ -2842,7 +2842,7 @@ static void ParseCSS1_float( const CSS1Expression *pExpr, { sal_uInt16 nFloat; if( SvxCSS1Parser::GetEnum( aFloatTable, pExpr->GetString(), nFloat ) ) - rPropInfo.m_eFloat = (SvxAdjust)nFloat; + rPropInfo.m_eFloat = static_cast<SvxAdjust>(nFloat); } } @@ -2857,7 +2857,7 @@ static void ParseCSS1_position( const CSS1Expression *pExpr, { sal_uInt16 nPos; if( SvxCSS1Parser::GetEnum( aPositionTable, pExpr->GetString(), nPos ) ) - rPropInfo.m_ePosition = (SvxCSS1Position)nPos; + rPropInfo.m_ePosition = static_cast<SvxCSS1Position>(nPos); } } @@ -2958,7 +2958,7 @@ static void ParseCSS1_size( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aSizeTable, pExpr->GetString(), nValue ) ) { - rPropInfo.m_eSizeType = (SvxCSS1SizeType)nValue; + rPropInfo.m_eSizeType = static_cast<SvxCSS1SizeType>(nValue); } } break; @@ -3000,7 +3000,7 @@ static void ParseCSS1_page_break_xxx( const CSS1Expression *pExpr, if( SvxCSS1Parser::GetEnum( aPageBreakTable, pExpr->GetString(), nValue ) ) { - rPBreak = (SvxCSS1PageBreak)nValue; + rPBreak = static_cast<SvxCSS1PageBreak>(nValue); } } } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 9215f4f35dcc..aad798936453 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -138,7 +138,7 @@ HTMLOptionEnum<SvxAdjust> aHTMLPAlignTable[] = { OOO_STRING_SVTOOLS_HTML_AL_right, SvxAdjust::Right }, { OOO_STRING_SVTOOLS_HTML_AL_justify, SvxAdjust::Block }, { OOO_STRING_SVTOOLS_HTML_AL_char, SvxAdjust::Left }, - { nullptr, (SvxAdjust)0 } + { nullptr, SvxAdjust(0) } }; // <SPACER TYPE=...> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 9f7ce8cc1547..72a1fc372439 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2967,7 +2967,7 @@ static void impl_borderLine( FSHelperPtr const & pSerializer, sal_Int32 elementT // if they are equal, it means that they were style-defined and there is // no need to write them. if( rStyleProps != nullptr && pBorderLine && !pBorderLine->isEmpty() && - pBorderLine->GetBorderLineStyle() == (SvxBorderLineStyle)rStyleProps->LineStyle && + pBorderLine->GetBorderLineStyle() == static_cast<SvxBorderLineStyle>(rStyleProps->LineStyle) && pBorderLine->GetColor() == rStyleProps->Color && pBorderLine->GetWidth() == convertMm100ToTwip( rStyleProps->LineWidth ) ) return; @@ -4689,7 +4689,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size if ( pGrfNode && SfxItemState::SET == pGrfNode->GetSwAttrSet().GetItemState(RES_GRFATR_DRAWMODE, true, &pItem)) { - nMode = (GraphicDrawMode)static_cast<const SfxEnumItemInterface*>(pItem)->GetEnumValue(); + nMode = static_cast<GraphicDrawMode>(static_cast<const SfxEnumItemInterface*>(pItem)->GetEnumValue()); if (nMode == GraphicDrawMode::Greys) m_pSerializer->singleElementNS (XML_a, XML_grayscl, FSEND); else if (nMode == GraphicDrawMode::Mono) //black/white has a 0,5 threshold in LibreOffice diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 61ed96720ae5..4da44ceab223 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -639,7 +639,7 @@ void RtfExport::WritePageDescTable() .WriteChar('{') .WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PGDSC); OutULong(n).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PGDSCUSE); - OutULong((sal_uLong)rPageDesc.ReadUseOn()); + OutULong(static_cast<sal_uLong>(rPageDesc.ReadUseOn())); OutPageDescription(rPageDesc, false); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index d8756282b0f0..522d9de719bd 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1674,7 +1674,7 @@ void SwBasicEscherEx::WriteGrfAttr(const SwNoTextNode& rNd, const SwFrameFormat& if (SfxItemState::SET == rNd.GetSwAttrSet().GetItemState(RES_GRFATR_DRAWMODE, true, &pItem)) { - nMode = (GraphicDrawMode)static_cast<const SfxEnumItemInterface*>(pItem)->GetEnumValue(); + nMode = static_cast<GraphicDrawMode>(static_cast<const SfxEnumItemInterface*>(pItem)->GetEnumValue()); if (nMode == GraphicDrawMode::Watermark) { /* diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index b49a86aa1ba4..48a6098f5eb9 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2418,7 +2418,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) { OUString sFieldId; it->second >>= sFieldId; - eFieldId = (ww::eField)sFieldId.toInt32(); + eFieldId = static_cast<ww::eField>(sFieldId.toInt32()); } it = pFieldmark->GetParameters()->find( ODF_CODE_PARAM ); @@ -2465,7 +2465,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) { OUString sFieldId; it->second >>= sFieldId; - eFieldId = (ww::eField)sFieldId.toInt32(); + eFieldId = static_cast<ww::eField>(sFieldId.toInt32()); } } @@ -3331,7 +3331,7 @@ void MSWordExportBase::OutputContentNode( SwContentNode& rNode ) OutputOLENode( *rNode.GetOLENode() ); break; default: - SAL_WARN("sw.ww8", "Unhandled node, type == " << (int)rNode.GetNodeType() ); + SAL_WARN("sw.ww8", "Unhandled node, type == " << static_cast<int>(rNode.GetNodeType()) ); break; } } diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index c79f447b1a90..eb3ff52f1a4c 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1584,7 +1584,7 @@ sal_Int32 SwWW8ImplReader::MatchSdrBoxIntoFlyBoxItem(const Color& rLineColor, nIdx = SvxBorderLineStyle::DOUBLE; break; // no line style is set - case (MSO_LineStyle)USHRT_MAX: + case MSO_LineStyle(USHRT_MAX): break; // erroneously not implemented line style is set default: diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 50f57141a9ab..9ab1e55a7ef5 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -692,7 +692,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, bool bVerticalText = false; if ( IsProperty( DFF_Prop_txflTextFlow ) ) { - MSO_TextFlow eTextFlow = (MSO_TextFlow)(GetPropertyValue( + MSO_TextFlow eTextFlow = static_cast<MSO_TextFlow>(GetPropertyValue( DFF_Prop_txflTextFlow, 0) & 0xFFFF); switch( eTextFlow ) { @@ -797,8 +797,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, aSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); } - switch ( (MSO_WrapMode) - GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) ) + switch ( static_cast<MSO_WrapMode>(GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare )) ) { case mso_wrapNone : aSet.Put( makeSdrTextAutoGrowWidthItem( true ) ); @@ -1037,12 +1036,12 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, } pImpRec->eLineStyle = (nLineFlags & 8) - ? (MSO_LineStyle)GetPropertyValue( + ? static_cast<MSO_LineStyle>(GetPropertyValue( DFF_Prop_lineStyle, - mso_lineSimple ) - : (MSO_LineStyle)USHRT_MAX; - pImpRec->eLineDashing = (MSO_LineDashing)GetPropertyValue( - DFF_Prop_lineDashing, mso_lineSolid ); + mso_lineSimple )) + : MSO_LineStyle(USHRT_MAX); + pImpRec->eLineDashing = static_cast<MSO_LineDashing>(GetPropertyValue( + DFF_Prop_lineDashing, mso_lineSolid )); pImpRec->nFlags = rObjData.nSpFlags; @@ -1948,7 +1947,7 @@ void SwWW8ImplReader::ImportDopTypography(const WW8DopTypography &rTypo) } m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::KERN_ASIAN_PUNCTUATION, rTypo.fKerningPunct); - m_rDoc.getIDocumentSettingAccess().setCharacterCompressionType((CharCompressType)rTypo.iJustification); + m_rDoc.getIDocumentSettingAccess().setCharacterCompressionType(static_cast<CharCompressType>(rTypo.iJustification)); } /** diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 9acf6575441a..cc487a888925 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2548,7 +2548,7 @@ bool SwMSConvertControls::InsertControl( else nTemp = text::TextContentAnchorType_AS_CHARACTER; - xShapePropSet->setPropertyValue("AnchorType", uno::Any((sal_Int16)nTemp) ); + xShapePropSet->setPropertyValue("AnchorType", uno::Any(static_cast<sal_Int16>(nTemp)) ); xShapePropSet->setPropertyValue("VertOrient", uno::Any(sal_Int16(text::VertOrientation::TOP)) ); diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx index 7272cd5ae31b..119f72671683 100644 --- a/sw/source/filter/xml/xmlithlp.cxx +++ b/sw/source/filter/xml/xmlithlp.cxx @@ -242,21 +242,21 @@ const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushRepeat[] = { XML_BACKGROUND_REPEAT, GPOS_TILED }, { XML_BACKGROUND_NO_REPEAT, GPOS_MM }, { XML_BACKGROUND_STRETCH, GPOS_AREA }, - { XML_TOKEN_INVALID, (SvxGraphicPosition)0 } + { XML_TOKEN_INVALID, SvxGraphicPosition(0) } }; const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushHoriPos[] = { { XML_LEFT, GPOS_LM }, { XML_RIGHT, GPOS_RM }, - { XML_TOKEN_INVALID, (SvxGraphicPosition)0 } + { XML_TOKEN_INVALID, SvxGraphicPosition(0) } }; const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushVertPos[] = { { XML_TOP, GPOS_MT }, { XML_BOTTOM, GPOS_MB }, - { XML_TOKEN_INVALID, (SvxGraphicPosition)0 } + { XML_TOKEN_INVALID, SvxGraphicPosition(0) } }; void sw_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos, |