From abf7b94123a555c4f3e90a0ae41bd7a842d1c1fb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 12 Jan 2018 20:16:43 +0100 Subject: More loplugin:cstylecast: sd auto-rewrite with "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I144975b94fe2725ac740a953ca2133e99f8a3fce --- sd/source/core/CustomAnimationEffect.cxx | 10 +-- sd/source/core/EffectMigration.cxx | 4 +- sd/source/core/PageListWatcher.cxx | 12 +-- sd/source/core/drawdoc2.cxx | 16 ++-- sd/source/core/drawdoc3.cxx | 6 +- sd/source/core/drawdoc4.cxx | 2 +- sd/source/core/sdpage.cxx | 38 +++++----- sd/source/core/sdpage2.cxx | 2 +- sd/source/core/sdpage_animations.cxx | 4 +- sd/source/core/stlpool.cxx | 2 +- sd/source/core/stlsheet.cxx | 14 ++-- sd/source/filter/cgm/sdcgmfilter.cxx | 2 +- sd/source/filter/eppt/eppt.cxx | 2 +- sd/source/filter/eppt/epptso.cxx | 84 ++++++++++----------- sd/source/filter/eppt/pptexanimations.cxx | 72 +++++++++--------- sd/source/filter/eppt/pptexsoundcollection.cxx | 2 +- sd/source/filter/eppt/pptx-epptbase.cxx | 2 +- sd/source/filter/eppt/pptx-epptooxml.cxx | 36 ++++----- sd/source/filter/eppt/pptx-stylesheet.cxx | 12 +-- sd/source/filter/eppt/pptx-text.cxx | 38 +++++----- sd/source/filter/grf/sdgrffilter.cxx | 8 +- sd/source/filter/html/htmlex.cxx | 56 +++++++------- sd/source/filter/html/pubdlg.cxx | 24 +++--- sd/source/filter/ppt/pptin.cxx | 14 ++-- sd/source/filter/ppt/pptinanimations.cxx | 88 +++++++++++----------- sd/source/filter/ppt/propread.cxx | 2 +- .../accessibility/AccessibleDocumentViewBase.cxx | 4 +- .../ui/accessibility/AccessibleSlideSorterView.cxx | 4 +- .../ui/accessibility/AccessibleViewForwarder.cxx | 14 ++-- sd/source/ui/animations/CustomAnimationDialog.cxx | 50 ++++++------ sd/source/ui/animations/CustomAnimationPane.cxx | 8 +- sd/source/ui/animations/SlideTransitionPane.cxx | 2 +- sd/source/ui/animations/motionpathtag.cxx | 2 +- sd/source/ui/annotations/annotationmanager.cxx | 2 +- sd/source/ui/annotations/annotationtag.cxx | 6 +- sd/source/ui/annotations/annotationwindow.cxx | 8 +- sd/source/ui/app/optsitem.cxx | 46 +++++------ sd/source/ui/app/sddll.cxx | 4 +- sd/source/ui/app/sdmod1.cxx | 2 +- sd/source/ui/app/sdmod2.cxx | 8 +- sd/source/ui/app/sdxfer.cxx | 2 +- sd/source/ui/controller/displaymodecontroller.cxx | 4 +- sd/source/ui/controller/slidelayoutcontroller.cxx | 2 +- sd/source/ui/dlg/PhotoAlbumDialog.cxx | 4 +- sd/source/ui/dlg/RemoteDialogClientBox.cxx | 4 +- sd/source/ui/dlg/animobjs.cxx | 8 +- sd/source/ui/dlg/copydlg.cxx | 18 ++--- sd/source/ui/dlg/custsdlg.cxx | 8 +- sd/source/ui/dlg/diactrl.cxx | 4 +- sd/source/ui/dlg/dlgolbul.cxx | 4 +- sd/source/ui/dlg/dlgpage.cxx | 6 +- sd/source/ui/dlg/dlgsnap.cxx | 2 +- sd/source/ui/dlg/docprev.cxx | 10 +-- sd/source/ui/dlg/headerfooterdlg.cxx | 12 +-- sd/source/ui/dlg/navigatr.cxx | 4 +- sd/source/ui/dlg/paragr.cxx | 2 +- sd/source/ui/dlg/present.cxx | 4 +- sd/source/ui/dlg/sdpreslt.cxx | 10 +-- sd/source/ui/dlg/sdtreelb.cxx | 2 +- sd/source/ui/dlg/tpoption.cxx | 18 ++--- sd/source/ui/dlg/vectdlg.cxx | 20 ++--- sd/source/ui/framework/tools/FrameworkHelper.cxx | 2 +- sd/source/ui/func/bulmaper.cxx | 8 +- sd/source/ui/func/fucon3d.cxx | 2 +- sd/source/ui/func/fuconarc.cxx | 6 +- sd/source/ui/func/fuconbez.cxx | 2 +- sd/source/ui/func/fuconrec.cxx | 2 +- sd/source/ui/func/fucopy.cxx | 10 +-- sd/source/ui/func/fumorph.cxx | 4 +- sd/source/ui/func/fuoaprms.cxx | 4 +- sd/source/ui/func/fuolbull.cxx | 4 +- sd/source/ui/func/fupage.cxx | 6 +- sd/source/ui/func/fuscale.cxx | 4 +- sd/source/ui/func/fusel.cxx | 2 +- sd/source/ui/func/fusldlg.cxx | 2 +- sd/source/ui/func/fusnapln.cxx | 2 +- sd/source/ui/func/futempl.cxx | 2 +- sd/source/ui/func/fuzoom.cxx | 2 +- sd/source/ui/inc/morphdlg.hxx | 2 +- sd/source/ui/inc/optsitem.hxx | 2 +- sd/source/ui/remotecontrol/BluetoothServer.cxx | 2 +- .../ui/remotecontrol/BufferedStreamSocket.cxx | 2 +- sd/source/ui/remotecontrol/ImagePreparer.cxx | 4 +- sd/source/ui/sidebar/LayoutMenu.cxx | 6 +- sd/source/ui/sidebar/MasterPageContainer.cxx | 10 +-- sd/source/ui/sidebar/MasterPagesSelector.cxx | 8 +- sd/source/ui/sidebar/PreviewValueSet.cxx | 4 +- sd/source/ui/slideshow/SlideShowRestarter.cxx | 2 +- sd/source/ui/slideshow/slideshow.cxx | 4 +- sd/source/ui/slideshow/slideshowimpl.cxx | 18 ++--- sd/source/ui/slideshow/slideshowviewimpl.cxx | 8 +- .../ui/slidesorter/cache/SlsCacheConfiguration.cxx | 2 +- .../ui/slidesorter/controller/SlsClipboard.cxx | 2 +- .../slidesorter/controller/SlsScrollBarManager.cxx | 14 ++-- .../controller/SlsSelectionFunction.cxx | 2 +- .../ui/slidesorter/controller/SlsSlotManager.cxx | 4 +- .../ui/slidesorter/model/SlideSorterModel.cxx | 4 +- .../ui/slidesorter/shell/SlideSorterViewShell.cxx | 6 +- sd/source/ui/table/TableDesignPane.cxx | 6 +- sd/source/ui/table/tableobjectbar.cxx | 4 +- sd/source/ui/tools/ConfigurationAccess.cxx | 2 +- sd/source/ui/tools/PreviewRenderer.cxx | 2 +- sd/source/ui/unoidl/SdUnoDrawView.cxx | 4 +- sd/source/ui/unoidl/UnoDocumentSettings.cxx | 18 ++--- sd/source/ui/unoidl/unocpres.cxx | 4 +- sd/source/ui/unoidl/unolayer.cxx | 4 +- sd/source/ui/unoidl/unomodel.cxx | 30 ++++---- sd/source/ui/unoidl/unoobj.cxx | 10 +-- sd/source/ui/unoidl/unopage.cxx | 16 ++-- sd/source/ui/unoidl/unopool.cxx | 2 +- sd/source/ui/view/DocumentRenderer.cxx | 18 ++--- sd/source/ui/view/Outliner.cxx | 20 ++--- sd/source/ui/view/OutlinerIterator.cxx | 4 +- sd/source/ui/view/ViewClipboard.cxx | 2 +- sd/source/ui/view/ViewShellBase.cxx | 4 +- sd/source/ui/view/ViewTabBar.cxx | 2 +- sd/source/ui/view/drtxtob.cxx | 2 +- sd/source/ui/view/drtxtob1.cxx | 8 +- sd/source/ui/view/drviews1.cxx | 14 ++-- sd/source/ui/view/drviews2.cxx | 14 ++-- sd/source/ui/view/drviews3.cxx | 12 +-- sd/source/ui/view/drviews4.cxx | 10 +-- sd/source/ui/view/drviews5.cxx | 4 +- sd/source/ui/view/drviews7.cxx | 8 +- sd/source/ui/view/drviews8.cxx | 4 +- sd/source/ui/view/drviews9.cxx | 82 ++++++++++---------- sd/source/ui/view/drviewsa.cxx | 8 +- sd/source/ui/view/drviewse.cxx | 14 ++-- sd/source/ui/view/drviewsf.cxx | 6 +- sd/source/ui/view/drviewsh.cxx | 4 +- sd/source/ui/view/frmview.cxx | 38 +++++----- sd/source/ui/view/outlnvs2.cxx | 4 +- sd/source/ui/view/outlnvsh.cxx | 16 ++-- sd/source/ui/view/outlview.cxx | 40 +++++----- sd/source/ui/view/sdview.cxx | 4 +- sd/source/ui/view/sdview3.cxx | 12 +-- sd/source/ui/view/sdwindow.cxx | 54 ++++++------- sd/source/ui/view/tabcontr.cxx | 12 +-- sd/source/ui/view/viewshe2.cxx | 28 +++---- sd/source/ui/view/viewshe3.cxx | 2 +- 140 files changed, 791 insertions(+), 791 deletions(-) (limited to 'sd/source') diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 57adfc1ade78..2d1025db6b61 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1547,7 +1547,7 @@ void CustomAnimationEffect::updateSdrPathObjFromPath( SdrPathObj& rPathObj ) if( pPage ) { const Size aPageSize( pPage->GetSize() ); - aPolyPoly.transform(basegfx::utils::createScaleB2DHomMatrix((double)aPageSize.Width(), (double)aPageSize.Height())); + aPolyPoly.transform(basegfx::utils::createScaleB2DHomMatrix(static_cast(aPageSize.Width()), static_cast(aPageSize.Height()))); } const ::tools::Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); @@ -1575,8 +1575,8 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj if(!aRange.isEmpty()) { aBoundRect = ::tools::Rectangle( - (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()), - (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY())); + static_cast(floor(aRange.getMinX())), static_cast(floor(aRange.getMinY())), + static_cast(ceil(aRange.getMaxX())), static_cast(ceil(aRange.getMaxY()))); } const Point aCenter( aBoundRect.Center() ); @@ -1588,7 +1588,7 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj { const Size aPageSize( pPage->GetSize() ); aPolyPoly.transform(basegfx::utils::createScaleB2DHomMatrix( - 1.0 / (double)aPageSize.Width(), 1.0 / (double)aPageSize.Height())); + 1.0 / static_cast(aPageSize.Width()), 1.0 / static_cast(aPageSize.Height()))); } } @@ -2263,7 +2263,7 @@ void CustomAnimationTextGroup::addEffect( CustomAnimationEffectPtr const & pEffe if( mnDepthFlags[nParaDepth] == 0 ) { // so set it to the first found - mnDepthFlags[nParaDepth] = (sal_Int8)pEffect->getNodeType(); + mnDepthFlags[nParaDepth] = static_cast(pEffect->getNodeType()); } else if( mnDepthFlags[nParaDepth] != pEffect->getNodeType() ) { diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 5594376234e3..62b10a680f23 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -1019,7 +1019,7 @@ void EffectMigration::SetDimPrevious( SvxShape* pShape, bool bDimPrevious ) Any aColor; if( bDimPrevious ) - aColor <<= (sal_Int32)COL_LIGHTGRAY; + aColor <<= static_cast(COL_LIGHTGRAY); sd::MainSequencePtr pMainSequence = static_cast(pObj->GetPage())->getMainSequence(); @@ -1146,7 +1146,7 @@ void EffectMigration::SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos std::vector< CustomAnimationEffectPtr >::iterator aTempIter( aEffects.begin() ); std::vector< CustomAnimationEffectPtr >::iterator aTempEnd( aEffects.end() ); - if( nNewPos == (sal_Int32)aEffectVector.size() ) + if( nNewPos == static_cast(aEffectVector.size()) ) { while( aTempIter != aTempEnd ) { diff --git a/sd/source/core/PageListWatcher.cxx b/sd/source/core/PageListWatcher.cxx index 1dc7afc01fe2..9dfd01e97e8a 100644 --- a/sd/source/core/PageListWatcher.cxx +++ b/sd/source/core/PageListWatcher.cxx @@ -87,7 +87,7 @@ SdPage* ImpPageListWatcher::GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum) { case PageKind::Standard: { - if( nPgNum < (sal_uInt32)maPageVectorStandard.size() ) + if( nPgNum < static_cast(maPageVectorStandard.size()) ) pRetval = maPageVectorStandard[nPgNum]; else { @@ -98,7 +98,7 @@ SdPage* ImpPageListWatcher::GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum) } case PageKind::Notes: { - if( nPgNum < (sal_uInt32)maPageVectorNotes.size() ) + if( nPgNum < static_cast(maPageVectorNotes.size()) ) pRetval = maPageVectorNotes[nPgNum]; else { @@ -177,12 +177,12 @@ sal_uInt32 ImpPageListWatcher::GetVisibleSdPageCount() sal_uInt32 ImpDrawPageListWatcher::ImpGetPageCount() const { - return (sal_uInt32)mrModel.GetPageCount(); + return static_cast(mrModel.GetPageCount()); } SdPage* ImpDrawPageListWatcher::ImpGetPage(sal_uInt32 nIndex) const { - return const_cast(static_cast(mrModel.GetPage((sal_uInt16)nIndex))); + return const_cast(static_cast(mrModel.GetPage(static_cast(nIndex)))); } ImpDrawPageListWatcher::ImpDrawPageListWatcher(const SdrModel& rModel) @@ -196,12 +196,12 @@ ImpDrawPageListWatcher::~ImpDrawPageListWatcher() sal_uInt32 ImpMasterPageListWatcher::ImpGetPageCount() const { - return (sal_uInt32)mrModel.GetMasterPageCount(); + return static_cast(mrModel.GetMasterPageCount()); } SdPage* ImpMasterPageListWatcher::ImpGetPage(sal_uInt32 nIndex) const { - return const_cast(static_cast(mrModel.GetMasterPage((sal_uInt16)nIndex))); + return const_cast(static_cast(mrModel.GetMasterPage(static_cast(nIndex)))); } ImpMasterPageListWatcher::ImpMasterPageListWatcher(const SdrModel& rModel) diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 760856c46bef..3f632f5880f6 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -224,7 +224,7 @@ SdPage* SdDrawDocument::GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const sal_uInt16 SdDrawDocument::GetSdPageCount(PageKind ePgKind) const { - return (sal_uInt16)mpDrawPageListWatcher->GetSdPageCount(ePgKind); + return static_cast(mpDrawPageListWatcher->GetSdPageCount(ePgKind)); } SdPage* SdDrawDocument::GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind) @@ -234,12 +234,12 @@ SdPage* SdDrawDocument::GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind) sal_uInt16 SdDrawDocument::GetMasterSdPageCount(PageKind ePgKind) const { - return (sal_uInt16)mpMasterPageListWatcher->GetSdPageCount(ePgKind); + return static_cast(mpMasterPageListWatcher->GetSdPageCount(ePgKind)); } sal_uInt16 SdDrawDocument::GetActiveSdPageCount() const { - return (sal_uInt16)mpDrawPageListWatcher->GetVisibleSdPageCount(); + return static_cast(mpDrawPageListWatcher->GetVisibleSdPageCount()); } // Adapt the page numbers that are registered in the page objects of the notes @@ -592,8 +592,8 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument const * pRefDocument /* = sal_uLong nTop = aPageOffset.Y(); sal_uLong nLeft = aPageOffset.X(); - sal_uLong nBottom = std::max((long)(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L); - sal_uLong nRight = std::max((long)(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L); + sal_uLong nBottom = std::max(static_cast(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L); + sal_uLong nRight = std::max(static_cast(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L); pPage->SetBorder(nLeft, nTop, nRight, nBottom); } @@ -774,7 +774,7 @@ bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage) // If necessary, look backwards, until we find a page that wasn't selected nPage = nTargetPage; - if (nPage != (sal_uInt16)-1) + if (nPage != sal_uInt16(-1)) { pPage = GetSdPage(nPage, PageKind::Standard); while (nPage > 0 && pPage->IsSelected()) @@ -785,12 +785,12 @@ bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage) if (pPage->IsSelected()) { - nPage = (sal_uInt16)-1; + nPage = sal_uInt16(-1); } } // Insert before the first page - if (nPage == (sal_uInt16)-1) + if (nPage == sal_uInt16(-1)) { std::vector::reverse_iterator iter; for (iter = aPageList.rbegin(); iter != aPageList.rend(); ++iter) diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 5aba6cf3f448..d09e3438b54e 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -160,7 +160,7 @@ static void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBoo if( rBookmarkList.empty() ) { // simply take master page of nPos'th page in source document - pBMMPage = static_cast(&(pBookmarkDoc->GetSdPage((sal_uInt16)nPos, PageKind::Standard)->TRG_GetMasterPage())); + pBMMPage = static_cast(&(pBookmarkDoc->GetSdPage(static_cast(nPos), PageKind::Standard)->TRG_GetMasterPage())); } else { @@ -1208,8 +1208,8 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl if (!pMaster) { - pMaster = GetMasterSdPage( (sal_uInt16) nMPage, PageKind::Standard ); - pNotesMaster = GetMasterSdPage( (sal_uInt16) nMPage, PageKind::Notes ); + pMaster = GetMasterSdPage( static_cast(nMPage), PageKind::Standard ); + pNotesMaster = GetMasterSdPage( static_cast(nMPage), PageKind::Notes ); } else { diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 4fc6bba2d5d7..c8b8e052c9eb 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -1299,7 +1299,7 @@ sal_uInt32 SdDrawDocument::convertFontHeightToCTL( sal_uInt32 nWesternFontHeight { // http://specs.openoffice.org/g11n/font_sizes/42775_42725_Individual_configurable_font_size_for_default_fonts.odt double fTemp = double(nWesternFontHeight) * 1.333; - nWesternFontHeight = (sal_uInt32)fTemp; + nWesternFontHeight = static_cast(fTemp); // make some nice values for UI that displays PT instead of 1/100th mm nWesternFontHeight = ((nWesternFontHeight * 72) + 1270) / 2540L; nWesternFontHeight = ((nWesternFontHeight * 2540L) + 36) / 72; diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 9479976ac74e..8d20e7a1692e 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1132,14 +1132,14 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) { // scale actually page size into handout rectangle double fH = pRefPage->GetWidth() == 0 - ? 0 : (double) aPartArea.Width() / pRefPage->GetWidth(); + ? 0 : static_cast(aPartArea.Width()) / pRefPage->GetWidth(); double fV = pRefPage->GetHeight() == 0 - ? 0 : (double) aPartArea.Height() / pRefPage->GetHeight(); + ? 0 : static_cast(aPartArea.Height()) / pRefPage->GetHeight(); if ( fH > fV ) fH = fV; - aSize.Width() = (long) (fH * pRefPage->GetWidth()); - aSize.Height() = (long) (fH * pRefPage->GetHeight()); + aSize.Width() = static_cast(fH * pRefPage->GetWidth()); + aSize.Height() = static_cast(fH * pRefPage->GetHeight()); aPos.X() += (aPartArea.Width() - aSize.Width()) / 2; aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2; @@ -1950,14 +1950,14 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN const SvxFontHeightItem& rOldHgt = rSet.Get(EE_CHAR_FONTHEIGHT); sal_uLong nFontHeight = rOldHgt.GetHeight(); - nFontHeight = long(nFontHeight * (double) aFractY); + nFontHeight = long(nFontHeight * static_cast(aFractY)); rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT)); if( SfxItemState::DEFAULT == rSet.GetItemState( EE_CHAR_FONTHEIGHT_CJK ) ) { const SvxFontHeightItem& rOldHgt2 = rSet.Get(EE_CHAR_FONTHEIGHT_CJK); nFontHeight = rOldHgt2.GetHeight(); - nFontHeight = long(nFontHeight * (double) aFractY); + nFontHeight = long(nFontHeight * static_cast(aFractY)); rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK)); } @@ -1965,7 +1965,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN { const SvxFontHeightItem& rOldHgt2 = rSet.Get(EE_CHAR_FONTHEIGHT_CTL); nFontHeight = rOldHgt2.GetHeight(); - nFontHeight = long(nFontHeight * (double) aFractY); + nFontHeight = long(nFontHeight * static_cast(aFractY)); rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL)); } @@ -1989,14 +1989,14 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN const SvxFontHeightItem& rOldHgt = aTempSet.Get(EE_CHAR_FONTHEIGHT); sal_uLong nFontHeight = rOldHgt.GetHeight(); - nFontHeight = long(nFontHeight * (double) aFractY); + nFontHeight = long(nFontHeight * static_cast(aFractY)); aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT)); if( SfxItemState::DEFAULT == aTempSet.GetItemState( EE_CHAR_FONTHEIGHT_CJK ) ) { const SvxFontHeightItem& rOldHgt2 = aTempSet.Get(EE_CHAR_FONTHEIGHT_CJK); nFontHeight = rOldHgt2.GetHeight(); - nFontHeight = long(nFontHeight * (double) aFractY); + nFontHeight = long(nFontHeight * static_cast(aFractY)); aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK)); } @@ -2004,7 +2004,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN { const SvxFontHeightItem& rOldHgt2 = aTempSet.Get(EE_CHAR_FONTHEIGHT_CTL); nFontHeight = rOldHgt2.GetHeight(); - nFontHeight = long(nFontHeight * (double) aFractY); + nFontHeight = long(nFontHeight * static_cast(aFractY)); aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL)); } @@ -2040,7 +2040,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN if (pNotesSheet) { sal_uLong nHeight = pObj->GetLogicRect().GetSize().Height(); - sal_uLong nFontHeight = (sal_uLong) (nHeight * 0.0741); + sal_uLong nFontHeight = static_cast(nHeight * 0.0741); SfxItemSet& rSet = pNotesSheet->GetItemSet(); rSet.Put( SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT )); rSet.Put( SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK )); @@ -2066,7 +2066,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN // use more modern method to scale the text height sal_uInt32 nFontHeight = static_cast(pObj->GetMergedItem(nWhich)).GetHeight(); - sal_uInt32 nNewFontHeight = sal_uInt32((double)nFontHeight * (double)aFractY); + sal_uInt32 nNewFontHeight = sal_uInt32(static_cast(nFontHeight) * static_cast(aFractY)); pObj->SetMergedItem(SvxFontHeightItem(nNewFontHeight, 100, nWhich)); } @@ -2082,8 +2082,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN // corrected scaling; only distances may be scaled // use aTopLeft as original TopLeft - aNewPos.X() = long((aTopLeft.X() - GetLeftBorder()) * (double)aFractX) + nLeft; - aNewPos.Y() = long((aTopLeft.Y() - GetUpperBorder()) * (double)aFractY) + nUpper; + aNewPos.X() = long((aTopLeft.X() - GetLeftBorder()) * static_cast(aFractX)) + nLeft; + aNewPos.Y() = long((aTopLeft.Y() - GetUpperBorder()) * static_cast(aFractY)) + nUpper; Size aVec(aNewPos.X() - aTopLeft.X(), aNewPos.Y() - aTopLeft.Y()); @@ -2578,7 +2578,7 @@ const OUString& SdPage::GetName() const // if the document has number none as a formatting // for page numbers we still default to arabic numbering // to keep the default page names unique - aCreatedPageName += OUString::number( (sal_Int32)nNum ); + aCreatedPageName += OUString::number( static_cast(nNum) ); } else { @@ -3067,14 +3067,14 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, if (pFirstPage && pFirstPage->GetWidth() && pFirstPage->GetHeight()) { // scale actual size into handout rect - double fScale = (double)aPartArea.Width() / (double)pFirstPage->GetWidth(); + double fScale = static_cast(aPartArea.Width()) / static_cast(pFirstPage->GetWidth()); - aSize.Height() = (long)(fScale * pFirstPage->GetHeight() ); + aSize.Height() = static_cast(fScale * pFirstPage->GetHeight() ); if( aSize.Height() > aPartArea.Height() ) { - fScale = (double)aPartArea.Height() / (double)pFirstPage->GetHeight(); + fScale = static_cast(aPartArea.Height()) / static_cast(pFirstPage->GetHeight()); aSize.Height() = aPartArea.Height(); - aSize.Width() = (long)(fScale * pFirstPage->GetWidth()); + aSize.Width() = static_cast(fScale * pFirstPage->GetWidth()); } else { diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index e4181f171bc2..6057a9dacc14 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -586,7 +586,7 @@ void SdPage::createAnnotation( css::uno::Reference< css::office::XAnnotation >& void SdPage::addAnnotation( const Reference< XAnnotation >& xAnnotation, int nIndex ) { - if( (nIndex == -1) || (nIndex > (int)maAnnotations.size()) ) + if( (nIndex == -1) || (nIndex > static_cast(maAnnotations.size())) ) { maAnnotations.push_back( xAnnotation ); } diff --git a/sd/source/core/sdpage_animations.cxx b/sd/source/core/sdpage_animations.cxx index b2539bb69292..cdd16e9cb968 100644 --- a/sd/source/core/sdpage_animations.cxx +++ b/sd/source/core/sdpage_animations.cxx @@ -105,7 +105,7 @@ void SdPage::onParagraphInserted( ::Outliner* pOutliner, Paragraph const * pPara aTarget.Shape.set( pObj->getUnoShape(), UNO_QUERY ); /* FIXME: Paragraph should be sal_Int32, though more than 64k * paragrapsh at a shape are unlikely.. */ - aTarget.Paragraph = (sal_Int16)pOutliner->GetAbsPos( pPara ); + aTarget.Paragraph = static_cast(pOutliner->GetAbsPos( pPara )); getMainSequence()->insertTextRange( makeAny( aTarget ) ); } @@ -120,7 +120,7 @@ void SdPage::onParagraphRemoving( ::Outliner* pOutliner, Paragraph const * pPara aTarget.Shape.set( pObj->getUnoShape(), UNO_QUERY ); /* FIXME: Paragraph should be sal_Int32, though more than 64k * paragrapsh at a shape are unlikely.. */ - aTarget.Paragraph = (sal_Int16)pOutliner->GetAbsPos( pPara ); + aTarget.Paragraph = static_cast(pOutliner->GetAbsPos( pPara )); getMainSequence()->disposeTextRange( makeAny( aTarget ) ); } diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index c627970fd4e2..d11f09013af5 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -294,7 +294,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool } // FontSize - nFontSize = (sal_uInt16)((nFontSize * 2540L) / 72); // Pt --> 1/100 mm + nFontSize = static_cast((nFontSize * 2540L) / 72); // Pt --> 1/100 mm SfxItemSet& rOutlineSet = pSheet->GetItemSet(); rOutlineSet.Put( SvxFontHeightItem( nFontSize, 100, EE_CHAR_FONTHEIGHT ) ); rOutlineSet.Put( SvxFontHeightItem( nFontSize, 100, EE_CHAR_FONTHEIGHT_CJK ) ); diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 507c5e787eb1..8910ac419a42 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -537,7 +537,7 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, bool bOnlyMissingItems) const SvxBulletItem& rBItem = pCurSet->Get(EE_PARA_BULLET); double fBulletFraction = double(rBItem.GetWidth()) / nOldHeight; SvxBulletItem aNewBItem(rBItem); - aNewBItem.SetWidth((sal_uInt32)(fBulletFraction * nNewHeight)); + aNewBItem.SetWidth(static_cast(fBulletFraction * nNewHeight)); rSet.Put(aNewBItem); } @@ -548,7 +548,7 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, bool bOnlyMissingItems) SvxLRSpaceItem aNewLRItem(rLRItem); aNewLRItem.SetTextLeft(fIndentFraction * nNewHeight); double fFirstIndentFraction = double(rLRItem.GetTextFirstLineOfst()) / nOldHeight; - aNewLRItem.SetTextFirstLineOfst((short)(fFirstIndentFraction * nNewHeight)); + aNewLRItem.SetTextFirstLineOfst(static_cast(fFirstIndentFraction * nNewHeight)); rSet.Put(aNewLRItem); } @@ -557,9 +557,9 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, bool bOnlyMissingItems) const SvxULSpaceItem& rULItem = pCurSet->Get(EE_PARA_ULSPACE); SvxULSpaceItem aNewULItem(rULItem); double fLowerFraction = double(rULItem.GetLower()) / nOldHeight; - aNewULItem.SetLower((sal_uInt16)(fLowerFraction * nNewHeight)); + aNewULItem.SetLower(static_cast(fLowerFraction * nNewHeight)); double fUpperFraction = double(rULItem.GetUpper()) / nOldHeight; - aNewULItem.SetUpper((sal_uInt16)(fUpperFraction * nNewHeight)); + aNewULItem.SetUpper(static_cast(fUpperFraction * nNewHeight)); rSet.Put(aNewULItem); } } @@ -1105,7 +1105,7 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName ) { sal_Int32 nValue = 0; aAny >>= nValue; - aAny <<= (sal_Int16)nValue; + aAny <<= static_cast(nValue); } else { @@ -1190,7 +1190,7 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN case XATTR_LINESTART: case XATTR_LINEDASH: { - const NameOrIndex* pItem = rStyleSet.GetItem((sal_uInt16)pEntry->nWID); + const NameOrIndex* pItem = rStyleSet.GetItem(static_cast(pEntry->nWID)); if( ( pItem == nullptr ) || pItem->GetName().isEmpty() ) eState = PropertyState_DEFAULT_VALUE; } @@ -1294,7 +1294,7 @@ void SdStyleSheet::BroadcastSdStyleSheetChange(SfxStyleSheetBase const * pStyleS { OUString sStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " "); - for( sal_uInt16 n = (sal_uInt16)(ePO - PO_OUTLINE_1 + 2); n < 10; n++ ) + for( sal_uInt16 n = static_cast(ePO - PO_OUTLINE_1 + 2); n < 10; n++ ) { OUString aName( sStyleName + OUString::number(n) ); diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx b/sd/source/filter/cgm/sdcgmfilter.cxx index f5b394f31f23..7bd04a246b10 100644 --- a/sd/source/filter/cgm/sdcgmfilter.cxx +++ b/sd/source/filter/cgm/sdcgmfilter.cxx @@ -108,7 +108,7 @@ bool SdCGMFilter::Import() if(pSdPage) { // set PageFill to given color - const Color aColor((sal_uInt8)(nRetValue >> 16), (sal_uInt8)(nRetValue >> 8), (sal_uInt8)(nRetValue >> 16)); + const Color aColor(static_cast(nRetValue >> 16), static_cast(nRetValue >> 8), static_cast(nRetValue >> 16)); pSdPage->getSdrPageProperties().PutItem(XFillColorItem(OUString(), aColor)); pSdPage->getSdrPageProperties().PutItem(XFillStyleItem(drawing::FillStyle_SOLID)); } diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index c49ad4ead574..62acfef7eace 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -794,7 +794,7 @@ bool PPTWriter::ImplCreateDocument() { nStartSlide = pIter - maSlideNameList.begin() + 1; nFlags |= 4; - nEndSlide = (sal_uInt16)mnPages; + nEndSlide = static_cast(mnPages); } } } diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index b1acd7a4ba04..7ea85d922520 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -118,8 +118,8 @@ sal_uInt16 PPTExBulletProvider::GetId( const OString& rUniqueId, Size& rGraphicS if ( rGraphicSize.Width() && rGraphicSize.Height() ) { - double fQ1 = ( (double)aPrefSize.Width() / (double)aPrefSize.Height() ); - double fQ2 = ( (double)rGraphicSize.Width() / (double)rGraphicSize.Height() ); + double fQ1 = ( static_cast(aPrefSize.Width()) / static_cast(aPrefSize.Height()) ); + double fQ2 = ( static_cast(rGraphicSize.Width()) / static_cast(rGraphicSize.Height()) ); double fXScale = 1; double fYScale = 1; @@ -131,8 +131,8 @@ sal_uInt16 PPTExBulletProvider::GetId( const OString& rUniqueId, Size& rGraphicS if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) ) { aBmpEx.Scale( fXScale, fYScale ); - Size aNewSize( (sal_Int32)((double)rGraphicSize.Width() / fXScale + 0.5 ), - (sal_Int32)((double)rGraphicSize.Height() / fYScale + 0.5 ) ); + Size aNewSize( static_cast(static_cast(rGraphicSize.Width()) / fXScale + 0.5 ), + static_cast(static_cast(rGraphicSize.Height()) / fYScale + 0.5 ) ); rGraphicSize = aNewSize; @@ -143,7 +143,7 @@ sal_uInt16 PPTExBulletProvider::GetId( const OString& rUniqueId, Size& rGraphicS sal_uInt32 nId = pGraphicProv->GetBlibID(aBuExPictureStream, xGraphicObject->GetUniqueID()); if ( nId && ( nId < 0x10000 ) ) - nRetValue = (sal_uInt16)nId - 1; + nRetValue = static_cast(nId) - 1; } return nRetValue; } @@ -283,7 +283,7 @@ sal_uInt32 PPTWriter::ImplProgBinaryTagContainer( SvStream* pStrm, SvMemoryStrea if ( pStrm ) { - pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) ); + pStrm->SeekRel( - ( static_cast(nSize) - 4 ) ); pStrm->WriteUInt32( nSize - 8 ); pStrm->SeekRel( nSize - 8 ); } @@ -303,7 +303,7 @@ sal_uInt32 PPTWriter::ImplProgTagContainer( SvStream* pStrm, SvMemoryStream* pBi nSize += ImplProgBinaryTagContainer( pStrm, pBinTagStrm ); if ( pStrm ) { - pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) ); + pStrm->SeekRel( - ( static_cast(nSize) - 4 ) ); pStrm->WriteUInt32( nSize - 8 ); pStrm->SeekRel( nSize - 8 ); } @@ -327,7 +327,7 @@ sal_uInt32 PPTWriter::ImplDocumentListContainer( SvStream* pStrm ) if ( pStrm ) { - pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) ); + pStrm->SeekRel( - ( static_cast(nSize) - 4 ) ); pStrm->WriteUInt32( nSize - 8 ); pStrm->SeekRel( nSize - 8 ); } @@ -386,7 +386,7 @@ sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const OUString& rBookmarkURL, const PPTWriter::WriteCString( *mpExEmbed, rStringVer3, 3 ); nHyperSize = mpExEmbed->Tell() - nHyperStart; - mpExEmbed->SeekRel( - ( (sal_Int32)nHyperSize + 4 ) ); + mpExEmbed->SeekRel( - ( static_cast(nHyperSize) + 4 ) ); mpExEmbed->WriteUInt32( nHyperSize ); mpExEmbed->SeekRel( nHyperSize ); return nHyperId; @@ -671,7 +671,7 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj ) { double fN = 100.0; fN *= pDesc->Scaling; - nNormalSpacing = (sal_Int16)( fN + 0.5 ); + nNormalSpacing = static_cast( fN + 0.5 ); } if ( !mbFontIndependentLineSpacing && bFirstParagraph && ( nLineSpacing > nNormalSpacing ) ) // sj: i28747, no replacement for fixed linespacing { @@ -683,14 +683,14 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj ) if ( nLineSpacing > 0 ) { if ( !mbFontIndependentLineSpacing && pDesc ) - nLineSpacing = (sal_Int16)( (double)nLineSpacing * pDesc->Scaling + 0.5 ); + nLineSpacing = static_cast( static_cast(nLineSpacing) * pDesc->Scaling + 0.5 ); } else { - if ( !pPara->mbFixedLineSpacing && rPortion.mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point + if ( !pPara->mbFixedLineSpacing && rPortion.mnCharHeight > static_cast( static_cast(-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point nLineSpacing = nNormalSpacing; else - nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 ); + nLineSpacing = static_cast( static_cast(nLineSpacing) / 4.40972 ); } if ( ( pPara->meLineSpacing == css::beans::PropertyState_DIRECT_VALUE ) || ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, ParaAttr_LineFeed, nLineSpacing ) ) ) @@ -730,7 +730,7 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj ) nPropertyFlags |= 0x400; FontCollectionEntry aFontDescEntry( pPara->aFontDesc.Name, pPara->aFontDesc.Family, pPara->aFontDesc.Pitch, pPara->aFontDesc.CharSet ); - sal_uInt16 nFontId = (sal_uInt16)maFontCollection.GetId( aFontDescEntry ); + sal_uInt16 nFontId = static_cast(maFontCollection.GetId( aFontDescEntry )); rOut.WriteUInt32( nCharCount ) .WriteUInt16( nDepth ) // Level @@ -874,8 +874,8 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj ) } sal_Int32 nB = nBackgroundColor & 0xff; - nB += (sal_uInt8)( nBackgroundColor >> 8 ); - nB += (sal_uInt8)( nBackgroundColor >> 16 ); + nB += static_cast( nBackgroundColor >> 8 ); + nB += static_cast( nBackgroundColor >> 16 ); // if the background color is nearly black, relief can't been used, because the text would not be visible if ( nB < 0x60 || ( nBackgroundColor != nCharColor ) ) { @@ -990,8 +990,8 @@ void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt ) else mnAngle = ( 36000 - ( mnAngle % 36000 ) ); - double fCos = cos( (double)mnAngle * F_PI18000 ); - double fSin = sin( (double)mnAngle * F_PI18000 ); + double fCos = cos( static_cast(mnAngle) * F_PI18000 ); + double fSin = sin( static_cast(mnAngle) * F_PI18000 ); double fWidthHalf = maRect.GetWidth() / 2.0; double fHeightHalf = maRect.GetHeight() / 2.0; @@ -999,7 +999,7 @@ void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt ) double fXDiff = fCos * fWidthHalf + fSin * (-fHeightHalf); double fYDiff = - ( fSin * fWidthHalf - fCos * ( -fHeightHalf ) ); - maRect.Move( (sal_Int32)( -( fWidthHalf - fXDiff ) ), (sal_Int32)( - ( fHeightHalf + fYDiff ) ) ); + maRect.Move( static_cast( -( fWidthHalf - fXDiff ) ), static_cast( - ( fHeightHalf + fYDiff ) ) ); mnAngle *= 655; mnAngle += 0x8000; mnAngle &=~0xffff; // round nAngle to full grads @@ -1010,7 +1010,7 @@ void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt ) { // Maddeningly, in those two areas of PPT is the BoundingBox already // vertical. Therefore, we need to put down it BEFORE THE ROTATION. - css::awt::Point aTopLeft( (sal_Int32)( maRect.Left() + fWidthHalf - fHeightHalf ), (sal_Int32)( maRect.Top() + fHeightHalf - fWidthHalf ) ); + css::awt::Point aTopLeft( static_cast( maRect.Left() + fWidthHalf - fHeightHalf ), static_cast( maRect.Top() + fHeightHalf - fWidthHalf ) ); const long nRotatedWidth(maRect.GetHeight()); const long nRotatedHeight(maRect.GetWidth()); const Size aNewSize(nRotatedWidth, nRotatedHeight); @@ -1031,7 +1031,7 @@ void PPTWriter::ImplAdjustFirstLineLineSpacing( TextObj& rTextObj, EscherPropert sal_Int16 nLineSpacing = pPara->mnLineSpacing; const FontCollectionEntry* pDesc = maFontCollection.GetById( rPortion.mnFont ); if ( pDesc ) - nLineSpacing = (sal_Int16)( (double)nLineSpacing * pDesc->Scaling + 0.5 ); + nLineSpacing = static_cast( static_cast(nLineSpacing) * pDesc->Scaling + 0.5 ); if ( ( nLineSpacing > 0 ) && ( nLineSpacing < 100 ) ) { @@ -1079,7 +1079,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u ImplWriteParagraphs( rOut, aTextObj ); ImplWritePortions( rOut, aTextObj ); nSize = rOut.Tell() - nPos; - rOut.SeekRel( - ( (sal_Int32)nSize - 4 ) ); + rOut.SeekRel( - ( static_cast(nSize) - 4 ) ); rOut.WriteUInt32( nSize - 8 ); rOut.SeekRel( nSize - 8 ); @@ -1219,7 +1219,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u { nParaFlags |= nMask << 16; nNumberingRule[ nDepth << 1 ] = pPara->nTextOfs; - nNumberingRule[ ( nDepth << 1 ) + 1 ] = (sal_Int16)pPara->nBulletOfs; + nNumberingRule[ ( nDepth << 1 ) + 1 ] = static_cast(pPara->nBulletOfs); } } } @@ -1241,8 +1241,8 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u const sal_uInt32 nDefaultTabSize = MapSize( awt::Size( nDefaultTabSizeSrc, 1 ) ).Width; sal_uInt32 nDefaultTabs = std::abs( maRect.GetWidth() ) / nDefaultTabSize; if ( nTabs ) - nDefaultTabs -= (sal_Int32)( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize ); - if ( (sal_Int32)nDefaultTabs < 0 ) + nDefaultTabs -= static_cast( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize ); + if ( static_cast(nDefaultTabs) < 0 ) nDefaultTabs = 0; sal_uInt32 nTabCount = nTabs + nDefaultTabs; @@ -1270,7 +1270,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u pRuleOut->WriteUInt16( nTabCount ); for ( i = 0; i < nTabs; i++ ) { - sal_uInt16 nPosition = (sal_uInt16)( ( pTabStop[ i ].Position / 4.40972 ) + nTextOfs ); + sal_uInt16 nPosition = static_cast( ( pTabStop[ i ].Position / 4.40972 ) + nTextOfs ); sal_uInt16 nType; switch ( pTabStop[ i ].Alignment ) { @@ -1287,7 +1287,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u sal_uInt32 nWidth = 1; if ( nTabs ) - nWidth += (sal_Int32)( ( pTabStop[ nTabs - 1 ].Position / 4.40972 + nTextOfs ) / nDefaultTabSize ); + nWidth += static_cast( ( pTabStop[ nTabs - 1 ].Position / 4.40972 + nTextOfs ) / nDefaultTabSize ); nWidth *= nDefaultTabSize; for ( i = 0; i < nDefaultTabs; i++, nWidth += nDefaultTabSize ) pRuleOut->WriteUInt32( nWidth ); @@ -1300,7 +1300,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u pRuleOut->WriteInt16( nNumberingRule[ ( i << 1 ) + 1 ] ); } sal_uInt32 nBufSize = pRuleOut->Tell() - nRulePos; - pRuleOut->SeekRel( - ( (sal_Int32)nBufSize - 4 ) ); + pRuleOut->SeekRel( - ( static_cast(nBufSize) - 4 ) ); pRuleOut->WriteUInt32( nBufSize - 8 ); pRuleOut->SeekRel( nBufSize - 8 ); } @@ -1364,7 +1364,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u rExtBuStr.WriteUInt32( 0 ).WriteUInt32( 0 ); } sal_uInt32 nBulletSize = ( rExtBuStr.Tell() - nPos2 ) - 8; - rExtBuStr.SeekRel( - ( (sal_Int32)nBulletSize + 4 ) ); + rExtBuStr.SeekRel( - ( static_cast(nBulletSize) + 4 ) ); rExtBuStr.WriteUInt32( nBulletSize ); rExtBuStr.SeekRel( nBulletSize ); } @@ -1490,7 +1490,7 @@ void PPTWriter::ImplWriteClickAction( SvStream& rSt, css::presentation::ClickAct INetURLObject aUrl( aBookmark ); if ( INetProtocol::File == aUrl.GetProtocol() ) aBookmarkFile = aUrl.PathToFileName(); - nHyperLinkID = ImplInsertBookmarkURL( aBookmark, (sal_uInt32)(2 | ( 1U << 31 )), aBookmarkFile, aBookmark, "", "" ); + nHyperLinkID = ImplInsertBookmarkURL( aBookmark, sal_uInt32(2 | ( 1U << 31 )), aBookmarkFile, aBookmark, "", "" ); } } } @@ -1873,10 +1873,10 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a css::awt::Size aSize( mXShape->getSize() ); css::awt::Point aStart, aEnd, aCenter; ::tools::Rectangle aRect( Point( aPoint.X, aPoint.Y ), Size( aSize.Width, aSize.Height ) ); - aStart.X = (sal_Int32) ( cos( nStartAngle * F_PI18000 ) * 100.0 ); - aStart.Y = - (sal_Int32) ( sin( nStartAngle * F_PI18000 ) * 100.0 ); - aEnd.X = (sal_Int32) ( cos( nEndAngle * F_PI18000 ) * 100.0 ); - aEnd.Y = - (sal_Int32) ( sin( nEndAngle * F_PI18000 ) * 100.0 ) ; + aStart.X = static_cast( cos( nStartAngle * F_PI18000 ) * 100.0 ); + aStart.Y = - static_cast( sin( nStartAngle * F_PI18000 ) * 100.0 ); + aEnd.X = static_cast( cos( nEndAngle * F_PI18000 ) * 100.0 ); + aEnd.Y = - static_cast( sin( nEndAngle * F_PI18000 ) * 100.0 ) ; aCenter.X = aPoint.X + ( aSize.Width / 2 ); aCenter.Y = aPoint.Y + ( aSize.Height / 2 ); aStart.X += aCenter.X; @@ -1887,7 +1887,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a bool bNeedText = true; if ( mnAngle ) { - aPolygon.Rotate( aRect.TopLeft(), (sal_uInt16)( mnAngle / 10 ) ); + aPolygon.Rotate( aRect.TopLeft(), static_cast( mnAngle / 10 ) ); if ( ImplGetText() ) { // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187) @@ -2044,8 +2044,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a for ( sal_Int32 i = 0; i < aControlName.getLength(); i++ ) { sal_Unicode nUnicode = aControlName[i]; - *pTmp++ = (sal_uInt8)nUnicode; - *pTmp++ = (sal_uInt8)( nUnicode >> 8 ); + *pTmp++ = static_cast(nUnicode); + *pTmp++ = static_cast( nUnicode >> 8 ); } *pTmp++ = 0; *pTmp = 0; @@ -2655,7 +2655,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a .WriteUInt16( 0 ) .WriteUInt16( 0x435 ); - sal_uInt16 i, nStringLen = (sal_uInt16)aMediaURL.getLength(); + sal_uInt16 i, nStringLen = static_cast(aMediaURL.getLength()); mpExEmbed->WriteUInt32( EPP_CString << 16 ).WriteUInt32( nStringLen * 2 ); for ( i = 0; i < nStringLen; i++ ) { @@ -2663,7 +2663,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a mpExEmbed->WriteUInt16( nChar ); } nSize = mpExEmbed->Tell() - nStart; - mpExEmbed->SeekRel( - ( (sal_Int32)nSize + 4 ) ); + mpExEmbed->SeekRel( - ( static_cast(nSize) + 4 ) ); mpExEmbed->WriteUInt32( nSize ); // size of PPT_PST_ExMCIMovie mpExEmbed->SeekRel( 0x10 ); nSize -= 20; @@ -2900,7 +2900,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a { double fDist = hypot( maRect.GetWidth(), maRect.GetHeight() ); maRect = ::tools::Rectangle( Point( aTextRefPoint.X, aTextRefPoint.Y ), - Point( (sal_Int32)( aTextRefPoint.X + fDist ), aTextRefPoint.Y - 1 ) ); + Point( static_cast( aTextRefPoint.X + fDist ), aTextRefPoint.Y - 1 ) ); ImplCreateTextShape( aPropOpt, aSolverContainer, false ); aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x60006 ); // Size Shape To Fit Text if ( mnAngle < 0 ) @@ -3333,7 +3333,7 @@ void TextObjBinary::Write( SvStream* pStrm ) for ( sal_uInt32 i = 0; i < ParagraphCount(); ++i ) GetParagraph(i)->Write( pStrm ); nSize = pStrm->Tell() - nPos; - pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) ); + pStrm->SeekRel( - ( static_cast(nSize) - 4 ) ); pStrm->WriteUInt32( nSize - 8 ); pStrm->SeekRel( nSize - 8 ); } @@ -3356,7 +3356,7 @@ void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm ) pStrm ->WriteUInt32( nPortionSize ) .WriteInt32( nFlags ) .WriteInt16( 1 ) // spellinfo -> needs rechecking - .WriteInt16( (sal_uInt16)LanguageTag( rPortion.meCharLocale ).makeFallback().getLanguageType() ) + .WriteInt16( static_cast(LanguageTag( rPortion.meCharLocale ).makeFallback().getLanguageType()) ) .WriteInt16( 0 ); // alt language } } diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index 3642aae67d7f..4e8ea36a0965 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -213,7 +213,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl } } if ( !bTranslated ) - nPresetSubType = (sal_uInt32)rPresetSubType.toInt32(); + nPresetSubType = static_cast(rPresetSubType.toInt32()); return nPresetSubType; } @@ -815,7 +815,7 @@ void AnimationExporter::exportAnimNode( SvStream& rStrm, const Reference< XAnima } else if ( xNode->getDuration() >>= fDuration ) { - aAnim.mnDuration = (sal_Int32)( fDuration * 1000.0 ); + aAnim.mnDuration = static_cast( fDuration * 1000.0 ); } else aAnim.mnDuration = -1; @@ -925,7 +925,7 @@ sal_uInt32 AnimationExporter::GetPresetID( const OUString& rPreset, sal_uInt32 n else { const oox::ppt::preset_maping* p = oox::ppt::preset_maping::getList(); - while( p->mpStrPresetId && ((p->mnPresetClass != (sal_Int32)nAPIPresetClass) || !rPreset.equalsAscii( p->mpStrPresetId )) ) + while( p->mpStrPresetId && ((p->mnPresetClass != static_cast(nAPIPresetClass)) || !rPreset.equalsAscii( p->mpStrPresetId )) ) p++; if( p->mpStrPresetId ) @@ -967,10 +967,10 @@ sal_Int16 AnimationExporter::exportAnimPropertySet( SvStream& rStrm, const Refer pAny[ DFF_ANIM_MASTERREL ] = &aMasterRel; - aOverride <<= (sal_Int32)1; + aOverride <<= sal_Int32(1); pAny[ DFF_ANIM_OVERRIDE ] = &aOverride; - aRunTimeContext <<= (sal_Int32)1; + aRunTimeContext <<= sal_Int32(1); pAny[ DFF_ANIM_RUNTIMECONTEXT ] = &aRunTimeContext; } @@ -1193,7 +1193,7 @@ void AnimationExporter::exportAnimPropertyString( SvStream& rStrm, const sal_uIn void AnimationExporter::exportAnimPropertyFloat( SvStream& rStrm, const sal_uInt16 nPropertyId, const double& rVal ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimAttributeValue, nPropertyId ); - float fFloat = (float)rVal; + float fFloat = static_cast(rVal); rStrm.WriteUChar( DFF_ANIM_PROP_TYPE_FLOAT ) .WriteFloat( fFloat ); } @@ -1328,7 +1328,7 @@ void AnimationExporter::exportAnimEvent( SvStream& rStrm, const Reference< XAnim nBegin = -1; } else if ( aEvent.Offset >>= fTiming ) - nBegin = (sal_Int32)( fTiming * 1000.0 ); + nBegin = static_cast( fTiming * 1000.0 ); } aSource = aEvent.Source; } @@ -1341,7 +1341,7 @@ void AnimationExporter::exportAnimEvent( SvStream& rStrm, const Reference< XAnim else if ( aAny >>= fTiming ) { bCreateEvent = true; - nBegin = (sal_Int32)( fTiming * 1000.0 ); + nBegin = static_cast( fTiming * 1000.0 ); } } break; @@ -1419,21 +1419,21 @@ Any AnimationExporter::convertAnimateValue( const Any& rSourceValue, const OUStr if ( rSourceValue >>= aHSL ) { aDest += "hsl(" - + OUString::number( (sal_Int32)( aHSL[ 0 ] / ( 360.0 / 255 ) ) ) + + OUString::number( static_cast( aHSL[ 0 ] / ( 360.0 / 255 ) ) ) + aP - + OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) ) + + OUString::number( static_cast( aHSL[ 1 ] * 255.0 ) ) + aP - + OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) ) + + OUString::number( static_cast( aHSL[ 2 ] * 255.0 ) ) + ")"; } else if ( rSourceValue >>= nColor ) { aDest += "rgb(" - + OUString::number( ( (sal_Int8)nColor ) ) + + OUString::number( static_cast(nColor) ) + aP - + OUString::number( ( (sal_Int8)( nColor >> 8 ) ) ) + + OUString::number( static_cast( nColor >> 8 ) ) + aP - + OUString::number( ( (sal_Int8)( nColor >> 16 ) ) ) + + OUString::number( static_cast( nColor >> 16 ) ) + ")"; } } @@ -1809,7 +1809,7 @@ void AnimationExporter::exportAnimateKeyPoints( SvStream& rStrm, const Reference { { EscherExAtom aAnimKeyTime( rStrm, DFF_msofbtAnimKeyTime ); - sal_Int32 nKeyTime = (sal_Int32)( aKeyTimes[ i ] * 1000.0 ); + sal_Int32 nKeyTime = static_cast( aKeyTimes[ i ] * 1000.0 ); rStrm.WriteInt32( nKeyTime ); } Any aAny[ 2 ]; @@ -1848,10 +1848,10 @@ void AnimationExporter::exportAnimValue( SvStream& rStrm, const Reference< XAnim if ( aAny >>= eTiming ) { if ( eTiming == Timing_INDEFINITE ) - fRepeatCount = ((float)3.40282346638528860e+38); + fRepeatCount = (float(3.40282346638528860e+38)); } else if ( aAny >>= fRepeat ) - fRepeatCount = (float)fRepeat; + fRepeatCount = static_cast(fRepeat); if ( fRepeatCount != 0.0 ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimValue ); @@ -1860,7 +1860,7 @@ void AnimationExporter::exportAnimValue( SvStream& rStrm, const Reference< XAnim .WriteFloat( fRepeatCount ); } // accelerate (3) - float fAccelerate = (float)xNode->getAcceleration(); + float fAccelerate = static_cast(xNode->getAcceleration()); if ( bExportAlways || ( fAccelerate != 0.0 ) ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimValue ); @@ -1870,7 +1870,7 @@ void AnimationExporter::exportAnimValue( SvStream& rStrm, const Reference< XAnim } // decelerate (4) - float fDecelerate = (float)xNode->getDecelerate(); + float fDecelerate = static_cast(xNode->getDecelerate()); if ( bExportAlways || ( fDecelerate != 0.0 ) ) { EscherExAtom aExAtom( rStrm, DFF_msofbtAnimValue ); @@ -1973,8 +1973,8 @@ void AnimationExporter::exportAnimateTransform( SvStream& rStrm, const Reference if ( ( aPair.First >>= fX ) && ( aPair.Second >>= fY ) ) { nBits |= 1; - fByX = (float)( fX * 100 ); - fByY = (float)( fY * 100 ); + fByX = static_cast( fX * 100 ); + fByY = static_cast( fY * 100 ); } } if ( xTransform->getFrom() >>= aPair ) @@ -1982,8 +1982,8 @@ void AnimationExporter::exportAnimateTransform( SvStream& rStrm, const Reference if ( ( aPair.First >>= fX ) && ( aPair.Second >>= fY ) ) { nBits |= 2; - fFromX = (float)( fX * 100 ); - fFromY = (float)( fY * 100 ); + fFromX = static_cast( fX * 100 ); + fFromY = static_cast( fY * 100 ); } } if( xTransform->getTo() >>= aPair ) @@ -1991,8 +1991,8 @@ void AnimationExporter::exportAnimateTransform( SvStream& rStrm, const Reference if ( ( aPair.First >>= fX ) && ( aPair.Second >>= fY ) ) { nBits |= 4; - fToX = (float)( fX * 100 ); - fToY = (float)( fY * 100 ); + fToX = static_cast( fX * 100 ); + fToY = static_cast( fY * 100 ); } } @@ -2019,17 +2019,17 @@ void AnimationExporter::exportAnimateTransform( SvStream& rStrm, const Reference if ( xTransform->getBy() >>= fVal ) { nBits |= 1; - fBy = (float)fVal; + fBy = static_cast(fVal); } if ( xTransform->getFrom() >>= fVal ) { nBits |= 2; - fFrom = (float)fVal; + fFrom = static_cast(fVal); } if ( xTransform->getTo() >>= fVal ) { nBits |= 4; - fTo = (float)fVal; + fTo = static_cast(fVal); } rStrm.WriteUInt32( nBits ).WriteFloat( fBy ).WriteFloat( fFrom ).WriteFloat( fTo ).WriteUInt32( nU1 ); } @@ -2050,15 +2050,15 @@ bool AnimationExporter::getColorAny( const Any& rAny, const sal_Int16 nColorSpac Sequence< double > aHSL( 3 ); if ( rAny >>= nColor ) // RGB color { - rA = (sal_uInt8)( nColor >> 16 ); - rB = (sal_uInt8)( nColor >> 8 ); - rC = (sal_uInt8) nColor; + rA = static_cast( nColor >> 16 ); + rB = static_cast( nColor >> 8 ); + rC = static_cast(nColor); } else if ( rAny >>= aHSL ) // HSL { - rA = (sal_Int32) ( aHSL[ 0 ] * 255.0 / 360.0 ); - rB = (sal_Int32) ( aHSL[ 1 ] * 255.0 ); - rC = (sal_Int32) ( aHSL[ 2 ] * 255.0 ); + rA = static_cast( aHSL[ 0 ] * 255.0 / 360.0 ); + rB = static_cast( aHSL[ 1 ] * 255.0 ); + rC = static_cast( aHSL[ 2 ] * 255.0 ); } else bIsColor = false; @@ -2133,7 +2133,7 @@ void AnimationExporter::exportIterate( SvStream& rStrm, const Reference< XAnimat case TextAnimationType::BY_LETTER : nTextUnitEffect = 2; break; } - fInterval = (float)xIterate->getIterateInterval(); + fInterval = static_cast(xIterate->getIterateInterval()); // convert interval from absolute to percentage double fDuration = 0.0; @@ -2163,7 +2163,7 @@ void AnimationExporter::exportIterate( SvStream& rStrm, const Reference< XAnimat } if( fDuration ) - fInterval = (float)(100.0 * fInterval / fDuration); + fInterval = static_cast(100.0 * fInterval / fDuration); rStrm.WriteFloat( fInterval ).WriteInt32( nTextUnitEffect ).WriteInt32( nU1 ).WriteInt32( nU2 ).WriteInt32( nU3 ); aTarget = xIterate->getTarget(); diff --git a/sd/source/filter/eppt/pptexsoundcollection.cxx b/sd/source/filter/eppt/pptexsoundcollection.cxx index e5277f023e9c..080bf0bc6203 100644 --- a/sd/source/filter/eppt/pptexsoundcollection.cxx +++ b/sd/source/filter/eppt/pptexsoundcollection.cxx @@ -40,7 +40,7 @@ ExSoundEntry::ExSoundEntry(const OUString& rString) comphelper::getProcessComponentContext() ); sal_Int64 nVal = 0; aCnt.getPropertyValue("Size") >>= nVal; - nFileSize = (sal_uInt32)nVal; + nFileSize = static_cast(nVal); } catch( css::uno::Exception& ) { diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index cd2b2fb3b06b..3e83cdab9a5e 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -523,7 +523,7 @@ bool PPTWriterBase::GetStyleSheets() aXPropSet( mXModel, UNO_QUERY ); sal_uInt16 nDefaultTab = ( aXPropSet.is() && ImplGetPropertyValue( aXPropSet, "TabStop" ) ) - ? (sal_uInt16)( *o3tl::doAccess(mAny) / 4.40972 ) + ? static_cast( *o3tl::doAccess(mAny) / 4.40972 ) : 1250; maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, dynamic_cast(this) ) ); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index cb404b1fd8d9..0fc8507f658c 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -878,7 +878,7 @@ void PowerPointExport::WriteAnimateValues(const FSHelperPtr& pFS, const Referenc { pFS->startElementNS(XML_p, XML_tav, XML_fmla, sFormula.isEmpty() ? nullptr : USS(sFormula), - XML_tm, I32S((sal_Int32)(aKeyTimes[ i ]*100000.0)), + XML_tm, I32S(static_cast(aKeyTimes[ i ]*100000.0)), FSEND); pFS->startElementNS(XML_p, XML_val, FSEND); ValuePair aPair; @@ -1229,12 +1229,12 @@ void PowerPointExport::WriteAnimationCondition(const FSHelperPtr& pFS, const cha { if (!pEvent) pFS->singleElementNS(XML_p, XML_cond, - XML_delay, bHasFDelay ? I64S((sal_uInt32)(fDelay*1000.0)) : pDelay, + XML_delay, bHasFDelay ? I64S(static_cast(fDelay*1000.0)) : pDelay, FSEND); else { pFS->startElementNS(XML_p, XML_cond, - XML_delay, bHasFDelay ? I64S((sal_uInt32)(fDelay*1000.0)) : pDelay, + XML_delay, bHasFDelay ? I64S(static_cast(fDelay*1000.0)) : pDelay, XML_evt, pEvent, FSEND); @@ -1483,7 +1483,7 @@ void PowerPointExport::WriteAnimationNodeCommonPropsStart(const FSHelperPtr& pFS pFS->startElementNS(XML_p, XML_cTn, XML_id, I64S(mnAnimationNodeIdMax ++), - XML_dur, fDuration != 0 ? I32S((sal_Int32)(fDuration * 1000.0)) : pDuration, + XML_dur, fDuration != 0 ? I32S(static_cast(fDuration * 1000.0)) : pDuration, XML_restart, pRestart, XML_nodeType, pNodeType, XML_fill, pFill, @@ -1809,7 +1809,7 @@ bool PowerPointExport::WriteComments(sal_uInt32 nPageNum) { FSHelperPtr pFS = openFragmentStreamWithSerializer(OUStringBuffer() .append("ppt/comments/comment") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear(), "application/vnd.openxmlformats-officedocument.presentationml.comments+xml"); @@ -1837,8 +1837,8 @@ bool PowerPointExport::WriteComments(sal_uInt32 nPageNum) FSEND); pFS->singleElementNS(XML_p, XML_pos, - XML_x, I64S(((sal_Int64)(57600*aRealPoint2D.X + 1270)/2540.0)), - XML_y, I64S(((sal_Int64)(57600*aRealPoint2D.Y + 1270)/2540.0)), + XML_x, I64S((static_cast(57600*aRealPoint2D.X + 1270)/2540.0)), + XML_y, I64S((static_cast(57600*aRealPoint2D.Y + 1270)/2540.0)), FSEND); pFS->startElementNS(XML_p, XML_text, @@ -1900,7 +1900,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum oox::getRelationship(Relationship::SLIDE), OUStringBuffer() .append("slides/slide") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear()); @@ -1914,7 +1914,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum FSHelperPtr pFS = openFragmentStreamWithSerializer(OUStringBuffer() .append("ppt/slides/slide") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear(), "application/vnd.openxmlformats-officedocument.presentationml.slide+xml"); @@ -1968,7 +1968,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum oox::getRelationship(Relationship::COMMENTS), OUStringBuffer() .append("../comments/comment") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear()); @@ -1984,7 +1984,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) FSHelperPtr pFS = openFragmentStreamWithSerializer(OUStringBuffer() .append("ppt/notesSlides/notesSlide") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear(), "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"); @@ -2004,7 +2004,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) oox::getRelationship(Relationship::SLIDE), OUStringBuffer() .append("../slides/slide") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear()); @@ -2014,7 +2014,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) oox::getRelationship(Relationship::NOTESSLIDE), OUStringBuffer() .append("../notesSlides/notesSlide") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear()); @@ -2055,7 +2055,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro oox::getRelationship(Relationship::SLIDEMASTER), OUStringBuffer() .append("slideMasters/slideMaster") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear()); @@ -2070,7 +2070,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro FSHelperPtr pFS = openFragmentStreamWithSerializer(OUStringBuffer() .append("ppt/slideMasters/slideMaster") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear(), "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"); @@ -2083,7 +2083,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro oox::getRelationship(Relationship::THEME), OUStringBuffer() .append("../theme/theme") - .append((sal_Int32) nPageNum + 1) + .append(static_cast(nPageNum) + 1) .append(".xml") .makeStringAndClear()); @@ -2196,7 +2196,7 @@ void PowerPointExport::ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMaster oox::getRelationship(Relationship::SLIDEMASTER), OUStringBuffer() .append("../slideMasters/slideMaster") - .append((sal_Int32) nMasterNum + 1) + .append(static_cast(nMasterNum) + 1) .append(".xml") .makeStringAndClear()); @@ -2734,7 +2734,7 @@ bool PowerPointExport::WriteNotesMaster() oox::getRelationship(Relationship::THEME), OUStringBuffer() .append("../theme/theme") - .append((sal_Int32) mnMasterPages + 1) + .append(static_cast(mnMasterPages) + 1) .append(".xml") .makeStringAndClear()); diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx b/sd/source/filter/eppt/pptx-stylesheet.cxx index 693607413215..d71241ec9de6 100644 --- a/sd/source/filter/eppt/pptx-stylesheet.cxx +++ b/sd/source/filter/eppt/pptx-stylesheet.cxx @@ -243,21 +243,21 @@ void PPTExParaSheet::SetStyleSheet( const css::uno::Reference< css::beans::XProp { const FontCollectionEntry* pDesc = rFontCollection.GetById( rCharLevel.mnFont ); if ( pDesc ) - nLineSpacing = (sal_Int16)( (double)nLineSpacing * pDesc->Scaling + 0.5 ); + nLineSpacing = static_cast( static_cast(nLineSpacing) * pDesc->Scaling + 0.5 ); } } else { - if ( rCharLevel.mnFontHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point + if ( rCharLevel.mnFontHeight > static_cast( static_cast(-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point { const FontCollectionEntry* pDesc = rFontCollection.GetById( rCharLevel.mnFont ); if ( pDesc ) - nLineSpacing = (sal_Int16)( 100.0 * pDesc->Scaling + 0.5 ); + nLineSpacing = static_cast( 100.0 * pDesc->Scaling + 0.5 ); else nLineSpacing = 100; } else - nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 ); + nLineSpacing = static_cast( static_cast(nLineSpacing) / 4.40972 ); } rLev.mnLineFeed = nLineSpacing; } @@ -294,11 +294,11 @@ void PPTExParaSheet::SetStyleSheet( const css::uno::Reference< css::beans::XProp if ( i ) aParagraphObj.ImplGetNumberingLevel( pBuProv, i, false, false ); rLevel.mnTextOfs = aParagraphObj.nTextOfs; - rLevel.mnBulletOfs = (sal_uInt16)aParagraphObj.nBulletOfs; + rLevel.mnBulletOfs = static_cast(aParagraphObj.nBulletOfs); rLevel.mnBulletChar = aParagraphObj.cBulletId; FontCollectionEntry aFontDescEntry( aParagraphObj.aFontDesc.Name, aParagraphObj.aFontDesc.Family, aParagraphObj.aFontDesc.Pitch, aParagraphObj.aFontDesc.CharSet ); - rLevel.mnBulletFont = (sal_uInt16)rFontCollection.GetId( aFontDescEntry ); + rLevel.mnBulletFont = static_cast(rFontCollection.GetId( aFontDescEntry )); rLevel.mnBulletHeight = aParagraphObj.nBulletRealSize; rLevel.mnBulletColor = aParagraphObj.nBulletColor; diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 857910a11333..13837d7eceed 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -154,7 +154,7 @@ PortionObj::PortionObj(css::uno::Reference< css::text::XTextRange > & rXTextRang sal_uInt16 nChar; for ( sal_Int32 i = 0; i < aString.getLength(); i++ ) { - nChar = (sal_uInt16)aString[ i ]; + nChar = static_cast(aString[ i ]); if ( nChar == 0xa ) nChar++; else if ( !bSymbol ) @@ -240,7 +240,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe { FontCollectionEntry aFontDesc( *o3tl::doAccess(mAny) ); sal_uInt32 nCount = rFontCollection.GetCount(); - mnFont = (sal_uInt16)rFontCollection.GetId( aFontDesc ); + mnFont = static_cast(rFontCollection.GetId( aFontDesc )); if ( mnFont == nCount ) { FontCollectionEntry& rFontDesc = rFontCollection.GetLast(); @@ -267,7 +267,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe { FontCollectionEntry aFontDesc( *o3tl::doAccess(mAny) ); sal_uInt32 nCount = rFontCollection.GetCount(); - mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc ); + mnAsianOrComplexFont = static_cast(rFontCollection.GetId( aFontDesc )); if ( mnAsianOrComplexFont == nCount ) { FontCollectionEntry& rFontDesc = rFontCollection.GetLast(); @@ -288,7 +288,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe { FontCollectionEntry aFontDesc( *o3tl::doAccess(mAny) ); sal_uInt32 nCount = rFontCollection.GetCount(); - mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc ); + mnAsianOrComplexFont = static_cast(rFontCollection.GetId( aFontDesc )); if ( mnAsianOrComplexFont == nCount ) { FontCollectionEntry& rFontDesc = rFontCollection.GetLast(); @@ -337,7 +337,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe float fVal(0.0); if ( mAny >>= fVal ) { - mnCharHeight = (sal_uInt16)( fVal + 0.5 ); + mnCharHeight = static_cast( fVal + 0.5 ); meCharHeight = GetPropertyState( mXPropSet, aCharHeightName ); } } @@ -416,8 +416,8 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe { sal_uInt32 nSOColor = *( o3tl::doAccess(mAny) ); mnCharColor = nSOColor & 0xff00ff00; // green and hibyte - mnCharColor |= (sal_uInt8) nSOColor << 16; // red and blue is switched - mnCharColor |= (sal_uInt8)( nSOColor >> 16 ); + mnCharColor |= static_cast(nSOColor) << 16; // red and blue is switched + mnCharColor |= static_cast( nSOColor >> 16 ); } meCharColor = ePropState; @@ -775,8 +775,8 @@ void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight ) double fLen = aBuGraSize.Height(); fCharHeight = fCharHeight * 0.2540; double fQuo = fLen / fCharHeight; - nBulletRealSize = (sal_Int16)( fQuo + 0.5 ); - if ( (sal_uInt16)nBulletRealSize > 400 ) + nBulletRealSize = static_cast( fQuo + 0.5 ); + if ( static_cast(nBulletRealSize) > 400 ) nBulletRealSize = 400; } } @@ -859,13 +859,13 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1 else if ( aPropName == "LeftMargin" ) nTextOfs = nTextOfs + static_cast< sal_Int16 >( *o3tl::doAccess(pPropValue[i].Value) / ( 2540.0 / 576 ) ); else if ( aPropName == "FirstLineOffset" ) - nBulletOfs += (sal_Int16)( *o3tl::doAccess(pPropValue[i].Value) / ( 2540.0 / 576 ) ); + nBulletOfs += static_cast( *o3tl::doAccess(pPropValue[i].Value) / ( 2540.0 / 576 ) ); else if ( aPropName == "BulletColor" ) { sal_uInt32 nSOColor = *o3tl::doAccess(pPropValue[i].Value); nBulletColor = nSOColor & 0xff00ff00; // green and hibyte - nBulletColor |= (sal_uInt8) nSOColor << 16; // red - nBulletColor |= (sal_uInt8)( nSOColor >> 16 ) | 0xfe000000; // blue + nBulletColor |= static_cast(nSOColor) << 16; // red + nBulletColor |= static_cast( nSOColor >> 16 ) | 0xfe000000; // blue } else if ( aPropName == "BulletRelSize" ) { @@ -1152,18 +1152,18 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bG switch ( aLineSpacing.Mode ) { case css::style::LineSpacingMode::FIX : - mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) ); + mnLineSpacing = static_cast(-( aLineSpacing.Height ) ); mbFixedLineSpacing = true; break; case css::style::LineSpacingMode::MINIMUM : case css::style::LineSpacingMode::LEADING : - mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) ); + mnLineSpacing = static_cast(-( aLineSpacing.Height ) ); mbFixedLineSpacing = false; break; case css::style::LineSpacingMode::PROP : default: - mnLineSpacing = (sal_Int16)( aLineSpacing.Height ); + mnLineSpacing = static_cast( aLineSpacing.Height ); break; } } @@ -1172,14 +1172,14 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bG if ( ImplGetPropertyValue( "ParaBottomMargin", bGetPropStateValue ) ) { double fSpacing = *o3tl::doAccess(mAny) + ( 2540.0 / 576.0 ) - 1; - mnLineSpacingBottom = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) ); + mnLineSpacingBottom = static_cast(-( fSpacing * 576.0 / 2540.0 ) ); } meLineSpacingBottom = ePropState; if ( ImplGetPropertyValue( "ParaTopMargin", bGetPropStateValue ) ) { double fSpacing = *o3tl::doAccess(mAny) + ( 2540.0 / 576.0 ) - 1; - mnLineSpacingTop = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) ); + mnLineSpacingTop = static_cast(-( fSpacing * 576.0 / 2540.0 ) ); } meLineSpacingTop = ePropState; @@ -1420,11 +1420,11 @@ sal_uInt32 FontCollection::GetId( FontCollectionEntry& rEntry ) pVDev->SetFont( aFont ); FontMetric aMetric( pVDev->GetFontMetric() ); - sal_uInt16 nTxtHeight = (sal_uInt16)aMetric.GetAscent() + (sal_uInt16)aMetric.GetDescent(); + sal_uInt16 nTxtHeight = static_cast(aMetric.GetAscent()) + static_cast(aMetric.GetDescent()); if ( nTxtHeight ) { - double fScaling = (double)nTxtHeight / 120.0; + double fScaling = static_cast(nTxtHeight) / 120.0; if ( ( fScaling > 0.50 ) && ( fScaling < 1.5 ) ) rEntry.Scaling = fScaling; } diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index 60900a642ca8..855ec8290a1a 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -188,19 +188,19 @@ bool SdGRFFilter::Import() if ( ( ( aGrfSize.Height() > aPagSize.Height() ) || ( aGrfSize.Width() > aPagSize.Width() ) ) && aGrfSize.Height() && aPagSize.Height() ) { - double fGrfWH = (double) aGrfSize.Width() / aGrfSize.Height(); - double fWinWH = (double) aPagSize.Width() / aPagSize.Height(); + double fGrfWH = static_cast(aGrfSize.Width()) / aGrfSize.Height(); + double fWinWH = static_cast(aPagSize.Width()) / aPagSize.Height(); // adjust graphic to page size (scales) if( fGrfWH < fWinWH ) { - aGrfSize.Width() = (long) ( aPagSize.Height() * fGrfWH ); + aGrfSize.Width() = static_cast( aPagSize.Height() * fGrfWH ); aGrfSize.Height() = aPagSize.Height(); } else if( fGrfWH > 0.F ) { aGrfSize.Width() = aPagSize.Width(); - aGrfSize.Height()= (long) ( aPagSize.Width() / fGrfWH ); + aGrfSize.Height()= static_cast( aPagSize.Width() / fGrfWH ); } } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 497a0912f5c1..dbc632cd9ede 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -437,20 +437,20 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams if(!aTmp.isEmpty()) { aTmp = aTmp.replaceFirst("%", ""); - mnCompression = (sal_Int16)aTmp.toInt32(); + mnCompression = static_cast(aTmp.toInt32()); } } else if ( pParams->Name == "Width" ) { sal_Int32 temp = 0; pParams->Value >>= temp; - mnWidthPixel = (sal_uInt16)temp; + mnWidthPixel = static_cast(temp); } else if ( pParams->Name == "UseButtonSet" ) { sal_Int32 temp = 0; pParams->Value >>= temp; - mnButtonThema = (sal_Int16)temp; + mnButtonThema = static_cast(temp); } else if ( pParams->Name == "IsExportNotes" ) { @@ -599,9 +599,9 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams // calculate image sizes SdPage* pPage = mpDoc->GetSdPage(0, PageKind::Standard); Size aTmpSize( pPage->GetSize() ); - double dRatio=((double)aTmpSize.Width())/aTmpSize.Height(); + double dRatio=static_cast(aTmpSize.Width())/aTmpSize.Height(); - mnHeightPixel = (sal_uInt16)(mnWidthPixel/dRatio); + mnHeightPixel = static_cast(mnWidthPixel/dRatio); // we come up with a destination... @@ -978,13 +978,13 @@ bool HtmlExport::CreateImagesForPresPages( bool bThumbnail) Sequence< PropertyValue > aFilterData(((meFormat==FORMAT_JPG)&&(mnCompression != -1))? 3 : 2); aFilterData[0].Name = "PixelWidth"; - aFilterData[0].Value <<= (sal_Int32)(bThumbnail ? PUB_THUMBNAIL_WIDTH : mnWidthPixel ); + aFilterData[0].Value <<= static_cast(bThumbnail ? PUB_THUMBNAIL_WIDTH : mnWidthPixel ); aFilterData[1].Name = "PixelHeight"; - aFilterData[1].Value <<= (sal_Int32)(bThumbnail ? PUB_THUMBNAIL_HEIGHT : mnHeightPixel); + aFilterData[1].Value <<= static_cast(bThumbnail ? PUB_THUMBNAIL_HEIGHT : mnHeightPixel); if((meFormat==FORMAT_JPG)&&(mnCompression != -1)) { aFilterData[2].Name = "Quality"; - aFilterData[2].Value <<= (sal_Int32)mnCompression; + aFilterData[2].Value <<= static_cast(mnCompression); } Sequence< PropertyValue > aDescriptor( 3 ); @@ -1335,7 +1335,7 @@ void HtmlExport::WriteOutlinerParagraph(OUStringBuffer& aStr, SdrOutliner* pOutl if(pParagraph == nullptr) continue; - const sal_Int16 nDepth = (sal_uInt16) pOutliner->GetDepth(nIndex); + const sal_Int16 nDepth = static_cast(pOutliner->GetDepth(nIndex)); OUString aParaText = ParagraphToHTMLString(pOutliner, nIndex, rBackgroundColor); if (aParaText.isEmpty()) @@ -1696,11 +1696,11 @@ bool HtmlExport::CreateHtmlForPresPages() // origin of ordinates aRect.Move(-pPage->GetLeftBorder(), -pPage->GetUpperBorder()); - double fLogicToPixel = ((double)mnWidthPixel) / nPageWidth; - aRect.Left() = (long)(aRect.Left() * fLogicToPixel); - aRect.Top() = (long)(aRect.Top() * fLogicToPixel); - aRect.Right() = (long)(aRect.Right() * fLogicToPixel); - aRect.Bottom() = (long)(aRect.Bottom() * fLogicToPixel); + double fLogicToPixel = static_cast(mnWidthPixel) / nPageWidth; + aRect.Left() = static_cast(aRect.Left() * fLogicToPixel); + aRect.Top() = static_cast(aRect.Top() * fLogicToPixel); + aRect.Right() = static_cast(aRect.Right() * fLogicToPixel); + aRect.Bottom() = static_cast(aRect.Bottom() * fLogicToPixel); long nRadius = aRect.GetWidth() / 2; /** @@ -1746,10 +1746,10 @@ bool HtmlExport::CreateHtmlForPresPages() // conversion into pixel coordinates aArea.Move(aLogPos.X() - pPage->GetLeftBorder(), aLogPos.Y() - pPage->GetUpperBorder()); - aArea.Left() = (long)(aArea.Left() * fLogicToPixel); - aArea.Top() = (long)(aArea.Top() * fLogicToPixel); - aArea.Right() = (long)(aArea.Right() * fLogicToPixel); - aArea.Bottom() = (long)(aArea.Bottom() * fLogicToPixel); + aArea.Left() = static_cast(aArea.Left() * fLogicToPixel); + aArea.Top() = static_cast(aArea.Top() * fLogicToPixel); + aArea.Right() = static_cast(aArea.Right() * fLogicToPixel); + aArea.Bottom() = static_cast(aArea.Bottom() * fLogicToPixel); aStr.append(CreateHTMLRectArea(aArea, aURL)); } @@ -1761,12 +1761,12 @@ bool HtmlExport::CreateHtmlForPresPages() GetCenter(false)); aCenter += Point(aLogPos.X() - pPage->GetLeftBorder(), aLogPos.Y() - pPage->GetUpperBorder()); - aCenter.X() = (long)(aCenter.X() * fLogicToPixel); - aCenter.Y() = (long)(aCenter.Y() * fLogicToPixel); + aCenter.X() = static_cast(aCenter.X() * fLogicToPixel); + aCenter.Y() = static_cast(aCenter.Y() * fLogicToPixel); sal_uLong nCircleRadius = static_cast(pArea)-> GetRadius(false); - nCircleRadius = (sal_uLong)(nCircleRadius * fLogicToPixel); + nCircleRadius = static_cast(nCircleRadius * fLogicToPixel); aStr.append(CreateHTMLCircleArea(nCircleRadius, aCenter.X(), aCenter.Y(), aURL)); @@ -1835,7 +1835,7 @@ bool HtmlExport::CreateHtmlForPresPages() else nPage = nSdPage - 1; - aHRef = CreatePageURL( (sal_uInt16) nPage); + aHRef = CreatePageURL( static_cast(nPage)); } break; @@ -1847,7 +1847,7 @@ bool HtmlExport::CreateHtmlForPresPages() else nPage = nSdPage + 1; - aHRef = CreatePageURL( (sal_uInt16) nPage); + aHRef = CreatePageURL( static_cast(nPage)); } break; @@ -2353,7 +2353,7 @@ bool HtmlExport::CreateFrames() if(mbNotes) { aStr.append(" (static_cast(mnWidthPixel) * 0.75) + 16)); aStr.append(",*\">\r\n"); } else @@ -2805,8 +2805,8 @@ OUString HtmlExport::CreateHTMLPolygonArea( const ::basegfx::B2DPolyPolygon& rPo // origin of ordinates aPnt.Move(aShift.Width(), aShift.Height()); - aPnt.X() = (long)(aPnt.X() * fFactor); - aPnt.Y() = (long)(aPnt.Y() * fFactor); + aPnt.X() = static_cast(aPnt.X() * fFactor); + aPnt.Y() = static_cast(aPnt.Y() * fFactor); aStr.append(OUString::number(aPnt.X()) + "," + OUString::number(aPnt.Y())); if (nPoint < nNoOfPoints - 1) @@ -2838,7 +2838,7 @@ OUString HtmlExport::StringToHTMLString( const OUString& rString ) { SvMemoryStream aMemStm; HTMLOutFuncs::Out_String( aMemStm, rString, RTL_TEXTENCODING_UTF8 ); - aMemStm.WriteChar( (char) 0 ); + aMemStm.WriteChar( char(0) ); sal_Int32 nLength = strlen(static_cast(aMemStm.GetData())); return OUString( static_cast(aMemStm.GetData()), nLength, RTL_TEXTENCODING_UTF8 ); } @@ -2892,7 +2892,7 @@ bool HtmlExport::CopyScript( const OUString& rPath, const OUString& rSource, con if( nErr != ERRCODE_NONE ) { ErrorHandler::HandleError( nErr ); - return (bool) nErr; + return static_cast(nErr); } OUString aScript(aScriptBuf.makeStringAndClear()); diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index cacef11b2626..d65844384cf0 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -60,7 +60,7 @@ using namespace com::sun::star::beans; #define NOOFPAGES 6 //ID for the config-data with the HTML-settings -const sal_uInt16 nMagic = (sal_uInt16)0x1977; +const sal_uInt16 nMagic = sal_uInt16(0x1977); // Key for the soffice.ini #define KEY_QUALITY "JPG-EXPORT-QUALITY" @@ -773,7 +773,7 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) else ePublishMode = PUBLISH_HTML; - aValue.Value <<= (sal_Int32) ePublishMode; + aValue.Value <<= static_cast(ePublishMode); aProps.push_back( aValue ); aValue.Name = "IsExportContentsPage"; @@ -811,7 +811,7 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) if( pPage2_Kiosk->IsChecked() && pPage2_ChgAuto->IsChecked() ) { aValue.Name = "KioskSlideDuration"; - aValue.Value <<= (sal_uInt32)pPage2_Duration->GetTime().GetMSFromTime() / 1000; + aValue.Value <<= static_cast(pPage2_Duration->GetTime().GetMSFromTime()) / 1000; aProps.push_back( aValue ); aValue.Name = "KioskEndless"; @@ -887,7 +887,7 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) if( !pPage5_TextOnly->IsChecked() ) { aValue.Name = "UseButtonSet"; - aValue.Value <<= (sal_Int32)(pPage5_Buttons->GetSelectItemId() - 1); + aValue.Value <<= static_cast(pPage5_Buttons->GetSelectItemId() - 1); aProps.push_back( aValue ); } @@ -895,23 +895,23 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) if( pPage6_User->IsChecked() ) { aValue.Name = "BackColor"; - aValue.Value <<= (sal_Int32)m_aBackColor.GetColor(); + aValue.Value <<= static_cast(m_aBackColor.GetColor()); aProps.push_back( aValue ); aValue.Name = "TextColor"; - aValue.Value <<= (sal_Int32)m_aTextColor.GetColor(); + aValue.Value <<= static_cast(m_aTextColor.GetColor()); aProps.push_back( aValue ); aValue.Name = "LinkColor"; - aValue.Value <<= (sal_Int32)m_aLinkColor.GetColor(); + aValue.Value <<= static_cast(m_aLinkColor.GetColor()); aProps.push_back( aValue ); aValue.Name = "VLinkColor"; - aValue.Value <<= (sal_Int32)m_aVLinkColor.GetColor(); + aValue.Value <<= static_cast(m_aVLinkColor.GetColor()); aProps.push_back( aValue ); aValue.Name = "ALinkColor"; - aValue.Value <<= (sal_Int32)m_aALinkColor.GetColor(); + aValue.Value <<= static_cast(m_aALinkColor.GetColor()); aProps.push_back( aValue ); } @@ -1341,7 +1341,7 @@ void SdPublishingDlg::LoadPreviewButtons() { if( mpButtonSet->getPreview( nSet, aButtonNames, aImage ) ) { - pPage5_Buttons->InsertItem( (sal_uInt16)nSet+1, aImage ); + pPage5_Buttons->InsertItem( static_cast(nSet)+1, aImage ); if( nHeight < aImage.GetSizePixel().Height() ) nHeight = aImage.GetSizePixel().Height(); } @@ -1493,7 +1493,7 @@ void SdPublishingDlg::GetDesign( SdPublishingDesign* pDesign ) pDesign->m_aURL = pPage2_URL->GetText(); pDesign->m_bAutoSlide = pPage2_ChgAuto->IsChecked(); - pDesign->m_nSlideDuration = (sal_uInt32)pPage2_Duration->GetTime().GetMSFromTime() / 1000; + pDesign->m_nSlideDuration = static_cast(pPage2_Duration->GetTime().GetMSFromTime()) / 1000; pDesign->m_bEndless = pPage2_Endless->IsChecked(); } @@ -1571,7 +1571,7 @@ bool SdPublishingDlg::Save() { SdIOCompat aIO(*pStream, StreamMode::WRITE, 0); - sal_uInt16 nDesigns = (sal_uInt16) m_aDesignList.size(); + sal_uInt16 nDesigns = static_cast(m_aDesignList.size()); pStream->WriteUInt16( nDesigns ); for( sal_uInt16 nIndex = 0; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index dae80f480de8..0b64546358d7 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -487,7 +487,7 @@ bool ImplSdPPTImport::Import() sal_Int32 nNumber = aStringAry[ nToken ].toInt32(); if ( ( nNumber & ~0xff ) == 0 ) { - nPageNumber = (sal_uInt32)nNumber - 1; + nPageNumber = static_cast(nNumber) - 1; bDocInternalSubAddress = true; break; } @@ -501,7 +501,7 @@ bool ImplSdPPTImport::Import() pHyperlink->aConvSubString = maSlideNameList[ nPageNumber ]; if ( pHyperlink->aConvSubString.isEmpty() ) { - pHyperlink->aConvSubString = SdResId( STR_PAGE ) + " " + ( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) ); + pHyperlink->aConvSubString = SdResId( STR_PAGE ) + " " + ( mpDoc->CreatePageNumValue( static_cast(nPageNumber) + 1 ) ); } } else { // if sub address is given but not internal, use it as it is @@ -634,7 +634,7 @@ bool ImplSdPPTImport::Import() if ( ePgKind == PageKind::Standard ) { // standard page: create new presentation layout aLayoutName = SdResId( STR_LAYOUT_DEFAULT_TITLE_NAME ); - aLayoutName += OUString::number( (sal_Int32)( ( nMasterNum + 1 ) / 2 - 1 ) ); + aLayoutName += OUString::number( static_cast( ( nMasterNum + 1 ) / 2 - 1 ) ); static_cast( mpDoc->GetStyleSheetPool() )->CreateLayoutStyleSheets( aLayoutName ); } else // note page: use presentation layout of standard page @@ -2484,8 +2484,8 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || aOutlineSize.Width() == 0 || - (double)aLogicSize.Width() / aOutlineSize.Width() < 0.48 || - (double)aLogicSize.Width() / aOutlineSize.Width() > 0.5) + static_cast(aLogicSize.Width()) / aOutlineSize.Width() < 0.48 || + static_cast(aLogicSize.Width()) / aOutlineSize.Width() > 0.5) { pPresObj->SetUserCall(nullptr); } @@ -2515,8 +2515,8 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || aOutlineSize.Width() == 0 || - (double)aLogicSize.Width() / aOutlineSize.Width() < 0.48 || - (double)aLogicSize.Width() / aOutlineSize.Width() > 0.5) + static_cast(aLogicSize.Width()) / aOutlineSize.Width() < 0.48 || + static_cast(aLogicSize.Width()) / aOutlineSize.Width() > 0.5) { pPresObj->SetUserCall( nullptr ); } diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 34190b2566be..01bdde01703a 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -300,7 +300,7 @@ int AnimationImporter::importAnimationContainer( const Atom* pAtom, const Refere if( is_random( aNode, aSet, nPresetClass ) ) { // create a random animation node with the given preset class - xNode.set( sd::RandomAnimationNode_createInstance( (sal_Int16)nPresetClass ), UNO_QUERY ); + xNode.set( sd::RandomAnimationNode_createInstance( static_cast(nPresetClass) ), UNO_QUERY ); } if( !xNode.is() ) @@ -723,14 +723,14 @@ bool AnimationImporter::convertAnimationValue( oox::ppt::MS_AttributeNames eAttr { OUString aString; rValue >>= aString; - rValue <<= (sal_Int16)aString.toDouble(); + rValue <<= static_cast(aString.toDouble()); bRet = true; } else if( rValue.getValueType() == cppu::UnoType::get() ) { double fValue = 0.0; rValue >>= fValue; - rValue <<= (sal_Int16)fValue; + rValue <<= static_cast(fValue); bRet = true; } } @@ -747,10 +747,10 @@ bool AnimationImporter::convertAnimationValue( oox::ppt::MS_AttributeNames eAttr if( aString.getLength() >= 7 && aString[0] == '#' ) { Color aColor; - aColor.SetRed( (sal_uInt8)(lcl_gethex( aString[1] ) * 16 + lcl_gethex( aString[2] )) ); - aColor.SetGreen( (sal_uInt8)(lcl_gethex( aString[3] ) * 16 + lcl_gethex( aString[4] )) ); - aColor.SetBlue( (sal_uInt8)(lcl_gethex( aString[5] ) * 16 + lcl_gethex( aString[6] )) ); - rValue <<= (sal_Int32)aColor.GetColor(); + aColor.SetRed( static_cast(lcl_gethex( aString[1] ) * 16 + lcl_gethex( aString[2] )) ); + aColor.SetGreen( static_cast(lcl_gethex( aString[3] ) * 16 + lcl_gethex( aString[4] )) ); + aColor.SetBlue( static_cast(lcl_gethex( aString[5] ) * 16 + lcl_gethex( aString[6] )) ); + rValue <<= static_cast(aColor.GetColor()); bRet = true; } else if( aString.startsWith( "rgb(" ) ) @@ -758,10 +758,10 @@ bool AnimationImporter::convertAnimationValue( oox::ppt::MS_AttributeNames eAttr aString = aString.copy( 4, aString.getLength() - 5 ); Color aColor; sal_Int32 index = 0; - aColor.SetRed( (sal_uInt8)aString.getToken( 0, ',', index ).toInt32() ); - aColor.SetGreen( (sal_uInt8)aString.getToken( 0, ',', index ).toInt32() ); - aColor.SetRed( (sal_uInt8)aString.getToken( 0, ',', index ).toInt32() ); - rValue <<= (sal_Int32)aColor.GetColor(); + aColor.SetRed( static_cast(aString.getToken( 0, ',', index ).toInt32()) ); + aColor.SetGreen( static_cast(aString.getToken( 0, ',', index ).toInt32()) ); + aColor.SetRed( static_cast(aString.getToken( 0, ',', index ).toInt32()) ); + rValue <<= static_cast(aColor.GetColor()); bRet = true; } else if( aString.startsWith( "hsl(" ) ) @@ -845,7 +845,7 @@ bool AnimationImporter::convertAnimationValue( oox::ppt::MS_AttributeNames eAttr OUString aString; if( rValue >>= aString ) { - rValue <<= (float)aString.toDouble(); + rValue <<= static_cast(aString.toDouble()); bRet = true; } } @@ -1215,7 +1215,7 @@ int AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference< case 2: nIterateType = TextAnimationType::BY_LETTER; break; } xIter->setIterateType( nIterateType ); - xIter->setIterateInterval( (double)fInterval ); + xIter->setIterateInterval( static_cast(fInterval) ); } nNodes++; @@ -1398,7 +1398,7 @@ void AnimationImporter::importAnimateFilterContainer( const Atom* pAtom, const R break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -1530,7 +1530,7 @@ void AnimationImporter::importAnimateAttributeTargetContainer( const Atom* pAtom break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -1576,8 +1576,8 @@ Any AnimationImporter::implGetColorAny( sal_Int32 nMode, sal_Int32 nA, sal_Int3 dump( "rgb(%ld", nA ); dump( ",%ld", nB ); dump( ",%ld)", nC ); - Color aColor( (sal_uInt8)nA, (sal_uInt8)nB, (sal_uInt8)nC ); - return makeAny( (sal_Int32)aColor.GetRGBColor() ); + Color aColor( static_cast(nA), static_cast(nB), static_cast(nC) ); + return makeAny( static_cast(aColor.GetRGBColor()) ); } case 1: // hsl { @@ -1594,12 +1594,12 @@ Any AnimationImporter::implGetColorAny( sal_Int32 nMode, sal_Int32 nA, sal_Int3 case 2: // index { Color aColor; - mpPPTImport->GetColorFromPalette((sal_uInt16)nA, aColor ); + mpPPTImport->GetColorFromPalette(static_cast(nA), aColor ); dump( "index(%ld", nA ); - dump( " [%ld", (sal_Int32)aColor.GetRed() ); - dump( ",%ld", (sal_Int32)aColor.GetGreen() ); - dump( ",%ld])", (sal_Int32)aColor.GetBlue() ); - return makeAny( (sal_Int32)aColor.GetRGBColor() ); + dump( " [%ld", static_cast(aColor.GetRed()) ); + dump( ",%ld", static_cast(aColor.GetGreen()) ); + dump( ",%ld])", static_cast(aColor.GetBlue()) ); + return makeAny( static_cast(aColor.GetRGBColor()) ); } default: @@ -1677,7 +1677,7 @@ void AnimationImporter::importAnimateColorContainer( const Atom* pAtom, const Re break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -1734,7 +1734,7 @@ void AnimationImporter::importAnimateSetContainer( const Atom* pAtom, const Refe break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -1811,7 +1811,7 @@ void AnimationImporter::importAnimateContainer( const Atom* pAtom, const Referen } break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -1891,7 +1891,7 @@ void AnimationImporter::importAnimateMotionContainer( const Atom* pAtom, const R break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -1955,7 +1955,7 @@ void AnimationImporter::importCommandContainer( const Atom* pAtom, const Referen break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -2078,7 +2078,7 @@ int AnimationImporter::importAudioContainer( const Atom* pAtom, const Reference< break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -2127,24 +2127,24 @@ void AnimationImporter::importAnimateScaleContainer( const Atom* pAtom, const Re // 'from' value if( nBits & 2 ) { - aPair.First <<= (double)fFromX / 100.0; - aPair.Second <<= (double)fFromY / 100.0; + aPair.First <<= static_cast(fFromX) / 100.0; + aPair.Second <<= static_cast(fFromY) / 100.0; xTransform->setFrom( makeAny( aPair ) ); } // 'to' value if( nBits & 4 ) { - aPair.First <<= (double)fToX / 100.0; - aPair.Second <<= (double)fToY / 100.0; + aPair.First <<= static_cast(fToX) / 100.0; + aPair.Second <<= static_cast(fToY) / 100.0; xTransform->setTo( makeAny( aPair ) ); } // 'by' value if( nBits & 1 ) { - aPair.First <<= (double)fByX / 100.0; - aPair.Second <<= (double)fByY / 100.0; + aPair.First <<= static_cast(fByX) / 100.0; + aPair.Second <<= static_cast(fByY) / 100.0; if( nBits & 2 ) { @@ -2183,7 +2183,7 @@ void AnimationImporter::importAnimateScaleContainer( const Atom* pAtom, const Re break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -2222,13 +2222,13 @@ void AnimationImporter::importAnimateRotationContainer( const Atom* pAtom, const mrStCtrl.ReadUInt32( nBits ).ReadFloat( fBy ).ReadFloat( fFrom ).ReadFloat( fTo ).ReadUInt32( nU1 ); if( nBits & 1 ) - xTransform->setBy( makeAny( (double) fBy ) ); + xTransform->setBy( makeAny( static_cast(fBy) ) ); if( nBits & 2 ) - xTransform->setFrom( makeAny( (double) fFrom ) ); + xTransform->setFrom( makeAny( static_cast(fFrom) ) ); if( nBits & 4 ) - xTransform->setTo( makeAny( (double) fTo ) ); + xTransform->setTo( makeAny( static_cast(fTo) ) ); #ifdef DBG_ANIM_LOG if( nBits & 1 ) @@ -2251,7 +2251,7 @@ void AnimationImporter::importAnimateRotationContainer( const Atom* pAtom, const break; default: - dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() ); + dump( " unknown_atom=\"%ld\"", static_cast(pChildAtom->getType()) ); break; } @@ -2313,7 +2313,7 @@ void AnimationImporter::importAnimationValues( const Atom* pAtom, const Referenc { float fRepeat; mrStCtrl.ReadFloat( fRepeat ); - xNode->setRepeatCount( (fRepeat < ((float)3.40282346638528860e+38)) ? makeAny( (double)fRepeat ) : makeAny( Timing_INDEFINITE ) ); + xNode->setRepeatCount( (fRepeat < (float(3.40282346638528860e+38))) ? makeAny( static_cast(fRepeat) ) : makeAny( Timing_INDEFINITE ) ); #ifdef DBG_ANIM_LOG if( (fRepeat < ((float)3.40282346638528860e+38)) ) @@ -2333,7 +2333,7 @@ void AnimationImporter::importAnimationValues( const Atom* pAtom, const Referenc float faccelerate; mrStCtrl.ReadFloat( faccelerate ); xNode->setAcceleration( faccelerate ); - dump( " accelerate=\"%g\"", (double)faccelerate ); + dump( " accelerate=\"%g\"", static_cast(faccelerate) ); } break; @@ -2342,7 +2342,7 @@ void AnimationImporter::importAnimationValues( const Atom* pAtom, const Referenc float fdecelerate; mrStCtrl.ReadFloat( fdecelerate ); xNode->setDecelerate( fdecelerate ); - dump( " decelerate=\"%g\"", (double)fdecelerate ); + dump( " decelerate=\"%g\"", static_cast(fdecelerate) ); } break; @@ -2398,7 +2398,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen if( pIter->seekToContent() ) { mrStCtrl.ReadInt32( nTemp ); - double fTemp = (double)nTemp / 1000.0; + double fTemp = static_cast(nTemp) / 1000.0; aKeyTimes[nKeyTime] = fTemp; const Atom* pValue = Atom::findNextChildAtom(pIter); @@ -2550,7 +2550,7 @@ bool AnimationImporter::importAttributeValue( const Atom* pAtom, Any& rAny ) { float fFloat; mrStCtrl.ReadFloat( fFloat ); - rAny <<= (double)fFloat; + rAny <<= static_cast(fFloat); bOk = true; } diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index 43f35b2fe514..2c9b5b393e40 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -164,7 +164,7 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign ) ReadUtf16( pString[ i ] ); if ( pString[ nItemSize - 1 ] == 0 ) { - if ( (sal_uInt16)nItemSize > 1 ) + if ( static_cast(nItemSize) > 1 ) rString = OUString(pString.get(), lcl_getMaxSafeStrLen(nItemSize)); else rString.clear(); diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index 601ca86992c2..97b53cbcf162 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -719,7 +719,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() sValue = sName + sDisplay ; sName = ";page-number:"; sValue += sName; - sValue += OUString::number((sal_Int16)((sal_uInt16)((pDrViewSh->getCurrentPage()->GetPageNum()-1)>>1) + 1)) ; + sValue += OUString::number(static_cast(static_cast((pDrViewSh->getCurrentPage()->GetPageNum()-1)>>1) + 1)) ; sName = ";total-pages:"; sValue += sName; sValue += OUString::number(pDrViewSh->GetPageTabControl().GetPageCount()) ; @@ -807,7 +807,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() sValue = sName + sDisplay ; sName = ";page-number:"; sValue += sName; - sValue += OUString::number((sal_Int16)((sal_uInt16)((pCurrPge->GetPageNum()-1)>>1) + 1)) ; + sValue += OUString::number(static_cast(static_cast((pCurrPge->GetPageNum()-1)>>1) + 1)) ; sName = ";total-pages:"; sValue += sName; sValue += OUString::number(pDoc->GetSdPageCount(PageKind::Standard)) ; diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index 0e8d7df003e5..85c65293d485 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -731,7 +731,7 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAcces { AccessibleSlideSorterObject* pChild = nullptr; - if (nIndex>=0 && (sal_uInt32)nIndex=0 && static_cast(nIndex)=0 && (sal_uInt32)nIndex=0 && static_cast(nIndex)(a); break; } } @@ -58,9 +58,9 @@ AccessibleViewForwarder::~AccessibleViewForwarder() { ::tools::Rectangle aVisibleArea; - if((sal_uInt32)mnWindowId < mpView->PaintWindowCount()) + if(static_cast(mnWindowId) < mpView->PaintWindowCount()) { - SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow((sal_uInt32)mnWindowId); + SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(static_cast(mnWindowId)); aVisibleArea = pPaintWindow->GetVisibleArea(); } @@ -74,9 +74,9 @@ AccessibleViewForwarder::~AccessibleViewForwarder() Point AccessibleViewForwarder::LogicToPixel (const Point& rPoint) const { OSL_ASSERT (mpView != nullptr); - if((sal_uInt32)mnWindowId < mpView->PaintWindowCount()) + if(static_cast(mnWindowId) < mpView->PaintWindowCount()) { - SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow((sal_uInt32)mnWindowId); + SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(static_cast(mnWindowId)); OutputDevice& rOutDev = pPaintWindow->GetOutputDevice(); ::tools::Rectangle aBBox(static_cast(rOutDev).GetWindowExtentsRelative(nullptr)); return rOutDev.LogicToPixel (rPoint) + aBBox.TopLeft(); @@ -88,9 +88,9 @@ Point AccessibleViewForwarder::LogicToPixel (const Point& rPoint) const Size AccessibleViewForwarder::LogicToPixel (const Size& rSize) const { OSL_ASSERT (mpView != nullptr); - if((sal_uInt32)mnWindowId < mpView->PaintWindowCount()) + if(static_cast(mnWindowId) < mpView->PaintWindowCount()) { - SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow((sal_uInt32)mnWindowId); + SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(static_cast(mnWindowId)); OutputDevice& rOutDev = pPaintWindow->GetOutputDevice(); return rOutDev.LogicToPixel (rSize); } diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 28f96d559121..dad89d8f8ffe 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -232,7 +232,7 @@ void ColorPropertyBox::setValue( const Any& rValue, const OUString& ) Any ColorPropertyBox::getValue() { - return makeAny( (sal_Int32)mpControl->GetSelectEntryColor().GetRGBColor() ); + return makeAny( static_cast(mpControl->GetSelectEntryColor().GetRGBColor()) ); } Control* ColorPropertyBox::getControl() @@ -467,13 +467,13 @@ void CharHeightPropertyBox::setValue( const Any& rValue, const OUString& ) { double fValue = 0.0; rValue >>= fValue; - mpMetric->SetValue( (long)(fValue * 100.0) ); + mpMetric->SetValue( static_cast(fValue * 100.0) ); } } Any CharHeightPropertyBox::getValue() { - return makeAny( (double)mpMetric->GetValue() / 100.0 ); + return makeAny( static_cast(mpMetric->GetValue()) / 100.0 ); } Control* CharHeightPropertyBox::getControl() @@ -564,7 +564,7 @@ void TransparencyPropertyBox::setValue( const Any& rValue, const OUString& ) { double fValue = 0.0; rValue >>= fValue; - long nValue = (long)(fValue * 100); + long nValue = static_cast(fValue * 100); mpMetric->SetValue( nValue ); updateMenu(); } @@ -572,7 +572,7 @@ void TransparencyPropertyBox::setValue( const Any& rValue, const OUString& ) Any TransparencyPropertyBox::getValue() { - return makeAny( ((double)mpMetric->GetValue()) / 100.0 ); + return makeAny( static_cast(mpMetric->GetValue()) / 100.0 ); } Control* TransparencyPropertyBox::getControl() @@ -683,7 +683,7 @@ void RotationPropertyBox::setValue( const Any& rValue, const OUString& ) { double fValue = 0.0; rValue >>= fValue; - long nValue = (long)fValue; + long nValue = static_cast(fValue); mpMetric->SetValue( nValue ); updateMenu(); } @@ -691,7 +691,7 @@ void RotationPropertyBox::setValue( const Any& rValue, const OUString& ) Any RotationPropertyBox::getValue() { - return makeAny( (double)mpMetric->GetValue() ); + return makeAny( static_cast(mpMetric->GetValue()) ); } Control* RotationPropertyBox::getControl() @@ -839,9 +839,9 @@ void ScalePropertyBox::setValue( const Any& rValue, const OUString& ) long nValue; if( fValue1 ) - nValue = (long)(fValue1 * 100.0); + nValue = static_cast(fValue1 * 100.0); else - nValue = (long)(fValue2 * 100.0); + nValue = static_cast(fValue2 * 100.0); mpMetric->SetValue( nValue ); updateMenu(); } @@ -849,7 +849,7 @@ void ScalePropertyBox::setValue( const Any& rValue, const OUString& ) Any ScalePropertyBox::getValue() { - double fValue1 = (double)mpMetric->GetValue() / 100.0; + double fValue1 = static_cast(mpMetric->GetValue()) / 100.0; // Shrink animation is represented by value < 1 (< 100%) // Shrink factor is calculated as (1 + $fValue) @@ -1187,7 +1187,7 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( vcl::Window* pParent { double fIterateInterval = 0.0; pSet->getPropertyValue( nHandleIterateInterval ) >>= fIterateInterval; - mpMFTextDelay->SetValue( (long)(fIterateInterval*10) ); + mpMFTextDelay->SetValue( static_cast(fIterateInterval*10) ); } } else @@ -1222,14 +1222,14 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( vcl::Window* pParent OUString aString = maSoundList[ i ]; if( aString == aSoundURL ) { - nPos = (sal_Int32)i+2; + nPos = static_cast(i)+2; break; } } if( nPos == 0 ) { - nPos = (sal_Int32)maSoundList.size()+2; + nPos = static_cast(maSoundList.size())+2; maSoundList.push_back( aSoundURL ); INetURLObject aURL( aSoundURL ); nPos = mpLBSound->InsertEntry( aURL.GetBase(), nPos ); @@ -1381,7 +1381,7 @@ void CustomAnimationEffectTabPage::update( STLPropertySet* pSet ) if( nPos == 1 ) { Color aSelectedColor = mpCLBDimColor->GetSelectEntryColor(); - aDimColor <<= (sal_Int32)aSelectedColor.GetRGBColor(); + aDimColor <<= static_cast(aSelectedColor.GetRGBColor()); } if( (mpSet->getPropertyState( nHandleDimColor ) == STLPropertyState::Ambiguous) || @@ -1434,7 +1434,7 @@ void CustomAnimationEffectTabPage::update( STLPropertySet* pSet ) nPos = mpLBSound->GetSelectedEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - Any aNewSoundURL, aOldSoundURL( makeAny( (sal_Int32) 0 ) ); + Any aNewSoundURL, aOldSoundURL( makeAny( sal_Int32(0) ) ); if( nPos == 0 ) { @@ -1642,7 +1642,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pPar { double fBegin = 0.0; pSet->getPropertyValue( nHandleBegin ) >>= fBegin; - mpMFStartDelay->SetValue( (long)(fBegin*10) ); + mpMFStartDelay->SetValue( static_cast(fBegin*10) ); } if( pSet->getPropertyState( nHandleDuration ) != STLPropertyState::Ambiguous ) @@ -1752,7 +1752,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pPar OUString aDescription( getShapeDescription( xShape, true ) ); sal_Int32 nPos = mpLBTrigger->InsertEntry( aDescription ); - mpLBTrigger->SetEntryData( nPos, reinterpret_cast((sal_IntPtr)nShape) ); + mpLBTrigger->SetEntryData( nPos, reinterpret_cast(static_cast(nShape)) ); if( xShape == xTrigger ) mpLBTrigger->SelectEntryPos( nPos ); } @@ -1936,7 +1936,7 @@ void CustomAnimationDurationTabPage::update( STLPropertySet* pSet ) nPos = mpLBTrigger->GetSelectedEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_Int32 nShape = (sal_Int32)reinterpret_cast(mpLBTrigger->GetEntryData( nPos )); + sal_Int32 nShape = static_cast(reinterpret_cast(mpLBTrigger->GetEntryData( nPos ))); Reference< XDrawPage > xCurrentPage; mpSet->getPropertyValue( nHandleCurrentPage ) >>= xCurrentPage; @@ -2015,7 +2015,7 @@ CustomAnimationTextAnimTabPage::CustomAnimationTextAnimTabPage(vcl::Window* pPar { maCBXGroupAuto->Check( fTextGroupingAuto >= 0.0 ); if( fTextGroupingAuto >= 0.0 ) - maMFGroupAuto->SetValue( (long)(fTextGroupingAuto*10) ); + maMFGroupAuto->SetValue( static_cast(fTextGroupingAuto*10) ); } } else @@ -2230,15 +2230,15 @@ STLPropertySet* CustomAnimationDialog::createDefaultSet() Any aEmpty; STLPropertySet* pSet = new STLPropertySet(); - pSet->setPropertyDefaultValue( nHandleMaxParaDepth, makeAny( (sal_Int32)-1 ) ); + pSet->setPropertyDefaultValue( nHandleMaxParaDepth, makeAny( sal_Int32(-1) ) ); pSet->setPropertyDefaultValue( nHandleHasAfterEffect, makeAny( false ) ); pSet->setPropertyDefaultValue( nHandleAfterEffectOnNextEffect, makeAny( false ) ); pSet->setPropertyDefaultValue( nHandleDimColor, aEmpty ); - pSet->setPropertyDefaultValue( nHandleIterateType, makeAny( (sal_Int16)0 ) ); + pSet->setPropertyDefaultValue( nHandleIterateType, makeAny( sal_Int16(0) ) ); pSet->setPropertyDefaultValue( nHandleIterateInterval, makeAny( 0.0 ) ); - pSet->setPropertyDefaultValue( nHandleStart, makeAny( (sal_Int16)EffectNodeType::ON_CLICK ) ); + pSet->setPropertyDefaultValue( nHandleStart, makeAny( sal_Int16(EffectNodeType::ON_CLICK) ) ); pSet->setPropertyDefaultValue( nHandleBegin, makeAny( 0.0 ) ); pSet->setPropertyDefaultValue( nHandleDuration, makeAny( 2.0 ) ); pSet->setPropertyDefaultValue( nHandleRepeat, aEmpty ); @@ -2258,7 +2258,7 @@ STLPropertySet* CustomAnimationDialog::createDefaultSet() pSet->setPropertyDefaultValue( nHandleHasText, makeAny( false ) ); pSet->setPropertyDefaultValue( nHandleHasVisibleShape, makeAny( false ) ); - pSet->setPropertyDefaultValue( nHandleTextGrouping, makeAny( (sal_Int32)-1 ) ); + pSet->setPropertyDefaultValue( nHandleTextGrouping, makeAny( sal_Int32(-1) ) ); pSet->setPropertyDefaultValue( nHandleAnimateForm, makeAny( true ) ); pSet->setPropertyDefaultValue( nHandleTextGroupingAuto, makeAny( -1.0 ) ); pSet->setPropertyDefaultValue( nHandleTextReverse, makeAny( false ) ); @@ -2267,9 +2267,9 @@ STLPropertySet* CustomAnimationDialog::createDefaultSet() pSet->setPropertyDefaultValue( nHandleSoundURL, aEmpty ); pSet->setPropertyDefaultValue( nHandleSoundVolumne, makeAny( 1.0) ); - pSet->setPropertyDefaultValue( nHandleSoundEndAfterSlide, makeAny( (sal_Int32)0 ) ); + pSet->setPropertyDefaultValue( nHandleSoundEndAfterSlide, makeAny( sal_Int32(0) ) ); - pSet->setPropertyDefaultValue( nHandleCommand, makeAny( (sal_Int16)0 ) ); + pSet->setPropertyDefaultValue( nHandleCommand, makeAny( sal_Int16(0) ) ); return pSet; } diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index c00aedf6c607..17ed3f4b0b36 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1158,11 +1158,11 @@ STLPropertySet* CustomAnimationPane::createSelectionSet() // convert absolute time to percentage value // This calculation is done in float to avoid some rounding artifacts. - float fIterateInterval = (float)pEffect->getIterateInterval(); + float fIterateInterval = static_cast(pEffect->getIterateInterval()); if( pEffect->getDuration() ) - fIterateInterval = (float)(fIterateInterval / pEffect->getDuration() ); + fIterateInterval = static_cast(fIterateInterval / pEffect->getDuration() ); fIterateInterval *= 100.0; - addValue( pSet, nHandleIterateInterval, makeAny( (double)fIterateInterval ) ); + addValue( pSet, nHandleIterateInterval, makeAny( static_cast(fIterateInterval) ) ); addValue( pSet, nHandleBegin, makeAny( pEffect->getBegin() ) ); addValue( pSet, nHandleDuration, makeAny( pEffect->getDuration() ) ); @@ -1196,7 +1196,7 @@ STLPropertySet* CustomAnimationPane::createSelectionSet() if( nGroupId != -1 ) pTextGroup = pEffectSequence->findGroup( nGroupId ); - addValue( pSet, nHandleTextGrouping, makeAny( pTextGroup.get() ? pTextGroup->getTextGrouping() : (sal_Int32)-1 ) ); + addValue( pSet, nHandleTextGrouping, makeAny( pTextGroup.get() ? pTextGroup->getTextGrouping() : sal_Int32(-1) ) ); addValue( pSet, nHandleAnimateForm, makeAny( pTextGroup.get() == nullptr || pTextGroup->getAnimateForm() ) ); addValue( pSet, nHandleTextGroupingAuto, makeAny( pTextGroup.get() ? pTextGroup->getTextGroupingAuto() : -1.0 ) ); addValue( pSet, nHandleTextReverse, makeAny( pTextGroup.get() && pTextGroup->getTextReverse() ) ); diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index fc01f7b7547e..5204d0f3a8ff 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -307,7 +307,7 @@ OUString lcl_getSoundFileURL( // the first three entries are no actual sounds if( nPos >= 3 ) { - DBG_ASSERT( (sal_uInt32)(rListBox->GetEntryCount() - 3) == rSoundList.size(), + DBG_ASSERT( static_cast(rListBox->GetEntryCount() - 3) == rSoundList.size(), "Sound list-box is not synchronized to sound list" ); nPos -= 3; if( rSoundList.size() > static_cast(nPos) ) diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index cdc7dac65b24..688a15873920 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -511,7 +511,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl ) if( pHdl && !rMEvt.IsRight() ) { mrView.BrkAction(); - const sal_uInt16 nDrgLog = (sal_uInt16)pOut->PixelToLogic(Size(DRGPIX,0)).Width(); + const sal_uInt16 nDrgLog = static_cast(pOut->PixelToLogic(Size(DRGPIX,0)).Width()); rtl::Reference< MotionPathTag > xTag( this ); SdrDragMethod* pDragMethod; diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index d9df5c535086..ce3a9075e5cb 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -513,7 +513,7 @@ void AnnotationManagerImpl::InsertAnnotation(const OUString& rText) xAnnotation->setDateTime( getCurrentDateTime() ); // set position - RealPoint2D aPos( ((double)x) / 100.0, ((double)y) / 100.0 ); + RealPoint2D aPos( static_cast(x) / 100.0, static_cast(y) / 100.0 ); xAnnotation->setPosition( aPos ); if( mpDoc->IsUndoEnabled() ) diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index bd3de09cabfe..87acb02941b9 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -368,8 +368,8 @@ void AnnotationTag::Move( int nDX, int nDY ) mrManager.GetDoc()->BegUndo( SdResId( STR_ANNOTATION_UNDO_MOVE ) ); RealPoint2D aPosition( mxAnnotation->getPosition() ); - aPosition.X += (double)nDX / 100.0; - aPosition.Y += (double)nDY / 100.0; + aPosition.X += static_cast(nDX) / 100.0; + aPosition.Y += static_cast(nDY) / 100.0; mxAnnotation->setPosition( aPosition ); if( mrManager.GetDoc()->IsUndoEnabled() ) @@ -649,7 +649,7 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent&, rEvent, void) if( pHdl ) { mrView.BrkAction(); - const sal_uInt16 nDrgLog = (sal_uInt16)pWindow->PixelToLogic(Size(DRGPIX,0)).Width(); + const sal_uInt16 nDrgLog = static_cast(pWindow->PixelToLogic(Size(DRGPIX,0)).Width()); rtl::Reference< AnnotationTag > xTag( this ); diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 46de3bffe1b7..78ed4d898651 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -95,15 +95,15 @@ using namespace ::com::sun::star::text; #define METABUTTON_WIDTH 16 #define METABUTTON_HEIGHT 18 #define METABUTTON_AREA_WIDTH 30 -#define POSTIT_META_HEIGHT (sal_Int32) 30 +#define POSTIT_META_HEIGHT sal_Int32(30) namespace sd { Color ColorFromAlphaColor(sal_uInt8 aTransparency, Color const &aFront, Color const &aBack ) { - return Color((sal_uInt8)(aFront.GetRed() * aTransparency/(double)255 + aBack.GetRed() * (1-aTransparency/(double)255)), - (sal_uInt8)(aFront.GetGreen() * aTransparency/(double)255 + aBack.GetGreen() * (1-aTransparency/(double)255)), - (sal_uInt8)(aFront.GetBlue() * aTransparency/(double)255 + aBack.GetBlue() * (1-aTransparency/(double)255))); + return Color(static_cast(aFront.GetRed() * aTransparency/double(255) + aBack.GetRed() * (1-aTransparency/double(255))), + static_cast(aFront.GetGreen() * aTransparency/double(255) + aBack.GetGreen() * (1-aTransparency/double(255))), + static_cast(aFront.GetBlue() * aTransparency/double(255) + aBack.GetBlue() * (1-aTransparency/double(255)))); } /************ AnnotationTextWindow **********************************/ diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx index ed84c83a716e..0a6f4b5656da 100644 --- a/sd/source/ui/app/optsitem.cxx +++ b/sd/source/ui/app/optsitem.cxx @@ -190,7 +190,7 @@ SdOptionsLayout::SdOptionsLayout(bool bImpress, bool bUseConfig) : bDragStripes( false ), bHandlesBezier( false ), bHelplines( true ), - nMetric((sal_uInt16)(isMetricSystem() ? FUNIT_CM : FUNIT_INCH)), + nMetric(static_cast(isMetricSystem() ? FUNIT_CM : FUNIT_INCH)), nDefTab( 1250 ) { EnableModify( true ); @@ -248,8 +248,8 @@ bool SdOptionsLayout::ReadData( const Any* pValues ) if( pValues[2].hasValue() ) SetMoveOutline( *o3tl::doAccess(pValues[ 2 ]) ); if( pValues[3].hasValue() ) SetDragStripes( *o3tl::doAccess(pValues[ 3 ]) ); if( pValues[4].hasValue() ) SetHelplines( *o3tl::doAccess(pValues[ 4 ]) ); - if( pValues[5].hasValue() ) SetMetric( (sal_uInt16) *o3tl::doAccess(pValues[ 5 ]) ); - if( pValues[6].hasValue() ) SetDefTab( (sal_uInt16) *o3tl::doAccess(pValues[ 6 ]) ); + if( pValues[5].hasValue() ) SetMetric( static_cast(*o3tl::doAccess(pValues[ 5 ])) ); + if( pValues[6].hasValue() ) SetDefTab( static_cast(*o3tl::doAccess(pValues[ 6 ])) ); return true; } @@ -261,8 +261,8 @@ bool SdOptionsLayout::WriteData( Any* pValues ) const pValues[ 2 ] <<= IsMoveOutline(); pValues[ 3 ] <<= IsDragStripes(); pValues[ 4 ] <<= IsHelplines(); - pValues[ 5 ] <<= (sal_Int32) GetMetric(); - pValues[ 6 ] <<= (sal_Int32) GetDefTab(); + pValues[ 5 ] <<= static_cast(GetMetric()); + pValues[ 6 ] <<= static_cast(GetDefTab()); return true; } @@ -577,7 +577,7 @@ bool SdOptionsMisc::WriteData( Any* pValues ) const pValues[ 6 ] <<= IsDoubleClickTextEdit(); pValues[ 7 ] <<= IsClickChangeRotation(); // The preview is not supported anymore. Use a dummy value. - pValues[ 8 ] <<= (double)0;// GetPreviewQuality(); + pValues[ 8 ] <<= double(0);// GetPreviewQuality(); pValues[ 9 ] <<= IsSolidDragging(); pValues[ 10 ] <<= GetDefaultObjectSizeWidth(); pValues[ 11 ] <<= GetDefaultObjectSizeHeight(); @@ -796,9 +796,9 @@ bool SdOptionsSnap::ReadData( const Any* pValues ) if( pValues[4].hasValue() ) SetOrtho( *o3tl::doAccess(pValues[ 4 ]) ); if( pValues[5].hasValue() ) SetBigOrtho( *o3tl::doAccess(pValues[ 5 ]) ); if( pValues[6].hasValue() ) SetRotate( *o3tl::doAccess(pValues[ 6 ]) ); - if( pValues[7].hasValue() ) SetSnapArea( (sal_Int16) *o3tl::doAccess(pValues[ 7 ]) ); - if( pValues[8].hasValue() ) SetAngle( (sal_Int16) *o3tl::doAccess(pValues[ 8 ]) ); - if( pValues[9].hasValue() ) SetEliminatePolyPointLimitAngle( (sal_Int16) *o3tl::doAccess(pValues[ 9 ]) ); + if( pValues[7].hasValue() ) SetSnapArea( static_cast(*o3tl::doAccess(pValues[ 7 ])) ); + if( pValues[8].hasValue() ) SetAngle( static_cast(*o3tl::doAccess(pValues[ 8 ])) ); + if( pValues[9].hasValue() ) SetEliminatePolyPointLimitAngle( static_cast(*o3tl::doAccess(pValues[ 9 ])) ); return true; } @@ -812,9 +812,9 @@ bool SdOptionsSnap::WriteData( Any* pValues ) const pValues[ 4 ] <<= IsOrtho(); pValues[ 5 ] <<= IsBigOrtho(); pValues[ 6 ] <<= IsRotate(); - pValues[ 7 ] <<= (sal_Int32) GetSnapArea(); - pValues[ 8 ] <<= (sal_Int32) GetAngle(); - pValues[ 9 ] <<= (sal_Int32) GetEliminatePolyPointLimitAngle(); + pValues[ 7 ] <<= static_cast(GetSnapArea()); + pValues[ 8 ] <<= static_cast(GetAngle()); + pValues[ 9 ] <<= static_cast(GetEliminatePolyPointLimitAngle()); return true; } @@ -845,8 +845,8 @@ SdOptionsSnapItem::SdOptionsSnapItem( SdOptions const * pOpts, ::sd::FrameView c maOptionsSnap.SetBigOrtho( pView->IsBigOrtho() ); maOptionsSnap.SetRotate( pView->IsAngleSnapEnabled() ); maOptionsSnap.SetSnapArea( pView->GetSnapMagneticPixel() ); - maOptionsSnap.SetAngle( (sal_Int16) pView->GetSnapAngle() ); - maOptionsSnap.SetEliminatePolyPointLimitAngle( (sal_Int16) pView->GetEliminatePolyPointLimitAngle() ); + maOptionsSnap.SetAngle( static_cast(pView->GetSnapAngle()) ); + maOptionsSnap.SetEliminatePolyPointLimitAngle( static_cast(pView->GetEliminatePolyPointLimitAngle()) ); } else if( pOpts ) { @@ -1051,12 +1051,12 @@ bool SdOptionsGrid::ReadData( const Any* pValues ) bool SdOptionsGrid::WriteData( Any* pValues ) const { - pValues[ 0 ] <<= (sal_Int32) GetFieldDrawX(); - pValues[ 1 ] <<= (sal_Int32) GetFieldDrawY(); - pValues[ 2 ] <<= ( GetFieldDivisionX() ? ( (double) GetFieldDrawX() / GetFieldDivisionX() - 1.0 ) : (double) 0 ); - pValues[ 3 ] <<= ( GetFieldDivisionY() ? ( (double) GetFieldDrawY() / GetFieldDivisionY() - 1.0 ) : (double) 0 ); - pValues[ 4 ] <<= (sal_Int32) GetFieldSnapX(); - pValues[ 5 ] <<= (sal_Int32) GetFieldSnapY(); + pValues[ 0 ] <<= static_cast(GetFieldDrawX()); + pValues[ 1 ] <<= static_cast(GetFieldDrawY()); + pValues[ 2 ] <<= ( GetFieldDivisionX() ? ( static_cast(GetFieldDrawX()) / GetFieldDivisionX() - 1.0 ) : double(0) ); + pValues[ 3 ] <<= ( GetFieldDivisionY() ? ( static_cast(GetFieldDrawY()) / GetFieldDivisionY() - 1.0 ) : double(0) ); + pValues[ 4 ] <<= static_cast(GetFieldSnapX()); + pValues[ 5 ] <<= static_cast(GetFieldSnapY()); pValues[ 6 ] <<= IsUseGridSnap(); pValues[ 7 ] <<= IsSynchronize(); pValues[ 8 ] <<= IsGridVisible(); @@ -1232,7 +1232,7 @@ bool SdOptionsPrint::ReadData( const Any* pValues ) if( pValues[7].hasValue() ) SetFrontPage( *o3tl::doAccess(pValues[ 7 ]) ); if( pValues[8].hasValue() ) SetBackPage( *o3tl::doAccess(pValues[ 8 ]) ); if( pValues[9].hasValue() ) SetPaperbin( *o3tl::doAccess(pValues[ 9 ]) ); - if( pValues[10].hasValue() ) SetOutputQuality( (sal_uInt16) *o3tl::doAccess(pValues[ 10 ]) ); + if( pValues[10].hasValue() ) SetOutputQuality( static_cast(*o3tl::doAccess(pValues[ 10 ])) ); if( pValues[11].hasValue() ) SetDraw( *o3tl::doAccess(pValues[ 11 ]) ); // just for impress @@ -1242,7 +1242,7 @@ bool SdOptionsPrint::ReadData( const Any* pValues ) if( pValues[13].hasValue() ) SetHandout( *o3tl::doAccess(pValues[ 13 ]) ); if( pValues[14].hasValue() ) SetOutline( *o3tl::doAccess(pValues[ 14 ]) ); if( pValues[15].hasValue() ) SetHandoutHorizontal( *o3tl::doAccess(pValues[15]) ); - if( pValues[16].hasValue() ) SetHandoutPages( (sal_uInt16)*o3tl::doAccess(pValues[16]) ); + if( pValues[16].hasValue() ) SetHandoutPages( static_cast(*o3tl::doAccess(pValues[16])) ); } return true; @@ -1260,7 +1260,7 @@ bool SdOptionsPrint::WriteData( Any* pValues ) const pValues[ 7 ] <<= IsFrontPage(); pValues[ 8 ] <<= IsBackPage(); pValues[ 9 ] <<= IsPaperbin(); - pValues[ 10 ] <<= (sal_Int32) GetOutputQuality(); + pValues[ 10 ] <<= static_cast(GetOutputQuality()); pValues[ 11 ] <<= IsDraw(); // just for impress diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index b48b928dd31b..16b47899ceea 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -164,8 +164,8 @@ void SdDLL::RegisterControllers(SdModule* pMod) SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod ); ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod); - ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::DrawViewShell::GetInterfaceId(), pMod ); - ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::GraphicViewShell::GetInterfaceId(), pMod ); + ::sd::NavigatorChildWindow::RegisterChildWindowContext( static_cast(::sd::DrawViewShell::GetInterfaceId()), pMod ); + ::sd::NavigatorChildWindow::RegisterChildWindowContext( static_cast(::sd::GraphicViewShell::GetInterfaceId()), pMod ); Svx3DChildWindow::RegisterChildWindow(false, pMod); SvxFontWorkChildWindow::RegisterChildWindow(false, pMod); diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 715ea305341a..2a155733d71f 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -141,7 +141,7 @@ void SdModule::Execute(SfxRequest& rReq) PutItem( *pItem ); SdOptions* pOptions = GetSdOptions( eDocType ); if(pOptions) - pOptions->SetMetric( (sal_uInt16)eUnit ); + pOptions->SetMetric( static_cast(eUnit) ); rReq.Done(); } } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 9fc37b1c70e4..395ca9eb7eaa 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -108,7 +108,7 @@ static SdPage* GetCurrentPage( sd::ViewShell const * pViewSh, EditFieldInfo cons nPgNum++; } - pPage = pViewSh->GetDoc()->GetSdPage( (sal_uInt16)nPgNum, PageKind::Standard ); + pPage = pViewSh->GetDoc()->GetSdPage( static_cast(nPgNum), PageKind::Standard ); } else { @@ -246,7 +246,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) { nPgNum = (pPage->GetPageNum() - 1) / 2 + 1; } - aRepresentation = pDoc->CreatePageNumValue((sal_uInt16)nPgNum); + aRepresentation = pDoc->CreatePageNumValue(static_cast(nPgNum)); } else aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_NUMBER); @@ -489,7 +489,7 @@ std::unique_ptr SdModule::CreateItemSet( sal_uInt16 nSlot ) if( nMetric == (FieldUnit)0xffff ) nMetric = GetFieldUnit(); - pRet->Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nMetric ) ); + pRet->Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast(nMetric) ) ); // TP_OPTIONS_MISC: SdOptionsMiscItem aSdOptionsMiscItem( pOptions, pFrameView ); @@ -497,7 +497,7 @@ std::unique_ptr SdModule::CreateItemSet( sal_uInt16 nSlot ) { aSdOptionsMiscItem.GetOptionsMisc().SetSummationOfParagraphs( pDoc->IsSummationOfParagraphs() ); aSdOptionsMiscItem.GetOptionsMisc().SetPrinterIndependentLayout ( - (sal_uInt16)pDoc->GetPrinterIndependentLayout()); + static_cast(pDoc->GetPrinterIndependentLayout())); } pRet->Put( aSdOptionsMiscItem ); diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index aca1a5e2647e..471955e3f7ba 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -184,7 +184,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) { mpGraphic = new Graphic( static_cast< SdrGrafObj* >( pObj )->GetTransformedGraphic() ); } - else if( pObj->IsUnoObj() && SdrInventor::FmForm == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == (sal_uInt16) OBJ_FM_BUTTON ) ) + else if( pObj->IsUnoObj() && SdrInventor::FmForm == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == sal_uInt16(OBJ_FM_BUTTON) ) ) { SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pObj ); diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx index bac411ee621a..7555d0d48e4b 100644 --- a/sd/source/ui/controller/displaymodecontroller.cxx +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -252,9 +252,9 @@ void DisplayModeController::setToolboxItemImage(const OUString& rImage) double scale = 1.0f; Size size = aBmp.GetSizePixel(); if (size.Width() > targetSize) - scale = (double)targetSize / (double)size.Width(); + scale = static_cast(targetSize) / static_cast(size.Width()); if (size.Height() > targetSize) - scale = ::std::min( scale, (double)targetSize / (double)size.Height() ); + scale = ::std::min( scale, static_cast(targetSize) / static_cast(size.Height()) ); aBmp.Scale( scale, scale ); pToolBox->SetItemImage( nId, Image( aBmp ) ); } diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index d414a5035779..5c50b910f14b 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -296,7 +296,7 @@ void LayoutToolbarMenu::SelectHdl(void const * pControl) { aArgs = Sequence< PropertyValue >(1); aArgs[0].Name = "WhatLayout"; - aArgs[0].Value <<= (sal_Int32)eLayout; + aArgs[0].Value <<= static_cast(eLayout); } else if( mbInsertPage ) { diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index 72d8bd2a1db2..ef8dca5ea873 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -645,8 +645,8 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl, ListBox&, void) sal_Int32 nBmpWidth = aBmp.GetSizePixel().Width(); sal_Int32 nBmpHeight = aBmp.GetSizePixel().Height(); - double nXRatio = (double) 200 / nBmpWidth; - double nYRatio = (double) 150 / nBmpHeight; + double nXRatio = double(200) / nBmpWidth; + double nYRatio = double(150) / nBmpHeight; if ( nXRatio < nYRatio ) aBmp.Scale( nXRatio, nXRatio ); else diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index ca9554ff509b..df6c64af704d 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -227,7 +227,7 @@ void ClientBox::selectEntry( const long nPos ) m_vEntries[ m_nActive ]->m_bActive = false; } - if ( ( nPos >= 0 ) && ( nPos < (long) m_vEntries.size() ) ) + if ( ( nPos >= 0 ) && ( nPos < static_cast(m_vEntries.size()) ) ) { m_bHasActive = true; m_nActive = nPos; @@ -459,7 +459,7 @@ bool ClientBox::HandleCursorKey( sal_uInt16 nKeyCode ) if ( nSelect < 0 ) nSelect = 0; - if ( nSelect >= (long) m_vEntries.size() ) + if ( nSelect >= static_cast(m_vEntries.size()) ) nSelect = m_vEntries.size() - 1; selectEntry( nSelect ); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 8d1eda9a2e56..443b8cc44408 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -85,8 +85,8 @@ void SdDisplay::Paint( vcl::RenderContext& /*rRenderContext*/, const ::tools::Re Point aPt; Size aSize = GetOutputSize(); Size aBmpSize = aBitmapEx.GetBitmap().GetSizePixel(); - aBmpSize.Width() = (long) ( (double) aBmpSize.Width() * (double) aScale ); - aBmpSize.Height() = (long) ( (double) aBmpSize.Height() * (double) aScale ); + aBmpSize.Width() = static_cast( static_cast(aBmpSize.Width()) * static_cast(aScale) ); + aBmpSize.Height() = static_cast( static_cast(aBmpSize.Height()) * static_cast(aScale) ); if( aBmpSize.Width() < aSize.Width() ) aPt.X() = ( aSize.Width() - aBmpSize.Width() ) / 2; @@ -662,8 +662,8 @@ Fraction AnimationWindow::GetScale() Size aDisplaySize(m_pCtlDisplay->GetOutputSize()); - aFrac = Fraction( std::min( (double)aDisplaySize.Width() / (double)aBmpSize.Width(), - (double)aDisplaySize.Height() / (double)aBmpSize.Height() ) ); + aFrac = Fraction( std::min( static_cast(aDisplaySize.Width()) / static_cast(aBmpSize.Width()), + static_cast(aDisplaySize.Height()) / static_cast(aBmpSize.Height()) ) ); } return aFrac; } diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 3186dd0c68aa..b5a69b709934 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -195,28 +195,28 @@ void CopyDlg::Reset() else { long nTmp; - nTmp = (long)aStr.getToken( 0, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 0, TOKEN ).toInt32()); m_pNumFldCopies->SetValue( nTmp ); - nTmp = (long)aStr.getToken( 1, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 1, TOKEN ).toInt32()); m_pMtrFldMoveX->SetValue( nTmp ); - nTmp = (long)aStr.getToken( 2, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 2, TOKEN ).toInt32()); m_pMtrFldMoveY->SetValue( nTmp ); - nTmp = (long)aStr.getToken( 3, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 3, TOKEN ).toInt32()); m_pMtrFldAngle->SetValue( nTmp ); - nTmp = (long)aStr.getToken( 4, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 4, TOKEN ).toInt32()); m_pMtrFldWidth->SetValue( nTmp ); - nTmp = (long)aStr.getToken( 5, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 5, TOKEN ).toInt32()); m_pMtrFldHeight->SetValue( nTmp ); - nTmp = (long)aStr.getToken( 6, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 6, TOKEN ).toInt32()); m_pLbStartColor->SelectEntry( Color( nTmp ) ); - nTmp = (long)aStr.getToken( 7, TOKEN ).toInt32(); + nTmp = static_cast(aStr.getToken( 7, TOKEN ).toInt32()); m_pLbEndColor->SelectEntry( Color( nTmp ) ); } @@ -232,7 +232,7 @@ void CopyDlg::GetAttr( SfxItemSet& rOutAttrs ) long nHeight = long( GetCoreValue( *m_pMtrFldHeight, MapUnit::Map100thMM) * maUIScale); long nWidth = long( GetCoreValue( *m_pMtrFldWidth, MapUnit::Map100thMM) * maUIScale); - rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, (sal_uInt16) m_pNumFldCopies->GetValue() ) ); + rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, static_cast(m_pNumFldCopies->GetValue()) ) ); rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) ); rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_Y, nMoveY ) ); rOutAttrs.Put( SfxInt32Item( ATTR_COPY_ANGLE, static_cast(m_pMtrFldAngle->GetValue()) ) ); diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index bbd107dcdb1d..9e6bab218aa2 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -74,7 +74,7 @@ SdCustomShowDlg::SdCustomShowDlg( vcl::Window* pWindow, { m_pLbCustomShows->InsertEntry( pCustomShow->GetName() ); } - m_pLbCustomShows->SelectEntryPos( (sal_Int32)nPosToSelect ); + m_pLbCustomShows->SelectEntryPos( static_cast(nPosToSelect) ); pCustomShowList->Seek( nPosToSelect ); } @@ -317,7 +317,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow, nPage < rDoc.GetSdPageCount( PageKind::Standard ); nPage++ ) { - SdPage* pPage = rDoc.GetSdPage( (sal_uInt16) nPage, PageKind::Standard ); + SdPage* pPage = rDoc.GetSdPage( static_cast(nPage), PageKind::Standard ); OUString aStr( pPage->GetName() ); m_pLbPages->InsertEntry( aStr ); } @@ -418,8 +418,8 @@ void SdDefineCustomShowDlg::ClickButtonHdl2(void const * p) nullptr, false, nPosCP ); m_pLbCustomPages->Select( pEntry ); - SdPage* pPage = rDoc.GetSdPage( (sal_uInt16) m_pLbPages-> - GetSelectedEntryPos( i ), PageKind::Standard ); + SdPage* pPage = rDoc.GetSdPage( static_cast(m_pLbPages-> + GetSelectedEntryPos( i )), PageKind::Standard ); pEntry->SetUserData( pPage ); if( nPosCP != TREELIST_APPEND ) diff --git a/sd/source/ui/dlg/diactrl.cxx b/sd/source/ui/dlg/diactrl.cxx index 8aaf23686c3d..636ffa6db47e 100644 --- a/sd/source/ui/dlg/diactrl.cxx +++ b/sd/source/ui/dlg/diactrl.cxx @@ -69,7 +69,7 @@ void SdPagesField::UpdatePagesField( const SfxUInt16Item* pItem ) { if( pItem ) { - long nValue = (long) pItem->GetValue(); + long nValue = static_cast(pItem->GetValue()); SetValue( nValue ); if( nValue == 1 ) SetCustomUnitText( SdResId( STR_SLIDE_SINGULAR ) ); @@ -82,7 +82,7 @@ void SdPagesField::UpdatePagesField( const SfxUInt16Item* pItem ) void SdPagesField::Modify() { - SfxUInt16Item aItem( SID_PAGES_PER_ROW, (sal_uInt16) GetValue() ); + SfxUInt16Item aItem( SID_PAGES_PER_ROW, static_cast(GetValue()) ); ::uno::Any a; ::uno::Sequence< ::beans::PropertyValue > aArgs( 1 ); diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index a691b0667970..1ca852217a17 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -157,7 +157,7 @@ void OutlineBulletDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { FieldUnit eMetric = pSdView->GetDoc().GetUIUnit(); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,(sal_uInt16)eMetric)); + aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,static_cast(eMetric))); rPage.PageCreated(aSet); } } @@ -167,7 +167,7 @@ void OutlineBulletDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { FieldUnit eMetric = pSdView->GetDoc().GetUIUnit(); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,(sal_uInt16)eMetric)); + aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,static_cast(eMetric))); rPage.PageCreated(aSet); } } diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx index a80f24392012..0d53321cb1e0 100644 --- a/sd/source/ui/dlg/dlgpage.cxx +++ b/sd/source/ui/dlg/dlgpage.cxx @@ -76,9 +76,9 @@ void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); if (nId == mnPage) { - aSet.Put (SfxAllEnumItem((sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION)); - aSet.Put (SfxAllEnumItem((sal_uInt16)SID_PAPER_START, PAPER_A0)); - aSet.Put (SfxAllEnumItem((sal_uInt16)SID_PAPER_END, PAPER_E)); + aSet.Put (SfxAllEnumItem(sal_uInt16(SID_ENUM_PAGE_MODE), SVX_PAGE_MODE_PRESENTATION)); + aSet.Put (SfxAllEnumItem(sal_uInt16(SID_PAPER_START), PAPER_A0)); + aSet.Put (SfxAllEnumItem(sal_uInt16(SID_PAPER_END), PAPER_E)); rPage.PageCreated(aSet); } else if (nId == mnArea) diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx index 9f7ede841d56..2f1554389db1 100644 --- a/sd/source/ui/dlg/dlgsnap.cxx +++ b/sd/source/ui/dlg/dlgsnap.cxx @@ -155,7 +155,7 @@ void SdSnapLineDlg::GetAttr(SfxItemSet& rOutAttrs) nXValue = long( GetCoreValue( *m_pMtrFldX, MapUnit::Map100thMM) * aUIScale); nYValue = long( GetCoreValue( *m_pMtrFldY, MapUnit::Map100thMM) * aUIScale); - rOutAttrs.Put(SfxAllEnumItem(ATTR_SNAPLINE_KIND, (sal_uInt16)eKind)); + rOutAttrs.Put(SfxAllEnumItem(ATTR_SNAPLINE_KIND, static_cast(eKind))); rOutAttrs.Put(SfxInt32Item(ATTR_SNAPLINE_X, nXValue)); rOutAttrs.Put(SfxInt32Item(ATTR_SNAPLINE_Y, nYValue)); } diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index 846b4f46207a..85dea1b94a90 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -95,17 +95,17 @@ void SdDocPreviewWin::CalcSizeAndPos( Size& rSize, Point& rPoint ) if( nHeight < 0 ) nHeight = 0; double dRatio = 1; - double dRatioPreV = nHeight ? (((double) nWidth ) / nHeight) : 0.0; + double dRatioPreV = nHeight ? (static_cast(nWidth) / nHeight) : 0.0; if (dRatio > dRatioPreV) { - rSize=Size(nWidth, (sal_uInt16)(nWidth/dRatio)); - rPoint=Point( 0, (sal_uInt16)((nHeight-rSize.Height())/2)); + rSize=Size(nWidth, static_cast(nWidth/dRatio)); + rPoint=Point( 0, static_cast((nHeight-rSize.Height())/2)); } else { - rSize=Size((sal_uInt16)(nHeight*dRatio), nHeight); - rPoint=Point((sal_uInt16)((nWidth-rSize.Width())/2),0); + rSize=Size(static_cast(nHeight*dRatio), nHeight); + rPoint=Point(static_cast((nWidth-rSize.Width())/2),0); } } diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index ced53b446926..55fee0870827 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -326,7 +326,7 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides ) int nPage; for( nPage = 0; nPage < nPageCount; nPage++ ) { - SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PageKind::Standard ); + SdPage* pPage = mpDoc->GetSdPage( static_cast(nPage), PageKind::Standard ); change( pUndoGroup, pPage, aNewSettings ); } } @@ -367,7 +367,7 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides ) int nPage; for( nPage = 0; nPage < nPageCount; nPage++ ) { - SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PageKind::Notes ); + SdPage* pPage = mpDoc->GetSdPage( static_cast(nPage), PageKind::Notes ); change( pUndoGroup, pPage, aNewSettings ); } @@ -727,8 +727,8 @@ void PresLayoutPreview::Paint(vcl::RenderContext& rRenderContext, SdrTextObj con // build complete transformation by adding view transformation from // logic page coordinates to local pixel coordinates - const double fScaleX((double)maOutRect.getWidth() / (double)maPageSize.Width()); - const double fScaleY((double)maOutRect.getHeight() / (double)maPageSize.Height()); + const double fScaleX(static_cast(maOutRect.getWidth()) / static_cast(maPageSize.Width())); + const double fScaleY(static_cast(maOutRect.getHeight()) / static_cast(maPageSize.Height())); aObjectTransform.scale(fScaleX, fScaleY); aObjectTransform.translate(maOutRect.TopLeft().X(), maOutRect.TopLeft().Y()); @@ -774,12 +774,12 @@ void PresLayoutPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools: if( maPageSize.Width() > maPageSize.Height() ) { nWidth = maOutRect.GetWidth(); - nHeight = maPageSize.Width() == 0 ? 0 : long( (double)(nWidth * maPageSize.Height()) / (double)maPageSize.Width() ); + nHeight = maPageSize.Width() == 0 ? 0 : long( static_cast(nWidth * maPageSize.Height()) / static_cast(maPageSize.Width()) ); } else { nHeight = maOutRect.GetHeight(); - nWidth = maPageSize.Height() == 0 ? 0 : long( (double)(nHeight * maPageSize.Width()) / (double)maPageSize.Height() ); + nWidth = maPageSize.Height() == 0 ? 0 : long( static_cast(nHeight * maPageSize.Width()) / static_cast(maPageSize.Height()) ); } maOutRect.Left() += (maOutRect.GetWidth() - nWidth) >> 1; diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 4552f262c7a1..f302b77028ee 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -232,7 +232,7 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectToolboxHdl, ToolBox *, void) if (ePage != PAGE_NONE) { - SfxUInt16Item aItem( SID_NAVIGATOR_PAGE, (sal_uInt16)ePage ); + SfxUInt16Item aItem( SID_NAVIGATOR_PAGE, static_cast(ePage) ); mpBindings->GetDispatcher()->ExecuteList(SID_NAVIGATOR_PAGE, SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem }); } @@ -276,7 +276,7 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox, void ) meDragType = NAVIGATOR_DRAGTYPE_EMBEDDED; } - pMenu->CheckItem( (sal_uInt16)meDragType ); + pMenu->CheckItem( static_cast(meDragType) ); pMenu->SetSelectHdl( LINK( this, SdNavigatorWin, MenuSelectHdl ) ); pMenu->Execute( this, maToolbox->GetItemRect( nId ), PopupMenuFlags::ExecuteDown ); diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index 85b96791ae13..5ec2c07b0285 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -111,7 +111,7 @@ bool SdParagraphNumTabPage::FillItemSet( SfxItemSet* rSet ) bool bNumberNewStartChecked = TRISTATE_TRUE == m_pNewStartNumberCB->GetState(); rSet->Put(SfxBoolItem(ATTR_NUMBER_NEWSTART, bNewStartChecked)); - const sal_Int16 nStartAt = (sal_Int16)m_pNewStartNF->GetValue(); + const sal_Int16 nStartAt = static_cast(m_pNewStartNF->GetValue()); rSet->Put(SfxInt16Item(ATTR_NUMBER_NEWSTART_AT, bNumberNewStartChecked && bNewStartChecked ? nStartAt : -1)); } diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index 88e66130c1f7..c36ab6d196ad 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -209,7 +209,7 @@ sal_Int32 SdStartPresentationDlg::InsertDisplayEntry(const rtl::OUString &aName, { maLBMonitor->InsertEntry( aName ); const sal_uInt32 nEntryIndex = maLBMonitor->GetEntryCount() - 1; - maLBMonitor->SetEntryData( nEntryIndex, reinterpret_cast((sal_IntPtr)nDisplay) ); + maLBMonitor->SetEntryData( nEntryIndex, reinterpret_cast(static_cast(nDisplay)) ); return nEntryIndex; } @@ -308,7 +308,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr ) sal_Int32 nPos = maLBMonitor->GetSelectedEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) - rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)reinterpret_cast(maLBMonitor->GetEntryData(nPos))) ); + rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, static_cast(reinterpret_cast(maLBMonitor->GetEntryData(nPos)))) ); nPos = aLbCustomshow->GetSelectedEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 094a93098931..28c06f6e4982 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -102,7 +102,7 @@ void SdPresLayoutDlg::Reset() } DBG_ASSERT(nName < mnLayoutCount, "Layout not found"); - m_pVS->SelectItem((sal_uInt16)nName + 1); // Indices of the ValueSets start at 1 + m_pVS->SelectItem(static_cast(nName) + 1); // Indices of the ValueSets start at 1 } @@ -159,7 +159,7 @@ void SdPresLayoutDlg::FillValueSet() maLayoutNames.push_back(aLayoutName); Image aBitmap(mpDocSh->GetPagePreviewBitmap(pMaster)); - m_pVS->InsertItem((sal_uInt16)maLayoutNames.size(), aBitmap, aLayoutName); + m_pVS->InsertItem(static_cast(maLayoutNames.size()), aBitmap, aLayoutName); } } @@ -257,7 +257,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl, Button*, void) maLayoutNames.push_back(aLayoutName); Image aBitmap(pTemplDocSh->GetPagePreviewBitmap(pMaster)); - m_pVS->InsertItem((sal_uInt16)maLayoutNames.size(), aBitmap, aLayoutName); + m_pVS->InsertItem(static_cast(maLayoutNames.size()), aBitmap, aLayoutName); } } } @@ -272,14 +272,14 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl, Button*, void) { // empty layout maLayoutNames.push_back(maStrNone); - m_pVS->InsertItem( (sal_uInt16) maLayoutNames.size(), + m_pVS->InsertItem( static_cast(maLayoutNames.size()), Image(BMP_FOIL_NONE), maStrNone ); } if (!bCancel) { // select template - m_pVS->SelectItem( (sal_uInt16) maLayoutNames.size() ); + m_pVS->SelectItem( static_cast(maLayoutNames.size()) ); } } } diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 33329a3ea808..b31ede51e6f8 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -147,7 +147,7 @@ sal_Int64 SAL_CALL SdPageObjsTLB::SdPageObjsTransferable::getSomething( const cs if( ( rId.getLength() == 16 ) && ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ) { - nRet = (sal_Int64)reinterpret_cast(this); + nRet = static_cast(reinterpret_cast(this)); } else nRet = SdTransferable::getSomething(rId); diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index a600f2b77819..47bc6c5b5734 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -67,9 +67,9 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs ) aOptsItem.GetOptionsSnap().SetOrtho( pCbxOrtho->IsChecked() ); aOptsItem.GetOptionsSnap().SetBigOrtho( pCbxBigOrtho->IsChecked() ); aOptsItem.GetOptionsSnap().SetRotate( pCbxRotate->IsChecked() ); - aOptsItem.GetOptionsSnap().SetSnapArea( (sal_Int16) pMtrFldSnapArea->GetValue() ); - aOptsItem.GetOptionsSnap().SetAngle( (sal_Int16) pMtrFldAngle->GetValue() ); - aOptsItem.GetOptionsSnap().SetEliminatePolyPointLimitAngle( (sal_Int16) pMtrFldBezAngle->GetValue() ); + aOptsItem.GetOptionsSnap().SetSnapArea( static_cast(pMtrFldSnapArea->GetValue()) ); + aOptsItem.GetOptionsSnap().SetAngle( static_cast(pMtrFldAngle->GetValue()) ); + aOptsItem.GetOptionsSnap().SetEliminatePolyPointLimitAngle( static_cast(pMtrFldBezAngle->GetValue()) ); rAttrs->Put( aOptsItem ); @@ -327,7 +327,7 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet ) { const SfxUInt16Item* pItem = static_cast(pAttr); - FieldUnit eFUnit = (FieldUnit)(long)pItem->GetValue(); + FieldUnit eFUnit = (FieldUnit)static_cast(pItem->GetValue()); if( eFUnit != m_pMtrFldOriginalWidth->GetUnit() ) { @@ -417,7 +417,7 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) const sal_Int32 nMPos = m_pLbMetric->GetSelectedEntryPos(); if ( m_pLbMetric->IsValueChangedFromSaved() ) { - sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast(m_pLbMetric->GetEntryData( nMPos )); + sal_uInt16 nFieldUnit = static_cast(reinterpret_cast(m_pLbMetric->GetEntryData( nMPos ))); rAttrs->Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ), nFieldUnit ) ); bModified = true; } @@ -427,7 +427,7 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) { sal_uInt16 nWh = GetWhich( SID_ATTR_DEFTABSTOP ); MapUnit eUnit = rAttrs->GetPool()->GetMetric( nWh ); - SfxUInt16Item aDef( nWh,(sal_uInt16)GetCoreValue( *m_pMtrFldTabstop, eUnit ) ); + SfxUInt16Item aDef( nWh,static_cast(GetCoreValue( *m_pMtrFldTabstop, eUnit )) ); rAttrs->Put( aDef ); bModified = true; } @@ -478,7 +478,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) if ( rAttrs->GetItemState( nWhich ) >= SfxItemState::DEFAULT ) { const SfxUInt16Item& rItem = static_cast(rAttrs->Get( nWhich )); - long nFieldUnit = (long)rItem.GetValue(); + long nFieldUnit = static_cast(rItem.GetValue()); for ( sal_Int32 i = 0; i < m_pLbMetric->GetEntryCount(); ++i ) { @@ -590,7 +590,7 @@ bool SdTpOptionsMisc::SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32 if (!comphelper::string::isdigitAsciiString(aTmp)) return false; - rX = (long) aTmp.toInt32(); + rX = static_cast(aTmp.toInt32()); if( rX == 0 ) return false; @@ -598,7 +598,7 @@ bool SdTpOptionsMisc::SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32 if (!comphelper::string::isdigitAsciiString(aTmp)) return false; - rY = (long) aTmp.toInt32(); + rY = static_cast(aTmp.toInt32()); return rY != 0; } diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 5099ce6539a7..3b76955bb26d 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -97,18 +97,18 @@ void SdVectorizeDlg::dispose() if( rBmpSize.Width() && rBmpSize.Height() && rDispSize.Width() && rDispSize.Height() ) { Size aBmpSize( rBmpSize ); - const double fGrfWH = (double) aBmpSize.Width() / aBmpSize.Height(); - const double fWinWH = (double) rDispSize.Width() / rDispSize.Height(); + const double fGrfWH = static_cast(aBmpSize.Width()) / aBmpSize.Height(); + const double fWinWH = static_cast(rDispSize.Width()) / rDispSize.Height(); if( fGrfWH < fWinWH ) { - aBmpSize.Width() = (long) ( rDispSize.Height() * fGrfWH ); + aBmpSize.Width() = static_cast( rDispSize.Height() * fGrfWH ); aBmpSize.Height()= rDispSize.Height(); } else { aBmpSize.Width() = rDispSize.Width(); - aBmpSize.Height()= (long) ( rDispSize.Width() / fGrfWH); + aBmpSize.Height()= static_cast( rDispSize.Width() / fGrfWH); } const Point aBmpPos( ( rDispSize.Width() - aBmpSize.Width() ) >> 1, @@ -143,7 +143,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap const & rBmp, Fraction& rScale else rScale = Fraction( 1, 1 ); - aNew.ReduceColors( (sal_uInt16) m_pNmLayers->GetValue() ); + aNew.ReduceColors( static_cast(m_pNmLayers->GetValue()) ); return aNew; } @@ -159,7 +159,7 @@ void SdVectorizeDlg::Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf ) if( !!aTmp ) { const Link aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) ); - aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), &aPrgsHdl ); + aTmp.Vectorize( rMtf, static_cast(m_pMtReduce->GetValue()), &aPrgsHdl ); if( m_pCbFillHoles->IsChecked() ) { @@ -240,9 +240,9 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess const * pRAcc, GDIMetaFile& rMtf, } } - const Color aColor( (sal_uInt8) FRound( nSumR * fMult ), - (sal_uInt8) FRound( nSumG * fMult ), - (sal_uInt8) FRound( nSumB * fMult ) ); + const Color aColor( static_cast(FRound( nSumR * fMult )), + static_cast(FRound( nSumG * fMult )), + static_cast(FRound( nSumB * fMult )) ); ::tools::Rectangle aRect( Point( nPosX, nPosY ), Size( nWidth + 1, nHeight + 1 ) ); const Size& rMaxSize = rMtf.GetPrefSize(); @@ -262,7 +262,7 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess const * pRAcc, GDIMetaFile& rMtf, IMPL_LINK( SdVectorizeDlg, ProgressHdl, long, nData, void ) { - m_pPrgs->SetValue( (sal_uInt16)nData ); + m_pPrgs->SetValue( static_cast(nData) ); } IMPL_LINK_NOARG(SdVectorizeDlg, ClickPreviewHdl, Button*, void) diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 7c905edd4550..a3c4fd163b21 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -561,7 +561,7 @@ void FrameworkHelper::HandleModeChangeSlot ( const SfxItemSet* pRequestArguments = rRequest.GetArgs(); if (pRequestArguments) { - const SfxBoolItem* pIsActive = rRequest.GetArg((sal_uInt16)nSlotId); + const SfxBoolItem* pIsActive = rRequest.GetArg(static_cast(nSlotId)); if (!pIsActive->GetValue ()) { if (nSlotId == SID_NOTES_MASTER_MODE) diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx index d512ee098254..6ba3f8ceb6bc 100644 --- a/sd/source/ui/func/bulmaper.cxx +++ b/sd/source/ui/func/bulmaper.cxx @@ -60,22 +60,22 @@ void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const SfxItemSet& vcl::Font aMyFont; const SvxFontItem& rFItem = - static_cast(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_FONT ))); + static_cast(rSet.Get(GetWhich( sal_uInt16(SID_ATTR_CHAR_FONT) ))); aMyFont.SetFamily(rFItem.GetFamily()); aMyFont.SetFamilyName(rFItem.GetFamilyName()); aMyFont.SetCharSet(rFItem.GetCharSet()); aMyFont.SetPitch(rFItem.GetPitch()); const SvxFontHeightItem& rFHItem = - static_cast(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_FONTHEIGHT ))); + static_cast(rSet.Get(GetWhich( sal_uInt16(SID_ATTR_CHAR_FONTHEIGHT) ))); aMyFont.SetFontSize(Size(0, rFHItem.GetHeight())); const SvxWeightItem& rWItem = - static_cast(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_WEIGHT ))); + static_cast(rSet.Get(GetWhich( sal_uInt16(SID_ATTR_CHAR_WEIGHT) ))); aMyFont.SetWeight(rWItem.GetWeight()); const SvxPostureItem& rPItem = - static_cast(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_POSTURE ))); + static_cast(rSet.Get(GetWhich( sal_uInt16(SID_ATTR_CHAR_POSTURE) ))); aMyFont.SetItalic(rPItem.GetPosture()); const SvxUnderlineItem& rUItem = static_cast(rSet.Get(GetWhich(SID_ATTR_CHAR_UNDERLINE))); diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index 78e4319d881f..aec8839e18c6 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -372,7 +372,7 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B3DRange aVolume(aObjVol); double fW(aVolume.getWidth()); double fH(aVolume.getHeight()); - ::tools::Rectangle a3DRect(0, 0, (long)fW, (long)fH); + ::tools::Rectangle a3DRect(0, 0, static_cast(fW), static_cast(fH)); E3dScene* pScene = new E3dScene; // copied code from E3dView::InitScene diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index 54e751a87eff..a1202e98159c 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -93,8 +93,8 @@ void FuConstructArc::DoExecute( SfxRequest& rReq ) SdrCircObj* pNewCircle = new SdrCircObj((SdrObjKind) mpView->GetCurrentObjIdentifier(), aNewRectangle, - (long) (pPhiStart->GetValue () * 10.0), - (long) (pPhiEnd->GetValue () * 10.0)); + static_cast(pPhiStart->GetValue () * 10.0), + static_cast(pPhiEnd->GetValue () * 10.0)); SdrPageView *pPV = mpView->GetSdrPageView(); mpView->InsertObjectAtView(pNewCircle, *pPV, SdrInsertFlags::SETDEFLAYER); @@ -193,7 +193,7 @@ void FuConstructArc::Activate() break; } - mpView->SetCurrentObj((sal_uInt16)aObjKind); + mpView->SetCurrentObj(static_cast(aObjKind)); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index d49f009506dc..e7cc868d495b 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -263,7 +263,7 @@ void FuConstructBezierPolygon::Activate() break; } - mpView->SetCurrentObj((sal_uInt16)eKind); + mpView->SetCurrentObj(static_cast(eKind)); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index e46293693ae6..6f1116916cd3 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -357,7 +357,7 @@ void FuConstructRectangle::Activate() break; } - mpView->SetCurrentObj((sal_uInt16)aObjKind); + mpView->SetCurrentObj(static_cast(aObjKind)); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index dc9abea360a5..f3389e861b30 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -192,13 +192,13 @@ void FuCopy::DoExecute( SfxRequest& rReq ) if( lWidth < 0 ) { long nTmp = ( aRect.Right() - aRect.Left() ) / -lWidth; - nNumber = (sal_uInt16) std::min( nTmp, (long)nNumber ); + nNumber = static_cast(std::min( nTmp, static_cast(nNumber) )); } if( lHeight < 0 ) { long nTmp = ( aRect.Bottom() - aRect.Top() ) / -lHeight; - nNumber = (sal_uInt16) std::min( nTmp, (long)nNumber ); + nNumber = static_cast(std::min( nTmp, static_cast(nNumber) )); } for( sal_uInt16 i = 1; i <= nNumber; i++ ) @@ -268,9 +268,9 @@ void FuCopy::DoExecute( SfxRequest& rReq ) if( bColor ) { // probably room for optimizations, but may can lead to rounding errors - sal_uInt8 nRed = aStartColor.GetRed() + (sal_uInt8) ( ( (long) aEndColor.GetRed() - (long) aStartColor.GetRed() ) * (long) i / (long) nNumber ); - sal_uInt8 nGreen = aStartColor.GetGreen() + (sal_uInt8) ( ( (long) aEndColor.GetGreen() - (long) aStartColor.GetGreen() ) * (long) i / (long) nNumber ); - sal_uInt8 nBlue = aStartColor.GetBlue() + (sal_uInt8) ( ( (long) aEndColor.GetBlue() - (long) aStartColor.GetBlue() ) * (long) i / (long) nNumber ); + sal_uInt8 nRed = aStartColor.GetRed() + static_cast( ( static_cast(aEndColor.GetRed()) - static_cast(aStartColor.GetRed()) ) * static_cast(i) / static_cast(nNumber) ); + sal_uInt8 nGreen = aStartColor.GetGreen() + static_cast( ( static_cast(aEndColor.GetGreen()) - static_cast(aStartColor.GetGreen()) ) * static_cast(i) / static_cast(nNumber) ); + sal_uInt8 nBlue = aStartColor.GetBlue() + static_cast( ( static_cast(aEndColor.GetBlue()) - static_cast(aStartColor.GetBlue()) ) * static_cast(i) / static_cast(nNumber) ); Color aNewColor( nRed, nGreen, nBlue ); SfxItemSet aNewSet( mpViewShell->GetPool(), svl::Items{} ); aNewSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) ); diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 94523658c2e7..16565daf57ad 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -193,7 +193,7 @@ void FuMorph::DoExecute( SfxRequest& ) { // length of step in dest poly ::basegfx::B2DPolygon aRetval; - const double fStep(::basegfx::utils::getLength(rCandidate) / (double)(rCandidate.isClosed() ? nNum : nNum - 1)); + const double fStep(::basegfx::utils::getLength(rCandidate) / static_cast(rCandidate.isClosed() ? nNum : nNum - 1)); double fDestPos(0.0); double fSrcPos(0.0); sal_uInt32 nSrcPos(0); @@ -420,7 +420,7 @@ void FuMorph::ImpInsertPolygons( // line width if ( bLineWidth ) - aSet.Put( XLineWidthItem( nStartLineWidth + (long) ( fFactor * fDelta + 0.5 ) ) ); + aSet.Put( XLineWidthItem( nStartLineWidth + static_cast( fFactor * fDelta + 0.5 ) ) ); pNewObj->SetMergedItemSetAndBroadcast(aSet); diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 00384f087572..f3b61cba846c 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -730,7 +730,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) pAction->SetPlayFull(pInfo->mbPlayFull, bPlayFull); pAction->SetClickAction(pInfo->meClickAction, eClickAction); pAction->SetBookmark(pInfo->GetBookmark(), aBookmark); - pAction->SetVerb(pInfo->mnVerb, (sal_uInt16)pInfo->GetBookmark().toInt32() ); + pAction->SetVerb(pInfo->mnVerb, static_cast(pInfo->GetBookmark().toInt32()) ); pAction->SetSecondEffect(pInfo->meSecondEffect, eSecondEffect); pAction->SetSecondSpeed(pInfo->meSecondSpeed, eSecondSpeed); pAction->SetSecondSoundOn(pInfo->mbSecondSoundOn, bSecondSoundOn); @@ -787,7 +787,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) pInfo->mbSecondPlayFull = bSecondPlayFull; if (eClickAction == presentation::ClickAction_VERB) - pInfo->mnVerb = (sal_uInt16)aBookmark.toInt32(); + pInfo->mnVerb = static_cast(aBookmark.toInt32()); } } // Set the Undo Group in of the Undo Manager diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 5ef3fb1800fc..46dc6495a489 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -180,7 +180,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) sal_uInt16 nIdx = pItem->GetValue(); bool bToggle = false; - if( nIdx == (sal_uInt16)0xFFFF ) + if( nIdx == sal_uInt16(0xFFFF) ) { // If the nIdx is (sal_uInt16)0xFFFF, means set bullet status to on/off nIdx = 1; @@ -201,7 +201,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) nSId == FN_SVX_SET_BULLET ? NBOType::Bullets : NBOType::Numbering ); if ( pNumRuleMgr ) { - sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF; + sal_uInt16 nActNumLvl = sal_uInt16(0xFFFF); const SfxPoolItem* pNumLevelItem = nullptr; if(SfxItemState::SET == aNewAttr.GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pNumLevelItem)) nActNumLvl = static_cast(pNumLevelItem)->GetValue(); diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 462146c6196e..18931db2369a 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -248,13 +248,13 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window const * pParent ) aNewAttr.Put( aMaxSizeItem ); // paperbin - SvxPaperBinItem aPaperBinItem( SID_ATTR_PAGE_PAPERBIN, (sal_uInt8)mpPage->GetPaperBin() ); + SvxPaperBinItem aPaperBinItem( SID_ATTR_PAGE_PAPERBIN, static_cast(mpPage->GetPaperBin()) ); aNewAttr.Put( aPaperBinItem ); - SvxLRSpaceItem aLRSpaceItem( (sal_uInt16)mpPage->GetLeftBorder(), (sal_uInt16)mpPage->GetRightBorder(), 0, 0, mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE)); + SvxLRSpaceItem aLRSpaceItem( static_cast(mpPage->GetLeftBorder()), static_cast(mpPage->GetRightBorder()), 0, 0, mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE)); aNewAttr.Put( aLRSpaceItem ); - SvxULSpaceItem aULSpaceItem( (sal_uInt16)mpPage->GetUpperBorder(), (sal_uInt16)mpPage->GetLowerBorder(), mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE)); + SvxULSpaceItem aULSpaceItem( static_cast(mpPage->GetUpperBorder()), static_cast(mpPage->GetLowerBorder()), mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE)); aNewAttr.Put( aULSpaceItem ); // Application diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx index 6ffa2b98073e..33749b20c71e 100644 --- a/sd/source/ui/func/fuscale.cxx +++ b/sd/source/ui/func/fuscale.cxx @@ -73,7 +73,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) std::unique_ptr pZoomItem; SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL; - nValue = (sal_Int16) mpWindow->GetZoom(); + nValue = static_cast(mpWindow->GetZoom()); // zoom on page size? if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr && @@ -112,7 +112,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) ScopedVclPtr pDlg(pFact ? pFact->CreateSvxZoomDialog(nullptr, aNewAttr) : nullptr); if (pDlg) { - pDlg->SetLimits( (sal_uInt16)mpWindow->GetMinZoom(), (sal_uInt16)mpWindow->GetMaxZoom() ); + pDlg->SetLimits( static_cast(mpWindow->GetMinZoom()), static_cast(mpWindow->GetMaxZoom()) ); sal_uInt16 nResult = pDlg->Execute(); switch( nResult ) { diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 2ca5fbc55908..9fbca6fa8be8 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -1367,7 +1367,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) // Assign verb mpView->UnmarkAll(); mpView->MarkObj(pObj, mpView->GetSdrPageView()); - pDrViewSh->DoVerb((sal_Int16)pInfo->mnVerb); + pDrViewSh->DoVerb(static_cast(pInfo->mnVerb)); bAnimated = true; } break; diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index 2514fe37abf1..10f9afa23cf4 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -68,7 +68,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) for( nPage = mpDoc->GetSdPageCount( PageKind::Standard ) - 1; nPage >= 0; nPage-- ) { - pPage = mpDoc->GetSdPage( (sal_uInt16) nPage, PageKind::Standard ); + pPage = mpDoc->GetSdPage( static_cast(nPage), PageKind::Standard ); OUString aStr( pPage->GetName() ); if ( aStr.isEmpty() ) diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx index 2273151acdd9..10763d18ea7e 100644 --- a/sd/source/ui/func/fusnapln.cxx +++ b/sd/source/ui/func/fusnapln.cxx @@ -87,7 +87,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) if ( aLinePos.X() >= 0 ) { aLinePos = mpWindow->PixelToLogic(aLinePos); - sal_uInt16 nHitLog = (sal_uInt16) mpWindow->PixelToLogic(Size(HITPIX,0)).Width(); + sal_uInt16 nHitLog = static_cast(mpWindow->PixelToLogic(Size(HITPIX,0)).Width()); bLineExist = mpView->PickHelpLine(aLinePos, nHitLog, *mpWindow, nHelpLine, pPV); if ( bLineExist ) aLinePos = (pPV->GetHelpLines())[nHelpLine].GetPos(); diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index ff7eaa096ea8..ad3298d5cafc 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -340,7 +340,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) OUString aOutlineStr(SdResId(STR_PSEUDOSHEET_OUTLINE)); // determine number, mind the blank between name and number OUString aNumStr(aName.copy(aOutlineStr.getLength() + 1)); - sal_uInt16 nLevel = (sal_uInt16)aNumStr.toInt32(); + sal_uInt16 nLevel = static_cast(aNumStr.toInt32()); switch (nLevel) { case 1: ePO = PO_OUTLINE_1; break; diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx index d802d69be6d8..a739f2ec12c0 100644 --- a/sd/source/ui/func/fuzoom.cxx +++ b/sd/source/ui/func/fuzoom.cxx @@ -156,7 +156,7 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt) Size aZoomSizePixel = mpWindow->LogicToPixel(aZoomRect).GetSize(); sal_uLong nTol = DRGPIX + DRGPIX; - if ( ( aZoomSizePixel.Width() < (long) nTol && aZoomSizePixel.Height() < (long) nTol ) || rMEvt.IsMod1() ) + if ( ( aZoomSizePixel.Width() < static_cast(nTol) && aZoomSizePixel.Height() < static_cast(nTol) ) || rMEvt.IsMod1() ) { // click at place: double zoom factor Point aPos = mpWindow->PixelToLogic(aPosPix); diff --git a/sd/source/ui/inc/morphdlg.hxx b/sd/source/ui/inc/morphdlg.hxx index 37e093be34e1..d717a82b39d2 100644 --- a/sd/source/ui/inc/morphdlg.hxx +++ b/sd/source/ui/inc/morphdlg.hxx @@ -42,7 +42,7 @@ public: virtual void dispose() override; void SaveSettings() const; - sal_uInt16 GetFadeSteps() const { return (sal_uInt16) m_pMtfSteps->GetValue(); } + sal_uInt16 GetFadeSteps() const { return static_cast(m_pMtfSteps->GetValue()); } bool IsAttributeFade() const { return m_pCbxAttributes->IsChecked(); } bool IsOrientationFade() const { return m_pCbxOrientation->IsChecked(); } diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx index 398369b0c1c9..8d925a316bf5 100644 --- a/sd/source/ui/inc/optsitem.hxx +++ b/sd/source/ui/inc/optsitem.hxx @@ -131,7 +131,7 @@ public: bool IsDragStripes() const { Init(); return bDragStripes; } bool IsHandlesBezier() const { Init(); return bHandlesBezier; } bool IsHelplines() const { Init(); return bHelplines; } - sal_uInt16 GetMetric() const { Init(); return( ( 0xffff == nMetric ) ? (sal_uInt16)SfxModule::GetCurrentFieldUnit() : nMetric ); } + sal_uInt16 GetMetric() const { Init(); return( ( 0xffff == nMetric ) ? static_cast(SfxModule::GetCurrentFieldUnit()) : nMetric ); } sal_uInt16 GetDefTab() const { Init(); return nDefTab; } void SetRulerVisible( bool bOn ) { if( bRuler != bOn ) { OptionsChanged(); bRuler = bOn; } } diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index bd11e2ea53c3..968a7542bb57 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -327,7 +327,7 @@ bluez4GetDefaultService( DBusConnection *pConnection ) else { SAL_INFO( "sdremote.bluetooth", "invalid type of reply to DefaultAdapter: '" - << (char) dbus_message_iter_get_arg_type( &it ) << "'" ); + << static_cast(dbus_message_iter_get_arg_type( &it )) << "'" ); } dbus_message_unref(pMsg); return nullptr; diff --git a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx index 9a50c001842c..a79d5e390281 100644 --- a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx +++ b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx @@ -63,7 +63,7 @@ sal_Int32 BufferedStreamSocket::write( const void* pBuffer, sal_uInt32 n ) #else pBuffer, #endif - (size_t) n, 0 ); + static_cast(n), 0 ); } void BufferedStreamSocket::close() diff --git a/sd/source/ui/remotecontrol/ImagePreparer.cxx b/sd/source/ui/remotecontrol/ImagePreparer.cxx index ffd019b0c128..199d3d434c54 100644 --- a/sd/source/ui/remotecontrol/ImagePreparer.cxx +++ b/sd/source/ui/remotecontrol/ImagePreparer.cxx @@ -98,7 +98,7 @@ void ImagePreparer::sendPreview( sal_uInt32 aSlideNumber ) aBuffer.append( "slide_preview\n" ); - aBuffer.append( (sal_Int32)aSlideNumber ); + aBuffer.append( static_cast(aSlideNumber) ); aBuffer.append( "\n" ); aBuffer.append( aEncodedShortString.getStr() ); @@ -183,7 +183,7 @@ void ImagePreparer::sendNotes( sal_uInt32 aSlideNumber ) aBuffer.append( "slide_notes\n" ); - aBuffer.append( (sal_Int32) aSlideNumber ); + aBuffer.append( static_cast(aSlideNumber) ); aBuffer.append( "\n" ); aBuffer.append( "" ); diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 5a975ec80c49..50acfad99a25 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -273,8 +273,8 @@ void LayoutMenu::Resize() int nRowCount = CalculateRowCount (aItemSize, nColumnCount); - SetColCount ((sal_uInt16)nColumnCount); - SetLineCount ((sal_uInt16)nRowCount); + SetColCount (static_cast(nColumnCount)); + SetLineCount (static_cast(nRowCount)); } } @@ -579,7 +579,7 @@ void LayoutMenu::Command (const CommandEvent& rEvent) } else { - if (GetSelectItemId() == (sal_uInt16)-1) + if (GetSelectItemId() == sal_uInt16(-1)) return; ::tools::Rectangle aBBox (GetItemRect(GetSelectItemId())); aMenuPosition = aBBox.Center(); diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 1e13ccf9493c..48deb2505e4e 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -683,14 +683,14 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage ( bool MasterPageContainer::Implementation::HasToken (Token aToken) const { return aToken>=0 - && (unsigned)aToken(aToken)=0 && (unsigned)aToken=0 && static_cast(aToken)=0 && (unsigned)aToken=0 && static_cast(aToken) MasterPageContainer::Implementation::GetModel() if (xProperties.is()) xProperties->setPropertyValue( "Layout", - makeAny((sal_Int16)AUTOLAYOUT_TITLE)); + makeAny(sal_Int16(AUTOLAYOUT_TITLE))); } } } @@ -978,7 +978,7 @@ bool MasterPageContainer::Implementation::UpdateDescriptor ( void MasterPageContainer::Implementation::ReleaseDescriptor (Token aToken) { - if (aToken>=0 && (unsigned)aToken=0 && static_cast(aToken)= 0) { PreviewValueSet::SetItemImage ( - (sal_uInt16)nIndex, + static_cast(nIndex), mpContainer->GetPreviewForToken(rEvent.maChildToken)); - PreviewValueSet::Invalidate(PreviewValueSet::GetItemRect((sal_uInt16)nIndex)); + PreviewValueSet::Invalidate(PreviewValueSet::GetItemRect(static_cast(nIndex))); } } break; @@ -446,7 +446,7 @@ MasterPagesSelector::UserData* MasterPagesSelector::GetUserData (int nIndex) con const ::osl::MutexGuard aGuard (maMutex); if (nIndex>0 && static_cast(nIndex)<=PreviewValueSet::GetItemCount()) - return static_cast(PreviewValueSet::GetItemData((sal_uInt16)nIndex)); + return static_cast(PreviewValueSet::GetItemData(static_cast(nIndex))); else return nullptr; } @@ -460,7 +460,7 @@ void MasterPagesSelector::SetUserData (int nIndex, UserData* pData) UserData* pOldData = GetUserData(nIndex); if (pOldData!=nullptr && pOldData!=pData) delete pOldData; - PreviewValueSet::SetItemData((sal_uInt16)nIndex, pData); + PreviewValueSet::SetItemData(static_cast(nIndex), pData); } } diff --git a/sd/source/ui/sidebar/PreviewValueSet.cxx b/sd/source/ui/sidebar/PreviewValueSet.cxx index c15d89d4e231..c145cb25ef1b 100644 --- a/sd/source/ui/sidebar/PreviewValueSet.cxx +++ b/sd/source/ui/sidebar/PreviewValueSet.cxx @@ -94,7 +94,7 @@ sal_uInt16 PreviewValueSet::CalculateColumnCount (int nWidth) const else if (mnMaxColumnCount>0 && nColumnCount>mnMaxColumnCount) nColumnCount = mnMaxColumnCount; } - return (sal_uInt16)nColumnCount; + return static_cast(nColumnCount); } sal_uInt16 PreviewValueSet::CalculateRowCount (sal_uInt16 nColumnCount) const @@ -108,7 +108,7 @@ sal_uInt16 PreviewValueSet::CalculateRowCount (sal_uInt16 nColumnCount) const nRowCount = 1; } - return (sal_uInt16)nRowCount; + return static_cast(nRowCount); } sal_Int32 PreviewValueSet::GetPreferredHeight (sal_Int32 nWidth) diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx b/sd/source/ui/slideshow/SlideShowRestarter.cxx index c18a4aae19d4..d4611afbcf1c 100644 --- a/sd/source/ui/slideshow/SlideShowRestarter.cxx +++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx @@ -82,7 +82,7 @@ IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void) mnEventId = nullptr; if (mpSlideShow.is()) { - if (mnDisplayCount != (sal_Int32)Application::GetScreenCount()) + if (mnDisplayCount != static_cast(Application::GetScreenCount())) { bool bIsExitAfterPresenting = mpSlideShow->IsExitAfterPresenting(); mpSlideShow->SetExitAfterPresenting(false); diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 0944af55018d..f738688983a9 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -726,7 +726,7 @@ void SAL_CALL SlideShow::end() // switch to the previously visible Slide DrawViewShell* pDrawViewShell = dynamic_cast( pViewShell ); if( pDrawViewShell ) - pDrawViewShell->SwitchPage( (sal_uInt16)xController->getRestoreSlide() ); + pDrawViewShell->SwitchPage( static_cast(xController->getRestoreSlide()) ); else { Reference xDrawView ( @@ -1150,7 +1150,7 @@ sal_Int32 SlideShow::GetDisplay() if( nDisplay < 0 ) nDisplay = -1; else if( nDisplay == 0) - nDisplay = (sal_Int32)Application::GetDisplayExternalScreen(); + nDisplay = static_cast(Application::GetDisplayExternalScreen()); else nDisplay--; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 4dddb8e702f8..7983130d1783 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -150,7 +150,7 @@ private: bool getSlideAPI( sal_Int32 nSlideNumber, Reference< XDrawPage >& xSlide, Reference< XAnimationNode >& xAnimNode ); sal_Int32 findSlideIndex( sal_Int32 nSlideNumber ) const; - bool isValidIndex( sal_Int32 nIndex ) const { return (nIndex >= 0) && (nIndex < (sal_Int32)maSlideNumbers.size()); } + bool isValidIndex( sal_Int32 nIndex ) const { return (nIndex >= 0) && (nIndex < static_cast(maSlideNumbers.size())); } bool isValidSlideNumber( sal_Int32 nSlideNumber ) const { return (nSlideNumber >= 0) && (nSlideNumber < mnSlideCount); } private: @@ -1107,7 +1107,7 @@ void SlideshowImpl::onFirstPaint() } SolarMutexGuard aSolarGuard; - maUpdateTimer.SetTimeout( (sal_uLong)100 ); + maUpdateTimer.SetTimeout( sal_uLong(100) ); maUpdateTimer.Start(); } @@ -1978,12 +1978,12 @@ IMPL_LINK_NOARG(SlideshowImpl, ContextMenuHdl, void*, void) { if( mpSlideController->isVisibleSlideNumber( nPageNumber ) ) { - SdPage* pPage = mpDoc->GetSdPage((sal_uInt16)nPageNumber, PageKind::Standard); + SdPage* pPage = mpDoc->GetSdPage(static_cast(nPageNumber), PageKind::Standard); if (pPage) { - pPageMenu->InsertItem( (sal_uInt16)(CM_SLIDES + nPageNumber), pPage->GetName() ); + pPageMenu->InsertItem( static_cast(CM_SLIDES + nPageNumber), pPage->GetName() ); if( nPageNumber == nCurrentSlideNumber ) - pPageMenu->CheckItem( (sal_uInt16)(CM_SLIDES + nPageNumber) ); + pPageMenu->CheckItem( static_cast(CM_SLIDES + nPageNumber) ); } } } @@ -2244,7 +2244,7 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide ) for( nSlide = 0, nFirstVisibleSlide = -1; ( nSlide < nSlideCount ) && ( -1 == nFirstVisibleSlide ); nSlide++ ) { - SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt16)nSlide, PageKind::Standard ); + SdPage* pTestSlide = mpDoc->GetSdPage( static_cast(nSlide), PageKind::Standard ); if( pTestSlide->GetName() == rPresSlide ) { @@ -2263,7 +2263,7 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide ) for( sal_Int32 i = 0; i < nSlideCount; i++ ) { - bool bVisible = ! mpDoc->GetSdPage( (sal_uInt16)i, PageKind::Standard )->IsExcluded(); + bool bVisible = ! mpDoc->GetSdPage( static_cast(i), PageKind::Standard )->IsExcluded(); if( bVisible || (eMode == AnimationSlideController::ALL) ) mpSlideController->insertSlideNumber( i, bVisible ); } @@ -2276,11 +2276,11 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide ) { sal_Int32 nSlide; for( nSlide = 0; nSlide < nSlideCount; nSlide++ ) - if( rPresSlide == mpDoc->GetSdPage( (sal_uInt16) nSlide, PageKind::Standard )->GetName() ) + if( rPresSlide == mpDoc->GetSdPage( static_cast(nSlide), PageKind::Standard )->GetName() ) break; if( nSlide < nSlideCount ) - mpSlideController->insertSlideNumber( (sal_uInt16) nSlide ); + mpSlideController->insertSlideNumber( static_cast(nSlide) ); } sal_Int32 nSlideIndex = 0; diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 433db37cda52..881ad6ed4613 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -329,15 +329,15 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation( ) if( meAnimationMode != ANIMATIONMODE_SHOW ) { - aOutputSize.Width() = (long)( aOutputSize.Width() / 1.03 ); - aOutputSize.Height() = (long)( aOutputSize.Height() / 1.03 ); + aOutputSize.Width() = static_cast( aOutputSize.Width() / 1.03 ); + aOutputSize.Height() = static_cast( aOutputSize.Height() / 1.03 ); } SdPage* pP = mpDoc->GetSdPage( 0, PageKind::Standard ); Size aPageSize( pP->GetSize() ); - const double page_ratio = (double)aPageSize.Width() / (double)aPageSize.Height(); - const double output_ratio = (double)aOutputSize.Width() / (double)aOutputSize.Height(); + const double page_ratio = static_cast(aPageSize.Width()) / static_cast(aPageSize.Height()); + const double output_ratio = static_cast(aOutputSize.Width()) / static_cast(aOutputSize.Height()); if( page_ratio > output_ratio ) { diff --git a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx index 5f044aaded4f..53fb945278a1 100644 --- a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx +++ b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx @@ -83,7 +83,7 @@ CacheConfiguration::CacheConfiguration() Sequence aCreationArguments(comphelper::InitAnyPropertySequence( { {"nodepath", makeAny(sPathToImpressConfigurationRoot)}, - {"depth", makeAny((sal_Int32)-1)} + {"depth", makeAny(sal_Int32(-1))} })); Reference xRoot (xProvider->createInstanceWithArguments( diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index b65926d52844..66b518187ef5 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -307,7 +307,7 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition) const std::vector &rBookmarkList = pClipTransferable->GetPageBookmarks(); const SolarMutexGuard aGuard; - nInsertPageCount = (sal_uInt16) rBookmarkList.size(); + nInsertPageCount = static_cast(rBookmarkList.size()); rModel.GetDocument()->InsertBookmarkAsPage( rBookmarkList, nullptr, diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx index 9d34a23dbb2c..ebc6a5c2b109 100644 --- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx @@ -143,7 +143,7 @@ void ScrollBarManager::PlaceHorizontalScrollBar (const ::tools::Rectangle& aAvai // Restore the relative position. mpHorizontalScrollBar->SetThumbPos( - (long)(0.5 + mnHorizontalPosition * mpHorizontalScrollBar->GetRange().Len())); + static_cast(0.5 + mnHorizontalPosition * mpHorizontalScrollBar->GetRange().Len())); } void ScrollBarManager::PlaceVerticalScrollBar (const ::tools::Rectangle& aArea) @@ -278,8 +278,8 @@ void ScrollBarManager::SetWindowOrigin ( sd::Window *pWindow (mrSlideSorter.GetContentWindow().get()); Size aViewSize (pWindow->GetViewSize()); Point aOrigin ( - (long int) (mnHorizontalPosition * aViewSize.Width()), - (long int) (mnVerticalPosition * aViewSize.Height())); + static_cast(mnHorizontalPosition * aViewSize.Width()), + static_cast(mnVerticalPosition * aViewSize.Height())); pWindow->SetWinViewPos (aOrigin); pWindow->UpdateMapMode (); @@ -448,14 +448,14 @@ void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition) if (rMouseWindowPosition.X() < maScrollBorder.Width() && aWindowArea.Left() > aViewPixelArea.Left()) { - nDx = -1 + (int)(mnHorizontalScrollFactor + nDx = -1 + static_cast(mnHorizontalScrollFactor * (rMouseWindowPosition.X() - maScrollBorder.Width())); } if (rMouseWindowPosition.X() >= (aWindowSize.Width() - maScrollBorder.Width()) && aWindowArea.Right() < aViewPixelArea.Right()) { - nDx = 1 + (int)(mnHorizontalScrollFactor + nDx = 1 + static_cast(mnHorizontalScrollFactor * (rMouseWindowPosition.X() - aWindowSize.Width() + maScrollBorder.Width())); } @@ -467,14 +467,14 @@ void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition) if (rMouseWindowPosition.Y() < maScrollBorder.Height() && aWindowArea.Top() > aViewPixelArea.Top()) { - nDy = -1 + (int)(mnVerticalScrollFactor + nDy = -1 + static_cast(mnVerticalScrollFactor * (rMouseWindowPosition.Y() - maScrollBorder.Height())); } if (rMouseWindowPosition.Y() >= (aWindowSize.Height() - maScrollBorder.Height()) && aWindowArea.Bottom() < aViewPixelArea.Bottom()) { - nDy = 1 + (int)(mnVerticalScrollFactor + nDy = 1 + static_cast(mnVerticalScrollFactor * (rMouseWindowPosition.Y() - aWindowSize.Height() + maScrollBorder.Height())); } diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index b299f00ed748..255b3a3792f8 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -623,7 +623,7 @@ void SelectionFunction::GotoNextPage (int nOffset) void SelectionFunction::GotoPage (int nIndex) { - sal_uInt16 nPageCount = (sal_uInt16)mrSlideSorter.GetModel().GetPageCount(); + sal_uInt16 nPageCount = static_cast(mrSlideSorter.GetModel().GetPageCount()); if (nIndex >= nPageCount) nIndex = nPageCount - 1; diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index a21f520af711..461e079f8304 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -500,7 +500,7 @@ void SlotManager::GetAttrState (SfxItemSet& rSet) rSet.Put ( SfxUInt16Item ( nSlotId, - (sal_uInt16)mrSlideSorter.GetView().GetLayouter().GetColumnCount() + static_cast(mrSlideSorter.GetView().GetLayouter().GetColumnCount()) ) ); break; @@ -1054,7 +1054,7 @@ void SlotManager::InsertSlide (SfxRequest& rRequest) // Create shapes for the default layout. pNewPage = pDocument->GetMasterSdPage( - (sal_uInt16)(nInsertionIndex+1), PageKind::Standard); + static_cast(nInsertionIndex+1), PageKind::Standard); pNewPage->CreateTitleAndLayout (true,true); } } diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx index 0267860dfecc..31d99706bd68 100644 --- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx +++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx @@ -635,9 +635,9 @@ SdPage* SlideSorterModel::GetPage (const sal_Int32 nSdIndex) const if (pModel != nullptr) { if (meEditMode == EditMode::Page) - return pModel->GetSdPage ((sal_uInt16)nSdIndex, PageKind::Standard); + return pModel->GetSdPage (static_cast(nSdIndex), PageKind::Standard); else - return pModel->GetMasterSdPage ((sal_uInt16)nSdIndex, PageKind::Standard); + return pModel->GetMasterSdPage (static_cast(nSdIndex), PageKind::Standard); } else return nullptr; diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index b0f6bc32031a..bd5271954aa8 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -547,7 +547,7 @@ void SlideSorterViewShell::WriteFrameViewData() if (mpFrameView != nullptr) { view::SlideSorterView& rView (mpSlideSorter->GetView()); - mpFrameView->SetSlidesPerRow((sal_uInt16)rView.GetLayouter().GetColumnCount()); + mpFrameView->SetSlidesPerRow(static_cast(rView.GetLayouter().GetColumnCount())); // DrawMode for 'main' window if( mpFrameView->GetDrawMode() != GetActiveWindow()->GetDrawMode() ) @@ -567,7 +567,7 @@ void SlideSorterViewShell::WriteFrameViewData() // We have no current page to set but at least we can make sure // that the index of the frame view has a legal value. if (mpFrameView->GetSelectedPage() >= mpSlideSorter->GetModel().GetPageCount()) - mpFrameView->SetSelectedPage((sal_uInt16)mpSlideSorter->GetModel().GetPageCount()-1); + mpFrameView->SetSelectedPage(static_cast(mpSlideSorter->GetModel().GetPageCount())-1); } } } @@ -738,7 +738,7 @@ void SlideSorterViewShell::ExecMovePageFirst (SfxRequest& /*rReq*/) SyncPageSelectionToDocument(xSelection); // Moves selected pages after page -1 - GetDoc()->MovePages( (sal_uInt16) -1 ); + GetDoc()->MovePages( sal_uInt16(-1) ); PostMoveSlidesActions(xSelection); } diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 06a77214f9fe..aba2d0473ae7 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -323,8 +323,8 @@ void TableValueSet::Resize() int nVisibleRowCount = (aValueSetSize.Height()+2) / aItemSize.Height(); - SetColCount ((sal_uInt16)nColumnCount); - SetLineCount ((sal_uInt16)nRowCount); + SetColCount (static_cast(nColumnCount)); + SetLineCount (static_cast(nRowCount)); if( !m_bModal ) { @@ -402,7 +402,7 @@ void TableDesignWidget::updateControls() { if( aNames[nIndex] == sStyleName ) { - nSelection = (sal_uInt16)nIndex+1; + nSelection = static_cast(nIndex)+1; break; } } diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx index 6612478aa1e2..046880e4822f 100644 --- a/sd/source/ui/table/tableobjectbar.cxx +++ b/sd/source/ui/table/tableobjectbar.cxx @@ -167,10 +167,10 @@ void TableObjectBar::Execute( SfxRequest& rReq ) else nSlotId = SID_TABLE_INSERT_COL; - rReq.AppendItem(SfxInt16Item((sal_uInt16)nSlotId, nCount)); + rReq.AppendItem(SfxInt16Item(static_cast(nSlotId), nCount)); rReq.AppendItem(SfxBoolItem(SID_TABLE_PARAM_INSERT_AFTER, bInsertAfter)); - rReq.SetSlot( (sal_uInt16)nSlotId ); + rReq.SetSlot( static_cast(nSlotId) ); } } diff --git a/sd/source/ui/tools/ConfigurationAccess.cxx b/sd/source/ui/tools/ConfigurationAccess.cxx index 438b4c015b0e..9e32b5314d2b 100644 --- a/sd/source/ui/tools/ConfigurationAccess.cxx +++ b/sd/source/ui/tools/ConfigurationAccess.cxx @@ -63,7 +63,7 @@ void ConfigurationAccess::Initialize ( Sequence aCreationArguments(comphelper::InitAnyPropertySequence( { {"nodepath", makeAny(rsRootName)}, - {"depth", makeAny((sal_Int32)-1)} + {"depth", makeAny(sal_Int32(-1))} })); OUString sAccessService; diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index da9dab6e2077..143e2d02cb9e 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -438,7 +438,7 @@ Image PreviewRenderer::ScaleBitmap ( break; Size aFrameSize ( nWidth, - (long)((nWidth*1.0 * aSize.Height()) / aSize.Width() + 0.5)); + static_cast((nWidth*1.0 * aSize.Height()) / aSize.Width() + 0.5)); Size aPreviewSize (aFrameSize.Width()-2,aFrameSize.Height()-2); MapMode aMapMode (mpPreviewDevice->GetMapMode()); aMapMode.SetMapUnit(MapUnit::MapPixel); diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx index 02e541d4b572..09289a73b976 100644 --- a/sd/source/ui/unoidl/SdUnoDrawView.cxx +++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx @@ -384,7 +384,7 @@ Any SAL_CALL SdUnoDrawView::getFastPropertyValue ( aValue <<= GetZoom(); break; case DrawController::PROPERTY_ZOOMTYPE: - aValue <<= (sal_Int16)css::view::DocumentZoomType::BY_VALUE; + aValue <<= sal_Int16(css::view::DocumentZoomType::BY_VALUE); break; case DrawController::PROPERTY_VIEWOFFSET: aValue <<= GetViewOffset(); @@ -438,7 +438,7 @@ sal_Int16 SdUnoDrawView::GetZoom() const { if (mrDrawViewShell.GetActiveWindow() ) { - return (sal_Int16)mrDrawViewShell.GetActiveWindow()->GetZoom(); + return static_cast(mrDrawViewShell.GetActiveWindow()->GetZoom()); } else { diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 44262f34c2c8..f8e682edfc8f 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -646,7 +646,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, { if( aPrintOpts.GetOutputQuality() != nValue) { - aPrintOpts.SetOutputQuality( (sal_uInt16)nValue ); + aPrintOpts.SetOutputQuality( static_cast(nValue) ); bOptionsChanged = true; } bOk = true; @@ -697,7 +697,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, sal_Int32 nValue = 0; if( (*pValues >>= nValue) && (nValue >= 0) ) { - pDoc->SetDefaultTabulator((sal_uInt16)nValue); + pDoc->SetDefaultTabulator(static_cast(nValue)); bOk = true; bChanged = true; } @@ -892,7 +892,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, // the document and determine it really differs from the old // one. sal_Int16 nOldValue = - (sal_Int16)pDoc->GetPrinterIndependentLayout (); + static_cast(pDoc->GetPrinterIndependentLayout ()); sal_Int16 nValue = 0; if (*pValues >>= nValue) { @@ -1060,7 +1060,7 @@ DocumentSettings::_getPropertyValues( *pValue <<= aPrintOpts.IsOutline(); break; case HANDLE_SLIDESPERHANDOUT: - *pValue <<= (sal_Int16)aPrintOpts.GetHandoutPages(); + *pValue <<= static_cast(aPrintOpts.GetHandoutPages()); break; case HANDLE_HANDOUTHORIZONTAL: *pValue <<= aPrintOpts.IsHandoutHorizontal(); @@ -1093,13 +1093,13 @@ DocumentSettings::_getPropertyValues( *pValue <<= aPrintOpts.IsBackPage(); break; case HANDLE_PRINTQUALITY: - *pValue <<= (sal_Int32)aPrintOpts.GetOutputQuality(); + *pValue <<= static_cast(aPrintOpts.GetOutputQuality()); break; case HANDLE_MEASUREUNIT: { short nMeasure; SvxFieldUnitToMeasureUnit( pDoc->GetUIUnit(), nMeasure ); - *pValue <<= (sal_Int16)nMeasure; + *pValue <<= static_cast(nMeasure); } break; case HANDLE_SCALE_NUM: @@ -1109,10 +1109,10 @@ DocumentSettings::_getPropertyValues( *pValue <<= pDoc->GetUIScale().GetDenominator(); break; case HANDLE_TABSTOP: - *pValue <<= (sal_Int32)pDoc->GetDefaultTabulator(); + *pValue <<= static_cast(pDoc->GetDefaultTabulator()); break; case HANDLE_PAGENUMFMT: - *pValue <<= (sal_Int32)pDoc->GetPageNumType(); + *pValue <<= static_cast(pDoc->GetPageNumType()); break; case HANDLE_PRINTERNAME: { @@ -1177,7 +1177,7 @@ DocumentSettings::_getPropertyValues( case HANDLE_PRINTER_INDEPENDENT_LAYOUT: { sal_Int16 nPrinterIndependentLayout = - (sal_Int16)pDoc->GetPrinterIndependentLayout(); + static_cast(pDoc->GetPrinterIndependentLayout()); *pValue <<= nPrinterIndependentLayout; } break; diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx index 6cb6f6d6dbc5..be3b964aebb9 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -87,7 +87,7 @@ void SAL_CALL SdXCustomPresentation::insertByIndex( sal_Int32 Index, const uno:: if( bDisposing ) throw lang::DisposedException(); - if( Index < 0 || Index > (sal_Int32)( mpSdCustomShow ? mpSdCustomShow->PagesVector().size() : 0 ) ) + if( Index < 0 || Index > static_cast( mpSdCustomShow ? mpSdCustomShow->PagesVector().size() : 0 ) ) throw lang::IndexOutOfBoundsException(); uno::Reference< drawing::XDrawPage > xPage; @@ -185,7 +185,7 @@ uno::Any SAL_CALL SdXCustomPresentation::getByIndex( sal_Int32 Index ) if( bDisposing ) throw lang::DisposedException(); - if (Index < 0 || !mpSdCustomShow || Index >= (sal_Int32)mpSdCustomShow->PagesVector().size()) + if (Index < 0 || !mpSdCustomShow || Index >= static_cast(mpSdCustomShow->PagesVector().size())) throw lang::IndexOutOfBoundsException(); uno::Any aAny; diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 546e724af0fc..b6c6d9a1c968 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -494,7 +494,7 @@ uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::insertNewByIndex( sal SdrLayerAdmin& rLA=mpModel->mpDoc->GetLayerAdmin(); const sal_Int32 nMax=rLA.GetLayerCount(); if (nIndex>nMax) nIndex=nMax; - xLayer = GetLayer (rLA.NewLayer(aLayerName,(sal_uInt16)nIndex)); + xLayer = GetLayer (rLA.NewLayer(aLayerName,static_cast(nIndex))); mpModel->SetModified(); } return xLayer; @@ -596,7 +596,7 @@ uno::Any SAL_CALL SdLayerManager::getByIndex( sal_Int32 nLayer ) if( mpModel->mpDoc ) { SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin(); - uno::Reference xLayer (GetLayer (rLayerAdmin.GetLayer((sal_uInt16)nLayer))); + uno::Reference xLayer (GetLayer (rLayerAdmin.GetLayer(static_cast(nLayer)))); aAny <<= xLayer; } return aAny; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 4216ff32874a..8e85f989b376 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -484,7 +484,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) else { // here we determine the page after which we should insert - SdPage* pPreviousStandardPage = mpDoc->GetSdPage( std::min( (sal_uInt16)(nPageCount - 1), nPage ), PageKind::Standard ); + SdPage* pPreviousStandardPage = mpDoc->GetSdPage( std::min( static_cast(nPageCount - 1), nPage ), PageKind::Standard ); SdrLayerIDSet aVisibleLayers = pPreviousStandardPage->TRG_GetMasterPageVisibleLayers(); bool bIsPageBack = aVisibleLayers.IsSet( aBckgrnd ); bool bIsPageObj = aVisibleLayers.IsSet( aBckgrndObj ); @@ -1240,7 +1240,7 @@ void SAL_CALL SdXImpressDocument::setPropertyValue( const OUString& aPropertyNam if(!(aValue >>= nValue) || nValue < 0 ) throw lang::IllegalArgumentException(); - mpDoc->SetDefaultTabulator((sal_uInt16)nValue); + mpDoc->SetDefaultTabulator(static_cast(nValue)); break; } case WID_MODEL_VISAREA: @@ -1314,7 +1314,7 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property break; } case WID_MODEL_TABSTOP: - aAny <<= (sal_Int32)mpDoc->GetDefaultTabulator(); + aAny <<= static_cast(mpDoc->GetDefaultTabulator()); break; case WID_MODEL_VISAREA: { @@ -1907,11 +1907,11 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r { vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast( pOut->GetExtOutDevData() ); - if ( !( mpDoc->GetSdPage((sal_Int16) nPageNumber-1, PageKind::Standard)->IsExcluded() ) || + if ( !( mpDoc->GetSdPage(static_cast(nPageNumber)-1, PageKind::Standard)->IsExcluded() ) || (pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportHiddenSlides()) ) { std::unique_ptr<::sd::ClientView> pView( new ::sd::ClientView( mpDocShell, pOut ) ); - ::tools::Rectangle aVisArea = ::tools::Rectangle( Point(), mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1, ePageKind )->GetSize() ); + ::tools::Rectangle aVisArea = ::tools::Rectangle( Point(), mpDoc->GetSdPage( static_cast(nPageNumber) - 1, ePageKind )->GetSize() ); vcl::Region aRegion( aVisArea ); ::sd::ViewShell* pOldViewSh = mpDocShell->GetViewShell(); @@ -1934,7 +1934,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r if( xModel == mpDocShell->GetModel() ) { - pView->ShowSdrPage( mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1, ePageKind )); + pView->ShowSdrPage( mpDoc->GetSdPage( static_cast(nPageNumber) - 1, ePageKind )); SdrPageView* pPV = pView->GetSdrPageView(); if( pOldSdView ) @@ -2151,7 +2151,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r rBookmarks.clear(); //---> #i56629, #i40318 //get the page name, will be used as outline element in PDF bookmark pane - OUString aPageName = mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1 , PageKind::Standard )->GetName(); + OUString aPageName = mpDoc->GetSdPage( static_cast(nPageNumber) - 1 , PageKind::Standard )->GetName(); if( !aPageName.isEmpty() ) { // Destination PageNum @@ -2816,7 +2816,7 @@ uno::Any SAL_CALL SdDrawPagesAccess::getByIndex( sal_Int32 Index ) if( (Index < 0) || (Index >= mpModel->mpDoc->GetSdPageCount( PageKind::Standard ) ) ) throw lang::IndexOutOfBoundsException(); - SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)Index, PageKind::Standard ); + SdPage* pPage = mpModel->mpDoc->GetSdPage( static_cast(Index), PageKind::Standard ); if( pPage ) { uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY ); @@ -2927,7 +2927,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdDrawPagesAccess::insertNewByInde if( mpModel->mpDoc ) { - SdPage* pPage = mpModel->InsertSdPage( (sal_uInt16)nIndex, false ); + SdPage* pPage = mpModel->InsertSdPage( static_cast(nIndex), false ); if( pPage ) { uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY ); @@ -3085,7 +3085,7 @@ uno::Any SAL_CALL SdMasterPagesAccess::getByIndex( sal_Int32 Index ) if( (Index < 0) || (Index >= mpModel->mpDoc->GetMasterSdPageCount( PageKind::Standard ) ) ) throw lang::IndexOutOfBoundsException(); - SdPage* pPage = mpModel->mpDoc->GetMasterSdPage( (sal_uInt16)Index, PageKind::Standard ); + SdPage* pPage = mpModel->mpDoc->GetMasterSdPage( static_cast(Index), PageKind::Standard ); if( pPage ) { uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY ); @@ -3136,7 +3136,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn bUnique = true; for( sal_Int32 nMaster = 1; nMaster < nMPageCount; nMaster++ ) { - SdPage* pPage = static_cast(pDoc->GetMasterPage((sal_uInt16)nMaster)); + SdPage* pPage = static_cast(pDoc->GetMasterPage(static_cast(nMaster))); if( pPage && pPage->GetName() == aPrefix ) { bUnique = false; @@ -3160,8 +3160,8 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn static_cast(pDoc->GetStyleSheetPool())->CreateLayoutStyleSheets( aPrefix ); // get the first page for initial size and border settings - SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PageKind::Standard ); - SdPage* pRefNotesPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PageKind::Notes); + SdPage* pPage = mpModel->mpDoc->GetSdPage( sal_uInt16(0), PageKind::Standard ); + SdPage* pRefNotesPage = mpModel->mpDoc->GetSdPage( sal_uInt16(0), PageKind::Notes); // create and insert new draw masterpage SdPage* pMPage = mpModel->mpDoc->AllocSdPage(true); @@ -3171,7 +3171,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn pPage->GetRightBorder(), pPage->GetLowerBorder() ); pMPage->SetLayoutName( aLayoutName ); - pDoc->InsertMasterPage(pMPage, (sal_uInt16)nInsertPos); + pDoc->InsertMasterPage(pMPage, static_cast(nInsertPos)); { // ensure default MasterPage fill @@ -3189,7 +3189,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn pRefNotesPage->GetRightBorder(), pRefNotesPage->GetLowerBorder() ); pMNotesPage->SetLayoutName( aLayoutName ); - pDoc->InsertMasterPage(pMNotesPage, (sal_uInt16)nInsertPos + 1); + pDoc->InsertMasterPage(pMNotesPage, static_cast(nInsertPos) + 1); pMNotesPage->SetAutoLayout(AUTOLAYOUT_NOTES, true, true); mpModel->SetModified(); } diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 6dd5c89a1a90..be4785c732fc 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -553,7 +553,7 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& aPropertyName, const c if(!(aValue >>= nVerb)) throw lang::IllegalArgumentException(); - pInfo->mnVerb = (sal_uInt16)nVerb; + pInfo->mnVerb = static_cast(nVerb); break; } case WID_DIMCOLOR: @@ -766,10 +766,10 @@ css::uno::Any SAL_CALL SdXShape::getPropertyValue( const OUString& PropertyName aRet <<= EffectMigration::GetSoundOn( mpShape ); break; case WID_BLUESCREEN: - aRet <<= (sal_Int32)( pInfo?pInfo->maBlueScreen.GetColor():0x00ffffff ); + aRet <<= static_cast( pInfo?pInfo->maBlueScreen.GetColor():0x00ffffff ); break; case WID_VERB: - aRet <<= (sal_Int32)( pInfo?pInfo->mnVerb:0 ); + aRet <<= static_cast( pInfo?pInfo->mnVerb:0 ); break; case WID_DIMCOLOR: aRet <<= EffectMigration::GetDimColor( mpShape ); @@ -1352,7 +1352,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno case presentation::ClickAction_VERB: if( nFound & FoundFlags::Verb ) { - pInfo->mnVerb = (sal_uInt16)nVerb; + pInfo->mnVerb = static_cast(nVerb); bOk = true; } break; @@ -1628,7 +1628,7 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) break; case presentation::ClickAction_VERB: - aAny <<= (sal_Int32)pInfo->mnVerb; + aAny <<= static_cast(pInfo->mnVerb); pProperties->Name = maStrVerb; pProperties->Handle = -1; pProperties->Value = aAny; diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 6aeedfd081eb..8cadc7db9239 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1035,10 +1035,10 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) aAny <<= GetPage()->GetLowerBorder(); break; case WID_PAGE_WIDTH: - aAny <<= (sal_Int32)( GetPage()->GetSize().getWidth() ); + aAny <<= static_cast( GetPage()->GetSize().getWidth() ); break; case WID_PAGE_HEIGHT: - aAny <<= (sal_Int32)( GetPage()->GetSize().getHeight() ); + aAny <<= static_cast( GetPage()->GetSize().getHeight() ); break; case WID_PAGE_ORIENT: aAny <<= view::PaperOrientation( @@ -1050,7 +1050,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) aAny <<= GetPage()->GetFadeEffect(); break; case WID_PAGE_CHANGE: - aAny <<= (sal_Int32)( GetPage()->GetPresChange() ); + aAny <<= static_cast( GetPage()->GetPresChange() ); break; case WID_PAGE_SPEED: { @@ -1060,7 +1060,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) } break; case WID_PAGE_LAYOUT: - aAny <<= (sal_Int16)( GetPage()->GetAutoLayout() ); + aAny <<= static_cast( GetPage()->GetAutoLayout() ); break; case WID_PAGE_NUMBER: { @@ -1069,7 +1069,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) if(nPageNumber > 0) { // for all other pages calculate the number - aAny <<= (sal_Int16)((sal_uInt16)((nPageNumber-1)>>1) + 1); + aAny <<= static_cast(static_cast((nPageNumber-1)>>1) + 1); } else { @@ -1078,7 +1078,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) } break; case WID_PAGE_DURATION: - aAny <<= (sal_Int32)( GetPage()->GetTime() + .5 ); + aAny <<= static_cast( GetPage()->GetTime() + .5 ); break; case WID_PAGE_HIGHRESDURATION: aAny <<= GetPage()->GetTime(); @@ -1109,7 +1109,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) { sal_uInt16 nPgNum = 0; sal_uInt16 nPageCount = pDoc->GetSdPageCount( PageKind::Standard ); - sal_uInt16 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNum() - 1 ) >> 1 ); + sal_uInt16 nPageNumber = static_cast( ( GetPage()->GetPageNum() - 1 ) >> 1 ); while( nPgNum < nPageCount ) { pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PageKind::Standard ), nPgNum == nPageNumber ); @@ -1150,7 +1150,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) { sal_uInt16 nPgNum = 0; sal_uInt16 nPageCount = pDoc->GetSdPageCount( PageKind::Standard ); - sal_uInt16 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNum() - 1 ) >> 1 ); + sal_uInt16 nPageNumber = static_cast( ( GetPage()->GetPageNum() - 1 ) >> 1 ); while( nPgNum < nPageCount ) { pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PageKind::Standard ), nPgNum == nPageNumber ); diff --git a/sd/source/ui/unoidl/unopool.cxx b/sd/source/ui/unoidl/unopool.cxx index bee9100319e4..33573b3bea49 100644 --- a/sd/source/ui/unoidl/unopool.cxx +++ b/sd/source/ui/unoidl/unopool.cxx @@ -71,7 +71,7 @@ void SdUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEnt if( rValue >>= aLocale ) mpDrawModel->SetLanguage( SdUnoGetLanguage( aLocale ), - (sal_uInt16)pEntry->mnHandle ); + static_cast(pEntry->mnHandle) ); } } SvxUnoDrawPool::putAny( pPool, pEntry, rValue ); diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 7bf0ba2d15e2..4a4399c83ee1 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1776,8 +1776,8 @@ private: const Size aPageSize (rHandoutPage.GetSize()); const Size aPrintSize (rInfo.mpPrinter->GetOutputSize()); - const double fHorz = (double) aPrintSize.Width() / aPageSize.Width(); - const double fVert = (double) aPrintSize.Height() / aPageSize.Height(); + const double fHorz = static_cast(aPrintSize.Width()) / aPageSize.Width(); + const double fVert = static_cast(aPrintSize.Height()) / aPageSize.Height(); Fraction aFract; if ( fHorz < fVert ) @@ -1904,8 +1904,8 @@ private: if (mpOptions->IsPageSize()) { - const double fHorz ((double) rInfo.maPrintSize.Width() / aPageSize.Width()); - const double fVert ((double) rInfo.maPrintSize.Height() / aPageSize.Height()); + const double fHorz (static_cast(rInfo.maPrintSize.Width()) / aPageSize.Width()); + const double fVert (static_cast(rInfo.maPrintSize.Height()) / aPageSize.Height()); Fraction aFract; if (fHorz < fVert) @@ -1974,18 +1974,18 @@ private: else aPrintSize_2.Height() >>= 1; - const double fPageWH = (double) aPageSize_2.Width() / aPageSize_2.Height(); - const double fPrintWH = (double) aPrintSize_2.Width() / aPrintSize_2.Height(); + const double fPageWH = static_cast(aPageSize_2.Width()) / aPageSize_2.Height(); + const double fPrintWH = static_cast(aPrintSize_2.Width()) / aPrintSize_2.Height(); if( fPageWH < fPrintWH ) { - aPageSize_2.Width() = (long) ( aPrintSize_2.Height() * fPageWH ); + aPageSize_2.Width() = static_cast( aPrintSize_2.Height() * fPageWH ); aPageSize_2.Height()= aPrintSize_2.Height(); } else { aPageSize_2.Width() = aPrintSize_2.Width(); - aPageSize_2.Height() = (long) ( aPrintSize_2.Width() / fPageWH ); + aPageSize_2.Height() = static_cast( aPrintSize_2.Width() / fPageWH ); } MapMode aMap (rInfo.maMap); @@ -2033,7 +2033,7 @@ private: sal_uInt32 nFirstIndex = 0, nLastIndex = aPageVector.size() - 1; if( aPageVector.size() & 1 ) - aPairVector.emplace_back( (sal_uInt16) 65535, aPageVector[ nFirstIndex++ ] ); + aPairVector.emplace_back( sal_uInt16(65535), aPageVector[ nFirstIndex++ ] ); else aPairVector.emplace_back( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] ); diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 2609e6e65bce..279f0700d974 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -164,7 +164,7 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode ) mpParaObj(nullptr), meStartViewMode(PageKind::Standard), meStartEditMode(EditMode::Page), - mnStartPageIndex((sal_uInt16)-1), + mnStartPageIndex(sal_uInt16(-1)), mpStartEditedObject(nullptr), maStartSelection(), mpSearchItem(nullptr), @@ -354,7 +354,7 @@ void SdOutliner::EndSpelling() mpWeakViewShell.reset(); mpView = nullptr; mpWindow = nullptr; - mnStartPageIndex = (sal_uInt16) -1; + mnStartPageIndex = sal_uInt16(-1); } bool SdOutliner::SpellNextDocument() @@ -500,7 +500,7 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) if (nCommand == SvxSearchCmd::FIND) bEndOfSearch = false; } - mnStartPageIndex = (sal_uInt16)-1; + mnStartPageIndex = sal_uInt16(-1); } SfxChildWindow *pChildWin = @@ -630,7 +630,7 @@ bool SdOutliner::SearchAndReplaceAll() if( !mbStringFound ) { RestoreStartPosition (); - mnStartPageIndex = (sal_uInt16)-1; + mnStartPageIndex = sal_uInt16(-1); return true; } @@ -642,7 +642,7 @@ bool SdOutliner::SearchAndReplaceAll() if (mpSearchItem->GetCommand() == SvxSearchCmd::FIND_ALL && comphelper::LibreOfficeKit::isActive() && bFoundMatch && aSelections.size() == 1) { // Without this, RememberStartPosition() will think it already has a remembered position. - mnStartPageIndex = (sal_uInt16)-1; + mnStartPageIndex = sal_uInt16(-1); RememberStartPosition(); @@ -698,7 +698,7 @@ bool SdOutliner::SearchAndReplaceAll() rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles.getStr()); } - mnStartPageIndex = (sal_uInt16)-1; + mnStartPageIndex = sal_uInt16(-1); return bRet; } @@ -956,7 +956,7 @@ void SdOutliner::RememberStartPosition() return; } - if ( mnStartPageIndex != (sal_uInt16) -1 ) + if ( mnStartPageIndex != sal_uInt16(-1) ) return; if( nullptr != dynamic_cast< const sd::DrawViewShell *>( pViewShell.get() )) @@ -996,7 +996,7 @@ void SdOutliner::RememberStartPosition() } else { - mnStartPageIndex = (sal_uInt16)-1; + mnStartPageIndex = sal_uInt16(-1); } } @@ -1005,7 +1005,7 @@ void SdOutliner::RestoreStartPosition() bool bRestore = true; // Take a negative start page index as inidicator that restoring the // start position is not requested. - if (mnStartPageIndex == (sal_uInt16)-1 ) + if (mnStartPageIndex == sal_uInt16(-1) ) bRestore = false; // Don't restore when the view shell is not valid. std::shared_ptr pViewShell (mpWeakViewShell.lock()); @@ -1506,7 +1506,7 @@ SdrObject* SdOutliner::SetObject ( const sd::outliner::IteratorPosition& rPosition) { SetViewMode (rPosition.mePageKind); - SetPage (rPosition.meEditMode, (sal_uInt16)rPosition.mnPageIndex); + SetPage (rPosition.meEditMode, static_cast(rPosition.mnPageIndex)); mnText = rPosition.mnText; return rPosition.mxObject.get(); } diff --git a/sd/source/ui/view/OutlinerIterator.cxx b/sd/source/ui/view/OutlinerIterator.cxx index d94aa84d5297..aee6712c4446 100644 --- a/sd/source/ui/view/OutlinerIterator.cxx +++ b/sd/source/ui/view/OutlinerIterator.cxx @@ -637,11 +637,11 @@ void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex) { if (maPosition.meEditMode == EditMode::Page) mpPage = mpDocument->GetSdPage ( - (sal_uInt16)nPageIndex, + static_cast(nPageIndex), maPosition.mePageKind); else mpPage = mpDocument->GetMasterSdPage ( - (sal_uInt16)nPageIndex, + static_cast(nPageIndex), maPosition.mePageKind); } else diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx index 38b1a9ebea47..daa168782a28 100644 --- a/sd/source/ui/view/ViewClipboard.cxx +++ b/sd/source/ui/view/ViewClipboard.cxx @@ -198,7 +198,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( // pages are inserted. pBookmarkList = &rTransferable.GetPageBookmarks(); pDataDocSh = rTransferable.GetPageDocShell(); - nInsertPgCnt = (sal_uInt16)pBookmarkList->size(); + nInsertPgCnt = static_cast(pBookmarkList->size()); } else { diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index ab6eca07ca5e..804dce0859b6 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -481,8 +481,8 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize, b aSize.Height() -= (aBorder.Top() + aBorder.Bottom()); Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel(aObjSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( - Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), (long int)1 ) ), - Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), (long int)1) ) ); + Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), static_cast(1) ) ), + Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), static_cast(1)) ) ); } mpImpl->ResizePixel(rOrigin, rSize, false); diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index f4324c8398a2..18ae719434c8 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -440,7 +440,7 @@ void ViewTabBar::AddTabBarButton ( if (nPosition>=0 && nPosition<=mpTabControl->GetPageCount()) { - sal_uInt16 nIndex ((sal_uInt16)nPosition); + sal_uInt16 nIndex (static_cast(nPosition)); // Insert the button into our local array. maTabBarButtons.insert(maTabBarButtons.begin()+nIndex, rButton); diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index b2e821d7a58e..1eca050e50e3 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -464,7 +464,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) { const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( nPara ); const SvxULSpaceItem& rItem = rItems.Get( EE_PARA_ULSPACE ); - nUpper = std::max( nUpper, (long)rItem.GetUpper() ); + nUpper = std::max( nUpper, static_cast(rItem.GetUpper()) ); } if( nUpper == 0 ) rSet.DisableItem( SID_PARASPACE_DECREASE ); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 16d465cf75f9..0504e883da90 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -164,7 +164,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) nUpper -= 100; nUpper = std::max( nUpper, 0 ); } - pNewItem->SetUpper( (sal_uInt16) nUpper ); + pNewItem->SetUpper( static_cast(nUpper) ); long nLower = pNewItem->GetLower(); if( nSlot == SID_PARASPACE_INCREASE ) @@ -174,7 +174,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) nLower -= 100; nLower = std::max( nLower, 0 ); } - pNewItem->SetLower( (sal_uInt16) nLower ); + pNewItem->SetLower( static_cast(nLower) ); SfxItemSet aNewAttrs( aAttr ); aNewAttrs.Put( *pNewItem ); @@ -205,7 +205,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) nUpper -= 100; nUpper = std::max( nUpper, 0 ); } - pNewItem->SetUpper( (sal_uInt16) nUpper ); + pNewItem->SetUpper( static_cast(nUpper) ); long nLower = pNewItem->GetLower(); if( nSlot == SID_PARASPACE_INCREASE ) @@ -215,7 +215,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) nLower -= 100; nLower = std::max( nLower, 0 ); } - pNewItem->SetLower( (sal_uInt16) nLower ); + pNewItem->SetLower( static_cast(nLower) ); aNewAttrs.Put( *pNewItem ); pNewItem.reset(); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 74433d89fa6e..2fcb816d77e0 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -511,10 +511,10 @@ VclPtr DrawViewShell::CreateHRuler (::sd::Window* pWin) GetViewFrame()->GetBindings(), aWBits); // Metric ... - sal_uInt16 nMetric = (sal_uInt16)GetDoc()->GetUIUnit(); + sal_uInt16 nMetric = static_cast(GetDoc()->GetUIUnit()); if( nMetric == 0xffff ) - nMetric = (sal_uInt16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit(); + nMetric = static_cast(GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit()); pRuler->SetUnit( FieldUnit( nMetric ) ); @@ -542,10 +542,10 @@ VclPtr DrawViewShell::CreateVRuler(::sd::Window* pWin) GetViewFrame()->GetBindings(), aWBits); // Metric same as HRuler, use document setting - sal_uInt16 nMetric = (sal_uInt16)GetDoc()->GetUIUnit(); + sal_uInt16 nMetric = static_cast(GetDoc()->GetUIUnit()); if( nMetric == 0xffff ) - nMetric = (sal_uInt16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit(); + nMetric = static_cast(GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit()); pRuler->SetUnit( FieldUnit( nMetric ) ); @@ -595,7 +595,7 @@ IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab, void ) - maTabControl->GetPosPixel().X() ; Size aTabSize = maTabControl->GetSizePixel(); - aTabSize.Width() = std::min(pTab->GetSplitSize(), (long)(nMax-1)); + aTabSize.Width() = std::min(pTab->GetSplitSize(), static_cast(nMax-1)); maTabControl->SetSizePixel(aTabSize); @@ -625,11 +625,11 @@ SdPage* DrawViewShell::getCurrentPage() const if (meEditMode == EditMode::Page) { - return GetDoc()->GetSdPage((sal_uInt16)nCurrentPage, mePageKind); + return GetDoc()->GetSdPage(static_cast(nCurrentPage), mePageKind); } else // EditMode::MasterPage { - return GetDoc()->GetMasterSdPage((sal_uInt16)nCurrentPage, mePageKind); + return GetDoc()->GetMasterSdPage(static_cast(nCurrentPage), mePageKind); } } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 42be1b63f8b0..698dac808ae0 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -916,8 +916,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) switch( eZT ) { case SvxZoomType::PERCENT: - SetZoom( (long) static_cast( pArgs-> - Get( SID_ATTR_ZOOM ) ).GetValue() ); + SetZoom( static_cast(static_cast( pArgs-> + Get( SID_ATTR_ZOOM ) ).GetValue()) ); break; case SvxZoomType::OPTIMAL: @@ -1234,8 +1234,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SdrPageView* pPV; Point aMPos = GetActiveWindow()->PixelToLogic( maMousePos ); - sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( Size( - FuPoor::HITPIX, 0 ) ).Width(); + sal_uInt16 nHitLog = static_cast(GetActiveWindow()->PixelToLogic( Size( + FuPoor::HITPIX, 0 ) ).Width()); sal_uInt16 nHelpLine; mbMousePosFreezed = false; @@ -1404,7 +1404,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case FN_NUM_BULLET_ON: { // The value (sal_uInt16)0xFFFF means set bullet on/off. - SfxUInt16Item aItem(FN_SVX_SET_BULLET, (sal_uInt16)0xFFFF); + SfxUInt16Item aItem(FN_SVX_SET_BULLET, sal_uInt16(0xFFFF)); GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_BULLET, SfxCallMode::RECORD, { &aItem }); } @@ -1413,7 +1413,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case FN_NUM_NUMBERING_ON: { // The value (sal_uInt16)0xFFFF means set bullet on/off. - SfxUInt16Item aItem(FN_SVX_SET_NUMBER, (sal_uInt16)0xFFFF); + SfxUInt16Item aItem(FN_SVX_SET_NUMBER, sal_uInt16(0xFFFF)); GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_NUMBER, SfxCallMode::RECORD, { &aItem }); } @@ -1858,7 +1858,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( aPrevLayer == aName ) { - nPrevLayer = std::max(nLayer, (sal_uInt16) 4); + nPrevLayer = std::max(nLayer, sal_uInt16(4)); } } diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index f8f398dd91ca..d267641c9a0f 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -131,7 +131,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) if(SlideShow::IsRunning(GetViewShellBase()) && rReq.GetArgs()) { const SfxUInt32Item* pWhatPage = rReq.GetArg(ID_VAL_WHATPAGE); - SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber((sal_Int32)((pWhatPage->GetValue()-1)>>1)); + SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber(static_cast((pWhatPage->GetValue()-1)>>1)); } else { @@ -147,7 +147,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) const SfxUInt32Item* pWhatPage = rReq.GetArg(ID_VAL_WHATPAGE); const SfxUInt32Item* pWhatKind = rReq.GetArg(ID_VAL_WHATKIND); - sal_Int32 nWhatPage = (sal_Int32)pWhatPage->GetValue (); + sal_Int32 nWhatPage = static_cast(pWhatPage->GetValue ()); PageKind nWhatKind = (PageKind)pWhatKind->GetValue (); if (! (nWhatKind >= PageKind::Standard && nWhatKind <= PageKind::Handout)) { @@ -168,7 +168,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) break; } - nSelectedPage = (short) nWhatPage; + nSelectedPage = static_cast(nWhatPage); mePageKind = nWhatKind; } } @@ -216,7 +216,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) if(pWhatLayer) { - nCurPage = (short)pWhatLayer->GetValue(); + nCurPage = static_cast(pWhatLayer->GetValue()); bCurPageValid = true; } } @@ -1023,8 +1023,8 @@ void DrawViewShell::GetSnapItemState( SfxItemSet &rSet ) { SdrPageView* pPV; Point aMPos = GetActiveWindow()->PixelToLogic(maMousePos); - sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( - Size(FuPoor::HITPIX,0)).Width(); + sal_uInt16 nHitLog = static_cast(GetActiveWindow()->PixelToLogic( + Size(FuPoor::HITPIX,0)).Width()); sal_uInt16 nHelpLine; if ( mpDrawView->PickHelpLine(aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) ) diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 6600582b685c..0f38933a37f3 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -397,9 +397,9 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) } } - pBmpMask->SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ), - (sal_uInt8) ( nGreen / fDiv + .5 ), - (sal_uInt8) ( nBlue / fDiv + .5 ) ) ); + pBmpMask->SetColor( Color( static_cast( nRed / fDiv + .5 ), + static_cast( nGreen / fDiv + .5 ), + static_cast( nBlue / fDiv + .5 ) ) ); } } } @@ -504,8 +504,8 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) // is there a snap object under the cursor? SdrPageView* pPV; Point aMPos = pWin->PixelToLogic( maMousePos ); - sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( - Size(FuPoor::HITPIX, 0 ) ).Width(); + sal_uInt16 nHitLog = static_cast(GetActiveWindow()->PixelToLogic( + Size(FuPoor::HITPIX, 0 ) ).Width()); sal_uInt16 nHelpLine; // for glue points SdrObject* pObj = nullptr; diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 13c5807082f7..d1d604e43ad0 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -573,8 +573,8 @@ void DrawViewShell::SetActiveTabLayerIndex (int nIndex) if (nIndex>=0 && nIndexGetPageCount()) { // Tell the draw view and the tab control of the new active layer. - mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId ((sal_uInt16)nIndex))); - pBar->SetCurPageId (pBar->GetPageId ((sal_uInt16)nIndex)); + mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId (static_cast(nIndex)))); + pBar->SetCurPageId (pBar->GetPageId (static_cast(nIndex))); rtl::Reference pUnoDrawView(new SdUnoDrawView ( *this, *GetView())); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 2abf0aae8aa3..1e18528eadda 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -269,8 +269,8 @@ void DrawViewShell::GetMarginProperties( SfxItemSet &rSet ) { // const SvxLRSpaceItem aTmpPageLRSpace ( rDesc.GetMaster().GetLRSpace() ); const SvxLongLRSpaceItem aLongLR( - (long)pPage->GetLeftBorder(), - (long)pPage->GetRightBorder(), + static_cast(pPage->GetLeftBorder()), + static_cast(pPage->GetRightBorder()), SID_ATTR_PAGE_LRSPACE ); rSet.Put( aLongLR ); } @@ -280,8 +280,8 @@ void DrawViewShell::GetMarginProperties( SfxItemSet &rSet ) { // const SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() ); SvxLongULSpaceItem aLongUL( - (long)pPage->GetUpperBorder(), - (long)pPage->GetLowerBorder(), + static_cast(pPage->GetUpperBorder()), + static_cast(pPage->GetLowerBorder()), SID_ATTR_PAGE_ULSPACE ); rSet.Put( aLongUL ); } diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 3d0bf89a5888..7904c458bf8f 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -79,8 +79,8 @@ void DrawViewShell::ScannerEvent() if( ( ( aBmpSize.Height() > aPageSize.Height() ) || ( aBmpSize.Width() > aPageSize.Width() ) ) && aBmpSize.Height() && aPageSize.Height() ) { - double fGrfWH = (double) aBmpSize.Width() / aBmpSize.Height(); - double fWinWH = (double) aPageSize.Width() / aPageSize.Height(); + double fGrfWH = static_cast(aBmpSize.Width()) / aBmpSize.Height(); + double fWinWH = static_cast(aPageSize.Width()) / aPageSize.Height(); if( fGrfWH < fWinWH ) { diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index c3a55f55f031..2d21a572880a 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -104,21 +104,21 @@ void DrawViewShell::ExecGallery(SfxRequest const & rReq) if ( ( ( aSize.Height() > aPageSize.Height() ) || ( aSize.Width() > aPageSize.Width() ) ) && aSize.Height() && aPageSize.Height() ) { - float fGrfWH = (float)aSize.Width() / - (float)aSize.Height(); - float fWinWH = (float)aPageSize.Width() / - (float)aPageSize.Height(); + float fGrfWH = static_cast(aSize.Width()) / + static_cast(aSize.Height()); + float fWinWH = static_cast(aPageSize.Width()) / + static_cast(aPageSize.Height()); // constrain size to page size if necessary if ((fGrfWH != 0.F) && (fGrfWH < fWinWH)) { - aSize.Width() = (long)(aPageSize.Height() * fGrfWH); + aSize.Width() = static_cast(aPageSize.Height() * fGrfWH); aSize.Height()= aPageSize.Height(); } else { aSize.Width() = aPageSize.Width(); - aSize.Height()= (long)(aPageSize.Width() / fGrfWH); + aSize.Height()= static_cast(aPageSize.Width() / fGrfWH); } } @@ -242,7 +242,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) if (pArgs->Count () == 1) { const SfxUInt32Item* pLineStyle = rReq.GetArg(ID_VAL_STYLE); - if (CHECK_RANGE ((sal_Int32)drawing::LineStyle_NONE, (sal_Int32)pLineStyle->GetValue(), (sal_Int32)drawing::LineStyle_DASH)) + if (CHECK_RANGE ((sal_Int32)drawing::LineStyle_NONE, static_cast(pLineStyle->GetValue()), (sal_Int32)drawing::LineStyle_DASH)) { pAttr->ClearItem (XATTR_LINESTYLE); XLineStyleItem aStyleItem((drawing::LineStyle) pLineStyle->GetValue()); @@ -288,9 +288,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) pAttr->ClearItem (XATTR_FILLCOLOR); pAttr->ClearItem (XATTR_FILLSTYLE); - XFillColorItem aColorItem(-1, Color ((sal_uInt8) pRed->GetValue (), - (sal_uInt8) pGreen->GetValue (), - (sal_uInt8) pBlue->GetValue ())); + XFillColorItem aColorItem(-1, Color (static_cast(pRed->GetValue ()), + static_cast(pGreen->GetValue ()), + static_cast(pBlue->GetValue ()))); aColorItem.SetWhich(XATTR_FILLCOLOR); pAttr->Put(aColorItem); rBindings.Invalidate (SID_ATTR_FILL_COLOR); @@ -313,9 +313,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pBlue = rReq.GetArg(ID_VAL_BLUE); pAttr->ClearItem (XATTR_LINECOLOR); - XLineColorItem aColorItem(-1, Color((sal_uInt8) pRed->GetValue(), - (sal_uInt8) pGreen->GetValue(), - (sal_uInt8) pBlue->GetValue())); + XLineColorItem aColorItem(-1, Color(static_cast(pRed->GetValue()), + static_cast(pGreen->GetValue()), + static_cast(pBlue->GetValue()))); aColorItem.SetWhich(XATTR_LINECOLOR); pAttr->Put(aColorItem); rBindings.Invalidate (SID_ATTR_LINE_COLOR); @@ -338,9 +338,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) XGradientListRef pGradientList = GetDoc()->GetGradientList (); long nCounts = pGradientList->Count (); - Color aColor ((sal_uInt8) pRed->GetValue (), - (sal_uInt8) pGreen->GetValue (), - (sal_uInt8) pBlue->GetValue ()); + Color aColor (static_cast(pRed->GetValue ()), + static_cast(pGreen->GetValue ()), + static_cast(pBlue->GetValue ())); long i; pAttr->ClearItem (XATTR_FILLGRADIENT); @@ -409,9 +409,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) XHatchListRef pHatchList = GetDoc()->GetHatchList (); long nCounts = pHatchList->Count (); - Color aColor ((sal_uInt8) pRed->GetValue (), - (sal_uInt8) pGreen->GetValue (), - (sal_uInt8) pBlue->GetValue ()); + Color aColor (static_cast(pRed->GetValue ()), + static_cast(pGreen->GetValue ()), + static_cast(pBlue->GetValue ())); long i; pAttr->ClearItem (XATTR_FILLHATCH); @@ -475,10 +475,10 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pDashLen = rReq.GetArg(ID_VAL_DASHLEN); const SfxUInt32Item* pDistance = rReq.GetArg(ID_VAL_DISTANCE); - if (CHECK_RANGE ((sal_Int32)css::drawing::DashStyle_RECT, (sal_Int32)pStyle->GetValue(), (sal_Int32)css::drawing::DashStyle_ROUNDRELATIVE)) + if (CHECK_RANGE ((sal_Int32)css::drawing::DashStyle_RECT, static_cast(pStyle->GetValue()), (sal_Int32)css::drawing::DashStyle_ROUNDRELATIVE)) { - XDash aNewDash ((css::drawing::DashStyle) pStyle->GetValue (), (short) pDots->GetValue (), pDotLen->GetValue (), - (short) pDashes->GetValue (), pDashLen->GetValue (), pDistance->GetValue ()); + XDash aNewDash ((css::drawing::DashStyle) pStyle->GetValue (), static_cast(pDots->GetValue ()), pDotLen->GetValue (), + static_cast(pDashes->GetValue ()), pDashLen->GetValue (), pDistance->GetValue ()); pAttr->ClearItem (XATTR_LINEDASH); pAttr->ClearItem (XATTR_LINESTYLE); @@ -530,13 +530,13 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pStart = rReq.GetArg(ID_VAL_STARTINTENS); const SfxUInt32Item* pEnd = rReq.GetArg(ID_VAL_ENDINTENS); - if (CHECK_RANGE ((sal_Int32)css::awt::GradientStyle_LINEAR, (sal_Int32)pStyle->GetValue(), (sal_Int32)css::awt::GradientStyle_RECT) && - CHECK_RANGE (0, (sal_Int32)pAngle->GetValue (), 360) && - CHECK_RANGE (0, (sal_Int32)pBorder->GetValue (), 100) && - CHECK_RANGE (0, (sal_Int32)pCenterX->GetValue (), 100) && - CHECK_RANGE (0, (sal_Int32)pCenterY->GetValue (), 100) && - CHECK_RANGE (0, (sal_Int32)pStart->GetValue (), 100) && - CHECK_RANGE (0, (sal_Int32)pEnd->GetValue (), 100)) + if (CHECK_RANGE ((sal_Int32)css::awt::GradientStyle_LINEAR, static_cast(pStyle->GetValue()), (sal_Int32)css::awt::GradientStyle_RECT) && + CHECK_RANGE (0, static_cast(pAngle->GetValue ()), 360) && + CHECK_RANGE (0, static_cast(pBorder->GetValue ()), 100) && + CHECK_RANGE (0, static_cast(pCenterX->GetValue ()), 100) && + CHECK_RANGE (0, static_cast(pCenterY->GetValue ()), 100) && + CHECK_RANGE (0, static_cast(pStart->GetValue ()), 100) && + CHECK_RANGE (0, static_cast(pEnd->GetValue ()), 100)) { pAttr->ClearItem (XATTR_FILLGRADIENT); pAttr->ClearItem (XATTR_FILLSTYLE); @@ -555,11 +555,11 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) aGradient.SetGradientStyle ((css::awt::GradientStyle) pStyle->GetValue ()); aGradient.SetAngle (pAngle->GetValue () * 10); - aGradient.SetBorder ((short) pBorder->GetValue ()); - aGradient.SetXOffset ((short) pCenterX->GetValue ()); - aGradient.SetYOffset ((short) pCenterY->GetValue ()); - aGradient.SetStartIntens ((short) pStart->GetValue ()); - aGradient.SetEndIntens ((short) pEnd->GetValue ()); + aGradient.SetBorder (static_cast(pBorder->GetValue ())); + aGradient.SetXOffset (static_cast(pCenterX->GetValue ())); + aGradient.SetYOffset (static_cast(pCenterY->GetValue ())); + aGradient.SetStartIntens (static_cast(pStart->GetValue ())); + aGradient.SetEndIntens (static_cast(pEnd->GetValue ())); XFillStyleItem aStyleItem(drawing::FillStyle_GRADIENT); aStyleItem.SetWhich(XATTR_FILLSTYLE); @@ -575,9 +575,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) { Color aBlack (0, 0, 0); XGradient aGradient (aBlack, aBlack, (css::awt::GradientStyle) pStyle->GetValue (), - pAngle->GetValue () * 10, (short) pCenterX->GetValue (), - (short) pCenterY->GetValue (), (short) pBorder->GetValue (), - (short) pStart->GetValue (), (short) pEnd->GetValue ()); + pAngle->GetValue () * 10, static_cast(pCenterX->GetValue ()), + static_cast(pCenterY->GetValue ()), static_cast(pBorder->GetValue ()), + static_cast(pStart->GetValue ()), static_cast(pEnd->GetValue ())); pGradientList->Insert(o3tl::make_unique(aGradient, pName->GetValue())); XFillStyleItem aStyleItem(drawing::FillStyle_GRADIENT); @@ -613,8 +613,8 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pDistance = rReq.GetArg(ID_VAL_DISTANCE); const SfxUInt32Item* pAngle = rReq.GetArg(ID_VAL_ANGLE); - if (CHECK_RANGE ((sal_Int32)css::drawing::HatchStyle_SINGLE, (sal_Int32)pStyle->GetValue(), (sal_Int32)css::drawing::HatchStyle_TRIPLE) && - CHECK_RANGE (0, (sal_Int32)pAngle->GetValue (), 360)) + if (CHECK_RANGE ((sal_Int32)css::drawing::HatchStyle_SINGLE, static_cast(pStyle->GetValue()), (sal_Int32)css::drawing::HatchStyle_TRIPLE) && + CHECK_RANGE (0, static_cast(pAngle->GetValue ()), 360)) { pAttr->ClearItem (XATTR_FILLHATCH); pAttr->ClearItem (XATTR_FILLSTYLE); @@ -830,7 +830,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { const XLineWidthItem &rLineWidthItem = aAttr.Get (XATTR_LINEWIDTH); - rSet.Put (SfxUInt32Item (nWhich, (long) rLineWidthItem.GetValue ())); + rSet.Put (SfxUInt32Item (nWhich, static_cast(rLineWidthItem.GetValue ()))); break; } @@ -884,7 +884,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) ; } - rSet.Put (SfxUInt32Item (nWhich, (long) ((nWhich == SID_GETRED) + rSet.Put (SfxUInt32Item (nWhich, static_cast((nWhich == SID_GETRED) ? aColor.GetRed () : (nWhich == SID_GETGREEN) ? aColor.GetGreen () diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 83fb4e824975..4a1cd9c0b38e 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -536,7 +536,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) else { std::unique_ptr pZoomItem; - sal_uInt16 nZoom = (sal_uInt16) GetActiveWindow()->GetZoom(); + sal_uInt16 nZoom = static_cast(GetActiveWindow()->GetZoom()); if( mbZoomOnPage ) pZoomItem.reset(new SvxZoomItem( SvxZoomType::WHOLEPAGE, nZoom )); @@ -566,7 +566,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) else { sd::Window * pActiveWindow = GetActiveWindow(); - SvxZoomSliderItem aZoomItem( (sal_uInt16) pActiveWindow->GetZoom(), (sal_uInt16)pActiveWindow->GetMinZoom(), (sal_uInt16)pActiveWindow->GetMaxZoom() ) ; + SvxZoomSliderItem aZoomItem( static_cast(pActiveWindow->GetZoom()), static_cast(pActiveWindow->GetMinZoom()), static_cast(pActiveWindow->GetMaxZoom()) ) ; SdrPageView* pPageView = mpDrawView->GetSdrPageView(); if( pPageView ) @@ -575,10 +575,10 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) Size aPageSize = pPageView->GetPage()->GetSize(); aPagePos.X() += aPageSize.Width() / 2; - aPageSize.Width() = (long) (aPageSize.Width() * 1.03); + aPageSize.Width() = static_cast(aPageSize.Width() * 1.03); aPagePos.Y() += aPageSize.Height() / 2; - aPageSize.Height() = (long) (aPageSize.Height() * 1.03); + aPageSize.Height() = static_cast(aPageSize.Height() * 1.03); aPagePos.Y() -= aPageSize.Height() / 2; aPagePos.X() -= aPageSize.Width() / 2; diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 517417adda4c..daf0d5177c05 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -127,7 +127,7 @@ void ImpAddPrintableCharactersToTextEdit(SfxRequest const & rReq, ::sd::View* pV { for(sal_Int32 a(0); a < aInputString.getLength(); a++) { - sal_Char aChar = (sal_Char)aInputString[a]; + sal_Char aChar = static_cast(aInputString[a]); vcl::KeyCode aKeyCode; KeyEvent aKeyEvent(aChar, aKeyCode); @@ -1090,12 +1090,12 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) Size aPageSize = pPageView->GetPage()->GetSize(); aPagePos.X() += aPageSize.Width() / 2; - aPageSize.Width() = (long) (aPageSize.Width() * 1.03); + aPageSize.Width() = static_cast(aPageSize.Width() * 1.03); if( rReq.GetSlot() == SID_SIZE_PAGE ) { aPagePos.Y() += aPageSize.Height() / 2; - aPageSize.Height() = (long) (aPageSize.Height() * 1.03); + aPageSize.Height() = static_cast(aPageSize.Height() * 1.03); aPagePos.Y() -= aPageSize.Height() / 2; } else @@ -1186,8 +1186,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) if ( mpDrawView->AreObjectsMarked() ) { maMarkRect = mpDrawView->GetAllMarkedRect(); - long nW = (long) (maMarkRect.GetWidth() * 1.03); - long nH = (long) (maMarkRect.GetHeight() * 1.03); + long nW = static_cast(maMarkRect.GetWidth() * 1.03); + long nH = static_cast(maMarkRect.GetHeight() * 1.03); Point aPos = maMarkRect.Center(); aPos.X() -= nW / 2; aPos.Y() -= nH / 2; @@ -1218,8 +1218,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) { ::tools::Rectangle aBoundRect( pPageView->GetObjList()->GetAllObjBoundRect() ); - long nW = (long) (aBoundRect.GetWidth() * 1.03); - long nH = (long) (aBoundRect.GetHeight() * 1.03); + long nW = static_cast(aBoundRect.GetWidth() * 1.03); + long nH = static_cast(aBoundRect.GetHeight() * 1.03); Point aPos = aBoundRect.Center(); aPos.X() -= nW / 2; aPos.Y() -= nH / 2; diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index dc13ed8cbca8..4819c227e844 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -582,7 +582,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) { sal_uInt16 nMask = 1; sal_uInt16 nCount = 0; - sal_uInt16 nCurLevel = (sal_uInt16)0xFFFF; + sal_uInt16 nCurLevel = sal_uInt16(0xFFFF); for(sal_uInt16 i = 0; i < pNumRule->GetLevelCount(); i++) { if(nActNumLvl & nMask) @@ -609,8 +609,8 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) bBullets = false; } - rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,(sal_uInt16)0xFFFF)); - rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF)); + rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,sal_uInt16(0xFFFF))); + rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,sal_uInt16(0xFFFF))); if ( bBullets ) { NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(NBOType::Bullets); diff --git a/sd/source/ui/view/drviewsh.cxx b/sd/source/ui/view/drviewsh.cxx index 3b8e6c5bf5ce..af1f146685f2 100644 --- a/sd/source/ui/view/drviewsh.cxx +++ b/sd/source/ui/view/drviewsh.cxx @@ -63,8 +63,8 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW // tdf#98646 check if Rectangle which contains the bounds of the region to // be shown eventually contains values that cause overflows when processing // e.g. when calling GetWidth() - const bool bOverflowInX(!rtl::math::approxEqual((double)rRect.getWidth(), (double)rRect.Right() - (double)rRect.Left())); - const bool bOverflowInY(!rtl::math::approxEqual((double)rRect.getHeight(), (double)rRect.Bottom() - (double)rRect.Top())); + const bool bOverflowInX(!rtl::math::approxEqual(static_cast(rRect.getWidth()), static_cast(rRect.Right()) - static_cast(rRect.Left()))); + const bool bOverflowInY(!rtl::math::approxEqual(static_cast(rRect.getHeight()), static_cast(rRect.Bottom()) - static_cast(rRect.Top()))); if(bOverflowInX || bOverflowInY) { diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index f22643275668..4509fe94bc32 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -349,17 +349,17 @@ static OUString createHelpLinesString( const SdrHelpLineList& rHelpLines ) { case SdrHelpLineKind::Point: aLines.append( 'P' ); - aLines.append( (sal_Int32)rPos.X() ); + aLines.append( static_cast(rPos.X()) ); aLines.append( ',' ); - aLines.append( (sal_Int32)rPos.Y() ); + aLines.append( static_cast(rPos.Y()) ); break; case SdrHelpLineKind::Vertical: aLines.append( 'V' ); - aLines.append( (sal_Int32)rPos.X() ); + aLines.append( static_cast(rPos.X()) ); break; case SdrHelpLineKind::Horizontal: aLines.append( 'H' ); - aLines.append( (sal_Int32)rPos.Y() ); + aLines.append( static_cast(rPos.Y()) ); break; default: OSL_FAIL( "Unsupported helpline Kind!" ); @@ -385,7 +385,7 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert aUserData.addValue( sUNO_View_IsPlusHandlesAlwaysVisible, makeAny( IsPlusHandlesAlwaysVisible() ) ); aUserData.addValue( sUNO_View_IsFrameDragSingles, makeAny( IsFrameDragSingles() ) ); - aUserData.addValue( sUNO_View_EliminatePolyPointLimitAngle, makeAny( (sal_Int32)GetEliminatePolyPointLimitAngle() ) ); + aUserData.addValue( sUNO_View_EliminatePolyPointLimitAngle, makeAny( static_cast(GetEliminatePolyPointLimitAngle()) ) ); aUserData.addValue( sUNO_View_IsEliminatePolyPoints, makeAny( IsEliminatePolyPoints() ) ); Any aAny; @@ -412,13 +412,13 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert aUserData.addValue( sUNO_View_RulerIsVisible, makeAny( HasRuler() ) ); aUserData.addValue( sUNO_View_PageKind, makeAny( (sal_Int16)GetPageKind() ) ); - aUserData.addValue( sUNO_View_SelectedPage, makeAny( (sal_Int16)GetSelectedPage() ) ); + aUserData.addValue( sUNO_View_SelectedPage, makeAny( static_cast(GetSelectedPage()) ) ); aUserData.addValue( sUNO_View_IsLayerMode, makeAny( IsLayerMode() ) ); aUserData.addValue( sUNO_View_IsDoubleClickTextEdit, makeAny( IsDoubleClickTextEdit() ) ); aUserData.addValue( sUNO_View_IsClickChangeRotation, makeAny( IsClickChangeRotation() ) ); - aUserData.addValue( sUNO_View_SlidesPerRow, makeAny( (sal_Int16)GetSlidesPerRow() ) ); + aUserData.addValue( sUNO_View_SlidesPerRow, makeAny( static_cast(GetSlidesPerRow()) ) ); aUserData.addValue( sUNO_View_EditMode, makeAny( (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 ) ) ); @@ -427,22 +427,22 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert { const ::tools::Rectangle aVisArea = GetVisArea(); - aUserData.addValue( sUNO_View_VisibleAreaTop, makeAny( (sal_Int32)aVisArea.Top() ) ); - aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( (sal_Int32)aVisArea.Left() ) ); - aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( (sal_Int32)aVisArea.GetWidth() ) ); - aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( (sal_Int32)aVisArea.GetHeight() ) ); + aUserData.addValue( sUNO_View_VisibleAreaTop, makeAny( static_cast(aVisArea.Top()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( static_cast(aVisArea.Left()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( static_cast(aVisArea.GetWidth()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( static_cast(aVisArea.GetHeight()) ) ); } - aUserData.addValue( sUNO_View_GridCoarseWidth, makeAny( (sal_Int32)GetGridCoarse().Width() ) ); - aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( (sal_Int32)GetGridCoarse().Height() ) ); - aUserData.addValue( sUNO_View_GridFineWidth, makeAny( (sal_Int32)GetGridFine().Width() ) ); - aUserData.addValue( sUNO_View_GridFineHeight, makeAny( (sal_Int32)GetGridFine().Height() ) ); + aUserData.addValue( sUNO_View_GridCoarseWidth, makeAny( static_cast(GetGridCoarse().Width()) ) ); + aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( static_cast(GetGridCoarse().Height()) ) ); + aUserData.addValue( sUNO_View_GridFineWidth, makeAny( static_cast(GetGridFine().Width()) ) ); + aUserData.addValue( sUNO_View_GridFineHeight, makeAny( static_cast(GetGridFine().Height()) ) ); aUserData.addValue( sUNO_View_GridSnapWidthXNumerator, makeAny( GetSnapGridWidthX().GetNumerator() ) ); aUserData.addValue( sUNO_View_GridSnapWidthXDenominator, makeAny( GetSnapGridWidthX().GetDenominator() ) ); aUserData.addValue( sUNO_View_GridSnapWidthYNumerator, makeAny( GetSnapGridWidthY().GetNumerator() ) ); aUserData.addValue( sUNO_View_GridSnapWidthYDenominator, makeAny( GetSnapGridWidthY().GetDenominator() ) ); aUserData.addValue( sUNO_View_IsAngleSnapEnabled, makeAny( IsAngleSnapEnabled() ) ); - aUserData.addValue( sUNO_View_SnapAngle, makeAny( (sal_Int32)GetSnapAngle() ) ); + aUserData.addValue( sUNO_View_SnapAngle, makeAny( static_cast(GetSnapAngle()) ) ); const sal_Int32 nOldLength = rValues.getLength(); rValues.realloc( nOldLength + aUserData.size() ); @@ -597,9 +597,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() ) ) - SetSelectedPage( (sal_uInt16)nInt16 ); + SetSelectedPage( static_cast(nInt16) ); - SetSelectedPageOnLoad( (sal_uInt16)nInt16 ); + SetSelectedPageOnLoad( static_cast(nInt16) ); } } else if ( pValue->Name == sUNO_View_IsLayerMode ) @@ -627,7 +627,7 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr { if( pValue->Value >>= nInt16 ) { - SetSlidesPerRow( (sal_uInt16)nInt16 ); + SetSlidesPerRow( static_cast(nInt16) ); } } else if ( pValue->Name == sUNO_View_EditMode ) diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index c48121a62496..ff5c9767d478 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -94,8 +94,8 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) switch( eZT ) { case SvxZoomType::PERCENT: - SetZoom( (long) static_cast( pArgs-> - Get( SID_ATTR_ZOOM ) ).GetValue() ); + SetZoom( static_cast(static_cast( pArgs-> + Get( SID_ATTR_ZOOM ) ).GetValue()) ); Invalidate( SID_ATTR_ZOOM ); Invalidate( SID_ATTR_ZOOMSLIDER ); break; diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 76625cb36544..efccc9dce51e 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1067,7 +1067,7 @@ void OutlineViewShell::VirtHScrollHdl(ScrollBar* pHScroll) { long nThumb = pHScroll->GetThumbPos(); long nRange = pHScroll->GetRange().Len(); - double fX = (double) nThumb / nRange; + double fX = static_cast(nThumb) / nRange; Window* pWin = mpContentWindow.get(); OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWin); @@ -1076,7 +1076,7 @@ void OutlineViewShell::VirtHScrollHdl(ScrollBar* pHScroll) long nTextWidth = pOlView->GetPaperWidth(); nViewWidth = std::max(nViewWidth, nTextWidth); long nCurrentPos = pOutlinerView->GetVisArea().Left(); - long nTargetPos = (long)(fX * nViewWidth); + long nTargetPos = static_cast(fX * nViewWidth); long nDelta = nTargetPos - nCurrentPos; pOutlinerView->HideCursor(); @@ -1088,7 +1088,7 @@ void OutlineViewShell::VirtVScrollHdl(ScrollBar* pVScroll) { long nThumb = pVScroll->GetThumbPos(); long nRange = pVScroll->GetRange().Len(); - double fY = (double) nThumb / nRange; + double fY = static_cast(nThumb) / nRange; Window* pWin = mpContentWindow.get(); OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWin); @@ -1097,7 +1097,7 @@ void OutlineViewShell::VirtVScrollHdl(ScrollBar* pVScroll) long nTextHeight = pOlView->GetOutliner().GetTextHeight(); nViewHeight += nTextHeight; long nCurrentPos = pOutlinerView->GetVisArea().Top(); - long nTargetPos = (long)(fY * nViewHeight); + long nTargetPos = static_cast(fY * nViewHeight); long nDelta = nTargetPos - nCurrentPos; pOutlinerView->HideCursor(); @@ -1260,7 +1260,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) // Zoom-Item if( SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_ZOOM ) ) { - sal_uInt16 nZoom = (sal_uInt16) GetActiveWindow()->GetZoom(); + sal_uInt16 nZoom = static_cast(GetActiveWindow()->GetZoom()); std::unique_ptr pZoomItem(new SvxZoomItem( SvxZoomType::PERCENT, nZoom )); @@ -1283,7 +1283,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) else { sd::Window * pActiveWindow = GetActiveWindow(); - SvxZoomSliderItem aZoomItem( (sal_uInt16) pActiveWindow->GetZoom(), (sal_uInt16)pActiveWindow->GetMinZoom(), (sal_uInt16)pActiveWindow->GetMaxZoom() ) ; + SvxZoomSliderItem aZoomItem( static_cast(pActiveWindow->GetZoom()), static_cast(pActiveWindow->GetMinZoom()), static_cast(pActiveWindow->GetMaxZoom()) ) ; aZoomItem.AddSnappingPoint(100); rSet.Put( aZoomItem ); } @@ -1330,11 +1330,11 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) if( nPos >= GetDoc()->GetSdPageCount( PageKind::Standard ) ) nPos = 0; - SdrPage* pPage = GetDoc()->GetSdPage( (sal_uInt16) nPos, PageKind::Standard ); + SdrPage* pPage = GetDoc()->GetSdPage( static_cast(nPos), PageKind::Standard ); aPageStr = SdResId(STR_SD_PAGE_COUNT); - aPageStr = aPageStr.replaceFirst("%1", OUString::number((sal_Int32)(nPos + 1))); + aPageStr = aPageStr.replaceFirst("%1", OUString::number(static_cast(nPos + 1))); aPageStr = aPageStr.replaceFirst("%2", OUString::number(nPageCount)); aLayoutStr = pPage->GetLayoutName(); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 67d509d913c7..94741524df75 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -421,13 +421,13 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) **********************************************************************/ // this page is exemplary - SdPage* pExample = mrDoc.GetSdPage((sal_uInt16)nExample, PageKind::Standard); + SdPage* pExample = mrDoc.GetSdPage(static_cast(nExample), PageKind::Standard); SdPage* pPage = mrDoc.AllocSdPage(false); pPage->SetLayoutName(pExample->GetLayoutName()); // insert (page) - mrDoc.InsertPage(pPage, (sal_uInt16)nTarget * 2 + 1); + mrDoc.InsertPage(pPage, static_cast(nTarget) * 2 + 1); if( isRecordingUndo() ) AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoNewPage(*pPage)); @@ -458,7 +458,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) /********************************************************************** |* now the notes page \*********************************************************************/ - pExample = mrDoc.GetSdPage((sal_uInt16)nExample, PageKind::Notes); + pExample = mrDoc.GetSdPage(static_cast(nExample), PageKind::Notes); SdPage* pNotesPage = mrDoc.AllocSdPage(false); pNotesPage->SetLayoutName(pExample->GetLayoutName()); @@ -466,7 +466,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) pNotesPage->SetPageKind(PageKind::Notes); // insert (notes page) - mrDoc.InsertPage(pNotesPage, (sal_uInt16)nTarget * 2 + 2); + mrDoc.InsertPage(pNotesPage, static_cast(nTarget) * 2 + 2); if( isRecordingUndo() ) AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoNewPage(*pNotesPage)); @@ -509,13 +509,13 @@ IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner::ParagraphHdlParam, aPa } // delete page and notes page - sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1; + sal_uInt16 nAbsPos = static_cast(nPos) * 2 + 1; SdrPage* pPage = mrDoc.GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); mrDoc.RemovePage(nAbsPos); - nAbsPos = (sal_uInt16)nPos * 2 + 1; + nAbsPos = static_cast(nPos) * 2 + 1; pPage = mrDoc.GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); @@ -639,13 +639,13 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner::DepthChangeHdlParam, aParam } // delete page and notes page - sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1; + sal_uInt16 nAbsPos = static_cast(nPos) * 2 + 1; SdrPage* pPage = mrDoc.GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); mrDoc.RemovePage(nAbsPos); - nAbsPos = (sal_uInt16)nPos * 2 + 1; + nAbsPos = static_cast(nPos) * 2 + 1; pPage = mrDoc.GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); @@ -690,7 +690,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner::DepthChangeHdlParam, aParam if(nPos >= 0) { - SdPage*pPage = mrDoc.GetSdPage( (sal_uInt16) nPos, PageKind::Standard); + SdPage*pPage = mrDoc.GetSdPage( static_cast(nPos), PageKind::Standard); if(pPage && pPage->GetPresObj(PRESOBJ_TEXT)) pOutliner->SetDepth( pPara, 0 ); @@ -710,7 +710,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner::DepthChangeHdlParam, aParam if( nPos >= 0 ) { - SdPage* pPage = mrDoc.GetSdPage( (sal_uInt16) nPos, PageKind::Standard ); + SdPage* pPage = mrDoc.GetSdPage( static_cast(nPos), PageKind::Standard ); if( pPage ) { @@ -867,7 +867,7 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner, void ) sal_uInt16 nPos = nPosNewOrder; // don't change nPosNewOrder if (nPos == 0) { - nPos = (sal_uInt16)-1; // insert before the first page + nPos = sal_uInt16(-1); // insert before the first page } else { @@ -887,7 +887,7 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner, void ) mrDoc.MovePages(nPos); // deselect the pages again - sal_uInt16 nPageCount = (sal_uInt16)maSelectedParas.size(); + sal_uInt16 nPageCount = static_cast(maSelectedParas.size()); while (nPageCount) { SdPage* pPage = mrDoc.GetSdPage(nPosNewOrder, PageKind::Standard); @@ -1219,8 +1219,8 @@ SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara ) nPageToSelect++; } - if( nPageToSelect < (sal_uInt32)mrDoc.GetSdPageCount( PageKind::Standard ) ) - return mrDoc.GetSdPage( (sal_uInt16)nPageToSelect, PageKind::Standard ); + if( nPageToSelect < static_cast(mrDoc.GetSdPageCount( PageKind::Standard )) ) + return mrDoc.GetSdPage( static_cast(nPageToSelect), PageKind::Standard ); return nullptr; } @@ -1491,7 +1491,7 @@ void OutlineView::UpdateDocument() sal_uInt32 nPage; for (nPage = 0; nPage < nPageCount; nPage++) { - SdPage* pPage = mrDoc.GetSdPage( (sal_uInt16)nPage, PageKind::Standard); + SdPage* pPage = mrDoc.GetSdPage( static_cast(nPage), PageKind::Standard); mrDoc.SetSelected(pPage, false); mrOutlineViewShell.UpdateTitleObject( pPage, pPara ); @@ -1609,7 +1609,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) nPage++; } - long nBulletHeight = (long)mrOutliner.GetLineHeight( pInfo->mnPara ); + long nBulletHeight = static_cast(mrOutliner.GetLineHeight( pInfo->mnPara )); long nFontHeight = 0; if ( !rEditEngine.IsFlatMode() ) { @@ -1624,13 +1624,13 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) Size aOutSize( 2000, nBulletHeight ); - const float fImageHeight = ((float)aOutSize.Height() * (float)4) / (float)7; + const float fImageHeight = (static_cast(aOutSize.Height()) * float(4)) / float(7); if (aImageSize.Width() != 0) { - const float fImageRatio = (float)aImageSize.Height() / (float)aImageSize.Width(); - aImageSize.Width() = (long)( fImageRatio * fImageHeight ); + const float fImageRatio = static_cast(aImageSize.Height()) / static_cast(aImageSize.Width()); + aImageSize.Width() = static_cast( fImageRatio * fImageHeight ); } - aImageSize.Height() = (long)fImageHeight; + aImageSize.Height() = static_cast(fImageHeight); Point aImagePos( pInfo->mrStartPos ); aImagePos.X() += aOutSize.Width() - aImageSize.Width() - aOffset.Width() ; diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 28c80e6204b0..f8412e84496b 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1348,7 +1348,7 @@ void View::ChangeMarkedObjectsBulletsNumbering( pOutlinerView->ApplyBulletsNumbering( bHandleBullets, pNumRule, bToggle ); } sal_uInt32 nParaCount = pOutliner->GetParagraphCount(); - pText->SetOutlinerParaObject(pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount)); + pText->SetOutlinerParaObject(pOutliner->CreateParaObject(0, static_cast(nParaCount))); pOutliner->Clear(); } } @@ -1379,7 +1379,7 @@ void View::ChangeMarkedObjectsBulletsNumbering( pOutlinerView->ApplyBulletsNumbering( bHandleBullets, pNumRule, bToggle ); } sal_uInt32 nParaCount = pOutliner->GetParagraphCount(); - pTextObj->SetOutlinerParaObject(pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount)); + pTextObj->SetOutlinerParaObject(pOutliner->CreateParaObject(0, static_cast(nParaCount))); pOutliner->Clear(); } } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index dd41e3a505f4..fdc7237974be 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -657,10 +657,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // delete pages, that are not of any interest for us for( long i = ( pWorkModel->GetPageCount() - 1 ); i >= 0; i-- ) { - SdPage* pP = static_cast< SdPage* >( pWorkModel->GetPage( (sal_uInt16) i ) ); + SdPage* pP = static_cast< SdPage* >( pWorkModel->GetPage( static_cast(i) ) ); if( pP->GetPageKind() != PageKind::Standard ) - pWorkModel->DeletePage( (sal_uInt16) i ); + pWorkModel->DeletePage( static_cast(i) ); } bReturn = Paste(*pWorkModel, maDropPos, pPage, nPasteOptions); @@ -900,10 +900,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // delete pages, that are not of any interest for us for( long i = ( pModel->GetPageCount() - 1 ); i >= 0; i-- ) { - SdPage* pP = static_cast< SdPage* >( pModel->GetPage( (sal_uInt16) i ) ); + SdPage* pP = static_cast< SdPage* >( pModel->GetPage( static_cast(i) ) ); if( pP->GetPageKind() != PageKind::Standard ) - pModel->DeletePage( (sal_uInt16) i ); + pModel->DeletePage( static_cast(i) ); } bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions); @@ -1344,8 +1344,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, SfxItemSet aSet( mrDoc.GetPool() ); bool bClosed = pPickObj->IsClosedObj(); ::sd::Window* pWin = mpViewSh->GetActiveWindow(); - sal_uInt16 nHitLog = (sal_uInt16) pWin->PixelToLogic( - Size(FuPoor::HITPIX, 0 ) ).Width(); + sal_uInt16 nHitLog = static_cast(pWin->PixelToLogic( + Size(FuPoor::HITPIX, 0 ) ).Width()); const long n2HitLog = nHitLog << 1; Point aHitPosR( rPos ); Point aHitPosL( rPos ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index c46be7b78302..f916769b4f9c 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -156,34 +156,34 @@ void Window::CalcMinZoom() // area (also called application area) to completely fill the // window. Size aWinSize = PixelToLogic(GetOutputSizePixel()); - sal_uLong nX = (sal_uLong) ((double) aWinSize.Width() - * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Width()); - sal_uLong nY = (sal_uLong) ((double) aWinSize.Height() - * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Height()); + sal_uLong nX = static_cast(static_cast(aWinSize.Width()) + * double(ZOOM_MULTIPLICATOR) / static_cast(maViewSize.Width())); + sal_uLong nY = static_cast(static_cast(aWinSize.Height()) + * double(ZOOM_MULTIPLICATOR) / static_cast(maViewSize.Height())); // Decide whether to take the larger or the smaller factor. sal_uLong nFact = std::min(nX, nY); // The factor is transformed according to the current zoom factor. nFact = nFact * nZoom / ZOOM_MULTIPLICATOR; - mnMinZoom = std::max((sal_uInt16) MIN_ZOOM, (sal_uInt16) nFact); + mnMinZoom = std::max(sal_uInt16(MIN_ZOOM), static_cast(nFact)); } // If the current zoom factor is smaller than the calculated minimal // zoom factor then set the new minimal factor as the current zoom // factor. - if ( nZoom < (long) mnMinZoom ) + if ( nZoom < static_cast(mnMinZoom) ) SetZoomFactor(mnMinZoom); } } void Window::SetMinZoom (long int nMin) { - mnMinZoom = (sal_uInt16) nMin; + mnMinZoom = static_cast(nMin); } void Window::SetMaxZoom (long int nMax) { - mnMaxZoom = (sal_uInt16) nMax; + mnMaxZoom = static_cast(nMax); } long Window::GetZoom() const @@ -333,7 +333,7 @@ long Window::SetZoomFactor(long nZoom) // calculated by CalcMinZoom() and the constant MAX_ZOOM. if ( nZoom > MAX_ZOOM ) nZoom = MAX_ZOOM; - if ( nZoom < (long) mnMinZoom ) + if ( nZoom < static_cast(mnMinZoom) ) nZoom = mnMinZoom; // Set the zoom factor at the window's map mode. @@ -368,7 +368,7 @@ void Window::SetZoomIntegral(long nZoom) // MAX_ZOOM constant. if ( nZoom > MAX_ZOOM ) nZoom = MAX_ZOOM; - if ( nZoom < (long) mnMinZoom ) + if ( nZoom < static_cast(mnMinZoom) ) nZoom = mnMinZoom; // Calculate the window's new origin. @@ -401,14 +401,14 @@ long Window::GetZoomForRect( const ::tools::Rectangle& rZoomRect ) const Size aWinSize( PixelToLogic(GetOutputSizePixel()) ); if(rZoomRect.GetHeight()) { - nX = (sal_uLong) ((double) aWinSize.Height() - * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetHeight()); + nX = static_cast(static_cast(aWinSize.Height()) + * double(ZOOM_MULTIPLICATOR) / static_cast(rZoomRect.GetHeight())); } if(rZoomRect.GetWidth()) { - nY = (sal_uLong) ((double) aWinSize.Width() - * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth()); + nY = static_cast(static_cast(aWinSize.Width()) + * double(ZOOM_MULTIPLICATOR) / static_cast(rZoomRect.GetWidth())); } // Use the smaller one of both so that the zoom rectangle will be @@ -432,7 +432,7 @@ long Window::GetZoomForRect( const ::tools::Rectangle& rZoomRect ) // MAX_ZOOM constant. if ( nRetZoom > MAX_ZOOM ) nRetZoom = MAX_ZOOM; - if ( nRetZoom < (long) mnMinZoom ) + if ( nRetZoom < static_cast(mnMinZoom) ) nRetZoom = mnMinZoom; } } @@ -474,14 +474,14 @@ long Window::SetZoomRect (const ::tools::Rectangle& rZoomRect) if(rZoomRect.GetHeight()) { - nX = (sal_uLong) ((double) aWinSize.Height() - * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetHeight()); + nX = static_cast(static_cast(aWinSize.Height()) + * double(ZOOM_MULTIPLICATOR) / static_cast(rZoomRect.GetHeight())); } if(rZoomRect.GetWidth()) { - nY = (sal_uLong) ((double) aWinSize.Width() - * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth()); + nY = static_cast(static_cast(aWinSize.Width()) + * double(ZOOM_MULTIPLICATOR) / static_cast(rZoomRect.GetWidth())); } // Use the smaller one of both so that the zoom rectangle will be @@ -507,9 +507,9 @@ long Window::SetZoomRect (const ::tools::Rectangle& rZoomRect) maWinPos = maViewOrigin + aPos; - aWinSize.Width() = (long) ((double) aWinSize.Width() * (double) ZOOM_MULTIPLICATOR / (double) nFact); + aWinSize.Width() = static_cast(static_cast(aWinSize.Width()) * double(ZOOM_MULTIPLICATOR) / static_cast(nFact)); maWinPos.X() += (rZoomRect.GetWidth() - aWinSize.Width()) / 2; - aWinSize.Height() = (long) ((double) aWinSize.Height() * (double) ZOOM_MULTIPLICATOR / (double) nFact); + aWinSize.Height() = static_cast(static_cast(aWinSize.Height()) * double(ZOOM_MULTIPLICATOR) / static_cast(nFact)); maWinPos.Y() += (rZoomRect.GetHeight() - aWinSize.Height()) / 2; if ( maWinPos.X() < 0 ) maWinPos.X() = 0; @@ -630,7 +630,7 @@ void Window::UpdateMapMode() */ double Window::GetVisibleX() { - return ((double) maWinPos.X() / maViewSize.Width()); + return (static_cast(maWinPos.X()) / maViewSize.Width()); } /** @@ -639,7 +639,7 @@ double Window::GetVisibleX() */ double Window::GetVisibleY() { - return ((double) maWinPos.Y() / maViewSize.Height()); + return (static_cast(maWinPos.Y()) / maViewSize.Height()); } /** @@ -652,9 +652,9 @@ void Window::SetVisibleXY(double fX, double fY) long nOldY = maWinPos.Y(); if ( fX >= 0 ) - maWinPos.X() = (long) (fX * maViewSize.Width()); + maWinPos.X() = static_cast(fX * maViewSize.Width()); if ( fY >= 0 ) - maWinPos.Y() = (long) (fY * maViewSize.Height()); + maWinPos.Y() = static_cast(fY * maViewSize.Height()); UpdateMapOrigin(false); Scroll(nOldX - maWinPos.X(), nOldY - maWinPos.Y(), ScrollFlags::Children); Update(); @@ -669,7 +669,7 @@ double Window::GetVisibleWidth() Size aWinSize = PixelToLogic(GetOutputSizePixel()); if ( aWinSize.Width() > maViewSize.Width() ) aWinSize.Width() = maViewSize.Width(); - return ((double) aWinSize.Width() / maViewSize.Width()); + return (static_cast(aWinSize.Width()) / maViewSize.Width()); } /** @@ -681,7 +681,7 @@ double Window::GetVisibleHeight() Size aWinSize = PixelToLogic(GetOutputSizePixel()); if ( aWinSize.Height() > maViewSize.Height() ) aWinSize.Height() = maViewSize.Height(); - return ((double) aWinSize.Height() / maViewSize.Height()); + return (static_cast(aWinSize.Height()) / maViewSize.Height()); } /** diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx index 390f30b0fd24..c1d9398d77a8 100644 --- a/sd/source/ui/view/tabcontr.cxx +++ b/sd/source/ui/view/tabcontr.cxx @@ -196,9 +196,9 @@ sal_Int8 TabControl::AcceptDrop( const AcceptDropEvent& rEvt ) sal_Int32 nPageId = GetPageId( aPos ) - 1; - if( ( nPageId >= 0 ) && pDoc->GetPage( (sal_uInt16)nPageId ) ) + if( ( nPageId >= 0 ) && pDoc->GetPage( static_cast(nPageId) ) ) { - nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND ); + nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, static_cast(nPageId), SDRLAYER_NOTFOUND ); SwitchPage( aPos ); } } @@ -245,14 +245,14 @@ sal_Int8 TabControl::ExecuteDrop( const ExecuteDropEvent& rEvt ) // Adapt target page id when necessary, i.e. page copy // has been inserted in front of the target page. sal_uInt16 nPageNum = nPageId; - if ((nPageNumOfCopy <= nPageNum) && (nPageNum != (sal_uInt16)-1)) + if ((nPageNumOfCopy <= nPageNum) && (nPageNum != sal_uInt16(-1))) nPageNum += 1; if (pDoc->MovePages(nPageNum)) { // 3. Switch to the copy that has been moved to its // final destination. Use an asynchron slot call to // be executed after the still pending ones. - if (nPageNumOfCopy >= nPageNum || (nPageNum == (sal_uInt16)-1)) + if (nPageNumOfCopy >= nPageNum || (nPageNum == sal_uInt16(-1))) nPageNum += 1; SetCurPageId (GetPageId(nPageNum)); SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher(); @@ -271,9 +271,9 @@ sal_Int8 TabControl::ExecuteDrop( const ExecuteDropEvent& rEvt ) { sal_Int32 nPageId = GetPageId( aPos ) - 1; - if( ( nPageId >= 0 ) && pDoc->GetPage( (sal_uInt16)nPageId ) ) + if( ( nPageId >= 0 ) && pDoc->GetPage( static_cast(nPageId) ) ) { - nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND ); + nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, static_cast(nPageId), SDRLAYER_NOTFOUND ); } } diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 78d6cd13f4db..28addf16c480 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -84,21 +84,21 @@ void ViewShell::UpdateScrollBars() { if (mpHorizontalScrollBar.get() != nullptr) { - long nW = (long)(mpContentWindow->GetVisibleWidth() * 32000); - long nX = (long)(mpContentWindow->GetVisibleX() * 32000); + long nW = static_cast(mpContentWindow->GetVisibleWidth() * 32000); + long nX = static_cast(mpContentWindow->GetVisibleX() * 32000); mpHorizontalScrollBar->SetVisibleSize(nW); mpHorizontalScrollBar->SetThumbPos(nX); nW = 32000 - nW; - long nLine = (long) (mpContentWindow->GetScrlLineWidth() * nW); - long nPage = (long) (mpContentWindow->GetScrlPageWidth() * nW); + long nLine = static_cast(mpContentWindow->GetScrlLineWidth() * nW); + long nPage = static_cast(mpContentWindow->GetScrlPageWidth() * nW); mpHorizontalScrollBar->SetLineSize(nLine); mpHorizontalScrollBar->SetPageSize(nPage); } if (mpVerticalScrollBar.get() != nullptr) { - long nH = (long)(mpContentWindow->GetVisibleHeight() * 32000); - long nY = (long)(mpContentWindow->GetVisibleY() * 32000); + long nH = static_cast(mpContentWindow->GetVisibleHeight() * 32000); + long nY = static_cast(mpContentWindow->GetVisibleY() * 32000); if(IsPageFlipMode()) // ie in zoom mode where no panning { @@ -117,8 +117,8 @@ void ViewShell::UpdateScrollBars() mpVerticalScrollBar->SetVisibleSize(nH); mpVerticalScrollBar->SetThumbPos(nY); nH = 32000 - nH; - long nLine = (long) (mpContentWindow->GetScrlLineHeight() * nH); - long nPage = (long) (mpContentWindow->GetScrlPageHeight() * nH); + long nLine = static_cast(mpContentWindow->GetScrlLineHeight() * nH); + long nPage = static_cast(mpContentWindow->GetScrlPageHeight() * nH); mpVerticalScrollBar->SetLineSize(nLine); mpVerticalScrollBar->SetPageSize(nPage); } @@ -148,7 +148,7 @@ void ViewShell::VirtHScrollHdl(ScrollBar* pHScroll) if (nDelta != 0) { - double fX = (double) pHScroll->GetThumbPos() / pHScroll->GetRange().Len(); + double fX = static_cast(pHScroll->GetThumbPos()) / pHScroll->GetRange().Len(); // scroll all windows of the column ::sd::View* pView = GetView(); @@ -202,13 +202,13 @@ void ViewShell::VirtVScrollHdl(ScrollBar* pVScroll) { SdPage* pPage = static_cast(this)->GetActualPage(); sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1; - sal_uInt16 nNewPage = (sal_uInt16)pVScroll->GetThumbPos()/256; + sal_uInt16 nNewPage = static_cast(pVScroll->GetThumbPos())/256; if( nCurPage != nNewPage ) static_cast(this)->SwitchPage(nNewPage); } else //panning mode { - double fY = (double) pVScroll->GetThumbPos() / pVScroll->GetRange().Len(); + double fY = static_cast(pVScroll->GetThumbPos()) / pVScroll->GetRange().Len(); ::sd::View* pView = GetView(); OutlinerView* pOLV = nullptr; @@ -292,9 +292,9 @@ void ViewShell::Scroll(long nScrollX, long nScrollY) long nNewThumb = mpVerticalScrollBar->GetThumbPos() + nScrollY; mpVerticalScrollBar->SetThumbPos(nNewThumb); } - double fX = (double) mpHorizontalScrollBar->GetThumbPos() / + double fX = static_cast(mpHorizontalScrollBar->GetThumbPos()) / mpHorizontalScrollBar->GetRange().Len(); - double fY = (double) mpVerticalScrollBar->GetThumbPos() / + double fY = static_cast(mpVerticalScrollBar->GetThumbPos()) / mpVerticalScrollBar->GetRange().Len(); GetActiveWindow()->SetVisibleXY(fX, fY); @@ -632,7 +632,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, */ void ViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction&) { - long nZoom = (long)((double) rZoomX * 100); + long nZoom = static_cast(static_cast(rZoomX) * 100); SetZoom(nZoom); } diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index f209ecf79827..045c5486f88b 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -352,7 +352,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( i == nNewPageIndex); } // Move the selected page to the head of the document - pDocument->MovePages ((sal_uInt16)-1); + pDocument->MovePages (sal_uInt16(-1)); nNewPageIndex = 0; } else -- cgit