diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:03:36 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:03:36 +0100 |
commit | e1bdc38a0b8861281f4111fa78b39f76be6e14e7 (patch) | |
tree | ee847ac020c48c91148072603dd1706bb719fd83 /sd | |
parent | 5cd41952cdb1c3c14cd48858d382d8bd95f602ff (diff) |
More loplugin:cstylecast: sd
Change-Id: I77ed2793aad62377ec6fc2513e06e2371c1c77ad
Diffstat (limited to 'sd')
43 files changed, 156 insertions, 161 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index a31ff8d350e7..c75824a4fab2 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -516,12 +516,12 @@ void SdOOXMLExportTest1::testTableCellFillProperties() drawing::FillStyle aFillStyle( drawing::FillStyle_NONE ); xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); xCell->getPropertyValue("FillStyle") >>= aFillStyle; - CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_BITMAP, (int)aFillStyle); + CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_BITMAP), static_cast<int>(aFillStyle)); // Test Gradient fill type for cell xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW); xCell->getPropertyValue("FillStyle") >>= aFillStyle; - CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, (int)aFillStyle); + CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_GRADIENT), static_cast<int>(aFillStyle)); xDocShRef->DoClose(); } @@ -552,7 +552,7 @@ void SdOOXMLExportTest1::testLineStyle() const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>( pShape->GetMergedItem(XATTR_LINESTYLE)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style", (int)drawing::LineStyle_SOLID, (int)rStyleItem.GetValue()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong style", int(drawing::LineStyle_SOLID), static_cast<int>(rStyleItem.GetValue())); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 2c499bf77528..3561647221b2 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -821,12 +821,12 @@ void SdOOXMLExportTest2::testTdf105739() // Test fill type drawing::FillStyle aFillStyle(drawing::FillStyle_NONE); aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle; - CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, (int)aFillStyle); + CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_GRADIENT), static_cast<int>(aFillStyle)); // Test gradient properties com::sun::star::awt::Gradient aFillGradient; aXBackgroundPropSet->getPropertyValue("FillGradient") >>= aFillGradient; - CPPUNIT_ASSERT_EQUAL((int)awt::GradientStyle_LINEAR, (int)aFillGradient.Style); + CPPUNIT_ASSERT_EQUAL(int(awt::GradientStyle_LINEAR), static_cast<int>(aFillGradient.Style)); CPPUNIT_ASSERT_EQUAL(util::Color(0xff0000), aFillGradient.StartColor); CPPUNIT_ASSERT_EQUAL(util::Color(0x00b050), aFillGradient.EndColor); } diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx index bdd7a3f7ac8f..0fccc43cbce8 100644 --- a/sd/qa/unit/misc-tests.cxx +++ b/sd/qa/unit/misc-tests.cxx @@ -222,7 +222,7 @@ void SdMiscTest::testTdf99396TextEdit() uno::Reference<table::XTable> xTable = pTableObject->getTable(); uno::Reference<beans::XPropertySet> xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY); drawing::TextVerticalAdjust eAdjust = xCell->getPropertyValue("TextVerticalAdjust").get<drawing::TextVerticalAdjust>(); - CPPUNIT_ASSERT_EQUAL((int)drawing::TextVerticalAdjust_BOTTOM, (int)eAdjust); + CPPUNIT_ASSERT_EQUAL(int(drawing::TextVerticalAdjust_BOTTOM), static_cast<int>(eAdjust)); } { const EditTextObject& rEdit = pTableObject->getText(0)->GetOutlinerParaObject()->GetTextObject(); @@ -240,7 +240,7 @@ void SdMiscTest::testTdf99396TextEdit() uno::Reference<beans::XPropertySet> xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY); drawing::TextVerticalAdjust eAdjust = xCell->getPropertyValue("TextVerticalAdjust").get<drawing::TextVerticalAdjust>(); // This failed: Undo() did not change it from drawing::TextVerticalAdjust_BOTTOM. - CPPUNIT_ASSERT_EQUAL((int)drawing::TextVerticalAdjust_TOP, (int)eAdjust); + CPPUNIT_ASSERT_EQUAL(int(drawing::TextVerticalAdjust_TOP), static_cast<int>(eAdjust)); } { const EditTextObject& rEdit = pTableObject->getText(0)->GetOutlinerParaObject()->GetTextObject(); @@ -292,7 +292,7 @@ void SdMiscTest::testFillGradient() drawing::FillStyle eFillStyle; awt::Gradient aGradient2; CPPUNIT_ASSERT(xPropSet2->getPropertyValue("FillStyle") >>= eFillStyle); - CPPUNIT_ASSERT_EQUAL((int)drawing::FillStyle_GRADIENT, (int)eFillStyle); + CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_GRADIENT), static_cast<int>(eFillStyle)); CPPUNIT_ASSERT(xPropSet2->getPropertyValue("FillGradient") >>= aGradient2); CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(255, 0, 0)),aGradient2.StartColor); CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(0, 255, 0)),aGradient2.EndColor); diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index ab47522c19f3..93c76ffaa037 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -465,7 +465,7 @@ void SdTiledRenderingTest::testSetGraphicSelection() CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(8), pObject->GetHdlCount()); // Take the bottom center one. SdrHdl* pHdl = pObject->GetHdl(6); - CPPUNIT_ASSERT_EQUAL((int)SdrHdlKind::Lower, (int)pHdl->GetKind()); + CPPUNIT_ASSERT_EQUAL(int(SdrHdlKind::Lower), static_cast<int>(pHdl->GetKind())); ::tools::Rectangle aShapeBefore = pObject->GetSnapRect(); // Resize. pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY())); diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index e2ba0daef116..80b02412d092 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -175,9 +175,9 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) // Allow UI scale only for draw documents. if( eType == DocumentType::Draw ) - SetUIUnit( (FieldUnit)pOptions->GetMetric(), Fraction( nX, nY ) ); // user-defined + SetUIUnit( static_cast<FieldUnit>(pOptions->GetMetric()), Fraction( nX, nY ) ); // user-defined else - SetUIUnit( (FieldUnit)pOptions->GetMetric(), Fraction( 1, 1 ) ); // default + SetUIUnit( static_cast<FieldUnit>(pOptions->GetMetric()), Fraction( 1, 1 ) ); // default SetScaleUnit(MapUnit::Map100thMM); SetScaleFraction(Fraction(1, 1)); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 8d20e7a1692e..1016ceb96fa6 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1932,7 +1932,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN if (mbScaleObjects) { - SdrObjKind eObjKind = (SdrObjKind) pObj->GetObjIdentifier(); + SdrObjKind eObjKind = static_cast<SdrObjKind>(pObj->GetObjIdentifier()); if (bIsPresObjOnMaster) { diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 62acfef7eace..81938bc66ecf 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -245,7 +245,7 @@ void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_ { css::presentation::AnimationSpeed aAs; aAny >>= aAs; - nSpeed = (sal_uInt8)aAs; + nSpeed = static_cast<sal_uInt8>(aAs); } sal_Int16 nTT = 0; if ( GetPropertyValue( aAny, mXPagePropSet, "TransitionType" ) @@ -615,8 +615,8 @@ void PPTWriter::ImplCreateHeaderFooters( css::uno::Reference< css::beans::XPrope if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, "DateTimeFormat", true ) ) { sal_Int32 nFormat = *o3tl::doAccess<sal_Int32>(aAny); - SvxDateFormat eDateFormat = (SvxDateFormat)( nFormat & 0xf ); - SvxTimeFormat eTimeFormat = (SvxTimeFormat)( ( nFormat >> 4 ) & 0xf ); + SvxDateFormat eDateFormat = static_cast<SvxDateFormat>( nFormat & 0xf ); + SvxTimeFormat eTimeFormat = static_cast<SvxTimeFormat>( ( nFormat >> 4 ) & 0xf ); switch( eDateFormat ) { case SvxDateFormat::F : diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 0fc8507f658c..6b0c8fc5d0d5 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1322,7 +1322,7 @@ void PowerPointExport::WriteAnimationCondition(const FSHelperPtr& pFS, Any const { if (eTiming == Timing_INDEFINITE) pDelay = "indefinite"; - SAL_INFO("sd.eppt", "event offset timing: " << (int)eTiming); + SAL_INFO("sd.eppt", "event offset timing: " << static_cast<int>(eTiming)); } } else if (rAny >>= xShape) diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index cda37dff9ea2..ba9097d5bf39 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -822,7 +822,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1 { OUString aPropName( pPropValue[ i ].Name ); if ( aPropName == "NumberingType" ) - nNumberingType = (SvxNumType)*o3tl::doAccess<sal_Int16>(pPropValue[i].Value); + nNumberingType = static_cast<SvxNumType>(*o3tl::doAccess<sal_Int16>(pPropValue[i].Value)); else if ( aPropName == "Adjust" ) nHorzAdjust = *o3tl::doAccess<sal_Int16>(pPropValue[i].Value); else if ( aPropName == "BulletChar" ) @@ -1124,10 +1124,10 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bG if ( ImplGetPropertyValue( "ParaTabStops", bGetPropStateValue ) ) maTabStop = *o3tl::doAccess<css::uno::Sequence<css::style::TabStop>>(mAny); - sal_Int16 eTextAdjust = (sal_Int16)css::style::ParagraphAdjust_LEFT; + sal_Int16 eTextAdjust = sal_Int16(css::style::ParagraphAdjust_LEFT); if ( GetPropertyValue( aAny, mXPropSet, "ParaAdjust", bGetPropStateValue ) ) aAny >>= eTextAdjust; - switch ( (css::style::ParagraphAdjust)eTextAdjust ) + switch ( static_cast<css::style::ParagraphAdjust>(eTextAdjust) ) { case css::style::ParagraphAdjust_CENTER : mnTextAdjust = 1; diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index dbc632cd9ede..31cde572bdbe 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -417,7 +417,7 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams { sal_Int32 temp = 0; pParams->Value >>= temp; - meMode = (HtmlPublishMode)temp; + meMode = static_cast<HtmlPublishMode>(temp); } else if ( pParams->Name == "IndexURL" ) { @@ -428,7 +428,7 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams { sal_Int32 temp = 0; pParams->Value >>= temp; - meFormat = (PublishingFormat)temp; + meFormat = static_cast<PublishingFormat>(temp); } else if ( pParams->Name == "Compression" ) { diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index d65844384cf0..db3919fc527f 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -240,14 +240,14 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) rDesign.m_aDesignName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rIn.ReadUInt16( nTemp16 ); - rDesign.m_eMode = (HtmlPublishMode)nTemp16; + rDesign.m_eMode = static_cast<HtmlPublishMode>(nTemp16); rIn.ReadCharAsBool( rDesign.m_bContentPage ); rIn.ReadCharAsBool( rDesign.m_bNotes ); rIn.ReadUInt16( rDesign.m_nResolution ); rDesign.m_aCompression = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rIn.ReadUInt16( nTemp16 ); - rDesign.m_eFormat = (PublishingFormat)nTemp16; + rDesign.m_eFormat = static_cast<PublishingFormat>(nTemp16); rDesign.m_aAuthor = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rDesign.m_aEMail = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, @@ -269,7 +269,7 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) rIn.ReadCharAsBool( rDesign.m_bUseColor ); rIn.ReadUInt16( nTemp16 ); - rDesign.m_eScript = (PublishingScript)nTemp16; + rDesign.m_eScript = static_cast<PublishingScript>(nTemp16); rDesign.m_aURL = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rDesign.m_aCGI = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 2a155733d71f..7bdede6cd75a 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -124,7 +124,7 @@ void SdModule::Execute(SfxRequest& rReq) const SfxPoolItem* pItem; if ( pSet && SfxItemState::SET == pSet->GetItemState( SID_ATTR_METRIC, true, &pItem ) ) { - FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem)->GetValue(); + FieldUnit eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); switch( eUnit ) { case FUNIT_MM: // only the units which are also in the dialog diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 395ca9eb7eaa..9c514395387a 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -480,13 +480,13 @@ std::unique_ptr<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot ) nDefTab = pOptions->GetDefTab(); pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, nDefTab ) ); - FieldUnit nMetric = (FieldUnit)0xffff; + FieldUnit nMetric = FieldUnit(0xffff); if( pFrameView) nMetric = pDoc->GetUIUnit(); else - nMetric = (FieldUnit)pOptions->GetMetric(); + nMetric = static_cast<FieldUnit>(pOptions->GetMetric()); - if( nMetric == (FieldUnit)0xffff ) + if( nMetric == FieldUnit(0xffff) ) nMetric = GetFieldUnit(); pRet->Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast<sal_uInt16>(nMetric) ) ); @@ -719,7 +719,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) // Only if also the document type matches... if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) { - FieldUnit eUIUnit = (FieldUnit) pOptions->GetMetric(); + FieldUnit eUIUnit = static_cast<FieldUnit>(pOptions->GetMetric()); pDoc->SetUIUnit(eUIUnit); if (pViewShell) diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index f5c77ab55d5a..08a1c06db958 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -85,7 +85,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) aDateField.SetFormat( SvxDateFormat::F ); // Dienstag, 13.Februar 1996 InsertItem( nID++, aDateField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle ); - CheckItem( (sal_uInt16) ( pDateField->GetFormat() ) + 1 ); // - 2 + 3 ! + CheckItem( static_cast<sal_uInt16>( pDateField->GetFormat() ) + 1 ); // - 2 + 3 ! } else if( dynamic_cast< const SvxExtTimeField *>( pField ) != nullptr ) { @@ -119,7 +119,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) //SvxTimeFormat::HH12_MM_SS_AMPM, // 01:49:38 PM //SvxTimeFormat::HH12_MM_SS_00_AMPM // 01:49:38.78 PM - CheckItem( (sal_uInt16) ( pTimeField->GetFormat() ) + 1 ); // - 2 + 3 ! + CheckItem( static_cast<sal_uInt16>( pTimeField->GetFormat() ) + 1 ); // - 2 + 3 ! } else if( dynamic_cast< const SvxExtFileField *>( pField ) != nullptr ) { @@ -136,7 +136,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) InsertItem( nID++, SdResId( STR_FILEFORMAT_PATH ), nStyle ); InsertItem( nID++, SdResId( STR_FILEFORMAT_NAME ), nStyle ); - CheckItem( (sal_uInt16) ( pFileField->GetFormat() ) + 3 ); + CheckItem( static_cast<sal_uInt16>( pFileField->GetFormat() ) + 3 ); } else if( dynamic_cast< const SvxAuthorField *>( pField ) != nullptr ) { @@ -150,10 +150,10 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) for( sal_uInt16 i = 0; i < 4; i++ ) { - aAuthorField.SetFormat( (SvxAuthorFormat) i ); + aAuthorField.SetFormat( static_cast<SvxAuthorFormat>(i) ); InsertItem( nID++, aAuthorField.GetFormatted(), nStyle ); } - CheckItem( (sal_uInt16) ( pAuthorField->GetFormat() ) + 3 ); + CheckItem( static_cast<sal_uInt16>( pAuthorField->GetFormat() ) + 3 ); } } @@ -183,7 +183,7 @@ SvxFieldData* SdFieldPopup::GetField() if( IsItemChecked( i ) ) break; } - eFormat = (SvxDateFormat) ( i - 1 ); + eFormat = static_cast<SvxDateFormat>( i - 1 ); if( pDateField->GetFormat() != eFormat || pDateField->GetType() != eType ) @@ -216,7 +216,7 @@ SvxFieldData* SdFieldPopup::GetField() if( IsItemChecked( i ) ) break; } - eFormat = (SvxTimeFormat) ( i - 1 ); + eFormat = static_cast<SvxTimeFormat>( i - 1 ); if( pTimeField->GetFormat() != eFormat || pTimeField->GetType() != eType ) @@ -250,7 +250,7 @@ SvxFieldData* SdFieldPopup::GetField() if( IsItemChecked( i ) ) break; } - eFormat = (SvxFileFormat) ( i - 3 ); + eFormat = static_cast<SvxFileFormat>( i - 3 ); if( pFileField->GetFormat() != eFormat || pFileField->GetType() != eType ) @@ -289,7 +289,7 @@ SvxFieldData* SdFieldPopup::GetField() if( IsItemChecked( i ) ) break; } - eFormat = (SvxAuthorFormat) ( i - 3 ); + eFormat = static_cast<SvxAuthorFormat>( i - 3 ); if( pAuthorField->GetFormat() != eFormat || pAuthorField->GetType() != eType ) diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 443b8cc44408..7fa8374a8ba2 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -894,7 +894,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) const Point aWindowCenter( pOutWin->PixelToLogic( Point( aTemp.Width() >> 1, aTemp.Height() >> 1 ) ) ); const OutputDevice* pDefDev = Application::GetDefaultDevice(); const size_t nCount = m_FrameList.size(); - BitmapAdjustment eBA = (BitmapAdjustment) m_pLbAdjustment->GetSelectedEntryPos(); + BitmapAdjustment eBA = static_cast<BitmapAdjustment>(m_pLbAdjustment->GetSelectedEntryPos()); // find biggest bitmap for (size_t i = 0; i < nCount; ++i) diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index dd07c3e6a3da..dcb9799c3283 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -91,7 +91,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() else eType = SvxDateType::Var; - eFormat = (SvxDateFormat) ( m_pLbFormat->GetSelectedEntryPos() + 2 ); + eFormat = static_cast<SvxDateFormat>( m_pLbFormat->GetSelectedEntryPos() + 2 ); pNewField = new SvxDateField( *pDateField ); static_cast<SvxDateField*>( pNewField )->SetType( eType ); @@ -108,7 +108,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() else eType = SvxTimeType::Var; - eFormat = (SvxTimeFormat) ( m_pLbFormat->GetSelectedEntryPos() + 2 ); + eFormat = static_cast<SvxTimeFormat>( m_pLbFormat->GetSelectedEntryPos() + 2 ); pNewField = new SvxExtTimeField( *pTimeField ); static_cast<SvxExtTimeField*>( pNewField )->SetType( eType ); @@ -125,7 +125,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() else eType = SvxFileType::Var; - eFormat = (SvxFileFormat) ( m_pLbFormat->GetSelectedEntryPos() ); + eFormat = static_cast<SvxFileFormat>( m_pLbFormat->GetSelectedEntryPos() ); ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() ); @@ -153,7 +153,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() else eType = SvxAuthorType::Var; - eFormat = (SvxAuthorFormat) ( m_pLbFormat->GetSelectedEntryPos() ); + eFormat = static_cast<SvxAuthorFormat>( m_pLbFormat->GetSelectedEntryPos() ); // Get current state of address, not the old one SvtUserOptions aUserOptions; @@ -236,7 +236,7 @@ void SdModifyFieldDlg::FillFormatList() m_pLbFormat->InsertEntry( SdResId( STR_FILEFORMAT_PATH ) ); m_pLbFormat->InsertEntry( SdResId( STR_FILEFORMAT_NAME ) ); - m_pLbFormat->SelectEntryPos( (sal_uInt16) ( pFileField->GetFormat() ) ); + m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>( pFileField->GetFormat() ) ); } else if( dynamic_cast< const SvxAuthorField *>( pField ) != nullptr ) { @@ -245,11 +245,11 @@ void SdModifyFieldDlg::FillFormatList() for( sal_uInt16 i = 0; i < 4; i++ ) { - aAuthorField.SetFormat( (SvxAuthorFormat) i ); + aAuthorField.SetFormat( static_cast<SvxAuthorFormat>(i) ); m_pLbFormat->InsertEntry( aAuthorField.GetFormatted() ); } - m_pLbFormat->SelectEntryPos( (sal_uInt16) ( pAuthorField->GetFormat() ) ); + m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>( pAuthorField->GetFormat() ) ); } diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index f302b77028ee..3ffbe5942ed9 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -258,7 +258,7 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox, void ) for (sal_uInt16 nID = NAVIGATOR_DRAGTYPE_URL; nID < NAVIGATOR_DRAGTYPE_COUNT; ++nID) { - const char* pRId = GetDragTypeSdStrId((NavigatorDragType)nID); + const char* pRId = GetDragTypeSdStrId(static_cast<NavigatorDragType>(nID)); if (pRId) { DBG_ASSERT(aHIDs[nID-NAVIGATOR_DRAGTYPE_URL],"HelpId not added!"); @@ -399,7 +399,7 @@ IMPL_LINK( SdNavigatorWin, MenuSelectHdl, Menu *, pMenu, bool ) if( nMenuId != USHRT_MAX ) // Necessary ? { - NavigatorDragType eDT = (NavigatorDragType) nMenuId; + NavigatorDragType eDT = static_cast<NavigatorDragType>(nMenuId); if( meDragType != eDT ) { meDragType = eDT; @@ -753,7 +753,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, if( eState >= SfxItemState::DEFAULT && nSId == SID_NAVIGATOR_STATE ) { const SfxUInt32Item& rStateItem = dynamic_cast<const SfxUInt32Item&>(*pItem); - NavState nState = (NavState)rStateItem.GetValue(); + NavState nState = static_cast<NavState>(rStateItem.GetValue()); // only if doc in LB is the active NavDocInfo* pInfo = pNavigatorWin->GetDocInfo(); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index eb749cf5bf6e..4b7f5630c3cc 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -282,7 +282,7 @@ bool SdTPAction::FillItemSet( SfxItemSet* rAttrs ) if( m_pLbAction->IsValueChangedFromSaved() ) { - rAttrs->Put( SfxAllEnumItem( ATTR_ACTION, (sal_uInt16)eCA ) ); + rAttrs->Put( SfxAllEnumItem( ATTR_ACTION, static_cast<sal_uInt16>(eCA) ) ); bModified = true; } else @@ -323,8 +323,8 @@ void SdTPAction::Reset( const SfxItemSet* rAttrs ) // m_pLbAction if( rAttrs->GetItemState( ATTR_ACTION ) != SfxItemState::DONTCARE ) { - eCA = (presentation::ClickAction) static_cast<const SfxAllEnumItem&>( rAttrs-> - Get( ATTR_ACTION ) ).GetValue(); + eCA = static_cast<presentation::ClickAction>(static_cast<const SfxAllEnumItem&>( rAttrs-> + Get( ATTR_ACTION ) ).GetValue()); SetActualClickAction( eCA ); } else diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 47bc6c5b5734..26bd177b8df4 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -227,7 +227,7 @@ SdTpOptionsMisc::SdTpOptionsMisc(vcl::Window* pParent, const SfxItemSet& rInAttr if ( rInAttrs.GetItemState( nWhich ) >= SfxItemState::DEFAULT ) { const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rInAttrs.Get( nWhich )); - eFUnit = (FieldUnit)rItem.GetValue(); + eFUnit = static_cast<FieldUnit>(rItem.GetValue()); } else eFUnit = SfxModule::GetCurrentFieldUnit(); @@ -327,7 +327,7 @@ void SdTpOptionsMisc::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 != m_pMtrFldOriginalWidth->GetUnit() ) { @@ -534,7 +534,7 @@ IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl, ListBox&, void) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - FieldUnit eUnit = (FieldUnit)reinterpret_cast<sal_IntPtr>(m_pLbMetric->GetEntryData( nPos )); + FieldUnit eUnit = static_cast<FieldUnit>(reinterpret_cast<sal_IntPtr>(m_pLbMetric->GetEntryData( nPos ))); sal_Int64 nVal = m_pMtrFldTabstop->Denormalize( m_pMtrFldTabstop->GetValue( FUNIT_TWIP ) ); SetFieldUnit( *m_pMtrFldTabstop, eUnit ); diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index a1202e98159c..7d6aca665a37 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -91,7 +91,7 @@ void FuConstructArc::DoExecute( SfxRequest& rReq ) Activate(); // sets aObjKind SdrCircObj* pNewCircle = - new SdrCircObj((SdrObjKind) mpView->GetCurrentObjIdentifier(), + new SdrCircObj(static_cast<SdrObjKind>(mpView->GetCurrentObjIdentifier()), aNewRectangle, static_cast<long>(pPhiStart->GetValue () * 10.0), static_cast<long>(pPhiEnd->GetValue () * 10.0)); diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx index 9a07fa2a3348..935cb0c50157 100644 --- a/sd/source/ui/func/fuconuno.cxx +++ b/sd/source/ui/func/fuconuno.cxx @@ -70,7 +70,7 @@ void FuConstructUnoControl::DoExecute( SfxRequest& rReq ) const SfxUInt32Item* pInventorItem = rReq.GetArg<SfxUInt32Item>(SID_FM_CONTROL_INVENTOR); const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER); if( pInventorItem ) - nInventor = (SdrInventor)pInventorItem->GetValue(); + nInventor = static_cast<SdrInventor>(pInventorItem->GetValue()); if( pIdentifierItem ) nIdentifier = pIdentifierItem->GetValue(); diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index f3b61cba846c..900fe8b7c1d1 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -288,8 +288,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) { SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj(); SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj(); - SdrObjKind eKind1 = (SdrObjKind)pObject1->GetObjIdentifier(); - SdrObjKind eKind2 = (SdrObjKind)pObject2->GetObjIdentifier(); + SdrObjKind eKind1 = static_cast<SdrObjKind>(pObject1->GetObjIdentifier()); + SdrObjKind eKind2 = static_cast<SdrObjKind>(pObject2->GetObjIdentifier()); SdAnimationInfo* pInfo1 = SdDrawDocument::GetAnimationInfo(pObject1); SdAnimationInfo* pInfo2 = SdDrawDocument::GetAnimationInfo(pObject2); pInfo = nullptr; @@ -349,21 +349,21 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, false)); if (nEffectSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, (sal_uInt16)eEffect)); + aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, static_cast<sal_uInt16>(eEffect))); else if (nEffectSet == ATTR_MIXED) aSet.InvalidateItem( ATTR_ANIMATION_EFFECT ); else - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, (sal_uInt16)presentation::AnimationEffect_NONE)); + aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); if (nTextEffectSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, (sal_uInt16)eTextEffect)); + aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, static_cast<sal_uInt16>(eTextEffect))); else if (nTextEffectSet == ATTR_MIXED) aSet.InvalidateItem( ATTR_ANIMATION_TEXTEFFECT ); else - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, (sal_uInt16)presentation::AnimationEffect_NONE)); + aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); if (nSpeedSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_SPEED, (sal_uInt16)eSpeed)); + aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_SPEED, static_cast<sal_uInt16>(eSpeed))); else aSet.InvalidateItem(ATTR_ANIMATION_SPEED); @@ -408,11 +408,11 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, false)); if (nClickActionSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ACTION, (sal_uInt16)eClickAction)); + aSet.Put(SfxAllEnumItem(ATTR_ACTION, static_cast<sal_uInt16>(eClickAction))); else if (nClickActionSet == ATTR_MIXED) aSet.InvalidateItem(ATTR_ACTION); else - aSet.Put(SfxAllEnumItem(ATTR_ACTION, (sal_uInt16)presentation::ClickAction_NONE)); + aSet.Put(SfxAllEnumItem(ATTR_ACTION, sal_uInt16(presentation::ClickAction_NONE))); if (nBookmarkSet == ATTR_SET) aSet.Put(SfxStringItem(ATTR_ACTION_FILENAME, aBookmark)); @@ -420,14 +420,14 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) aSet.InvalidateItem(ATTR_ACTION_FILENAME); if (nSecondEffectSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, (sal_uInt16)eSecondEffect)); + aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, static_cast<sal_uInt16>(eSecondEffect))); else if (nSecondEffectSet == ATTR_MIXED) aSet.InvalidateItem( ATTR_ACTION_EFFECT ); else - aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, (sal_uInt16)presentation::AnimationEffect_NONE)); + aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); if (nSecondSpeedSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECTSPEED, (sal_uInt16)eSecondSpeed)); + aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECTSPEED, static_cast<sal_uInt16>(eSecondSpeed))); else aSet.InvalidateItem(ATTR_ACTION_EFFECTSPEED); @@ -471,8 +471,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_EFFECT) == SfxItemState::SET) { - eEffect = (presentation::AnimationEffect)static_cast<const SfxAllEnumItem&>( pArgs-> - Get(ATTR_ANIMATION_EFFECT)).GetValue(); + eEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxAllEnumItem&>( pArgs-> + Get(ATTR_ANIMATION_EFFECT)).GetValue()); nEffectSet = ATTR_SET; } else @@ -480,8 +480,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_TEXTEFFECT) == SfxItemState::SET) { - eTextEffect = (presentation::AnimationEffect)static_cast<const SfxAllEnumItem&>( pArgs-> - Get(ATTR_ANIMATION_TEXTEFFECT)).GetValue(); + eTextEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxAllEnumItem&>( pArgs-> + Get(ATTR_ANIMATION_TEXTEFFECT)).GetValue()); nTextEffectSet = ATTR_SET; } else @@ -489,8 +489,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_SPEED) == SfxItemState::SET) { - eSpeed = (presentation::AnimationSpeed)static_cast<const SfxAllEnumItem&>( pArgs-> - Get(ATTR_ANIMATION_SPEED)).GetValue(); + eSpeed = static_cast<presentation::AnimationSpeed>(static_cast<const SfxAllEnumItem&>( pArgs-> + Get(ATTR_ANIMATION_SPEED)).GetValue()); nSpeedSet = ATTR_SET; } else @@ -546,8 +546,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION) == SfxItemState::SET) { - eClickAction = (presentation::ClickAction)static_cast<const SfxAllEnumItem&>(pArgs-> - Get(ATTR_ACTION)).GetValue(); + eClickAction = static_cast<presentation::ClickAction>(static_cast<const SfxAllEnumItem&>(pArgs-> + Get(ATTR_ACTION)).GetValue()); nClickActionSet = ATTR_SET; } else @@ -564,8 +564,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_EFFECT) == SfxItemState::SET) { - eSecondEffect = (presentation::AnimationEffect)static_cast<const SfxAllEnumItem&>( pArgs-> - Get(ATTR_ACTION_EFFECT)).GetValue(); + eSecondEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxAllEnumItem&>( pArgs-> + Get(ATTR_ACTION_EFFECT)).GetValue()); nSecondEffectSet = ATTR_SET; } else @@ -573,8 +573,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_EFFECTSPEED) == SfxItemState::SET) { - eSecondSpeed = (presentation::AnimationSpeed)static_cast<const SfxAllEnumItem&>( pArgs-> - Get(ATTR_ACTION_EFFECTSPEED)).GetValue(); + eSecondSpeed = static_cast<presentation::AnimationSpeed>(static_cast<const SfxAllEnumItem&>( pArgs-> + Get(ATTR_ACTION_EFFECTSPEED)).GetValue()); nSecondSpeedSet = ATTR_SET; } else @@ -632,8 +632,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) DBG_ASSERT(nCount == 2, "This effect expects two selected objects"); SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj(); SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj(); - SdrObjKind eKind1 = (SdrObjKind)pObject1->GetObjIdentifier(); - SdrObjKind eKind2 = (SdrObjKind)pObject2->GetObjIdentifier(); + SdrObjKind eKind1 = static_cast<SdrObjKind>(pObject1->GetObjIdentifier()); + SdrObjKind eKind2 = static_cast<SdrObjKind>(pObject2->GetObjIdentifier()); SdrObject* pRunningObj = nullptr; if (pObject1->GetObjInventor() == SdrInventor::Default && diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index c0c268da2928..8f18c041790e 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -122,7 +122,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) } else { - ePO = (PresentationObjects) ( PO_OUTLINE_1 + nDepth - 1 ); + ePO = static_cast<PresentationObjects>( PO_OUTLINE_1 + nDepth - 1 ); aStyleName += STR_LAYOUT_OUTLINE " " + OUString::number(nDepth); } diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx index 10763d18ea7e..96e135e9299b 100644 --- a/sd/source/ui/func/fusnapln.cxx +++ b/sd/source/ui/func/fusnapln.cxx @@ -173,8 +173,8 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) pPV = mpView->GetSdrPageView(); - switch ( (SnapKind) static_cast<const SfxAllEnumItem&>( - pArgs->Get(ATTR_SNAPLINE_KIND)).GetValue() ) + switch ( static_cast<SnapKind>(static_cast<const SfxAllEnumItem&>( + pArgs->Get(ATTR_SNAPLINE_KIND)).GetValue()) ) { case SK_HORIZONTAL : eKind = SdrHelpLineKind::Horizontal; break; case SK_VERTICAL : eKind = SdrHelpLineKind::Vertical; break; diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index ad3298d5cafc..34b25bea7e16 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -103,11 +103,11 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) SfxStyleSheetBase* pStyleSheet = nullptr; const SfxPoolItem* pItem; - SfxStyleFamily nFamily = (SfxStyleFamily)USHRT_MAX; + SfxStyleFamily nFamily = SfxStyleFamily(USHRT_MAX); if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, false, &pItem )) { - nFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item &>( pArgs->Get( SID_STYLE_FAMILY ) ).GetValue(); + nFamily = static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item &>( pArgs->Get( SID_STYLE_FAMILY ) ).GetValue()); } else if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME, false, &pItem )) diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 190be7ff59dd..32b819bb6c09 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -306,7 +306,7 @@ void SlideBackground::HandleContextChange( void SlideBackground::Update() { - eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectedEntryPos(); + eFillStyle nPos = static_cast<eFillStyle>(mpFillStyle->GetSelectedEntryPos()); if(maContext == maImpressHandoutContext) nPos = NONE; @@ -939,7 +939,7 @@ void SlideBackground::NotifyItemUpdate( IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, ListBox&, void) { - const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectedEntryPos(); + const eFillStyle nPos = static_cast<eFillStyle>(mpFillStyle->GetSelectedEntryPos()); Update(); switch (nPos) @@ -1006,7 +1006,7 @@ IMPL_LINK_NOARG(SlideBackground, PaperSizeModifyHdl, ListBox&, void) IMPL_LINK_NOARG(SlideBackground, FillColorHdl, SvxColorListBox&, void) { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpFillStyle->GetSelectedEntryPos(); + const drawing::FillStyle eXFS = static_cast<drawing::FillStyle>(mpFillStyle->GetSelectedEntryPos()); switch(eXFS) { case drawing::FillStyle_SOLID: @@ -1034,7 +1034,7 @@ IMPL_LINK_NOARG(SlideBackground, FillColorHdl, SvxColorListBox&, void) IMPL_LINK_NOARG(SlideBackground, FillBackgroundHdl, ListBox&, void) { - const eFillStyle nFillPos = (eFillStyle)mpFillStyle->GetSelectedEntryPos(); + const eFillStyle nFillPos = static_cast<eFillStyle>(mpFillStyle->GetSelectedEntryPos()); SfxObjectShell* pSh = SfxObjectShell::Current(); switch(nFillPos) { diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 461e079f8304..36876957064e 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -343,7 +343,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) const SfxPoolItem& rItem ( rRequest.GetArgs()->Get(SID_STYLE_FAMILY)); pDocument->GetDocSh()->SetStyleFamily( - (SfxStyleFamily) static_cast<const SfxUInt16Item&>(rItem).GetValue()); + static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item&>(rItem).GetValue())); } } break; diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index f8e682edfc8f..7d85f27bb0e6 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -328,7 +328,7 @@ uno::Sequence<beans::PropertyValue> SdDrawDocument* pDoc = mxModel->GetDoc(); for( size_t i = 0; i < SAL_N_ELEMENTS( aURLPropertyNames ); i++ ) { - XPropertyListRef pList = pDoc->GetPropertyList( (XPropertyListType) i ); + XPropertyListRef pList = pDoc->GetPropertyList( static_cast<XPropertyListType>(i) ); bHasEmbed = pList.is() && pList->IsEmbedInDocument(); if( bHasEmbed ) break; @@ -708,7 +708,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, sal_Int32 nValue = 0; if( (*pValues >>= nValue ) && (nValue >= css::style::NumberingType::CHARS_UPPER_LETTER ) && (nValue <= css::style::NumberingType::PAGE_DESCRIPTOR) ) { - pDoc->SetPageNumType((SvxNumType)nValue); + pDoc->SetPageNumType(static_cast<SvxNumType>(nValue)); bOk = true; bChanged = true; } @@ -831,19 +831,19 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, { bOk = true; - pDoc->SetCharCompressType( (CharCompressType)nCharCompressType ); + pDoc->SetCharCompressType( static_cast<CharCompressType>(nCharCompressType) ); SdDrawDocument* pDocument = pDocSh->GetDoc(); SdrOutliner& rOutl = pDocument->GetDrawOutliner(); - rOutl.SetAsianCompressionMode( (CharCompressType)nCharCompressType ); + rOutl.SetAsianCompressionMode( static_cast<CharCompressType>(nCharCompressType) ); SdOutliner* pOutl = pDocument->GetOutliner( false ); if( pOutl ) { - pOutl->SetAsianCompressionMode( (CharCompressType)nCharCompressType ); + pOutl->SetAsianCompressionMode( static_cast<CharCompressType>(nCharCompressType) ); } pOutl = pDocument->GetInternalOutliner( false ); if( pOutl ) { - pOutl->SetAsianCompressionMode( (CharCompressType)nCharCompressType ); + pOutl->SetAsianCompressionMode( static_cast<CharCompressType>(nCharCompressType) ); } } break; @@ -1158,7 +1158,7 @@ DocumentSettings::_getPropertyValues( case HANDLE_CHARCOMPRESS: { - *pValue <<= (sal_Int16)pDoc->GetCharCompressType(); + *pValue <<= static_cast<sal_Int16>(pDoc->GetCharCompressType()); break; } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 8cadc7db9239..506891188a3d 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -638,10 +638,10 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName SetLowerBorder( nValue ); break; case WID_PAGE_CHANGE: - GetPage()->SetPresChange( (PresChange)nValue ); + GetPage()->SetPresChange( static_cast<PresChange>(nValue) ); break; case WID_PAGE_LAYOUT: - GetPage()->SetAutoLayout( (AutoLayout)nValue, true ); + GetPage()->SetAutoLayout( static_cast<AutoLayout>(nValue), true ); break; case WID_PAGE_DURATION: GetPage()->SetTime(nValue); @@ -682,7 +682,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if(!::cppu::enum2int( nEnum, aValue )) throw lang::IllegalArgumentException(); - Orientation eOri = (((view::PaperOrientation)nEnum) == view::PaperOrientation_PORTRAIT)?Orientation::Portrait:Orientation::Landscape; + Orientation eOri = (static_cast<view::PaperOrientation>(nEnum) == view::PaperOrientation_PORTRAIT)?Orientation::Portrait:Orientation::Landscape; if( eOri != GetPage()->GetOrientation() ) { @@ -712,7 +712,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if(!::cppu::enum2int( nEnum, aValue )) throw lang::IllegalArgumentException(); - GetPage()->SetFadeEffect( (presentation::FadeEffect)nEnum ); + GetPage()->SetFadeEffect( static_cast<presentation::FadeEffect>(nEnum) ); break; } case WID_PAGE_BACK: diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index f6efb164f1d3..772fab4c878e 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -1407,7 +1407,7 @@ void ToolBarShellList::UpdateShells ( std::insert_iterator<GroupedShellList>(aList,aList.begin())); for (GroupedShellList::iterator iShell=aList.begin(); iShell!=aList.end(); ++iShell) { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": deactivating tool bar shell " << (sal_uInt32)iShell->mnId); + SAL_INFO("sd.view", OSL_THIS_FUNC << ": deactivating tool bar shell " << static_cast<sal_uInt32>(iShell->mnId)); rpManager->DeactivateSubShell(*rpMainViewShell, iShell->mnId); } @@ -1419,7 +1419,7 @@ void ToolBarShellList::UpdateShells ( std::insert_iterator<GroupedShellList>(aList,aList.begin())); for (GroupedShellList::iterator iShell=aList.begin(); iShell!=aList.end(); ++iShell) { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": activating tool bar shell " << (sal_uInt32)iShell->mnId); + SAL_INFO("sd.view", OSL_THIS_FUNC << ": activating tool bar shell " << static_cast<sal_uInt32>(iShell->mnId)); rpManager->ActivateSubShell(*rpMainViewShell, iShell->mnId); } diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 804dce0859b6..9be30f88fc36 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -889,7 +889,7 @@ OUString ViewShellBase::GetInitialViewShellType() { sal_Int16 nPageKind = 0; rProperty.Value >>= nPageKind; - switch ((PageKind)nPageKind) + switch (static_cast<PageKind>(nPageKind)) { case PageKind::Standard: sRequestedView = FrameworkHelper::msImpressViewURL; diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 9ad12b4639b3..d6510431df05 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -129,12 +129,12 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( const SfxUInt32Item* pNewAutoLayout = rRequest.GetArg<SfxUInt32Item>(ID_VAL_WHATLAYOUT); const SfxBoolItem* pBVisible = rRequest.GetArg<SfxBoolItem>(ID_VAL_ISPAGEBACK); const SfxBoolItem* pBObjsVisible = rRequest.GetArg<SfxBoolItem>(ID_VAL_ISPAGEOBJ); - AutoLayout aLayout ((AutoLayout)pNewAutoLayout->GetValue ()); + AutoLayout aLayout (static_cast<AutoLayout>(pNewAutoLayout->GetValue ())); if (aLayout >= AUTOLAYOUT_START && aLayout < AUTOLAYOUT_END) { aNewName = pNewName->GetValue (); - aNewAutoLayout = (AutoLayout) pNewAutoLayout->GetValue (); + aNewAutoLayout = static_cast<AutoLayout>(pNewAutoLayout->GetValue ()); bBVisible = pBVisible->GetValue (); bBObjsVisible = pBObjsVisible->GetValue (); } diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 1eca050e50e3..a0233250a0d6 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -581,7 +581,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } // justification (superscript, subscript) is also needed in outline-mode - SvxEscapement eEsc = (SvxEscapement ) aAttrSet.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(aAttrSet.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Superscript ) rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) ); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 0504e883da90..f88384daf008 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -541,8 +541,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_SET_SUPER_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) - aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Superscript ) aItem.SetEscapement( SvxEscapement::Off ); @@ -554,8 +553,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_SET_SUB_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) - aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Subscript ) aItem.SetEscapement( SvxEscapement::Off ); @@ -666,8 +664,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else if(nSlot == SID_SET_SUPER_SCRIPT ) { SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT); - SvxEscapement eEsc = (SvxEscapement) - aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Superscript ) aItem.SetEscapement( SvxEscapement::Off ); @@ -680,8 +677,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else if( nSlot == SID_SET_SUB_SCRIPT ) { SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT); - SvxEscapement eEsc = (SvxEscapement) - aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Subscript ) aItem.SetEscapement( SvxEscapement::Off ); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 698dac808ae0..74e1621192e3 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2955,7 +2955,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SfxStringItem aStyleNameItem( SID_STYLE_EDIT, pStyleSheet->GetName() ); aSet.Put(aStyleNameItem); - SfxUInt16Item aStyleFamilyItem( SID_STYLE_FAMILY, (sal_uInt16)pStyleSheet->GetFamily() ); + SfxUInt16Item aStyleFamilyItem( SID_STYLE_FAMILY, static_cast<sal_uInt16>(pStyleSheet->GetFamily()) ); aSet.Put(aStyleFamilyItem); rReq.SetArgs(aSet); @@ -3441,7 +3441,7 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) case SID_SET_SUB_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Subscript ) aItem.SetEscapement( SvxEscapement::Off ); else @@ -3452,7 +3452,7 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) case SID_SET_SUPER_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Superscript ) aItem.SetEscapement( SvxEscapement::Off ); else diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index d267641c9a0f..ce60ef119797 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -148,7 +148,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) const SfxUInt32Item* pWhatKind = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATKIND); sal_Int32 nWhatPage = static_cast<sal_Int32>(pWhatPage->GetValue ()); - PageKind nWhatKind = (PageKind)pWhatKind->GetValue (); + PageKind nWhatKind = static_cast<PageKind>(pWhatKind->GetValue ()); if (! (nWhatKind >= PageKind::Standard && nWhatKind <= PageKind::Handout)) { #if HAVE_FEATURE_SCRIPTING @@ -242,7 +242,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) const SfxBoolItem* pIsActive = rReq.GetArg<SfxBoolItem>(ID_VAL_ISACTIVE); const SfxUInt32Item* pWhatKind = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATKIND); - PageKind nWhatKind = (PageKind)pWhatKind->GetValue(); + PageKind nWhatKind = static_cast<PageKind>(pWhatKind->GetValue()); if ( nWhatKind >= PageKind::Standard && nWhatKind <= PageKind::Handout) { mbIsLayerModeActive = pIsActive->GetValue(); @@ -268,7 +268,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) if (pArgs && pArgs->Count() == 2) { const SfxUInt32Item* pWhatLayer = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATLAYER); - EditMode nWhatLayer = (EditMode)pWhatLayer->GetValue(); + EditMode nWhatLayer = static_cast<EditMode>(pWhatLayer->GetValue()); if (nWhatLayer == EditMode::Page || nWhatLayer == EditMode::MasterPage) { mbIsLayerModeActive = rReq.GetArg<SfxBoolItem>(ID_VAL_ISACTIVE)->GetValue(); diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 2d21a572880a..ad01925b8ebd 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -217,10 +217,10 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) if (pArgs->Count () == 1) { const SfxUInt32Item* pFillStyle = rReq.GetArg<SfxUInt32Item>(ID_VAL_STYLE); - if (CHECK_RANGE (drawing::FillStyle_NONE, (drawing::FillStyle)pFillStyle->GetValue (), drawing::FillStyle_BITMAP)) + if (CHECK_RANGE (drawing::FillStyle_NONE, static_cast<drawing::FillStyle>(pFillStyle->GetValue ()), drawing::FillStyle_BITMAP)) { pAttr->ClearItem (XATTR_FILLSTYLE); - XFillStyleItem aStyleItem((drawing::FillStyle) pFillStyle->GetValue ()); + XFillStyleItem aStyleItem(static_cast<drawing::FillStyle>(pFillStyle->GetValue ())); aStyleItem.SetWhich(XATTR_FILLSTYLE); pAttr->Put (aStyleItem); rBindings.Invalidate (SID_ATTR_FILL_STYLE); @@ -242,10 +242,10 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) if (pArgs->Count () == 1) { const SfxUInt32Item* pLineStyle = rReq.GetArg<SfxUInt32Item>(ID_VAL_STYLE); - if (CHECK_RANGE ((sal_Int32)drawing::LineStyle_NONE, static_cast<sal_Int32>(pLineStyle->GetValue()), (sal_Int32)drawing::LineStyle_DASH)) + if (CHECK_RANGE (sal_Int32(drawing::LineStyle_NONE), static_cast<sal_Int32>(pLineStyle->GetValue()), sal_Int32(drawing::LineStyle_DASH))) { pAttr->ClearItem (XATTR_LINESTYLE); - XLineStyleItem aStyleItem((drawing::LineStyle) pLineStyle->GetValue()); + XLineStyleItem aStyleItem(static_cast<drawing::LineStyle>(pLineStyle->GetValue())); aStyleItem.SetWhich(XATTR_LINESTYLE); pAttr->Put(aStyleItem); rBindings.Invalidate (SID_ATTR_LINE_STYLE); @@ -475,9 +475,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pDashLen = rReq.GetArg<SfxUInt32Item>(ID_VAL_DASHLEN); const SfxUInt32Item* pDistance = rReq.GetArg<SfxUInt32Item>(ID_VAL_DISTANCE); - if (CHECK_RANGE ((sal_Int32)css::drawing::DashStyle_RECT, static_cast<sal_Int32>(pStyle->GetValue()), (sal_Int32)css::drawing::DashStyle_ROUNDRELATIVE)) + if (CHECK_RANGE (sal_Int32(css::drawing::DashStyle_RECT), static_cast<sal_Int32>(pStyle->GetValue()), sal_Int32(css::drawing::DashStyle_ROUNDRELATIVE))) { - XDash aNewDash ((css::drawing::DashStyle) pStyle->GetValue (), static_cast<short>(pDots->GetValue ()), pDotLen->GetValue (), + XDash aNewDash (static_cast<css::drawing::DashStyle>(pStyle->GetValue ()), static_cast<short>(pDots->GetValue ()), pDotLen->GetValue (), static_cast<short>(pDashes->GetValue ()), pDashLen->GetValue (), pDistance->GetValue ()); pAttr->ClearItem (XATTR_LINEDASH); @@ -530,7 +530,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pStart = rReq.GetArg<SfxUInt32Item>(ID_VAL_STARTINTENS); const SfxUInt32Item* pEnd = rReq.GetArg<SfxUInt32Item>(ID_VAL_ENDINTENS); - if (CHECK_RANGE ((sal_Int32)css::awt::GradientStyle_LINEAR, static_cast<sal_Int32>(pStyle->GetValue()), (sal_Int32)css::awt::GradientStyle_RECT) && + if (CHECK_RANGE (sal_Int32(css::awt::GradientStyle_LINEAR), static_cast<sal_Int32>(pStyle->GetValue()), sal_Int32(css::awt::GradientStyle_RECT)) && CHECK_RANGE (0, static_cast<sal_Int32>(pAngle->GetValue ()), 360) && CHECK_RANGE (0, static_cast<sal_Int32>(pBorder->GetValue ()), 100) && CHECK_RANGE (0, static_cast<sal_Int32>(pCenterX->GetValue ()), 100) && @@ -553,7 +553,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) { XGradient aGradient(pEntry->GetGradient()); - aGradient.SetGradientStyle ((css::awt::GradientStyle) pStyle->GetValue ()); + aGradient.SetGradientStyle (static_cast<css::awt::GradientStyle>(pStyle->GetValue ())); aGradient.SetAngle (pAngle->GetValue () * 10); aGradient.SetBorder (static_cast<short>(pBorder->GetValue ())); aGradient.SetXOffset (static_cast<short>(pCenterX->GetValue ())); @@ -574,7 +574,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) if (i >= nCounts) { Color aBlack (0, 0, 0); - XGradient aGradient (aBlack, aBlack, (css::awt::GradientStyle) pStyle->GetValue (), + XGradient aGradient (aBlack, aBlack, static_cast<css::awt::GradientStyle>(pStyle->GetValue ()), pAngle->GetValue () * 10, static_cast<short>(pCenterX->GetValue ()), static_cast<short>(pCenterY->GetValue ()), static_cast<short>(pBorder->GetValue ()), static_cast<short>(pStart->GetValue ()), static_cast<short>(pEnd->GetValue ())); @@ -613,7 +613,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pDistance = rReq.GetArg<SfxUInt32Item>(ID_VAL_DISTANCE); const SfxUInt32Item* pAngle = rReq.GetArg<SfxUInt32Item>(ID_VAL_ANGLE); - if (CHECK_RANGE ((sal_Int32)css::drawing::HatchStyle_SINGLE, static_cast<sal_Int32>(pStyle->GetValue()), (sal_Int32)css::drawing::HatchStyle_TRIPLE) && + if (CHECK_RANGE (sal_Int32(css::drawing::HatchStyle_SINGLE), static_cast<sal_Int32>(pStyle->GetValue()), sal_Int32(css::drawing::HatchStyle_TRIPLE)) && CHECK_RANGE (0, static_cast<sal_Int32>(pAngle->GetValue ()), 360)) { pAttr->ClearItem (XATTR_FILLHATCH); @@ -631,7 +631,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) { XHatch aHatch(pEntry->GetHatch()); - aHatch.SetHatchStyle ((css::drawing::HatchStyle) pStyle->GetValue ()); + aHatch.SetHatchStyle (static_cast<css::drawing::HatchStyle>(pStyle->GetValue ())); aHatch.SetDistance (pDistance->GetValue ()); aHatch.SetAngle (pAngle->GetValue () * 10); @@ -648,7 +648,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) if (i >= nCounts) { Color aBlack (0, 0, 0); - XHatch aHatch (aBlack, (css::drawing::HatchStyle) pStyle->GetValue (), pDistance->GetValue (), + XHatch aHatch (aBlack, static_cast<css::drawing::HatchStyle>(pStyle->GetValue ()), pDistance->GetValue (), pAngle->GetValue () * 10); pHatchList->Insert(o3tl::make_unique<XHatchEntry>(aHatch, pName->GetValue())); @@ -814,7 +814,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { const XFillStyleItem &rFillStyleItem = aAttr.Get (XATTR_FILLSTYLE); - rSet.Put (SfxUInt32Item (nWhich, (long) rFillStyleItem.GetValue ())); + rSet.Put (SfxUInt32Item (nWhich, static_cast<long>(rFillStyleItem.GetValue ()))); break; } @@ -822,7 +822,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { const XLineStyleItem &rLineStyleItem = aAttr.Get (XATTR_LINESTYLE); - rSet.Put (SfxUInt32Item (nWhich, (long) rLineStyleItem.GetValue ())); + rSet.Put (SfxUInt32Item (nWhich, static_cast<long>(rLineStyleItem.GetValue ()))); break; } diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx index 6fe5932bd89f..8ec28f5b2cf0 100644 --- a/sd/source/ui/view/drviewsd.cxx +++ b/sd/source/ui/view/drviewsd.cxx @@ -74,8 +74,8 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq ) mpDrawView->SdrEndTextEdit(); const SfxItemSet* pArgs = rReq.GetArgs(); - PageJump eJump = (PageJump)static_cast<const SfxAllEnumItem&>( pArgs-> - Get(SID_NAVIGATOR_PAGE)).GetValue(); + PageJump eJump = static_cast<PageJump>(static_cast<const SfxAllEnumItem&>( pArgs-> + Get(SID_NAVIGATOR_PAGE)).GetValue()); switch (eJump) { @@ -186,7 +186,7 @@ void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet ) nState |= NavState::BtnLastEnabled | NavState::BtnNextEnabled; } - rSet.Put( SfxUInt32Item( SID_NAVIGATOR_STATE, (sal_uInt32)nState ) ); + rSet.Put( SfxUInt32Item( SID_NAVIGATOR_STATE, static_cast<sal_uInt32>(nState) ) ); rSet.Put( SfxStringItem( SID_NAVIGATOR_PAGENAME, aPageName ) ); } diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index daf0d5177c05..4ec78e3ebb2c 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -693,7 +693,7 @@ void DrawViewShell::FuDeleteSelectedObjects() void DrawViewShell::FuSupport(SfxRequest& rReq) { if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) - GetDocSh()->SetStyleFamily((SfxStyleFamily) static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); + GetDocSh()->SetStyleFamily(static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue())); // We do not execute a thing during a native slide show if(SlideShow::IsRunning(GetViewShellBase()) && diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 4819c227e844..11b3e60813bb 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -191,11 +191,11 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet) SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTPUT_QUALITY_BLACKWHITE ) || SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTPUT_QUALITY_CONTRAST ) ) { - const sal_uLong nMode = (sal_Int32)GetActiveWindow()->GetDrawMode(); - rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_COLOR, (sal_uLong)OUTPUT_DRAWMODE_COLOR == nMode ) ); - rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_GRAYSCALE, (sal_uLong)OUTPUT_DRAWMODE_GRAYSCALE == nMode ) ); - rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_BLACKWHITE, (sal_uLong)OUTPUT_DRAWMODE_BLACKWHITE == nMode ) ); - rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_CONTRAST, (sal_uLong)OUTPUT_DRAWMODE_CONTRAST == nMode ) ); + const sal_uLong nMode = static_cast<sal_Int32>(GetActiveWindow()->GetDrawMode()); + rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_COLOR, sal_uLong(OUTPUT_DRAWMODE_COLOR) == nMode ) ); + rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_GRAYSCALE, static_cast<sal_uLong>(OUTPUT_DRAWMODE_GRAYSCALE) == nMode ) ); + rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_BLACKWHITE, static_cast<sal_uLong>(OUTPUT_DRAWMODE_BLACKWHITE) == nMode ) ); + rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_CONTRAST, static_cast<sal_uLong>(OUTPUT_DRAWMODE_CONTRAST) == nMode ) ); } if ( SfxItemState::DEFAULT == rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) ) @@ -718,8 +718,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) rSet.InvalidateItem(SID_ATTR_PARA_ULSPACE); } - SvxEscapement eEsc = (SvxEscapement) - pSet->Get( EE_CHAR_ESCAPEMENT ).GetEnumValue(); + SvxEscapement eEsc = static_cast<SvxEscapement>(pSet->Get( EE_CHAR_ESCAPEMENT ).GetEnumValue()); if( eEsc == SvxEscapement::Superscript ) { rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) ); diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 4509fe94bc32..a49aa782118f 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -411,7 +411,7 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert aUserData.addValue( sUNO_View_SnapLinesHandout, makeAny( createHelpLinesString( GetHandoutHelpLines() ) ) ); aUserData.addValue( sUNO_View_RulerIsVisible, makeAny( HasRuler() ) ); - aUserData.addValue( sUNO_View_PageKind, makeAny( (sal_Int16)GetPageKind() ) ); + aUserData.addValue( sUNO_View_PageKind, makeAny( static_cast<sal_Int16>(GetPageKind()) ) ); aUserData.addValue( sUNO_View_SelectedPage, makeAny( static_cast<sal_Int16>(GetSelectedPage()) ) ); aUserData.addValue( sUNO_View_IsLayerMode, makeAny( IsLayerMode() ) ); @@ -419,7 +419,7 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert aUserData.addValue( sUNO_View_IsClickChangeRotation, makeAny( IsClickChangeRotation() ) ); aUserData.addValue( sUNO_View_SlidesPerRow, makeAny( static_cast<sal_Int16>(GetSlidesPerRow()) ) ); - aUserData.addValue( sUNO_View_EditMode, makeAny( (sal_Int32)GetViewShEditMode() ) ); + aUserData.addValue( sUNO_View_EditMode, makeAny( static_cast<sal_Int32>(GetViewShEditMode()) ) ); // aUserData.addValue( sUNO_View_EditModeStandard, makeAny( (sal_Int32)GetViewShEditMode( PageKind::Standard ) ) ); // aUserData.addValue( sUNO_View_EditModeNotes, makeAny( (sal_Int32)GetViewShEditMode( PageKind::Notes ) ) ); // aUserData.addValue( sUNO_View_EditModeHandout, makeAny( (sal_Int32)GetViewShEditMode( PageKind::Handout ) ) ); @@ -586,9 +586,9 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr { SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() ); if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) - SetPageKind( (PageKind)nInt16 ); + SetPageKind( static_cast<PageKind>(nInt16) ); - SetPageKindOnLoad( (PageKind)nInt16 ); + SetPageKindOnLoad( static_cast<PageKind>(nInt16) ); } } else if ( pValue->Name == sUNO_View_SelectedPage ) @@ -636,7 +636,7 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr { SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() ); if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) - SetViewShEditMode( (EditMode)nInt32 ); + SetViewShEditMode( static_cast<EditMode>(nInt32) ); } } // This one is kept for compatibility. Old value read from sUNO_View_EditModeStandard @@ -648,7 +648,7 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr { SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() ); if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) - SetViewShEditMode( (EditMode)nInt32 ); + SetViewShEditMode( static_cast<EditMode>(nInt32) ); } } else if ( pValue->Name == sUNO_View_VisibleAreaTop ) diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index efccc9dce51e..c65fe6c31b3d 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -411,7 +411,7 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet) void OutlineViewShell::FuSupport(SfxRequest &rReq) { if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) - GetDocSh()->SetStyleFamily((SfxStyleFamily) static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); + GetDocSh()->SetStyleFamily(static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue())); bool bPreviewState = false; sal_uLong nSlot = rReq.GetSlot(); diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index 045c5486f88b..719d46ef108b 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -243,11 +243,11 @@ SdPage* ViewShell::CreateOrDuplicatePage ( { if (ePageKind == PageKind::Notes) { - eNotesLayout = (AutoLayout) pLayout->GetValue (); + eNotesLayout = static_cast<AutoLayout>(pLayout->GetValue ()); } else { - eStandardLayout = (AutoLayout) pLayout->GetValue (); + eStandardLayout = static_cast<AutoLayout>(pLayout->GetValue ()); } } } @@ -261,17 +261,17 @@ SdPage* ViewShell::CreateOrDuplicatePage ( const SfxBoolItem* pIsPageBack = rRequest.GetArg<SfxBoolItem>(ID_VAL_ISPAGEBACK); const SfxBoolItem* pIsPageObj = rRequest.GetArg<SfxBoolItem>(ID_VAL_ISPAGEOBJ); - if (CHECK_RANGE (AUTOLAYOUT_START, (AutoLayout) pLayout->GetValue (), AUTOLAYOUT_END)) + if (CHECK_RANGE (AUTOLAYOUT_START, static_cast<AutoLayout>(pLayout->GetValue ()), AUTOLAYOUT_END)) { if (ePageKind == PageKind::Notes) { aNotesPageName = pPageName->GetValue (); - eNotesLayout = (AutoLayout) pLayout->GetValue (); + eNotesLayout = static_cast<AutoLayout>(pLayout->GetValue ()); } else { aStandardPageName = pPageName->GetValue (); - eStandardLayout = (AutoLayout) pLayout->GetValue (); + eStandardLayout = static_cast<AutoLayout>(pLayout->GetValue ()); } bIsPageBack = pIsPageBack->GetValue (); |