summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-03 21:11:52 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-05 21:18:06 +0200
commitc03009c69deffbc9d19e0f67f9a0e114298e55c4 (patch)
treec95f9aa94521f2edb6a9ee7cc792a96cf748486b
parent760cd5b67be4225b6ff47b80a9afa97f2ddb466a (diff)
Improved loplugin:cstylecast to reference types: sc
Change-Id: I75bbb06a5dd7a458a8ddb605cd8d722b01da8f54
-rw-r--r--sc/source/core/data/column.cxx2
-rw-r--r--sc/source/core/data/documen3.cxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx2
-rw-r--r--sc/source/core/tool/autoform.cxx2
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx2
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx2
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx2
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx8
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx2
-rw-r--r--sc/source/ui/view/cellsh.cxx2
-rw-r--r--sc/source/ui/view/printfun.cxx2
13 files changed, 16 insertions, 16 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 565ce5be9afe..f0735c5a7948 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1773,7 +1773,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol )
{
DeleteArea( nStart, nEnd, InsertDeleteFlags::CONTENTS );
sc::CopyToDocContext aCxt(*pDocument);
- ((ScColumn&)rSrcCol).
+ rSrcCol.
CopyToColumn(aCxt, nStart, nEnd, InsertDeleteFlags::CONTENTS, false, *this);
// UpdateUsed not needed, already done in TestCopyScenario (obsolete comment ?)
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 14dc9c1ab0fa..4c4d25752207 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1409,7 +1409,7 @@ void ScDocument::Reorder( const sc::ReorderParam& rParam )
SCSIZE ScDocument::Query(SCTAB nTab, const ScQueryParam& rQueryParam, bool bKeepSub)
{
if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
- return maTabs[nTab]->Query((ScQueryParam&)rQueryParam, bKeepSub);
+ return maTabs[nTab]->Query(const_cast<ScQueryParam&>(rQueryParam), bKeepSub);
OSL_FAIL("missing tab");
return 0;
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 97604b507141..f7364af902b8 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -2053,7 +2053,7 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
if ( pIMapInfo )
{
Size aGraphSize;
- ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap();
+ ImageMap& rImageMap = const_cast<ImageMap&>(pIMapInfo->GetImageMap());
Graphic aGraphic;
bool bObjSupported = false;
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 6b7cd8b84452..3940631fd176 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -633,7 +633,7 @@ void ScAutoFormatData::FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, S
if( bIncludeValueFormat )
{
- ScNumFormatAbbrev& rNumFormat = (ScNumFormatAbbrev&)rField.GetNumFormat();
+ ScNumFormatAbbrev& rNumFormat = const_cast<ScNumFormatAbbrev&>(rField.GetNumFormat());
SfxUInt32Item aValueFormat( ATTR_VALUE_FORMAT, 0 );
aValueFormat.SetValue( rNumFormat.GetFormatIndex( *rDoc.GetFormatTable() ) );
rItemSet.Put( aValueFormat );
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 43e51e653886..56cbe3ba9462 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -133,7 +133,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
nMergedCols(1),
nMatrixCols(0),
nColsRepeated(1),
- rXMLImport((ScXMLImport&)rImport),
+ rXMLImport(rImport),
eGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT),
nCellType(util::NumberFormat::TEXT),
bIsMerged(false),
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 0d3b1e1747b9..43f574740e78 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -275,7 +275,7 @@ void ScTpSubTotalGroup::FillListBoxes()
i++;
}
// subsequent initialization of the constant:
- (sal_uInt16&)nFieldCount = i;
+ const_cast<sal_uInt16&>(nFieldCount) = i;
}
}
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 26d2bfd7e3f5..63adda37a3f8 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1437,7 +1437,7 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
}
- rDoc.ApplySelectionStyle( (ScStyleSheet&)*pStyleSheet, rMark );
+ rDoc.ApplySelectionStyle( *pStyleSheet, rMark );
if (!AdjustRowHeight( aMultiRange ))
rDocShell.PostPaint( aMultiRange, PaintPartFlags::Grid );
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index ed773c3ebf38..5f14c552c5ba 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1971,7 +1971,7 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
nStartCol = nEndCol;
if (nStartRow>nEndRow)
nStartRow = nEndRow;
- tools::Rectangle aNewArea = ((ScDocument&)aDocument)
+ tools::Rectangle aNewArea = aDocument
.GetMMRect( nStartCol,nStartRow, nEndCol,nEndRow, nVisTab );
//TODO/LATER: different methods for setting VisArea?!
const_cast<ScDocShell*>(this)->SfxObjectShell::SetVisArea( aNewArea );
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 8dcf933461f6..a4b096213b49 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -596,7 +596,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
bool bChanged = false;
//! GetPortions and GetAttribs should be const!
- EditEngine& rEditEng = (EditEngine&)pOutliner->GetEditEngine();
+ EditEngine& rEditEng = const_cast<EditEngine&>(pOutliner->GetEditEngine());
sal_Int32 nParCount = pOutliner->GetParagraphCount();
for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index ce68e1f9cb67..7da26ee75f5f 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -294,7 +294,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
const SdrHdlList& rHdlList = pView->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();
@@ -506,7 +506,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap();
+ const_cast<SdrDragStat&>(rDragStat).SetNoSnap();
if(bWasSnapEnabled)
pView->SetSnapEnabled(false);
@@ -515,7 +515,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
// restore snap
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap(bWasNoSnap);
+ const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
if(bWasSnapEnabled)
pView->SetSnapEnabled(bWasSnapEnabled);
}
@@ -586,7 +586,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
if(pNewOne)
{
- ((SdrHdlList&)rHdlList).SetFocusHdl(pNewOne);
+ const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne);
}
}
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index ee19ebcf9d3c..c228e2f8f4d5 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -235,7 +235,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
mknum:
if (bNumFormat)
{
- ScNumFormatAbbrev& rNumFormat = (ScNumFormatAbbrev&) pCurData->GetNumFormat(sal_uInt16(nNum));
+ ScNumFormatAbbrev& rNumFormat = const_cast<ScNumFormatAbbrev&>(pCurData->GetNumFormat(sal_uInt16(nNum)));
nNum = rNumFormat.GetFormatIndex(*pNumFmt);
}
else
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 2bc601a1ae72..202598956891 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -424,7 +424,7 @@ static bool lcl_TestFormat( SvxClipboardFormatItem& rFormats, const Transferable
if ( nFormatId == SotClipboardFormatId::EMBED_SOURCE )
{
TransferableObjectDescriptor aDesc;
- if ( ((TransferableDataHelper&)rDataHelper).GetTransferableObjectDescriptor(
+ if ( const_cast<TransferableDataHelper&>(rDataHelper).GetTransferableObjectDescriptor(
SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc ) )
aStrVal = aDesc.maTypeName;
}
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index a4edfae9770d..42c97db3185f 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1093,7 +1093,7 @@ static void lcl_DrawGraphic( const Graphic &rGraphic, vcl::RenderContext *pOut,
pOut->IntersectClipRegion( rOut );
}
- ((Graphic&)rGraphic).Draw( pOut, rGrf.TopLeft(), rGrf.GetSize() );
+ rGraphic.Draw( pOut, rGrf.TopLeft(), rGrf.GetSize() );
if ( bNotInside )
pOut->Pop();