diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:28:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:28:26 +0200 |
commit | 3fa5ac8eb9ee6c58d3733a6e2cc18f673d37565d (patch) | |
tree | d82fbe9c16be483b5fb0dbb16a86371ad2c3c302 | |
parent | loplugin:cstylecast: deal with those that are (technically) const_cast (diff) | |
download | core-3fa5ac8eb9ee6c58d3733a6e2cc18f673d37565d.tar.gz core-3fa5ac8eb9ee6c58d3733a6e2cc18f673d37565d.zip |
loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: I35229af6f25db931bd98bdf53add2f2ed65774c0
-rw-r--r-- | include/svx/svdlayer.hxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmexpl.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/fmundo.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/formcontroller.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdlayer.cxx | 2 | ||||
-rw-r--r-- | svx/source/toolbars/extrusionbar.cxx | 6 | ||||
-rw-r--r-- | svx/source/toolbars/fontworkbar.cxx | 2 |
10 files changed, 16 insertions, 16 deletions
diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx index d485ed995128..0a79bd94b5e2 100644 --- a/include/svx/svdlayer.hxx +++ b/include/svx/svdlayer.hxx @@ -137,7 +137,7 @@ public: SdrLayer* GetLayer(const OUString& rName, bool bInherited); const SdrLayer* GetLayer(const OUString& rName, bool bInherited) const; SdrLayerID GetLayerID(const OUString& rName, bool bInherited) const; - SdrLayer* GetLayerPerID(sal_uInt16 nID) { return const_cast<SdrLayer*>(((const SdrLayerAdmin*)this)->GetLayerPerID(nID)); } + SdrLayer* GetLayerPerID(sal_uInt16 nID) { return const_cast<SdrLayer*>(const_cast<const SdrLayerAdmin*>(this)->GetLayerPerID(nID)); } const SdrLayer* GetLayerPerID(sal_uInt16 nID) const; void SetControlLayerName(const OUString& rNewName); diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 95f466d27f50..29378409c3cf 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1799,7 +1799,7 @@ Sequence< Any> FmGridControl::getSelectionBookmarks() Sequence< Any> aBookmarks(nSelectedRows); if ( nSelectedRows ) { - Any* pBookmarks = (Any*)aBookmarks.getArray(); + Any* pBookmarks = aBookmarks.getArray(); // (I'm not sure if the problem isn't deeper : The szenario : a large table displayed by a grid with a // thread-safe cursor (dBase). On loading the sdb-cursor started a counting thread. While this counting progress diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 4e7cb83a9ae3..08e39326caf8 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -2667,7 +2667,7 @@ bool DbListBox::commitControl() if (static_cast<ListBox*>(m_pWindow.get())->GetSelectEntryCount()) { aSelectSeq.realloc(1); - *(sal_Int16 *)aSelectSeq.getArray() = (sal_Int16)static_cast<ListBox*>(m_pWindow.get())->GetSelectEntryPos(); + *aSelectSeq.getArray() = (sal_Int16)static_cast<ListBox*>(m_pWindow.get())->GetSelectEntryPos(); } aVal <<= aSelectSeq; m_rColumn.getModel()->setPropertyValue(FM_PROP_SELECT_SEQ, aVal); diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 354887120517..25a9da72c822 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -310,7 +310,7 @@ bool FmFormData::IsEqualWithoutChildren( FmEntryData* pEntryData ) if( !pEntryData->ISA(FmFormData) ) return false; FmFormData* pFormData = static_cast<FmFormData*>(pEntryData); - if( (XForm*)m_xForm.get() != (XForm*)pFormData->GetFormIface().get() ) + if( m_xForm.get() != pFormData->GetFormIface().get() ) return false; return FmEntryData::IsEqualWithoutChildren( pFormData ); @@ -475,7 +475,7 @@ bool FmControlData::IsEqualWithoutChildren( FmEntryData* pEntryData ) return false; FmControlData* pControlData = static_cast<FmControlData*>(pEntryData); - if( (XFormComponent*)m_xFormComponent.get() != (XFormComponent*)pControlData->GetFormComponent().get() ) + if( m_xFormComponent.get() != pControlData->GetFormComponent().get() ) return false; return FmEntryData::IsEqualWithoutChildren( pControlData ); diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 0b32ca054528..b028941dfacb 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -486,7 +486,7 @@ void FmXUndoEnvironment::Removed(FmFormObj* pObj) Reference< XIndexContainer > xForm(xContent->getParent(), UNO_QUERY); if (xForm.is()) { - Reference< XIndexAccess > xIndexAccess((XIndexContainer*)xForm.get()); + Reference< XIndexAccess > xIndexAccess(xForm.get()); // Feststellen an welcher Position sich das Kind befunden hat const sal_Int32 nPos = getElementPos(xIndexAccess, xContent); if (nPos >= 0) diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 5558b920194c..51db4998cc73 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -279,7 +279,7 @@ Reference< XFormController > getControllerSearchChildren( const Reference< XInd for (sal_Int32 n = xIndex->getCount(); n-- && !xController.is(); ) { xIndex->getByIndex(n) >>= xController; - if ((XTabControllerModel*)xModel.get() == (XTabControllerModel*)xController->getModel().get()) + if (xModel.get() == xController->getModel().get()) return xController; else { @@ -299,7 +299,7 @@ Reference< XFormController > FormViewPageWindowAdapter::getController( const Re for (::std::vector< Reference< XFormController > >::const_iterator i = m_aControllerList.begin(); i != m_aControllerList.end(); ++i) { - if ((XTabControllerModel*)(*i)->getModel().get() == (XTabControllerModel*)xModel.get()) + if ((*i)->getModel().get() == xModel.get()) return *i; // the current-round controller isn't the right one. perhaps one of its children ? diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 9e5bef901f94..e3e1127ac411 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -1634,7 +1634,7 @@ void FormController::focusGained(const FocusEvent& e) throw( RuntimeException, s // do we need to keep the locking of the commit // we hold the lock as long as the control differs from the current // otherwise we disabled the lock - m_bCommitLock = m_bCommitLock && (XControl*)xControl.get() != (XControl*)m_xCurrentControl.get(); + m_bCommitLock = m_bCommitLock && xControl.get() != m_xCurrentControl.get(); if (m_bCommitLock) return; @@ -1972,7 +1972,7 @@ void FormController::addToEventAttacher(const Reference< XControl > & xControl) for( ; nPos; ) { m_xModelAsIndex->getByIndex(--nPos) >>= xTemp; - if ((XFormComponent*)xComp.get() == (XFormComponent*)xTemp.get()) + if (xComp.get() == xTemp.get()) { m_xModelAsManager->attach( nPos, Reference<XInterface>( xControl, UNO_QUERY ), makeAny(xControl) ); break; @@ -1999,7 +1999,7 @@ void FormController::removeFromEventAttacher(const Reference< XControl > & xCont for( ; nPos; ) { m_xModelAsIndex->getByIndex(--nPos) >>= xTemp; - if ((XFormComponent*)xComp.get() == (XFormComponent*)xTemp.get()) + if (xComp.get() == xTemp.get()) { m_xModelAsManager->detach( nPos, Reference<XInterface>( xControl, UNO_QUERY ) ); break; diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx index 46092955266f..57a944fd3350 100644 --- a/svx/source/svdraw/svdlayer.cxx +++ b/svx/source/svdraw/svdlayer.cxx @@ -269,7 +269,7 @@ sal_uInt16 SdrLayerAdmin::GetLayerPos(SdrLayer* pLayer) const SdrLayer* SdrLayerAdmin::GetLayer(const OUString& rName, bool bInherited) { - return const_cast<SdrLayer*>(((const SdrLayerAdmin*)this)->GetLayer(rName, bInherited)); + return const_cast<SdrLayer*>(const_cast<const SdrLayerAdmin*>(this)->GetLayer(rName, bInherited)); } const SdrLayer* SdrLayerAdmin::GetLayer(const OUString& rName, bool /*bInherited*/) const diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index 912b8d8fa357..de50647caa53 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -108,8 +108,8 @@ void getLightingDirectionDefaults( const Direction3D **pLighting1Defaults, const Direction3D( -50000, 0, 10000 ) }; - *pLighting1Defaults = (const Direction3D *)aLighting1Defaults; - *pLighting2Defaults = (const Direction3D *)aLighting2Defaults; + *pLighting1Defaults = aLighting1Defaults; + *pLighting2Defaults = aLighting2Defaults; }; static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem& rGeometryItem, SdrObject* pObj ) @@ -591,7 +591,7 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB SvxDoubleItem aItem( fDepth, SID_EXTRUSION_DEPTH ); SfxPoolItem* aItems[] = { &aItem, 0 }; - rBindings.Execute( SID_EXTRUSION_DEPTH, (const SfxPoolItem**)aItems ); + rBindings.Execute( SID_EXTRUSION_DEPTH, const_cast<const SfxPoolItem**>(aItems) ); } } break; diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index 72b2661cfd73..7fc75ce484e5 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -497,7 +497,7 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi { SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, aDlg->getScale() ); SfxPoolItem* aItems[] = { &aItem, 0 }; - rBindings.Execute( SID_FONTWORK_CHARACTER_SPACING, (const SfxPoolItem**)aItems ); + rBindings.Execute( SID_FONTWORK_CHARACTER_SPACING, const_cast<const SfxPoolItem**>(aItems) ); } } } |