summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-03 21:11:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-05 21:18:06 +0200
commit760cd5b67be4225b6ff47b80a9afa97f2ddb466a (patch)
tree961ba8fc741a61bbe57e70785bc488614f1a2f12 /sd
parent03f2dbfabf2d1e8906ac7c3ec5d230facb0ec57c (diff)
Improved loplugin:cstylecast to reference types: sd
Change-Id: Icce4141f8aef688d85d219021606530839fb276f
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests.cxx2
-rw-r--r--sd/source/core/drawdoc2.cxx2
-rw-r--r--sd/source/filter/eppt/epptso.cxx6
-rw-r--r--sd/source/filter/eppt/pptexanimations.cxx2
-rw-r--r--sd/source/filter/ppt/pptin.cxx28
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx8
-rw-r--r--sd/source/ui/docshell/docshel4.cxx2
-rw-r--r--sd/source/ui/func/fudraw.cxx2
-rw-r--r--sd/source/ui/func/fupoor.cxx10
9 files changed, 31 insertions, 31 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index d379b1fd86c4..a5be80b54a95 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -594,7 +594,7 @@ void SdImportTest::testFdo72998()
SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>(pPage->GetObj(2));
CPPUNIT_ASSERT( pObj );
const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
- const css::uno::Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( OUString( "ViewBox" ) );
+ const css::uno::Any* pViewBox = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( OUString( "ViewBox" ) );
CPPUNIT_ASSERT_MESSAGE( "Missing ViewBox", pViewBox );
css::awt::Rectangle aViewBox;
CPPUNIT_ASSERT( (*pViewBox >>= aViewBox ) );
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 917c486c7408..73bd440f9c54 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -1043,7 +1043,7 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj,
const MapMode aMap100( MapUnit::Map100thMM );
Size aGraphSize;
Point aRelPoint( rWinPoint );
- ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap();
+ ImageMap& rImageMap = const_cast<ImageMap&>(pIMapInfo->GetImageMap());
const ::tools::Rectangle& rRect = pObj->GetLogicRect();
bool bObjSupported = false;
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 4a465c5328fe..f73a882ff0f3 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1068,7 +1068,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
if ( !mbEmptyPresObj )
{
ParagraphObj* pPara;
- TextObjBinary aTextObj( mXText, nTextInstance, maFontCollection, (PPTExBulletProvider&)*this );
+ TextObjBinary aTextObj( mXText, nTextInstance, maFontCollection, static_cast<PPTExBulletProvider&>(*this) );
// leaving out EPP_TextCharsAtom w/o text - still write out
// attribute info though
@@ -2249,7 +2249,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
bIsTitlePossible = false;
ImplGetText();
- TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Title, maFontCollection, (PPTExBulletProvider&)*this );
+ TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Title, maFontCollection, static_cast<PPTExBulletProvider&>(*this) );
if ( ePageType == MASTER )
{
if ( mnTextSize )
@@ -2343,7 +2343,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
)
{
ImplGetText();
- TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Body, maFontCollection, (PPTExBulletProvider&)*this );
+ TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Body, maFontCollection, static_cast<PPTExBulletProvider&>(*this) );
if ( ePageType == MASTER )
{
nPrevTextStyle = EPP_TEXTSTYLE_TITLE;
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index 5ffc215ded64..35157a49cedb 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1776,7 +1776,7 @@ void AnimationExporter::exportAnimateTargetElement( SvStream& rStrm, const Any&
EscherExAtom aAnimReference( rStrm, DFF_msofbtAnimReference );
sal_uInt32 nRefType = 1; // TODO: nRefType == 2 -> Sound;
- sal_uInt32 nRefId = ((EscherSolverContainer&)mrSolverContainer).GetShapeId( xShape );
+ sal_uInt32 nRefId = mrSolverContainer.GetShapeId( xShape );
rStrm.WriteUInt32( nRefMode )
.WriteUInt32( nRefType )
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 9c4574d8729b..c2613ebc41a4 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -245,7 +245,7 @@ bool ImplSdPPTImport::Import()
EEControlBits nControlWord = rOutl.GetEditEngine().GetControlWord();
nControlWord |= EEControlBits::ULSPACESUMMATION;
nControlWord &= ~EEControlBits::ULSPACEFIRSTPARA;
- ((EditEngine&)rOutl.GetEditEngine()).SetControlWord( nControlWord );
+ const_cast<EditEngine&>(rOutl.GetEditEngine()).SetControlWord( nControlWord );
SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
mnBackgroundLayerID = rAdmin.GetLayerID( SdResId( STR_LAYER_BCKGRND ) );
@@ -607,8 +607,8 @@ bool ImplSdPPTImport::Import()
PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_Type::TextInShape, 0 );
PPTPortionObj aPortion( *pPPTStyleSheet, TSS_Type::TextInShape, 0 );
aParagraph.AppendPortion( aPortion );
- aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
- aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
+ aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
+ aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
}
}
@@ -620,8 +620,8 @@ bool ImplSdPPTImport::Import()
PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_Type::TextInShape, 0 );
PPTPortionObj aPortion( *pPPTStyleSheet, TSS_Type::TextInShape, 0 );
aParagraph.AppendPortion( aPortion );
- aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
- aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
+ aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
+ aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
}
// create layoutstylesheets, set layoutname and stylesheet
@@ -665,8 +665,8 @@ bool ImplSdPPTImport::Import()
PPTParagraphObj aParagraph( *pPPTStyleSheet, nTitleInstance, 0 );
PPTPortionObj aPortion( *pPPTStyleSheet, nTitleInstance, 0 );
aParagraph.AppendPortion( aPortion );
- aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
- aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
+ aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
+ aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
}
// outlinerstylesheet
@@ -686,8 +686,8 @@ bool ImplSdPPTImport::Import()
SfxItemSet& rItemSet = pOutlineSheet->GetItemSet();
PPTPortionObj aPortion( *pPPTStyleSheet, nOutlinerInstance, nLevel );
pParagraphs[ nLevel ]->AppendPortion( aPortion );
- pParagraphs[ nLevel ]->ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
- aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
+ pParagraphs[ nLevel ]->ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
+ aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
}
else
pParagraphs[ nLevel ] = nullptr;
@@ -702,8 +702,8 @@ bool ImplSdPPTImport::Import()
PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_Type::Subtitle, 0 );
PPTPortionObj aPortion( *pPPTStyleSheet, TSS_Type::Subtitle, 0 );
aParagraph.AppendPortion( aPortion );
- aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
- aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
+ aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
+ aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
}
}
else if ( ePgKind == PageKind::Notes )
@@ -715,8 +715,8 @@ bool ImplSdPPTImport::Import()
PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_Type::Notes, 0 );
PPTPortionObj aPortion( *pPPTStyleSheet, TSS_Type::Notes, 0 );
aParagraph.AppendPortion( aPortion );
- aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
- aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
+ aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
+ aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
}
}
}
@@ -2439,7 +2439,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
{
if ( PPTPortionObj * pPor = pPara->First() )
{
- pPor->ApplyTo(aSet, (SdrPowerPointImport&)*this, pTextObj->GetDestinationInstance());
+ pPor->ApplyTo(aSet, const_cast<SdrPowerPointImport&>(static_cast<SdrPowerPointImport const &>(*this)), pTextObj->GetDestinationInstance());
}
}
}
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 9de47d3750b4..a871239e64a7 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -596,7 +596,7 @@ bool MotionPathTag::OnTabHandles( const KeyEvent& rKEvt )
const SdrHdlList& rHdlList = mrView.GetHdlList();
bool bForward(!rKEvt.GetKeyCode().IsShift());
- ((SdrHdlList&)rHdlList).TravelFocusHdl(bForward);
+ const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(bForward);
// guarantee visibility of focused handle
SdrHdl* pHdl = rHdlList.GetFocusHdl();
@@ -659,7 +659,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
}
if(pNewOne)
- ((SdrHdlList&)rHdlList).SetFocusHdl(pNewOne);
+ const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne);
}
}
@@ -730,7 +730,7 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)mrView.GetDragStat()).SetNoSnap();
+ const_cast<SdrDragStat&>(mrView.GetDragStat()).SetNoSnap();
if(bWasSnapEnabled)
mrView.SetSnapEnabled(false);
@@ -739,7 +739,7 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
// restore snap
if(!bWasNoSnap)
- ((SdrDragStat&)mrView.GetDragStat()).SetNoSnap(bWasNoSnap);
+ const_cast<SdrDragStat&>(mrView.GetDragStat()).SetNoSnap(bWasNoSnap);
if(bWasSnapEnabled)
mrView.SetSnapEnabled(bWasSnapEnabled);
}
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 773bfd506a7e..1e4c7c885d94 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -405,7 +405,7 @@ bool DrawDocShell::ImportFrom(SfxMedium &rMedium,
EEControlBits nControlWord = rOutl.GetEditEngine().GetControlWord();
nControlWord |= EEControlBits::ULSPACESUMMATION;
nControlWord &=~ EEControlBits::ULSPACEFIRSTPARA;
- ((EditEngine&)rOutl.GetEditEngine()).SetControlWord( nControlWord );
+ const_cast<EditEngine&>(rOutl.GetEditEngine()).SetControlWord( nControlWord );
mpDoc->SetSummationOfParagraphs();
}
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 2501ecb59fda..4494d8476e3e 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -961,7 +961,7 @@ bool FuDraw::cancel()
if(pHdl)
{
- ((SdrHdlList&)rHdlList).ResetFocusHdl();
+ const_cast<SdrHdlList&>(rHdlList).ResetFocusHdl();
}
else
{
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index 8fa2896794ef..5589ca9f0345 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -288,7 +288,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
const SdrHdlList& rHdlList = mpView->GetHdlList();
bool bForward(!rKEvt.GetKeyCode().IsShift());
- ((SdrHdlList&)rHdlList).TravelFocusHdl(bForward);
+ const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(bForward);
// guarantee visibility of focused handle
SdrHdl* pHdl = rHdlList.GetFocusHdl();
@@ -569,7 +569,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
if(pNewOne)
{
- ((SdrHdlList&)rHdlList).SetFocusHdl(pNewOne);
+ const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne);
}
}
@@ -752,7 +752,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap();
+ const_cast<SdrDragStat&>(rDragStat).SetNoSnap();
if(bWasSnapEnabled)
mpView->SetSnapEnabled(false);
@@ -761,7 +761,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// restore snap
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap(bWasNoSnap);
+ const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
if(bWasSnapEnabled)
mpView->SetSnapEnabled(bWasSnapEnabled);
}
@@ -891,7 +891,7 @@ bool FuPoor::MouseMove(const MouseEvent& )
void FuPoor::SelectionHasChanged()
{
const SdrHdlList& rHdlList = mpView->GetHdlList();
- ((SdrHdlList&)rHdlList).ResetFocusHdl();
+ const_cast<SdrHdlList&>(rHdlList).ResetFocusHdl();
}
/**