summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:16:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:16:43 +0100
commitabf7b94123a555c4f3e90a0ae41bd7a842d1c1fb (patch)
tree6e0208e0450308652be1a0a512f98023b35ca489
parentb271fb5ba1a8f7da2120d7037de087b02eb16c91 (diff)
More loplugin:cstylecast: sd
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I144975b94fe2725ac740a953ca2133e99f8a3fce
-rw-r--r--sd/inc/sdiocmpt.hxx2
-rw-r--r--sd/qa/unit/export-tests.cxx2
-rw-r--r--sd/qa/unit/import-tests.cxx8
-rw-r--r--sd/qa/unit/sdmodeltestbase.hxx2
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx10
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx10
-rw-r--r--sd/source/core/EffectMigration.cxx4
-rw-r--r--sd/source/core/PageListWatcher.cxx12
-rw-r--r--sd/source/core/drawdoc2.cxx16
-rw-r--r--sd/source/core/drawdoc3.cxx6
-rw-r--r--sd/source/core/drawdoc4.cxx2
-rw-r--r--sd/source/core/sdpage.cxx38
-rw-r--r--sd/source/core/sdpage2.cxx2
-rw-r--r--sd/source/core/sdpage_animations.cxx4
-rw-r--r--sd/source/core/stlpool.cxx2
-rw-r--r--sd/source/core/stlsheet.cxx14
-rw-r--r--sd/source/filter/cgm/sdcgmfilter.cxx2
-rw-r--r--sd/source/filter/eppt/eppt.cxx2
-rw-r--r--sd/source/filter/eppt/epptso.cxx84
-rw-r--r--sd/source/filter/eppt/pptexanimations.cxx72
-rw-r--r--sd/source/filter/eppt/pptexsoundcollection.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-epptbase.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx36
-rw-r--r--sd/source/filter/eppt/pptx-stylesheet.cxx12
-rw-r--r--sd/source/filter/eppt/pptx-text.cxx38
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx8
-rw-r--r--sd/source/filter/html/htmlex.cxx56
-rw-r--r--sd/source/filter/html/pubdlg.cxx24
-rw-r--r--sd/source/filter/ppt/pptin.cxx14
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx88
-rw-r--r--sd/source/filter/ppt/propread.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx4
-rw-r--r--sd/source/ui/accessibility/AccessibleSlideSorterView.cxx4
-rw-r--r--sd/source/ui/accessibility/AccessibleViewForwarder.cxx14
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx50
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx8
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx2
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx2
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx2
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx6
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx8
-rw-r--r--sd/source/ui/app/optsitem.cxx46
-rw-r--r--sd/source/ui/app/sddll.cxx4
-rw-r--r--sd/source/ui/app/sdmod1.cxx2
-rw-r--r--sd/source/ui/app/sdmod2.cxx8
-rw-r--r--sd/source/ui/app/sdxfer.cxx2
-rw-r--r--sd/source/ui/controller/displaymodecontroller.cxx4
-rw-r--r--sd/source/ui/controller/slidelayoutcontroller.cxx2
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx4
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.cxx4
-rw-r--r--sd/source/ui/dlg/animobjs.cxx8
-rw-r--r--sd/source/ui/dlg/copydlg.cxx18
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx8
-rw-r--r--sd/source/ui/dlg/diactrl.cxx4
-rw-r--r--sd/source/ui/dlg/dlgolbul.cxx4
-rw-r--r--sd/source/ui/dlg/dlgpage.cxx6
-rw-r--r--sd/source/ui/dlg/dlgsnap.cxx2
-rw-r--r--sd/source/ui/dlg/docprev.cxx10
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx12
-rw-r--r--sd/source/ui/dlg/navigatr.cxx4
-rw-r--r--sd/source/ui/dlg/paragr.cxx2
-rw-r--r--sd/source/ui/dlg/present.cxx4
-rw-r--r--sd/source/ui/dlg/sdpreslt.cxx10
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx2
-rw-r--r--sd/source/ui/dlg/tpoption.cxx18
-rw-r--r--sd/source/ui/dlg/vectdlg.cxx20
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx2
-rw-r--r--sd/source/ui/func/bulmaper.cxx8
-rw-r--r--sd/source/ui/func/fucon3d.cxx2
-rw-r--r--sd/source/ui/func/fuconarc.cxx6
-rw-r--r--sd/source/ui/func/fuconbez.cxx2
-rw-r--r--sd/source/ui/func/fuconrec.cxx2
-rw-r--r--sd/source/ui/func/fucopy.cxx10
-rw-r--r--sd/source/ui/func/fumorph.cxx4
-rw-r--r--sd/source/ui/func/fuoaprms.cxx4
-rw-r--r--sd/source/ui/func/fuolbull.cxx4
-rw-r--r--sd/source/ui/func/fupage.cxx6
-rw-r--r--sd/source/ui/func/fuscale.cxx4
-rw-r--r--sd/source/ui/func/fusel.cxx2
-rw-r--r--sd/source/ui/func/fusldlg.cxx2
-rw-r--r--sd/source/ui/func/fusnapln.cxx2
-rw-r--r--sd/source/ui/func/futempl.cxx2
-rw-r--r--sd/source/ui/func/fuzoom.cxx2
-rw-r--r--sd/source/ui/inc/morphdlg.hxx2
-rw-r--r--sd/source/ui/inc/optsitem.hxx2
-rw-r--r--sd/source/ui/remotecontrol/BluetoothServer.cxx2
-rw-r--r--sd/source/ui/remotecontrol/BufferedStreamSocket.cxx2
-rw-r--r--sd/source/ui/remotecontrol/ImagePreparer.cxx4
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx6
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.cxx10
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx8
-rw-r--r--sd/source/ui/sidebar/PreviewValueSet.cxx4
-rw-r--r--sd/source/ui/slideshow/SlideShowRestarter.cxx2
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx4
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx18
-rw-r--r--sd/source/ui/slideshow/slideshowviewimpl.cxx8
-rw-r--r--sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx14
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx4
-rw-r--r--sd/source/ui/slidesorter/model/SlideSorterModel.cxx4
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx6
-rw-r--r--sd/source/ui/table/TableDesignPane.cxx6
-rw-r--r--sd/source/ui/table/tableobjectbar.cxx4
-rw-r--r--sd/source/ui/tools/ConfigurationAccess.cxx2
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx2
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx4
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx18
-rw-r--r--sd/source/ui/unoidl/unocpres.cxx4
-rw-r--r--sd/source/ui/unoidl/unolayer.cxx4
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx30
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx10
-rw-r--r--sd/source/ui/unoidl/unopage.cxx16
-rw-r--r--sd/source/ui/unoidl/unopool.cxx2
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx18
-rw-r--r--sd/source/ui/view/Outliner.cxx20
-rw-r--r--sd/source/ui/view/OutlinerIterator.cxx4
-rw-r--r--sd/source/ui/view/ViewClipboard.cxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx4
-rw-r--r--sd/source/ui/view/ViewTabBar.cxx2
-rw-r--r--sd/source/ui/view/drtxtob.cxx2
-rw-r--r--sd/source/ui/view/drtxtob1.cxx8
-rw-r--r--sd/source/ui/view/drviews1.cxx14
-rw-r--r--sd/source/ui/view/drviews2.cxx14
-rw-r--r--sd/source/ui/view/drviews3.cxx12
-rw-r--r--sd/source/ui/view/drviews4.cxx10
-rw-r--r--sd/source/ui/view/drviews5.cxx4
-rw-r--r--sd/source/ui/view/drviews7.cxx8
-rw-r--r--sd/source/ui/view/drviews8.cxx4
-rw-r--r--sd/source/ui/view/drviews9.cxx82
-rw-r--r--sd/source/ui/view/drviewsa.cxx8
-rw-r--r--sd/source/ui/view/drviewse.cxx14
-rw-r--r--sd/source/ui/view/drviewsf.cxx6
-rw-r--r--sd/source/ui/view/drviewsh.cxx4
-rw-r--r--sd/source/ui/view/frmview.cxx38
-rw-r--r--sd/source/ui/view/outlnvs2.cxx4
-rw-r--r--sd/source/ui/view/outlnvsh.cxx16
-rw-r--r--sd/source/ui/view/outlview.cxx40
-rw-r--r--sd/source/ui/view/sdview.cxx4
-rw-r--r--sd/source/ui/view/sdview3.cxx12
-rw-r--r--sd/source/ui/view/sdwindow.cxx54
-rw-r--r--sd/source/ui/view/tabcontr.cxx12
-rw-r--r--sd/source/ui/view/viewshe2.cxx28
-rw-r--r--sd/source/ui/view/viewshe3.cxx2
145 files changed, 803 insertions, 803 deletions
diff --git a/sd/inc/sdiocmpt.hxx b/sd/inc/sdiocmpt.hxx
index d91c339ba0ce..b3582a85c58f 100644
--- a/sd/inc/sdiocmpt.hxx
+++ b/sd/inc/sdiocmpt.hxx
@@ -43,7 +43,7 @@ public:
void CloseSubRecord();
};
-#define SDIOCOMPAT_VERSIONDONTKNOW (sal_uInt16)0xffff
+#define SDIOCOMPAT_VERSIONDONTKNOW sal_uInt16(0xffff)
class SD_DLLPUBLIC SdIOCompat : public old_SdrDownCompat
{
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 78c5d4d68753..44099cbac91b 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -759,7 +759,7 @@ void SdExportTest::testTextRotation()
auto it = aCustomShapeGeometry.find("TextRotateAngle");
CPPUNIT_ASSERT(it != aCustomShapeGeometry.end());
- CPPUNIT_ASSERT_EQUAL((double)(-90), aCustomShapeGeometry["TextRotateAngle"].get<double>());
+ CPPUNIT_ASSERT_EQUAL(double(-90), aCustomShapeGeometry["TextRotateAngle"].get<double>());
xDocShRef->DoClose();
}
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 5f91f1ad2f75..52d7d0c44010 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1325,9 +1325,9 @@ void SdImportTest::testTdf93124()
uno::Sequence< beans::PropertyValue > aFilterData(2);
aFilterData[0].Name = "PixelWidth";
- aFilterData[0].Value <<= (sal_Int32)320;
+ aFilterData[0].Value <<= sal_Int32(320);
aFilterData[1].Name = "PixelHeight";
- aFilterData[1].Value <<= (sal_Int32)180;
+ aFilterData[1].Value <<= sal_Int32(180);
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
@@ -1401,9 +1401,9 @@ void SdImportTest::testTdf99729()
uno::Sequence< beans::PropertyValue > aFilterData(2);
aFilterData[0].Name = "PixelWidth";
- aFilterData[0].Value <<= (sal_Int32)320;
+ aFilterData[0].Value <<= sal_Int32(320);
aFilterData[1].Name = "PixelHeight";
- aFilterData[1].Value <<= (sal_Int32)240;
+ aFilterData[1].Value <<= sal_Int32(240);
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 19b7b0ac6bf2..3662bf373d2a 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -157,7 +157,7 @@ protected:
FileFormat* getFormat(sal_Int32 nExportType)
{
FileFormat* pFormat = &aFileFormats[0];
- if (((sal_uInt32) nExportType) < SAL_N_ELEMENTS(aFileFormats))
+ if (static_cast<sal_uInt32>(nExportType) < SAL_N_ELEMENTS(aFileFormats))
pFormat = &aFileFormats[nExportType];
return pFormat;
}
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 63080a2461e2..ab47522c19f3 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -58,7 +58,7 @@ static char const DATA_DIRECTORY[] = "/sd/qa/unit/tiledrendering/data/";
static std::ostream& operator<<(std::ostream& os, ViewShellId id)
{
- os << (sal_Int32)id;
+ os << static_cast<sal_Int32>(id);
return os;
}
@@ -1345,7 +1345,7 @@ void SdTiledRenderingTest::testTdf102223()
rEditView.SetSelection(ESelection(0, 0, 0, 3)); // start para, start char, end para, end char.
CPPUNIT_ASSERT_EQUAL(OUString("Red"), rEditView.GetSelected());
const SvxFontHeightItem& rItem = rEditView.GetAttribs().Get(EE_CHAR_FONTHEIGHT);
- CPPUNIT_ASSERT_EQUAL((int)1411, (int)rItem.GetHeight());
+ CPPUNIT_ASSERT_EQUAL(int(1411), static_cast<int>(rItem.GetHeight()));
// cut contents of cell
uno::Sequence<beans::PropertyValue> aArgs;
@@ -1357,7 +1357,7 @@ void SdTiledRenderingTest::testTdf102223()
EditView& rEditView2 = pView->GetTextEditOutlinerView()->GetEditView();
rEditView2.SetSelection(ESelection(0, 0, 0, 1)); // start para, start char, end para, end char.
const SvxFontHeightItem& rItem2 = rEditView2.GetAttribs().Get(EE_CHAR_FONTHEIGHT);
- CPPUNIT_ASSERT_EQUAL((int)1411, (int)rItem2.GetHeight());
+ CPPUNIT_ASSERT_EQUAL(int(1411), static_cast<int>(rItem2.GetHeight()));
comphelper::LibreOfficeKit::setActive(false);
}
@@ -1442,7 +1442,7 @@ void SdTiledRenderingTest::testTdf103083()
CPPUNIT_ASSERT_EQUAL(OUString("No-Logo Content~LT~Gliederung 2"),
pOutliner->GetStyleSheet(2)->GetName());
const SfxItemSet& rParagraphItemSet1 = pTextObject->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(2);
- CPPUNIT_ASSERT_EQUAL((sal_uInt16)3, rParagraphItemSet1.Count());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rParagraphItemSet1.Count());
// cut contents of bullet item
comphelper::dispatchCommand(".uno:Cut", uno::Sequence<beans::PropertyValue>());
@@ -1470,7 +1470,7 @@ void SdTiledRenderingTest::testTdf103083()
pOutliner->GetStyleSheet(2)->GetName());
const SfxItemSet& rParagraphItemSet2 = pTextObject->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(2);
- CPPUNIT_ASSERT_EQUAL((sal_uInt16)3, rParagraphItemSet2.Count());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rParagraphItemSet2.Count());
comphelper::LibreOfficeKit::setActive(false);
}
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<double>(aPageSize.Width()), static_cast<double>(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<sal_Int32>(floor(aRange.getMinX())), static_cast<sal_Int32>(floor(aRange.getMinY())),
+ static_cast<sal_Int32>(ceil(aRange.getMaxX())), static_cast<sal_Int32>(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<double>(aPageSize.Width()), 1.0 / static_cast<double>(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<sal_Int8>(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<sal_Int32>(COL_LIGHTGRAY);
sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(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<sal_Int32>(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<sal_uInt32>(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<sal_uInt32>(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<sal_uInt32>(mrModel.GetPageCount());
}
SdPage* ImpDrawPageListWatcher::ImpGetPage(sal_uInt32 nIndex) const
{
- return const_cast<SdPage*>(static_cast<const SdPage*>(mrModel.GetPage((sal_uInt16)nIndex)));
+ return const_cast<SdPage*>(static_cast<const SdPage*>(mrModel.GetPage(static_cast<sal_uInt16>(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<sal_uInt32>(mrModel.GetMasterPageCount());
}
SdPage* ImpMasterPageListWatcher::ImpGetPage(sal_uInt32 nIndex) const
{
- return const_cast<SdPage*>(static_cast<const SdPage*>(mrModel.GetMasterPage((sal_uInt16)nIndex)));
+ return const_cast<SdPage*>(static_cast<const SdPage*>(mrModel.GetMasterPage(static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(mpMasterPageListWatcher->GetSdPageCount(ePgKind));
}
sal_uInt16 SdDrawDocument::GetActiveSdPageCount() const
{
- return (sal_uInt16)mpDrawPageListWatcher->GetVisibleSdPageCount();
+ return static_cast<sal_uInt16>(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<long>(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L);
+ sal_uLong nRight = std::max(static_cast<long>(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<SdPage*>::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<SdPage*>(&(pBookmarkDoc->GetSdPage((sal_uInt16)nPos, PageKind::Standard)->TRG_GetMasterPage()));
+ pBMMPage = static_cast<SdPage*>(&(pBookmarkDoc->GetSdPage(static_cast<sal_uInt16>(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<sal_uInt16>(nMPage), PageKind::Standard );
+ pNotesMaster = GetMasterSdPage( static_cast<sal_uInt16>(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<sal_uInt32>(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<double>(aPartArea.Width()) / pRefPage->GetWidth();
double fV = pRefPage->GetHeight() == 0
- ? 0 : (double) aPartArea.Height() / pRefPage->GetHeight();
+ ? 0 : static_cast<double>(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<long>(fH * pRefPage->GetWidth());
+ aSize.Height() = static_cast<long>(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<double>(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<double>(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<double>(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<double>(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<double>(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<double>(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<sal_uLong>(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<const SvxFontHeightItem&>(pObj->GetMergedItem(nWhich)).GetHeight();
- sal_uInt32 nNewFontHeight = sal_uInt32((double)nFontHeight * (double)aFractY);
+ sal_uInt32 nNewFontHeight = sal_uInt32(static_cast<double>(nFontHeight) * static_cast<double>(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<double>(aFractX)) + nLeft;
+ aNewPos.Y() = long((aTopLeft.Y() - GetUpperBorder()) * static_cast<double>(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<sal_Int32>(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<double>(aPartArea.Width()) / static_cast<double>(pFirstPage->GetWidth());
- aSize.Height() = (long)(fScale * pFirstPage->GetHeight() );
+ aSize.Height() = static_cast<long>(fScale * pFirstPage->GetHeight() );
if( aSize.Height() > aPartArea.Height() )
{
- fScale = (double)aPartArea.Height() / (double)pFirstPage->GetHeight();
+ fScale = static_cast<double>(aPartArea.Height()) / static_cast<double>(pFirstPage->GetHeight());
aSize.Height() = aPartArea.Height();
- aSize.Width() = (long)(fScale * pFirstPage->GetWidth());
+ aSize.Width() = static_cast<long>(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<int>(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<sal_Int16>(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<sal_Int16>(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<sal_uInt16>((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<sal_uInt32>(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<short>(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<sal_uInt16>(fLowerFraction * nNewHeight));
double fUpperFraction = double(rULItem.GetUpper()) / nOldHeight;
- aNewULItem.SetUpper((sal_uInt16)(fUpperFraction * nNewHeight));
+ aNewULItem.SetUpper(static_cast<sal_uInt16>(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<sal_Int16>(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<NameOrIndex>((sal_uInt16)pEntry->nWID);
+ const NameOrIndex* pItem = rStyleSet.GetItem<NameOrIndex>(static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_uInt8>(nRetValue >> 16), static_cast<sal_uInt8>(nRetValue >> 8), static_cast<sal_uInt8>(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<sal_uInt16>(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<double>(aPrefSize.Width()) / static_cast<double>(aPrefSize.Height()) );
+ double fQ2 = ( static_cast<double>(rGraphicSize.Width()) / static_cast<double>(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<sal_Int32>(static_cast<double>(rGraphicSize.Width()) / fXScale + 0.5 ),
+ static_cast<sal_Int32>(static_cast<double>(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<sal_uInt16>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int16>( 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<sal_Int16>( static_cast<double>(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<sal_uInt16>( static_cast<double>(-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
nLineSpacing = nNormalSpacing;
else
- nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );
+ nLineSpacing = static_cast<sal_Int16>( static_cast<double>(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<sal_uInt16>(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<sal_uInt8>( nBackgroundColor >> 8 );
+ nB += static_cast<sal_uInt8>( 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<double>(mnAngle) * F_PI18000 );
+ double fSin = sin( static_cast<double>(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<sal_Int32>( -( fWidthHalf - fXDiff ) ), static_cast<sal_Int32>( - ( 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<sal_Int32>( maRect.Left() + fWidthHalf - fHeightHalf ), static_cast<sal_Int32>( 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<sal_Int16>( static_cast<double>(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<sal_Int32>(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<sal_Int16>(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<sal_Int32>( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize );
+ if ( static_cast<sal_Int32>(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<sal_uInt16>( ( 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<sal_Int32>( ( 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<sal_Int32>(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<sal_Int32>(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<sal_Int32>( cos( nStartAngle * F_PI18000 ) * 100.0 );
+ aStart.Y = - static_cast<sal_Int32>( sin( nStartAngle * F_PI18000 ) * 100.0 );
+ aEnd.X = static_cast<sal_Int32>( cos( nEndAngle * F_PI18000 ) * 100.0 );
+ aEnd.Y = - static_cast<sal_Int32>( 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<sal_uInt16>( 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<sal_uInt8>(nUnicode);
+ *pTmp++ = static_cast<sal_uInt8>( 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<sal_uInt16>(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<sal_Int32>(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<sal_Int32>( 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<sal_Int32>(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<sal_uInt16>(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<sal_uInt32>(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<sal_Int32>( 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<sal_Int32>(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<float>(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<sal_Int32>( 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<sal_Int32>( 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<sal_Int32>( aHSL[ 0 ] / ( 360.0 / 255 ) ) )
+ aP
- + OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) )
+ + OUString::number( static_cast<sal_Int32>( aHSL[ 1 ] * 255.0 ) )
+ aP
- + OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) )
+ + OUString::number( static_cast<sal_Int32>( aHSL[ 2 ] * 255.0 ) )
+ ")";
}
else if ( rSourceValue >>= nColor )
{
aDest += "rgb("
- + OUString::number( ( (sal_Int8)nColor ) )
+ + OUString::number( static_cast<sal_Int8>(nColor) )
+ aP
- + OUString::number( ( (sal_Int8)( nColor >> 8 ) ) )
+ + OUString::number( static_cast<sal_Int8>( nColor >> 8 ) )
+ aP
- + OUString::number( ( (sal_Int8)( nColor >> 16 ) ) )
+ + OUString::number( static_cast<sal_Int8>( 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<sal_Int32>( 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<float>(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<float>(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<float>(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<float>( fX * 100 );
+ fByY = static_cast<float>( 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<float>( fX * 100 );
+ fFromY = static_cast<float>( 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<float>( fX * 100 );
+ fToY = static_cast<float>( 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<float>(fVal);
}
if ( xTransform->getFrom() >>= fVal )
{
nBits |= 2;
- fFrom = (float)fVal;
+ fFrom = static_cast<float>(fVal);
}
if ( xTransform->getTo() >>= fVal )
{
nBits |= 4;
- fTo = (float)fVal;
+ fTo = static_cast<float>(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<sal_uInt8>( nColor >> 16 );
+ rB = static_cast<sal_uInt8>( nColor >> 8 );
+ rC = static_cast<sal_uInt8>(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<sal_Int32>( aHSL[ 0 ] * 255.0 / 360.0 );
+ rB = static_cast<sal_Int32>( aHSL[ 1 ] * 255.0 );
+ rC = static_cast<sal_Int32>( 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<float>(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<float>(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<sal_uInt32>(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<sal_Int32>(mAny) / 4.40972 )
+ ? static_cast<sal_uInt16>( *o3tl::doAccess<sal_Int32>(mAny) / 4.40972 )
: 1250;
maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, dynamic_cast<PPTExBulletProvider*>(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<sal_Int32>(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<sal_uInt32>(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<sal_uInt32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int64>(57600*aRealPoint2D.X + 1270)/2540.0)),
+ XML_y, I64S((static_cast<sal_Int64>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int16>( static_cast<double>(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<sal_uInt16>( static_cast<double>(-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<sal_Int16>( 100.0 * pDesc->Scaling + 0.5 );
else
nLineSpacing = 100;
}
else
- nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );
+ nLineSpacing = static_cast<sal_Int16>( static_cast<double>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(aString[ i ]);
if ( nChar == 0xa )
nChar++;
else if ( !bSymbol )
@@ -240,7 +240,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe
{
FontCollectionEntry aFontDesc( *o3tl::doAccess<OUString>(mAny) );
sal_uInt32 nCount = rFontCollection.GetCount();
- mnFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
+ mnFont = static_cast<sal_uInt16>(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<OUString>(mAny) );
sal_uInt32 nCount = rFontCollection.GetCount();
- mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
+ mnAsianOrComplexFont = static_cast<sal_uInt16>(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<OUString>(mAny) );
sal_uInt32 nCount = rFontCollection.GetCount();
- mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
+ mnAsianOrComplexFont = static_cast<sal_uInt16>(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<sal_uInt16>( fVal + 0.5 );
meCharHeight = GetPropertyState( mXPropSet, aCharHeightName );
}
}
@@ -416,8 +416,8 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe
{
sal_uInt32 nSOColor = *( o3tl::doAccess<sal_uInt32>(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<sal_uInt8>(nSOColor) << 16; // red and blue is switched
+ mnCharColor |= static_cast<sal_uInt8>( 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<sal_Int16>( fQuo + 0.5 );
+ if ( static_cast<sal_uInt16>(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<sal_Int32>(pPropValue[i].Value) / ( 2540.0 / 576 ) );
else if ( aPropName == "FirstLineOffset" )
- nBulletOfs += (sal_Int16)( *o3tl::doAccess<sal_Int32>(pPropValue[i].Value) / ( 2540.0 / 576 ) );
+ nBulletOfs += static_cast<sal_Int16>( *o3tl::doAccess<sal_Int32>(pPropValue[i].Value) / ( 2540.0 / 576 ) );
else if ( aPropName == "BulletColor" )
{
sal_uInt32 nSOColor = *o3tl::doAccess<sal_uInt32>(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<sal_uInt8>(nSOColor) << 16; // red
+ nBulletColor |= static_cast<sal_uInt8>( 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<sal_Int16>(-( aLineSpacing.Height ) );
mbFixedLineSpacing = true;
break;
case css::style::LineSpacingMode::MINIMUM :
case css::style::LineSpacingMode::LEADING :
- mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) );
+ mnLineSpacing = static_cast<sal_Int16>(-( aLineSpacing.Height ) );
mbFixedLineSpacing = false;
break;
case css::style::LineSpacingMode::PROP :
default:
- mnLineSpacing = (sal_Int16)( aLineSpacing.Height );
+ mnLineSpacing = static_cast<sal_Int16>( aLineSpacing.Height );
break;
}
}
@@ -1172,14 +1172,14 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bG
if ( ImplGetPropertyValue( "ParaBottomMargin", bGetPropStateValue ) )
{
double fSpacing = *o3tl::doAccess<sal_uInt32>(mAny) + ( 2540.0 / 576.0 ) - 1;
- mnLineSpacingBottom = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) );
+ mnLineSpacingBottom = static_cast<sal_Int16>(-( fSpacing * 576.0 / 2540.0 ) );
}
meLineSpacingBottom = ePropState;
if ( ImplGetPropertyValue( "ParaTopMargin", bGetPropStateValue ) )
{
double fSpacing = *o3tl::doAccess<sal_uInt32>(mAny) + ( 2540.0 / 576.0 ) - 1;
- mnLineSpacingTop = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) );
+ mnLineSpacingTop = static_cast<sal_Int16>(-( 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<sal_uInt16>(aMetric.GetAscent()) + static_cast<sal_uInt16>(aMetric.GetDescent());
if ( nTxtHeight )
{
- double fScaling = (double)nTxtHeight / 120.0;
+ double fScaling = static_cast<double>(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<double>(aGrfSize.Width()) / aGrfSize.Height();
+ double fWinWH = static_cast<double>(aPagSize.Width()) / aPagSize.Height();
// adjust graphic to page size (scales)
if( fGrfWH < fWinWH )
{
- aGrfSize.Width() = (long) ( aPagSize.Height() * fGrfWH );
+ aGrfSize.Width() = static_cast<long>( 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<long>( 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<sal_Int16>(aTmp.toInt32());
}
}
else if ( pParams->Name == "Width" )
{
sal_Int32 temp = 0;
pParams->Value >>= temp;
- mnWidthPixel = (sal_uInt16)temp;
+ mnWidthPixel = static_cast<sal_uInt16>(temp);
}
else if ( pParams->Name == "UseButtonSet" )
{
sal_Int32 temp = 0;
pParams->Value >>= temp;
- mnButtonThema = (sal_Int16)temp;
+ mnButtonThema = static_cast<sal_Int16>(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<double>(aTmpSize.Width())/aTmpSize.Height();
- mnHeightPixel = (sal_uInt16)(mnWidthPixel/dRatio);
+ mnHeightPixel = static_cast<sal_uInt16>(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<sal_Int32>(bThumbnail ? PUB_THUMBNAIL_WIDTH : mnWidthPixel );
aFilterData[1].Name = "PixelHeight";
- aFilterData[1].Value <<= (sal_Int32)(bThumbnail ? PUB_THUMBNAIL_HEIGHT : mnHeightPixel);
+ aFilterData[1].Value <<= static_cast<sal_Int32>(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<sal_Int32>(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<sal_uInt16>(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<double>(mnWidthPixel) / nPageWidth;
+ aRect.Left() = static_cast<long>(aRect.Left() * fLogicToPixel);
+ aRect.Top() = static_cast<long>(aRect.Top() * fLogicToPixel);
+ aRect.Right() = static_cast<long>(aRect.Right() * fLogicToPixel);
+ aRect.Bottom() = static_cast<long>(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<long>(aArea.Left() * fLogicToPixel);
+ aArea.Top() = static_cast<long>(aArea.Top() * fLogicToPixel);
+ aArea.Right() = static_cast<long>(aArea.Right() * fLogicToPixel);
+ aArea.Bottom() = static_cast<long>(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<long>(aCenter.X() * fLogicToPixel);
+ aCenter.Y() = static_cast<long>(aCenter.Y() * fLogicToPixel);
sal_uLong nCircleRadius = static_cast<IMapCircleObject*>(pArea)->
GetRadius(false);
- nCircleRadius = (sal_uLong)(nCircleRadius * fLogicToPixel);
+ nCircleRadius = static_cast<sal_uLong>(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<sal_uInt16>(nPage));
}
break;
@@ -1847,7 +1847,7 @@ bool HtmlExport::CreateHtmlForPresPages()
else
nPage = nSdPage + 1;
- aHRef = CreatePageURL( (sal_uInt16) nPage);
+ aHRef = CreatePageURL( static_cast<sal_uInt16>(nPage));
}
break;
@@ -2353,7 +2353,7 @@ bool HtmlExport::CreateFrames()
if(mbNotes)
{
aStr.append(" <frameset rows=\"42,");
- aStr.append(OUString::number((int)((double)mnWidthPixel * 0.75) + 16));
+ aStr.append(OUString::number(static_cast<int>(static_cast<double>(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<long>(aPnt.X() * fFactor);
+ aPnt.Y() = static_cast<long>(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<char const *>(aMemStm.GetData()));
return OUString( static_cast<char const *>(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<bool>(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<sal_Int32>(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<sal_uInt32>(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<sal_Int32>(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<sal_Int32>(m_aBackColor.GetColor());
aProps.push_back( aValue );
aValue.Name = "TextColor";
- aValue.Value <<= (sal_Int32)m_aTextColor.GetColor();
+ aValue.Value <<= static_cast<sal_Int32>(m_aTextColor.GetColor());
aProps.push_back( aValue );
aValue.Name = "LinkColor";
- aValue.Value <<= (sal_Int32)m_aLinkColor.GetColor();
+ aValue.Value <<= static_cast<sal_Int32>(m_aLinkColor.GetColor());
aProps.push_back( aValue );
aValue.Name = "VLinkColor";
- aValue.Value <<= (sal_Int32)m_aVLinkColor.GetColor();
+ aValue.Value <<= static_cast<sal_Int32>(m_aVLinkColor.GetColor());
aProps.push_back( aValue );
aValue.Name = "ALinkColor";
- aValue.Value <<= (sal_Int32)m_aALinkColor.GetColor();
+ aValue.Value <<= static_cast<sal_Int32>(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<sal_uInt16>(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<sal_uInt32>(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<sal_uInt16>(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<sal_uInt32>(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<sal_uInt16>(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<sal_Int32>( ( nMasterNum + 1 ) / 2 - 1 ) );
static_cast<SdStyleSheetPool*>( 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<double>(aLogicSize.Width()) / aOutlineSize.Width() < 0.48 ||
+ static_cast<double>(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<double>(aLogicSize.Width()) / aOutlineSize.Width() < 0.48 ||
+ static_cast<double>(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<sal_Int16>(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<sal_Int16>(aString.toDouble());
bRet = true;
}
else if( rValue.getValueType() == cppu::UnoType<double>::get() )
{
double fValue = 0.0;
rValue >>= fValue;
- rValue <<= (sal_Int16)fValue;
+ rValue <<= static_cast<sal_Int16>(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<sal_uInt8>(lcl_gethex( aString[1] ) * 16 + lcl_gethex( aString[2] )) );
+ aColor.SetGreen( static_cast<sal_uInt8>(lcl_gethex( aString[3] ) * 16 + lcl_gethex( aString[4] )) );
+ aColor.SetBlue( static_cast<sal_uInt8>(lcl_gethex( aString[5] ) * 16 + lcl_gethex( aString[6] )) );
+ rValue <<= static_cast<sal_Int32>(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<sal_uInt8>(aString.getToken( 0, ',', index ).toInt32()) );
+ aColor.SetGreen( static_cast<sal_uInt8>(aString.getToken( 0, ',', index ).toInt32()) );
+ aColor.SetRed( static_cast<sal_uInt8>(aString.getToken( 0, ',', index ).toInt32()) );
+ rValue <<= static_cast<sal_Int32>(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<float>(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<double>(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<sal_Int32>(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<sal_Int32>(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<sal_uInt8>(nA), static_cast<sal_uInt8>(nB), static_cast<sal_uInt8>(nC) );
+ return makeAny( static_cast<sal_Int32>(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<sal_uInt16>(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<sal_Int32>(aColor.GetRed()) );
+ dump( ",%ld", static_cast<sal_Int32>(aColor.GetGreen()) );
+ dump( ",%ld])", static_cast<sal_Int32>(aColor.GetBlue()) );
+ return makeAny( static_cast<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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<double>(fFromX) / 100.0;
+ aPair.Second <<= static_cast<double>(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<double>(fToX) / 100.0;
+ aPair.Second <<= static_cast<double>(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<double>(fByX) / 100.0;
+ aPair.Second <<= static_cast<double>(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<sal_Int32>(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<double>(fBy) ) );
if( nBits & 2 )
- xTransform->setFrom( makeAny( (double) fFrom ) );
+ xTransform->setFrom( makeAny( static_cast<double>(fFrom) ) );
if( nBits & 4 )
- xTransform->setTo( makeAny( (double) fTo ) );
+ xTransform->setTo( makeAny( static_cast<double>(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<sal_Int32>(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<double>(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<double>(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<double>(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<double>(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<double>(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<sal_uInt16>(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<sal_Int16>(static_cast<sal_uInt16>((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<sal_Int16>(static_cast<sal_uInt16>((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<maPageObjects.size())
+ if (nIndex>=0 && static_cast<sal_uInt32>(nIndex)<maPageObjects.size())
{
if (maPageObjects[nIndex] == nullptr)
{
@@ -756,7 +756,7 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAcces
}
else
{
- OSL_ASSERT(nIndex>=0 && (sal_uInt32)nIndex<maPageObjects.size());
+ OSL_ASSERT(nIndex>=0 && static_cast<sal_uInt32>(nIndex)<maPageObjects.size());
}
return pChild;
diff --git a/sd/source/ui/accessibility/AccessibleViewForwarder.cxx b/sd/source/ui/accessibility/AccessibleViewForwarder.cxx
index 1090412acc8c..72d7afcb985b 100644
--- a/sd/source/ui/accessibility/AccessibleViewForwarder.cxx
+++ b/sd/source/ui/accessibility/AccessibleViewForwarder.cxx
@@ -43,7 +43,7 @@ AccessibleViewForwarder::AccessibleViewForwarder (SdrPaintView* pView, OutputDev
if(&rOutDev == &rDevice)
{
- mnWindowId = (sal_uInt16)a;
+ mnWindowId = static_cast<sal_uInt16>(a);
break;
}
}
@@ -58,9 +58,9 @@ AccessibleViewForwarder::~AccessibleViewForwarder()
{
::tools::Rectangle aVisibleArea;
- if((sal_uInt32)mnWindowId < mpView->PaintWindowCount())
+ if(static_cast<sal_uInt32>(mnWindowId) < mpView->PaintWindowCount())
{
- SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow((sal_uInt32)mnWindowId);
+ SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(static_cast<sal_uInt32>(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<sal_uInt32>(mnWindowId) < mpView->PaintWindowCount())
{
- SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow((sal_uInt32)mnWindowId);
+ SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(static_cast<sal_uInt32>(mnWindowId));
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
::tools::Rectangle aBBox(static_cast<vcl::Window&>(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<sal_uInt32>(mnWindowId) < mpView->PaintWindowCount())
{
- SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow((sal_uInt32)mnWindowId);
+ SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(static_cast<sal_uInt32>(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<sal_Int32>(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<long>(fValue * 100.0) );
}
}
Any CharHeightPropertyBox::getValue()
{
- return makeAny( (double)mpMetric->GetValue() / 100.0 );
+ return makeAny( static_cast<double>(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<long>(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<double>(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<long>(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<double>(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<long>(fValue1 * 100.0);
else
- nValue = (long)(fValue2 * 100.0);
+ nValue = static_cast<long>(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<double>(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<long>(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<sal_Int32>(i)+2;
break;
}
}
if( nPos == 0 )
{
- nPos = (sal_Int32)maSoundList.size()+2;
+ nPos = static_cast<sal_Int32>(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<sal_Int32>(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<long>(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<void*>((sal_IntPtr)nShape) );
+ mpLBTrigger->SetEntryData( nPos, reinterpret_cast<void*>(static_cast<sal_IntPtr>(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<sal_IntPtr>(mpLBTrigger->GetEntryData( nPos ));
+ sal_Int32 nShape = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(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<long>(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<float>(pEffect->getIterateInterval());
if( pEffect->getDuration() )
- fIterateInterval = (float)(fIterateInterval / pEffect->getDuration() );
+ fIterateInterval = static_cast<float>(fIterateInterval / pEffect->getDuration() );
fIterateInterval *= 100.0;
- addValue( pSet, nHandleIterateInterval, makeAny( (double)fIterateInterval ) );
+ addValue( pSet, nHandleIterateInterval, makeAny( static_cast<double>(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<sal_uInt32>(rListBox->GetEntryCount() - 3) == rSoundList.size(),
"Sound list-box is not synchronized to sound list" );
nPos -= 3;
if( rSoundList.size() > static_cast<size_t>(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<sal_uInt16>(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<double>(x) / 100.0, static_cast<double>(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<double>(nDX) / 100.0;
+ aPosition.Y += static_cast<double>(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<sal_uInt16>(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<sal_uInt8>(aFront.GetRed() * aTransparency/double(255) + aBack.GetRed() * (1-aTransparency/double(255))),
+ static_cast<sal_uInt8>(aFront.GetGreen() * aTransparency/double(255) + aBack.GetGreen() * (1-aTransparency/double(255))),
+ static_cast<sal_uInt8>(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<sal_uInt16>(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<bool>(pValues[ 2 ]) );
if( pValues[3].hasValue() ) SetDragStripes( *o3tl::doAccess<bool>(pValues[ 3 ]) );
if( pValues[4].hasValue() ) SetHelplines( *o3tl::doAccess<bool>(pValues[ 4 ]) );
- if( pValues[5].hasValue() ) SetMetric( (sal_uInt16) *o3tl::doAccess<sal_Int32>(pValues[ 5 ]) );
- if( pValues[6].hasValue() ) SetDefTab( (sal_uInt16) *o3tl::doAccess<sal_Int32>(pValues[ 6 ]) );
+ if( pValues[5].hasValue() ) SetMetric( static_cast<sal_uInt16>(*o3tl::doAccess<sal_Int32>(pValues[ 5 ])) );
+ if( pValues[6].hasValue() ) SetDefTab( static_cast<sal_uInt16>(*o3tl::doAccess<sal_Int32>(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<sal_Int32>(GetMetric());
+ pValues[ 6 ] <<= static_cast<sal_Int32>(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<bool>(pValues[ 4 ]) );
if( pValues[5].hasValue() ) SetBigOrtho( *o3tl::doAccess<bool>(pValues[ 5 ]) );
if( pValues[6].hasValue() ) SetRotate( *o3tl::doAccess<bool>(pValues[ 6 ]) );
- if( pValues[7].hasValue() ) SetSnapArea( (sal_Int16) *o3tl::doAccess<sal_Int32>(pValues[ 7 ]) );
- if( pValues[8].hasValue() ) SetAngle( (sal_Int16) *o3tl::doAccess<sal_Int32>(pValues[ 8 ]) );
- if( pValues[9].hasValue() ) SetEliminatePolyPointLimitAngle( (sal_Int16) *o3tl::doAccess<sal_Int32>(pValues[ 9 ]) );
+ if( pValues[7].hasValue() ) SetSnapArea( static_cast<sal_Int16>(*o3tl::doAccess<sal_Int32>(pValues[ 7 ])) );
+ if( pValues[8].hasValue() ) SetAngle( static_cast<sal_Int16>(*o3tl::doAccess<sal_Int32>(pValues[ 8 ])) );
+ if( pValues[9].hasValue() ) SetEliminatePolyPointLimitAngle( static_cast<sal_Int16>(*o3tl::doAccess<sal_Int32>(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<sal_Int32>(GetSnapArea());
+ pValues[ 8 ] <<= static_cast<sal_Int32>(GetAngle());
+ pValues[ 9 ] <<= static_cast<sal_Int32>(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<sal_Int16>(pView->GetSnapAngle()) );
+ maOptionsSnap.SetEliminatePolyPointLimitAngle( static_cast<sal_Int16>(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<sal_Int32>(GetFieldDrawX());
+ pValues[ 1 ] <<= static_cast<sal_Int32>(GetFieldDrawY());
+ pValues[ 2 ] <<= ( GetFieldDivisionX() ? ( static_cast<double>(GetFieldDrawX()) / GetFieldDivisionX() - 1.0 ) : double(0) );
+ pValues[ 3 ] <<= ( GetFieldDivisionY() ? ( static_cast<double>(GetFieldDrawY()) / GetFieldDivisionY() - 1.0 ) : double(0) );
+ pValues[ 4 ] <<= static_cast<sal_Int32>(GetFieldSnapX());
+ pValues[ 5 ] <<= static_cast<sal_Int32>(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<bool>(pValues[ 7 ]) );
if( pValues[8].hasValue() ) SetBackPage( *o3tl::doAccess<bool>(pValues[ 8 ]) );
if( pValues[9].hasValue() ) SetPaperbin( *o3tl::doAccess<bool>(pValues[ 9 ]) );
- if( pValues[10].hasValue() ) SetOutputQuality( (sal_uInt16) *o3tl::doAccess<sal_Int32>(pValues[ 10 ]) );
+ if( pValues[10].hasValue() ) SetOutputQuality( static_cast<sal_uInt16>(*o3tl::doAccess<sal_Int32>(pValues[ 10 ])) );
if( pValues[11].hasValue() ) SetDraw( *o3tl::doAccess<bool>(pValues[ 11 ]) );
// just for impress
@@ -1242,7 +1242,7 @@ bool SdOptionsPrint::ReadData( const Any* pValues )
if( pValues[13].hasValue() ) SetHandout( *o3tl::doAccess<bool>(pValues[ 13 ]) );
if( pValues[14].hasValue() ) SetOutline( *o3tl::doAccess<bool>(pValues[ 14 ]) );
if( pValues[15].hasValue() ) SetHandoutHorizontal( *o3tl::doAccess<bool>(pValues[15]) );
- if( pValues[16].hasValue() ) SetHandoutPages( (sal_uInt16)*o3tl::doAccess<sal_Int32>(pValues[16]) );
+ if( pValues[16].hasValue() ) SetHandoutPages( static_cast<sal_uInt16>(*o3tl::doAccess<sal_Int32>(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<sal_Int32>(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<sal_uInt16>(::sd::DrawViewShell::GetInterfaceId()), pMod );
+ ::sd::NavigatorChildWindow::RegisterChildWindowContext( static_cast<sal_uInt16>(::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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(nPgNum));
}
else
aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_NUMBER);
@@ -489,7 +489,7 @@ std::unique_ptr<SfxItemSet> 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<sal_uInt16>(nMetric) ) );
// TP_OPTIONS_MISC:
SdOptionsMiscItem aSdOptionsMiscItem( pOptions, pFrameView );
@@ -497,7 +497,7 @@ std::unique_ptr<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot )
{
aSdOptionsMiscItem.GetOptionsMisc().SetSummationOfParagraphs( pDoc->IsSummationOfParagraphs() );
aSdOptionsMiscItem.GetOptionsMisc().SetPrinterIndependentLayout (
- (sal_uInt16)pDoc->GetPrinterIndependentLayout());
+ static_cast<sal_uInt16>(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<double>(targetSize) / static_cast<double>(size.Width());
if (size.Height() > targetSize)
- scale = ::std::min( scale, (double)targetSize / (double)size.Height() );
+ scale = ::std::min( scale, static_cast<double>(targetSize) / static_cast<double>(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<sal_Int32>(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<long>(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<long>(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<long>( static_cast<double>(aBmpSize.Width()) * static_cast<double>(aScale) );
+ aBmpSize.Height() = static_cast<long>( static_cast<double>(aBmpSize.Height()) * static_cast<double>(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<double>(aDisplaySize.Width()) / static_cast<double>(aBmpSize.Width()),
+ static_cast<double>(aDisplaySize.Height()) / static_cast<double>(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<long>(aStr.getToken( 0, TOKEN ).toInt32());
m_pNumFldCopies->SetValue( nTmp );
- nTmp = (long)aStr.getToken( 1, TOKEN ).toInt32();
+ nTmp = static_cast<long>(aStr.getToken( 1, TOKEN ).toInt32());
m_pMtrFldMoveX->SetValue( nTmp );
- nTmp = (long)aStr.getToken( 2, TOKEN ).toInt32();
+ nTmp = static_cast<long>(aStr.getToken( 2, TOKEN ).toInt32());
m_pMtrFldMoveY->SetValue( nTmp );
- nTmp = (long)aStr.getToken( 3, TOKEN ).toInt32();
+ nTmp = static_cast<long>(aStr.getToken( 3, TOKEN ).toInt32());
m_pMtrFldAngle->SetValue( nTmp );
- nTmp = (long)aStr.getToken( 4, TOKEN ).toInt32();
+ nTmp = static_cast<long>(aStr.getToken( 4, TOKEN ).toInt32());
m_pMtrFldWidth->SetValue( nTmp );
- nTmp = (long)aStr.getToken( 5, TOKEN ).toInt32();
+ nTmp = static_cast<long>(aStr.getToken( 5, TOKEN ).toInt32());
m_pMtrFldHeight->SetValue( nTmp );
- nTmp = (long)aStr.getToken( 6, TOKEN ).toInt32();
+ nTmp = static_cast<long>(aStr.getToken( 6, TOKEN ).toInt32());
m_pLbStartColor->SelectEntry( Color( nTmp ) );
- nTmp = (long)aStr.getToken( 7, TOKEN ).toInt32();
+ nTmp = static_cast<long>(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<sal_uInt16>(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<sal_Int32>(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<sal_Int32>(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<sal_uInt16>(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<sal_uInt16>(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<long>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<double>(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<sal_uInt16>(nWidth/dRatio));
+ rPoint=Point( 0, static_cast<sal_uInt16>((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<sal_uInt16>(nHeight*dRatio), nHeight);
+ rPoint=Point(static_cast<sal_uInt16>((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<sal_uInt16>(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<sal_uInt16>(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<double>(maOutRect.getWidth()) / static_cast<double>(maPageSize.Width()));
+ const double fScaleY(static_cast<double>(maOutRect.getHeight()) / static_cast<double>(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<double>(nWidth * maPageSize.Height()) / static_cast<double>(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<double>(nHeight * maPageSize.Width()) / static_cast<double>(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<sal_uInt16>(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<sal_uInt16>(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<sal_Int16>(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<void*>((sal_IntPtr)nDisplay) );
+ maLBMonitor->SetEntryData( nEntryIndex, reinterpret_cast<void*>(static_cast<sal_IntPtr>(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<sal_IntPtr>(maLBMonitor->GetEntryData(nPos))) );
+ rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(maLayoutNames.size()),
Image(BMP_FOIL_NONE), maStrNone );
}
if (!bCancel)
{
// select template
- m_pVS->SelectItem( (sal_uInt16) maLayoutNames.size() );
+ m_pVS->SelectItem( static_cast<sal_uInt16>(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<sal_IntPtr>(this);
+ nRet = static_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(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<sal_Int16>(pMtrFldSnapArea->GetValue()) );
+ aOptsItem.GetOptionsSnap().SetAngle( static_cast<sal_Int16>(pMtrFldAngle->GetValue()) );
+ aOptsItem.GetOptionsSnap().SetEliminatePolyPointLimitAngle( static_cast<sal_Int16>(pMtrFldBezAngle->GetValue()) );
rAttrs->Put( aOptsItem );
@@ -327,7 +327,7 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet )
{
const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pAttr);
- FieldUnit eFUnit = (FieldUnit)(long)pItem->GetValue();
+ FieldUnit eFUnit = (FieldUnit)static_cast<long>(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<sal_IntPtr>(m_pLbMetric->GetEntryData( nMPos ));
+ sal_uInt16 nFieldUnit = static_cast<sal_uInt16>(reinterpret_cast<sal_IntPtr>(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<sal_uInt16>(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<const SfxUInt16Item&>(rAttrs->Get( nWhich ));
- long nFieldUnit = (long)rItem.GetValue();
+ long nFieldUnit = static_cast<long>(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<long>(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<long>(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<double>(aBmpSize.Width()) / aBmpSize.Height();
+ const double fWinWH = static_cast<double>(rDispSize.Width()) / rDispSize.Height();
if( fGrfWH < fWinWH )
{
- aBmpSize.Width() = (long) ( rDispSize.Height() * fGrfWH );
+ aBmpSize.Width() = static_cast<long>( rDispSize.Height() * fGrfWH );
aBmpSize.Height()= rDispSize.Height();
}
else
{
aBmpSize.Width() = rDispSize.Width();
- aBmpSize.Height()= (long) ( rDispSize.Width() / fGrfWH);
+ aBmpSize.Height()= static_cast<long>( 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<sal_uInt16>(m_pNmLayers->GetValue()) );
return aNew;
}
@@ -159,7 +159,7 @@ void SdVectorizeDlg::Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf )
if( !!aTmp )
{
const Link<long,void> aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) );
- aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), &aPrgsHdl );
+ aTmp.Vectorize( rMtf, static_cast<sal_uInt8>(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<sal_uInt8>(FRound( nSumR * fMult )),
+ static_cast<sal_uInt8>(FRound( nSumG * fMult )),
+ static_cast<sal_uInt8>(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<sal_uInt16>(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<SfxBoolItem>((sal_uInt16)nSlotId);
+ const SfxBoolItem* pIsActive = rRequest.GetArg<SfxBoolItem>(static_cast<sal_uInt16>(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<const SvxFontItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_FONT )));
+ static_cast<const SvxFontItem&>(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<const SvxFontHeightItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_FONTHEIGHT )));
+ static_cast<const SvxFontHeightItem&>(rSet.Get(GetWhich( sal_uInt16(SID_ATTR_CHAR_FONTHEIGHT) )));
aMyFont.SetFontSize(Size(0, rFHItem.GetHeight()));
const SvxWeightItem& rWItem =
- static_cast<const SvxWeightItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_WEIGHT )));
+ static_cast<const SvxWeightItem&>(rSet.Get(GetWhich( sal_uInt16(SID_ATTR_CHAR_WEIGHT) )));
aMyFont.SetWeight(rWItem.GetWeight());
const SvxPostureItem& rPItem =
- static_cast<const SvxPostureItem&>(rSet.Get(GetWhich( (sal_uInt16)SID_ATTR_CHAR_POSTURE )));
+ static_cast<const SvxPostureItem&>(rSet.Get(GetWhich( sal_uInt16(SID_ATTR_CHAR_POSTURE) )));
aMyFont.SetItalic(rPItem.GetPosture());
const SvxUnderlineItem& rUItem = static_cast<const SvxUnderlineItem&>(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<long>(fW), static_cast<long>(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<long>(pPhiStart->GetValue () * 10.0),
+ static_cast<long>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(std::min( nTmp, static_cast<long>(nNumber) ));
}
if( lHeight < 0 )
{
long nTmp = ( aRect.Bottom() - aRect.Top() ) / -lHeight;
- nNumber = (sal_uInt16) std::min( nTmp, (long)nNumber );
+ nNumber = static_cast<sal_uInt16>(std::min( nTmp, static_cast<long>(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<sal_uInt8>( ( static_cast<long>(aEndColor.GetRed()) - static_cast<long>(aStartColor.GetRed()) ) * static_cast<long>(i) / static_cast<long>(nNumber) );
+ sal_uInt8 nGreen = aStartColor.GetGreen() + static_cast<sal_uInt8>( ( static_cast<long>(aEndColor.GetGreen()) - static_cast<long>(aStartColor.GetGreen()) ) * static_cast<long>(i) / static_cast<long>(nNumber) );
+ sal_uInt8 nBlue = aStartColor.GetBlue() + static_cast<sal_uInt8>( ( static_cast<long>(aEndColor.GetBlue()) - static_cast<long>(aStartColor.GetBlue()) ) * static_cast<long>(i) / static_cast<long>(nNumber) );
Color aNewColor( nRed, nGreen, nBlue );
SfxItemSet aNewSet( mpViewShell->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR>{} );
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<double>(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<long>( 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<sal_uInt16>(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<sal_uInt16>(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<const SfxUInt16Item*>(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<sal_uInt8>(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<sal_uInt16>(mpPage->GetLeftBorder()), static_cast<sal_uInt16>(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<sal_uInt16>(mpPage->GetUpperBorder()), static_cast<sal_uInt16>(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<SvxZoomItem> pZoomItem;
SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL;
- nValue = (sal_Int16) mpWindow->GetZoom();
+ nValue = static_cast<sal_Int16>(mpWindow->GetZoom());
// zoom on page size?
if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr &&
@@ -112,7 +112,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
ScopedVclPtr<AbstractSvxZoomDialog> pDlg(pFact ? pFact->CreateSvxZoomDialog(nullptr, aNewAttr) : nullptr);
if (pDlg)
{
- pDlg->SetLimits( (sal_uInt16)mpWindow->GetMinZoom(), (sal_uInt16)mpWindow->GetMaxZoom() );
+ pDlg->SetLimits( static_cast<sal_uInt16>(mpWindow->GetMinZoom()), static_cast<sal_uInt16>(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<sal_Int16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<long>(nTol) && aZoomSizePixel.Height() < static_cast<long>(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<sal_uInt16>(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<sal_uInt16>(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<char>(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<size_t>(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<sal_Int32>(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<sal_Int32>(aSlideNumber) );
aBuffer.append( "\n" );
aBuffer.append( "<html><body>" );
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<sal_uInt16>(nColumnCount));
+ SetLineCount (static_cast<sal_uInt16>(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<maContainer.size()
+ && static_cast<unsigned>(aToken)<maContainer.size()
&& maContainer[aToken].get()!=nullptr;
}
const SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescriptor (
Token aToken) const
{
- if (aToken>=0 && (unsigned)aToken<maContainer.size())
+ if (aToken>=0 && static_cast<unsigned>(aToken)<maContainer.size())
return maContainer[aToken];
else
return SharedMasterPageDescriptor();
@@ -698,7 +698,7 @@ const SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescrip
SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescriptor (Token aToken)
{
- if (aToken>=0 && (unsigned)aToken<maContainer.size())
+ if (aToken>=0 && static_cast<unsigned>(aToken)<maContainer.size())
return maContainer[aToken];
else
return SharedMasterPageDescriptor();
@@ -850,7 +850,7 @@ Reference<frame::XModel> 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<maContainer.size())
+ if (aToken>=0 && static_cast<unsigned>(aToken)<maContainer.size())
{
maContainer[aToken].reset();
}
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index a7b4eb40fccc..53d13a1112e9 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -415,9 +415,9 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC
if (nIndex >= 0)
{
PreviewValueSet::SetItemImage (
- (sal_uInt16)nIndex,
+ static_cast<sal_uInt16>(nIndex),
mpContainer->GetPreviewForToken(rEvent.maChildToken));
- PreviewValueSet::Invalidate(PreviewValueSet::GetItemRect((sal_uInt16)nIndex));
+ PreviewValueSet::Invalidate(PreviewValueSet::GetItemRect(static_cast<sal_uInt16>(nIndex)));
}
}
break;
@@ -446,7 +446,7 @@ MasterPagesSelector::UserData* MasterPagesSelector::GetUserData (int nIndex) con
const ::osl::MutexGuard aGuard (maMutex);
if (nIndex>0 && static_cast<unsigned int>(nIndex)<=PreviewValueSet::GetItemCount())
- return static_cast<UserData*>(PreviewValueSet::GetItemData((sal_uInt16)nIndex));
+ return static_cast<UserData*>(PreviewValueSet::GetItemData(static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_Int32>(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<DrawViewShell*>( pViewShell );
if( pDrawViewShell )
- pDrawViewShell->SwitchPage( (sal_uInt16)xController->getRestoreSlide() );
+ pDrawViewShell->SwitchPage( static_cast<sal_uInt16>(xController->getRestoreSlide()) );
else
{
Reference<XDrawView> 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<sal_Int32>(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<sal_Int32>(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<sal_uInt16>(nPageNumber), PageKind::Standard);
if (pPage)
{
- pPageMenu->InsertItem( (sal_uInt16)(CM_SLIDES + nPageNumber), pPage->GetName() );
+ pPageMenu->InsertItem( static_cast<sal_uInt16>(CM_SLIDES + nPageNumber), pPage->GetName() );
if( nPageNumber == nCurrentSlideNumber )
- pPageMenu->CheckItem( (sal_uInt16)(CM_SLIDES + nPageNumber) );
+ pPageMenu->CheckItem( static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(nSlide), PageKind::Standard )->GetName() )
break;
if( nSlide < nSlideCount )
- mpSlideController->insertSlideNumber( (sal_uInt16) nSlide );
+ mpSlideController->insertSlideNumber( static_cast<sal_uInt16>(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<long>( aOutputSize.Width() / 1.03 );
+ aOutputSize.Height() = static_cast<long>( 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<double>(aPageSize.Width()) / static_cast<double>(aPageSize.Height());
+ const double output_ratio = static_cast<double>(aOutputSize.Width()) / static_cast<double>(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<Any> aCreationArguments(comphelper::InitAnyPropertySequence(
{
{"nodepath", makeAny(sPathToImpressConfigurationRoot)},
- {"depth", makeAny((sal_Int32)-1)}
+ {"depth", makeAny(sal_Int32(-1))}
}));
Reference<XInterface> 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<OUString> &rBookmarkList = pClipTransferable->GetPageBookmarks();
const SolarMutexGuard aGuard;
- nInsertPageCount = (sal_uInt16) rBookmarkList.size();
+ nInsertPageCount = static_cast<sal_uInt16>(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<long>(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<long int>(mnHorizontalPosition * aViewSize.Width()),
+ static_cast<long int>(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<int>(mnHorizontalScrollFactor
* (rMouseWindowPosition.X() - maScrollBorder.Width()));
}
if (rMouseWindowPosition.X() >= (aWindowSize.Width() - maScrollBorder.Width())
&& aWindowArea.Right() < aViewPixelArea.Right())
{
- nDx = 1 + (int)(mnHorizontalScrollFactor
+ nDx = 1 + static_cast<int>(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<int>(mnVerticalScrollFactor
* (rMouseWindowPosition.Y() - maScrollBorder.Height()));
}
if (rMouseWindowPosition.Y() >= (aWindowSize.Height() - maScrollBorder.Height())
&& aWindowArea.Bottom() < aViewPixelArea.Bottom())
{
- nDy = 1 + (int)(mnVerticalScrollFactor
+ nDy = 1 + static_cast<int>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(nSdIndex), PageKind::Standard);
else
- return pModel->GetMasterSdPage ((sal_uInt16)nSdIndex, PageKind::Standard);
+ return pModel->GetMasterSdPage (static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(nColumnCount));
+ SetLineCount (static_cast<sal_uInt16>(nRowCount));
if( !m_bModal )
{
@@ -402,7 +402,7 @@ void TableDesignWidget::updateControls()
{
if( aNames[nIndex] == sStyleName )
{
- nSelection = (sal_uInt16)nIndex+1;
+ nSelection = static_cast<sal_uInt16>(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<sal_uInt16>(nSlotId), nCount));
rReq.AppendItem(SfxBoolItem(SID_TABLE_PARAM_INSERT_AFTER, bInsertAfter));
- rReq.SetSlot( (sal_uInt16)nSlotId );
+ rReq.SetSlot( static_cast<sal_uInt16>(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<Any> 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<long>((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<sal_Int16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_Int16>(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<sal_Int16>(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<sal_Int32>(aPrintOpts.GetOutputQuality());
break;
case HANDLE_MEASUREUNIT:
{
short nMeasure;
SvxFieldUnitToMeasureUnit( pDoc->GetUIUnit(), nMeasure );
- *pValue <<= (sal_Int16)nMeasure;
+ *pValue <<= static_cast<sal_Int16>(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<sal_Int32>(pDoc->GetDefaultTabulator());
break;
case HANDLE_PAGENUMFMT:
- *pValue <<= (sal_Int32)pDoc->GetPageNumType();
+ *pValue <<= static_cast<sal_Int32>(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<sal_Int16>(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<sal_Int32>( 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<sal_Int32>(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<sal_uInt16>(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<drawing::XLayer> xLayer (GetLayer (rLayerAdmin.GetLayer((sal_uInt16)nLayer)));
+ uno::Reference<drawing::XLayer> xLayer (GetLayer (rLayerAdmin.GetLayer(static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_Int32>(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<vcl::PDFExtOutDevData* >( pOut->GetExtOutDevData() );
- if ( !( mpDoc->GetSdPage((sal_Int16) nPageNumber-1, PageKind::Standard)->IsExcluded() ) ||
+ if ( !( mpDoc->GetSdPage(static_cast<sal_Int16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<SdPage*>(pDoc->GetMasterPage((sal_uInt16)nMaster));
+ SdPage* pPage = static_cast<SdPage*>(pDoc->GetMasterPage(static_cast<sal_uInt16>(nMaster)));
if( pPage && pPage->GetName() == aPrefix )
{
bUnique = false;
@@ -3160,8 +3160,8 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn
static_cast<SdStyleSheetPool*>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_Int32>( pInfo?pInfo->maBlueScreen.GetColor():0x00ffffff );
break;
case WID_VERB:
- aRet <<= (sal_Int32)( pInfo?pInfo->mnVerb:0 );
+ aRet <<= static_cast<sal_Int32>( 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<sal_uInt16>(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<sal_Int32>(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<sal_Int32>( GetPage()->GetSize().getWidth() );
break;
case WID_PAGE_HEIGHT:
- aAny <<= (sal_Int32)( GetPage()->GetSize().getHeight() );
+ aAny <<= static_cast<sal_Int32>( 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<sal_Int32>( 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<sal_Int16>( 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<sal_Int16>(static_cast<sal_uInt16>((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<sal_Int32>( 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<sal_uInt16>( ( 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<sal_uInt16>( ( 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<sal_uInt16>(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<double>(aPrintSize.Width()) / aPageSize.Width();
+ const double fVert = static_cast<double>(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<double>(rInfo.maPrintSize.Width()) / aPageSize.Width());
+ const double fVert (static_cast<double>(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<double>(aPageSize_2.Width()) / aPageSize_2.Height();
+ const double fPrintWH = static_cast<double>(aPrintSize_2.Width()) / aPrintSize_2.Height();
if( fPageWH < fPrintWH )
{
- aPageSize_2.Width() = (long) ( aPrintSize_2.Height() * fPageWH );
+ aPageSize_2.Width() = static_cast<long>( 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<long>( 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<sd::ViewShell> 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<sal_uInt16>(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<sal_uInt16>(nPageIndex),
maPosition.mePageKind);
else
mpPage = mpDocument->GetMasterSdPage (
- (sal_uInt16)nPageIndex,
+ static_cast<sal_uInt16>(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<sal_uInt16>(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<long int>(1) ) ),
+ Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), static_cast<long int>(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<sal_uInt16>(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<long>(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<long>( nUpper, 0 );
}
- pNewItem->SetUpper( (sal_uInt16) nUpper );
+ pNewItem->SetUpper( static_cast<sal_uInt16>(nUpper) );
long nLower = pNewItem->GetLower();
if( nSlot == SID_PARASPACE_INCREASE )
@@ -174,7 +174,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
nLower -= 100;
nLower = std::max<long>( nLower, 0 );
}
- pNewItem->SetLower( (sal_uInt16) nLower );
+ pNewItem->SetLower( static_cast<sal_uInt16>(nLower) );
SfxItemSet aNewAttrs( aAttr );
aNewAttrs.Put( *pNewItem );
@@ -205,7 +205,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
nUpper -= 100;
nUpper = std::max<long>( nUpper, 0 );
}
- pNewItem->SetUpper( (sal_uInt16) nUpper );
+ pNewItem->SetUpper( static_cast<sal_uInt16>(nUpper) );
long nLower = pNewItem->GetLower();
if( nSlot == SID_PARASPACE_INCREASE )
@@ -215,7 +215,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
nLower -= 100;
nLower = std::max<long>( nLower, 0 );
}
- pNewItem->SetLower( (sal_uInt16) nLower );
+ pNewItem->SetLower( static_cast<sal_uInt16>(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<SvxRuler> DrawViewShell::CreateHRuler (::sd::Window* pWin)
GetViewFrame()->GetBindings(), aWBits);
// Metric ...
- sal_uInt16 nMetric = (sal_uInt16)GetDoc()->GetUIUnit();
+ sal_uInt16 nMetric = static_cast<sal_uInt16>(GetDoc()->GetUIUnit());
if( nMetric == 0xffff )
- nMetric = (sal_uInt16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit();
+ nMetric = static_cast<sal_uInt16>(GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit());
pRuler->SetUnit( FieldUnit( nMetric ) );
@@ -542,10 +542,10 @@ VclPtr<SvxRuler> 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<sal_uInt16>(GetDoc()->GetUIUnit());
if( nMetric == 0xffff )
- nMetric = (sal_uInt16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit();
+ nMetric = static_cast<sal_uInt16>(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<long>(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<sal_uInt16>(nCurrentPage), mePageKind);
}
else // EditMode::MasterPage
{
- return GetDoc()->GetMasterSdPage((sal_uInt16)nCurrentPage, mePageKind);
+ return GetDoc()->GetMasterSdPage(static_cast<sal_uInt16>(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<const SvxZoomItem&>( pArgs->
- Get( SID_ATTR_ZOOM ) ).GetValue() );
+ SetZoom( static_cast<long>(static_cast<const SvxZoomItem&>( 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<sal_uInt16>(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<SfxUInt32Item>(ID_VAL_WHATPAGE);
- SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber((sal_Int32)((pWhatPage->GetValue()-1)>>1));
+ SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber(static_cast<sal_Int32>((pWhatPage->GetValue()-1)>>1));
}
else
{
@@ -147,7 +147,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
const SfxUInt32Item* pWhatPage = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATPAGE);
const SfxUInt32Item* pWhatKind = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATKIND);
- sal_Int32 nWhatPage = (sal_Int32)pWhatPage->GetValue ();
+ sal_Int32 nWhatPage = static_cast<sal_Int32>(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<short>(nWhatPage);
mePageKind = nWhatKind;
}
}
@@ -216,7 +216,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if(pWhatLayer)
{
- nCurPage = (short)pWhatLayer->GetValue();
+ nCurPage = static_cast<short>(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<sal_uInt16>(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<sal_uInt8>( nRed / fDiv + .5 ),
+ static_cast<sal_uInt8>( nGreen / fDiv + .5 ),
+ static_cast<sal_uInt8>( 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<sal_uInt16>(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 && nIndex<pBar->GetPageCount())
{
// 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<sal_uInt16>(nIndex))));
+ pBar->SetCurPageId (pBar->GetPageId (static_cast<sal_uInt16>(nIndex)));
rtl::Reference<SdUnoDrawView> 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<long>(pPage->GetLeftBorder()),
+ static_cast<long>(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<long>(pPage->GetUpperBorder()),
+ static_cast<long>(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<double>(aBmpSize.Width()) / aBmpSize.Height();
+ double fWinWH = static_cast<double>(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<float>(aSize.Width()) /
+ static_cast<float>(aSize.Height());
+ float fWinWH = static_cast<float>(aPageSize.Width()) /
+ static_cast<float>(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<long>(aPageSize.Height() * fGrfWH);
aSize.Height()= aPageSize.Height();
}
else
{
aSize.Width() = aPageSize.Width();
- aSize.Height()= (long)(aPageSize.Width() / fGrfWH);
+ aSize.Height()= static_cast<long>(aPageSize.Width() / fGrfWH);
}
}
@@ -242,7 +242,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs->Count () == 1)
{
const SfxUInt32Item* pLineStyle = rReq.GetArg<SfxUInt32Item>(ID_VAL_STYLE);
- if (CHECK_RANGE ((sal_Int32)drawing::LineStyle_NONE, (sal_Int32)pLineStyle->GetValue(), (sal_Int32)drawing::LineStyle_DASH))
+ if (CHECK_RANGE ((sal_Int32)drawing::LineStyle_NONE, static_cast<sal_Int32>(pLineStyle->GetValue()), (sal_Int32)drawing::LineStyle_DASH))
{
pAttr->ClearItem (XATTR_LINESTYLE);
XLineStyleItem aStyleItem((drawing::LineStyle) pLineStyle->GetValue());
@@ -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<sal_uInt8>(pRed->GetValue ()),
+ static_cast<sal_uInt8>(pGreen->GetValue ()),
+ static_cast<sal_uInt8>(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<SfxUInt32Item>(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<sal_uInt8>(pRed->GetValue()),
+ static_cast<sal_uInt8>(pGreen->GetValue()),
+ static_cast<sal_uInt8>(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<sal_uInt8>(pRed->GetValue ()),
+ static_cast<sal_uInt8>(pGreen->GetValue ()),
+ static_cast<sal_uInt8>(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<sal_uInt8>(pRed->GetValue ()),
+ static_cast<sal_uInt8>(pGreen->GetValue ()),
+ static_cast<sal_uInt8>(pBlue->GetValue ()));
long i;
pAttr->ClearItem (XATTR_FILLHATCH);
@@ -475,10 +475,10 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
const SfxUInt32Item* pDashLen = rReq.GetArg<SfxUInt32Item>(ID_VAL_DASHLEN);
const SfxUInt32Item* pDistance = rReq.GetArg<SfxUInt32Item>(ID_VAL_DISTANCE);
- if (CHECK_RANGE ((sal_Int32)css::drawing::DashStyle_RECT, (sal_Int32)pStyle->GetValue(), (sal_Int32)css::drawing::DashStyle_ROUNDRELATIVE))
+ if (CHECK_RANGE ((sal_Int32)css::drawing::DashStyle_RECT, static_cast<sal_Int32>(pStyle->GetValue()), (sal_Int32)css::drawing::DashStyle_ROUNDRELATIVE))
{
- XDash aNewDash ((css::drawing::DashStyle) pStyle->GetValue (), (short) pDots->GetValue (), pDotLen->GetValue (),
- (short) pDashes->GetValue (), pDashLen->GetValue (), pDistance->GetValue ());
+ XDash aNewDash ((css::drawing::DashStyle) pStyle->GetValue (), static_cast<short>(pDots->GetValue ()), pDotLen->GetValue (),
+ static_cast<short>(pDashes->GetValue ()), pDashLen->GetValue (), pDistance->GetValue ());
pAttr->ClearItem (XATTR_LINEDASH);
pAttr->ClearItem (XATTR_LINESTYLE);
@@ -530,13 +530,13 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
const SfxUInt32Item* pStart = rReq.GetArg<SfxUInt32Item>(ID_VAL_STARTINTENS);
const SfxUInt32Item* pEnd = rReq.GetArg<SfxUInt32Item>(ID_VAL_ENDINTENS);
- if (CHECK_RANGE ((sal_Int32)css::awt::GradientStyle_LINEAR, (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<sal_Int32>(pStyle->GetValue()), (sal_Int32)css::awt::GradientStyle_RECT) &&
+ CHECK_RANGE (0, static_cast<sal_Int32>(pAngle->GetValue ()), 360) &&
+ CHECK_RANGE (0, static_cast<sal_Int32>(pBorder->GetValue ()), 100) &&
+ CHECK_RANGE (0, static_cast<sal_Int32>(pCenterX->GetValue ()), 100) &&
+ CHECK_RANGE (0, static_cast<sal_Int32>(pCenterY->GetValue ()), 100) &&
+ CHECK_RANGE (0, static_cast<sal_Int32>(pStart->GetValue ()), 100) &&
+ CHECK_RANGE (0, static_cast<sal_Int32>(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<short>(pBorder->GetValue ()));
+ aGradient.SetXOffset (static_cast<short>(pCenterX->GetValue ()));
+ aGradient.SetYOffset (static_cast<short>(pCenterY->GetValue ()));
+ aGradient.SetStartIntens (static_cast<short>(pStart->GetValue ()));
+ aGradient.SetEndIntens (static_cast<short>(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<short>(pCenterX->GetValue ()),
+ static_cast<short>(pCenterY->GetValue ()), static_cast<short>(pBorder->GetValue ()),
+ static_cast<short>(pStart->GetValue ()), static_cast<short>(pEnd->GetValue ()));
pGradientList->Insert(o3tl::make_unique<XGradientEntry>(aGradient, pName->GetValue()));
XFillStyleItem aStyleItem(drawing::FillStyle_GRADIENT);
@@ -613,8 +613,8 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
const SfxUInt32Item* pDistance = rReq.GetArg<SfxUInt32Item>(ID_VAL_DISTANCE);
const SfxUInt32Item* pAngle = rReq.GetArg<SfxUInt32Item>(ID_VAL_ANGLE);
- if (CHECK_RANGE ((sal_Int32)css::drawing::HatchStyle_SINGLE, (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<sal_Int32>(pStyle->GetValue()), (sal_Int32)css::drawing::HatchStyle_TRIPLE) &&
+ CHECK_RANGE (0, static_cast<sal_Int32>(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<long>(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<long>((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<SvxZoomItem> pZoomItem;
- sal_uInt16 nZoom = (sal_uInt16) GetActiveWindow()->GetZoom();
+ sal_uInt16 nZoom = static_cast<sal_uInt16>(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<sal_uInt16>(pActiveWindow->GetZoom()), static_cast<sal_uInt16>(pActiveWindow->GetMinZoom()), static_cast<sal_uInt16>(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<long>(aPageSize.Width() * 1.03);
aPagePos.Y() += aPageSize.Height() / 2;
- aPageSize.Height() = (long) (aPageSize.Height() * 1.03);
+ aPageSize.Height() = static_cast<long>(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<sal_Char>(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<long>(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<long>(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<long>(maMarkRect.GetWidth() * 1.03);
+ long nH = static_cast<long>(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<long>(aBoundRect.GetWidth() * 1.03);
+ long nH = static_cast<long>(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<double>(rRect.getWidth()), static_cast<double>(rRect.Right()) - static_cast<double>(rRect.Left())));
+ const bool bOverflowInY(!rtl::math::approxEqual(static_cast<double>(rRect.getHeight()), static_cast<double>(rRect.Bottom()) - static_cast<double>(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<sal_Int32>(rPos.X()) );
aLines.append( ',' );
- aLines.append( (sal_Int32)rPos.Y() );
+ aLines.append( static_cast<sal_Int32>(rPos.Y()) );
break;
case SdrHelpLineKind::Vertical:
aLines.append( 'V' );
- aLines.append( (sal_Int32)rPos.X() );
+ aLines.append( static_cast<sal_Int32>(rPos.X()) );
break;
case SdrHelpLineKind::Horizontal:
aLines.append( 'H' );
- aLines.append( (sal_Int32)rPos.Y() );
+ aLines.append( static_cast<sal_Int32>(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<sal_Int32>(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<sal_Int16>(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<sal_Int16>(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<sal_Int32>(aVisArea.Top()) ) );
+ aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( static_cast<sal_Int32>(aVisArea.Left()) ) );
+ aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( static_cast<sal_Int32>(aVisArea.GetWidth()) ) );
+ aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( static_cast<sal_Int32>(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<sal_Int32>(GetGridCoarse().Width()) ) );
+ aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( static_cast<sal_Int32>(GetGridCoarse().Height()) ) );
+ aUserData.addValue( sUNO_View_GridFineWidth, makeAny( static_cast<sal_Int32>(GetGridFine().Width()) ) );
+ aUserData.addValue( sUNO_View_GridFineHeight, makeAny( static_cast<sal_Int32>(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<sal_Int32>(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<sal_uInt16>(nInt16) );
- SetSelectedPageOnLoad( (sal_uInt16)nInt16 );
+ SetSelectedPageOnLoad( static_cast<sal_uInt16>(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<sal_uInt16>(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<const SvxZoomItem&>( pArgs->
- Get( SID_ATTR_ZOOM ) ).GetValue() );
+ SetZoom( static_cast<long>(static_cast<const SvxZoomItem&>( 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<double>(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<long>(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<double>(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<long>(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<sal_uInt16>(GetActiveWindow()->GetZoom());
std::unique_ptr<SvxZoomItem> 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<sal_uInt16>(pActiveWindow->GetZoom()), static_cast<sal_uInt16>(pActiveWindow->GetMinZoom()), static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_Int32>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt32>(mrDoc.GetSdPageCount( PageKind::Standard )) )
+ return mrDoc.GetSdPage( static_cast<sal_uInt16>(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<sal_uInt16>(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<long>(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<float>(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<float>(aImageSize.Height()) / static_cast<float>(aImageSize.Width());
+ aImageSize.Width() = static_cast<long>( fImageRatio * fImageHeight );
}
- aImageSize.Height() = (long)fImageHeight;
+ aImageSize.Height() = static_cast<long>(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<sal_uInt16>(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<sal_uInt16>(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<sal_uInt16>(i) ) );
if( pP->GetPageKind() != PageKind::Standard )
- pWorkModel->DeletePage( (sal_uInt16) i );
+ pWorkModel->DeletePage( static_cast<sal_uInt16>(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<sal_uInt16>(i) ) );
if( pP->GetPageKind() != PageKind::Standard )
- pModel->DeletePage( (sal_uInt16) i );
+ pModel->DeletePage( static_cast<sal_uInt16>(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<sal_uInt16>(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<sal_uLong>(static_cast<double>(aWinSize.Width())
+ * double(ZOOM_MULTIPLICATOR) / static_cast<double>(maViewSize.Width()));
+ sal_uLong nY = static_cast<sal_uLong>(static_cast<double>(aWinSize.Height())
+ * double(ZOOM_MULTIPLICATOR) / static_cast<double>(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<sal_uInt16>(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<long>(mnMinZoom) )
SetZoomFactor(mnMinZoom);
}
}
void Window::SetMinZoom (long int nMin)
{
- mnMinZoom = (sal_uInt16) nMin;
+ mnMinZoom = static_cast<sal_uInt16>(nMin);
}
void Window::SetMaxZoom (long int nMax)
{
- mnMaxZoom = (sal_uInt16) nMax;
+ mnMaxZoom = static_cast<sal_uInt16>(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<long>(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<long>(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<sal_uLong>(static_cast<double>(aWinSize.Height())
+ * double(ZOOM_MULTIPLICATOR) / static_cast<double>(rZoomRect.GetHeight()));
}
if(rZoomRect.GetWidth())
{
- nY = (sal_uLong) ((double) aWinSize.Width()
- * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth());
+ nY = static_cast<sal_uLong>(static_cast<double>(aWinSize.Width())
+ * double(ZOOM_MULTIPLICATOR) / static_cast<double>(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<long>(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<sal_uLong>(static_cast<double>(aWinSize.Height())
+ * double(ZOOM_MULTIPLICATOR) / static_cast<double>(rZoomRect.GetHeight()));
}
if(rZoomRect.GetWidth())
{
- nY = (sal_uLong) ((double) aWinSize.Width()
- * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth());
+ nY = static_cast<sal_uLong>(static_cast<double>(aWinSize.Width())
+ * double(ZOOM_MULTIPLICATOR) / static_cast<double>(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<long>(static_cast<double>(aWinSize.Width()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(nFact));
maWinPos.X() += (rZoomRect.GetWidth() - aWinSize.Width()) / 2;
- aWinSize.Height() = (long) ((double) aWinSize.Height() * (double) ZOOM_MULTIPLICATOR / (double) nFact);
+ aWinSize.Height() = static_cast<long>(static_cast<double>(aWinSize.Height()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(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<double>(maWinPos.X()) / maViewSize.Width());
}
/**
@@ -639,7 +639,7 @@ double Window::GetVisibleX()
*/
double Window::GetVisibleY()
{
- return ((double) maWinPos.Y() / maViewSize.Height());
+ return (static_cast<double>(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<long>(fX * maViewSize.Width());
if ( fY >= 0 )
- maWinPos.Y() = (long) (fY * maViewSize.Height());
+ maWinPos.Y() = static_cast<long>(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<double>(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<double>(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<sal_uInt16>(nPageId) ) )
{
- nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND );
+ nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, static_cast<sal_uInt16>(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<sal_uInt16>(nPageId) ) )
{
- nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND );
+ nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, static_cast<sal_uInt16>(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<long>(mpContentWindow->GetVisibleWidth() * 32000);
+ long nX = static_cast<long>(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<long>(mpContentWindow->GetScrlLineWidth() * nW);
+ long nPage = static_cast<long>(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<long>(mpContentWindow->GetVisibleHeight() * 32000);
+ long nY = static_cast<long>(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<long>(mpContentWindow->GetScrlLineHeight() * nH);
+ long nPage = static_cast<long>(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<double>(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<DrawViewShell*>(this)->GetActualPage();
sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1;
- sal_uInt16 nNewPage = (sal_uInt16)pVScroll->GetThumbPos()/256;
+ sal_uInt16 nNewPage = static_cast<sal_uInt16>(pVScroll->GetThumbPos())/256;
if( nCurPage != nNewPage )
static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage);
}
else //panning mode
{
- double fY = (double) pVScroll->GetThumbPos() / pVScroll->GetRange().Len();
+ double fY = static_cast<double>(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<double>(mpHorizontalScrollBar->GetThumbPos()) /
mpHorizontalScrollBar->GetRange().Len();
- double fY = (double) mpVerticalScrollBar->GetThumbPos() /
+ double fY = static_cast<double>(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<long>(static_cast<double>(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