diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:02:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:02:31 +0100 |
commit | d9d92d20fdc414c5956290c10c4d473dcb836ceb (patch) | |
tree | 02c6079b0fbbae106e51dd307202ec2415f3340f | |
parent | a5eddfbf45277eea21dd2271b36e9668313eadf3 (diff) |
More loplugin:cstylecast: svx
Change-Id: If370ad12d2885ea9a6348736a3bcab618bc2e6ec
57 files changed, 169 insertions, 170 deletions
diff --git a/include/svx/EnhancedCustomShapeFunctionParser.hxx b/include/svx/EnhancedCustomShapeFunctionParser.hxx index bc1d97bd5879..30873c5eb644 100644 --- a/include/svx/EnhancedCustomShapeFunctionParser.hxx +++ b/include/svx/EnhancedCustomShapeFunctionParser.hxx @@ -126,7 +126,7 @@ inline std::basic_ostream<charT, traits> & operator <<( case ExpressionFunct::TernaryIf : return stream << "if"; - default: return stream << "?(" << (int)eFunc << ")"; + default: return stream << "?(" << static_cast<int>(eFunc) << ")"; } } diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx index 71bf9ab2cfc1..d852cd10f0dc 100644 --- a/include/svx/chrtitem.hxx +++ b/include/svx/chrtitem.hxx @@ -38,7 +38,7 @@ enum class SvxChartTextOrder Auto }; -#define CHTXTORDER_COUNT ((sal_uInt16)SvxChartTextOrder::Auto + 1) +#define CHTXTORDER_COUNT (sal_uInt16(SvxChartTextOrder::Auto) + 1) enum class SvxChartKindError { @@ -52,7 +52,7 @@ enum class SvxChartKindError Range }; -#define CHERROR_COUNT ((sal_uInt16)SvxChartKindError::Range + 1) +#define CHERROR_COUNT (sal_uInt16(SvxChartKindError::Range) + 1) enum class SvxChartIndicate { @@ -62,7 +62,7 @@ enum class SvxChartIndicate Down }; -#define CHINDICATE_COUNT ((sal_uInt16)SvxChartIndicate::Down + 1) +#define CHINDICATE_COUNT (sal_uInt16(SvxChartIndicate::Down) + 1) enum class SvxChartRegress { @@ -77,7 +77,7 @@ enum class SvxChartRegress Unknown }; -#define CHREGRESS_COUNT ((sal_uInt16)SvxChartRegress::Unknown + 1) +#define CHREGRESS_COUNT (sal_uInt16(SvxChartRegress::Unknown) + 1) class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartRegressItem : public SfxEnumItem<SvxChartRegress> { diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index 17351e83d9fd..b6562093a6f1 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -104,7 +104,7 @@ public: // Perspective: enum ProjectionType { ProjectionType::Parallel, ProjectionType::Perspective } ProjectionType GetPerspective() const - { return (ProjectionType) GetObjectItemSet().Get(SDRATTR_3DSCENE_PERSPECTIVE).GetValue(); } + { return static_cast<ProjectionType>(GetObjectItemSet().Get(SDRATTR_3DSCENE_PERSPECTIVE).GetValue()); } // Distance: double GetDistance() const diff --git a/include/svx/swframetypes.hxx b/include/svx/swframetypes.hxx index 34cab05c4b9e..cd33ae4779b4 100644 --- a/include/svx/swframetypes.hxx +++ b/include/svx/swframetypes.hxx @@ -29,11 +29,11 @@ enum class RndStdIds UNKNOWN = -1, // return value used by SwFEShell::GetAnchorId // the following 5 values are deliberately the same as the values in css::text::TextContentAnchorType - FLY_AT_PARA = (int)css::text::TextContentAnchorType_AT_PARAGRAPH, // Anchored at paragraph. - FLY_AS_CHAR = (int)css::text::TextContentAnchorType_AS_CHARACTER, // Anchored as character. - FLY_AT_PAGE = (int)css::text::TextContentAnchorType_AT_PAGE, // Anchored at page. - FLY_AT_FLY = (int)css::text::TextContentAnchorType_AT_FRAME, // Anchored at frame. - FLY_AT_CHAR = (int)css::text::TextContentAnchorType_AT_CHARACTER, // Anchored at character. + FLY_AT_PARA = int(css::text::TextContentAnchorType_AT_PARAGRAPH), // Anchored at paragraph. + FLY_AS_CHAR = int(css::text::TextContentAnchorType_AS_CHARACTER), // Anchored as character. + FLY_AT_PAGE = int(css::text::TextContentAnchorType_AT_PAGE), // Anchored at page. + FLY_AT_FLY = int(css::text::TextContentAnchorType_AT_FRAME), // Anchored at frame. + FLY_AT_CHAR = int(css::text::TextContentAnchorType_AT_CHARACTER), // Anchored at character. HEADER, FOOTER, diff --git a/svx/qa/unit/svdraw/test_SdrTextObject.cxx b/svx/qa/unit/svdraw/test_SdrTextObject.cxx index 1062fc0fec57..7af646b0bb16 100644 --- a/svx/qa/unit/svdraw/test_SdrTextObject.cxx +++ b/svx/qa/unit/svdraw/test_SdrTextObject.cxx @@ -35,7 +35,7 @@ void SdrTextObjTest::AllFamiliesCanBeRestoredFromSavedString() { OUString styleName = "styleName"; SdrTextObj::AppendFamilyToStyleName(styleName, family); SfxStyleFamily readFamily = SdrTextObj::ReadFamilyFromStyleName(styleName); - CPPUNIT_ASSERT_EQUAL((int)family, (int)readFamily); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(family), static_cast<int>(readFamily)); } } diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index a668d9dc7618..470f9275874e 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -153,14 +153,14 @@ OUString AccFrameSelector::getAccessibleDescription( ) { SolarMutexGuard aGuard; IsValid(); - return SvxResId(RID_SVXSTR_FRMSEL_DESCRIPTIONS[(sal_uInt32)meBorder].first); + return SvxResId(RID_SVXSTR_FRMSEL_DESCRIPTIONS[static_cast<sal_uInt32>(meBorder)].first); } OUString AccFrameSelector::getAccessibleName( ) { SolarMutexGuard aGuard; IsValid(); - return SvxResId(RID_SVXSTR_FRMSEL_TEXTS[(sal_uInt32)meBorder].first); + return SvxResId(RID_SVXSTR_FRMSEL_TEXTS[static_cast<sal_uInt32>(meBorder)].first); } Reference< XAccessibleRelationSet > AccFrameSelector::getAccessibleRelationSet( ) diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 4fd64288e536..bb652eed0f52 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -87,13 +87,13 @@ static const ChildIndexToPointData* IndexToPoint( long nIndex ) static long PointToIndex( RectPoint ePoint ) { - long nRet( (long) ePoint ); + long nRet( static_cast<long>(ePoint) ); // corner control // corners are counted from left to right and top to bottom - DBG_ASSERT( (int)RectPoint::LT == 0 && (int)RectPoint::MT == 1 && (int)RectPoint::RT == 2 && (int)RectPoint::LM == 3 && (int)RectPoint::MM == 4 && (int)RectPoint::RM == 5 && - (int)RectPoint::LB == 6 && (int)RectPoint::MB == 7 && (int)RectPoint::RB == 8, "*PointToIndex(): unexpected enum value!" ); + DBG_ASSERT( int(RectPoint::LT) == 0 && int(RectPoint::MT) == 1 && int(RectPoint::RT) == 2 && int(RectPoint::LM) == 3 && int(RectPoint::MM) == 4 && int(RectPoint::RM) == 5 && + int(RectPoint::LB) == 6 && int(RectPoint::MB) == 7 && int(RectPoint::RB) == 8, "*PointToIndex(): unexpected enum value!" ); - nRet = ( long ) ePoint; + nRet = static_cast<long>(ePoint); return nRet; } diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx index 77abee970fe0..30f670884c10 100644 --- a/svx/source/dialog/dlgutil.cxx +++ b/svx/source/dialog/dlgutil.cxx @@ -32,7 +32,7 @@ FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet ) FieldUnit eUnit = FUNIT_INCH; const SfxPoolItem* pItem = nullptr; if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_METRIC, false, &pItem ) ) - eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); + eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); else { return SfxModule::GetCurrentFieldUnit(); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 348084cd2d03..704e90f47d64 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -397,7 +397,7 @@ void SAL_CALL RecoveryCore::statusChanged(const css::frame::FeatureStateEvent& a TURLInfo aNew; aNew.ID = lInfo.getUnpackedValueOrDefault(STATEPROP_ID , sal_Int32(0) ); - aNew.DocState = (EDocStates)lInfo.getUnpackedValueOrDefault(STATEPROP_STATE , sal_Int32(0) ); + aNew.DocState = static_cast<EDocStates>(lInfo.getUnpackedValueOrDefault(STATEPROP_STATE , sal_Int32(0) )); aNew.OrgURL = lInfo.getUnpackedValueOrDefault(STATEPROP_ORGURL , OUString()); aNew.TempURL = lInfo.getUnpackedValueOrDefault(STATEPROP_TEMPURL , OUString()); aNew.FactoryURL = lInfo.getUnpackedValueOrDefault(STATEPROP_FACTORYURL , OUString()); diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index ff05b66a15ff..958c26f67778 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -256,7 +256,7 @@ void SvxGridTabPage::ActivatePage( const SfxItemSet& rSet ) { const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pAttr); - FieldUnit eFUnit = (FieldUnit)static_cast<long>(pItem->GetValue()); + FieldUnit eFUnit = static_cast<FieldUnit>(static_cast<long>(pItem->GetValue())); if( eFUnit != pMtrFldDrawX->GetUnit() ) { diff --git a/svx/source/dialog/papersizelistbox.cxx b/svx/source/dialog/papersizelistbox.cxx index 9dda16736d40..54e0743c3424 100644 --- a/svx/source/dialog/papersizelistbox.cxx +++ b/svx/source/dialog/papersizelistbox.cxx @@ -41,7 +41,7 @@ void PaperSizeListBox::FillPaperSizeEntries( PaperSizeApp eApp ) for ( sal_uInt32 i = 0; i < nCnt; ++i ) { OUString aStr = SvxResId(pPaperAry[i].first); - Paper eSize = (Paper)pPaperAry[i].second; + Paper eSize = static_cast<Paper>(pPaperAry[i].second); sal_Int32 nPos = InsertEntry( aStr ); SetEntryData( nPos, reinterpret_cast<void*>(static_cast<sal_uLong>(eSize)) ); } @@ -55,7 +55,7 @@ void PaperSizeListBox::SetSelection( Paper ePreselectPaper ) for (sal_Int32 i = 0; i < nEntryCount; ++i ) { - Paper eTmp = (Paper)reinterpret_cast<sal_uLong>(GetEntryData(i)); + Paper eTmp = static_cast<Paper>(reinterpret_cast<sal_uLong>(GetEntryData(i))); if ( eTmp == ePreselectPaper ) { @@ -74,7 +74,7 @@ void PaperSizeListBox::SetSelection( Paper ePreselectPaper ) Paper PaperSizeListBox::GetSelection() const { const sal_Int32 nPos = GetSelectedEntryPos(); - Paper ePaper = (Paper)reinterpret_cast<sal_uLong>(GetEntryData( nPos )); + Paper ePaper = static_cast<Paper>(reinterpret_cast<sal_uLong>(GetEntryData( nPos ))); return ePaper; } diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 7776fcafa6b3..309a23cc653e 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -801,7 +801,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang long nRubyWidth = rRenderContext.GetTextWidth(sRubyText); rRenderContext.SetFont(aSaveFont); - RubyAdjust nAdjust = (RubyAdjust)m_pParentDlg->m_pAdjustLB->GetSelectedEntryPos(); + RubyAdjust nAdjust = static_cast<RubyAdjust>(m_pParentDlg->m_pAdjustLB->GetSelectedEntryPos()); //use center if no adjustment is available if (nAdjust > RubyAdjust_INDENT_BLOCK) nAdjust = RubyAdjust_CENTER; diff --git a/svx/source/dialog/srchctrl.cxx b/svx/source/dialog/srchctrl.cxx index 8160a11ea0a4..28747acd75f4 100644 --- a/svx/source/dialog/srchctrl.cxx +++ b/svx/source/dialog/srchctrl.cxx @@ -54,7 +54,7 @@ void SvxSearchController::StateChanged( sal_uInt16 nSID, SfxItemState eState, else if ( SID_SEARCH_OPTIONS == nSID ) { DBG_ASSERT( dynamic_cast<const SfxUInt16Item* >(pState) != nullptr, "wrong item type" ); - SearchOptionFlags nFlags = (SearchOptionFlags) static_cast<const SfxUInt16Item*>(pState)->GetValue(); + SearchOptionFlags nFlags = static_cast<SearchOptionFlags>(static_cast<const SfxUInt16Item*>(pState)->GetValue()); rSrchDlg.EnableControls_Impl( nFlags ); } else if ( SID_SEARCH_ITEM == nSID ) diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 49ce01bb778e..82b76e1f187e 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -1577,7 +1577,7 @@ void Svx3DWin::Update( SfxItemSet const & rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_PERSPECTIVE); if( eState != SfxItemState::DONTCARE ) { - ProjectionType ePT = (ProjectionType)rAttrs.Get(SDRATTR_3DSCENE_PERSPECTIVE).GetValue(); + ProjectionType ePT = static_cast<ProjectionType>(rAttrs.Get(SDRATTR_3DSCENE_PERSPECTIVE).GetValue()); if( ( !m_pBtnPerspective->IsChecked() && ePT == ProjectionType::Perspective ) || ( m_pBtnPerspective->IsChecked() && ePT == ProjectionType::Parallel ) ) { diff --git a/svx/source/engine3d/svx3ditems.cxx b/svx/source/engine3d/svx3ditems.cxx index 87b0cbf18020..8b1efe4dfc44 100644 --- a/svx/source/engine3d/svx3ditems.cxx +++ b/svx/source/engine3d/svx3ditems.cxx @@ -66,7 +66,7 @@ Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal) {} Svx3DPerspectiveItem::Svx3DPerspectiveItem(ProjectionType nVal) -: SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, (sal_uInt16)nVal) +: SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, static_cast<sal_uInt16>(nVal)) {} Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal) @@ -151,7 +151,7 @@ SfxPoolItem * Svx3DCloseBackItem::Clone(SfxItemPool *) const // Svx3DNormalsKindItem: use drawing::NormalsKind bool Svx3DNormalsKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::NormalsKind)GetValue(); + rVal <<= static_cast<drawing::NormalsKind>(GetValue()); return true; } @@ -160,7 +160,7 @@ bool Svx3DNormalsKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId drawing::NormalsKind eVar; if(!(rVal >>= eVar)) return false; - SetValue((sal_Int16)eVar); + SetValue(static_cast<sal_Int16>(eVar)); return true; } @@ -172,7 +172,7 @@ SfxPoolItem* Svx3DNormalsKindItem::Clone(SfxItemPool* /*pPool*/) const // Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode bool Svx3DTextureProjectionXItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextureProjectionMode)GetValue(); + rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue()); return true; } @@ -181,7 +181,7 @@ bool Svx3DTextureProjectionXItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nM drawing::TextureProjectionMode eVar; if(!(rVal >>= eVar)) return false; - SetValue((sal_Int16)eVar); + SetValue(static_cast<sal_Int16>(eVar)); return true; } @@ -193,7 +193,7 @@ SfxPoolItem* Svx3DTextureProjectionXItem::Clone(SfxItemPool* /*pPool*/) const // Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode bool Svx3DTextureProjectionYItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextureProjectionMode)GetValue(); + rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue()); return true; } @@ -202,7 +202,7 @@ bool Svx3DTextureProjectionYItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nM drawing::TextureProjectionMode eVar; if(!(rVal >>= eVar)) return false; - SetValue((sal_Int16)eVar); + SetValue(static_cast<sal_Int16>(eVar)); return true; } @@ -214,7 +214,7 @@ SfxPoolItem* Svx3DTextureProjectionYItem::Clone(SfxItemPool* /*pPool*/) const // Svx3DTextureKindItem: use drawing::TextureKind bool Svx3DTextureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextureKind)GetValue(); + rVal <<= static_cast<drawing::TextureKind>(GetValue()); return true; } @@ -223,7 +223,7 @@ bool Svx3DTextureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId drawing::TextureKind eVar; if(!(rVal >>= eVar)) return false; - SetValue((sal_Int16)eVar); + SetValue(static_cast<sal_Int16>(eVar)); return true; } @@ -235,7 +235,7 @@ SfxPoolItem* Svx3DTextureKindItem::Clone(SfxItemPool* /*pPool*/) const // Svx3DTextureModeItem: use drawing:TextureMode bool Svx3DTextureModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextureMode)GetValue(); + rVal <<= static_cast<drawing::TextureMode>(GetValue()); return true; } @@ -244,7 +244,7 @@ bool Svx3DTextureModeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId drawing::TextureMode eVar; if(!(rVal >>= eVar)) return false; - SetValue((sal_Int16)eVar); + SetValue(static_cast<sal_Int16>(eVar)); return true; } @@ -256,7 +256,7 @@ SfxPoolItem* Svx3DTextureModeItem::Clone(SfxItemPool* /*pPool*/) const // Svx3DPerspectiveItem: use drawing::ProjectionMode bool Svx3DPerspectiveItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::ProjectionMode)GetValue(); + rVal <<= static_cast<drawing::ProjectionMode>(GetValue()); return true; } @@ -265,7 +265,7 @@ bool Svx3DPerspectiveItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId drawing::ProjectionMode eVar; if(!(rVal >>= eVar)) return false; - SetValue((sal_Int16)eVar); + SetValue(static_cast<sal_Int16>(eVar)); return true; } @@ -277,7 +277,7 @@ SfxPoolItem* Svx3DPerspectiveItem::Clone(SfxItemPool* /*pPool*/) const // Svx3DShadeModeItem: use drawing::ShadeMode bool Svx3DShadeModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::ShadeMode)GetValue(); + rVal <<= static_cast<drawing::ShadeMode>(GetValue()); return true; } @@ -286,7 +286,7 @@ bool Svx3DShadeModeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ drawing::ShadeMode eVar; if(!(rVal >>= eVar)) return false; - SetValue((sal_Int16)eVar); + SetValue(static_cast<sal_Int16>(eVar)); return true; } diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index c4ec732dcc93..31280a401825 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -108,14 +108,14 @@ vcl::Font ImplCreateFont( const css::awt::FontDescriptor& rDescr ) aFont.SetFamilyName( rDescr.Name ); aFont.SetStyleName( rDescr.StyleName ); aFont.SetFontSize( ::Size( rDescr.Width, rDescr.Height ) ); - aFont.SetFamily( (FontFamily)rDescr.Family ); + aFont.SetFamily( static_cast<FontFamily>(rDescr.Family) ); aFont.SetCharSet( static_cast<rtl_TextEncoding>(rDescr.CharSet) ); - aFont.SetPitch( (FontPitch)rDescr.Pitch ); + aFont.SetPitch( static_cast<FontPitch>(rDescr.Pitch) ); aFont.SetWidthType( vcl::unohelper::ConvertFontWidth( rDescr.CharacterWidth ) ); aFont.SetWeight( vcl::unohelper::ConvertFontWeight( rDescr.Weight ) ); - aFont.SetItalic( (FontItalic)rDescr.Slant ); - aFont.SetUnderline( (::FontLineStyle)rDescr.Underline ); - aFont.SetStrikeout( (::FontStrikeout)rDescr.Strikeout ); + aFont.SetItalic( static_cast<FontItalic>(rDescr.Slant) ); + aFont.SetUnderline( static_cast<::FontLineStyle>(rDescr.Underline) ); + aFont.SetStrikeout( static_cast<::FontStrikeout>(rDescr.Strikeout) ); aFont.SetOrientation( static_cast<sal_Int16>(rDescr.Orientation) ); aFont.SetKerning( static_cast<FontKerning>(rDescr.Kerning) ); aFont.SetWordLineMode( rDescr.WordLineMode ); @@ -1857,14 +1857,14 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) { vcl::Font aGridFont = pGrid->GetControlFont(); sal_Int16 nValue = ::comphelper::getINT16(Value); - aGridFont.SetEmphasisMark( (FontEmphasisMark)nValue ); + aGridFont.SetEmphasisMark( static_cast<FontEmphasisMark>(nValue) ); pGrid->SetControlFont( aGridFont ); } else if ( PropertyName == FM_PROP_FONTRELIEF ) { vcl::Font aGridFont = pGrid->GetControlFont(); sal_Int16 nValue = ::comphelper::getINT16(Value); - aGridFont.SetRelief( (FontRelief)nValue ); + aGridFont.SetRelief( static_cast<FontRelief>(nValue) ); pGrid->SetControlFont( aGridFont ); } else if ( PropertyName == FM_PROP_HELPURL ) diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 49722fa6487a..b4ac9baf0263 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -2190,13 +2190,13 @@ void DbDateField::implAdjustGenericFieldSetting( const Reference< XPropertySet > static_cast<DateField*>( m_pPainter.get() )->SetShowDateCentury( bShowDateCentury ); } - static_cast< DateField* >( m_pWindow.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat ); + static_cast< DateField* >( m_pWindow.get() )->SetExtDateFormat( static_cast<ExtDateFieldFormat>(nFormat) ); static_cast< DateField* >( m_pWindow.get() )->SetMin( aMin ); static_cast< DateField* >( m_pWindow.get() )->SetMax( aMax ); static_cast< DateField* >( m_pWindow.get() )->SetStrictFormat( bStrict ); static_cast< DateField* >( m_pWindow.get() )->EnableEmptyFieldValue( true ); - static_cast< DateField* >( m_pPainter.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat ); + static_cast< DateField* >( m_pPainter.get() )->SetExtDateFormat( static_cast<ExtDateFieldFormat>(nFormat) ); static_cast< DateField* >( m_pPainter.get() )->SetMin( aMin ); static_cast< DateField* >( m_pPainter.get() )->SetMax( aMax ); static_cast< DateField* >( m_pPainter.get() )->SetStrictFormat( bStrict ); @@ -2298,13 +2298,13 @@ void DbTimeField::implAdjustGenericFieldSetting( const Reference< XPropertySet > OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_TIMEMAX ) >>= aMax ); bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) ); - static_cast< TimeField* >( m_pWindow.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat ); + static_cast< TimeField* >( m_pWindow.get() )->SetExtFormat( static_cast<ExtTimeFieldFormat>(nFormat) ); static_cast< TimeField* >( m_pWindow.get() )->SetMin( aMin ); static_cast< TimeField* >( m_pWindow.get() )->SetMax( aMax ); static_cast< TimeField* >( m_pWindow.get() )->SetStrictFormat( bStrict ); static_cast< TimeField* >( m_pWindow.get() )->EnableEmptyFieldValue( true ); - static_cast< TimeField* >( m_pPainter.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat ); + static_cast< TimeField* >( m_pPainter.get() )->SetExtFormat( static_cast<ExtTimeFieldFormat>(nFormat) ); static_cast< TimeField* >( m_pPainter.get() )->SetMin( aMin ); static_cast< TimeField* >( m_pPainter.get() )->SetMax( aMax ); static_cast< TimeField* >( m_pPainter.get() )->SetStrictFormat( bStrict ); @@ -3883,7 +3883,7 @@ void SAL_CALL FmXCheckBoxCell::setState( short n ) if (m_pBox) { UpdateFromColumn(); - m_pBox->SetState( (TriState)n ); + m_pBox->SetState( static_cast<TriState>(n) ); } } diff --git a/svx/source/form/dataaccessdescriptor.cxx b/svx/source/form/dataaccessdescriptor.cxx index d3b94afe6f04..ce8a47d7e095 100644 --- a/svx/source/form/dataaccessdescriptor.cxx +++ b/svx/source/form/dataaccessdescriptor.cxx @@ -228,7 +228,7 @@ namespace svx // build the property value PropertyValue aReturn; aReturn.Name = pProperty->maName; - aReturn.Handle = (sal_Int32)pProperty->mnHandle; + aReturn.Handle = static_cast<sal_Int32>(pProperty->mnHandle); aReturn.Value = _rPos->second; aReturn.State = PropertyState_DIRECT_VALUE; diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index d5b2a670ee98..8b4e0a97f99b 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -483,7 +483,7 @@ void FmFormShell::Execute(SfxRequest &rReq) } SfxUInt16Item aIdentifierItem( SID_FM_CONTROL_IDENTIFIER, nIdentifier ); - SfxUInt32Item aInventorItem( SID_FM_CONTROL_INVENTOR, (sal_uInt32) SdrInventor::FmForm ); + SfxUInt32Item aInventorItem( SID_FM_CONTROL_INVENTOR, sal_uInt32(SdrInventor::FmForm) ); const SfxPoolItem* pArgs[] = { &aIdentifierItem, &aInventorItem, nullptr diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 6eb3385291cd..dcdf9811b09e 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -505,7 +505,7 @@ bool IsSearchableControl( const css::uno::Reference< css::uno::XInterface>& _rxC { if ( _pCurrentText ) { - switch ( (::TriState)xCheckBox->getState() ) + switch ( static_cast<::TriState>(xCheckBox->getState()) ) { case TRISTATE_FALSE: *_pCurrentText = "0"; break; case TRISTATE_TRUE: *_pCurrentText = "1"; break; diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 4612f2563f68..a601ae6f2344 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -173,7 +173,7 @@ CheckBoxWrapper::CheckBoxWrapper(const Reference< css::awt::XCheckBox > & _xBox) OUString CheckBoxWrapper::getCurrentText() const { - switch ((TriState)m_xBox->getState()) + switch (static_cast<TriState>(m_xBox->getState())) { case TRISTATE_FALSE: return OUString("0"); case TRISTATE_TRUE: return OUString("1"); diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 9e68d5601186..19b7561158bc 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -2544,7 +2544,7 @@ void FormController::loaded(const EventObject& rEvent) Any aVal = xSet->getPropertyValue(FM_PROP_CYCLE); sal_Int32 aVal2 = 0; ::cppu::enum2int(aVal2,aVal); - m_bCycle = !aVal.hasValue() || (form::TabulatorCycle)aVal2 == TabulatorCycle_RECORDS; + m_bCycle = !aVal.hasValue() || static_cast<form::TabulatorCycle>(aVal2) == TabulatorCycle_RECORDS; m_bCanUpdate = canUpdate(xSet); m_bCanInsert = canInsert(xSet); m_bCurrentRecordModified = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ISMODIFIED)); diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 15810448ba84..b8d11333ac6a 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -173,7 +173,7 @@ void SgaObject::WriteData( SvStream& rOut, const OUString& rDestDir ) const { static const sal_uInt32 nInventor = COMPAT_FORMAT( 'S', 'G', 'A', '3' ); - rOut.WriteUInt32( nInventor ).WriteUInt16( 0x0004 ).WriteUInt16( GetVersion() ).WriteUInt16( (sal_uInt16)GetObjKind() ); + rOut.WriteUInt32( nInventor ).WriteUInt16( 0x0004 ).WriteUInt16( GetVersion() ).WriteUInt16( static_cast<sal_uInt16>(GetObjKind()) ); rOut.WriteBool( bIsThumbBmp ); if( bIsThumbBmp ) @@ -353,7 +353,7 @@ void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) { sal_uInt16 nTmp16; - rIn.ReadUInt16( nTmp16 ); eSoundType = (GalSoundType) nTmp16; + rIn.ReadUInt16( nTmp16 ); eSoundType = static_cast<GalSoundType>(nTmp16); if( rReadVersion >= 6 ) aTitle = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 9c6cdf8dfbec..8b63c7ab3b5b 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1337,7 +1337,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const rOStm.WriteBool( bRel ); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aPath, RTL_TEXTENCODING_UTF8); - rOStm.WriteUInt32( pObj->nOffset ).WriteUInt16( (sal_uInt16)pObj->eObjKind ); + rOStm.WriteUInt32( pObj->nOffset ).WriteUInt16( static_cast<sal_uInt16>(pObj->eObjKind) ); } // more recently, a 512-byte reserve buffer is written, @@ -1407,7 +1407,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) rIStm.ReadCharAsBool( bRel ); OString aTempFileName = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); rIStm.ReadUInt32( pObj->nOffset ); - rIStm.ReadUInt16( nTemp ); pObj->eObjKind = (SgaObjKind) nTemp; + rIStm.ReadUInt16( nTemp ); pObj->eObjKind = static_cast<SgaObjKind>(nTemp); aFileName = OStringToOUString(aTempFileName, osl_getThreadTextEncoding()); diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx index a6464bf11161..ef505418fc3a 100644 --- a/svx/source/items/algitem.cxx +++ b/svx/source/items/algitem.cxx @@ -101,7 +101,7 @@ bool SvxOrientationItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ sal_Int32 nValue = 0; if(!(rVal >>= nValue)) return false; - eOrient = (table::CellOrientation)nValue; + eOrient = static_cast<table::CellOrientation>(nValue); } SvxCellOrientation eSvx = SvxCellOrientation::Standard; switch (eOrient) @@ -133,7 +133,7 @@ SfxPoolItem* SvxOrientationItem::Create( SvStream& rStream, sal_uInt16 ) const { sal_uInt16 nVal; rStream.ReadUInt16( nVal ); - return new SvxOrientationItem( (SvxCellOrientation)nVal, Which() ); + return new SvxOrientationItem( static_cast<SvxCellOrientation>(nVal), Which() ); } diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx index 2855ae46789e..c7c0f4968a6e 100644 --- a/svx/source/items/clipfmtitem.cxx +++ b/svx/source/items/clipfmtitem.cxx @@ -59,7 +59,7 @@ bool SvxClipboardFormatItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMembe aClipFormats.Names.realloc( nCount ); for ( sal_uInt16 n=0; n < nCount; n++ ) { - aClipFormats.Identifiers[n] = (sal_Int64)GetClipbrdFormatId( n ); + aClipFormats.Identifiers[n] = static_cast<sal_Int64>(GetClipbrdFormatId( n )); aClipFormats.Names[n] = GetClipbrdFormatName( n ); } diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index 4585b270d2d0..d11249c74b10 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -175,7 +175,7 @@ bool SvxHyperlinkItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId case MID_HLINK_TYPE: if(!(rVal >>= nVal)) return false; - eType = (SvxLinkInsertMode) static_cast<sal_uInt16>(nVal); + eType = static_cast<SvxLinkInsertMode>(static_cast<sal_uInt16>(nVal)); break; default: return false; diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 6a23dd3b9d97..03840282e695 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -680,7 +680,7 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<OUString>& rL for(nIndex=eOffsetStart;nIndex<=eOffsetEnd;nIndex++) { - nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage); + nNFEntry=pFormatter->GetFormatIndex(static_cast<NfIndexTableOffset>(nIndex),eCurLanguage); const SvNumberformat* pNumEntry = pFormatter->GetEntry(nNFEntry); @@ -714,7 +714,7 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& r for (long nIndex = NF_DATETIME_START; nIndex <= NF_DATETIME_END; ++nIndex) { - nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage); + nNFEntry=pFormatter->GetFormatIndex(static_cast<NfIndexTableOffset>(nIndex),eCurLanguage); const SvNumberformat* pNumEntry = pFormatter->GetEntry(nNFEntry); if(pNumEntry!=nullptr) @@ -789,7 +789,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL for(long nIndex=NF_CURRENCY_START; nIndex<=NF_CURRENCY_END; nIndex++) { - nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage); + nNFEntry=pFormatter->GetFormatIndex(static_cast<NfIndexTableOffset>(nIndex),eCurLanguage); const SvNumberformat* pNumEntry = pFormatter->GetEntry(nNFEntry); diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx index f18e4fe50037..166eff735ffc 100644 --- a/svx/source/items/pageitem.cxx +++ b/svx/source/items/pageitem.cxx @@ -199,7 +199,7 @@ bool SvxPageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) if(!(rVal >>= nValue)) return false; - eNumType = (SvxNumType)nValue; + eNumType = static_cast<SvxNumType>(nValue); } break; case MID_PAGE_ORIENTATION: @@ -213,7 +213,7 @@ bool SvxPageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int32 nValue = 0; if(!(rVal >>= nValue)) return false; - eLayout = (style::PageStyleLayout)nValue; + eLayout = static_cast<style::PageStyleLayout>(nValue); } switch( eLayout ) { diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx index 0652f38f5d97..b1f21a131517 100644 --- a/svx/source/items/rotmodit.cxx +++ b/svx/source/items/rotmodit.cxx @@ -60,7 +60,7 @@ SfxPoolItem* SvxRotateModeItem::Create( SvStream& rStream, sal_uInt16 ) const { sal_uInt16 nVal; rStream.ReadUInt16( nVal ); - return new SvxRotateModeItem( (SvxRotateMode) nVal,Which() ); + return new SvxRotateModeItem( static_cast<SvxRotateMode>(nVal),Which() ); } bool SvxRotateModeItem::GetPresentation( diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx index 35561f3eda51..22c00fe7e8fd 100644 --- a/svx/source/mnuctrls/clipboardctl.cxx +++ b/svx/source/mnuctrls/clipboardctl.cxx @@ -77,7 +77,7 @@ VclPtr<SfxPopupWindow> SvxClipBoardControl::CreatePopupWindow() OUString aFmtStr( pFmtItem->GetClipbrdFormatName( i ) ); if (aFmtStr.isEmpty()) aFmtStr = SvPasteObjectHelper::GetSotFormatUIName( nFmtID ); - pPopup->InsertItem( (sal_uInt16)nFmtID, aFmtStr ); + pPopup->InsertItem( static_cast<sal_uInt16>(nFmtID), aFmtStr ); } ToolBox& rBox = GetToolBox(); diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 56a1d67ceeb5..8c0e9e8eb27a 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -240,7 +240,7 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ClickImportBitmapHdl, Button*, void) IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void) { - sal_Int32 nPos = (eFillStyle)mpLbFillType->GetSelectedEntryPos(); + sal_Int32 nPos = static_cast<eFillStyle>(mpLbFillType->GetSelectedEntryPos()); mpLbFillAttr->Clear(); SfxObjectShell* pSh = SfxObjectShell::Current(); if(!pSh) @@ -439,7 +439,7 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void) meLastXFS = static_cast<sal_uInt16>(nPos); - if(eFillStyle::NONE != (eFillStyle)nPos) + if(eFillStyle::NONE != static_cast<eFillStyle>(nPos)) { mpLbFillType->Selected(); } @@ -467,12 +467,12 @@ void AreaPropertyPanelBase::DataChanged( void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() { - sal_Int32 nPosFillStyle = (eFillStyle)mpLbFillType->GetSelectedEntryPos(); + sal_Int32 nPosFillStyle = static_cast<eFillStyle>(mpLbFillType->GetSelectedEntryPos()); SfxObjectShell* pSh = SfxObjectShell::Current(); // #i122676# dependent from bFillStyleChange, do execute a single or two // changes in one Execute call - const bool bFillStyleChange((eFillStyle) meLastXFS != (eFillStyle)nPosFillStyle); + const bool bFillStyleChange(static_cast<eFillStyle>(meLastXFS) != static_cast<eFillStyle>(nPosFillStyle)); switch(nPosFillStyle) { @@ -502,7 +502,7 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() { XGradient aGradient; aGradient.SetAngle(mpMTRAngle->GetValue() * 10); - aGradient.SetGradientStyle((css::awt::GradientStyle)mpGradientStyle->GetSelectedEntryPos()); + aGradient.SetGradientStyle(static_cast<css::awt::GradientStyle>(mpGradientStyle->GetSelectedEntryPos())); aGradient.SetStartColor(mpLbFillGradFrom->GetSelectEntryColor()); aGradient.SetEndColor(mpLbFillGradTo->GetSelectEntryColor()); @@ -1104,7 +1104,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate( void AreaPropertyPanelBase::Update() { - const eFillStyle eXFS = (eFillStyle)mpLbFillType->GetSelectedEntryPos(); + const eFillStyle eXFS = static_cast<eFillStyle>(mpLbFillType->GetSelectedEntryPos()); SfxObjectShell* pSh = SfxObjectShell::Current(); switch( eXFS ) @@ -1161,7 +1161,7 @@ void AreaPropertyPanelBase::Update() mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor()); mpLbFillGradTo->SelectEntry(aGradient.GetEndColor()); mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( aGradient.GetGradientStyle() )); - if(mpGradientStyle->GetSelectedEntryPos() == (sal_Int32)GradientStyle::Radial) + if(mpGradientStyle->GetSelectedEntryPos() == sal_Int32(GradientStyle::Radial)) mpMTRAngle->Disable(); else mpMTRAngle->SetValue( aGradient.GetAngle() /10 ); @@ -1344,7 +1344,7 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl, ListBox&, void) XGradient aTmpGradient; - switch((css::awt::GradientStyle)nSelectType) + switch(static_cast<css::awt::GradientStyle>(nSelectType)) { case css::awt::GradientStyle_LINEAR: aTmpGradient = maGradientLinear; diff --git a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx index eef6cca757f6..eaf6d2d7fcff 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx @@ -126,7 +126,7 @@ void AreaTransparencyGradientPopup::ExecuteValueModify(sal_uInt8 nStartCol, sal_ XGradient aTmpGradient( Color(nStartCol, nStartCol, nStartCol), Color(nEndCol, nEndCol, nEndCol), - (css::awt::GradientStyle)(mrAreaPropertyPanel.GetSelectedTransparencyTypeIndex()-2), + static_cast<css::awt::GradientStyle>(mrAreaPropertyPanel.GetSelectedTransparencyTypeIndex()-2), static_cast<sal_uInt16>(maMtrTrgrAngle->GetValue()) * 10, static_cast<sal_uInt16>(maMtrTrgrCenterX->GetValue()), static_cast<sal_uInt16>(maMtrTrgrCenterY->GetValue()), diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 3a4f7d62d9c2..6b9f2405a7d8 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -103,7 +103,7 @@ NumSettings_Impl* lcl_CreateNumberingSettingsPtr(const Sequence<PropertyValue>& { sal_Int16 nTmp; if (pValues[j].Value >>= nTmp) - pNew->nNumberType = (SvxNumType)nTmp; + pNew->nNumberType = static_cast<SvxNumType>(nTmp); } else if(pValues[j].Name == "Prefix") pValues[j].Value >>= pNew->sPrefix; diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index 1222396830c5..7ad35c4c4437 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -370,7 +370,7 @@ FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolI FieldUnit eUnit = FUNIT_NONE; if ( pState && eState >= SfxItemState::DEFAULT ) - eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pState)->GetValue(); + eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pState)->GetValue()); else { SfxViewFrame* pFrame = SfxViewFrame::Current(); @@ -384,7 +384,7 @@ FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolI { const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); if ( pItem ) - eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); + eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); } else { diff --git a/svx/source/sidebar/paragraph/ParaSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx index eea13fb4d039..21ef4c7f264d 100644 --- a/svx/source/sidebar/paragraph/ParaSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx @@ -66,7 +66,7 @@ void ParaULSpacingControl::StateChanged(sal_uInt16 nSID, SfxItemState eState, if(nSID == SID_ATTR_METRIC && pState && eState >= SfxItemState::DEFAULT) { const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pState); - pWindow->SetUnit((FieldUnit)pMetricItem->GetValue()); + pWindow->SetUnit(static_cast<FieldUnit>(pMetricItem->GetValue())); } else if((nSID == SID_ATTR_PARA_ULSPACE || nSID == SID_ATTR_PARA_ABOVESPACE @@ -153,7 +153,7 @@ void ParaLRSpacingControl::StateChanged(sal_uInt16 nSID, SfxItemState eState, if(nSID == SID_ATTR_METRIC && pState && eState >= SfxItemState::DEFAULT) { const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pState); - pWindow->SetUnit((FieldUnit)pMetricItem->GetValue()); + pWindow->SetUnit(static_cast<FieldUnit>(pMetricItem->GetValue())); } else if(nSID == SID_ATTR_PARA_LRSPACE || nSID == SID_ATTR_PARA_LEFTSPACE diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index fd1e2b055d60..280f7ede27c9 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -154,7 +154,7 @@ namespace if(1 == rMarkList.GetMarkCount()) { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier()); + const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier())); if((pObj->GetObjInventor() == SdrInventor::Default) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind)) { @@ -743,7 +743,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( case 1: { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier()); + const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier())); if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw) || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject) @@ -767,7 +767,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( while(isNoEdge && rMarkList.GetMark(nMarkObj)) { const SdrObject* pObj = rMarkList.GetMark(nMarkObj)->GetMarkedSdrObj(); - const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier()); + const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier())); if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw) || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject) @@ -835,7 +835,7 @@ void PosSizePropertyPanel::executeSize() // put Width & Height to itemset SfxUInt32Item aWidthItem( SID_ATTR_TRANSFORM_WIDTH, static_cast<sal_uInt32>(lWidth)); SfxUInt32Item aHeightItem( SID_ATTR_TRANSFORM_HEIGHT, static_cast<sal_uInt32>(lHeight)); - SfxAllEnumItem aPointItem (SID_ATTR_TRANSFORM_SIZE_POINT, (sal_uInt16)RectPoint::LT); + SfxAllEnumItem aPointItem (SID_ATTR_TRANSFORM_SIZE_POINT, sal_uInt16(RectPoint::LT)); const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI()); if( nCombinedContext == CombinedEnumContext(Application::WriterVariants, Context::Graphic) @@ -904,7 +904,7 @@ FieldUnit PosSizePropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPo if ( pState && eState >= SfxItemState::DEFAULT ) { - eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pState)->GetValue(); + eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pState)->GetValue()); } else { @@ -919,7 +919,7 @@ FieldUnit PosSizePropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPo { const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); if ( pItem ) - eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); + eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); } else { diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index c2797daf43e9..86627787ff48 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -984,7 +984,7 @@ bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemb if(!(rVal >>= nEnum)) return false; - eFS = (drawing::TextFitToSizeType) nEnum; + eFS = static_cast<drawing::TextFitToSizeType>(nEnum); } SetValue(eFS); @@ -1017,7 +1017,7 @@ bool SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres, bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextVerticalAdjust)GetValue(); + rVal <<= static_cast<drawing::TextVerticalAdjust>(GetValue()); return true; } @@ -1030,10 +1030,10 @@ bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberI if(!(rVal >>= nEnum)) return false; - eAdj = (drawing::TextVerticalAdjust)nEnum; + eAdj = static_cast<drawing::TextVerticalAdjust>(nEnum); } - SetValue( (SdrTextVertAdjust)eAdj ); + SetValue( static_cast<SdrTextVertAdjust>(eAdj) ); return true; } @@ -1070,7 +1070,7 @@ bool SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres, bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextHorizontalAdjust)GetValue(); + rVal <<= static_cast<drawing::TextHorizontalAdjust>(GetValue()); return true; } @@ -1083,10 +1083,10 @@ bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberI if(!(rVal >>= nEnum)) return false; - eAdj = (drawing::TextHorizontalAdjust)nEnum; + eAdj = static_cast<drawing::TextHorizontalAdjust>(nEnum); } - SetValue( (SdrTextHorzAdjust)eAdj ); + SetValue( static_cast<SdrTextHorzAdjust>(eAdj) ); return true; } @@ -1116,7 +1116,7 @@ bool SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres, bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextAnimationKind)GetValue(); + rVal <<= static_cast<drawing::TextAnimationKind>(GetValue()); return true; } @@ -1128,10 +1128,10 @@ bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ sal_Int32 nEnum = 0; if(!(rVal >>= nEnum)) return false; - eKind = (drawing::TextAnimationKind)nEnum; + eKind = static_cast<drawing::TextAnimationKind>(nEnum); } - SetValue( (SdrTextAniKind)eKind ); + SetValue( static_cast<SdrTextAniKind>(eKind) ); return true; } @@ -1161,7 +1161,7 @@ bool SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres, bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::TextAnimationDirection)GetValue(); + rVal <<= static_cast<drawing::TextAnimationDirection>(GetValue()); return true; } @@ -1174,10 +1174,10 @@ bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMembe if(!(rVal >>= nEnum)) return false; - eDir = (drawing::TextAnimationDirection)nEnum; + eDir = static_cast<drawing::TextAnimationDirection>(nEnum); } - SetValue( (SdrTextAniDirection)eDir ); + SetValue( static_cast<SdrTextAniDirection>(eDir) ); return true; } @@ -1349,7 +1349,7 @@ bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/) if(!(rVal >>= nEnum)) return false; - eCT = (drawing::ConnectorType)nEnum; + eCT = static_cast<drawing::ConnectorType>(nEnum); } SdrEdgeKind eEK = SdrEdgeKind::OrthoLines; @@ -1485,7 +1485,7 @@ bool SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres, bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::MeasureKind)GetValue(); + rVal <<= static_cast<drawing::MeasureKind>(GetValue()); return true; } @@ -1498,10 +1498,10 @@ bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ if(!(rVal >>= nEnum)) return false; - eKind = (drawing::MeasureKind)nEnum; + eKind = static_cast<drawing::MeasureKind>(nEnum); } - SetValue( (SdrMeasureKind)eKind ); + SetValue( static_cast<SdrMeasureKind>(eKind) ); return true; } @@ -1543,7 +1543,7 @@ bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember if(!(rVal >>= nEnum)) return false; - ePos = (drawing::MeasureTextHorzPos)nEnum; + ePos = static_cast<drawing::MeasureTextHorzPos>(nEnum); } SetValue(ePos); @@ -1588,7 +1588,7 @@ bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember if(!(rVal >>= nEnum)) return false; - ePos = (drawing::MeasureTextVertPos)nEnum; + ePos = static_cast<drawing::MeasureTextVertPos>(nEnum); } SetValue(ePos); @@ -1603,10 +1603,10 @@ OUString SdrMeasureUnitItem::GetValueTextByPos(sal_uInt16 nPos) const { OUString aRetval; - if((FieldUnit)nPos == FUNIT_NONE) + if(static_cast<FieldUnit>(nPos) == FUNIT_NONE) aRetval = "default"; else - SdrFormatter::TakeUnitStr((FieldUnit)nPos, aRetval); + SdrFormatter::TakeUnitStr(static_cast<FieldUnit>(nPos), aRetval); return aRetval; } @@ -1636,7 +1636,7 @@ bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ if(!(rVal >>= nMeasure)) return false; - SetValue( (FieldUnit)nMeasure ); + SetValue( static_cast<FieldUnit>(nMeasure) ); return true; } @@ -1665,7 +1665,7 @@ bool SdrCircKindItem::GetPresentation(SfxItemPresentation ePres, bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (drawing::CircleKind)GetValue(); + rVal <<= static_cast<drawing::CircleKind>(GetValue()); return true; } @@ -1678,10 +1678,10 @@ bool SdrCircKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/) if(!(rVal >>= nEnum)) return false; - eKind = (drawing::CircleKind)nEnum; + eKind = static_cast<drawing::CircleKind>(nEnum); } - SetValue( (SdrCircKind)eKind ); + SetValue( static_cast<SdrCircKind>(eKind) ); return true; } diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 53da7eb8e21f..ab5389aacf13 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1513,7 +1513,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) bChgHgt=true; } if (bChgSiz) { - eSizePoint=(RectPoint)rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue(); + eSizePoint=static_cast<RectPoint>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue()); } // rotation diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 430b987db155..8be4649c50c0 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1523,7 +1523,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, if(!bMakeLines || nPointCount < 2) { - SdrPathObj* pPath = new SdrPathObj((SdrObjKind)pSrcPath->GetObjIdentifier(), basegfx::B2DPolyPolygon(rCandidate)); + SdrPathObj* pPath = new SdrPathObj(static_cast<SdrObjKind>(pSrcPath->GetObjIdentifier()), basegfx::B2DPolyPolygon(rCandidate)); ImpCopyAttributes(pSrcPath, pPath); pLast = pPath; rOL.InsertObject(pPath, rPos); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index c22e0d410939..87454500d904 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1500,7 +1500,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) if(pTEObj->IsInserted() && bDelObj && pTEObj->GetObjInventor()==SdrInventor::Default && !bDontDeleteReally) { - SdrObjKind eIdent=(SdrObjKind)pTEObj->GetObjIdentifier(); + SdrObjKind eIdent=static_cast<SdrObjKind>(pTEObj->GetObjIdentifier()); if(eIdent==OBJ_TEXT || eIdent==OBJ_TEXTEXT) { pDelUndo= GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pTEObj); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index ba272a204c52..d8cc89375e49 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -1211,7 +1211,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction const & rAct, GDIMetaF SfxItemSet aGradAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges()); XGradient aXGradient; - aXGradient.SetGradientStyle((css::awt::GradientStyle)rGrad.GetStyle()); + aXGradient.SetGradientStyle(static_cast<css::awt::GradientStyle>(rGrad.GetStyle())); aXGradient.SetStartColor(rGrad.GetStartColor()); aXGradient.SetEndColor(rGrad.GetEndColor()); aXGradient.SetAngle(rGrad.GetAngle()); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 6a46dd1f4a18..ec3b2f1df4ea 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1846,7 +1846,7 @@ static bool ImpSdrHdlListSorter(SdrHdl* const& lhs, SdrHdl* const& rhs) { if (eKind1==eKind2) return lhs<rhs; // Hack, to always get to the same sorting - return (sal_uInt16)eKind1<(sal_uInt16)eKind2; + return static_cast<sal_uInt16>(eKind1)<static_cast<sal_uInt16>(eKind2); } else return nNum1<nNum2; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index c21866ed41f9..2e09b6c18814 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -162,9 +162,8 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe mbDisableTextEditUsesCommonUndoManager = false; if (!utl::ConfigManager::IsFuzzing()) - mnCharCompressType = (CharCompressType) - officecfg::Office::Common::AsianLayout::CompressCharacterDistance:: - get(); + mnCharCompressType = static_cast<CharCompressType>(officecfg::Office::Common::AsianLayout::CompressCharacterDistance:: + get()); else mnCharCompressType = CharCompressType::NONE; diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 26c2861f11e1..a53539ff0c35 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -1286,8 +1286,8 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) sal_uInt16 nIdent; SdrInventor nInvent; pView->TakeCurrentObj(nIdent,nInvent); - if (nInvent==SdrInventor::Default && pU->eAktKind!=(SdrObjKind)nIdent) { - SdrObjKind eNewKind=(SdrObjKind)nIdent; + if (nInvent==SdrInventor::Default && pU->eAktKind!=static_cast<SdrObjKind>(nIdent)) { + SdrObjKind eNewKind=static_cast<SdrObjKind>(nIdent); switch (eNewKind) { case OBJ_CARC: case OBJ_CIRC: diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 4cb9eae98fa0..152e19046f94 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1090,7 +1090,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& if(!(rValue >>= nMode)) throw IllegalArgumentException(); - eMode = (BitmapMode)nMode; + eMode = static_cast<BitmapMode>(nMode); } mpProperties->SetObjectItem( XFillBmpStretchItem( eMode == BitmapMode_STRETCH ) ); diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 3274fe577afb..5e18a4187aca 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -570,7 +570,7 @@ void FillControl::dispose() IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox&, void) { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectedEntryPos(); + const drawing::FillStyle eXFS = static_cast<drawing::FillStyle>(mpLbFillType->GetSelectedEntryPos()); if(meLastXFS != eXFS) { @@ -745,7 +745,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox&, void) IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void) { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectedEntryPos(); + const drawing::FillStyle eXFS = static_cast<drawing::FillStyle>(mpLbFillType->GetSelectedEntryPos()); const XFillStyleItem aXFillStyleItem(eXFS); SfxObjectShell* pSh = SfxObjectShell::Current(); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index ff24039ef3ce..97267ec5fdf5 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -649,7 +649,7 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ) { if( pItem ) { - aSet.Put( SdrGrafModeItem( (GraphicDrawMode) static_cast<const SfxUInt16Item*>(pItem)->GetValue() )); + aSet.Put( SdrGrafModeItem( static_cast<GraphicDrawMode>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()) )); if( bUndo ) aUndoStr += SvxResId( RID_SVXSTR_UNDO_GRAFMODE ); } diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 75feaa728cff..a61343f98329 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -387,7 +387,7 @@ SvxFillTypeBox::SvxFillTypeBox( vcl::Window* pParent ) : { SetSizePixel(LogicToPixel(Size(40, 40), MapMode(MapUnit::MapAppFont))); Fill(); - SelectEntryPos( (sal_Int32)drawing::FillStyle_SOLID ); + SelectEntryPos( sal_Int32(drawing::FillStyle_SOLID) ); Show(); } diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 1522525bb0f7..4bf9fb6ac898 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -128,9 +128,9 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext { "SearchItem.SearchString", css::uno::makeAny( sFindText ) }, { "SearchItem.Backward", css::uno::makeAny( aSearchBackwards ) }, { "SearchItem.SearchFlags", css::uno::makeAny( sal_Int32(0) ) }, - { "SearchItem.TransliterateFlags", css::uno::makeAny( (sal_Int32)nFlags ) }, - { "SearchItem.Command", css::uno::makeAny( (sal_Int16)(aFindAll ?SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND ) ) }, - { "SearchItem.AlgorithmType", css::uno::makeAny( (sal_Int16)css::util::SearchAlgorithms_ABSOLUTE ) }, + { "SearchItem.TransliterateFlags", css::uno::makeAny( static_cast<sal_Int32>(nFlags) ) }, + { "SearchItem.Command", css::uno::makeAny( static_cast<sal_Int16>(aFindAll ?SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND ) ) }, + { "SearchItem.AlgorithmType", css::uno::makeAny( sal_Int16(css::util::SearchAlgorithms_ABSOLUTE) ) }, { "SearchItem.AlgorithmType2", css::uno::makeAny( sal_Int16(css::util::SearchAlgorithms2::ABSOLUTE) ) }, { "SearchItem.SearchFormatted", css::uno::makeAny( bSearchFormatted ) } } ) ); diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index e08c6e5604d2..f3e0b30bea98 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -568,7 +568,7 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest const & rReq, SfxBindi (rReq.GetArgs()->GetItemState( SID_ATTR_METRIC ) == SfxItemState::SET)) { double fDepth = rReq.GetArgs()->GetItem<SvxDoubleItem>(SID_EXTRUSION_DEPTH)->GetValue(); - FieldUnit eUnit = (FieldUnit)rReq.GetArgs()->GetItem<SfxUInt16Item>(SID_ATTR_METRIC)->GetValue(); + FieldUnit eUnit = static_cast<FieldUnit>(rReq.GetArgs()->GetItem<SfxUInt16Item>(SID_ATTR_METRIC)->GetValue()); ScopedVclPtrInstance< ExtrusionDepthDialog > aDlg(nullptr, fDepth, eUnit); sal_uInt16 nRet = aDlg->Execute(); @@ -645,7 +645,7 @@ void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rSet ) pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "ProjectionMode" ); sal_Int16 nProjectionMode = sal_Int16(); if( pAny && ( *pAny >>= nProjectionMode ) ) - bParallel = (ProjectionMode)nProjectionMode == ProjectionMode_PARALLEL; + bParallel = static_cast<ProjectionMode>(nProjectionMode) == ProjectionMode_PARALLEL; if( bParallel ) { diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index 24093e8ba0de..55ca9a09cc90 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -384,7 +384,7 @@ uno::Any SvxUnoXDashTable::getAny( const XPropertyEntry* pEntry ) const throw() drawing::LineDash aLineDash; - aLineDash.Style = (css::drawing::DashStyle)((sal_uInt16)rXD.GetDashStyle()); + aLineDash.Style = static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(rXD.GetDashStyle())); aLineDash.Dots = rXD.GetDots(); aLineDash.DotLen = rXD.GetDotLen(); aLineDash.Dashes = rXD.GetDashes(); @@ -402,7 +402,7 @@ std::unique_ptr<XPropertyEntry> SvxUnoXDashTable::createEntry(const OUString& rN XDash aXDash; - aXDash.SetDashStyle((css::drawing::DashStyle)((sal_uInt16)(aLineDash.Style))); + aXDash.SetDashStyle(static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(aLineDash.Style))); aXDash.SetDots(aLineDash.Dots); aXDash.SetDotLen(aLineDash.DotLen); aXDash.SetDashes(aLineDash.Dashes); diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx index a3d0a4cbe479..9261a71bb830 100644 --- a/svx/source/unodraw/unopool.cxx +++ b/svx/source/unodraw/unopool.cxx @@ -171,7 +171,7 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEn if(!(aValue >>= nMode)) throw lang::IllegalArgumentException(); - eMode = (drawing::BitmapMode)nMode; + eMode = static_cast<drawing::BitmapMode>(nMode); } pPool->SetPoolDefaultItem( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) ); diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 35a07a496348..b8500ac7643b 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -670,7 +670,7 @@ namespace {style::ParagraphAdjust_RIGHT, sal_Int16(awt::TextAlign::RIGHT)}, {style::ParagraphAdjust_BLOCK, sal_Int16(awt::TextAlign::RIGHT)}, {style::ParagraphAdjust_STRETCH, sal_Int16(awt::TextAlign::LEFT)}, - {(style::ParagraphAdjust)-1,-1} + {style::ParagraphAdjust(-1),-1} }; void lcl_convertTextAlignmentToParaAdjustment( Any& _rValue ) @@ -681,7 +681,7 @@ namespace for ( auto const & rEntry : aMapAdjustToAlign ) if ( nValue == rEntry.nFormValue ) { - _rValue <<= (sal_uInt16)rEntry.nAPIValue; + _rValue <<= static_cast<sal_uInt16>(rEntry.nAPIValue); return; } } @@ -692,7 +692,7 @@ namespace OSL_VERIFY( _rValue >>= nValue ); for ( auto const & rEntry : aMapAdjustToAlign ) - if ( (style::ParagraphAdjust)nValue == rEntry.nAPIValue ) + if ( static_cast<style::ParagraphAdjust>(nValue) == rEntry.nAPIValue ) { _rValue <<= rEntry.nFormValue; return; @@ -751,7 +751,7 @@ void SAL_CALL SvxShapeControl::setPropertyValue( const OUString& aPropertyName, awt::FontSlant nSlant; if( !(aValue >>= nSlant ) ) throw lang::IllegalArgumentException(); - aConvertedValue <<= (sal_Int16)nSlant; + aConvertedValue <<= static_cast<sal_Int16>(nSlant); } else if ( aFormsName == "Align" ) { @@ -792,7 +792,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyValue( const OUString& aPropertyNa sal_Int16 nSlant = sal_Int16(); if ( aValue >>= nSlant ) { - eSlant = (awt::FontSlant)nSlant; + eSlant = static_cast<awt::FontSlant>(nSlant); } else { @@ -883,7 +883,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const OUString& aProperty { sal_Int16 nSlant( 0 ); aDefault >>= nSlant; - aDefault <<= (awt::FontSlant)nSlant; + aDefault <<= static_cast<awt::FontSlant>(nSlant); } else if ( aFormsName == "Align" ) { diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index c1b9c4cbc52a..14cc1a0f108f 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2281,7 +2281,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl if(!(rValue >>= nMode)) break; - eMode = (drawing::BitmapMode)nMode; + eMode = static_cast<drawing::BitmapMode>(nMode); } mpObj->SetMergedItem( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) ); mpObj->SetMergedItem( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) ); diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 452f8b3fb5f4..8ec5a260e289 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -366,7 +366,7 @@ bool XLineStyleItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId* sal_Int32 nLS = 0; if(!(rVal >>= nLS)) return false; - eLS = (css::drawing::LineStyle)nLS; + eLS = static_cast<css::drawing::LineStyle>(nLS); } SetValue( eLS ); @@ -615,7 +615,7 @@ bool XLineDashItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const css::drawing::LineDash aLineDash; const XDash& rXD = GetDashValue(); - aLineDash.Style = (css::drawing::DashStyle)((sal_uInt16)rXD.GetDashStyle()); + aLineDash.Style = static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(rXD.GetDashStyle())); aLineDash.Dots = rXD.GetDots(); aLineDash.DotLen = rXD.GetDotLen(); aLineDash.Dashes = rXD.GetDashes(); @@ -642,7 +642,7 @@ bool XLineDashItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const css::drawing::LineDash aLineDash; - aLineDash.Style = (css::drawing::DashStyle)((sal_uInt16)rXD.GetDashStyle()); + aLineDash.Style = static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(rXD.GetDashStyle())); aLineDash.Dots = rXD.GetDots(); aLineDash.DotLen = rXD.GetDotLen(); aLineDash.Dashes = rXD.GetDashes(); @@ -656,7 +656,7 @@ bool XLineDashItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const case MID_LINEDASH_STYLE: { const XDash& rXD = GetDashValue(); - rVal <<= (css::drawing::DashStyle)((sal_Int16)rXD.GetDashStyle()); + rVal <<= static_cast<css::drawing::DashStyle>(static_cast<sal_Int16>(rXD.GetDashStyle())); break; } @@ -732,7 +732,7 @@ bool XLineDashItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) { XDash aXDash; - aXDash.SetDashStyle((css::drawing::DashStyle)((sal_uInt16)(aLineDash.Style))); + aXDash.SetDashStyle(static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(aLineDash.Style))); aXDash.SetDots(aLineDash.Dots); aXDash.SetDotLen(aLineDash.DotLen); aXDash.SetDashes(aLineDash.Dashes); @@ -768,7 +768,7 @@ bool XLineDashItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) XDash aXDash; - aXDash.SetDashStyle((css::drawing::DashStyle)((sal_uInt16)(aLineDash.Style))); + aXDash.SetDashStyle(static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(aLineDash.Style))); aXDash.SetDots(aLineDash.Dots); aXDash.SetDotLen(aLineDash.DotLen); aXDash.SetDashes(aLineDash.Dashes); @@ -789,7 +789,7 @@ bool XLineDashItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) return false; XDash aXDash = GetDashValue(); - aXDash.SetDashStyle((css::drawing::DashStyle)static_cast<sal_uInt16>(nVal)); + aXDash.SetDashStyle(static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(nVal))); if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes())) aXDash.SetDots(1); @@ -1814,7 +1814,7 @@ bool XFillStyleItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId* sal_Int32 nFS = 0; if(!(rVal >>= nFS)) return false; - eFS = (css::drawing::FillStyle)nFS; + eFS = static_cast<css::drawing::FillStyle>(nFS); } SetValue( eFS ); @@ -1826,7 +1826,7 @@ void XFillStyleItem::dumpAsXml(xmlTextWriterPtr pWriter) const { xmlTextWriterStartElement(pWriter, BAD_CAST("XFillStyleItem")); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number((sal_Int16)GetValue()).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(static_cast<sal_Int16>(GetValue())).getStr())); OUString aPresentation; IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag()); @@ -2090,7 +2090,7 @@ bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) c break; } - case MID_GRADIENT_STYLE: rVal <<= (sal_Int16)GetGradientValue().GetGradientStyle(); break; + case MID_GRADIENT_STYLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetGradientStyle()); break; case MID_GRADIENT_STARTCOLOR: rVal <<= static_cast<sal_Int32>(GetGradientValue().GetStartColor().GetColor()); break; case MID_GRADIENT_ENDCOLOR: rVal <<= static_cast<sal_Int32>(GetGradientValue().GetEndColor().GetColor()); break; case MID_GRADIENT_ANGLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetAngle()); break; @@ -2225,7 +2225,7 @@ bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId switch ( nMemberId ) { case MID_GRADIENT_STYLE: - aXGradient.SetGradientStyle( (css::awt::GradientStyle)nVal ); break; + aXGradient.SetGradientStyle( static_cast<css::awt::GradientStyle>(nVal) ); break; case MID_GRADIENT_ANGLE: aXGradient.SetAngle( nVal ); break; case MID_GRADIENT_BORDER: @@ -2575,7 +2575,7 @@ bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nVal = sal_Int16(); if (!(rVal >>= nVal )) return false; - aHatch.SetHatchStyle( (css::drawing::HatchStyle)nVal ); + aHatch.SetHatchStyle( static_cast<css::drawing::HatchStyle>(nVal) ); break; } @@ -2646,7 +2646,7 @@ sal_uInt16 XFormTextStyleItem::GetValueCount() const bool XFormTextStyleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (sal_Int32)GetValue(); + rVal <<= static_cast<sal_Int32>(GetValue()); return true; } @@ -2654,7 +2654,7 @@ bool XFormTextStyleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ { sal_Int32 nValue = 0; rVal >>= nValue; - SetValue((XFormTextStyle)nValue); + SetValue(static_cast<XFormTextStyle>(nValue)); return true; } @@ -2679,7 +2679,7 @@ sal_uInt16 XFormTextAdjustItem::GetValueCount() const bool XFormTextAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (sal_Int32)GetValue(); + rVal <<= static_cast<sal_Int32>(GetValue()); return true; } @@ -2687,7 +2687,7 @@ bool XFormTextAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId* { sal_Int32 nValue = 0; rVal >>= nValue; - SetValue((XFormTextAdjust)nValue); + SetValue(static_cast<XFormTextAdjust>(nValue)); return true; } @@ -2763,7 +2763,7 @@ sal_uInt16 XFormTextShadowItem::GetValueCount() const bool XFormTextShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - rVal <<= (sal_Int32)GetValue(); + rVal <<= static_cast<sal_Int32>(GetValue()); return true; } @@ -2771,7 +2771,7 @@ bool XFormTextShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId* { sal_Int32 nValue = 0; rVal >>= nValue; - SetValue((XFormTextShadow)nValue); + SetValue(static_cast<XFormTextShadow>(nValue)); return true; } diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx index 86b1188e7be9..0dd56a73f7fc 100644 --- a/svx/source/xoutdev/xattr2.cxx +++ b/svx/source/xoutdev/xattr2.cxx @@ -144,7 +144,7 @@ bool XLineJointItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId* sal_Int32 nLJ = 0; if(!(rVal >>= nLJ)) return false; - eUnoJoint = (css::drawing::LineJoint)nLJ; + eUnoJoint = static_cast<css::drawing::LineJoint>(nLJ); } SetValue( eUnoJoint ); @@ -298,7 +298,7 @@ bool XLineCapItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) return false; } - eUnoCap = (css::drawing::LineCap)nLJ; + eUnoCap = static_cast<css::drawing::LineCap>(nLJ); } OSL_ENSURE(css::drawing::LineCap_BUTT == eUnoCap @@ -470,7 +470,7 @@ void XFillBmpPosItem::dumpAsXml(xmlTextWriterPtr pWriter) const { xmlTextWriterStartElement(pWriter, BAD_CAST("XFillBmpPosItem")); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number((int)GetValue()).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(static_cast<int>(GetValue())).getStr())); xmlTextWriterEndElement(pWriter); } |