summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unodraw.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:25:48 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:53 +0100
commit01b49802c7cda7fd4d5ba71263cef7bc95234b89 (patch)
treeb8d92f1c6abf5ac548d0bcb0c581ebfcffd8bfac /sw/source/core/unocore/unodraw.cxx
parent6cd7bf2043146a630925a2e49336f02c802f707a (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
Diffstat (limited to 'sw/source/core/unocore/unodraw.cxx')
-rw-r--r--sw/source/core/unocore/unodraw.cxx88
1 files changed, 44 insertions, 44 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index fb99025e305d..5577eb249738 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -92,12 +92,12 @@ public:
SwShapeDescriptor_Impl() :
// #i32349# - no defaults, in order to determine on
// adding a shape, if positioning attributes are set or not.
- pHOrient( 0L ),
- pVOrient( 0L ),
- pAnchor(0),
- pSurround(0),
- pULSpace(0),
- pLRSpace(0),
+ pHOrient( nullptr ),
+ pVOrient( nullptr ),
+ pAnchor(nullptr),
+ pSurround(nullptr),
+ pULSpace(nullptr),
+ pLRSpace(nullptr),
bOpaque(false),
// #i26791#
mpFollowTextFlow( new SwFormatFollowTextFlow( false ) ),
@@ -240,7 +240,7 @@ public:
};
SwFmDrawPage::SwFmDrawPage( SdrPage* pPage ) :
- SvxFmDrawPage( pPage ), pPageView(0)
+ SvxFmDrawPage( pPage ), pPageView(nullptr)
{
}
@@ -273,7 +273,7 @@ void SwFmDrawPage::RemovePageView()
{
if(pPageView && mpView)
mpView->HideSdrPage();
- pPageView = 0;
+ pPageView = nullptr;
}
uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj )
@@ -313,7 +313,7 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj )
SwDoc* pDoc = pFlyFormat->GetDoc();
const SwNodeIndex* pIdx;
if( RES_FLYFRMFMT == pFlyFormat->Which()
- && 0 != ( pIdx = pFlyFormat->GetContent().GetContentIdx() )
+ && nullptr != ( pIdx = pFlyFormat->GetContent().GetContentIdx() )
&& pIdx->GetNodes().IsDocNodes()
)
{
@@ -350,15 +350,15 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj )
}
uno::Reference< XUnoTunnel > xShapeTunnel(xRet, uno::UNO_QUERY);
//don't create an SwXShape if it already exists
- SwXShape* pShape = 0;
+ SwXShape* pShape = nullptr;
if(xShapeTunnel.is())
pShape = reinterpret_cast< SwXShape * >(
sal::static_int_cast< sal_IntPtr >( xShapeTunnel->getSomething(SwXShape::getUnoTunnelId()) ));
if(!pShape)
{
- xShapeTunnel = 0;
+ xShapeTunnel = nullptr;
uno::Reference< uno::XInterface > xCreate(xRet, uno::UNO_QUERY);
- xRet = 0;
+ xRet = nullptr;
uno::Reference< beans::XPropertySet > xPrSet;
if ( pObj->IsGroupObject() && (!pObj->Is3DObj() || (dynamic_cast<const E3dScene*>( pObj) != nullptr)) )
xPrSet = new SwXGroupShape( xCreate );
@@ -466,7 +466,7 @@ uno::Sequence< OUString > SwXDrawPage::getSupportedServiceNames() throw( uno::Ru
SwXDrawPage::SwXDrawPage(SwDoc* pDc) :
pDoc(pDc),
- pDrawPage(0)
+ pDrawPage(nullptr)
{
}
@@ -542,7 +542,7 @@ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException, std::exception )
{
- return getByIndex(nIndex, 0);
+ return getByIndex(nIndex, nullptr);
}
uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex, std::set<const SwFrameFormat*>* pTextBoxes)
@@ -591,8 +591,8 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
if(!pDoc)
throw uno::RuntimeException();
uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShape, uno::UNO_QUERY);
- SwXShape* pShape = 0;
- SvxShape* pSvxShape = 0;
+ SwXShape* pShape = nullptr;
+ SvxShape* pSvxShape = nullptr;
if(xShapeTunnel.is())
{
pShape = reinterpret_cast< SwXShape * >(
@@ -701,7 +701,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
pObj->SetLayer(pDoc->getIDocumentDrawModelAccess().GetInvisibleControlsId());
SwPaM* pPam = new SwPaM(pDoc->GetNodes().GetEndOfContent());
- SwUnoInternalPaM* pInternalPam = 0;
+ SwUnoInternalPaM* pInternalPam = nullptr;
uno::Reference< text::XTextRange > xRg;
if( pDesc && (xRg = pDesc->GetTextRange()).is() )
{
@@ -794,7 +794,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
if( !bFlyInCnt )
{
UnoActionContext aContext(pDoc);
- pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr );
SwDrawContact* pContact = pDoc->GroupSelection( *pPage->GetDrawView() );
pDoc->ChgAnchor(
@@ -808,7 +808,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
uno::Reference< uno::XInterface > xInt = SwFmDrawPage::GetInterface( pContact->GetMaster() );
xRet.set(xInt, uno::UNO_QUERY);
}
- pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr );
}
}
pPage->RemovePageView();
@@ -829,13 +829,13 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & rShapeG
{
pPage->PreUnGroup(rShapeGroup);
UnoActionContext aContext(pDoc);
- pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr );
pDoc->UnGroupSelection( *pPage->GetDrawView() );
pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(),
FLY_AT_PARA,
true, false );
- pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr );
pPage->RemovePageView();
}
}
@@ -870,7 +870,7 @@ SwFmDrawPage* SwXDrawPage::GetSvxPage()
*/
void SwXDrawPage::InvalidateSwDoc()
{
- pDoc = 0;
+ pDoc = nullptr;
}
SwDoc* SwXDrawPage::GetDoc()
@@ -945,19 +945,19 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
"<SwXShape::SwXShape(..)> - no XShape found at <xShapeAgg>" );
}
}
- xShape = 0;
+ xShape = nullptr;
m_refCount++;
if( xShapeAgg.is() )
xShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) );
m_refCount--;
uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY);
- SvxShape* pShape = 0;
+ SvxShape* pShape = nullptr;
if(xShapeTunnel.is())
pShape = reinterpret_cast< SvxShape * >(
sal::static_int_cast< sal_IntPtr >( xShapeTunnel->getSomething(SvxShape::getUnoTunnelId()) ));
- SdrObject* pObj = pShape ? pShape->GetSdrObject() : 0;
+ SdrObject* pObj = pShape ? pShape->GetSdrObject() : nullptr;
if(pObj)
{
SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
@@ -980,7 +980,7 @@ void SwXShape::AddExistingShapeToFormat( SdrObject& _rObj )
if ( !pCurrent )
continue;
- SwXShape* pSwShape = NULL;
+ SwXShape* pSwShape = nullptr;
uno::Reference< lang::XUnoTunnel > xShapeTunnel( pCurrent->getWeakUnoShape(), uno::UNO_QUERY );
if ( xShapeTunnel.is() )
pSwShape = reinterpret_cast< SwXShape * >(
@@ -1118,7 +1118,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
SwXFrame* pFrame = xTunnel.is() ?
reinterpret_cast< SwXFrame * >(
sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXFrame::getUnoTunnelId()) ))
- : 0;
+ : nullptr;
if(pFrame && pFrame->GetFrameFormat() &&
pFrame->GetFrameFormat()->GetDoc() == pDoc)
{
@@ -1394,7 +1394,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
}
else
{
- SfxPoolItem* pItem = 0;
+ SfxPoolItem* pItem = nullptr;
switch(pEntry->nWID)
{
case RES_ANCHOR:
@@ -1554,7 +1554,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
= SwXTextRange::CreateXTextRange(
*pFormat->GetDoc(),
*aAnchor.GetContentAnchor(),
- 0L );
+ nullptr );
aRet.setValue(&xTextRange, cppu::UnoType<text::XTextRange>::get());
}
else
@@ -1645,7 +1645,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
}
else
{
- SfxPoolItem* pItem = 0;
+ SfxPoolItem* pItem = nullptr;
switch(pEntry->nWID)
{
case RES_ANCHOR:
@@ -1827,10 +1827,10 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
SvxShape* pSvxShape = GetSvxShape();
bool bGroupMember = false;
bool bFormControl = false;
- SdrObject* pObject = pSvxShape ? pSvxShape->GetSdrObject() : NULL;
+ SdrObject* pObject = pSvxShape ? pSvxShape->GetSdrObject() : nullptr;
if(pObject)
{
- bGroupMember = pObject->GetUpGroup() != 0;
+ bGroupMember = pObject->GetUpGroup() != nullptr;
bFormControl = pObject->GetObjInventor() == FmFormInventor;
}
const OUString* pNames = aPropertyNames.getConstArray();
@@ -1876,7 +1876,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
}
else
{
- SfxPoolItem* pItem = 0;
+ SfxPoolItem* pItem = nullptr;
switch(pEntry->nWID)
{
case RES_ANCHOR:
@@ -2087,15 +2087,15 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
// get access to SwDoc
// (see also SwXTextRange::XTextRangeToSwPaM)
- SwDoc* pDoc = 0;
+ SwDoc* pDoc = nullptr;
uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
if(xRangeTunnel.is())
{
- SwXTextRange* pRange = 0;
- OTextCursorHelper* pCursor = 0;
- SwXTextPortion* pPortion = 0;
- SwXText* pText = 0;
- SwXParagraph* pParagraph = 0;
+ SwXTextRange* pRange = nullptr;
+ OTextCursorHelper* pCursor = nullptr;
+ SwXTextPortion* pPortion = nullptr;
+ SwXText* pText = nullptr;
+ SwXParagraph* pParagraph = nullptr;
pRange = reinterpret_cast< SwXTextRange * >(
sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) ));
@@ -2162,7 +2162,7 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor() throw( uno::RuntimeExc
(rAnchor.GetContentAnchor() && !rAnchor.GetPageNum()))
{
const SwPosition &rPos = *(pFormat->GetAnchor().GetContentAnchor());
- aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), rPos, 0);
+ aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), rPos, nullptr);
}
}
else
@@ -2178,7 +2178,7 @@ void SwXShape::dispose() throw( uno::RuntimeException, std::exception )
{
// determine correct <SdrObject>
SvxShape* pSvxShape = GetSvxShape();
- SdrObject* pObj = pSvxShape ? pSvxShape->GetSdrObject() : NULL;
+ SdrObject* pObj = pSvxShape ? pSvxShape->GetSdrObject() : nullptr;
// safety assertion:
// <pObj> must be the same as <pFormat->FindSdrObject()>, if <pObj> isn't
// a 'virtual' drawing object.
@@ -2267,7 +2267,7 @@ uno::Sequence< OUString > SwXShape::getSupportedServiceNames() throw( uno::Runti
SvxShape* SwXShape::GetSvxShape()
{
- SvxShape* pSvxShape = 0;
+ SvxShape* pSvxShape = nullptr;
if(xShapeAgg.is())
{
uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY);
@@ -2444,7 +2444,7 @@ OUString SAL_CALL SwXShape::getShapeType() throw ( uno::RuntimeException, std::e
*/
SdrObject* SwXShape::_GetTopGroupObj( SvxShape* _pSvxShape )
{
- SdrObject* pTopGroupObj( 0L );
+ SdrObject* pTopGroupObj( nullptr );
SvxShape* pSvxShape = _pSvxShape ? _pSvxShape : GetSvxShape();
if ( pSvxShape )
@@ -2837,7 +2837,7 @@ void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::Ru
throw uno::RuntimeException();
uno::Reference<lang::XUnoTunnel> xTunnel(xShape, uno::UNO_QUERY);
- SwXShape* pSwShape = 0;
+ SwXShape* pSwShape = nullptr;
if(xShape.is())
pSwShape = reinterpret_cast< SwXShape * >(
sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXShape::getUnoTunnelId()) ));