summaryrefslogtreecommitdiff
path: root/sd/source/ui/app
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:16:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:16:43 +0100
commitabf7b94123a555c4f3e90a0ae41bd7a842d1c1fb (patch)
tree6e0208e0450308652be1a0a512f98023b35ca489 /sd/source/ui/app
parentb271fb5ba1a8f7da2120d7037de087b02eb16c91 (diff)
More loplugin:cstylecast: sd
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I144975b94fe2725ac740a953ca2133e99f8a3fce
Diffstat (limited to 'sd/source/ui/app')
-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
5 files changed, 31 insertions, 31 deletions
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 );