summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui')
-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
114 files changed, 515 insertions, 515 deletions
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