summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-08 16:28:47 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-08 16:28:47 +0200
commitb2c8ea3a0253ce87f1b292fbb19b461a53c14912 (patch)
tree853cc34d4ced72c029f9b5bc4b3077d8b1944412 /sw/source/core/unocore
parentbc2becdf1a12a1020584ee808c965e41f1837383 (diff)
loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I8d27ae80d209159690182ab91e272cf00e9f863d
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r--sw/source/core/unocore/unocoll.cxx14
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx2
-rw-r--r--sw/source/core/unocore/unodraw.cxx8
-rw-r--r--sw/source/core/unocore/unofield.cxx2
-rw-r--r--sw/source/core/unocore/unoobj2.cxx2
-rw-r--r--sw/source/core/unocore/unoportenum.cxx2
-rw-r--r--sw/source/core/unocore/unotbl.cxx4
7 files changed, 17 insertions, 17 deletions
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 8f805e537162..18606735ebf7 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -568,7 +568,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
{
SwVbaObjectForCodeNameProvider* pObjProv =
new SwVbaObjectForCodeNameProvider(rDoc.GetDocShell());
- xRet = (cppu::OWeakObject*)pObjProv;
+ xRet = static_cast<cppu::OWeakObject*>(pObjProv);
}
#endif
break;
@@ -578,7 +578,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
if (rDoc.GetDocShell() && ooo::vba::isAlienWordDoc(*rDoc.GetDocShell()))
{
SwVbaCodeNameProvider* pObjProv = new SwVbaCodeNameProvider(rDoc.GetDocShell());
- xRet = (cppu::OWeakObject*)pObjProv;
+ xRet = static_cast<cppu::OWeakObject*>(pObjProv);
}
}
#endif
@@ -702,7 +702,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
: (eFamily == SFX_STYLE_FAMILY_FRAME)
? new SwXFrameStyle(&rDoc)
: new SwXStyle(&rDoc, eFamily, nObjectType == SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE);
- xRet = (cppu::OWeakObject*)pNewStyle;
+ xRet = static_cast<cppu::OWeakObject*>(pNewStyle);
}
break;
case SW_SERVICE_FIELDTYPE_DATETIME:
@@ -794,13 +794,13 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
xRet = SwXParagraph::CreateXParagraph(rDoc, 0);
break;
case SW_SERVICE_NUMBERING_RULES :
- xRet = (cppu::OWeakObject*)new SwXNumberingRules(rDoc);
+ xRet = static_cast<cppu::OWeakObject*>(new SwXNumberingRules(rDoc));
break;
case SW_SERVICE_TEXT_COLUMNS :
- xRet = (cppu::OWeakObject*)new SwXTextColumns(0);
+ xRet = static_cast<cppu::OWeakObject*>(new SwXTextColumns(0));
break;
case SW_SERVICE_DEFAULTS:
- xRet = (cppu::OWeakObject*)new SwXTextDefaults(&rDoc);
+ xRet = static_cast<cppu::OWeakObject*>(new SwXTextDefaults(&rDoc));
break;
case SW_SERVICE_IMAP_RECTANGLE :
xRet = SvUnoImageMapRectangleObject_createInstance( sw_GetSupportedMacroItems() );
@@ -817,7 +817,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
// This should not happen during copy/paste, as this will unlink
// charts using table data.
if (rDoc.GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED)
- xRet = (cppu::OWeakObject*) rDoc.getIDocumentChartDataProviderAccess().GetChartDataProvider( true /* create - if not yet available */ );
+ xRet = static_cast<cppu::OWeakObject*>(rDoc.getIDocumentChartDataProviderAccess().GetChartDataProvider( true /* create - if not yet available */ ));
else
SAL_WARN("sw.uno",
"not creating chart data provider for embedded object");
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index e0e668b8c3a3..de3afb5f6661 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -538,7 +538,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
if( pAny )
{
const SwTableNode* pTableNode = pSttNode->FindTableNode();
- SwFrameFormat* pTableFormat = (SwFrameFormat*)pTableNode->GetTable().GetFrameFormat();
+ SwFrameFormat* pTableFormat = static_cast<SwFrameFormat*>(pTableNode->GetTable().GetFrameFormat());
//SwTable& rTable = static_cast<SwTableNode*>(pSttNode)->GetTable();
if(FN_UNO_TEXT_TABLE == rEntry.nWID)
{
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 42a8013ee4c5..d1b01a48f8cd 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -286,7 +286,7 @@ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj
SwXShape* pxShape = SwIterator<SwXShape,SwFormat>( *pFormat ).First();
if(pxShape)
{
- xShape = *(cppu::OWeakObject*)pxShape;
+ xShape = *static_cast<cppu::OWeakObject*>(pxShape);
}
else
xShape = pObj->getUnoShape();
@@ -861,7 +861,7 @@ SwFmDrawPage* SwXDrawPage::GetSvxPage()
xPageAgg = *static_cast<uno::Reference< uno::XAggregation > const *>(aAgg.getValue());
}
if( xPageAgg.is() )
- xPageAgg->setDelegator( (cppu::OWeakObject*)this );
+ xPageAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) );
}
return pDrawPage;
}
@@ -949,7 +949,7 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
xShape = 0;
m_refCount++;
if( xShapeAgg.is() )
- xShapeAgg->setDelegator( (cppu::OWeakObject*)this );
+ xShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) );
m_refCount--;
uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY);
@@ -2139,7 +2139,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
uno::Any aPos;
aPos <<= xTextRange;
setPropertyValue("TextRange", aPos);
- uno::Reference< drawing::XShape > xTemp( (cppu::OWeakObject*) this, uno::UNO_QUERY );
+ uno::Reference< drawing::XShape > xTemp( static_cast<cppu::OWeakObject*>(this), uno::UNO_QUERY );
xDP->add( xTemp );
}
}
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 4d175fb843db..6d048c959410 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2648,7 +2648,7 @@ void SwXTextField::Impl::Modify(
{
case RES_REMOVE_UNO_OBJECT:
case RES_OBJECTDYING:
- if( (void*)GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
+ if( static_cast<void*>(GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
Invalidate();
break;
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 89e716ceac83..bd09158a7301 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -290,7 +290,7 @@ void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem
{
case RES_REMOVE_UNO_OBJECT:
case RES_OBJECTDYING:
- if( (void*)pClient->GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
+ if( static_cast<void*>(pClient->GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
pClient->GetRegisteredIn()->Remove(pClient);
break;
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 8b578ff2369b..0417bbe3a093 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -1281,7 +1281,7 @@ static void lcl_CreatePortions(
lcl_FillAnnotationStartArray( *pDoc, *pUnoCrsr, AnnotationStarts );
PortionStack_t PortionStack;
- PortionStack.push( PortionList_t(&i_rPortions, (const SwTextAttr *)0) );
+ PortionStack.push( PortionList_t(&i_rPortions, nullptr) );
std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pUnoCrsr->GetNode());
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 4662759f9f56..3bcbdce084bf 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -3061,7 +3061,7 @@ sal_uInt16 SwXTextTable::getColumnCount()
void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT &&
- (void*)GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
+ static_cast<void*>(GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
GetRegisteredIn()->Remove(this);
else
ClientModify(this, pOld, pNew);
@@ -3946,7 +3946,7 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
pFrameFormat->CallSwClientNotify(aHint);
if(!aHint.m_pResult)
aHint.m_pResult = new SwXTextTableRow(pFrameFormat, pLine);
- uno::Reference<beans::XPropertySet> xRet = (beans::XPropertySet*)aHint.m_pResult;
+ uno::Reference<beans::XPropertySet> xRet = static_cast<beans::XPropertySet*>(aHint.m_pResult);
return uno::makeAny(xRet);
}