diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:25:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:50 +0100 |
commit | 6cd7bf2043146a630925a2e49336f02c802f707a (patch) | |
tree | 786cecd8ab993e25cda497d45b68007050c30d61 /svx/source/table | |
parent | 28f4bee7bd7378141d8569186162e1a3166eb012 (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I71682f28c6a54d33da6b0c971f34d0a705ff04f5
Diffstat (limited to 'svx/source/table')
-rw-r--r-- | svx/source/table/accessiblecell.cxx | 30 | ||||
-rw-r--r-- | svx/source/table/accessibletableshape.cxx | 10 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 64 | ||||
-rw-r--r-- | svx/source/table/cellcursor.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/propertyset.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 70 | ||||
-rw-r--r-- | svx/source/table/tablecolumn.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 72 | ||||
-rw-r--r-- | svx/source/table/tablehandles.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.cxx | 14 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.hxx | 4 | ||||
-rw-r--r-- | svx/source/table/tablemodel.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/tablerow.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/tablerow.hxx | 2 | ||||
-rw-r--r-- | svx/source/table/tablertfexporter.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/tablertfimporter.cxx | 14 | ||||
-rw-r--r-- | svx/source/table/tableundo.cxx | 14 | ||||
-rw-r--r-- | svx/source/table/tableundo.hxx | 4 |
18 files changed, 162 insertions, 162 deletions
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index 4f67b59654ff..74b4fa85b1d6 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -50,7 +50,7 @@ AccessibleCell::AccessibleCell( const css::uno::Reference< css::accessibility::X : AccessibleCellBase( rxParent, AccessibleRole::TABLE_CELL ) , maShapeTreeInfo( rShapeTreeInfo ) , mnIndexInParent( nIndex ) -, mpText( NULL ) +, mpText( nullptr ) , mxCell( rCell ) { //Init the pAccTable var @@ -61,7 +61,7 @@ AccessibleCell::AccessibleCell( const css::uno::Reference< css::accessibility::X AccessibleCell::~AccessibleCell() { - DBG_ASSERT( mpText == 0, "svx::AccessibleCell::~AccessibleCell(), not disposed!?" ); + DBG_ASSERT( mpText == nullptr, "svx::AccessibleCell::~AccessibleCell(), not disposed!?" ); } @@ -70,11 +70,11 @@ void AccessibleCell::Init() { SdrView* pView = maShapeTreeInfo.GetSdrView(); const vcl::Window* pWindow = maShapeTreeInfo.GetWindow (); - if( (pView != NULL) && (pWindow != NULL) && mxCell.is()) + if( (pView != nullptr) && (pWindow != nullptr) && mxCell.is()) { OutlinerParaObject* pOutlinerParaObject = mxCell->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active - bool bOwnParaObject = pOutlinerParaObject != 0; + bool bOwnParaObject = pOutlinerParaObject != nullptr; if( !pOutlinerParaObject ) pOutlinerParaObject = mxCell->GetOutlinerParaObject(); @@ -99,7 +99,7 @@ bool AccessibleCell::SetState (sal_Int16 aState) { bool bStateHasChanged = false; - if (aState == AccessibleStateType::FOCUSED && mpText != NULL) + if (aState == AccessibleStateType::FOCUSED && mpText != nullptr) { // Offer FOCUSED state to edit engine and detect whether the state // changes. @@ -119,7 +119,7 @@ bool AccessibleCell::ResetState (sal_Int16 aState) { bool bStateHasChanged = false; - if (aState == AccessibleStateType::FOCUSED && mpText != NULL) + if (aState == AccessibleStateType::FOCUSED && mpText != nullptr) { // Try to remove FOCUSED state from the edit engine and detect // whether the state changes. @@ -173,7 +173,7 @@ sal_Int32 SAL_CALL AccessibleCell::getAccessibleChildCount() throw (css::uno::Ru { SolarMutexGuard aSolarGuard; ThrowIfDisposed (); - return mpText != NULL ? mpText->GetChildCount () : 0; + return mpText != nullptr ? mpText->GetChildCount () : 0; } @@ -204,7 +204,7 @@ Reference<XAccessibleStateSet> SAL_CALL AccessibleCell::getAccessibleStateSet() ::osl::MutexGuard aGuard (maMutex); Reference<XAccessibleStateSet> xStateSet; - if (rBHelper.bDisposed || mpText == NULL) + if (rBHelper.bDisposed || mpText == nullptr) { // Return a minimal state set that only contains the DEFUNC state. xStateSet = AccessibleContextBase::getAccessibleStateSet (); @@ -216,7 +216,7 @@ Reference<XAccessibleStateSet> SAL_CALL AccessibleCell::getAccessibleStateSet() if(pStateSet) { // Merge current FOCUSED state from edit engine. - if (mpText != NULL) + if (mpText != nullptr) { if (mpText->HaveFocus()) pStateSet->AddState (AccessibleStateType::FOCUSED); @@ -326,7 +326,7 @@ css::awt::Rectangle SAL_CALL AccessibleCell::getBounds() throw(RuntimeException, const ::Rectangle aCellRect( mxCell->getCellRect() ); // Transform coordinates from internal to pixel. - if (maShapeTreeInfo.GetViewForwarder() == NULL) + if (maShapeTreeInfo.GetViewForwarder() == nullptr) throw uno::RuntimeException ("AccessibleCell has no valid view forwarder",static_cast<uno::XWeak*>(this)); ::Size aPixelSize( maShapeTreeInfo.GetViewForwarder()->LogicToPixel(::Size(aCellRect.GetWidth(), aCellRect.GetHeight())) ); @@ -485,7 +485,7 @@ void SAL_CALL AccessibleCell::addAccessibleEventListener( const Reference<XAcces else { AccessibleContextBase::addAccessibleEventListener (rxListener); - if (mpText != NULL) + if (mpText != nullptr) mpText->AddEventListener (rxListener); } } @@ -496,7 +496,7 @@ void SAL_CALL AccessibleCell::removeAccessibleEventListener( const Reference<XAc { SolarMutexGuard aSolarGuard; AccessibleContextBase::removeAccessibleEventListener(rxListener); - if (mpText != NULL) + if (mpText != nullptr) mpText->RemoveEventListener (rxListener); } @@ -553,14 +553,14 @@ void AccessibleCell::disposing() // Make sure to send an event that this object loses the focus in the // case that it has the focus. ::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get()); - if (pStateSet != NULL) + if (pStateSet != nullptr) pStateSet->RemoveState(AccessibleStateType::FOCUSED); - if (mpText != NULL) + if (mpText != nullptr) { mpText->Dispose(); delete mpText; - mpText = NULL; + mpText = nullptr; } // Cleanup. Remove references to objects to allow them to be diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx index 0bea6de4c68c..ce4396987f50 100644 --- a/svx/source/table/accessibletableshape.cxx +++ b/svx/source/table/accessibletableshape.cxx @@ -342,7 +342,7 @@ SvxTableController* AccessibleTableShape::getTableController() if( pView ) return dynamic_cast< SvxTableController* >( pView->getSelectionController().get() ); else - return 0; + return nullptr; } @@ -961,7 +961,7 @@ void SAL_CALL AccessibleTableShape::selectionChanged (const EventObject& rEvent AccessibleCell* AccessibleTableShape::GetActiveAccessibleCell() { Reference< AccessibleCell > xAccCell; - AccessibleCell* pAccCell = NULL; + AccessibleCell* pAccCell = nullptr; SvxTableController* pController = getTableController(); if (pController) { @@ -990,7 +990,7 @@ bool AccessibleTableShape::SetState (sal_Int16 aState) { AccessibleCell* pActiveAccessibleCell = GetActiveAccessibleCell(); bool bStateHasChanged = false; - if (aState == AccessibleStateType::FOCUSED && pActiveAccessibleCell != NULL) + if (aState == AccessibleStateType::FOCUSED && pActiveAccessibleCell != nullptr) { return pActiveAccessibleCell->SetState(aState); } @@ -1004,7 +1004,7 @@ bool AccessibleTableShape::ResetState (sal_Int16 aState) { AccessibleCell* pActiveAccessibleCell = GetActiveAccessibleCell(); bool bStateHasChanged = false; - if (aState == AccessibleStateType::FOCUSED && pActiveAccessibleCell != NULL) + if (aState == AccessibleStateType::FOCUSED && pActiveAccessibleCell != nullptr) { return pActiveAccessibleCell->ResetState(aState); } @@ -1039,7 +1039,7 @@ AccessibleTableHeaderShape::AccessibleTableHeaderShape( AccessibleTableShape* pT AccessibleTableHeaderShape::~AccessibleTableHeaderShape() { - mpTable = NULL; + mpTable = nullptr; } // XAccessible diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 61418a29e1aa..6b70d0806e13 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -225,7 +225,7 @@ namespace sdr BaseProperties& CellProperties::Clone(SdrObject& rObj) const { OSL_FAIL("CellProperties::Clone(), does not work yet!"); - return *(new CellProperties(*this, rObj,0)); + return *(new CellProperties(*this, rObj,nullptr)); } void CellProperties::ForceDefaultAttributes() @@ -240,15 +240,15 @@ namespace sdr { OutlinerParaObject* pParaObj = mxCell->GetEditOutlinerParaObject(); - bool bOwnParaObj = pParaObj != 0; + bool bOwnParaObj = pParaObj != nullptr; - if( pParaObj == 0 ) + if( pParaObj == nullptr ) pParaObj = mxCell->GetOutlinerParaObject(); if(pParaObj) { // handle outliner attributes - Outliner* pOutliner = 0; + Outliner* pOutliner = nullptr; if(mxCell->IsTextEditActive()) { @@ -321,7 +321,7 @@ namespace sdr // Set a cell vertical property OutlinerParaObject* pParaObj = mxCell->GetEditOutlinerParaObject(); - if( pParaObj == 0 ) + if( pParaObj == nullptr ) pParaObj = mxCell->GetOutlinerParaObject(); if(pParaObj) { @@ -405,9 +405,9 @@ void Cell::dispose() if( mpProperties ) { delete mpProperties; - mpProperties = 0; + mpProperties = nullptr; } - SetOutlinerParaObject( 0 ); + SetOutlinerParaObject( nullptr ); } @@ -435,7 +435,7 @@ void Cell::SetModel(SdrModel* pNewModel) SetEditSource( new SvxTextEditSource( &GetObject(), this ) ); } - SetStyleSheet( 0, true ); + SetStyleSheet( nullptr, true ); SdrText::SetModel( pNewModel ); ForceOutlinerParaObject( OUTLINERMODE_TEXTOBJECT ); } @@ -517,7 +517,7 @@ void Cell::replaceContentAndFormating( const CellRef& xSourceCell ) if(rSourceTableObj.GetModel() != rTableObj.GetModel()) { - SetStyleSheet( 0, true ); + SetStyleSheet( nullptr, true ); } } } @@ -546,7 +546,7 @@ void Cell::copyFormatFrom( const CellRef& xSourceCell ) if(rSourceTableObj.GetModel() != rTableObj.GetModel()) { - SetStyleSheet( 0, true ); + SetStyleSheet( nullptr, true ); } notifyModified(); @@ -572,7 +572,7 @@ bool Cell::IsTextEditActive() if(rTableObj.getActiveCell().get() == this ) { OutlinerParaObject* pParaObj = rTableObj.GetEditOutlinerParaObject(); - if( pParaObj != 0 ) + if( pParaObj != nullptr ) { isActive = true; delete pParaObj; @@ -610,7 +610,7 @@ OutlinerParaObject* Cell::GetEditOutlinerParaObject() const SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() ); if( rTableObj.getActiveCell().get() == this ) return rTableObj.GetEditOutlinerParaObject(); - return 0; + return nullptr; } @@ -661,7 +661,7 @@ SfxStyleSheet* Cell::GetStyleSheet() const if( mpProperties ) return mpProperties->GetStyleSheet(); else - return 0; + return nullptr; } void Cell::TakeTextAnchorRect(Rectangle& rAnchorRect) const @@ -786,7 +786,7 @@ void Cell::SetOutlinerParaObject( OutlinerParaObject* pTextObject ) SdrText::SetOutlinerParaObject( pTextObject ); maSelection.nStartPara = EE_PARA_MAX_COUNT; - if( pTextObject == 0 ) + if( pTextObject == nullptr ) ForceOutlinerParaObject( OUTLINERMODE_TEXTOBJECT ); } @@ -809,7 +809,7 @@ sdr::properties::TextProperties* Cell::CloneProperties( sdr::properties::TextPro if( pProperties ) return new sdr::properties::CellProperties( *static_cast<sdr::properties::CellProperties*>(pProperties), rNewObj, &rNewCell ); else - return 0; + return nullptr; } @@ -1016,7 +1016,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& { ::SolarMutexGuard aGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(rPropertyName); @@ -1043,7 +1043,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& break; const TableBorder* pBorder = static_cast<const TableBorder*>(rValue.getValue()); - if( pBorder == NULL ) + if( pBorder == nullptr ) break; SvxBoxItem aBox( SDRATTR_TABLE_BORDER ); @@ -1051,27 +1051,27 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& SvxBorderLine aLine; bool bSet = SvxBoxItem::LineToSvxLine(pBorder->TopLine, aLine, false); - aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::TOP); + aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::TOP); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::TOP, pBorder->IsTopLineValid); bSet = SvxBoxItem::LineToSvxLine(pBorder->BottomLine, aLine, false); - aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::BOTTOM); + aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::BOTTOM); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::BOTTOM, pBorder->IsBottomLineValid); bSet = SvxBoxItem::LineToSvxLine(pBorder->LeftLine, aLine, false); - aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::LEFT); + aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::LEFT); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::LEFT, pBorder->IsLeftLineValid); bSet = SvxBoxItem::LineToSvxLine(pBorder->RightLine, aLine, false); - aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::RIGHT); + aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::RIGHT); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::RIGHT, pBorder->IsRightLineValid); bSet = SvxBoxItem::LineToSvxLine(pBorder->HorizontalLine, aLine, false); - aBoxInfo.SetLine(bSet ? &aLine : 0, SvxBoxInfoItemLine::HORI); + aBoxInfo.SetLine(bSet ? &aLine : nullptr, SvxBoxInfoItemLine::HORI); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI, pBorder->IsHorizontalLineValid); bSet = SvxBoxItem::LineToSvxLine(pBorder->VerticalLine, aLine, false); - aBoxInfo.SetLine(bSet ? &aLine : 0, SvxBoxInfoItemLine::VERT); + aBoxInfo.SetLine(bSet ? &aLine : nullptr, SvxBoxInfoItemLine::VERT); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT, pBorder->IsVerticalLineValid); aBox.SetDistance(pBorder->Distance); //TODO @@ -1161,7 +1161,7 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName ) throw(Unknow { ::SolarMutexGuard aGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName); @@ -1271,7 +1271,7 @@ void SAL_CALL Cell::setPropertyValues( const Sequence< OUString >& aPropertyName { ::SolarMutexGuard aSolarGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const sal_Int32 nCount = aPropertyNames.getLength(); @@ -1302,7 +1302,7 @@ Sequence< Any > SAL_CALL Cell::getPropertyValues( const Sequence< OUString >& aP { ::SolarMutexGuard aSolarGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const sal_Int32 nCount = aPropertyNames.getLength(); @@ -1356,7 +1356,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th { ::SolarMutexGuard aGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName); @@ -1426,7 +1426,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th case XATTR_LINEDASH: { const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); - if( ( pItem == NULL ) || pItem->GetName().isEmpty() ) + if( ( pItem == nullptr ) || pItem->GetName().isEmpty() ) eState = PropertyState_DEFAULT_VALUE; } break; @@ -1441,7 +1441,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th case XATTR_FILLFLOATTRANSPARENCE: { const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); - if( pItem == NULL ) + if( pItem == nullptr ) eState = PropertyState_DEFAULT_VALUE; } break; @@ -1460,7 +1460,7 @@ Sequence< PropertyState > SAL_CALL Cell::getPropertyStates( const Sequence< OUSt { ::SolarMutexGuard aGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const sal_Int32 nCount = aPropertyName.getLength(); @@ -1491,7 +1491,7 @@ void SAL_CALL Cell::setPropertyToDefault( const OUString& PropertyName ) throw(U { ::SolarMutexGuard aGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName); @@ -1533,7 +1533,7 @@ Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName ) throw(Unk { ::SolarMutexGuard aGuard; - if( (mpProperties == 0) || (GetModel() == 0) ) + if( (mpProperties == nullptr) || (GetModel() == nullptr) ) throw DisposedException(); const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(aPropertyName); diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx index 70a572c72ea8..04620251ad21 100644 --- a/svx/source/table/cellcursor.cxx +++ b/svx/source/table/cellcursor.cxx @@ -247,7 +247,7 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException, if( !GetMergedSelection( aStart, aEnd ) ) throw NoSupportException(); - if( !mxTable.is() || (mxTable->getSdrTableObj() == 0) ) + if( !mxTable.is() || (mxTable->getSdrTableObj() == nullptr) ) throw DisposedException(); SdrModel* pModel = mxTable->getSdrTableObj()->GetModel(); @@ -513,7 +513,7 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No if( (nColumns < 0) || (nRows < 0) ) throw IllegalArgumentException(); - if( !mxTable.is() || (mxTable->getSdrTableObj() == 0) ) + if( !mxTable.is() || (mxTable->getSdrTableObj() == nullptr) ) throw DisposedException(); SdrModel* pModel = mxTable->getSdrTableObj()->GetModel(); diff --git a/svx/source/table/propertyset.cxx b/svx/source/table/propertyset.cxx index 25302611510d..81bbc8b2bdb7 100644 --- a/svx/source/table/propertyset.cxx +++ b/svx/source/table/propertyset.cxx @@ -69,7 +69,7 @@ const Property* FastPropertySetInfo::hasProperty( const OUString& aName ) { PropertyMap::iterator aIter( maMap.find( aName ) ); if( aIter == maMap.end() ) - return 0; + return nullptr; else return &maProperties[(*aIter).second]; } @@ -94,7 +94,7 @@ Property SAL_CALL FastPropertySetInfo::getPropertyByName( const OUString& aName sal_Bool SAL_CALL FastPropertySetInfo::hasPropertyByName( const OUString& aName ) throw (RuntimeException, std::exception) { - return hasProperty( aName ) != 0; + return hasProperty( aName ) != nullptr; } FastPropertySet::FastPropertySet( const rtl::Reference< FastPropertySetInfo >& xInfo ) diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 3b6d0f239c1c..0a24b8feb793 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -250,7 +250,7 @@ private: static sal_Int32 lastColCount; }; -SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = NULL; +SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = nullptr; Rectangle SdrTableObjImpl::lastLayoutInputRectangle; Rectangle SdrTableObjImpl::lastLayoutResultRectangle; bool SdrTableObjImpl::lastLayoutFitWidth; @@ -260,8 +260,8 @@ sal_Int32 SdrTableObjImpl::lastRowCount; sal_Int32 SdrTableObjImpl::lastColCount; SdrTableObjImpl::SdrTableObjImpl() -: mpTableObj( 0 ) -, mpLayouter( 0 ) +: mpTableObj( nullptr ) +, mpLayouter( nullptr ) , mbModifyPending( false ) { } @@ -271,7 +271,7 @@ SdrTableObjImpl::SdrTableObjImpl() SdrTableObjImpl::~SdrTableObjImpl() { if( lastLayoutTable == this ) - lastLayoutTable = NULL; + lastLayoutTable = nullptr; } @@ -299,7 +299,7 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) if( mpLayouter ) { delete mpLayouter; - mpLayouter = 0; + mpLayouter = nullptr; } if( mxTable.is() ) @@ -474,7 +474,7 @@ void SdrTableObjImpl::dispose() if( mpLayouter ) { delete mpLayouter; - mpLayouter = 0; + mpLayouter = nullptr; } if( mxTable.is() ) @@ -651,9 +651,9 @@ void SAL_CALL SdrTableObjImpl::disposing( const css::lang::EventObject& /*Source if( mpLayouter ) { delete mpLayouter; - mpLayouter = 0; + mpLayouter = nullptr; } - mpTableObj = 0; + mpTableObj = nullptr; } @@ -1247,7 +1247,7 @@ SdrText* SdrTableObj::getText( sal_Int32 nIndex ) const return dynamic_cast< SdrText* >( xCell.get() ); } } - return 0; + return nullptr; } @@ -1305,7 +1305,7 @@ SdrOutliner* SdrTableObj::GetCellTextEditOutliner( const Cell& rCell ) const if( mpImpl && (mpImpl->getCell( mpImpl->maEditPos ).get() == &rCell) ) return pEdtOutl; else - return 0; + return nullptr; } const TableLayouter& SdrTableObj::getTableLayouter() const @@ -1480,7 +1480,7 @@ void SdrTableObj::TakeTextRect( const CellPos& rPos, SdrOutliner& rOutliner, Rec } else { - rOutliner.SetTextObj( NULL ); + rOutliner.SetTextObj( nullptr ); } if (pEdtOutl && !bNoEditText && pPara && mpImpl->mxActiveCell == xCell ) @@ -1622,7 +1622,7 @@ void SdrTableObj::TakeTextEditArea( const CellPos& rPos, Size* pPaperMin, Size* aAnkSiz.Width()--; aAnkSiz.Height()--; // weil GetSize() ein draufaddiert Size aMaxSiz(aAnkSiz.Width(),1000000); - if (pModel!=NULL) + if (pModel!=nullptr) { Size aTmpSiz(pModel->GetMaxObjSize()); if (aTmpSiz.Height()!=0) @@ -1636,7 +1636,7 @@ void SdrTableObj::TakeTextEditArea( const CellPos& rPos, Size* pPaperMin, Size* aPaperMin.Width() = aAnkSiz.Width(); - if (pViewMin!=NULL) + if (pViewMin!=nullptr) { *pViewMin=aViewInit; long nYFree=aAnkSiz.Height()-aPaperMin.Height(); @@ -1662,9 +1662,9 @@ void SdrTableObj::TakeTextEditArea( const CellPos& rPos, Size* pPaperMin, Size* else aPaperMin.Height() = 0; - if (pPaperMin!=NULL) *pPaperMin=aPaperMin; - if (pPaperMax!=NULL) *pPaperMax=aPaperMax; - if (pViewInit!=NULL) *pViewInit=aViewInit; + if (pPaperMin!=nullptr) *pPaperMin=aPaperMin; + if (pPaperMax!=nullptr) *pPaperMax=aPaperMax; + if (pViewInit!=nullptr) *pViewInit=aViewInit; } @@ -1739,7 +1739,7 @@ SdrTableObj& SdrTableObj::operator=(const SdrTableObj& rObj) // call parent SdrObject::operator=(rObj); - TableModelNotifyGuard aGuard( mpImpl ? mpImpl->mxTable.get() : 0 ); + TableModelNotifyGuard aGuard( mpImpl ? mpImpl->mxTable.get() : nullptr ); maLogicRect = rObj.maLogicRect; maRect = rObj.maRect; @@ -1818,7 +1818,7 @@ Point SdrTableObj::GetSnapPoint(sal_uInt32 i) const bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl) { - if( pEdtOutl != NULL ) + if( pEdtOutl != nullptr ) return false; pEdtOutl=&rOutl; @@ -1833,7 +1833,7 @@ bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl) Size aPaperMin; Size aPaperMax; Rectangle aEditArea; - TakeTextEditArea(&aPaperMin,&aPaperMax,&aEditArea,NULL); + TakeTextEditArea(&aPaperMin,&aPaperMax,&aEditArea,nullptr); rOutl.SetMinAutoPaperSize(aPaperMin); rOutl.SetMaxAutoPaperSize(aPaperMax); @@ -1865,7 +1865,7 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl) if( GetModel() && GetModel()->IsUndoEnabled() ) GetModel()->AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*this) ); - OutlinerParaObject* pNewText = 0; + OutlinerParaObject* pNewText = nullptr; Paragraph* p1stPara = rOutl.GetParagraph( 0 ); sal_Int32 nParaAnz = rOutl.GetParagraphCount(); @@ -1894,7 +1894,7 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl) SetOutlinerParaObject(pNewText); } - pEdtOutl = 0; + pEdtOutl = nullptr; rOutl.Clear(); EEControlBits nStat = rOutl.GetControlWord(); nStat &= ~EEControlBits::AUTOPAGESIZE; @@ -1911,7 +1911,7 @@ OutlinerParaObject* SdrTableObj::GetOutlinerParaObject() const if( xCell.is() ) return xCell->GetOutlinerParaObject(); else - return 0; + return nullptr; } @@ -1926,7 +1926,7 @@ void SdrTableObj::NbcSetOutlinerParaObject( OutlinerParaObject* pTextObject) // Update HitTestOutliner const SdrTextObj* pTestObj = pModel->GetHitTestOutliner().GetTextObj(); if( pTestObj && pTestObj->GetOutlinerParaObject() == xCell->GetOutlinerParaObject() ) - pModel->GetHitTestOutliner().SetTextObj( NULL ); + pModel->GetHitTestOutliner().SetTextObj( nullptr ); } xCell->SetOutlinerParaObject( pTextObject ); @@ -1990,7 +1990,7 @@ bool SdrTableObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) if (bRet) { Rectangle aBoundRect0; - if (pUserCall!=NULL) + if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); maRect = aNeuRect; SetRectsDirty(); @@ -2005,7 +2005,7 @@ bool SdrTableObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) bool SdrTableObj::AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHeight, bool bWidth) const { - if((pModel == NULL) || rR.IsEmpty() || !mpImpl || !mpImpl->mxTable.is() ) + if((pModel == nullptr) || rR.IsEmpty() || !mpImpl || !mpImpl->mxTable.is() ) return false; Rectangle aRectangle( rR ); @@ -2034,7 +2034,7 @@ void SdrTableObj::NbcReformatText() void SdrTableObj::ReformatText() { Rectangle aBoundRect0; - if (pUserCall!=NULL) + if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); NbcReformatText(); SetChanged(); @@ -2189,13 +2189,13 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const if( nRowHeight > 0 ) { if( rLayouter.isEdgeVisible( nCol, nRow, false ) ) - aColEdges[nCol]->SetEdge( nRow, nY, nY + nRowHeight, (rLayouter.getBorderLine( nCol, nRow, false ) == 0) ? Visible : Invisible); + aColEdges[nCol]->SetEdge( nRow, nY, nY + nRowHeight, (rLayouter.getBorderLine( nCol, nRow, false ) == nullptr) ? Visible : Invisible); } if( nColWidth > 0 ) { if( rLayouter.isEdgeVisible( nCol, nRow, true ) ) - aRowEdges[nRow]->SetEdge( nCol, nX, nX + nColWidth, (rLayouter.getBorderLine( nCol, nRow, true ) == 0) ? Visible : Invisible); + aRowEdges[nRow]->SetEdge( nCol, nX, nX + nColWidth, (rLayouter.getBorderLine( nCol, nRow, true ) == nullptr) ? Visible : Invisible); } nX += nColWidth; @@ -2206,7 +2206,7 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const } // add remaining handles - SdrHdl* pH=0; + SdrHdl* pH=nullptr; rHdlList.AddHdl( pH = new TableBorderHdl( maRect, !IsTextEditActive() ) ); pH->SetMoveOutside( true ); rHdlList.AddHdl( pH = new SdrHdl(maRect.TopLeft(),HDL_UPLFT) ); pH->SetMoveOutside( true ); rHdlList.AddHdl( pH = new SdrHdl(maRect.TopCenter(),HDL_UPPER) ); pH->SetMoveOutside( true ); @@ -2229,8 +2229,8 @@ SdrHdl* SdrTableObj::GetHdl(sal_uInt32 nHdlNum) const OSL_FAIL("SdrTableObj::GetHdl(): ineffective, use AddToHdlList instead (!)"); // to have an alternative, get single handle using the ineffective way - SdrHdl* pRetval = 0; - SdrHdlList aLocalList(0); + SdrHdl* pRetval = nullptr; + SdrHdlList aLocalList(nullptr); AddToHdlList(aLocalList); const size_t nHdlCount(aLocalList.GetHdlCount()); @@ -2255,7 +2255,7 @@ bool SdrTableObj::hasSpecialDrag() const bool SdrTableObj::beginSpecialDrag(SdrDragStat& rDrag) const { const SdrHdl* pHdl = rDrag.GetHdl(); - const SdrHdlKind eHdl((pHdl == NULL) ? HDL_MOVE : pHdl->GetKind()); + const SdrHdlKind eHdl((pHdl == nullptr) ? HDL_MOVE : pHdl->GetKind()); switch( eHdl ) { @@ -2292,7 +2292,7 @@ bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag) { bool bRet(true); const SdrHdl* pHdl = rDrag.GetHdl(); - const SdrHdlKind eHdl((pHdl == NULL) ? HDL_MOVE : pHdl->GetKind()); + const SdrHdlKind eHdl((pHdl == nullptr) ? HDL_MOVE : pHdl->GetKind()); switch( eHdl ) { @@ -2444,7 +2444,7 @@ Pointer SdrTableObj::GetCreatePointer() const void SdrTableObj::createCell( CellRef& xNewCell ) { - xNewCell = Cell::create( *this, 0 ); + xNewCell = Cell::create( *this, nullptr ); } @@ -2496,7 +2496,7 @@ SdrTableObj* SdrTableObj::CloneRange( const CellPos& rStart, const CellPos& rEnd if( !xTable.is() || !xNewTable.is() ) { delete pNewTableObj; - return 0; + return nullptr; } // copy cells diff --git a/svx/source/table/tablecolumn.cxx b/svx/source/table/tablecolumn.cxx index f94147da46b5..8f48aad20184 100644 --- a/svx/source/table/tablecolumn.cxx +++ b/svx/source/table/tablecolumn.cxx @@ -151,7 +151,7 @@ void SAL_CALL TableColumn::setFastPropertyValue( sal_Int32 nHandle, const Any& a SdrModel* pModel = mxTableModel->getSdrTableObj()->GetModel(); - TableColumnUndo* pUndo = 0; + TableColumnUndo* pUndo = nullptr; if( mxTableModel.is() && mxTableModel->getSdrTableObj() && mxTableModel->getSdrTableObj()->IsInserted() && pModel && pModel->IsUndoEnabled() ) { TableColumnRef xThis( this ); @@ -223,7 +223,7 @@ void SAL_CALL TableColumn::setFastPropertyValue( sal_Int32 nHandle, const Any& a if( pUndo ) { pModel->AddUndo( pUndo ); - pUndo = 0; + pUndo = nullptr; } mxTableModel->setModified(sal_True); } diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index ac3ed92595fb..0238e851e4ff 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -115,7 +115,7 @@ void SAL_CALL SvxTableControllerModifyListener::modified( const css::lang::Event void SAL_CALL SvxTableControllerModifyListener::disposing( const css::lang::EventObject& ) throw (css::uno::RuntimeException, std::exception) { - mpController = 0; + mpController = nullptr; } @@ -145,11 +145,11 @@ rtl::Reference< sdr::SelectionController > SvxTableController::create( SdrObjEdi SvxTableController::SvxTableController( SdrObjEditView* pView, const SdrObject* pObj ) : mbCellSelectionMode(false) , mbLeftButtonDown(false) -, mpSelectionOverlay(0) +, mpSelectionOverlay(nullptr) , mpView( dynamic_cast< SdrView* >( pView ) ) , mxTableObj( dynamic_cast< SdrTableObj* >( const_cast< SdrObject* >( pObj ) ) ) -, mpModel( 0 ) -, mnUpdateEvent( 0 ) +, mpModel( nullptr ) +, mnUpdateEvent( nullptr ) { if( pObj ) { @@ -287,7 +287,7 @@ bool SvxTableController::onMouseButtonDown(const MouseEvent& rMEvt, vcl::Window* RemoveSelection(); Point aPnt(rMEvt.GetPosPixel()); - if (pWindow!=NULL) + if (pWindow!=nullptr) aPnt=pWindow->PixelToLogic(aPnt); SdrHdl* pHdl = mpView->PickHandle(aPnt); @@ -530,7 +530,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs ) sal_uInt16 nCount = 0; if( pArgs ) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; pArgs->GetItemState(nSId, false, &pItem); if (pItem) { @@ -881,7 +881,7 @@ void SvxTableController::onSelect( sal_uInt16 nSId ) } StartSelection( aEnd ); - gotoCell( aStart, true, 0 ); + gotoCell( aStart, true, nullptr ); } } } @@ -923,7 +923,7 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) aNewAttr.Put( aBoxInfoItem ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr< SfxAbstractTabDialog > xDlg( pFact ? pFact->CreateSvxFormatCellsDialog( NULL, &aNewAttr, pTableObj->GetModel(), pTableObj) : 0 ); + std::unique_ptr< SfxAbstractTabDialog > xDlg( pFact ? pFact->CreateSvxFormatCellsDialog( nullptr, &aNewAttr, pTableObj->GetModel(), pTableObj) : nullptr ); // Even Cancel Button is returning positive(101) value, if (xDlg.get() && xDlg->Execute() == RET_OK) { @@ -1043,7 +1043,7 @@ void SvxTableController::Execute( SfxRequest& rReq ) void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) { SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( mxTableObj.get() ); - SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0; + SdrModel* pModel = pTableObj ? pTableObj->GetModel() : nullptr; if( !pTableObj || !pModel || !pArgs || (SfxItemState::SET != pArgs->GetItemState(SID_TABLE_STYLE, false)) ) return; @@ -1126,14 +1126,14 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) void SvxTableController::SetTableStyleSettings( const SfxItemSet* pArgs ) { SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( mxTableObj.get() ); - SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0; + SdrModel* pModel = pTableObj ? pTableObj->GetModel() : nullptr; if( !pTableObj || !pModel ) return; TableStyleSettings aSettings( pTableObj->getTableStyleSettings() ); - const SfxPoolItem *pPoolItem=NULL; + const SfxPoolItem *pPoolItem=nullptr; if( (SfxItemState::SET == pArgs->GetItemState(ID_VAL_USEFIRSTROWSTYLE, false,&pPoolItem)) ) aSettings.mbUseFirstRow = static_cast< const SfxBoolItem* >(pPoolItem)->GetValue(); @@ -1234,7 +1234,7 @@ void SvxTableController::SplitMarkedCells() getSelectedCells( aStart, aEnd ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr< SvxAbstractSplittTableDialog > xDlg( pFact ? pFact->CreateSvxSplittTableDialog( NULL, false, 99, 99 ) : 0 ); + std::unique_ptr< SvxAbstractSplittTableDialog > xDlg( pFact ? pFact->CreateSvxSplittTableDialog( nullptr, false, 99, 99 ) : nullptr ); if( xDlg.get() && xDlg->Execute() ) { const sal_Int32 nCount = xDlg->GetCount() - 1; @@ -1351,7 +1351,7 @@ bool SvxTableController::DeleteMarked() { if (bUndo) xCell->AddUndo(); - xCell->SetOutlinerParaObject(0); + xCell->SetOutlinerParaObject(nullptr); } } } @@ -1367,11 +1367,11 @@ bool SvxTableController::GetStyleSheet( SfxStyleSheet*& rpStyleSheet ) const { if( hasSelectedCells() ) { - rpStyleSheet = 0; + rpStyleSheet = nullptr; if( mxTable.is() ) { - SfxStyleSheet* pRet=0; + SfxStyleSheet* pRet=nullptr; bool b1st=true; CellPos aStart, aEnd; @@ -1701,7 +1701,7 @@ bool SvxTableController::executeAction( sal_uInt16 nAction, bool bSelect, vcl::W } case ACTION_EDIT_CELL: - EditCell( getSelectionStart(), pWindow, 0, nAction ); + EditCell( getSelectionStart(), pWindow, nullptr, nAction ); break; case ACTION_STOP_TEXT_EDIT: @@ -1763,7 +1763,7 @@ void SvxTableController::gotoCell( const CellPos& rPos, bool bSelect, vcl::Windo else { RemoveSelection(); - EditCell( rPos, pWindow, 0, nAction ); + EditCell( rPos, pWindow, nullptr, nAction ); } } @@ -1894,7 +1894,7 @@ void SvxTableController::EditCell( const CellPos& rPos, vcl::Window* pWindow, co pTableObj->setActiveCell( aPos ); // create new outliner, owner will be the SdrObjEditView - SdrOutliner* pOutl = mpModel ? SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *mpModel) : NULL; + SdrOutliner* pOutl = mpModel ? SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *mpModel) : nullptr; if (pOutl && pTableObj->IsVerticalWriting()) pOutl->SetVertical( true ); @@ -2114,7 +2114,7 @@ void SvxTableController::RemoveSelection() void SvxTableController::onTableModified() { - if( mnUpdateEvent == 0 ) + if( mnUpdateEvent == nullptr ) mnUpdateEvent = Application::PostUserEvent( LINK( this, SvxTableController, UpdateHdl ) ); } @@ -2200,7 +2200,7 @@ void SvxTableController::destroySelectionOverlay() if( mpSelectionOverlay ) { delete mpSelectionOverlay; - mpSelectionOverlay = 0; + mpSelectionOverlay = nullptr; if (mxTableObj->GetModel()->isTiledRendering()) { @@ -2297,12 +2297,12 @@ static void ImplApplyBoxItem( sal_uInt16 nCellFlags, const SvxBoxItem* pBoxItem, if( nCellFlags & CELL_UPPER ) { if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::TOP) ) - rNewFrame.SetLine(0, SvxBoxItemLine::BOTTOM ); + rNewFrame.SetLine(nullptr, SvxBoxItemLine::BOTTOM ); } else if( nCellFlags & CELL_LOWER ) { if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::BOTTOM) ) - rNewFrame.SetLine( 0, SvxBoxItemLine::TOP ); + rNewFrame.SetLine( nullptr, SvxBoxItemLine::TOP ); } } else if( (nCellFlags & ( CELL_UPPER|CELL_LOWER)) == 0 ) // check if its not sw or se corner @@ -2310,12 +2310,12 @@ static void ImplApplyBoxItem( sal_uInt16 nCellFlags, const SvxBoxItem* pBoxItem, if( nCellFlags & CELL_BEFORE ) { if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::LEFT) ) - rNewFrame.SetLine( 0, SvxBoxItemLine::RIGHT ); + rNewFrame.SetLine( nullptr, SvxBoxItemLine::RIGHT ); } else if( nCellFlags & CELL_AFTER ) { if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::RIGHT) ) - rNewFrame.SetLine( 0, SvxBoxItemLine::LEFT ); + rNewFrame.SetLine( nullptr, SvxBoxItemLine::LEFT ); } } } @@ -2430,19 +2430,19 @@ void SvxTableController::ApplyBorderAttr( const SfxItemSet& rAttr ) const sal_Int32 nColCount = mxTable->getColumnCount(); if( nRowCount && nColCount ) { - const SvxBoxItem* pBoxItem = 0; + const SvxBoxItem* pBoxItem = nullptr; if(SfxItemState::SET == rAttr.GetItemState(SDRATTR_TABLE_BORDER, false) ) pBoxItem = dynamic_cast< const SvxBoxItem* >( &rAttr.Get( SDRATTR_TABLE_BORDER ) ); - const SvxBoxInfoItem* pBoxInfoItem = 0; + const SvxBoxInfoItem* pBoxInfoItem = nullptr; if(SfxItemState::SET == rAttr.GetItemState(SDRATTR_TABLE_BORDER_INNER, false) ) pBoxInfoItem = dynamic_cast< const SvxBoxInfoItem* >( &rAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ); - const SvxColorItem* pLineColorItem = 0; + const SvxColorItem* pLineColorItem = nullptr; if(SfxItemState::SET == rAttr.GetItemState(SID_FRAME_LINECOLOR, false) ) pLineColorItem = dynamic_cast< const SvxColorItem* >( &rAttr.Get( SID_FRAME_LINECOLOR ) ); - const SvxBorderLine* pBorderLineItem = 0; + const SvxBorderLine* pBorderLineItem = nullptr; if(SfxItemState::SET == rAttr.GetItemState(SID_FRAME_LINESTYLE, false) ) pBorderLineItem = static_cast<const SvxLineItem&>(rAttr.Get( SID_FRAME_LINESTYLE )).GetLine(); @@ -2808,7 +2808,7 @@ bool SvxTableController::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNo IMPL_LINK_NOARG_TYPED(SvxTableController, UpdateHdl, void*, void) { - mnUpdateEvent = 0; + mnUpdateEvent = nullptr; if( mbCellSelectionMode ) { @@ -2912,7 +2912,7 @@ void lcl_MergeBorderLine( const SvxBorderLine* const pMergedLine(aBoxItem.getLine()); if ((pLine && !pMergedLine) || (!pLine && pMergedLine) || (pLine && (*pLine != *pMergedLine))) { - aBoxItem.setLine(0); + aBoxItem.setLine(nullptr); rbIndeterminate = true; } } @@ -3083,7 +3083,7 @@ bool SvxTableController::selectRow( sal_Int32 row ) return false; CellPos aStart( 0, row ), aEnd( mxTable->getColumnCount() - 1, row ); StartSelection( aEnd ); - gotoCell( aStart, true, 0 ); + gotoCell( aStart, true, nullptr ); return true; } @@ -3093,7 +3093,7 @@ bool SvxTableController::selectColumn( sal_Int32 column ) return false; CellPos aStart( column, 0 ), aEnd( column, mxTable->getRowCount() - 1 ); StartSelection( aEnd ); - gotoCell( aStart, true, 0 ); + gotoCell( aStart, true, nullptr ); return true; } @@ -3103,7 +3103,7 @@ bool SvxTableController::deselectRow( sal_Int32 row ) return false; CellPos aStart( 0, row ), aEnd( mxTable->getColumnCount() - 1, row ); StartSelection( aEnd ); - gotoCell( aStart, false, 0 ); + gotoCell( aStart, false, nullptr ); return true; } @@ -3113,7 +3113,7 @@ bool SvxTableController::deselectColumn( sal_Int32 column ) return false; CellPos aStart( column, 0 ), aEnd( column, mxTable->getRowCount() - 1 ); StartSelection( aEnd ); - gotoCell( aStart, false, 0 ); + gotoCell( aStart, false, nullptr ); return true; } @@ -3144,7 +3144,7 @@ bool SvxTableController::isColumnSelected( sal_Int32 nColumn ) bool SvxTableController::isRowHeader() { SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( mxTableObj.get() ); - SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0; + SdrModel* pModel = pTableObj ? pTableObj->GetModel() : nullptr; if( !pTableObj || !pModel ) return false; @@ -3157,7 +3157,7 @@ bool SvxTableController::isRowHeader() bool SvxTableController::isColumnHeader() { SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( mxTableObj.get() ); - SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0; + SdrModel* pModel = pTableObj ? pTableObj->GetModel() : nullptr; if( !pTableObj || !pModel ) return false; diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 67da8ecc9d5b..74227c6f338a 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -161,7 +161,7 @@ void TableEdgeHdl::CreateB2dIAObject() basegfx::B2DPolyPolygon aInvisible; // get visible and invisible parts - getPolyPolygon(aVisible, aInvisible, 0); + getPolyPolygon(aVisible, aInvisible, nullptr); if(aVisible.count() || aInvisible.count()) { diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 7443cb80a796..892b0d911660 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -178,7 +178,7 @@ bool TableLayouter::isEdgeVisible( sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHor if( (nEdgeX >= 0) && (nEdgeX < sal::static_int_cast<sal_Int32>(rMap.size())) && (nEdgeY >= 0) && (nEdgeY < sal::static_int_cast<sal_Int32>(rMap[nEdgeX].size())) ) { - return rMap[nEdgeX][nEdgeY] != 0; + return rMap[nEdgeX][nEdgeY] != nullptr; } else { @@ -193,7 +193,7 @@ bool TableLayouter::isEdgeVisible( sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHor /** returns the requested borderline in rpBorderLine or a null pointer if there is no border at this edge */ SvxBorderLine* TableLayouter::getBorderLine( sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHorizontal )const { - SvxBorderLine* pLine = 0; + SvxBorderLine* pLine = nullptr; const BorderLineMap& rMap = bHorizontal ? maHorizontalBorders : maVerticalBorders; @@ -202,7 +202,7 @@ SvxBorderLine* TableLayouter::getBorderLine( sal_Int32 nEdgeX, sal_Int32 nEdgeY, { pLine = rMap[nEdgeX][nEdgeY]; if( pLine == &gEmptyBorder ) - pLine = 0; + pLine = nullptr; } else { @@ -895,7 +895,7 @@ CellRef TableLayouter::getCell( const CellPos& rPos ) const bool TableLayouter::HasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ) { - if (!pThis || ((pThis == &gEmptyBorder) && (pOther != 0))) + if (!pThis || ((pThis == &gEmptyBorder) && (pOther != nullptr))) return false; if (!pOther || (pOther == &gEmptyBorder)) return true; @@ -931,14 +931,14 @@ bool TableLayouter::HasPriority( const SvxBorderLine* pThis, const SvxBorderLine void TableLayouter::SetBorder( sal_Int32 nCol, sal_Int32 nRow, bool bHorizontal, const SvxBorderLine* pLine ) { - if( pLine == 0 ) + if( pLine == nullptr ) pLine = &gEmptyBorder; SvxBorderLine *pOld = bHorizontal ? maHorizontalBorders[nCol][nRow] : maVerticalBorders[nCol][nRow]; if( HasPriority( pLine, pOld ) ) { - if( (pOld != 0) && (pOld != &gEmptyBorder) ) + if( (pOld != nullptr) && (pOld != &gEmptyBorder) ) delete pOld; SvxBorderLine* pNew = ( pLine != &gEmptyBorder ) ? new SvxBorderLine(*pLine) : &gEmptyBorder; @@ -975,7 +975,7 @@ void TableLayouter::ClearBorderLayout(BorderLineMap& rMap) if( pLine != &gEmptyBorder ) delete pLine; - rMap[nCol][nRow] = 0; + rMap[nCol][nRow] = nullptr; } } } diff --git a/svx/source/table/tablelayouter.hxx b/svx/source/table/tablelayouter.hxx index 03ba9983e15e..82b84685eb1d 100644 --- a/svx/source/table/tablelayouter.hxx +++ b/svx/source/table/tablelayouter.hxx @@ -92,8 +92,8 @@ public: void updateCells( ::Rectangle& rRectangle ); - sal_Int32 getHorizontalEdge( int nEdgeY, sal_Int32* pnMin = 0, sal_Int32* pnMax = 0 ); - sal_Int32 getVerticalEdge( int nEdgeX , sal_Int32* pnMin = 0, sal_Int32* pnMax = 0); + sal_Int32 getHorizontalEdge( int nEdgeY, sal_Int32* pnMin = nullptr, sal_Int32* pnMax = nullptr ); + sal_Int32 getVerticalEdge( int nEdgeX , sal_Int32* pnMin = nullptr, sal_Int32* pnMax = nullptr); void DistributeColumns( ::Rectangle& rArea, sal_Int32 nFirstCol, sal_Int32 nLastCol ); void DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal_Int32 nLastRow ); diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx index e14100f65643..c81572018a34 100644 --- a/svx/source/table/tablemodel.cxx +++ b/svx/source/table/tablemodel.cxx @@ -315,7 +315,7 @@ Reference< XCellCursor > SAL_CALL TableModel::createCursorByRange( const Referen ::SolarMutexGuard aGuard; ICellRange* pRange = dynamic_cast< ICellRange* >( rRange.get() ); - if( (pRange == 0) || (pRange->getTable().get() != this) ) + if( (pRange == nullptr) || (pRange->getTable().get() != this) ) throw IllegalArgumentException(); TableModelRef xModel( this ); @@ -572,7 +572,7 @@ void TableModel::disposing() mxTableRows.clear(); } - mpTableObj = 0; + mpTableObj = nullptr; } diff --git a/svx/source/table/tablerow.cxx b/svx/source/table/tablerow.cxx index 37b9430da6a2..d86f7e9186b4 100644 --- a/svx/source/table/tablerow.cxx +++ b/svx/source/table/tablerow.cxx @@ -215,7 +215,7 @@ void SAL_CALL TableRow::setFastPropertyValue( sal_Int32 nHandle, const Any& aVal bool bOk = false; bool bChange = false; - TableRowUndo* pUndo = 0; + TableRowUndo* pUndo = nullptr; SdrModel* pModel = mxTableModel->getSdrTableObj()->GetModel(); @@ -293,7 +293,7 @@ void SAL_CALL TableRow::setFastPropertyValue( sal_Int32 nHandle, const Any& aVal if( pUndo ) { pModel->AddUndo( pUndo ); - pUndo = 0; + pUndo = nullptr; } mxTableModel->setModified(sal_True); } diff --git a/svx/source/table/tablerow.hxx b/svx/source/table/tablerow.hxx index 9c3d8d723864..cc8c23618435 100644 --- a/svx/source/table/tablerow.hxx +++ b/svx/source/table/tablerow.hxx @@ -46,7 +46,7 @@ public: TableRow& operator=( const TableRow& ); - void insertColumns( sal_Int32 nIndex, sal_Int32 nCount, CellVector::iterator* pIter = 0 ); + void insertColumns( sal_Int32 nIndex, sal_Int32 nCount, CellVector::iterator* pIter = nullptr ); void removeColumns( sal_Int32 nIndex, sal_Int32 nCount ); // XCellRange diff --git a/svx/source/table/tablertfexporter.cxx b/svx/source/table/tablertfexporter.cxx index eb81993be8ee..616aa6c23625 100644 --- a/svx/source/table/tablertfexporter.cxx +++ b/svx/source/table/tablertfexporter.cxx @@ -178,9 +178,9 @@ void SdrTableRtfExporter::WriteCell( sal_Int32 nCol, sal_Int32 nRow ) OUString aContent; OutlinerParaObject* pParaObj = xCell->GetEditOutlinerParaObject(); - bool bOwnParaObj = pParaObj != 0; + bool bOwnParaObj = pParaObj != nullptr; - if( pParaObj == 0 ) + if( pParaObj == nullptr ) pParaObj = xCell->GetOutlinerParaObject(); if(pParaObj) diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index 1efb02a67baa..3eb66b77e4fc 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -135,8 +135,8 @@ SdrTableRTFParser::SdrTableRTFParser( SdrTableObj& rTableObj ) , mnColCnt( 0 ) , mnRowCnt( 0 ) , mnColMax( 0 ) -, mpActDefault( 0 ) -, mpDefMerge( 0 ) +, mpActDefault( nullptr ) +, mpDefMerge( nullptr ) , mxTable( rTableObj.getTable() ) { mpOutliner->SetUpdateMode(true); @@ -183,7 +183,7 @@ IMPL_LINK_TYPED( SdrTableRTFParser, RTFImportHdl, ImportInfo&, rInfo, void ) case RTFIMP_END: if ( rInfo.aSelection.nEndPos ) { - mpActDefault = NULL; + mpActDefault = nullptr; rInfo.nToken = RTF_PAR; rInfo.aSelection.nEndPara++; ProcToken( &rInfo ); @@ -268,7 +268,7 @@ void SdrTableRTFParser::FillTable() CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) ); if( xCell.is() && xCellInfo.get() ) { - const SfxPoolItem *pPoolItem = 0; + const SfxPoolItem *pPoolItem = nullptr; if( xCellInfo->maItemSet.GetItemState(SDRATTR_TABLE_BORDER,false,&pPoolItem)==SfxItemState::SET) xCell->SetMergedItem( *pPoolItem ); @@ -304,7 +304,7 @@ void SdrTableRTFParser::NewCellRow() maRows.push_back( RTFColumnVectorPtr( new RTFColumnVector() ) ); } - mpDefMerge = NULL; + mpDefMerge = nullptr; maDefaultIterator = maDefaultList.begin(); NextColumn(); @@ -317,7 +317,7 @@ void SdrTableRTFParser::NextColumn() if( maDefaultIterator != maDefaultList.end() ) mpActDefault = (*maDefaultIterator++).get(); else - mpActDefault = 0; + mpActDefault = nullptr; } long TwipsToHundMM( long nIn ) @@ -334,7 +334,7 @@ void SdrTableRTFParser::ProcToken( ImportInfo* pInfo ) { mnColCnt = 0; maDefaultList.clear(); - mpDefMerge = NULL; + mpDefMerge = nullptr; mnLastToken = pInfo->nToken; } break; diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx index 8e1358b97d2c..250675e67d48 100644 --- a/svx/source/table/tableundo.cxx +++ b/svx/source/table/tableundo.cxx @@ -61,13 +61,13 @@ void CellUndo::dispose() { mxCell.clear(); delete maUndoData.mpProperties; - maUndoData.mpProperties = 0; + maUndoData.mpProperties = nullptr; delete maRedoData.mpProperties; - maRedoData.mpProperties = 0; + maRedoData.mpProperties = nullptr; delete maUndoData.mpOutlinerParaObject; - maUndoData.mpOutlinerParaObject = 0; + maUndoData.mpOutlinerParaObject = nullptr; delete maRedoData.mpOutlinerParaObject; - maRedoData.mpOutlinerParaObject = 0; + maRedoData.mpOutlinerParaObject = nullptr; } void CellUndo::ObjectInDestruction(const SdrObject& ) @@ -79,7 +79,7 @@ void CellUndo::Undo() { if( mxCell.is() && mbUndo ) { - if( maRedoData.mpProperties == 0 ) + if( maRedoData.mpProperties == nullptr ) getDataFromCell( maRedoData ); setDataToCell( maUndoData ); @@ -115,7 +115,7 @@ void CellUndo::setDataToCell( const Data& rData ) if( rData.mpProperties ) mxCell->mpProperties = Cell::CloneProperties( rData.mpProperties, *mxObjRef.get(), *mxCell.get() ); else - mxCell->mpProperties = 0; + mxCell->mpProperties = nullptr; if( rData.mpOutlinerParaObject ) mxCell->SetOutlinerParaObject( new OutlinerParaObject(*rData.mpOutlinerParaObject) ); @@ -148,7 +148,7 @@ void CellUndo::getDataFromCell( Data& rData ) if( mxCell->GetOutlinerParaObject() ) rData.mpOutlinerParaObject = new OutlinerParaObject(*mxCell->GetOutlinerParaObject()); else - rData.mpOutlinerParaObject = 0; + rData.mpOutlinerParaObject = nullptr; rData.mnCellContentType = mxCell->mnCellContentType; diff --git a/svx/source/table/tableundo.hxx b/svx/source/table/tableundo.hxx index 54796f603fdb..63a8ed6ff47d 100644 --- a/svx/source/table/tableundo.hxx +++ b/svx/source/table/tableundo.hxx @@ -69,8 +69,8 @@ private: ::sal_Int32 mnColSpan; Data() - : mpProperties(NULL) - , mpOutlinerParaObject(NULL) + : mpProperties(nullptr) + , mpOutlinerParaObject(nullptr) , mnCellContentType(css::table::CellContentType_EMPTY) , mfValue(0) , mnError(0) |