diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:22:39 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:36 +0100 |
commit | de29ac09535d814e4be7e1bf0f10beb9f0f847e3 (patch) | |
tree | 139f75d657cb825622e812254b8b7df4e509140b /sc/source/ui | |
parent | loplugin:nullptr (automatic rewrite) (diff) | |
download | core-de29ac09535d814e4be7e1bf0f10beb9f0f847e3.tar.gz core-de29ac09535d814e4be7e1bf0f10beb9f0f847e3.zip |
loplugin:nullptr (automatic rewrite)
Change-Id: I765d2a600f9c57da50c85354688e3ae796750d94
Diffstat (limited to 'sc/source/ui')
314 files changed, 2389 insertions, 2389 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index e50345fc7b29..eb10c6004350 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -112,9 +112,9 @@ void SAL_CALL ScAccessibleCell::disposing() if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } - mpAccDoc = NULL; + mpAccDoc = nullptr; ScAccessibleCellBase::disposing(); } @@ -161,7 +161,7 @@ Rectangle ScAccessibleCell::GetBoundingBoxOnScreen() const vcl::Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos); if (pWindow) { - Rectangle aRect = pWindow->GetWindowExtentsRelative(NULL); + Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr); aCellRect.setX(aCellRect.getX() + aRect.getX()); aCellRect.setY(aCellRect.getY() + aRect.getY()); } @@ -290,7 +290,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL { SolarMutexGuard aGuard; IsObjectValid(); - utl::AccessibleRelationSetHelper* pRelationSet = NULL; + utl::AccessibleRelationSetHelper* pRelationSet = nullptr; if (mpAccDoc) pRelationSet = mpAccDoc->GetRelationSet(&maCellAddress); if (!pRelationSet) @@ -326,7 +326,7 @@ uno::Sequence< OUString> SAL_CALL bool ScAccessibleCell::IsDefunc( const uno::Reference<XAccessibleStateSet>& rxParentStates) { - return ScAccessibleContextBase::IsDefunc() || (mpDoc == NULL) || (mpViewShell == NULL) || !getAccessibleParent().is() || + return ScAccessibleContextBase::IsDefunc() || (mpDoc == nullptr) || (mpViewShell == nullptr) || !getAccessibleParent().is() || (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC)); } @@ -386,7 +386,7 @@ bool ScAccessibleCell::IsSelected() ScDocument* ScAccessibleCell::GetDocument(ScTabViewShell* pViewShell) { - ScDocument* pDoc = NULL; + ScDocument* pDoc = nullptr; if (pViewShell) pDoc = pViewShell->GetViewData().GetDocument(); return pDoc; diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 1de3ee8581a7..b971cff5af44 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -95,7 +95,7 @@ void SAL_CALL ScAccessibleContextBase::disposing() uno::Reference< XAccessibleEventBroadcaster > xBroadcaster (mxParent->getAccessibleContext(), uno::UNO_QUERY); if (xBroadcaster.is()) xBroadcaster->removeAccessibleEventListener(this); - mxParent = NULL; + mxParent = nullptr; } ScAccessibleContextBaseWeakImpl::disposing(); diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 5fb03c99b8fd..d5561f44c028 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -97,7 +97,7 @@ ScAccessibleCsvControl::~ScAccessibleCsvControl() void SAL_CALL ScAccessibleCsvControl::disposing() { SolarMutexGuard aGuard; - mpControl = NULL; + mpControl = nullptr; ScAccessibleContextBase::disposing(); } @@ -107,7 +107,7 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvControl::getAccessibleAtPoint( throw( RuntimeException, std::exception ) { ensureAlive(); - return NULL; + return nullptr; } bool SAL_CALL ScAccessibleCsvControl::isVisible() throw( RuntimeException, std::exception ) @@ -176,7 +176,7 @@ Rectangle ScAccessibleCsvControl::GetBoundingBoxOnScreen() const throw( RuntimeE { SolarMutexGuard aGuard; ensureAlive(); - return implGetControl().GetWindowExtentsRelative( NULL ); + return implGetControl().GetWindowExtentsRelative( nullptr ); } Rectangle ScAccessibleCsvControl::GetBoundingBox() const throw( RuntimeException, std::exception ) @@ -257,7 +257,7 @@ void ScAccessibleCsvControl::implDispose() Point ScAccessibleCsvControl::implGetAbsPos( const Point& rPos ) const { - return rPos + implGetControl().GetWindowExtentsRelative( NULL ).TopLeft(); + return rPos + implGetControl().GetWindowExtentsRelative( nullptr ).TopLeft(); } // Ruler ====================================================================== @@ -1009,14 +1009,14 @@ Reference< XAccessibleTable > SAL_CALL ScAccessibleCsvGrid::getAccessibleRowHead throw( RuntimeException, std::exception ) { ensureAlive(); - return NULL; + return nullptr; } Reference< XAccessibleTable > SAL_CALL ScAccessibleCsvGrid::getAccessibleColumnHeaders() throw( RuntimeException, std::exception ) { ensureAlive(); - return NULL; + return nullptr; } Sequence< sal_Int32 > SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleRows() @@ -1073,14 +1073,14 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleCaption() throw( RuntimeException, std::exception ) { ensureAlive(); - return NULL; + return nullptr; } Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleSummary() throw( RuntimeException, std::exception ) { ensureAlive(); - return NULL; + return nullptr; } sal_Bool SAL_CALL ScAccessibleCsvGrid::isAccessibleSelected( sal_Int32 /* nRow */, sal_Int32 nColumn ) diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index d1279ced0851..65603904aaa6 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -106,7 +106,7 @@ using ::std::for_each; struct ScAccessibleShapeData { - ScAccessibleShapeData() : pRelationCell(NULL), bSelected(false), bSelectable(true) {} + ScAccessibleShapeData() : pRelationCell(nullptr), bSelected(false), bSelectable(true) {} ~ScAccessibleShapeData(); mutable rtl::Reference< ::accessibility::AccessibleShape > pAccShape; mutable ScAddress* pRelationCell; // if it is NULL this shape is anchored on the table @@ -339,7 +339,7 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc meSplitPos(eSplitPos) { FillSelectionSupplier(); - maZOrderedShapes.push_back(NULL); // add an element which represents the table + maZOrderedShapes.push_back(nullptr); // add an element which represents the table GetCount(); // fill list with filtered shapes (no internal shapes) @@ -363,7 +363,7 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(rViewData.GetDocument()->GetDrawLayer()) ); maShapeTreeInfo.SetSdrView(rViewData.GetScDrawView()); - maShapeTreeInfo.SetController(NULL); + maShapeTreeInfo.SetController(nullptr); maShapeTreeInfo.SetWindow(pViewShell->GetWindowByPos(meSplitPos)); maShapeTreeInfo.SetViewForwarder(mpAccessibleDocument); } @@ -393,7 +393,7 @@ void ScChildrenShapes::SetDrawBroadcaster() maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(rViewData.GetDocument()->GetDrawLayer()) ); maShapeTreeInfo.SetSdrView(rViewData.GetScDrawView()); - maShapeTreeInfo.SetController(NULL); + maShapeTreeInfo.SetController(nullptr); maShapeTreeInfo.SetWindow(mpViewShell->GetWindowByPos(meSplitPos)); maShapeTreeInfo.SetViewForwarder(mpAccessibleDocument); } @@ -509,7 +509,7 @@ bool ScChildrenShapes::ReplaceChild (::accessibility::AccessibleShape* pCurrentC } } } - return NULL; + return nullptr; } css::uno::Reference < css::accessibility::XAccessible > @@ -527,7 +527,7 @@ ScChildrenShapes::GetAccessibleCaption (const css::uno::Reference < css::drawing return xNewChild; } } - return NULL; + return nullptr; } sal_Int32 ScChildrenShapes::GetCount() const @@ -553,7 +553,7 @@ sal_Int32 ScChildrenShapes::GetCount() const uno::Reference< XAccessible > ScChildrenShapes::Get(const ScAccessibleShapeData* pData) const { if (!pData) - return NULL; + return nullptr; if (!pData->pAccShape.is()) { @@ -580,7 +580,7 @@ uno::Reference< XAccessible > ScChildrenShapes::Get(sal_Int32 nIndex) const GetCount(); // fill list with filtered shapes (no internal shapes) if (static_cast<sal_uInt32>(nIndex) >= maZOrderedShapes.size()) - return NULL; + return nullptr; return Get(maZOrderedShapes[nIndex]); } @@ -880,7 +880,7 @@ void ScChildrenShapes::Deselect(sal_Int32 nChildIndex) SdrPage* ScChildrenShapes::GetDrawPage() const { SCTAB nTab(mpAccessibleDocument->getVisibleTable()); - SdrPage* pDrawPage = NULL; + SdrPage* pDrawPage = nullptr; if (mpViewShell) { ScViewData& rViewData = mpViewShell->GetViewData(); @@ -903,7 +903,7 @@ struct SetRelation SetRelation(const ScChildrenShapes* pChildrenShapes, const ScAddress* pAddress) : mpChildrenShapes(pChildrenShapes), - mpRelationSet(NULL), + mpRelationSet(nullptr), mpAddress(pAddress) { } @@ -955,7 +955,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X } else mnShapesSelected = 0; - SdrObject *pFocusedObj = NULL; + SdrObject *pFocusedObj = nullptr; if( mnShapesSelected == 1 && aShapesList.size() == 1) { pFocusedObj = GetSdrObjectFromXShape(aShapesList[0]->xShape); @@ -1034,9 +1034,9 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X bWinFocus = pWin->HasFocus(); } } - const SdrMarkList* pMarkList = NULL; - SdrObject* pMarkedObj = NULL; - SdrObject* pUpObj = NULL; + const SdrMarkList* pMarkList = nullptr; + SdrObject* pMarkedObj = nullptr; + SdrObject* pUpObj = nullptr; bool bIsFocuseMarked = true; if( mpViewShell && mnShapesSelected == 1 && bWinFocus) { @@ -1169,7 +1169,7 @@ void ScChildrenShapes::FillSelectionSupplier() const ScAddress* ScChildrenShapes::GetAnchor(const uno::Reference<drawing::XShape>& xShape) const { - ScAddress* pAddress = NULL; + ScAddress* pAddress = nullptr; if (mpViewShell) { SvxShape* pShapeImp = SvxShape::getImplementation(xShape); @@ -1336,7 +1336,7 @@ bool ScChildrenShapes::FindShape(const uno::Reference<drawing::XShape>& xShape, aShape.xShape = xShape; ScShapeDataLess aLess; rItr = std::lower_bound(maZOrderedShapes.begin(), maZOrderedShapes.end(), &aShape, aLess); - if ((rItr != maZOrderedShapes.end()) && (*rItr != NULL) && ((*rItr)->xShape.get() == xShape.get())) + if ((rItr != maZOrderedShapes.end()) && (*rItr != nullptr) && ((*rItr)->xShape.get() == xShape.get())) bResult = true; // if the shape is found #if OSL_DEBUG_LEVEL > 0 // test whether it finds truly the correct shape (perhaps it is not really sorted) @@ -1402,8 +1402,8 @@ ScAccessibleDocument::ScAccessibleDocument( : ScAccessibleDocumentBase(rxParent), mpViewShell(pViewShell), meSplitPos(eSplitPos), - mpChildrenShapes(NULL), - mpTempAccEdit(NULL), + mpChildrenShapes(nullptr), + mpTempAccEdit(nullptr), mbCompleteSheetSelected(false) { maVisArea = GetVisibleArea_Impl(); @@ -1465,7 +1465,7 @@ void SAL_CALL ScAccessibleDocument::disposing() pWin->RemoveChildEventListener( LINK( this, ScAccessibleDocument, WindowChildEventListener )); mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } if (mpChildrenShapes) DELETEZ(mpChildrenShapes); @@ -1617,7 +1617,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if (mpTempAccEdit) mpTempAccEdit->LostFocus(); - mpTempAccEdit = NULL; + mpTempAccEdit = nullptr; RemoveChild(mxTempAcc, true); if (mpAccessibleSpreadsheet.is() && mpViewShell && mpViewShell->IsActive()) mpAccessibleSpreadsheet->GotFocus(); @@ -1720,7 +1720,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAtPoin const awt::Point& rPoint ) throw (uno::RuntimeException, std::exception) { - uno::Reference<XAccessible> xAccessible = NULL; + uno::Reference<XAccessible> xAccessible = nullptr; if (containsPoint(rPoint)) { SolarMutexGuard aGuard; @@ -2132,7 +2132,7 @@ Point ScAccessibleDocument::LogicToPixel (const Point& rPoint) const if (pWin) { aPoint = pWin->LogicToPixel(rPoint, pWin->GetDrawMapMode()); - aPoint += pWin->GetWindowExtentsRelative(NULL).TopLeft(); + aPoint += pWin->GetWindowExtentsRelative(nullptr).TopLeft(); } return aPoint; } @@ -2152,7 +2152,7 @@ Size ScAccessibleDocument::LogicToPixel (const Size& rSize) const utl::AccessibleRelationSetHelper* ScAccessibleDocument::GetRelationSet(const ScAddress* pAddress) const { - utl::AccessibleRelationSetHelper* pRelationSet = NULL; + utl::AccessibleRelationSetHelper* pRelationSet = nullptr; if (mpChildrenShapes) pRelationSet = mpChildrenShapes->GetRelationSet(pAddress); return pRelationSet; @@ -2186,7 +2186,7 @@ Rectangle ScAccessibleDocument::GetBoundingBoxOnScreen() const { vcl::Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos); if (pWindow) - aRect = pWindow->GetWindowExtentsRelative(NULL); + aRect = pWindow->GetWindowExtentsRelative(nullptr); } return aRect; } @@ -2251,7 +2251,7 @@ bool ScAccessibleDocument::IsTableSelected() const bool ScAccessibleDocument::IsDefunc( const uno::Reference<XAccessibleStateSet>& rxParentStates) { - return ScAccessibleContextBase::IsDefunc() || (mpViewShell == NULL) || !getAccessibleParent().is() || + return ScAccessibleContextBase::IsDefunc() || (mpViewShell == nullptr) || !getAccessibleParent().is() || (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC)); } @@ -2286,7 +2286,7 @@ void ScAccessibleDocument::RemoveChild(const uno::Reference<XAccessible>& xAcc, aEvent.OldValue <<= mxTempAcc; CommitChange( aEvent ); } - mxTempAcc = NULL; + mxTempAcc = nullptr; } } @@ -2309,7 +2309,7 @@ OUString ScAccessibleDocument::GetCurrentCellDescription() ScDocument *ScAccessibleDocument::GetDocument() const { - return mpViewShell ? mpViewShell->GetViewData().GetDocument() : NULL; + return mpViewShell ? mpViewShell->GetViewData().GetDocument() : nullptr; } ScAddress ScAccessibleDocument::GetCurCellAddress() const @@ -2329,7 +2329,7 @@ uno::Any SAL_CALL ScAccessibleDocument::getExtendedAttributes() sal_uInt16 sheetIndex; OUString sSheetName; sheetIndex = getVisibleTable(); - if(GetDocument()==NULL) + if(GetDocument()==nullptr) return anyAtrribute; GetDocument()->GetName(sheetIndex,sSheetName); sName = "page-name:"; diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index d32f3c1416c1..4cccf56c8b9a 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -74,7 +74,7 @@ struct ScAccNote bool mbMarkNote; ScAccNote() - : mpTextHelper(NULL) + : mpTextHelper(nullptr) , mnParaCount(0) , mbMarkNote(false) { @@ -474,7 +474,7 @@ void ScNotesChildren::DataChanged(const Rectangle& rVisRect) inline ScDocument* ScNotesChildren::GetDocument() const { - ScDocument* pDoc = NULL; + ScDocument* pDoc = nullptr; if (mpViewShell) pDoc = &mpViewShell->GetDocument(); return pDoc; @@ -503,7 +503,7 @@ private: }; ScIAccessibleViewForwarder::ScIAccessibleViewForwarder() - : mpViewShell(NULL), mpAccDoc(NULL), mbValid(false) + : mpViewShell(nullptr), mpAccDoc(nullptr), mbValid(false) { } @@ -1019,7 +1019,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetBackgroundShapeAt(const awt::Poi { ::accessibility::AccessibleShapeTreeInfo aShapeTreeInfo; aShapeTreeInfo.SetSdrView(mpViewShell->GetPreview()->GetDrawView()); - aShapeTreeInfo.SetController(NULL); + aShapeTreeInfo.SetController(nullptr); aShapeTreeInfo.SetWindow(mpViewShell->GetWindow()); aShapeTreeInfo.SetViewForwarder(&(maShapeRanges[rShape.mnRangeId].maViewForwarder)); rShape.mpAccShape = rShapeHandler.CreateAccessibleObject(aShapeInfo, aShapeTreeInfo); @@ -1115,7 +1115,7 @@ void ScShapeChildren::FillShapes(const Rectangle& aPixelPaintRect, const MapMode SdrPage* ScShapeChildren::GetDrawPage() const { SCTAB nTab( mpViewShell->GetLocationData().GetPrintTab() ); - SdrPage* pDrawPage = NULL; + SdrPage* pDrawPage = nullptr; ScDocument& rDoc = mpViewShell->GetDocument(); if (rDoc.GetDrawLayer()) { @@ -1192,10 +1192,10 @@ ScAccessibleDocumentPagePreview::ScAccessibleDocumentPagePreview( const uno::Reference<XAccessible>& rxParent, ScPreviewShell* pViewShell ) : ScAccessibleDocumentBase(rxParent), mpViewShell(pViewShell), - mpNotesChildren(NULL), - mpShapeChildren(NULL), - mpHeader(NULL), - mpFooter(NULL) + mpNotesChildren(nullptr), + mpShapeChildren(nullptr), + mpHeader(nullptr), + mpFooter(nullptr) { if (pViewShell) pViewShell->AddAccessibilityObject(*this); @@ -1220,18 +1220,18 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing() if (mpHeader) { mpHeader->release(); - mpHeader = NULL; + mpHeader = nullptr; } if (mpFooter) { mpFooter->release(); - mpFooter = NULL; + mpFooter = nullptr; } if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } // no need to Dispose the AccessibleTextHelper, @@ -1576,7 +1576,7 @@ Rectangle ScAccessibleDocumentPagePreview::GetBoundingBoxOnScreen() const throw { vcl::Window* pWindow = mpViewShell->GetWindow(); if (pWindow) - aRect = pWindow->GetWindowExtentsRelative(NULL); + aRect = pWindow->GetWindowExtentsRelative(nullptr); } return aRect; } diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index 58ce83085854..122a080a1754 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -63,7 +63,7 @@ ScAccessibleEditObject::ScAccessibleEditObject( const OUString& rDescription, EditObjectType eObjectType) : ScAccessibleContextBase(rxParent, AccessibleRole::TEXT_FRAME), - mpTextHelper(NULL), + mpTextHelper(nullptr), mpEditView(pEditView), mpWindow(pWin), meObjectType(eObjectType), @@ -82,11 +82,11 @@ ScAccessibleEditObject::ScAccessibleEditObject( } else { - m_pScDoc=NULL; + m_pScDoc=nullptr; } } else - m_pScDoc=NULL; + m_pScDoc=nullptr; } ScAccessibleEditObject::~ScAccessibleEditObject() @@ -185,7 +185,7 @@ Rectangle ScAccessibleEditObject::GetBoundingBoxOnScreen() const MapMode aMapMode( mpEditView->GetEditEngine()->GetRefMapMode() ); aScreenBounds = mpWindow->LogicToPixel( mpEditView->GetOutputArea(), aMapMode ); Point aCellLoc = aScreenBounds.TopLeft(); - Rectangle aWindowRect = mpWindow->GetWindowExtentsRelative( NULL ); + Rectangle aWindowRect = mpWindow->GetWindowExtentsRelative( nullptr ); Point aWindowLoc = aWindowRect.TopLeft(); Point aPos( aCellLoc.getX() + aWindowLoc.getX(), aCellLoc.getY() + aWindowLoc.getY() ); aScreenBounds.SetPos( aPos ); @@ -193,7 +193,7 @@ Rectangle ScAccessibleEditObject::GetBoundingBoxOnScreen() const } else { - aScreenBounds = mpWindow->GetWindowExtentsRelative( NULL ); + aScreenBounds = mpWindow->GetWindowExtentsRelative( nullptr ); } } @@ -366,7 +366,7 @@ void ScAccessibleEditObject::CreateTextHelper() else { pAccessibleTextData.reset - (new ScAccessibleEditLineTextData(NULL, mpWindow)); + (new ScAccessibleEditLineTextData(nullptr, mpWindow)); } ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::move(pAccessibleTextData))); diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index 72ce834e4f78..1a20e96977ce 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -78,7 +78,7 @@ struct Dispose pArea->dispose(); pArea->release(); } - pArea = NULL; + pArea = nullptr; } }; @@ -88,7 +88,7 @@ ScAccessibleContextBase( rxParent, bHeader ? AccessibleRole::HEADER : Accessible mpViewShell( pViewShell ), mnIndex( nIndex ), mbHeader( bHeader ), - maAreas(MAX_AREAS, NULL), + maAreas(MAX_AREAS, nullptr), mnChildCount(-1) { if (mpViewShell) @@ -111,7 +111,7 @@ void SAL_CALL ScAccessiblePageHeader::disposing() if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } std::for_each(maAreas.begin(), maAreas.end(), Dispose()); @@ -352,7 +352,7 @@ Rectangle ScAccessiblePageHeader::GetBoundingBoxOnScreen() const throw (uno::Run vcl::Window* pWindow = mpViewShell->GetWindow(); if (pWindow) { - Rectangle aRect = pWindow->GetWindowExtentsRelative(NULL); + Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr); aCellRect.setX(aCellRect.getX() + aRect.getX()); aCellRect.setY(aCellRect.getY() + aRect.getY()); } @@ -386,7 +386,7 @@ Rectangle ScAccessiblePageHeader::GetBoundingBox() const throw (uno::RuntimeExce bool ScAccessiblePageHeader::IsDefunc( const uno::Reference<XAccessibleStateSet>& rxParentStates ) { - return ScAccessibleContextBase::IsDefunc() || (mpViewShell == NULL) || !getAccessibleParent().is() || + return ScAccessibleContextBase::IsDefunc() || (mpViewShell == nullptr) || !getAccessibleParent().is() || (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC)); } @@ -415,7 +415,7 @@ void ScAccessiblePageHeader::AddChild(const EditTextObject* pArea, sal_uInt32 nI if (maAreas[nIndex]) { maAreas[nIndex]->release(); - maAreas[nIndex] = NULL; + maAreas[nIndex] = nullptr; } } } diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index d22ddfdd6acb..0c76e2ab20cd 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -56,7 +56,7 @@ ScAccessiblePageHeaderArea::ScAccessiblePageHeaderArea( SvxAdjust eAdjust) : ScAccessibleContextBase(rxParent, AccessibleRole::TEXT), mpEditObj(pEditObj->Clone()), - mpTextHelper(NULL), + mpTextHelper(nullptr), mpViewShell(pViewShell), mbHeader(bHeader), meAdjust(eAdjust) @@ -81,7 +81,7 @@ void SAL_CALL ScAccessiblePageHeaderArea::disposing() if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } if (mpTextHelper) DELETEZ(mpTextHelper); diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index 54c2a246855c..939b5297a4cb 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -50,9 +50,9 @@ ScAccessiblePreviewCell::ScAccessiblePreviewCell( const css::uno::Reference<css: ScPreviewShell* pViewShell, /* const */ ScAddress& rCellAddress, sal_Int32 nIndex ) : - ScAccessibleCellBase( rxParent, ( pViewShell ? &pViewShell->GetDocument() : NULL ), rCellAddress, nIndex ), + ScAccessibleCellBase( rxParent, ( pViewShell ? &pViewShell->GetDocument() : nullptr ), rCellAddress, nIndex ), mpViewShell( pViewShell ), - mpTextHelper(NULL) + mpTextHelper(nullptr) { if (mpViewShell) mpViewShell->AddAccessibilityObject(*this); @@ -75,7 +75,7 @@ void SAL_CALL ScAccessiblePreviewCell::disposing() if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } if (mpTextHelper) @@ -219,7 +219,7 @@ Rectangle ScAccessiblePreviewCell::GetBoundingBoxOnScreen() const throw (uno::Ru vcl::Window* pWindow = mpViewShell->GetWindow(); if (pWindow) { - Rectangle aRect = pWindow->GetWindowExtentsRelative(NULL); + Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr); aCellRect.setX(aCellRect.getX() + aRect.getX()); aCellRect.setY(aCellRect.getY() + aRect.getY()); } @@ -252,7 +252,7 @@ Rectangle ScAccessiblePreviewCell::GetBoundingBox() const throw (uno::RuntimeExc bool ScAccessiblePreviewCell::IsDefunc( const uno::Reference<XAccessibleStateSet>& rxParentStates) { - return ScAccessibleContextBase::IsDefunc() || (mpDoc == NULL) || (mpViewShell == NULL) || !getAccessibleParent().is() || + return ScAccessibleContextBase::IsDefunc() || (mpDoc == nullptr) || (mpViewShell == nullptr) || !getAccessibleParent().is() || (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC)); } diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index 5701e538bb88..54f456bd3f66 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -83,12 +83,12 @@ ScAccessiblePreviewHeaderCell::ScAccessiblePreviewHeaderCell( const css::uno::Re sal_Int32 nIndex ) : ScAccessibleContextBase( rxParent, AccessibleRole::TABLE_CELL ), mpViewShell( pViewShell ), - mpTextHelper( NULL ), + mpTextHelper( nullptr ), mnIndex( nIndex ), maCellPos( rCellPos ), mbColumnHeader( bIsColHdr ), mbRowHeader( bIsRowHdr ), - mpTableInfo( NULL ) + mpTableInfo( nullptr ) { if (mpViewShell) mpViewShell->AddAccessibilityObject(*this); @@ -106,7 +106,7 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing() if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } if (mpTableInfo) @@ -348,7 +348,7 @@ Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScreen() const throw (u vcl::Window* pWindow = mpViewShell->GetWindow(); if (pWindow) { - Rectangle aRect = pWindow->GetWindowExtentsRelative(NULL); + Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr); aCellRect.setX(aCellRect.getX() + aRect.getX()); aCellRect.setY(aCellRect.getY() + aRect.getY()); } @@ -418,7 +418,7 @@ OUString SAL_CALL ScAccessiblePreviewHeaderCell::createAccessibleName() throw(un bool ScAccessiblePreviewHeaderCell::IsDefunc( const uno::Reference<XAccessibleStateSet>& rxParentStates ) { - return ScAccessibleContextBase::IsDefunc() || (mpViewShell == NULL) || !getAccessibleParent().is() || + return ScAccessibleContextBase::IsDefunc() || (mpViewShell == nullptr) || !getAccessibleParent().is() || (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC)); } diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index 947b988d81fd..b1af3790bc83 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -51,7 +51,7 @@ ScAccessiblePreviewTable::ScAccessiblePreviewTable( const css::uno::Reference<cs ScAccessibleContextBase( rxParent, AccessibleRole::TABLE ), mpViewShell( pViewShell ), mnIndex( nIndex ), - mpTableInfo( NULL ) + mpTableInfo( nullptr ) { if (mpViewShell) mpViewShell->AddAccessibilityObject(*this); @@ -73,7 +73,7 @@ void SAL_CALL ScAccessiblePreviewTable::disposing() if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } if (mpTableInfo) @@ -252,13 +252,13 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnExtentAt( sal_In uno::Reference< XAccessibleTable > SAL_CALL ScAccessiblePreviewTable::getAccessibleRowHeaders() throw (uno::RuntimeException, std::exception) { //! missing - return NULL; + return nullptr; } uno::Reference< XAccessibleTable > SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnHeaders() throw (uno::RuntimeException, std::exception) { //! missing - return NULL; + return nullptr; } uno::Sequence< sal_Int32 > SAL_CALL ScAccessiblePreviewTable::getSelectedAccessibleRows() throw (uno::RuntimeException, std::exception) @@ -343,13 +343,13 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCe uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCaption() throw (uno::RuntimeException, std::exception) { //! missing - return NULL; + return nullptr; } uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleSummary() throw (uno::RuntimeException, std::exception) { //! missing - return NULL; + return nullptr; } sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) @@ -637,7 +637,7 @@ Rectangle ScAccessiblePreviewTable::GetBoundingBoxOnScreen() const throw (uno::R vcl::Window* pWindow = mpViewShell->GetWindow(); if (pWindow) { - Rectangle aRect = pWindow->GetWindowExtentsRelative(NULL); + Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr); aCellRect.setX(aCellRect.getX() + aRect.getX()); aCellRect.setY(aCellRect.getY() + aRect.getY()); } @@ -671,7 +671,7 @@ Rectangle ScAccessiblePreviewTable::GetBoundingBox() const bool ScAccessiblePreviewTable::IsDefunc( const uno::Reference<XAccessibleStateSet>& rxParentStates ) { - return ScAccessibleContextBase::IsDefunc() || (mpViewShell == NULL) || !getAccessibleParent().is() || + return ScAccessibleContextBase::IsDefunc() || (mpViewShell == nullptr) || !getAccessibleParent().is() || (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC)); } diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 8c85c4518c6d..e1a56c54c812 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -197,7 +197,7 @@ bool ScAccessibleSpreadsheet::CalcScRangeDifferenceMax(ScRange *pSrc, ScRange *p //In Src , Not in Dest bool ScAccessibleSpreadsheet::CalcScRangeListDifferenceMax(ScRangeList *pSrc,ScRangeList *pDest,int nMax,VEC_MYADDR &vecRet) { - if (pSrc == NULL || pDest == NULL) + if (pSrc == nullptr || pDest == nullptr) { return false; } @@ -285,8 +285,8 @@ void ScAccessibleSpreadsheet::ConstructScAccessibleSpreadsheet( ScSplitPos eSplitPos) { mpViewShell = pViewShell; - mpMarkedRanges = 0; - mpSortedMarkedCells = 0; + mpMarkedRanges = nullptr; + mpSortedMarkedCells = nullptr; mpAccDoc = pAccDoc; mpAccCell.clear(); meSplitPos = eSplitPos; @@ -319,7 +319,7 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing() if (mpViewShell) { mpViewShell->RemoveAccessibilityObject(*this); - mpViewShell = NULL; + mpViewShell = nullptr; } mpAccCell.clear(); @@ -1004,7 +1004,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleAtP } catch(const css::lang::IndexOutOfBoundsException &) { - return NULL; + return nullptr; } } } @@ -1041,9 +1041,9 @@ sal_Int32 SAL_CALL ScAccessibleSpreadsheet::getBackground( ) uno::Reference<XAccessibleRelationSet> SAL_CALL ScAccessibleSpreadsheet::getAccessibleRelationSet() throw (css::uno::RuntimeException, std::exception) { - utl::AccessibleRelationSetHelper* pRelationSet = NULL; + utl::AccessibleRelationSetHelper* pRelationSet = nullptr; if(mpAccDoc) - pRelationSet = mpAccDoc->GetRelationSet(NULL); + pRelationSet = mpAccDoc->GetRelationSet(nullptr); if (!pRelationSet) pRelationSet = new utl::AccessibleRelationSetHelper(); return pRelationSet; @@ -1356,7 +1356,7 @@ Rectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() const { vcl::Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos); if (pWindow) - aRect = pWindow->GetWindowExtentsRelative(NULL); + aRect = pWindow->GetWindowExtentsRelative(nullptr); } return aRect; } @@ -1378,7 +1378,7 @@ Rectangle ScAccessibleSpreadsheet::GetBoundingBox() const bool ScAccessibleSpreadsheet::IsDefunc( const uno::Reference<XAccessibleStateSet>& rxParentStates) { - return ScAccessibleContextBase::IsDefunc() || (mpViewShell == NULL) || !getAccessibleParent().is() || + return ScAccessibleContextBase::IsDefunc() || (mpViewShell == nullptr) || !getAccessibleParent().is() || (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC)); } @@ -1427,7 +1427,7 @@ bool ScAccessibleSpreadsheet::IsCompleteSheetSelected() ScDocument* ScAccessibleSpreadsheet::GetDocument(ScTabViewShell* pViewShell) { - ScDocument* pDoc = NULL; + ScDocument* pDoc = nullptr; if (pViewShell) pDoc = pViewShell->GetViewData().GetDocument(); return pDoc; diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx index 761f078926a4..c9e7e140eeda 100644 --- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx @@ -54,7 +54,7 @@ ScAccessibleTableBase::~ScAccessibleTableBase() void SAL_CALL ScAccessibleTableBase::disposing() { SolarMutexGuard aGuard; - mpDoc = NULL; + mpDoc = nullptr; ScAccessibleContextBase::disposing(); } diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 69cd4378d3b3..d18735d3a815 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -74,7 +74,7 @@ ScViewForwarder::~ScViewForwarder() bool ScViewForwarder::IsValid() const { - return mpViewShell != NULL; + return mpViewShell != nullptr; } Rectangle ScViewForwarder::GetVisArea() const @@ -137,7 +137,7 @@ Point ScViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMod void ScViewForwarder::SetInvalid() { - mpViewShell = NULL; + mpViewShell = nullptr; } class ScEditObjectViewForwarder : public SvxViewForwarder @@ -237,7 +237,7 @@ Point ScEditObjectViewForwarder::PixelToLogic( const Point& rPoint, const MapMod void ScEditObjectViewForwarder::SetInvalid() { - mpWindow = NULL; + mpWindow = nullptr; } class ScPreviewViewForwarder : public SvxViewForwarder @@ -265,7 +265,7 @@ public: ScPreviewViewForwarder::ScPreviewViewForwarder(ScPreviewShell* pViewShell) : mpViewShell(pViewShell), - mpTableInfo(NULL) + mpTableInfo(nullptr) { } @@ -276,7 +276,7 @@ ScPreviewViewForwarder::~ScPreviewViewForwarder() bool ScPreviewViewForwarder::IsValid() const { - return mpViewShell != NULL; + return mpViewShell != nullptr; } Rectangle ScPreviewViewForwarder::GetVisArea() const @@ -330,7 +330,7 @@ Point ScPreviewViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& void ScPreviewViewForwarder::SetInvalid() { - mpViewShell = NULL; + mpViewShell = nullptr; } Rectangle ScPreviewViewForwarder::GetVisRect() const @@ -693,8 +693,8 @@ bool ScEditViewForwarder::Paste() void ScEditViewForwarder::SetInvalid() { - mpWindow = NULL; - mpEditView = NULL; + mpWindow = nullptr; + mpEditView = nullptr; } // ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object @@ -702,8 +702,8 @@ void ScEditViewForwarder::SetInvalid() ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell, const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell) : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP), - mpViewForwarder(NULL), - mpEditViewForwarder(NULL), + mpViewForwarder(nullptr), + mpEditViewForwarder(nullptr), mpViewShell(pViewShell), meSplitPos(eSplitPos), mpAccessibleCell( pAccCell ) @@ -728,7 +728,7 @@ void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - mpViewShell = NULL; // invalid now + mpViewShell = nullptr; // invalid now if (mpViewForwarder) mpViewForwarder->SetInvalid(); if (mpEditViewForwarder) @@ -929,7 +929,7 @@ SvxViewForwarder* ScAccessibleCellTextData::GetViewForwarder() SvxEditViewForwarder* ScAccessibleCellTextData::GetEditViewForwarder( bool /* bCreate */ ) { //#102219#; there should no EditViewForwarder be, because the cell is now readonly in this interface - return NULL; + return nullptr; } IMPL_LINK_TYPED(ScAccessibleTextData, NotifyHdl, EENotify&, aNotify, void) @@ -942,7 +942,7 @@ IMPL_LINK_TYPED(ScAccessibleTextData, NotifyHdl, EENotify&, aNotify, void) ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell) { - ScDocShell* pDocSh = NULL; + ScDocShell* pDocSh = nullptr; if (pViewShell) pDocSh = pViewShell->GetViewData().GetDocShell(); return pDocSh; @@ -950,11 +950,11 @@ ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell) ScAccessibleEditObjectTextData::ScAccessibleEditObjectTextData(EditView* pEditView, vcl::Window* pWin, bool isClone) : - mpViewForwarder(NULL), - mpEditViewForwarder(NULL), + mpViewForwarder(nullptr), + mpEditViewForwarder(nullptr), mpEditView(pEditView), - mpEditEngine(pEditView ? pEditView->GetEditEngine() : 0), - mpForwarder(NULL), + mpEditEngine(pEditView ? pEditView->GetEditEngine() : nullptr), + mpForwarder(nullptr), mpWindow(pWin) { // If the object is cloned, do NOT add notify hdl. @@ -984,9 +984,9 @@ void ScAccessibleEditObjectTextData::Notify( SfxBroadcaster& rBC, const SfxHint& sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - mpWindow = NULL; - mpEditView = NULL; - mpEditEngine = NULL; + mpWindow = nullptr; + mpEditView = nullptr; + mpEditEngine = nullptr; DELETEZ(mpForwarder); if (mpViewForwarder) mpViewForwarder->SetInvalid(); @@ -1071,7 +1071,7 @@ ScAccessibleEditLineTextData::~ScAccessibleEditLineTextData() if (mbEditEngineCreated && mpEditEngine) { delete mpEditEngine; - mpEditEngine = NULL; // don't access in ScAccessibleEditObjectTextData dtor! + mpEditEngine = nullptr; // don't access in ScAccessibleEditObjectTextData dtor! } else if (pTxtWnd && pTxtWnd->GetEditView() && pTxtWnd->GetEditView()->GetEditEngine()) { @@ -1090,7 +1090,7 @@ void ScAccessibleEditLineTextData::Dispose() pTxtWnd->RemoveAccessibleTextData( *this ); ResetEditMode(); - mpWindow = NULL; + mpWindow = nullptr; } ScAccessibleTextData* ScAccessibleEditLineTextData::Clone() const @@ -1113,7 +1113,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder() mpEditView = pTxtWnd->GetEditView(); ScAccessibleEditObjectTextData::GetTextForwarder(); // fill the mpForwarder - mpEditEngine = NULL; + mpEditEngine = nullptr; } else { @@ -1123,7 +1123,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder() { SfxItemPool* pEnginePool = EditEngine::CreatePool(); pEnginePool->FreezeIdRanges(); - mpEditEngine = new ScFieldEditEngine(NULL, pEnginePool, NULL, true); + mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); mbEditEngineCreated = true; mpEditEngine->EnableUndo( false ); mpEditEngine->SetRefMapMode( MAP_100TH_MM ); @@ -1174,7 +1174,7 @@ void ScAccessibleEditLineTextData::ResetEditMode() delete mpEditEngine; else if (pTxtWnd && pTxtWnd->GetEditView() && pTxtWnd->GetEditView()->GetEditEngine()) pTxtWnd->GetEditView()->GetEditEngine()->SetNotifyHdl(Link<EENotify&,void>()); - mpEditEngine = NULL; + mpEditEngine = nullptr; DELETEZ(mpForwarder); DELETEZ(mpEditViewForwarder); @@ -1196,7 +1196,7 @@ void ScAccessibleEditLineTextData::TextChanged() void ScAccessibleEditLineTextData::StartEdit() { ResetEditMode(); - mpEditView = NULL; + mpEditView = nullptr; // send HINT_BEGEDIT SdrHint aHint(HINT_BEGEDIT); @@ -1210,7 +1210,7 @@ void ScAccessibleEditLineTextData::EndEdit() GetBroadcaster().Broadcast( aHint ); ResetEditMode(); - mpEditView = NULL; + mpEditView = nullptr; } // ScAccessiblePreviewCellTextData: shared data between sub objects of a accessible cell text object @@ -1218,7 +1218,7 @@ void ScAccessibleEditLineTextData::EndEdit() ScAccessiblePreviewCellTextData::ScAccessiblePreviewCellTextData(ScPreviewShell* pViewShell, const ScAddress& rP) : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP), - mpViewForwarder(NULL), + mpViewForwarder(nullptr), mpViewShell(pViewShell) { } @@ -1239,7 +1239,7 @@ void ScAccessiblePreviewCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - mpViewShell = NULL; // invalid now + mpViewShell = nullptr; // invalid now if (mpViewForwarder) mpViewForwarder->SetInvalid(); } @@ -1254,7 +1254,7 @@ ScAccessibleTextData* ScAccessiblePreviewCellTextData::Clone() const SvxTextForwarder* ScAccessiblePreviewCellTextData::GetTextForwarder() { - bool bEditEngineBefore(pEditEngine != NULL); + bool bEditEngineBefore(pEditEngine != nullptr); ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine @@ -1282,7 +1282,7 @@ SvxViewForwarder* ScAccessiblePreviewCellTextData::GetViewForwarder() ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewShell) { - ScDocShell* pDocSh = NULL; + ScDocShell* pDocSh = nullptr; if (pViewShell) pDocSh = static_cast<ScDocShell*>( pViewShell->GetDocument().GetDocumentShell()); return pDocSh; @@ -1293,7 +1293,7 @@ ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewSh ScAccessiblePreviewHeaderCellTextData::ScAccessiblePreviewHeaderCellTextData(ScPreviewShell* pViewShell, const OUString& rText, const ScAddress& rP, bool bColHeader, bool bRowHeader) : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP), - mpViewForwarder(NULL), + mpViewForwarder(nullptr), mpViewShell(pViewShell), maText(rText), mbColHeader(bColHeader), @@ -1317,7 +1317,7 @@ void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const S sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - mpViewShell = NULL; // invalid now + mpViewShell = nullptr; // invalid now if (mpViewForwarder) mpViewForwarder->SetInvalid(); } @@ -1343,7 +1343,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder() { SfxItemPool* pEnginePool = EditEngine::CreatePool(); pEnginePool->FreezeIdRanges(); - pEditEngine = new ScFieldEditEngine(NULL, pEnginePool, NULL, true); + pEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); } pEditEngine->EnableUndo( false ); if (pDocShell) @@ -1390,7 +1390,7 @@ SvxViewForwarder* ScAccessiblePreviewHeaderCellTextData::GetViewForwarder() ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* pViewShell) { - ScDocShell* pDocSh = NULL; + ScDocShell* pDocSh = nullptr; if (pViewShell) pDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell()); return pDocSh; @@ -1399,11 +1399,11 @@ ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* p ScAccessibleHeaderTextData::ScAccessibleHeaderTextData(ScPreviewShell* pViewShell, const EditTextObject* pEditObj, bool bHeader, SvxAdjust eAdjust) : - mpViewForwarder(NULL), + mpViewForwarder(nullptr), mpViewShell(pViewShell), - mpEditEngine(NULL), - mpForwarder(NULL), - mpDocSh(NULL), + mpEditEngine(nullptr), + mpForwarder(nullptr), + mpDocSh(nullptr), mpEditObj(pEditObj), mbHeader(bHeader), mbDataValid(false), @@ -1440,8 +1440,8 @@ void ScAccessibleHeaderTextData::Notify( SfxBroadcaster&, const SfxHint& rHint ) sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - mpViewShell = NULL;// invalid now - mpDocSh = NULL; + mpViewShell = nullptr;// invalid now + mpDocSh = nullptr; if (mpViewForwarder) mpViewForwarder->SetInvalid(); } @@ -1514,11 +1514,11 @@ SvxViewForwarder* ScAccessibleHeaderTextData::GetViewForwarder() ScAccessibleNoteTextData::ScAccessibleNoteTextData(ScPreviewShell* pViewShell, const OUString& sText, const ScAddress& aCellPos, bool bMarkNote) : - mpViewForwarder(NULL), + mpViewForwarder(nullptr), mpViewShell(pViewShell), - mpEditEngine(NULL), - mpForwarder(NULL), - mpDocSh(NULL), + mpEditEngine(nullptr), + mpForwarder(nullptr), + mpDocSh(nullptr), msText(sText), maCellPos(aCellPos), mbMarkNote(bMarkNote), @@ -1555,8 +1555,8 @@ void ScAccessibleNoteTextData::Notify( SfxBroadcaster&, const SfxHint& rHint ) sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - mpViewShell = NULL;// invalid now - mpDocSh = NULL; + mpViewShell = nullptr;// invalid now + mpDocSh = nullptr; if (mpViewForwarder) mpViewForwarder->SetInvalid(); } @@ -1576,7 +1576,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder() { SfxItemPool* pEnginePool = EditEngine::CreatePool(); pEnginePool->FreezeIdRanges(); - mpEditEngine = new ScFieldEditEngine(NULL, pEnginePool, NULL, true); + mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); } mpEditEngine->EnableUndo( false ); if (mpDocSh) @@ -1670,7 +1670,7 @@ Point ScCsvViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMap void ScCsvViewForwarder::SetInvalid() { - mpWindow = NULL; + mpWindow = nullptr; } ScAccessibleCsvTextData::ScAccessibleCsvTextData( @@ -1696,8 +1696,8 @@ void ScAccessibleCsvTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint sal_uLong nId = pSimpleHint->GetId(); if( nId == SFX_HINT_DYING ) { - mpWindow = NULL; - mpEditEngine = NULL; + mpWindow = nullptr; + mpEditEngine = nullptr; if (mpViewForwarder.get()) mpViewForwarder->SetInvalid(); } @@ -1733,7 +1733,7 @@ SvxViewForwarder* ScAccessibleCsvTextData::GetViewForwarder() SvxEditViewForwarder* ScAccessibleCsvTextData::GetEditViewForwarder( bool /* bCreate */ ) { - return NULL; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index 0416a688c66a..e6329bc5d5bc 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -37,12 +37,12 @@ struct StatisticCalculation { static StatisticCalculation lclBasicStatistics[] = { - { STR_ANOVA_LABEL_GROUPS, NULL, NULL }, + { STR_ANOVA_LABEL_GROUPS, nullptr, nullptr }, { STRID_CALC_COUNT, "=COUNT(%RANGE%)", "COUNT_RANGE" }, { STRID_CALC_SUM, "=SUM(%RANGE%)", "SUM_RANGE" }, { STRID_CALC_MEAN, "=AVERAGE(%RANGE%)", "MEAN_RANGE" }, { STRID_CALC_VARIANCE, "=VAR(%RANGE%)", "VAR_RANGE" }, - { 0, NULL, NULL } + { 0, nullptr, nullptr } }; static sal_Int16 lclAnovaLabels[] = @@ -166,7 +166,7 @@ void ScAnalysisOfVarianceDialog::FactorChanged() void ScAnalysisOfVarianceDialog::RowColumn(ScRangeList& rRangeList, AddressWalkerWriter& aOutput, FormulaTemplate& aTemplate, OUString& sFormula, GroupedBy aGroupedBy, ScRange* pResultRange) { - if (pResultRange != NULL) + if (pResultRange != nullptr) pResultRange->aStart = aOutput.current(); if (!sFormula.isEmpty()) { @@ -176,7 +176,7 @@ void ScAnalysisOfVarianceDialog::RowColumn(ScRangeList& rRangeList, AddressWalke aTemplate.setTemplate(sFormula); aTemplate.applyRange(strWildcardRange, *pRange); aOutput.writeFormula(aTemplate.getTemplate()); - if (pResultRange != NULL) + if (pResultRange != nullptr) pResultRange->aEnd = aOutput.current(); aOutput.nextRow(); } @@ -191,7 +191,7 @@ void ScAnalysisOfVarianceDialog::RowColumn(ScRangeList& rRangeList, AddressWalke aTemplate.setTemplate(aLabelTemplate); aTemplate.applyNumber(strWildcardNumber, i + 1); aOutput.writeString(aTemplate.getTemplate()); - if (pResultRange != NULL) + if (pResultRange != nullptr) pResultRange->aEnd = aOutput.current(); aOutput.nextRow(); } @@ -233,7 +233,7 @@ void ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output, OUString sFormula = OUString::createFromAscii(lclBasicStatistics[i].aFormula); RowColumn(aRangeList, output, aTemplate, sFormula, mGroupedBy, &aResultRange); output.nextColumn(); - if (lclBasicStatistics[i].aResultRangeName != NULL) + if (lclBasicStatistics[i].aResultRangeName != nullptr) { OUString sResultRangeName = OUString::createFromAscii(lclBasicStatistics[i].aResultRangeName); aTemplate.autoReplaceRange("%" + sResultRangeName + "%", aResultRange); @@ -381,7 +381,7 @@ void ScAnalysisOfVarianceDialog::AnovaTwoFactor(AddressWalkerWriter& output, For ScRange aResultRange; OUString sFormula = OUString::createFromAscii(lclBasicStatistics[i].aFormula); RowColumn(aColumnRangeList, output, aTemplate, sFormula, BY_COLUMN, &aResultRange); - if (lclBasicStatistics[i].aResultRangeName != NULL) + if (lclBasicStatistics[i].aResultRangeName != nullptr) { OUString sResultRangeName = OUString::createFromAscii(lclBasicStatistics[i].aResultRangeName); aTemplate.autoReplaceRange("%" + sResultRangeName + "_COLUMN%", aResultRange); @@ -399,7 +399,7 @@ void ScAnalysisOfVarianceDialog::AnovaTwoFactor(AddressWalkerWriter& output, For OUString sFormula = OUString::createFromAscii(lclBasicStatistics[i].aFormula); RowColumn(aRowRangeList, output, aTemplate, sFormula, BY_ROW, &aResultRange); - if (lclBasicStatistics[i].aResultRangeName != NULL) + if (lclBasicStatistics[i].aResultRangeName != nullptr) { OUString sResultRangeName = OUString::createFromAscii(lclBasicStatistics[i].aResultRangeName); aTemplate.autoReplaceRange("%" + sResultRangeName + "_ROW%", aResultRange); diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index 0701b2e049cd..24854e3d9c91 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -51,7 +51,7 @@ static const StatisticCalculation lclCalcDefinitions[] = { STRID_CALC_MAX, "=MAX(%RANGE%)"}, { STRID_CALC_SUM, "=SUM(%RANGE%)"}, { STRID_CALC_COUNT, "=COUNT(%RANGE%)" }, - { 0, NULL } + { 0, nullptr } }; static const char strWildcardRange[] = "%RANGE%"; @@ -114,7 +114,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) aOutput.push(); // Write calculation labels - for(sal_Int32 i = 0; lclCalcDefinitions[i].aFormula != NULL; i++) + for(sal_Int32 i = 0; lclCalcDefinitions[i].aFormula != nullptr; i++) { OUString aLabel(SC_STRLOAD(RID_STATISTICS_DLGS, lclCalcDefinitions[i].aCalculationNameId)); aOutput.writeString(aLabel); @@ -128,7 +128,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) { aOutput.resetRow(); - for(sal_Int32 i = 0; lclCalcDefinitions[i].aFormula != NULL; i++) + for(sal_Int32 i = 0; lclCalcDefinitions[i].aFormula != nullptr; i++) { aTemplate.setTemplate(lclCalcDefinitions[i].aFormula); aTemplate.applyRange(strWildcardRange, pIterator->get(), b3DAddress); diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index 3f2c93005b57..83b1cedf035f 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -328,8 +328,8 @@ void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG& randomGenerator, const IMPL_LINK_NOARG_TYPED( ScRandomNumberGeneratorDialog, OkClicked, Button*, void ) { - ApplyClicked(NULL); - CloseClicked(NULL); + ApplyClicked(nullptr); + CloseClicked(nullptr); } IMPL_LINK_NOARG_TYPED( ScRandomNumberGeneratorDialog, ApplyClicked, Button*, void ) @@ -344,7 +344,7 @@ IMPL_LINK_NOARG_TYPED( ScRandomNumberGeneratorDialog, CloseClicked, Button*, voi IMPL_LINK_TYPED( ScRandomNumberGeneratorDialog, GetFocusHandler, Control&, rCtrl, void ) { - Edit* pEdit = NULL; + Edit* pEdit = nullptr; if( (&rCtrl == static_cast<Control*>(mpInputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpInputRangeButton)) ) pEdit = mpInputRangeEdit; diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index ebffefe8323d..4a03c7ec1775 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -29,7 +29,7 @@ ScSamplingDialog::ScSamplingDialog( vcl::Window* pParent, ScViewData* pViewData ) : ScAnyRefDlg ( pSfxBindings, pChildWindow, pParent, "SamplingDialog", "modules/scalc/ui/samplingdialog.ui" ), - mpActiveEdit ( NULL ), + mpActiveEdit ( nullptr ), mViewData ( pViewData ), mDocument ( pViewData->GetDocument() ), mInputRange ( ScAddress::INITIALIZE_INVALID ), @@ -296,7 +296,7 @@ IMPL_LINK_NOARG_TYPED( ScSamplingDialog, OkClicked, Button*, void ) IMPL_LINK_TYPED( ScSamplingDialog, GetFocusHandler, Control&, rCtrl, void ) { - mpActiveEdit = NULL; + mpActiveEdit = nullptr; if( (&rCtrl == static_cast<Control*>(mpInputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpInputRangeButton)) ) mpActiveEdit = mpInputRangeEdit; diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index 51d36af4d0ba..02a3e717be86 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -63,7 +63,7 @@ ScStatisticsInputOutputDialog::ScStatisticsInputOutputDialog( mAddressDetails ( mDocument->GetAddressConvention(), 0, 0 ), mOutputAddress ( ScAddress::INITIALIZE_INVALID ), mGroupedBy ( BY_COLUMN ), - mpActiveEdit ( NULL ), + mpActiveEdit ( nullptr ), mCurrentAddress ( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() ), mDialogLostFocus( false ) { @@ -200,7 +200,7 @@ IMPL_LINK_NOARG_TYPED( ScStatisticsInputOutputDialog, OkClicked, Button*, void ) IMPL_LINK_TYPED( ScStatisticsInputOutputDialog, GetFocusHandler, Control&, rCtrl, void ) { - mpActiveEdit = NULL; + mpActiveEdit = nullptr; if( (&rCtrl == static_cast<Control*>(mpInputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpInputRangeButton)) ) mpActiveEdit = mpInputRangeEdit; diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx index b6376a564c1f..df6dc0117615 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx @@ -36,7 +36,7 @@ ScStatisticsTwoVariableDialog::ScStatisticsTwoVariableDialog( mAddressDetails ( mDocument->GetAddressConvention(), 0, 0 ), mOutputAddress ( ScAddress::INITIALIZE_INVALID ), mGroupedBy ( BY_COLUMN ), - mpActiveEdit ( NULL ), + mpActiveEdit ( nullptr ), mCurrentAddress ( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() ), mDialogLostFocus( false ) { @@ -213,7 +213,7 @@ IMPL_LINK_NOARG_TYPED( ScStatisticsTwoVariableDialog, OkClicked, Button*, void ) IMPL_LINK_TYPED( ScStatisticsTwoVariableDialog, GetFocusHandler, Control&, rCtrl, void ) { - mpActiveEdit = NULL; + mpActiveEdit = nullptr; if( &rCtrl == mpVariable1RangeEdit || &rCtrl == mpVariable1RangeButton ) { diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx index 0bc4d938fe26..3594aa7f4372 100644 --- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx +++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx @@ -175,7 +175,7 @@ void AddressWalkerWriter::writeMatrixFormula(const OUString& aFormula) ScRange aRange; aRange.aStart = mCurrentAddress; aRange.aEnd = mCurrentAddress; - mpDocShell->GetDocFunc().EnterMatrix(aRange, NULL, NULL, aFormula, false, false, OUString(), meGrammar ); + mpDocShell->GetDocFunc().EnterMatrix(aRange, nullptr, nullptr, aFormula, false, false, OUString(), meGrammar ); } void AddressWalkerWriter::writeString(const OUString& aString) diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index 11702c6efc23..a762755cd8c3 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -42,7 +42,7 @@ using namespace com::sun::star; ScClient::ScClient( ScTabViewShell* pViewShell, vcl::Window* pDraw, SdrModel* pSdrModel, SdrOle2Obj* pObj ) : SfxInPlaceClient( pViewShell, pDraw, pObj->GetAspect() ), pModel( pSdrModel ), - pGrafEdit( 0 ) + pGrafEdit( nullptr ) { SetObject( pObj->GetObjRef() ); } @@ -54,7 +54,7 @@ ScClient::~ScClient() SdrOle2Obj* ScClient::GetDrawObj() { uno::Reference < embed::XEmbeddedObject > xObj = GetObject(); - SdrOle2Obj* pOle2Obj = NULL; + SdrOle2Obj* pOle2Obj = nullptr; OUString aName = GetViewShell()->GetObjectShell()->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj ); sal_uInt16 nPages = pModel->GetPageCount(); diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 527ff99f8f6d..a257bc533368 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -78,11 +78,11 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain const TransferableObjectDescriptor& rDesc ) : pModel( pClipModel ), aObjDesc( rDesc ), - pBookmark( NULL ), + pBookmark( nullptr ), bGraphic( false ), bGrIsBit( false ), bOleObj( false ), - pDragSourceView( NULL ), + pDragSourceView( nullptr ), nDragSourceFlags( 0 ), bDragWasInternal( false ), nSourceDocID( 0 ), @@ -157,7 +157,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain OUString aUrl = sTmp; OUString aAbs; const SfxMedium* pMedium; - if (pContainerShell && (pMedium = pContainerShell->GetMedium()) != NULL) + if (pContainerShell && (pMedium = pContainerShell->GetMedium()) != nullptr) { bool bWasAbs = true; aAbs = pMedium->GetURLObject().smartRel2Abs( aUrl, bWasAbs ). @@ -227,7 +227,7 @@ ScDrawTransferObj::~ScDrawTransferObj() if ( pScMod->GetClipData().pDrawClipboard == this ) { OSL_FAIL("ScDrawTransferObj wasn't released"); - pScMod->SetClipObject( NULL, NULL ); + pScMod->SetClipObject( nullptr, nullptr ); } if ( pScMod->GetDragData().pDrawTransfer == this ) { @@ -594,7 +594,7 @@ void ScDrawTransferObj::ObjectReleased() { ScModule* pScMod = SC_MOD(); if ( pScMod->GetClipData().pDrawClipboard == this ) - pScMod->SetClipObject( NULL, NULL ); + pScMod->SetClipObject( nullptr, nullptr ); TransferableHelper::ObjectReleased(); } @@ -690,7 +690,7 @@ SdrOle2Obj* ScDrawTransferObj::GetSingleObject() } } - return NULL; + return nullptr; } void ScDrawTransferObj::CreateOLEData() @@ -735,7 +735,7 @@ void ScDrawTransferObj::InitDocShell() aDestView.Paste( *pModel, Point(aSrcSize.Width()/2, aSrcSize.Height()/2), - NULL, SdrInsertFlags::NONE, OUString(), OUString()); + nullptr, SdrInsertFlags::NONE, OUString(), OUString()); // put objects to right layer (see ScViewFunc::PasteDataFormat for SotClipboardFormatId::DRAWING) @@ -762,7 +762,7 @@ void ScDrawTransferObj::InitDocShell() aViewOpt.SetOption( VOPT_GRID, false ); rDestDoc.SetViewOptions( aViewOpt ); - ScViewData aViewData( pDocSh, NULL ); + ScViewData aViewData( pDocSh, nullptr ); aViewData.SetTabNo( 0 ); aViewData.SetScreen( aDestArea ); aViewData.SetCurX( 0 ); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index f3d4eb95cb86..070c94a25fc7 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -501,16 +501,16 @@ static sal_Int32 lcl_MatchParenthesis( const OUString& rStr, sal_Int32 nPos ) } ScInputHandler::ScInputHandler() - : pInputWin( NULL ), - pEngine( NULL ), - pTableView( NULL ), - pTopView( NULL ), - pColumnData( NULL ), - pFormulaData( NULL ), - pFormulaDataPara( NULL ), - pTipVisibleParent( NULL ), + : pInputWin( nullptr ), + pEngine( nullptr ), + pTableView( nullptr ), + pTopView( nullptr ), + pColumnData( nullptr ), + pFormulaData( nullptr ), + pFormulaDataPara( nullptr ), + pTipVisibleParent( nullptr ), nTipVisible( 0 ), - pTipVisibleSecParent( NULL ), + pTipVisibleSecParent( nullptr ), nTipVisibleSec( 0 ), nFormSelStart( 0 ), nFormSelEnd( 0 ), @@ -535,17 +535,17 @@ ScInputHandler::ScInputHandler() eAttrAdjust( SVX_HOR_JUSTIFY_STANDARD ), aScaleX( 1,1 ), aScaleY( 1,1 ), - pRefViewSh( NULL ), - pLastPattern( NULL ), - pEditDefaults( NULL ), - pLastState( NULL ), - pDelayTimer( NULL ), - pRangeFindList( NULL ), + pRefViewSh( nullptr ), + pLastPattern( nullptr ), + pEditDefaults( nullptr ), + pLastState( nullptr ), + pDelayTimer( nullptr ), + pRangeFindList( nullptr ), maFormulaChar() { // The InputHandler is constructed with the view, so SfxViewShell::Current // doesn't have the right view yet. pActiveViewSh is updated in NotifyChange. - pActiveViewSh = NULL; + pActiveViewSh = nullptr; // Bindings (only still used for Invalidate) are retrieved if needed on demand } @@ -558,10 +558,10 @@ ScInputHandler::~ScInputHandler() EnterHandler(); // Finish input if (SC_MOD()->GetRefInputHdl() == this) - SC_MOD()->SetRefInputHdl(NULL); + SC_MOD()->SetRefInputHdl(nullptr); if ( pInputWin && pInputWin->GetInputHandler() == this ) - pInputWin->SetInputHandler( NULL ); + pInputWin->SetInputHandler( nullptr ); delete pRangeFindList; delete pEditDefaults; @@ -603,7 +603,7 @@ void ScInputHandler::UpdateRefDevice() if ( bTextWysiwyg && pActiveViewSh ) pEngine->SetRefDevice( pActiveViewSh->GetViewData().GetDocument()->GetPrinter() ); else - pEngine->SetRefDevice( NULL ); + pEngine->SetRefDevice( nullptr ); MapMode aMode( MAP_100TH_MM, Point(), aScaleX, aScaleY ); pEngine->SetRefMapMode( aMode ); @@ -626,7 +626,7 @@ void ScInputHandler::ImplCreateEditEngine() pEngine = new ScFieldEditEngine(&rDoc, rDoc.GetEnginePool(), rDoc.GetEditPool()); } else - pEngine = new ScFieldEditEngine(NULL, EditEngine::CreatePool(), NULL, true); + pEngine = new ScFieldEditEngine(nullptr, EditEngine::CreatePool(), nullptr, true); pEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( pEngine->GetWordDelimiters() ) ); UpdateRefDevice(); // also sets MapMode pEngine->SetPaperSize( Size( 1000000, 1000000 ) ); @@ -785,7 +785,7 @@ void ScInputHandler::HideTip() pTipVisibleParent->RemoveEventListener( LINK( this, ScInputHandler, ShowHideTipVisibleParentListener ) ); Help::HideTip( nTipVisible ); nTipVisible = 0; - pTipVisibleParent = NULL; + pTipVisibleParent = nullptr; } aManualTip.clear(); } @@ -797,7 +797,7 @@ void ScInputHandler::HideTipBelow() pTipVisibleSecParent->RemoveEventListener( LINK( this, ScInputHandler, ShowHideTipVisibleSecParentListener ) ); Help::HideTip( nTipVisibleSec ); nTipVisibleSec = 0; - pTipVisibleSecParent = NULL; + pTipVisibleSecParent = nullptr; } aManualTip.clear(); } @@ -818,7 +818,7 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) sal_Int32 nNextFStart = aHelper.GetFunctionStart( rSelText, nLeftParentPos, true); const IFunctionDescription* ppFDesc; ::std::vector< OUString> aArgs; - if( aHelper.GetNextFunc( rSelText, false, nNextFStart, NULL, &ppFDesc, &aArgs ) ) + if( aHelper.GetNextFunc( rSelText, false, nNextFStart, nullptr, &ppFDesc, &aArgs ) ) { if( !ppFDesc->getFunctionName().isEmpty() ) { @@ -1658,8 +1658,8 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // Executed synchron if ( pViewSh == pActiveViewSh ) { delete pLastState; - pLastState = NULL; - pLastPattern = NULL; + pLastState = nullptr; + pLastPattern = nullptr; } if ( pViewSh == pRefViewSh ) @@ -1668,9 +1668,9 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // Executed synchron // We end the EditMode anyways EnterHandler(); bFormulaMode = false; - pRefViewSh = NULL; + pRefViewSh = nullptr; SfxGetpApp()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) ); - SC_MOD()->SetRefInputHdl(NULL); + SC_MOD()->SetRefInputHdl(nullptr); if (pInputWin) pInputWin->SetFormulaMode(false); UpdateAutoCorrFlag(); @@ -1681,7 +1681,7 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // Executed synchron if ( pActiveViewSh && pActiveViewSh == pViewSh ) { OSL_FAIL("pActiveViewSh is gone"); - pActiveViewSh = NULL; + pActiveViewSh = nullptr; } if ( SC_MOD()->GetInputOptions().GetTextWysiwyg() ) @@ -1699,7 +1699,7 @@ void ScInputHandler::UpdateActiveView() vcl::Window* pShellWin = pActiveViewSh ? pActiveViewSh->GetWindowByPos( pActiveViewSh->GetViewData().GetEditActivePart() ) : - NULL; + nullptr; sal_uInt16 nCount = pEngine->GetViewCount(); if (nCount > 0) @@ -1714,7 +1714,7 @@ void ScInputHandler::UpdateActiveView() } } else - pTableView = NULL; + pTableView = nullptr; // setup the pTableView editeng for tiled rendering to get cursor and selections if (pActiveViewSh && pTableView) @@ -1732,7 +1732,7 @@ void ScInputHandler::UpdateActiveView() if (pInputWin && eMode == SC_INPUT_TOP ) pTopView = pInputWin->GetEditView(); else - pTopView = NULL; + pTopView = nullptr; } void ScInputHandler::SetInputWindow( ScInputWindow* pNew ) @@ -1745,7 +1745,7 @@ void ScInputHandler::StopInputWinEngine( bool bAll ) if (pInputWin) pInputWin->StopEditEngine( bAll ); - pTopView = NULL; // invalid now + pTopView = nullptr; // invalid now } EditView* ScInputHandler::GetActiveView() @@ -1756,7 +1756,7 @@ EditView* ScInputHandler::GetActiveView() void ScInputHandler::ForgetLastPattern() { - pLastPattern = NULL; + pLastPattern = nullptr; if ( !pLastState && pActiveViewSh ) pActiveViewSh->UpdateInputHandler( true ); // Get status again else @@ -2207,9 +2207,9 @@ void ScInputHandler::UpdateFormulaMode() { ShowRefFrame(); bFormulaMode = false; - pRefViewSh = NULL; + pRefViewSh = nullptr; pSfxApp->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) ); - SC_MOD()->SetRefInputHdl(NULL); + SC_MOD()->SetRefInputHdl(nullptr); if (pInputWin) pInputWin->SetFormulaMode(false); UpdateAutoCorrFlag(); @@ -2418,8 +2418,8 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) bool bMatrix = ( nBlockMode == ScEnterMode::MATRIX ); SfxApplication* pSfxApp = SfxGetpApp(); - EditTextObject* pObject = NULL; - ScPatternAttr* pCellAttrs = NULL; + EditTextObject* pObject = nullptr; + ScPatternAttr* pCellAttrs = nullptr; bool bForget = false; // Remove due to validity? OUString aString = GetEditText(pEngine); @@ -2434,7 +2434,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) lcl_SelectionToEnd(pTableView); } - vcl::Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : NULL; + vcl::Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : nullptr; if (pTopView) pTopView->CompleteAutoCorrect(); // CompleteAutoCorrect for both Views @@ -2534,12 +2534,12 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) ESelection aSel( 0, 0, nParCnt-1, pEngine->GetTextLen(nParCnt-1) ); SfxItemSet aOldAttribs = pEngine->GetAttribs( aSel ); - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; // Find common (cell) attributes before RemoveAdjust if ( pActiveViewSh && bUniformAttribs ) { - SfxItemSet* pCommonAttrs = NULL; + SfxItemSet* pCommonAttrs = nullptr; for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END; nId++) { SfxItemState eState = aOldAttribs.GetItemState( nId, false, &pItem ); @@ -2640,12 +2640,12 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) bFormulaMode = false; pSfxApp->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) ); - SC_MOD()->SetRefInputHdl(NULL); + SC_MOD()->SetRefInputHdl(nullptr); if (pInputWin) pInputWin->SetFormulaMode(false); UpdateAutoCorrFlag(); } - pRefViewSh = NULL; // Also without FormulaMode due to FunctionsAutoPilot + pRefViewSh = nullptr; // Also without FormulaMode due to FunctionsAutoPilot DeleteRangeFinder(); ResetAutoPar(); @@ -2658,7 +2658,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) // Text input (through number formats) or ApplySelectionPattern modify // the cell's attributes, so pLastPattern is no longer valid - pLastPattern = NULL; + pLastPattern = nullptr; if (bOldMod && !bProtected && !bForget) { @@ -2715,12 +2715,12 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) const SfxPoolItem* aArgs[2]; aArgs[0] = &aItem; - aArgs[1] = NULL; + aArgs[1] = nullptr; rBindings.Execute( nId, aArgs ); } delete pLastState; // pLastState still contains the old text - pLastState = NULL; + pLastState = nullptr; } else pSfxApp->Broadcast( SfxSimpleHint( FID_KILLEDITVIEW ) ); @@ -2768,12 +2768,12 @@ void ScInputHandler::CancelHandler() } bFormulaMode = false; SfxGetpApp()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) ); - SC_MOD()->SetRefInputHdl(NULL); + SC_MOD()->SetRefInputHdl(nullptr); if (pInputWin) pInputWin->SetFormulaMode(false); UpdateAutoCorrFlag(); } - pRefViewSh = NULL; // Also without FormulaMode due to FunctionsAutoPilot + pRefViewSh = nullptr; // Also without FormulaMode due to FunctionsAutoPilot DeleteRangeFinder(); ResetAutoPar(); @@ -3184,7 +3184,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false { if (pTableView) { - vcl::Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : NULL; + vcl::Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : nullptr; if ( pTableView->PostKeyEvent( rKEvt, pFrameWin ) ) bUsed = true; } @@ -3398,7 +3398,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState, if ( pState != pLastState ) { delete pLastState; - pLastState = pState ? new ScInputHdlState( *pState ) : NULL; + pLastState = pState ? new ScInputHdlState( *pState ) : nullptr; } if ( pState && pActiveViewSh ) @@ -3573,7 +3573,7 @@ void ScInputHandler::UpdateCellAdjust( SvxCellHorJustify eJust ) void ScInputHandler::ResetDelayTimer() { - if(pDelayTimer!=NULL) + if(pDelayTimer!=nullptr) { DELETEZ( pDelayTimer ); @@ -3590,7 +3590,7 @@ IMPL_LINK_TYPED( ScInputHandler, DelayTimer, Timer*, pTimer, void ) { DELETEZ( pDelayTimer ); - if ( NULL == pLastState || SC_MOD()->IsFormulaMode() || SC_MOD()->IsRefDialogOpen()) + if ( nullptr == pLastState || SC_MOD()->IsFormulaMode() || SC_MOD()->IsRefDialogOpen()) { //! New method at ScModule to query if function autopilot is open SfxViewFrame* pViewFrm = SfxViewFrame::Current(); @@ -3606,7 +3606,7 @@ IMPL_LINK_TYPED( ScInputHandler, DelayTimer, Timer*, pTimer, void ) { bInOwnChange = true; // disable ModifyHdl (reset below) - pActiveViewSh = NULL; + pActiveViewSh = nullptr; pEngine->SetText( EMPTY_OUSTRING ); if ( pInputWin ) { @@ -3726,7 +3726,7 @@ EditView* ScInputHandler::GetFuncEditView() { UpdateActiveView(); // Due to pTableView - EditView* pView = NULL; + EditView* pView = nullptr; if ( pInputWin ) { pInputWin->MakeDialogEditView(); @@ -3825,12 +3825,12 @@ ScInputHdlState::ScInputHdlState( const ScAddress& rCurPos, aStartPos ( rStartPos ), aEndPos ( rEndPos ), aString ( rString ), - pEditData ( pData ? pData->Clone() : NULL ) + pEditData ( pData ? pData->Clone() : nullptr ) { } ScInputHdlState::ScInputHdlState( const ScInputHdlState& rCpy ) - : pEditData ( NULL ) + : pEditData ( nullptr ) { *this = rCpy; } @@ -3857,7 +3857,7 @@ ScInputHdlState& ScInputHdlState::operator=( const ScInputHdlState& r ) aStartPos = r.aStartPos; aEndPos = r.aEndPos; aString = r.aString; - pEditData = r.pEditData ? r.pEditData->Clone() : NULL; + pEditData = r.pEditData ? r.pEditData->Clone() : nullptr; return *this; } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index d880c974491d..8fe0dc7bcb0d 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -149,7 +149,7 @@ SfxChildWinInfo ScInputWindowWrapper::GetInfo() const static VclPtr<ScTextWndBase> lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBindings* pBind ) { - ScTabViewShell* pViewSh = NULL; + ScTabViewShell* pViewSh = nullptr; SfxDispatcher* pDisp = pBind->GetDispatcher(); if ( pDisp ) { @@ -167,7 +167,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) : aWndPos ( VclPtr<ScPosWnd>::Create(this) ), pRuntimeWindow ( lcl_chooseRuntimeImpl( this, pBind ) ), aTextWindow ( *pRuntimeWindow ), - pInputHdl ( NULL ), + pInputHdl ( nullptr ), aTextOk ( ScResId( SCSTR_QHELP_BTNOK ) ), // Not always new as a Resource aTextCancel ( ScResId( SCSTR_QHELP_BTNCANCEL ) ), aTextSum ( ScResId( SCSTR_QHELP_BTNSUM ) ), @@ -181,7 +181,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) : // #i73615# don't rely on SfxViewShell::Current while constructing the input line // (also for GetInputHdl below) - ScTabViewShell* pViewSh = NULL; + ScTabViewShell* pViewSh = nullptr; SfxDispatcher* pDisp = pBind->GetDispatcher(); if ( pDisp ) { @@ -254,7 +254,7 @@ ScInputWindow::~ScInputWindow() void ScInputWindow::dispose() { - bool bDown = ( ScGlobal::pSysLocale == NULL ); // after Clear? + bool bDown = ( ScGlobal::pSysLocale == nullptr ); // after Clear? // if any view's input handler has a pointer to this input window, reset it // (may be several ones, #74522#) @@ -268,7 +268,7 @@ void ScInputWindow::dispose() ScInputHandler* pHdl = static_cast<ScTabViewShell*>(pSh)->GetInputHandler(); if ( pHdl && pHdl->GetInputWindow() == this ) { - pHdl->SetInputWindow( NULL ); + pHdl->SetInputWindow( nullptr ); pHdl->StopInputWinEngine( false ); // reset pTopView pointer } pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> ); @@ -939,7 +939,7 @@ void ScInputBarGroup::Resize() ScInputWindow *pParent; pParent = dynamic_cast<ScInputWindow*>(w); - if (pParent == NULL) + if (pParent == nullptr) { OSL_FAIL("The parent window pointer pParent is null"); return; @@ -1044,7 +1044,7 @@ IMPL_LINK_NOARG_TYPED(ScInputBarGroup, ClickHdl, Button*, void) ScInputWindow* pParent; pParent = dynamic_cast<ScInputWindow*>(w); - if (pParent == NULL) + if (pParent == nullptr) { OSL_FAIL("The parent window pointer pParent is null"); return; @@ -1094,7 +1094,7 @@ void ScInputBarGroup::TriggerToolboxLayout() else rParent.SetToolbarLayoutMode( TBX_LAYOUT_NORMAL ); xLayoutManager->lock(); - DataChangedEvent aFakeUpdate( DataChangedEventType::SETTINGS, NULL, AllSettingsFlags::STYLE ); + DataChangedEvent aFakeUpdate( DataChangedEventType::SETTINGS, nullptr, AllSettingsFlags::STYLE ); // this basically will trigger the reposititioning of the // items in the toolbar from ImplFormat ( which is controlled by @@ -1320,7 +1320,7 @@ void ScMultiTextWnd::InitEditEngine() { ScFieldEditEngine* pNew; ScTabViewShell* pViewSh = GetViewShell(); - ScDocShell* pDocSh = NULL; + ScDocShell* pDocSh = nullptr; if ( pViewSh ) { pDocSh = pViewSh->GetViewData().GetDocShell(); @@ -1328,7 +1328,7 @@ void ScMultiTextWnd::InitEditEngine() pNew = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool()); } else - pNew = new ScFieldEditEngine(NULL, EditEngine::CreatePool(), NULL, true); + pNew = new ScFieldEditEngine(nullptr, EditEngine::CreatePool(), nullptr, true); pNew->SetExecuteURL( false ); pEditEngine = pNew; @@ -1420,8 +1420,8 @@ void ScMultiTextWnd::SetTextString( const OUString& rNewString ) ScTextWnd::ScTextWnd( vcl::Window* pParent, ScTabViewShell* pViewSh ) : ScTextWndBase(pParent, WinBits(WB_HIDE | WB_BORDER)), DragSourceHelper(this), - pEditEngine (NULL), - pEditView (NULL), + pEditEngine (nullptr), + pEditView (nullptr), bIsInsertMode(true), bFormulaMode (false), bInputMode (false), @@ -1470,9 +1470,9 @@ void ScTextWnd::dispose() maAccTextDatas.back()->Dispose(); } delete pEditView; - pEditView = NULL; + pEditView = nullptr; delete pEditEngine; - pEditEngine = NULL; + pEditEngine = nullptr; ScTextWndBase::dispose(); } @@ -1577,7 +1577,7 @@ void ScTextWnd::Command( const CommandEvent& rCEvt ) { // Is dragged onto another View? ScTabViewShell* pEndViewSh = ScTabViewShell::GetActiveViewShell(); - if ( pEndViewSh != pStartViewSh && pStartViewSh != NULL ) + if ( pEndViewSh != pStartViewSh && pStartViewSh != nullptr ) { ScViewData& rViewData = pStartViewSh->GetViewData(); ScInputHandler* pHdl = pScMod->GetInputHdl( pStartViewSh ); @@ -1707,7 +1707,7 @@ void ScTextWnd::StartEditEngine() pNew = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool()); } else - pNew = new ScFieldEditEngine(NULL, EditEngine::CreatePool(), NULL, true); + pNew = new ScFieldEditEngine(nullptr, EditEngine::CreatePool(), nullptr, true); pNew->SetExecuteURL( false ); pEditEngine = pNew; @@ -1949,7 +1949,7 @@ void ScTextWnd::MakeDialogEditView() pNew = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool()); } else - pNew = new ScFieldEditEngine(NULL, EditEngine::CreatePool(), NULL, true); + pNew = new ScFieldEditEngine(nullptr, EditEngine::CreatePool(), nullptr, true); pNew->SetExecuteURL( false ); pEditEngine = pNew; @@ -1994,7 +1994,7 @@ void ScTextWnd::ImplInitSettings() css::uno::Reference< css::accessibility::XAccessible > ScTextWnd::CreateAccessible() { - return new ScAccessibleEditObject(GetAccessibleParentWindow()->GetAccessible(), NULL, this, + return new ScAccessibleEditObject(GetAccessibleParentWindow()->GetAccessible(), nullptr, this, OUString(ScResId(STR_ACC_EDITLINE_NAME)), OUString(ScResId(STR_ACC_EDITLINE_DESCR)), ScAccessibleEditObject::EditLine); } @@ -2036,7 +2036,7 @@ void ScTextWnd::TextGrabFocus() ScPosWnd::ScPosWnd( vcl::Window* pParent ) : ComboBox ( pParent, WinBits(WB_HIDE | WB_DROPDOWN) ), - pAccel ( NULL ), + pAccel ( nullptr ), nTipVisible ( 0 ), bFormulaMode( false ) { diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx index ee6d269e7018..f39fd78bc62a 100644 --- a/sc/source/ui/app/msgpool.cxx +++ b/sc/source/ui/app/msgpool.cxx @@ -41,16 +41,16 @@ static SfxItemInfo const aMsgItemInfos[] = ScMessagePool::ScMessagePool() : SfxItemPool ( OUString("ScMessagePool"), MSGPOOL_START, MSGPOOL_END, - aMsgItemInfos, NULL ), + aMsgItemInfos, nullptr ), aGlobalStringItem ( SfxStringItem ( SCITEM_STRING, OUString() ) ), aGlobalSearchItem ( SvxSearchItem ( SCITEM_SEARCHDATA ) ), - aGlobalSortItem ( ScSortItem ( SCITEM_SORTDATA, NULL ) ), - aGlobalQueryItem ( ScQueryItem ( SCITEM_QUERYDATA, NULL, NULL ) ), - aGlobalSubTotalItem ( ScSubTotalItem ( SCITEM_SUBTDATA, NULL, NULL ) ), - aGlobalConsolidateItem ( ScConsolidateItem ( SCITEM_CONSOLIDATEDATA, NULL ) ), - aGlobalPivotItem ( ScPivotItem ( SCITEM_PIVOTDATA, NULL, NULL, false ) ), - aGlobalSolveItem ( ScSolveItem ( SCITEM_SOLVEDATA, NULL ) ), + aGlobalSortItem ( ScSortItem ( SCITEM_SORTDATA, nullptr ) ), + aGlobalQueryItem ( ScQueryItem ( SCITEM_QUERYDATA, nullptr, nullptr ) ), + aGlobalSubTotalItem ( ScSubTotalItem ( SCITEM_SUBTDATA, nullptr, nullptr ) ), + aGlobalConsolidateItem ( ScConsolidateItem ( SCITEM_CONSOLIDATEDATA, nullptr ) ), + aGlobalPivotItem ( ScPivotItem ( SCITEM_PIVOTDATA, nullptr, nullptr, false ) ), + aGlobalSolveItem ( ScSolveItem ( SCITEM_SOLVEDATA, nullptr ) ), aGlobalUserListItem ( ScUserListItem ( SCITEM_USERLIST ) ), aPrintWarnItem ( SfxBoolItem ( SCITEM_PRINTWARN, false ) ) @@ -78,7 +78,7 @@ ScMessagePool::ScMessagePool() ScMessagePool::~ScMessagePool() { Delete(); - SetSecondaryPool( NULL ); // before deleting defaults (accesses defaults) + SetSecondaryPool( nullptr ); // before deleting defaults (accesses defaults) for ( sal_uInt16 i=0; i <= MSGPOOL_END-MSGPOOL_START; i++ ) SetRefCount( *ppPoolDefaults[i], 0 ); diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 9c9315362145..6327a373fb94 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -133,24 +133,24 @@ ScModule::ScModule( SfxObjectFactory* pFact ) : SfxModule( ResMgr::CreateResMgr( "sc" ), false, pFact, NULL ), mpDragData(new ScDragData), mpClipData(new ScClipData), - pSelTransfer( NULL ), - pMessagePool( NULL ), - pRefInputHandler( NULL ), - pViewCfg( NULL ), - pDocCfg( NULL ), - pAppCfg( NULL ), - pDefaultsCfg( NULL ), - pFormulaCfg( NULL ), - pInputCfg( NULL ), - pPrintCfg( NULL ), - pNavipiCfg( NULL ), - pAddInCfg( NULL ), - pColorConfig( NULL ), - pAccessOptions( NULL ), - pCTLOptions( NULL ), - pUserOptions( NULL ), - pErrorHdl( NULL ), - pFormEditData( NULL ), + pSelTransfer( nullptr ), + pMessagePool( nullptr ), + pRefInputHandler( nullptr ), + pViewCfg( nullptr ), + pDocCfg( nullptr ), + pAppCfg( nullptr ), + pDefaultsCfg( nullptr ), + pFormulaCfg( nullptr ), + pInputCfg( nullptr ), + pPrintCfg( nullptr ), + pNavipiCfg( nullptr ), + pAddInCfg( nullptr ), + pColorConfig( nullptr ), + pAccessOptions( nullptr ), + pCTLOptions( nullptr ), + pUserOptions( nullptr ), + pErrorHdl( nullptr ), + pFormEditData( nullptr ), nCurRefDlgId( 0 ), bIsWaterCan( false ), bIsInEditCommand( false ), @@ -162,7 +162,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) : SetName("StarCalc"); // for Basic ResetDragObject(); - SetClipObject( NULL, NULL ); + SetClipObject( nullptr, nullptr ); // InputHandler does not need to be created @@ -367,7 +367,7 @@ void ScModule::DeleteCfg() void ScModule::Execute( SfxRequest& rReq ) { SfxViewFrame* pViewFrm = SfxViewFrame::Current(); - SfxBindings* pBindings = pViewFrm ? &pViewFrm->GetBindings() : NULL; + SfxBindings* pBindings = pViewFrm ? &pViewFrm->GetBindings() : nullptr; const SfxItemSet* pReqArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -567,7 +567,7 @@ void ScModule::Execute( SfxRequest& rReq ) void ScModule::GetState( SfxItemSet& rSet ) { ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() ); - bool bTabView = pDocSh && (pDocSh->GetBestViewShell() != NULL); + bool bTabView = pDocSh && (pDocSh->GetBestViewShell() != nullptr); SfxWhichIter aIter(rSet); for (sal_uInt16 nWhich = aIter.FirstWhich(); nWhich; nWhich = aIter.NextWhich()) @@ -628,9 +628,9 @@ void ScModule::HideDisabledSlots( SfxItemSet& rSet ) void ScModule::ResetDragObject() { - mpDragData->pCellTransfer = NULL; - mpDragData->pDrawTransfer = NULL; - mpDragData->pJumpLocalDoc = NULL; + mpDragData->pCellTransfer = nullptr; + mpDragData->pDrawTransfer = nullptr; + mpDragData->pJumpLocalDoc = nullptr; (mpDragData->aLinkDoc).clear(); (mpDragData->aLinkTable).clear(); (mpDragData->aLinkArea).clear(); @@ -675,11 +675,11 @@ void ScModule::SetClipObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawO ScDocument* ScModule::GetClipDoc() { // called from document - ScTransferObj* pObj = ScTransferObj::GetOwnClipboard( NULL ); + ScTransferObj* pObj = ScTransferObj::GetOwnClipboard( nullptr ); if (pObj) return pObj->GetDocument(); - return NULL; + return nullptr; } void ScModule::SetSelectionTransfer( ScSelectionTransferObj* pNew ) @@ -955,12 +955,12 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet ) OSL_ENSURE( pInputCfg, "InputOptions not initialised :-(" ); SfxViewFrame* pViewFrm = SfxViewFrame::Current(); - SfxBindings* pBindings = pViewFrm ? &pViewFrm->GetBindings() : NULL; + SfxBindings* pBindings = pViewFrm ? &pViewFrm->GetBindings() : nullptr; ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() ); ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() ); - ScDocument* pDoc = pDocSh ? &pDocSh->GetDocument() : NULL; - const SfxPoolItem* pItem = NULL; + ScDocument* pDoc = pDocSh ? &pDocSh->GetDocument() : nullptr; + const SfxPoolItem* pItem = nullptr; bool bRepaint = false; bool bUpdateMarks = false; bool bUpdateRefDev = false; @@ -1371,7 +1371,7 @@ ScInputHandler* ScModule::GetInputHdl( ScTabViewShell* pViewSh, bool bUseRef ) if ( pRefInputHandler && bUseRef ) return pRefInputHandler; - ScInputHandler* pHdl = NULL; + ScInputHandler* pHdl = nullptr; if ( !pViewSh ) { // in case a UIActive embedded object has no ViewShell (UNO component) @@ -1582,7 +1582,7 @@ static SfxChildWindow* lcl_GetChildWinFromAnyView( sal_uInt16 nId ) SfxViewFrame* pViewFrm = SfxViewFrame::Current(); // #i46999# current view frame can be null (for example, when closing help) - SfxChildWindow* pChildWnd = pViewFrm ? pViewFrm->GetChildWindow( nId ) : NULL; + SfxChildWindow* pChildWnd = pViewFrm ? pViewFrm->GetChildWindow( nId ) : nullptr; if ( pChildWnd ) return pChildWnd; // found in the current view @@ -1599,7 +1599,7 @@ static SfxChildWindow* lcl_GetChildWinFromAnyView( sal_uInt16 nId ) pViewFrm = SfxViewFrame::GetNext( *pViewFrm ); } - return NULL; // none found + return nullptr; // none found } bool ScModule::IsModalMode(SfxObjectShell* pDocSh) @@ -1940,7 +1940,7 @@ IMPL_LINK_NOARG_TYPED(ScModule, SpellTimerHdl, Idle *, void) */ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId ) { - SfxItemSet* pRet = 0; + SfxItemSet* pRet = nullptr; if(SID_SC_EDITOPTIONS == nId) { pRet = new SfxItemSet( GetPool(), @@ -2224,12 +2224,12 @@ bool ScModule::UnregisterRefWindow( sal_uInt16 nSlotId, vcl::Window *pWnd ) vcl::Window * ScModule::Find1RefWindow( sal_uInt16 nSlotId, vcl::Window *pWndAncestor ) { if (!pWndAncestor) - return NULL; + return nullptr; auto iSlot = m_mapRefWindow.find( nSlotId ); if( iSlot == m_mapRefWindow.end() ) - return NULL; + return nullptr; std::list<VclPtr<vcl::Window> > & rlRefWindow = iSlot->second; @@ -2239,7 +2239,7 @@ vcl::Window * ScModule::Find1RefWindow( sal_uInt16 nSlotId, vcl::Window *pWndAn if ( pWndAncestor->IsWindowOrChild( *i, (*i)->IsSystemWindow() ) ) return *i; - return NULL; + return nullptr; } using namespace com::sun::star; diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index 488ae52c644e..ead955f31c2d 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -69,7 +69,7 @@ static bool lcl_IsURLButton( SdrObject* pObject ) ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView ) { - ScSelectionTransferObj* pRet = NULL; + ScSelectionTransferObj* pRet = nullptr; try { @@ -142,8 +142,8 @@ ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView ScSelectionTransferObj::ScSelectionTransferObj( ScTabView* pSource, ScSelectionTransferMode eNewMode ) : pView( pSource ), eMode( eNewMode ), - pCellData( NULL ), - pDrawData( NULL ) + pCellData( nullptr ), + pDrawData( nullptr ) { //! store range for StillValid } @@ -157,7 +157,7 @@ ScSelectionTransferObj::~ScSelectionTransferObj() // (CopyToSelection has no effect under Windows) ForgetView(); - pScMod->SetSelectionTransfer( NULL ); + pScMod->SetSelectionTransfer( nullptr ); } OSL_ENSURE( !pView, "ScSelectionTransferObj dtor: ForgetView not called" ); @@ -165,18 +165,18 @@ ScSelectionTransferObj::~ScSelectionTransferObj() void ScSelectionTransferObj::ForgetView() { - pView = NULL; + pView = nullptr; eMode = SC_SELTRANS_INVALID; if (pCellData) { pCellData->release(); - pCellData = NULL; + pCellData = nullptr; } if (pDrawData) { pDrawData->release(); - pDrawData = NULL; + pDrawData = nullptr; } } @@ -285,7 +285,7 @@ void ScSelectionTransferObj::CreateCellData() // (this may be called from pasting into the edit line) bool bCopied = rViewData.GetView()->CopyToClip( pClipDoc, false, true, true, false ); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); if ( bCopied ) { @@ -338,7 +338,7 @@ void ScSelectionTransferObj::CreateDrawData() ScDrawLayer::SetGlobalDrawPersist(aDragShellRef); SdrModel* pModel = pDrawView->GetMarkedObjModel(); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); ScViewData& rViewData = pView->GetViewData(); ScDocShell* pDocSh = rViewData.GetDocShell(); @@ -421,7 +421,7 @@ void ScSelectionTransferObj::ObjectReleased() ScModule* pScMod = SC_MOD(); if ( pScMod->GetSelectionTransfer() == this ) - pScMod->SetSelectionTransfer( NULL ); + pScMod->SetSelectionTransfer( nullptr ); TransferableHelper::ObjectReleased(); } diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index b539596c26ba..85f65e2dc168 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -100,7 +100,7 @@ void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPr Point aPoint; Rectangle aBound( aPoint, pDev->GetOutputSize() ); //! use size from clip area? - ScViewData aViewData(NULL,NULL); + ScViewData aViewData(nullptr,nullptr); aViewData.InitData( pDoc ); aViewData.SetTabNo( rBlock.aEnd.Tab() ); @@ -181,7 +181,7 @@ ScTransferObj::~ScTransferObj() if ( pScMod->GetClipData().pCellClipboard == this ) { OSL_FAIL("ScTransferObj wasn't released"); - pScMod->SetClipObject( NULL, NULL ); + pScMod->SetClipObject( nullptr, nullptr ); } if ( pScMod->GetDragData().pCellTransfer == this ) { @@ -212,7 +212,7 @@ ScTransferObj* ScTransferObj::GetOwnClipboard( vcl::Window* pUIWin ) if ( !aDataHelper.HasFormat( SotClipboardFormatId::DIF ) ) { // OSL_FAIL("ScTransferObj wasn't released"); - pObj = NULL; + pObj = nullptr; } } return pObj; @@ -482,7 +482,7 @@ void ScTransferObj::ObjectReleased() { ScModule* pScMod = SC_MOD(); if ( pScMod->GetClipData().pCellClipboard == this ) - pScMod->SetClipObject( NULL, NULL ); + pScMod->SetClipObject( nullptr, nullptr ); TransferableHelper::ObjectReleased(); } @@ -506,7 +506,7 @@ void ScTransferObj::DragFinished( sal_Int8 nDropAction ) if ( pScMod->GetDragData().pCellTransfer == this ) pScMod->ResetDragObject(); - xDragSourceRanges = NULL; // don't keep source after dropping + xDragSourceRanges = nullptr; // don't keep source after dropping TransferableHelper::DragFinished( nDropAction ); } @@ -554,7 +554,7 @@ ScDocument* ScTransferObj::GetSourceDocument() ScDocShell* pSourceDocSh = GetSourceDocShell(); if (pSourceDocSh) return &pSourceDocSh->GetDocument(); - return NULL; + return nullptr; } ScDocShell* ScTransferObj::GetSourceDocShell() @@ -563,7 +563,7 @@ ScDocShell* ScTransferObj::GetSourceDocShell() if (pRangesObj) return pRangesObj->GetDocShell(); - return NULL; // none set + return nullptr; // none set } ScMarkData ScTransferObj::GetSourceMarkData() @@ -646,7 +646,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize) bool bWasCut = pDoc->IsCutMode(); if (!bWasCut) pDoc->SetClipArea( aDestRange, true ); // Cut - rDestDoc.CopyFromClip( aDestRange, aDestMark, InsertDeleteFlags::ALL, NULL, pDoc, false ); + rDestDoc.CopyFromClip( aDestRange, aDestMark, InsertDeleteFlags::ALL, nullptr, pDoc, false ); pDoc->SetClipArea( aDestRange, bWasCut ); StripRefs( pDoc, nStartX,nStartY, nEndX,nEndY, &rDestDoc ); @@ -672,7 +672,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize) pDestPool->CopyStyleFrom( pStylePool, aStyleName, SFX_STYLE_FAMILY_PAGE ); } - ScViewData aViewData( pDocSh, NULL ); + ScViewData aViewData( pDocSh, nullptr ); aViewData.SetScreen( nStartX,nStartY, nEndX,nEndY ); aViewData.SetCurX( nStartX ); aViewData.SetCurY( nStartY ); @@ -742,7 +742,7 @@ SfxObjectShell* ScTransferObj::SetDrawClipDoc( bool bAnyOle ) else { ScGlobal::xDrawClipDocShellRef.Clear(); - return NULL; + return nullptr; } } diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index 6bf0f365ce10..0002c815ecd7 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -42,26 +42,26 @@ ScAttrDlg::ScAttrDlg(SfxViewFrame* pFrameP, vcl::Window* pParent, const SfxItemS OSL_ENSURE(pFact, "Dialog creation failed!"); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!"); - m_nNumberPageId = AddTabPage( "numbers", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 0 ); + m_nNumberPageId = AddTabPage( "numbers", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), nullptr ); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!"); - m_nFontPageId = AddTabPage( "font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 ); + m_nFontPageId = AddTabPage( "font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), nullptr ); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!"); - AddTabPage( "fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 ); + AddTabPage( "fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr ); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!"); - AddTabPage( "alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 ); + AddTabPage( "alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), nullptr ); if ( aCJKOptions.IsAsianTypographyEnabled() ) { OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!"); - AddTabPage( "asiantypography", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), 0 ); + AddTabPage( "asiantypography", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), nullptr ); } else RemoveTabPage( "asiantypography" ); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); - AddTabPage( "borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 ); + AddTabPage( "borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), nullptr ); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - AddTabPage( "background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 ); - AddTabPage( "cellprotection" , ScTabPageProtection::Create, 0 ); + AddTabPage( "background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr ); + AddTabPage( "cellprotection" , ScTabPageProtection::Create, nullptr ); } ScAttrDlg::~ScAttrDlg() @@ -90,7 +90,7 @@ void ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) IMPL_LINK_NOARG_TYPED(ScAttrDlg, OkHandler, SfxPoolItem*, void) { - GetOKButton().GetClickHdl().Call( NULL ); + GetOKButton().GetClickHdl().Call( nullptr ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx index cd8d1b7ce54f..a11e45a9034e 100644 --- a/sc/source/ui/attrdlg/scabstdlg.cxx +++ b/sc/source/ui/attrdlg/scabstdlg.cxx @@ -38,7 +38,7 @@ extern "C" ScAbstractDialogFactory* ScCreateDialogFactory(); ScAbstractDialogFactory* ScAbstractDialogFactory::Create() { - ScFuncPtrCreateDialogFactory fp = 0; + ScFuncPtrCreateDialogFactory fp = nullptr; #if HAVE_FEATURE_DESKTOP #ifndef DISABLE_DYNLOADING static ::osl::Module aDialogLibrary; @@ -56,7 +56,7 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create() #endif if ( fp ) return fp(); - return 0; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index b4881436ded6..3f7e5a0eb8e6 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -646,7 +646,7 @@ AbstractScCondFormatManagerDlg* ScAbstractDialogFactory_Impl::CreateScCondFormat if(pDlg) return new AbstractScCondFormatManagerDlg_Impl( pDlg ); - return NULL; + return nullptr; } AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg(vcl::Window* pParent) @@ -678,7 +678,7 @@ AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSe if ( pDlg ) return new AbstractScDataPilotServiceDlg_Impl( pDlg ); - return 0; + return nullptr; } AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg(vcl::Window* pParent, @@ -740,7 +740,7 @@ AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( v if ( pDlg ) return new AbstractScInsertCellDlg_Impl( pDlg ); - return 0; + return nullptr; } AbstractScInsertContentsDlg * ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg( vcl::Window* pParent, @@ -838,7 +838,7 @@ AbstractScDPNumGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg( { if( nId == RID_SCDLG_DPNUMGROUP ) return new AbstractScDPNumGroupDlg_Impl( VclPtr<ScDPNumGroupDlg>::Create( pParent, rInfo ) ); - return 0; + return nullptr; } AbstractScDPDateGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg( @@ -847,7 +847,7 @@ AbstractScDPDateGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg( { if( nId == RID_SCDLG_DPDATEGROUP ) return new AbstractScDPDateGroupDlg_Impl( VclPtr<ScDPDateGroupDlg>::Create( pParent, rInfo, nDatePart, rNullDate ) ); - return 0; + return nullptr; } AbstractScDPShowDetailDlg * ScAbstractDialogFactory_Impl::CreateScDPShowDetailDlg ( @@ -855,7 +855,7 @@ AbstractScDPShowDetailDlg * ScAbstractDialogFactory_Impl::CreateScDPShowDetailDl { if( nId == RID_SCDLG_DPSHOWDETAIL ) return new AbstractScDPShowDetailDlg_Impl( VclPtr<ScDPShowDetailDlg>::Create( pParent, rDPObj, nOrient ) ); - return 0; + return nullptr; } AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg(vcl::Window* pParent, const OUString& rName, @@ -956,7 +956,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( SfxViewF break; } - return pDlg ? new ScAbstractTabDialog_Impl( pDlg ) : NULL; + return pDlg ? new ScAbstractTabDialog_Impl( pDlg ) : nullptr; } SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Window* pParent, @@ -977,7 +977,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Wind if ( pDlg ) return new ScAbstractTabDialog_Impl( pDlg ); - return 0; + return nullptr; } SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) @@ -1042,7 +1042,7 @@ CreateTabPage ScAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI break; } - return 0; + return nullptr; } GetTabPageRanges ScAbstractDialogFactory_Impl::GetTabPageRangesFunc() diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index c4ab71e757e9..5971f6c8ec7f 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -225,11 +225,11 @@ class AbstractScInsertTableDlg_Impl : public AbstractScInsertTableDlg DECL_ABSTDLG_BASE( AbstractScInsertTableDlg_Impl, ScInsertTableDlg) virtual bool GetTablesFromFile() override; virtual bool GetTablesAsLink() override; - virtual const OUString* GetFirstTable( sal_uInt16* pN = NULL ) override; + virtual const OUString* GetFirstTable( sal_uInt16* pN = nullptr ) override; virtual ScDocShell* GetDocShellTables() override; virtual bool IsTableBefore() override; virtual sal_uInt16 GetTableCount() override; - virtual const OUString* GetNextTable( sal_uInt16* pN = NULL ) override; + virtual const OUString* GetNextTable( sal_uInt16* pN = nullptr ) override; }; @@ -447,7 +447,7 @@ public: virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( vcl::Window* pParent, InsertDeleteFlags nCheckDefaults = InsertDeleteFlags::NONE, - const OUString* pStrTitle = NULL ) override; + const OUString* pStrTitle = nullptr ) override; virtual AbstractScInsertTableDlg * CreateScInsertTableDlg(vcl::Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile) override; @@ -523,8 +523,8 @@ public: virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( vcl::Window* pParent, bool bAscii = true, - const ScImportOptions* pOptions = NULL, - const OUString* pStrTitle = NULL, + const ScImportOptions* pOptions = nullptr, + const OUString* pStrTitle = nullptr, bool bMultiByte = false, bool bOnlyDbtoolsEncodings = false, bool bImport = true ) override; diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx index 374e8ad74d15..b1e49d5a8cf8 100644 --- a/sc/source/ui/attrdlg/scuiexp.cxx +++ b/sc/source/ui/attrdlg/scuiexp.cxx @@ -54,7 +54,7 @@ namespace scui { - static ScAbstractDialogFactory_Impl* pFactory=NULL; + static ScAbstractDialogFactory_Impl* pFactory=nullptr; ScAbstractDialogFactory_Impl* GetFactory() { if ( !pFactory ) diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx index ba339e42ab85..cd27c35386fe 100644 --- a/sc/source/ui/attrdlg/tabpages.cxx +++ b/sc/source/ui/attrdlg/tabpages.cxx @@ -83,7 +83,7 @@ void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs ) // Initialize variables sal_uInt16 nWhich = GetWhich( SID_SCATTR_PROTECTION ); - const ScProtectionAttr* pProtAttr = NULL; + const ScProtectionAttr* pProtAttr = nullptr; SfxItemState eItemState = rCoreAttrs->GetItemState( nWhich, false, reinterpret_cast<const SfxPoolItem**>(&pProtAttr) ); @@ -92,7 +92,7 @@ void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs ) pProtAttr = static_cast<const ScProtectionAttr*>(&(rCoreAttrs->Get(nWhich))); // At SfxItemState::DONTCARE let to 0 - bTriEnabled = ( pProtAttr == NULL ); // TriState, when DontCare + bTriEnabled = ( pProtAttr == nullptr ); // TriState, when DontCare bDontCare = bTriEnabled; if (bTriEnabled) { diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index b3a2e2cc4e86..f6e3cce92ffc 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -168,7 +168,7 @@ void ScDataBarSettingsDlg::Init() if ( pDocSh ) { const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem != NULL ) + if ( pItem != nullptr ) pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); } if ( pColorTable.is() ) diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index aa0c6f75c938..9e91618e2c5f 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -40,8 +40,8 @@ ScCondFormatList::ScCondFormatList(vcl::Window* pParent, WinBits nStyle) : Control(pParent, nStyle | WB_DIALOGCONTROL) , mbHasScrollBar(false) , mpScrollBar(VclPtr<ScrollBar>::Create(this, WB_VERT )) - , mpDoc(NULL) - , mpDialogParent(NULL) + , mpDoc(nullptr) + , mpDialogParent(nullptr) { mpScrollBar->SetScrollHdl( LINK( this, ScCondFormatList, ScrollHdl ) ); mpScrollBar->EnableDrag(); @@ -169,7 +169,7 @@ void ScCondFormatList::Resize() ScConditionalFormat* ScCondFormatList::GetConditionalFormat() const { if(maEntries.empty()) - return NULL; + return nullptr; ScConditionalFormat* pFormat = new ScConditionalFormat(0, mpDoc); for(EntryContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) @@ -425,7 +425,7 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, , mbManaged(bManaged) , maPos(rPos) , mpViewData(pViewData) - , mpLastEdit(NULL) + , mpLastEdit(nullptr) { get(mpBtnOk, "ok"); get(mpBtnAdd, "add"); @@ -560,7 +560,7 @@ ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const { OUString aRangeStr = mpEdRange->GetText(); if(aRangeStr.isEmpty()) - return NULL; + return nullptr; ScRangeList aRange; sal_uInt16 nFlags = aRange.Parse(aRangeStr, mpViewData->GetDocument(), @@ -572,7 +572,7 @@ ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const else { delete pFormat; - pFormat = NULL; + pFormat = nullptr; } return pFormat; @@ -580,7 +580,7 @@ ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const void ScCondFormatDlg::InvalidateRefData() { - mpLastEdit = NULL; + mpLastEdit = nullptr; } // ------------------------------------------------------------- @@ -603,7 +603,7 @@ void ScCondFormatDlg::OkPressed() pFormat, maPos.Tab(), pFormat->GetRange()); else mpViewData->GetDocShell()->GetDocFunc().ReplaceConditionalFormat(maKey, - NULL, maPos.Tab(), ScRangeList()); + nullptr, maPos.Tab(), ScRangeList()); if ( mbManaged ) { @@ -643,8 +643,8 @@ bool ScCondFormatDlg::ParseXmlString(const OUString& sXMLString, OString sTagName; OUString sTagValue; - xmlNodePtr pXmlRoot = NULL; - xmlNodePtr pXmlNode = NULL; + xmlNodePtr pXmlRoot = nullptr; + xmlNodePtr pXmlNode = nullptr; OString sOString = OUStringToOString( sXMLString, RTL_TEXTENCODING_UTF8 ); xmlDocPtr pXmlDoc = xmlParseMemory(sOString.getStr(), sOString.getLength()); @@ -655,12 +655,12 @@ bool ScCondFormatDlg::ParseXmlString(const OUString& sXMLString, pXmlRoot = xmlDocGetRootElement( pXmlDoc ); pXmlNode = pXmlRoot->children; - while (pXmlNode != NULL && bRetVal) + while (pXmlNode != nullptr && bRetVal) { sTagName = OUStringToOString("Index", RTL_TEXTENCODING_UTF8); if (xmlStrcmp(pXmlNode->name, reinterpret_cast<xmlChar const *>(sTagName.getStr())) == 0) { - if (pXmlNode->children != NULL && pXmlNode->children->type == XML_TEXT_NODE) + if (pXmlNode->children != nullptr && pXmlNode->children->type == XML_TEXT_NODE) { sTagValue = OUString(reinterpret_cast<char*>(pXmlNode->children->content), strlen(reinterpret_cast<char*>(pXmlNode->children->content)), @@ -674,7 +674,7 @@ bool ScCondFormatDlg::ParseXmlString(const OUString& sXMLString, sTagName = OUStringToOString("Type", RTL_TEXTENCODING_UTF8); if (xmlStrcmp(pXmlNode->name, reinterpret_cast<xmlChar const *>(sTagName.getStr())) == 0) { - if (pXmlNode->children != NULL && pXmlNode->children->type == XML_TEXT_NODE) + if (pXmlNode->children != nullptr && pXmlNode->children->type == XML_TEXT_NODE) { sTagValue = OUString(reinterpret_cast<char*>(pXmlNode->children->content), strlen(reinterpret_cast<char*>(pXmlNode->children->content)), @@ -688,7 +688,7 @@ bool ScCondFormatDlg::ParseXmlString(const OUString& sXMLString, sTagName = OUStringToOString("Managed", RTL_TEXTENCODING_UTF8); if (xmlStrcmp(pXmlNode->name, reinterpret_cast<xmlChar const *>(sTagName.getStr())) == 0) { - if (pXmlNode->children != NULL && pXmlNode->children->type == XML_TEXT_NODE) + if (pXmlNode->children != nullptr && pXmlNode->children->type == XML_TEXT_NODE) { sTagValue = OUString(reinterpret_cast<char*>(pXmlNode->children->content), strlen(reinterpret_cast<char*>(pXmlNode->children->content)), @@ -717,18 +717,18 @@ OUString ScCondFormatDlg::GenerateXmlString(sal_uInt32 nIndex, sal_uInt8 nType, OString sTagName; OString sTagValue; - xmlNodePtr pXmlRoot = NULL; - xmlNodePtr pXmlNode = NULL; + xmlNodePtr pXmlRoot = nullptr; + xmlNodePtr pXmlNode = nullptr; - xmlChar* pBuffer = NULL; - const xmlChar* pTagName = NULL; - const xmlChar* pTagValue = NULL; + xmlChar* pBuffer = nullptr; + const xmlChar* pTagName = nullptr; + const xmlChar* pTagValue = nullptr; xmlDocPtr pXmlDoc = xmlNewDoc(reinterpret_cast<const xmlChar*>("1.0")); sTagName = OUStringToOString("ScCondFormatDlg", RTL_TEXTENCODING_UTF8); pTagName = reinterpret_cast<const xmlChar*>(sTagName.getStr()); - pXmlRoot = xmlNewDocNode(pXmlDoc, NULL, pTagName, NULL); + pXmlRoot = xmlNewDocNode(pXmlDoc, nullptr, pTagName, nullptr); xmlDocSetRootElement(pXmlDoc, pXmlRoot); @@ -736,7 +736,7 @@ OUString ScCondFormatDlg::GenerateXmlString(sal_uInt32 nIndex, sal_uInt8 nType, sTagValue = OUStringToOString(OUString::number(nIndex), RTL_TEXTENCODING_UTF8); pTagName = reinterpret_cast<const xmlChar*>(sTagName.getStr()); pTagValue = reinterpret_cast<const xmlChar*>(sTagValue.getStr()); - pXmlNode = xmlNewDocNode(pXmlDoc, NULL, pTagName, pTagValue); + pXmlNode = xmlNewDocNode(pXmlDoc, nullptr, pTagName, pTagValue); xmlAddChild(pXmlRoot, pXmlNode); @@ -744,7 +744,7 @@ OUString ScCondFormatDlg::GenerateXmlString(sal_uInt32 nIndex, sal_uInt8 nType, sTagValue = OUStringToOString(OUString::number(nType), RTL_TEXTENCODING_UTF8); pTagName = reinterpret_cast<const xmlChar*>(sTagName.getStr()); pTagValue = reinterpret_cast<const xmlChar*>(sTagValue.getStr()); - pXmlNode = xmlNewDocNode(pXmlDoc, NULL, pTagName, pTagValue); + pXmlNode = xmlNewDocNode(pXmlDoc, nullptr, pTagName, pTagValue); xmlAddChild(pXmlRoot, pXmlNode); @@ -752,7 +752,7 @@ OUString ScCondFormatDlg::GenerateXmlString(sal_uInt32 nIndex, sal_uInt8 nType, sTagValue = OUStringToOString(OUString::boolean(bManaged), RTL_TEXTENCODING_UTF8); pTagName = reinterpret_cast<const xmlChar*>(sTagName.getStr()); pTagValue = reinterpret_cast<const xmlChar*>(sTagValue.getStr()); - pXmlNode = xmlNewDocNode(pXmlDoc, NULL, pTagName, pTagValue); + pXmlNode = xmlNewDocNode(pXmlDoc, nullptr, pTagName, pTagValue); xmlAddChild(pXmlRoot, pXmlNode); diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index b6318a2a43eb..059fbb5eb76d 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -288,7 +288,7 @@ ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const aExpr2 = maEdVal2->GetText(); if (aExpr2.isEmpty()) { - return NULL; + return nullptr; } } @@ -609,7 +609,7 @@ ScFormatEntry* ScFormulaFrmtEntry::createFormulaEntry() const ScConditionMode eMode = SC_COND_DIRECT; OUString aFormula = maEdFormula->GetText(); if(aFormula.isEmpty()) - return NULL; + return nullptr; OUString aExpr2; ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle->GetSelectEntry()); @@ -800,7 +800,7 @@ void ScColorScale2FrmtEntry::Init() if ( pDocSh ) { const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem != NULL ) + if ( pItem != nullptr ) pColorTable = static_cast<const SvxColorListItem*>(pItem) ->GetColorList(); } if ( pColorTable.is() ) @@ -877,7 +877,7 @@ void ScColorScale2FrmtEntry::SetInactive() IMPL_LINK_TYPED( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox&, rBox, void ) { - Edit* pEd = NULL; + Edit* pEd = nullptr; if (&rBox == maLbEntryTypeMin.get()) pEd = maEdMin; else if (&rBox == maLbEntryTypeMax.get()) @@ -980,7 +980,7 @@ void ScColorScale3FrmtEntry::Init() if ( pDocSh ) { const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem != NULL ) + if ( pItem != nullptr ) pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); } if ( pColorTable.is() ) @@ -1069,7 +1069,7 @@ void ScColorScale3FrmtEntry::SetInactive() IMPL_LINK_TYPED( ScColorScale3FrmtEntry, EntryTypeHdl, ListBox&, rBox, void ) { - Edit* pEd = NULL; + Edit* pEd = nullptr; if(&rBox == maLbEntryTypeMin.get()) pEd = maEdMin.get(); else if(&rBox == maLbEntryTypeMiddle.get()) @@ -1402,7 +1402,7 @@ class ScIconSetFrmtDataEntry : public Control public: ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc, - sal_Int32 i, const ScColorScaleEntry* pEntry = NULL ); + sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr ); virtual ~ScIconSetFrmtDataEntry(); virtual void dispose() override; diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index d581bd895342..e3afe8807db4 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -73,7 +73,7 @@ void ScCondFormatManagerWindow::DeleteSelection() { if(GetSelectionCount()) { - for(SvTreeListEntry* pEntry = FirstSelected(); pEntry != NULL; pEntry = NextSelected(pEntry)) + for(SvTreeListEntry* pEntry = FirstSelected(); pEntry != nullptr; pEntry = NextSelected(pEntry)) { sal_Int32 nIndex = maMapLBoxEntryToCondIndex.find(pEntry)->second; mpFormatList->erase(nIndex); @@ -86,7 +86,7 @@ ScConditionalFormat* ScCondFormatManagerWindow::GetSelection() { SvTreeListEntry* pEntry = FirstSelected(); if(!pEntry) - return NULL; + return nullptr; sal_Int32 nIndex = maMapLBoxEntryToCondIndex.find(pEntry)->second; return mpFormatList->GetFormat(nIndex); @@ -104,7 +104,7 @@ void ScCondFormatManagerWindow::setColSizes() ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos): ModalDialog(pParent, "CondFormatManager", "modules/scalc/ui/condformatmanager.ui"), - mpFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : NULL), + mpFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : nullptr), mpDoc(pDoc), maPos(rPos), mbModified(false) @@ -143,7 +143,7 @@ void ScCondFormatManagerDlg::dispose() ScConditionalFormatList* ScCondFormatManagerDlg::GetConditionalFormatList() { ScConditionalFormatList* pList = mpFormatList; - mpFormatList = NULL; + mpFormatList = nullptr; return pList; } diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 447354633405..8ae684b5e538 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -48,11 +48,11 @@ ScRange lclGetRangeForNamedRange(OUString const & aName, ScDocument* pDocument) { ScRange aInvalidRange(ScAddress::INITIALIZE_INVALID); ScRangeName* pRangeName = pDocument->GetRangeName(); - if (pRangeName == NULL) + if (pRangeName == nullptr) return aInvalidRange; const ScRangeData* pData = pRangeName->findByUpperName(aName.toAsciiUpperCase()); - if (pData == NULL) + if (pData == nullptr) return aInvalidRange; ScRange aRange; @@ -69,12 +69,12 @@ ScPivotLayoutDialog::ScPivotLayoutDialog( ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bNewPivotTable) : ScAnyRefDlg (pSfxBindings, pChildWindow, pParent, "PivotTableLayout", "modules/scalc/ui/pivottablelayoutdialog.ui"), maPivotTableObject (*pPivotTableObject), - mpPreviouslyFocusedListBox(NULL), - mpCurrentlyFocusedListBox(NULL), + mpPreviouslyFocusedListBox(nullptr), + mpCurrentlyFocusedListBox(nullptr), mpViewData (pViewData), mpDocument (pViewData->GetDocument()), mbNewPivotTable (bNewPivotTable), - mpActiveEdit (NULL), + mpActiveEdit (nullptr), maAddressDetails (mpDocument->GetAddressConvention(), 0, 0), mbDialogLostFocus (false) { @@ -161,7 +161,7 @@ ScPivotLayoutDialog::ScPivotLayoutDialog( // Initialize Options const ScDPSaveData* pSaveData = maPivotTableObject.GetSaveData(); - if (pSaveData == NULL) + if (pSaveData == nullptr) { mpCheckAddFilter->Check(false); mpCheckDrillToDetail->Check(false); @@ -391,7 +391,7 @@ bool ScPivotLayoutDialog::IsRefInputMode() const void ScPivotLayoutDialog::ItemInserted(ScItemValue* pItemValue, ScPivotLayoutTreeList::SvPivotTreeListType eType) { - if (pItemValue == NULL) + if (pItemValue == nullptr) return; switch (eType) @@ -507,7 +507,7 @@ bool ScPivotLayoutDialog::ApplyChanges() SfxCallMode nCallMode = SfxCallMode::SLOT | SfxCallMode::RECORD; const SfxPoolItem* pResult = pDispatcher->Execute(SID_PIVOT_TABLE, nCallMode, &aPivotItem, NULL, 0); - if (pResult != NULL) + if (pResult != nullptr) { const SfxBoolItem* pItem = reinterpret_cast<const SfxBoolItem*>(pResult); if (pItem) @@ -565,7 +565,7 @@ void ScPivotLayoutDialog::ApplyLabelData(ScDPSaveData& rSaveData) OUString aUnoName = ScDPUtil::createDuplicateDimensionName(pLabelData.maName, pLabelData.mnDupCount); ScDPSaveDimension* pSaveDimensions = rSaveData.GetExistingDimensionByName(aUnoName); - if (pSaveDimensions == NULL) + if (pSaveDimensions == nullptr) continue; pSaveDimensions->SetUsedHierarchy(pLabelData.mnUsedHier); @@ -655,7 +655,7 @@ IMPL_LINK_NOARG_TYPED( ScPivotLayoutDialog, CancelClicked, Button*, void ) IMPL_LINK_TYPED(ScPivotLayoutDialog, GetFocusHandler, Control&, rCtrl, void) { - mpActiveEdit = NULL; + mpActiveEdit = nullptr; if (&rCtrl == static_cast<Control*>(mpSourceEdit) || &rCtrl == static_cast<Control*>(mpSourceButton)) diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx index 3b6dc553cf8f..82e5911dd939 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx @@ -77,7 +77,7 @@ void ScPivotLayoutTreeList::FillFields(ScPivotFieldVector& rFieldVector) { ScPivotField& rField = *it; ScItemValue* pItemValue = mpParent->GetItem(rField.nCol); - InsertEntry(pItemValue->maName, NULL, false, TREELIST_APPEND, pItemValue); + InsertEntry(pItemValue->maName, nullptr, false, TREELIST_APPEND, pItemValue); } } @@ -92,14 +92,14 @@ void ScPivotLayoutTreeList::InsertEntryForSourceTarget(SvTreeListEntry* pSource, mpParent->ItemInserted(pOriginalItemValue, meType); - sal_uLong nPosition = (pTarget == NULL) ? TREELIST_APPEND : GetModel()->GetAbsPos(pTarget) + 1; + sal_uLong nPosition = (pTarget == nullptr) ? TREELIST_APPEND : GetModel()->GetAbsPos(pTarget) + 1; InsertEntryForItem(pOriginalItemValue, nPosition); } void ScPivotLayoutTreeList::InsertEntryForItem(ScItemValue* pItemValue, sal_uLong nPosition) { OUString rName = pItemValue->maName; - InsertEntry(rName, NULL, false, nPosition, pItemValue); + InsertEntry(rName, nullptr, false, nPosition, pItemValue); } void ScPivotLayoutTreeList::KeyInput(const KeyEvent& rKeyEvent) diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx index 376e28d39ad9..407a3b4a8557 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx @@ -21,7 +21,7 @@ using namespace std; ScPivotLayoutTreeListBase::ScPivotLayoutTreeListBase(vcl::Window* pParent, WinBits nBits, SvPivotTreeListType eType) : SvTreeListBox(pParent, nBits) , meType(eType) - , mpParent(NULL) + , mpParent(nullptr) { SetHighlightRange(); SetDragDropMode(DragDropMode::CTRL_MOVE | DragDropMode::APP_MOVE | DragDropMode::APP_DROP); @@ -78,7 +78,7 @@ TriState ScPivotLayoutTreeListBase::NotifyCopying(SvTreeListEntry* /*pTarget*/, bool ScPivotLayoutTreeListBase::HasEntry(SvTreeListEntry* pEntry) { SvTreeListEntry* pEachEntry; - for (pEachEntry = First(); pEachEntry != NULL; pEachEntry = Next(pEachEntry)) + for (pEachEntry = First(); pEachEntry != nullptr; pEachEntry = Next(pEachEntry)) { if(pEachEntry == pEntry) return true; @@ -89,7 +89,7 @@ bool ScPivotLayoutTreeListBase::HasEntry(SvTreeListEntry* pEntry) void ScPivotLayoutTreeListBase::PushEntriesToPivotFieldVector(ScPivotFieldVector& rVector) { SvTreeListEntry* pEachEntry; - for (pEachEntry = First(); pEachEntry != NULL; pEachEntry = Next(pEachEntry)) + for (pEachEntry = First(); pEachEntry != nullptr; pEachEntry = Next(pEachEntry)) { ScItemValue* pItemValue = static_cast<ScItemValue*>(pEachEntry->GetUserData()); ScPivotFuncData& rFunctionData = pItemValue->maFunctionData; @@ -113,7 +113,7 @@ void ScPivotLayoutTreeListBase::InsertEntryForItem(ScItemValue* /*pItemValue*/, void ScPivotLayoutTreeListBase::RemoveEntryForItem(ScItemValue* pItemValue) { SvTreeListEntry* pEachEntry; - for (pEachEntry = First(); pEachEntry != NULL; pEachEntry = Next(pEachEntry)) + for (pEachEntry = First(); pEachEntry != nullptr; pEachEntry = Next(pEachEntry)) { ScItemValue* pEachItemValue = static_cast<ScItemValue*>(pEachEntry->GetUserData()); if (pEachItemValue == pItemValue) @@ -132,7 +132,7 @@ void ScPivotLayoutTreeListBase::GetFocus() { SvTreeListEntry* pEntry = mpParent->mpPreviouslyFocusedListBox->GetCurEntry(); if (pEntry) - InsertEntryForSourceTarget(pEntry, NULL); + InsertEntryForSourceTarget(pEntry, nullptr); if (mpParent->mpPreviouslyFocusedListBox != nullptr) mpParent->mpPreviouslyFocusedListBox->GrabFocus(); diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx index 5f9a2fb720c9..7623ed36eb65 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx @@ -138,14 +138,14 @@ void ScPivotLayoutTreeListData::FillDataField(ScPivotFieldVector& rDataFields) pItemValue->maFunctionData.mnDupCount); maDataItemValues.push_back(pItemValue); - InsertEntry(sDataItemName, NULL, false, TREELIST_APPEND, pItemValue); + InsertEntry(sDataItemName, nullptr, false, TREELIST_APPEND, pItemValue); } } void ScPivotLayoutTreeListData::PushDataFieldNames(vector<ScDPName>& rDataFieldNames) { SvTreeListEntry* pLoopEntry; - for (pLoopEntry = First(); pLoopEntry != NULL; pLoopEntry = Next(pLoopEntry)) + for (pLoopEntry = First(); pLoopEntry != nullptr; pLoopEntry = Next(pLoopEntry)) { ScItemValue* pEachItemValue = static_cast<ScItemValue*>(pLoopEntry->GetUserData()); SCCOL nColumn = pEachItemValue->maFunctionData.mnCol; @@ -179,12 +179,12 @@ void ScPivotLayoutTreeListData::InsertEntryForSourceTarget(SvTreeListEntry* pSou { OUString rText = GetEntryText(pSource); GetModel()->Remove(pSource); - sal_uLong nPosition = (pTarget == NULL) ? TREELIST_APPEND : GetModel()->GetAbsPos(pTarget) + 1; - InsertEntry(rText, NULL, false, nPosition, pItemValue); + sal_uLong nPosition = (pTarget == nullptr) ? TREELIST_APPEND : GetModel()->GetAbsPos(pTarget) + 1; + InsertEntry(rText, nullptr, false, nPosition, pItemValue); } else { - sal_uLong nPosition = (pTarget == NULL) ? TREELIST_APPEND : GetModel()->GetAbsPos(pTarget) + 1; + sal_uLong nPosition = (pTarget == nullptr) ? TREELIST_APPEND : GetModel()->GetAbsPos(pTarget) + 1; InsertEntryForItem(pItemValue->mpOriginalItemValue, nPosition); } } @@ -210,7 +210,7 @@ void ScPivotLayoutTreeListData::InsertEntryForItem(ScItemValue* pItemValue, sal_ pDataItemValue->maName, rFunctionData.mnDupCount); - InsertEntry(sDataName, NULL, false, nPosition, pDataItemValue); + InsertEntry(sDataName, nullptr, false, nPosition, pDataItemValue); } void ScPivotLayoutTreeListData::AdjustDuplicateCount(ScItemValue* pInputItemValue) @@ -223,7 +223,7 @@ void ScPivotLayoutTreeListData::AdjustDuplicateCount(ScItemValue* pInputItemValu sal_uInt8 nMaxDuplicateCount = 0; SvTreeListEntry* pEachEntry; - for (pEachEntry = First(); pEachEntry != NULL; pEachEntry = Next(pEachEntry)) + for (pEachEntry = First(); pEachEntry != nullptr; pEachEntry = Next(pEachEntry)) { ScItemValue* pItemValue = static_cast<ScItemValue*>(pEachEntry->GetUserData()); if (pItemValue == pInputItemValue) diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 3bbfd6d4b1a3..fe3bfb40a098 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -38,8 +38,8 @@ ScAsciiOptions::ScAsciiOptions() : bCharSetSystem ( false ), nStartRow ( 1 ), nInfoCount ( 0 ), - pColStart ( NULL ), - pColFormat ( NULL ) + pColStart ( nullptr ), + pColFormat ( nullptr ) { } @@ -68,8 +68,8 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) : } else { - pColStart = NULL; - pColFormat = NULL; + pColStart = nullptr; + pColFormat = nullptr; } } @@ -98,17 +98,17 @@ void ScAsciiOptions::SetColInfo( sal_uInt16 nCount, const sal_Int32* pStart, con } else { - pColStart = NULL; - pColFormat = NULL; + pColStart = nullptr; + pColFormat = nullptr; } } void ScAsciiOptions::SetColumnInfo( const ScCsvExpDataVec& rDataVec ) { delete[] pColStart; - pColStart = NULL; + pColStart = nullptr; delete[] pColFormat; - pColFormat = NULL; + pColFormat = nullptr; nInfoCount = static_cast< sal_uInt16 >( rDataVec.size() ); if( nInfoCount ) @@ -246,8 +246,8 @@ void ScAsciiOptions::ReadFromString( const OUString& rString ) } else { - pColStart = NULL; - pColFormat = NULL; + pColStart = nullptr; + pColFormat = nullptr; } } diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index 0d8f58910ae3..cbcd7ba355d6 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -72,7 +72,7 @@ ScConsolidateDlg::ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::W pDoc ( static_cast<ScTabViewShell*>(SfxViewShell::Current())-> GetViewData().GetDocument() ), pRangeUtil ( new ScRangeUtil ), - pAreaData ( NULL ), + pAreaData ( nullptr ), nAreaDataCount ( 0 ), nWhichCons ( rArgSet.GetPool()->GetWhich( SID_CONSOLIDATE ) ), bDlgLostFocus ( false ) @@ -207,7 +207,7 @@ void ScConsolidateDlg::Init() size_t nDbCount = pDbNames ? pDbNames->getNamedDBs().size() : 0; nAreaDataCount = nRangeCount+nDbCount; - pAreaData = NULL; + pAreaData = nullptr; if ( nAreaDataCount > 0 ) { @@ -326,7 +326,7 @@ bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd ) if ( pEd == pEdDataArea ) { bEditOk = ScRangeUtil::IsAbsArea( pEd->GetText(), pDoc, - nTab, &theCompleteStr, NULL, NULL, eConv ); + nTab, &theCompleteStr, nullptr, nullptr, eConv ); } else if ( pEd == pEdDestArea ) { @@ -334,7 +334,7 @@ bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd ) ScRangeUtil::CutPosString( pEd->GetText(), aPosStr ); bEditOk = ScRangeUtil::IsAbsPos( aPosStr, pDoc, - nTab, &theCompleteStr, NULL, eConv ); + nTab, &theCompleteStr, nullptr, eConv ); } if ( bEditOk ) @@ -373,7 +373,7 @@ IMPL_LINK_NOARG_TYPED(ScConsolidateDlg, OkHdl, Button*, void) OUString aDestPosStr( pEdDestArea->GetText() ); const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); - if ( ScRangeUtil::IsAbsPos( aDestPosStr, pDoc, nTab, NULL, &aDestAddress, eConv ) ) + if ( ScRangeUtil::IsAbsPos( aDestPosStr, pDoc, nTab, nullptr, &aDestAddress, eConv ) ) { ScConsolidateParam theOutParam( theConsData ); ScArea** ppDataAreas = new ScArea*[nDataAreaCount]; @@ -428,7 +428,7 @@ IMPL_LINK_TYPED( ScConsolidateDlg, ClickHdl, Button*, pBtn, void ) if ( !pEdDataArea->GetText().isEmpty() ) { OUString aNewEntry( pEdDataArea->GetText() ); - ScArea** ppAreas = NULL; + ScArea** ppAreas = nullptr; sal_uInt16 nAreaCount = 0; const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); @@ -500,7 +500,7 @@ IMPL_LINK_TYPED( ScConsolidateDlg, SelectHdl, ListBox&, rLb, void ) if ( pRangeUtil && (nSelPos > 0) && (nAreaDataCount > 0) - && (pAreaData != NULL) ) + && (pAreaData != nullptr) ) { if ( static_cast<size_t>(nSelPos) <= nAreaDataCount ) { diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx index aafe6abaccfc..2fb10309f0d5 100644 --- a/sc/source/ui/dbgui/csvcontrol.cxx +++ b/sc/source/ui/dbgui/csvcontrol.cxx @@ -59,7 +59,7 @@ ScCsvDiff ScCsvLayoutData::GetDiff( const ScCsvLayoutData& rData ) const ScCsvControl::ScCsvControl( ScCsvControl& rParent ) : Control( &rParent, WB_TABSTOP | WB_NODIALOGCONTROL ), mrData( rParent.GetLayoutData() ), - mxAccessible( NULL ), + mxAccessible( nullptr ), mbValidGfx( false ) { } @@ -67,7 +67,7 @@ ScCsvControl::ScCsvControl( ScCsvControl& rParent ) : ScCsvControl::ScCsvControl( vcl::Window* pParent, const ScCsvLayoutData& rData, WinBits nBits ) : Control( pParent, nBits ), mrData( rData ), - mxAccessible( NULL ), + mxAccessible( nullptr ), mbValidGfx( false ) { } diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 4ffc12fb2b39..ce7c978e5694 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -64,7 +64,7 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) : ScCsvControl( rParent ), mpBackgrDev( VclPtr<VirtualDevice>::Create() ), mpGridDev( VclPtr<VirtualDevice>::Create() ), - mpColorConfig( 0 ), + mpColorConfig( nullptr ), mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), true ) ), maHeaderFont( GetFont() ), maColStates( 1 ), diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx index 60b4b5cdfb1c..84237ad8efc8 100644 --- a/sc/source/ui/dbgui/dapidata.cxx +++ b/sc/source/ui/dbgui/dapidata.cxx @@ -144,7 +144,7 @@ void ScDataPilotDatabaseDlg::FillObjects() if ( !xSource.is() ) return; uno::Reference<task::XInteractionHandler> xHandler( - task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr), uno::UNO_QUERY_THROW); uno::Reference<sdbc::XConnection> xConnection = xSource->connectWithCompletion( xHandler ); diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index d80ed97a40a7..422e7abbbad8 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -41,7 +41,7 @@ class DBSaveData; -static DBSaveData* pSaveObj = NULL; +static DBSaveData* pSaveObj = nullptr; #define ERRORBOX(s) ScopedVclPtrInstance<MessageDialog>::Create(this, s)->Execute() @@ -217,7 +217,7 @@ void ScDbNameDlg::Init() SCTAB nEndTab = 0; ScDBCollection* pDBColl = pDoc->GetDBCollection(); - ScDBData* pDBData = NULL; + ScDBData* pDBData = nullptr; pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab ); @@ -396,7 +396,7 @@ bool ScDbNameDlg::IsRefInputMode() const IMPL_LINK_NOARG_TYPED(ScDbNameDlg, OkBtnHdl, Button*, void) { - AddBtnHdl( 0 ); + AddBtnHdl( nullptr ); // Der View die Aenderungen und die Remove-Liste uebergeben: // beide werden nur als Referenz uebergeben, so dass an dieser @@ -477,7 +477,7 @@ IMPL_LINK_NOARG_TYPED(ScDbNameDlg, AddBtnHdl, Button*, void) m_pBtnDoSize->Check( false ); m_pBtnKeepFmt->Check( false ); m_pBtnStripData->Check( false ); - SetInfoStrings( NULL ); // leer + SetInfoStrings( nullptr ); // leer theCurArea = ScRange(); bSaved = true; pSaveObj->Save(); @@ -557,7 +557,7 @@ IMPL_LINK_NOARG_TYPED(ScDbNameDlg, RemoveBtnHdl, Button*, void) m_pBtnDoSize->Check( false ); m_pBtnKeepFmt->Check( false ); m_pBtnStripData->Check( false ); - SetInfoStrings( NULL ); // leer + SetInfoStrings( nullptr ); // leer bSaved=false; pSaveObj->Restore(); NameModifyHdl( *m_pEdName ); diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index a43f66c08b1d..50ee6290df1a 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -58,15 +58,15 @@ ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPar , aStrEmpty(SC_RESSTR(SCSTR_FILTER_EMPTY)) , aStrNotEmpty(SC_RESSTR(SCSTR_FILTER_NOTEMPTY)) , aStrColumn(SC_RESSTR(SCSTR_COLUMN)) - , pOptionsMgr(NULL) + , pOptionsMgr(nullptr) , nWhichQuery(rArgSet.GetPool()->GetWhich(SID_QUERY)) , theQueryData(static_cast<const ScQueryItem&>(rArgSet.Get(nWhichQuery)).GetQueryData()) - , pOutItem(NULL) - , pViewData(NULL) - , pDoc(NULL) + , pOutItem(nullptr) + , pViewData(nullptr) + , pDoc(nullptr) , nSrcTab(0) , bRefInputMode(false) - , pTimer(NULL) + , pTimer(nullptr) { get(pLbConnect1,"connect1"); get(pLbField1,"field1"); @@ -231,7 +231,7 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) pLbCond4->SetSelectHdl( LINK( this, ScFilterDlg, LbSelectHdl ) ); pViewData = rQueryItem.GetViewData(); - pDoc = pViewData ? pViewData->GetDocument() : NULL; + pDoc = pViewData ? pViewData->GetDocument() : nullptr; nSrcTab = pViewData ? pViewData->GetTabNo() : static_cast<SCTAB>(0); // for easier access: @@ -416,8 +416,8 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) pEdVal4->Disable(); } - if(pDoc!=NULL && - pDoc->GetChangeTrack()!=NULL) pBtnCopyResult->Disable(); + if(pDoc!=nullptr && + pDoc->GetChangeTrack()!=nullptr) pBtnCopyResult->Disable(); // Switch on modal mode // SetDispatcherLock( true ); //@BugID 54702 Enable/disable only in Basic class @@ -516,7 +516,7 @@ void ScFilterDlg::UpdateValueList( size_t nList ) WaitObject aWaiter( this ); // even if only the list box has content SCCOL nColumn = theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1; - EntryList* pList = NULL; + EntryList* pList = nullptr; if (!maEntryLists.count(nColumn)) { size_t nOffset = GetSliderPos(); diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index 8d3b82a0aa48..e5ae0ec42c9a 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -48,7 +48,7 @@ ScFilterOptionsMgr::ScFilterOptionsMgr( const OUString& refStrUndefined ) : pViewData ( ptrViewData ), - pDoc ( ptrViewData ? ptrViewData->GetDocument() : NULL ), + pDoc ( ptrViewData ? ptrViewData->GetDocument() : nullptr ), pBtnCase ( refBtnCase ), pBtnRegExp ( refBtnRegExp ), pBtnHeader ( refBtnHeader ), diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index ba3e1ccbb392..c7c8b758c9ca 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -53,9 +53,9 @@ ScPivotFilterDlg::ScPivotFilterDlg(vcl::Window* pParent, const SfxItemSet& rArgS nWhichQuery ( rArgSet.GetPool()->GetWhich( SID_QUERY ) ), theQueryData ( static_cast<const ScQueryItem&>( rArgSet.Get( nWhichQuery )).GetQueryData() ), - pOutItem ( NULL ), - pViewData ( NULL ), - pDoc ( NULL ), + pOutItem ( nullptr ), + pViewData ( nullptr ), + pDoc ( nullptr ), nSrcTab ( nSourceTab ), // is not in QueryParam nFieldCount ( 0 ) { @@ -76,7 +76,7 @@ ScPivotFilterDlg::ScPivotFilterDlg(vcl::Window* pParent, const SfxItemSet& rArgS get(m_pFtDbArea, "dbarea"); for (sal_uInt16 i=0; i<=MAXCOL; i++) - pEntryLists[i] = NULL; + pEntryLists[i] = nullptr; Init( rArgSet ); } @@ -131,7 +131,7 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet ) m_pBtnUnique->Check( !theQueryData.bDuplicate ); pViewData = rQueryItem.GetViewData(); - pDoc = pViewData ? pViewData->GetDocument() : NULL; + pDoc = pViewData ? pViewData->GetDocument() : nullptr; // for easier access: aFieldLbArr [0] = m_pLbField1; diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index e1c7fe32e192..0bcca91ff5ef 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -499,7 +499,7 @@ void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa mpRbAuto->SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); mpRbUser->SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); - RadioButton* pRBtn = 0; + RadioButton* pRBtn = nullptr; switch( rFuncData.mnFuncMask ) { case PIVOT_FUNC_NONE: pRBtn = mpRbNone; break; @@ -692,7 +692,7 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou m_pRbSortDesc->SetClickHdl( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) ); m_pRbSortMan->SetClickHdl( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) ); - RadioButton* pRBtn = 0; + RadioButton* pRBtn = nullptr; switch( nSortMode ) { case DataPilotFieldSortMode::NONE: @@ -835,7 +835,7 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, OUString aName = rDPObj.GetDimName( nDim, bIsDataLayout, &nDimFlags ); if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) && ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ) ) { - const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : 0; + const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : nullptr; if ( !pDimension || (pDimension->GetOrientation() != nOrient) ) { if (pDimension) diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 295edd1eddea..736c7747c41b 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -244,7 +244,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( vcl::Window* pParent, const OUString& aDatNa mpDatStream ( pInStream ), mnStreamPos( pInStream ? pInStream->Tell() : 0 ), - mpRowPosArray( NULL ), + mpRowPosArray( nullptr ), mnRowPosCount(0), aCharSetUser( ScResId( SCSTR_CHARSET_USER ) ), diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 45909ce90ecd..a631c537b92b 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -49,16 +49,16 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc : ScAnyRefDlg ( pB, pCW, pParent, "AdvancedFilterDialog", "modules/scalc/ui/advancedfilterdialog.ui" ), aStrUndefined ( SC_RESSTR(SCSTR_UNDEFINED) ), - pOptionsMgr ( NULL ), + pOptionsMgr ( nullptr ), nWhichQuery ( rArgSet.GetPool()->GetWhich( SID_QUERY ) ), theQueryData ( static_cast<const ScQueryItem&>( rArgSet.Get( nWhichQuery )).GetQueryData() ), - pOutItem ( NULL ), - pViewData ( NULL ), - pDoc ( NULL ), - pRefInputEdit ( NULL ), + pOutItem ( nullptr ), + pViewData ( nullptr ), + pDoc ( nullptr ), + pRefInputEdit ( nullptr ), bRefInputMode ( false ), - pIdle ( NULL ) + pIdle ( nullptr ) { get(pLbFilterArea,"lbfilterarea"); get(pEdFilterArea,"edfilterarea"); @@ -148,13 +148,13 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet ) pEdFilterArea->SetModifyHdl ( LINK( this, ScSpecialFilterDlg, FilterAreaModHdl ) ); pViewData = rQueryItem.GetViewData(); - pDoc = pViewData ? pViewData->GetDocument() : NULL; + pDoc = pViewData ? pViewData->GetDocument() : nullptr; pEdFilterArea->SetText( EMPTY_OUSTRING ); // may be overwritten below if ( pViewData && pDoc ) { - if(pDoc->GetChangeTrack()!=NULL) pBtnCopyResult->Disable(); + if(pDoc->GetChangeTrack()!=nullptr) pBtnCopyResult->Disable(); ScRangeName* pRangeNames = pDoc->GetRangeName(); pLbFilterArea->Clear(); @@ -416,7 +416,7 @@ IMPL_LINK_TYPED( ScSpecialFilterDlg, TimeOutHdl, Idle*, _pIdle, void ) } else if( bRefInputMode ) { - pRefInputEdit = NULL; + pRefInputEdit = nullptr; bRefInputMode = false; } } diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx index a5a6d567698f..86ff8096d09c 100644 --- a/sc/source/ui/dbgui/sortdlg.cxx +++ b/sc/source/ui/dbgui/sortdlg.cxx @@ -29,8 +29,8 @@ ScSortDlg::ScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) , bIsHeaders(false) , bIsByRows(false) { - AddTabPage("criteria", ScTabPageSortFields::Create, 0); - AddTabPage("options", ScTabPageSortOptions::Create, 0); + AddTabPage("criteria", ScTabPageSortFields::Create, nullptr); + AddTabPage("options", ScTabPageSortOptions::Create, nullptr); } ScSortWarningDlg::ScSortWarningDlg(vcl::Window* pParent, diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx index 42593d0e31ac..ffa0238f692a 100644 --- a/sc/source/ui/dbgui/subtdlg.cxx +++ b/sc/source/ui/dbgui/subtdlg.cxx @@ -29,10 +29,10 @@ ScSubTotalDlg::ScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) { get(m_pBtnRemove, "remove"); - AddTabPage("1stgroup", ScTpSubTotalGroup1::Create, 0); - AddTabPage("2ndgroup", ScTpSubTotalGroup2::Create, 0); - AddTabPage("3rdgroup", ScTpSubTotalGroup3::Create, 0); - AddTabPage("options", ScTpSubTotalOptions::Create, 0); + AddTabPage("1stgroup", ScTpSubTotalGroup1::Create, nullptr); + AddTabPage("2ndgroup", ScTpSubTotalGroup2::Create, nullptr); + AddTabPage("3rdgroup", ScTpSubTotalGroup3::Create, nullptr); + AddTabPage("options", ScTpSubTotalOptions::Create, nullptr); m_pBtnRemove->SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) ); } diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index c81e7ad19d6e..daa45305c87a 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -79,7 +79,7 @@ ScTabPageSortFields::ScTabPageSortFields(vcl::Window* pParent, nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ), pDlg ( static_cast<ScSortDlg*>(GetParentDialog()) ), - pViewData ( NULL ), + pViewData ( nullptr ), aSortData ( static_cast<const ScSortItem&>( rArgSet.Get( nWhichSort )). GetSortData() ), @@ -290,7 +290,7 @@ bool ScTabPageSortFields::FillItemSet( SfxItemSet* rArgSet ) aNewSortData.maKeyState[i].bDoSort = false; } - rArgSet->Put( ScSortItem( SCITEM_SORTDATA, NULL, &aNewSortData ) ); + rArgSet->Put( ScSortItem( SCITEM_SORTDATA, nullptr, &aNewSortData ) ); return true; } @@ -494,11 +494,11 @@ ScTabPageSortOptions::ScTabPageSortOptions( vcl::Window* pParent, , aStrUndefined(SC_RESSTR(SCSTR_UNDEFINED)) , nWhichSort(rArgSet.GetPool()->GetWhich(SID_SORT)) , aSortData(static_cast<const ScSortItem&>(rArgSet.Get(nWhichSort)).GetSortData()) - , pViewData(NULL) - , pDoc(NULL) + , pViewData(nullptr) + , pDoc(nullptr) , pDlg(static_cast<ScSortDlg*>(GetParentDialog())) - , pColRes( NULL ) - , pColWrap( NULL ) + , pColRes( nullptr ) + , pColWrap( nullptr ) { get(m_pBtnCase, "case"); get(m_pBtnHeader, "header"); @@ -573,7 +573,7 @@ void ScTabPageSortOptions::Init() m_pLbLanguage->SetSelectHdl ( LINK( this, ScTabPageSortOptions, FillAlgorHdl ) ); pViewData = rSortItem.GetViewData(); - pDoc = pViewData ? pViewData->GetDocument() : NULL; + pDoc = pViewData ? pViewData->GetDocument() : nullptr; OSL_ENSURE( pViewData, "ViewData not found! :-/" ); diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index ab1bf01394b5..82e142216481 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -41,8 +41,8 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( vcl::Window* pParent, &rArgSet ), aStrNone ( SC_RESSTR( SCSTR_NONE ) ), aStrColumn ( SC_RESSTR( SCSTR_COLUMN ) ), - pViewData ( NULL ), - pDoc ( NULL ), + pViewData ( nullptr ), + pDoc ( nullptr ), nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ), rSubTotalData ( static_cast<const ScSubTotalItem&>( rArgSet.Get( nWhichSubTotals )). @@ -96,7 +96,7 @@ void ScTpSubTotalGroup::Init() GetItemSet().Get( nWhichSubTotals )); pViewData = rSubTotalItem.GetViewData(); - pDoc = ( pViewData ) ? pViewData->GetDocument() : NULL; + pDoc = ( pViewData ) ? pViewData->GetDocument() : nullptr; OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found :-(" ); @@ -441,8 +441,8 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( vcl::Window* pParent, : SfxTabPage ( pParent, "SubTotalOptionsPage", "modules/scalc/ui/subtotaloptionspage.ui" , &rArgSet ), - pViewData ( NULL ), - pDoc ( NULL ), + pViewData ( nullptr ), + pDoc ( nullptr ), nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ), rSubTotalData ( static_cast<const ScSubTotalItem&>( rArgSet.Get( nWhichSubTotals )). @@ -486,7 +486,7 @@ void ScTpSubTotalOptions::Init() GetItemSet().Get( nWhichSubTotals )); pViewData = rSubTotalItem.GetViewData(); - pDoc = ( pViewData ) ? pViewData->GetDocument() : NULL; + pDoc = ( pViewData ) ? pViewData->GetDocument() : nullptr; OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" ); diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 6b0b56abf78c..459c5d731fc7 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -90,9 +90,9 @@ ScValidationDlg::ScValidationDlg(vcl::Window* pParent, const SfxItemSet* pArgSet , m_bOwnRefHdlr(false) , m_bRefInputting(false) { - m_nValuePageId = AddTabPage("criteria", ScTPValidationValue::Create, 0); - AddTabPage("inputhelp", ScTPValidationHelp::Create, 0); - AddTabPage("erroralert", ScTPValidationError::Create, 0); + m_nValuePageId = AddTabPage("criteria", ScTPValidationValue::Create, nullptr); + AddTabPage("inputhelp", ScTPValidationHelp::Create, nullptr); + AddTabPage("erroralert", ScTPValidationError::Create, nullptr); get(m_pHBox, "refinputbox"); } @@ -320,7 +320,7 @@ ScTPValidationValue::ScTPValidationValue( vcl::Window* pParent, const SfxItemSet , maStrValue(ScResId(SCSTR_VALID_VALUE)) , maStrRange(ScResId(SCSTR_VALID_RANGE)) , maStrList(ScResId(SCSTR_VALID_LIST)) - , m_pRefEdit(NULL) + , m_pRefEdit(nullptr) { get(m_pLbAllow, "allow"); get(m_pCbAllow, "allowempty"); @@ -331,14 +331,14 @@ ScTPValidationValue::ScTPValidationValue( vcl::Window* pParent, const SfxItemSet get(m_pFtMin, "minft"); get(m_pMinGrid, "mingrid"); get(m_pEdMin, "min"); - m_pEdMin->SetReferences(NULL, m_pFtMin); + m_pEdMin->SetReferences(nullptr, m_pFtMin); get(m_pEdList, "minlist"); Size aSize(LogicToPixel(Size(174, 105), MAP_APPFONT)); m_pEdList->set_width_request(aSize.Width()); m_pEdList->set_height_request(aSize.Height()); get(m_pFtMax, "maxft"); get(m_pEdMax, "max"); - m_pEdMax->SetReferences(NULL, m_pFtMax); + m_pEdMax->SetReferences(nullptr, m_pFtMax); get(m_pFtHint, "hintft"); get(m_pBtnRef, "validref"); m_pBtnRef->SetParentPage(this); @@ -402,7 +402,7 @@ void ScTPValidationValue::Init() m_pLbValue->SelectEntryPos( SC_VALIDDLG_DATA_EQUAL ); SelectHdl( *m_pLbAllow.get() ); - CheckHdl( NULL ); + CheckHdl( nullptr ); } VclPtr<SfxTabPage> ScTPValidationValue::Create( vcl::Window* pParent, const SfxItemSet* rArgSet ) @@ -450,7 +450,7 @@ void ScTPValidationValue::Reset( const SfxItemSet* rArgSet ) SetSecondFormula( aFmlaStr ); SelectHdl( *m_pLbAllow.get() ); - CheckHdl( NULL ); + CheckHdl( nullptr ); } bool ScTPValidationValue::FillItemSet( SfxItemSet* rArgSet ) @@ -515,8 +515,8 @@ ScValidationDlg * ScTPValidationValue::GetValidationDlg() do{ if ( dynamic_cast<ScValidationDlg*>( pParent ) ) return static_cast< ScValidationDlg * >( pParent ); - }while ( NULL != ( pParent = pParent->GetParent() ) ); - return NULL; + }while ( nullptr != ( pParent = pParent->GetParent() ) ); + return nullptr; } void ScTPValidationValue::SetupRefDlg() @@ -531,7 +531,7 @@ void ScTPValidationValue::SetupRefDlg() pValidationDlg->SetRefInputStartPreHdl( static_cast<ScRefHandlerHelper::PINPUTSTARTDLTYPE>( &ScTPValidationValue::RefInputStartPreHdl ) ); pValidationDlg->SetRefInputDonePostHdl( static_cast<ScRefHandlerHelper::PCOMMONHDLTYPE>( &ScTPValidationValue::RefInputDonePostHdl ) ); - vcl::Window *pLabel = NULL; + vcl::Window *pLabel = nullptr; if ( m_pEdMax->IsVisible() ) { @@ -561,17 +561,17 @@ void ScTPValidationValue::RemoveRefDlg() { if( pValidationDlg->RemoveRefDlg() ) { - pValidationDlg->SetHandler( NULL ); - pValidationDlg->SetSetRefHdl( NULL ); - pValidationDlg->SetSetActHdl( NULL ); - pValidationDlg->SetRefInputStartPreHdl( NULL ); - pValidationDlg->SetRefInputDonePostHdl( NULL ); + pValidationDlg->SetHandler( nullptr ); + pValidationDlg->SetSetRefHdl( nullptr ); + pValidationDlg->SetSetActHdl( nullptr ); + pValidationDlg->SetRefInputStartPreHdl( nullptr ); + pValidationDlg->SetRefInputDonePostHdl( nullptr ); if( m_pRefEdit ) - m_pRefEdit->SetReferences( NULL, NULL ); - m_pRefEdit = NULL; + m_pRefEdit->SetReferences( nullptr, nullptr ); + m_pRefEdit = nullptr; - m_pBtnRef->SetReferences( NULL, NULL ); + m_pBtnRef->SetReferences( nullptr, nullptr ); } } } @@ -845,7 +845,7 @@ IMPL_LINK_NOARG_TYPED(ScTPValidationError, ClickSearchHdl, Button*, void) Application::SetDefDialogParent( pOld ); - if ( aScriptURL != NULL && !aScriptURL.isEmpty() ) + if ( aScriptURL != nullptr && !aScriptURL.isEmpty() ) { m_pEdtTitle->SetText( aScriptURL ); } @@ -861,7 +861,7 @@ bool ScValidationDlg::EnterRefStatus() SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); - if ( pWnd && pWnd->GetWindow()!= this ) pWnd = NULL; + if ( pWnd && pWnd->GetWindow()!= this ) pWnd = nullptr; SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); @@ -951,7 +951,7 @@ void ScTPValidationValue::OnClick( Button *pBtn ) bool ScValidationDlg::IsChildFocus() { if ( const vcl::Window *pWin = Application::GetFocusWindow() ) - while( NULL != ( pWin = pWin->GetParent() ) ) + while( nullptr != ( pWin = pWin->GetParent() ) ) if( pWin == this ) return true; diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index f9f2c12c3804..9f6b54777b53 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -24,7 +24,7 @@ namespace sc { SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParent, sal_uInt16 /* nId */ ) : ModelessDialog(pParent, "SearchResultsDialog", "modules/scalc/ui/searchresults.ui"), - mpBindings(_pBindings), mpDoc(NULL) + mpBindings(_pBindings), mpDoc(nullptr) { SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("results"); Size aControlSize(150, 120); @@ -66,7 +66,7 @@ void SearchResultsDlg::FillResults( ScDocument* pDoc, const ScRangeList &rMatche // Out-of-bound sheet index. continue; - OUString aPosStr = aPos.Format(SCA_ABS, NULL, pDoc->GetAddressConvention()); + OUString aPosStr = aPos.Format(SCA_ABS, nullptr, pDoc->GetAddressConvention()); mpList->InsertEntry(aTabNames[aPos.Tab()] + "\t" + aPosStr + "\t" + pDoc->GetString(aPos)); } } diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index df1829fcbf8d..d6d5d4dd44bd 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -51,7 +51,7 @@ struct AreaLink_Impl ScDocShell* m_pDocSh; AbstractScLinkedAreaDlg* m_pDialog; - AreaLink_Impl() : m_pDocSh( NULL ), m_pDialog( NULL ) {} + AreaLink_Impl() : m_pDocSh( nullptr ), m_pDialog( nullptr ) {} }; TYPEINIT1(ScAreaLink,::sfx2::SvBaseLink); @@ -110,10 +110,10 @@ void ScAreaLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /* rEn return SUCCESS; sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument().GetLinkManager(); - if (pLinkManager!=NULL) + if (pLinkManager!=nullptr) { OUString aFile, aArea, aFilter; - sfx2::LinkManager::GetDisplayNames(this, NULL, &aFile, &aArea, &aFilter); + sfx2::LinkManager::GetDisplayNames(this, nullptr, &aFile, &aArea, &aFilter); // the file dialog returns the filter name with the application prefix // -> remove prefix @@ -127,7 +127,7 @@ void ScAreaLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /* rEn // adjust in dialog: OUString aNewLinkName; OUString aTmp = aFilter; - sfx2::MakeLnkName(aNewLinkName, NULL, aFile, aArea, &aTmp); + sfx2::MakeLnkName(aNewLinkName, nullptr, aFile, aArea, &aTmp); aFilter = aTmp; SetName( aNewLinkName ); } @@ -176,7 +176,7 @@ void ScAreaLink::SetSource(const OUString& rDoc, const OUString& rFlt, const OUS // also update link name for dialog OUString aNewLinkName; - sfx2::MakeLnkName( aNewLinkName, NULL, aFileName, aSourceArea, &aFilterName ); + sfx2::MakeLnkName( aNewLinkName, nullptr, aFileName, aSourceArea, &aFilterName ); SetName( aNewLinkName ); } @@ -324,7 +324,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter, // Undo initialisieren - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bAddUndo && bUndo ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -392,7 +392,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter, ScMarkData aDestMark; aDestMark.SelectOneTable( nDestTab ); aDestMark.SetMarkArea( aNewTokenRange ); - rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, NULL, &aClipDoc, false ); + rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false ); aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 ); } } @@ -500,10 +500,10 @@ IMPL_LINK_NOARG_TYPED(ScAreaLink, AreaEndEditHdl, Dialog&, void) // copy source data from members (set in Refresh) into link name for dialog OUString aNewLinkName; - sfx2::MakeLnkName( aNewLinkName, NULL, aFileName, aSourceArea, &aFilterName ); + sfx2::MakeLnkName( aNewLinkName, nullptr, aFileName, aSourceArea, &aFilterName ); SetName( aNewLinkName ); } - pImpl->m_pDialog = NULL; // dialog is deleted with parent + pImpl->m_pDialog = nullptr; // dialog is deleted with parent } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx index 549a3ec6e5eb..81a80d27cb40 100644 --- a/sc/source/ui/docshell/autostyl.cxx +++ b/sc/source/ui/docshell/autostyl.cxx @@ -47,7 +47,7 @@ struct ScAutoStyleData inline sal_uLong TimeNow() // Sekunden { - return (sal_uLong) time(0); + return (sal_uLong) time(nullptr); } namespace { diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index f95425b2ebb6..082fe89a643e 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -217,7 +217,7 @@ private: { while (!isTerminateRequested()) { - DataStream::LinesType* pLines = NULL; + DataStream::LinesType* pLines = nullptr; osl::ResettableMutexGuard aGuard(maMtxLines); if (!maUsedLines.empty()) @@ -322,7 +322,7 @@ DataStream::DataStream(ScDocShell *pShell, const OUString& rURL, const ScRange& mbRunning(false), mbValuesInLine(false), mbRefreshOnEmptyLine(false), - mpLines(0), + mpLines(nullptr), mnLinesCount(0), mnLinesSinceRefresh(0), mfLastRefreshTime(0.0), @@ -424,7 +424,7 @@ void DataStream::StartImport() if (!mxReaderThread.is()) { - SvStream *pStream = 0; + SvStream *pStream = nullptr; if (mnSettings & SCRIPT_STREAM) pStream = new SvScriptStream(msURL); else diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 9b26badde76c..f14f1e957c01 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -64,7 +64,7 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, bool ScDBCollection* pDocColl = rDoc.GetDBCollection(); bool bUndo (rDoc.IsUndoEnabled()); - ScDBCollection* pUndoColl = NULL; + ScDBCollection* pUndoColl = nullptr; if (bUndo) pUndoColl = new ScDBCollection( *pDocColl ); @@ -123,7 +123,7 @@ bool ScDBDocFunc::DeleteDBRange(const OUString& rName) { ScDocShellModificator aModificator( rDocShell ); - ScDBCollection* pUndoColl = NULL; + ScDBCollection* pUndoColl = nullptr; if (bUndo) pUndoColl = new ScDBCollection( *pDocColl ); @@ -201,7 +201,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData ) ScDBCollection* pDocColl = rDoc.GetDBCollection(); bool bUndo = rDoc.IsUndoEnabled(); - ScDBData* pData = NULL; + ScDBData* pData = nullptr; if (rNewData.GetName() == STR_DB_LOCAL_NONAME) { ScRange aRange; @@ -220,7 +220,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData ) rNewData.GetArea(aNewRange); bool bAreaChanged = ( aOldRange != aNewRange ); // dann muss neu compiliert werden - ScDBCollection* pUndoColl = NULL; + ScDBCollection* pUndoColl = nullptr; if (bUndo) pUndoColl = new ScDBCollection( *pDocColl ); @@ -247,7 +247,7 @@ void ScDBDocFunc::ModifyAllDBData( const ScDBCollection& rNewColl, const std::ve ScDocShellModificator aModificator(rDocShell); ScDocument& rDoc = rDocShell.GetDocument(); ScDBCollection* pOldColl = rDoc.GetDBCollection(); - ScDBCollection* pUndoColl = NULL; + ScDBCollection* pUndoColl = nullptr; bool bRecord = rDoc.IsUndoEnabled(); std::vector<ScRange>::const_iterator iter; @@ -268,7 +268,7 @@ void ScDBDocFunc::ModifyAllDBData( const ScDBCollection& rNewColl, const std::ve rDoc.PreprocessDBDataUpdate(); rDoc.SetDBCollection( new ScDBCollection( rNewColl ) ); rDoc.CompileHybridFormula(); - pOldColl = NULL; + pOldColl = nullptr; rDocShell.PostPaint(ScRange(0, 0, 0, MAXCOL, MAXROW, MAXTAB), PAINT_GRID); aModificator.SetDocumentModified(); SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) ); @@ -289,7 +289,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo ScDocument& rDoc = rDocShell.GetDocument(); if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; - ScDBData* pDBData = NULL; + ScDBData* pDBData = nullptr; if (bIsUnnamed) { pDBData = rDoc.GetAnonymousDBData( aTab ); @@ -340,10 +340,10 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo //! Undo nur benoetigte Daten ? - ScDocument* pUndoDoc = NULL; - ScOutlineTable* pUndoTab = NULL; - ScRangeName* pUndoRange = NULL; - ScDBCollection* pUndoDB = NULL; + ScDocument* pUndoDoc = nullptr; + ScOutlineTable* pUndoTab = nullptr; + ScRangeName* pUndoRange = nullptr; + ScDBCollection* pUndoDB = nullptr; if (bRecord) { @@ -391,7 +391,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo // Sortieren ohne SubTotals aSubTotalParam.bRemoveOnly = true; // wird unten wieder zurueckgesetzt - DoSubTotals( nTab, aSubTotalParam, NULL, false, bApi ); + DoSubTotals( nTab, aSubTotalParam, nullptr, false, bApi ); } if (bSort) @@ -406,7 +406,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo if (pDBData->GetAdvancedQuerySource(aAdvSource)) Query( nTab, aQueryParam, &aAdvSource, false, bApi ); else - Query( nTab, aQueryParam, NULL, false, bApi ); + Query( nTab, aQueryParam, nullptr, false, bApi ); // bei nicht-inplace kann die Tabelle umgestellt worden sein // if ( !aQueryParam.bInplace && aQueryParam.nDestTab != nTab ) @@ -416,7 +416,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo { pDBData->GetSubTotalParam( aSubTotalParam ); // Bereich kann sich geaendert haben aSubTotalParam.bRemoveOnly = false; - DoSubTotals( nTab, aSubTotalParam, NULL, false, bApi ); + DoSubTotals( nTab, aSubTotalParam, nullptr, false, bApi ); } if (bRecord) @@ -427,8 +427,8 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo SCROW nNewEndRow; pDBData->GetArea( nDummyTab, nDummyCol,nDummyRow, nDummyCol,nNewEndRow ); - const ScRange* pOld = NULL; - const ScRange* pNew = NULL; + const ScRange* pOld = nullptr; + const ScRange* pNew = nullptr; if (bQuerySize) { ScDBData* pDest = rDoc.GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow, @@ -641,13 +641,13 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, for (SCSIZE i=0; i<nEC; i++) aOldQuery.GetEntry(i).bDoQuery = false; aOldQuery.bDuplicate = true; - Query( nTab, aOldQuery, NULL, bRecord, bApi ); + Query( nTab, aOldQuery, nullptr, bRecord, bApi ); } } ScQueryParam aLocalParam( rQueryParam ); // fuer Paint / Zielbereich bool bCopy = !rQueryParam.bInplace; // kopiert wird in Table::Query - ScDBData* pDestData = NULL; // Bereich, in den kopiert wird + ScDBData* pDestData = nullptr; // Bereich, in den kopiert wird bool bDoSize = false; // Zielgroesse anpassen (einf./loeschen) SCCOL nFormulaCols = 0; // nur bei bDoSize bool bKeepFmt = false; @@ -725,9 +725,9 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, bKeepSub = true; } - ScDocument* pUndoDoc = NULL; - ScDBCollection* pUndoDB = NULL; - const ScRange* pOld = NULL; + ScDocument* pUndoDoc = nullptr; + ScDBCollection* pUndoDB = nullptr; + const ScRange* pOld = nullptr; if ( bRecord ) { @@ -760,7 +760,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, rDoc.BeginDrawUndo(); } - ScDocument* pAttribDoc = NULL; + ScDocument* pAttribDoc = nullptr; ScRange aAttribRange; if (pDestData) // Zielbereich loeschen { @@ -1003,10 +1003,10 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam, ScDocShellModificator aModificator( rDocShell ); ScSubTotalParam aNewParam( rParam ); // Bereichsende wird veraendert - ScDocument* pUndoDoc = NULL; - ScOutlineTable* pUndoTab = NULL; - ScRangeName* pUndoRange = NULL; - ScDBCollection* pUndoDB = NULL; + ScDocument* pUndoDoc = nullptr; + ScOutlineTable* pUndoTab = nullptr; + ScRangeName* pUndoRange = nullptr; + ScDBCollection* pUndoDB = nullptr; if (bRecord) // alte Daten sichern { @@ -1354,7 +1354,7 @@ bool ScDBDocFunc::RemovePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDataPilot( - &rDocShell, pOldUndoDoc.release(), NULL, pUndoDPObj.get(), NULL, false)); + &rDocShell, pOldUndoDoc.release(), nullptr, pUndoDPObj.get(), nullptr, false)); // pUndoDPObj is copied } @@ -1454,7 +1454,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool if (bRecord) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDataPilot(&rDocShell, NULL, pNewUndoDoc.release(), NULL, &rDestObj, false)); + new ScUndoDataPilot(&rDocShell, nullptr, pNewUndoDoc.release(), nullptr, &rDestObj, false)); } // notify API objects diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index ce439e6debe0..1f258da9a526 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -119,13 +119,13 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, const svx::ODataAccessDescriptor* pDescriptor, bool bRecord, bool bAddrInsert ) { ScDocument& rDoc = rDocShell.GetDocument(); - ScChangeTrack *pChangeTrack = NULL; + ScChangeTrack *pChangeTrack = nullptr; ScRange aChangedRange; if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; - ScDBData* pDBData = NULL; + ScDBData* pDBData = nullptr; if ( !bAddrInsert ) { pDBData = rDoc.GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1, @@ -228,7 +228,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, if ( xExecute.is() ) { uno::Reference<task::XInteractionHandler> xHandler( - task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr), uno::UNO_QUERY_THROW); xExecute->executeWithCompletion( xHandler ); } @@ -415,7 +415,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, nErrStringId = aTester.GetMessageId(); bSuccess = false; } - else if ( (pChangeTrack = rDoc.GetChangeTrack()) != NULL ) + else if ( (pChangeTrack = rDoc.GetChangeTrack()) != nullptr ) aChangedRange = ScRange(rParam.nCol1, rParam.nRow1, nTab, nEndCol+nFormulaCols, nEndRow, nTab ); } @@ -476,8 +476,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, SCCOL nUndoEndCol = std::max( nEndCol, rParam.nCol2 ); // rParam = old end SCROW nUndoEndRow = std::max( nEndRow, rParam.nRow2 ); - ScDocument* pUndoDoc = NULL; - ScDBData* pUndoDBData = NULL; + ScDocument* pUndoDoc = nullptr; + ScDBData* pUndoDBData = nullptr; if ( bRecord ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -588,14 +588,14 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, if (bRecord) { ScDocument* pRedoDoc = pImportDoc; - pImportDoc = NULL; + pImportDoc = nullptr; if (nFormulaCols > 0) // include filled formulas for redo rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab, nEndCol+nFormulaCols, nEndRow, nTab, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pRedoDoc ); - ScDBData* pRedoDBData = pDBData ? new ScDBData( *pDBData ) : NULL; + ScDBData* pRedoDBData = pDBData ? new ScDBData( *pDBData ) : nullptr; rDocShell.GetUndoManager()->AddUndoAction( new ScUndoImportData( &rDocShell, nTab, diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 6f1e5930c93a..4b4afc130a72 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -177,7 +177,7 @@ bool ScDocFunc::DetectiveAddPred(const ScAddress& rPos) if (bUndo) pModel->BeginCalcUndo(false); bool bDone = ScDetectiveFunc( &rDoc,nTab ).ShowPred( nCol, nRow ); - SdrUndoGroup* pUndo = NULL; + SdrUndoGroup* pUndo = nullptr; if (bUndo) pUndo = pModel->GetCalcUndo(); if (bDone) @@ -218,7 +218,7 @@ bool ScDocFunc::DetectiveDelPred(const ScAddress& rPos) if (bUndo) pModel->BeginCalcUndo(false); bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeletePred( nCol, nRow ); - SdrUndoGroup* pUndo = NULL; + SdrUndoGroup* pUndo = nullptr; if (bUndo) pUndo = pModel->GetCalcUndo(); if (bDone) @@ -257,7 +257,7 @@ bool ScDocFunc::DetectiveAddSucc(const ScAddress& rPos) if (bUndo) pModel->BeginCalcUndo(false); bool bDone = ScDetectiveFunc( &rDoc,nTab ).ShowSucc( nCol, nRow ); - SdrUndoGroup* pUndo = NULL; + SdrUndoGroup* pUndo = nullptr; if (bUndo) pUndo = pModel->GetCalcUndo(); if (bDone) @@ -298,7 +298,7 @@ bool ScDocFunc::DetectiveDelSucc(const ScAddress& rPos) if (bUndo) pModel->BeginCalcUndo(false); bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeleteSucc( nCol, nRow ); - SdrUndoGroup* pUndo = NULL; + SdrUndoGroup* pUndo = nullptr; if (bUndo) pUndo = pModel->GetCalcUndo(); if (bDone) @@ -337,7 +337,7 @@ bool ScDocFunc::DetectiveAddError(const ScAddress& rPos) if (bUndo) pModel->BeginCalcUndo(false); bool bDone = ScDetectiveFunc( &rDoc,nTab ).ShowError( nCol, nRow ); - SdrUndoGroup* pUndo = NULL; + SdrUndoGroup* pUndo = nullptr; if (bUndo) pUndo = pModel->GetCalcUndo(); if (bDone) @@ -377,7 +377,7 @@ bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab) pModel->BeginCalcUndo(false); bool bOverflow; bool bDone = ScDetectiveFunc( &rDoc,nTab ).MarkInvalid( bOverflow ); - SdrUndoGroup* pUndo = NULL; + SdrUndoGroup* pUndo = nullptr; if (bUndo) pUndo = pModel->GetCalcUndo(); if (pWaitWin) @@ -416,22 +416,22 @@ bool ScDocFunc::DetectiveDelAll(SCTAB nTab) if (bUndo) pModel->BeginCalcUndo(false); bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeleteAll( SC_DET_DETECTIVE ); - SdrUndoGroup* pUndo = NULL; + SdrUndoGroup* pUndo = nullptr; if (bUndo) pUndo = pModel->GetCalcUndo(); if (bDone) { ScDetOpList* pOldList = rDoc.GetDetOpList(); - ScDetOpList* pUndoList = NULL; + ScDetOpList* pUndoList = nullptr; if (bUndo) - pUndoList = pOldList ? new ScDetOpList(*pOldList) : NULL; + pUndoList = pOldList ? new ScDetOpList(*pOldList) : nullptr; rDoc.ClearDetectiveOperations(); if (bUndo) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDetective( &rDocShell, pUndo, NULL, pUndoList ) ); + new ScUndoDetective( &rDocShell, pUndo, nullptr, pUndoList ) ); } aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -812,7 +812,7 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con { // wegen ChangeTracking darf UndoAction erst nach SetString angelegt werden rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoEnterData(&rDocShell, rPos, aOldValues, rText, NULL)); + new ScUndoEnterData(&rDocShell, rPos, aOldValues, rText, nullptr)); } if ( bEditDeleted || rDoc.HasAttrib( ScRange(rPos), HASATTR_NEEDHEIGHT ) ) @@ -1084,7 +1084,7 @@ bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, rEngine.SetUpdateMode(false); ScMyRememberItemList aRememberItems; - ScMyRememberItem* pRememberItem = NULL; + ScMyRememberItem* pRememberItem = nullptr; // All paragraph attributes must be removed before calling CreateTextObject, // not only alignment, so the object doesn't contain the cell attributes as @@ -1272,7 +1272,7 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c if (aTester.IsEditable()) { ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); - ::svl::IUndoManager* pUndoMgr = (pDrawLayer && rDoc.IsUndoEnabled()) ? rDocShell.GetUndoManager() : 0; + ::svl::IUndoManager* pUndoMgr = (pDrawLayer && rDoc.IsUndoEnabled()) ? rDocShell.GetUndoManager() : nullptr; ScNoteData aOldData; ScPostIt* pOldNote = rDoc.ReleaseNote( rPos ); @@ -1761,8 +1761,8 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, WaitObject aWait( ScDocShell::GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference - ScDocument* pRefUndoDoc = NULL; - ScRefUndoData* pUndoData = NULL; + ScDocument* pRefUndoDoc = nullptr; + ScRefUndoData* pUndoData = nullptr; if ( bRecord ) { pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -1816,9 +1816,9 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, ScDocAttrIterator aTestIter( &rDoc, i, nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow ); ScRange aExtendRange( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i ); - const ScPatternAttr* pPattern = NULL; - const ScMergeFlagAttr* pMergeFlagAttr = NULL; - while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != NULL ) + const ScPatternAttr* pPattern = nullptr; + const ScMergeFlagAttr* pMergeFlagAttr = nullptr; + while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != nullptr ) { const ScMergeAttr* pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem(ATTR_MERGE) ); pMergeFlagAttr = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem(ATTR_MERGE_FLAG) ); @@ -2230,9 +2230,9 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, ScDocAttrIterator aTestIter( &rDoc, i, nUndoStartCol, nUndoStartRow, nMergeTestEndCol, nMergeTestEndRow ); ScRange aExtendRange( nUndoStartCol, nUndoStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i ); - const ScPatternAttr* pPattern = NULL; - const ScMergeFlagAttr* pMergeFlagAttr = NULL; - while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != NULL ) + const ScPatternAttr* pPattern = nullptr; + const ScMergeFlagAttr* pMergeFlagAttr = nullptr; + while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != nullptr ) { const ScMergeAttr* pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem( ATTR_MERGE ) ); pMergeFlagAttr = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem( ATTR_MERGE_FLAG ) ); @@ -2332,9 +2332,9 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, WaitObject aWait( ScDocShell::GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference - ScDocument* pUndoDoc = NULL; - ScDocument* pRefUndoDoc = NULL; - ScRefUndoData* pUndoData = NULL; + ScDocument* pUndoDoc = nullptr; + ScDocument* pRefUndoDoc = nullptr; + ScRefUndoData* pUndoData = nullptr; if ( bRecord ) { // With the fix for #101329#, UpdateRef always puts cells into pRefUndoDoc at their old position, @@ -2373,7 +2373,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, switch (eCmd) { case DEL_CELLSUP: - rDoc.DeleteRow( nStartCol, 0, nEndCol, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, NULL, &aFullMark ); + rDoc.DeleteRow( nStartCol, 0, nEndCol, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, nullptr, &aFullMark ); nPaintEndRow = MAXROW; break; case DEL_DELROWS: @@ -2384,7 +2384,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, nPaintFlags |= PAINT_LEFT; break; case DEL_CELLSLEFT: - rDoc.DeleteCol( nStartRow, 0, nEndRow, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, NULL, &aFullMark ); + rDoc.DeleteCol( nStartRow, 0, nEndRow, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, nullptr, &aFullMark ); nPaintEndCol = MAXCOL; break; case DEL_DELCOLS: @@ -2411,7 +2411,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, pUndoDoc->AddUndoTab( 0, nTabCount-1 ); // kopieren mit bColRowFlags=false (#54194#) - pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,InsertDeleteFlags::FORMULA,false,pUndoDoc,NULL,false); + pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,InsertDeleteFlags::FORMULA,false,pUndoDoc,nullptr,false); delete pRefUndoDoc; SCTAB* pTabs = new SCTAB[nSelCount]; @@ -2612,7 +2612,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, ScClipParam aClipParam(ScRange(nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nStartTab), bCut); rDoc.CopyToClip(aClipParam, pClipDoc, &aSourceMark, false, bScenariosAdded, true); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); SCCOL nOldEndCol = nEndCol; SCROW nOldEndRow = nEndRow; @@ -2692,7 +2692,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, // ausfuehren - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if (bRecord) { @@ -2735,7 +2735,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, nUndoEndCol,nUndoEndRow,nDestEndTab, HASATTR_MERGED | HASATTR_OVERLAPPED )) { - rDoc.CopyFromClip( rSource, aSourceMark, InsertDeleteFlags::ALL, NULL, pClipDoc ); + rDoc.CopyFromClip( rSource, aSourceMark, InsertDeleteFlags::ALL, nullptr, pClipDoc ); for (nTab=nStartTab; nTab<=nEndTab; nTab++) { SCCOL nTmpEndCol = nEndCol; @@ -2767,7 +2767,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, ScDrawLayer::MoveCells() which may move away inserted objects to wrong positions (e.g. if source and destination range overlaps).*/ rDoc.CopyFromClip( aPasteDest, aDestMark, InsertDeleteFlags::ALL & ~(InsertDeleteFlags::OBJECTS), - NULL, pClipDoc, true, false, bIncludeFiltered ); + nullptr, pClipDoc, true, false, bIncludeFiltered ); // skipped rows and merged cells don't mix if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() ) @@ -2782,7 +2782,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, clipdoc does not contain a drawing layer.*/ if ( pClipDoc->GetDrawLayer() ) rDoc.CopyFromClip( aPasteDest, aDestMark, InsertDeleteFlags::OBJECTS, - NULL, pClipDoc, true, false, bIncludeFiltered ); + nullptr, pClipDoc, true, false, bIncludeFiltered ); if (bRecord) { @@ -2791,7 +2791,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, nStartCol, nStartRow, nStartTab, nOldEndCol, nOldEndRow, nEndTab ), ScAddress( nDestCol, nDestRow, nDestTab ), - bCut, pUndoDoc, NULL, bScenariosAdded ) ); + bCut, pUndoDoc, nullptr, bScenariosAdded ) ); } SCCOL nDestPaintEndCol = nDestEndCol; @@ -3047,8 +3047,8 @@ bool ScDocFunc::DeleteTable( SCTAB nTab, bool bRecord, bool /* bApi */ ) if ( bVbaEnabled ) bRecord = false; bool bWasLinked = rDoc.IsLinked(nTab); - ScDocument* pUndoDoc = NULL; - ScRefUndoData* pUndoData = NULL; + ScDocument* pUndoDoc = nullptr; + ScRefUndoData* pUndoData = nullptr; if (bRecord) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -3400,8 +3400,8 @@ bool ScDocFunc::SetWidthOrHeight( //! Option "Formeln anzeigen" - woher nehmen? } - ScDocument* pUndoDoc = NULL; - ScOutlineTable* pUndoTab = NULL; + ScDocument* pUndoDoc = nullptr; + ScOutlineTable* pUndoTab = nullptr; std::vector<sc::ColRowSpan> aUndoRanges; if ( bRecord ) @@ -3448,7 +3448,7 @@ bool ScDocFunc::SetWidthOrHeight( { sal_uInt8 nOld = rDoc.GetRowFlags(nRow,nTab); SCROW nLastRow = -1; - bool bHidden = rDoc.RowHidden(nRow, nTab, NULL, &nLastRow); + bool bHidden = rDoc.RowHidden(nRow, nTab, nullptr, &nLastRow); if ( !bHidden && ( nOld & CR_MANUALSIZE ) ) rDoc.SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE ); } @@ -3771,7 +3771,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) return false; } - rDoc.SetDocProtection(NULL); + rDoc.SetDocProtection(nullptr); if (rDoc.IsUndoEnabled()) { pProtectCopy->setProtected(false); @@ -3801,7 +3801,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi ) return false; } - rDoc.SetTabProtection(nTab, NULL); + rDoc.SetTabProtection(nTab, nullptr); if (rDoc.IsUndoEnabled()) { pProtectCopy->setProtected(false); @@ -3965,7 +3965,7 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark, bool bSize = pAutoFormat->findByIndex(nFormatNo)->GetIncludeWidthHeight(); SCTAB nTabCount = rDoc.GetTableCount(); - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bRecord ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -4064,7 +4064,7 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark, { WaitObject aWait( ScDocShell::GetActiveDialogParent() ); - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; const bool bUndo(rDoc.IsUndoEnabled()); if (bUndo) @@ -4100,7 +4100,7 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark, } else rDoc.InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow, - aMark, rString, NULL, eGrammar); + aMark, rString, nullptr, eGrammar); if (bUndo) { @@ -4319,7 +4319,7 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark, break; } - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bRecord ) { SCTAB nTabCount = rDoc.GetTableCount(); @@ -4434,7 +4434,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark, break; } - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bRecord ) { SCTAB nTabCount = rDoc.GetTableCount(); @@ -4583,7 +4583,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e WaitObject aWait( ScDocShell::GetActiveDialogParent() ); - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bRecord ) { SCTAB nTabCount = rDoc.GetTableCount(); @@ -4675,7 +4675,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo } } - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; bool bNeedContentsUndo = false; for (set<SCTAB>::const_iterator itr = itrBeg; itr != itrEnd; ++itr) { @@ -4728,7 +4728,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo if (pUndoDoc) { - SdrUndoGroup* pDrawUndo = rDoc.GetDrawLayer() ? rDoc.GetDrawLayer()->GetCalcUndo() : NULL; + SdrUndoGroup* pDrawUndo = rDoc.GetDrawLayer() ? rDoc.GetDrawLayer()->GetCalcUndo() : nullptr; rDocShell.GetUndoManager()->AddUndoAction( new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, pUndoDoc, pDrawUndo) ); } @@ -4770,7 +4770,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, bool bRecord ) if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; for (set<SCTAB>::const_iterator itr = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end(); itr != itrEnd; ++itr) { @@ -5084,7 +5084,7 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi ) ScEditableTester aTester( &rDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow ); if (aTester.IsEditable()) { - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if (bRecord) { @@ -5185,11 +5185,11 @@ bool ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd if ( DeleteContents( aMark, InsertDeleteFlags::CONTENTS, true, bApi ) ) { // GRAM_PODF_A1 for API compatibility. - bRet = EnterMatrix( aNewRange, &aMark, NULL, aFormula, bApi, false, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); + bRet = EnterMatrix( aNewRange, &aMark, nullptr, aFormula, bApi, false, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); if (!bRet) { // versuchen, alten Zustand wiederherzustellen - EnterMatrix( rOldRange, &aMark, NULL, aFormula, bApi, false, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); + EnterMatrix( rOldRange, &aMark, nullptr, aFormula, bApi, false, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); } } @@ -5296,7 +5296,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor return; bool bUndo = rDoc.IsUndoEnabled(); - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; ScRange aCombinedRange = rRanges.Combine(); ScRange aCompleteRange; if(bUndo) @@ -5408,7 +5408,7 @@ void ScDocFunc::ConvertFormulaToValue( const ScRange& rRange, bool bRecord, bool } sc::TableValues aUndoVals(rRange); - sc::TableValues* pUndoVals = bRecord ? &aUndoVals : NULL; + sc::TableValues* pUndoVals = bRecord ? &aUndoVals : nullptr; rDoc.ConvertFormulaToValue(rRange, pUndoVals); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 4f8dd2b39c20..62a489a8920a 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -262,7 +262,7 @@ void ScDocShell::BeforeXMLLoading() aDocument.EnableIdle(false); // prevent unnecessary broadcasts and updates - OSL_ENSURE(pModificator == NULL, "The Modificator should not exist"); + OSL_ENSURE(pModificator == nullptr, "The Modificator should not exist"); pModificator = new ScDocShellModificator( *this ); aDocument.SetImportingXML( true ); @@ -369,7 +369,7 @@ void ScDocShell::AfterXMLLoading(bool bRet) if (eRecalcState == ScDocument::HARDRECALCSTATE_OFF) aDocument.SetHardRecalcState(ScDocument::HARDRECALCSTATE_TEMPORARY); delete pModificator; - pModificator = NULL; + pModificator = nullptr; aDocument.SetHardRecalcState(eRecalcState); } else @@ -579,7 +579,7 @@ bool ScDocShell::Load( SfxMedium& rMedium ) aDocument.GetStyleSheetPool()->CreateStandardStyles(); aDocument.UpdStlShtPtrsFrmNms(); - bRet = LoadXML( &rMedium, NULL ); + bRet = LoadXML( &rMedium, nullptr ); } } @@ -667,7 +667,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( SwitchToShared( true, false ) ) { ScViewData* pViewData = GetViewData(); - ScTabView* pTabView = ( pViewData ? dynamic_cast< ScTabView* >( pViewData->GetView() ) : NULL ); + ScTabView* pTabView = ( pViewData ? dynamic_cast< ScTabView* >( pViewData->GetView() ) : nullptr ); if ( pTabView ) { pTabView->UpdateLayerLocks(); @@ -725,10 +725,10 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { uno::Reference< task::XJob > xJob( xFactory->createInstanceWithContext( xContext ), uno::UNO_QUERY_THROW ); ScViewData* pViewData = GetViewData(); - SfxViewShell* pViewShell = ( pViewData ? pViewData->GetViewShell() : NULL ); - SfxViewFrame* pViewFrame = ( pViewShell ? pViewShell->GetViewFrame() : NULL ); - SfxFrame* pFrame = ( pViewFrame ? &pViewFrame->GetFrame() : NULL ); - uno::Reference< frame::XController > xController = ( pFrame ? pFrame->GetController() : 0 ); + SfxViewShell* pViewShell = ( pViewData ? pViewData->GetViewShell() : nullptr ); + SfxViewFrame* pViewFrame = ( pViewShell ? pViewShell->GetViewFrame() : nullptr ); + SfxFrame* pFrame = ( pViewFrame ? &pViewFrame->GetFrame() : nullptr ); + uno::Reference< frame::XController > xController = ( pFrame ? pFrame->GetController() : nullptr ); uno::Reference< sheet::XSpreadsheetView > xSpreadsheetView( xController, uno::UNO_QUERY_THROW ); uno::Sequence< beans::NamedValue > aArgsForJob { { "SpreadsheetView", uno::makeAny( xSpreadsheetView ) } }; xJob->execute( aArgsForJob ); @@ -761,7 +761,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) // check if shared flag is set in shared file bool bShared = false; ScModelObj* pDocObj = ScModelObj::getImplementation( xModel ); - ScDocShell* pSharedDocShell = ( pDocObj ? dynamic_cast< ScDocShell* >( pDocObj->GetObjectShell() ) : NULL ); + ScDocShell* pSharedDocShell = ( pDocObj ? dynamic_cast< ScDocShell* >( pDocObj->GetObjectShell() ) : nullptr ); if ( pSharedDocShell ) { bShared = pSharedDocShell->HasSharedXMLFlagSet(); @@ -987,7 +987,7 @@ bool ScDocShell::LoadFrom( SfxMedium& rMedium ) // until loading/saving only the styles in XML is implemented, // load the whole file - bRet = LoadXML( &rMedium, NULL ); + bRet = LoadXML( &rMedium, nullptr ); InitItems(); SfxObjectShell::LoadFrom( rMedium ); @@ -1064,7 +1064,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) aDocument.SetInsertingFromOtherDoc( true ); if (aFltName == pFilterXML) - bRet = LoadXML( &rMedium, NULL ); + bRet = LoadXML( &rMedium, nullptr ); else if (aFltName == "StarCalc 1.0") { SvStream* pStream = rMedium.GetInStream(); @@ -1497,7 +1497,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) { // Update all rows in all tables. ScSizeDeviceProvider aProv(this); - ScDocRowHeightUpdater aUpdater(aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), NULL); + ScDocRowHeightUpdater aUpdater(aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), nullptr); aUpdater.update(); } else if (!aRecalcRowRangesArray.empty()) @@ -1619,7 +1619,7 @@ bool ScDocShell::Save() // wait cursor is handled with progress bar bool bRet = SfxObjectShell::Save(); if( bRet ) - bRet = SaveXML( GetMedium(), NULL ); + bRet = SaveXML( GetMedium(), nullptr ); return bRet; } @@ -1689,7 +1689,7 @@ bool ScDocShell::SaveAs( SfxMedium& rMedium ) { bRet = SfxObjectShell::SaveAs( rMedium ); if (bRet) - bRet = SaveXML( &rMedium, NULL ); + bRet = SaveXML( &rMedium, nullptr ); } else { @@ -1875,7 +1875,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt ScHorizontalCellIterator aIter( &aDocument, nTab, nStartCol, nStartRow, nEndCol, nEndRow ); ScRefCellValue* pCell; - while ( ( pCell = aIter.GetNext( nCol, nRow ) ) != NULL ) + while ( ( pCell = aIter.GetNext( nCol, nRow ) ) != nullptr ) { bool bProgress = false; // only upon line change if ( nNextRow < nRow ) @@ -2209,7 +2209,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) { //TODO/LATER: this shouldn't happen! OSL_FAIL("XML filter in ConvertFrom?!"); - bRet = SaveXML( &rMed, NULL ); + bRet = SaveXML( &rMed, nullptr ); } else if (aFltName == pFilterExcel5 || aFltName == pFilterExcel95 || aFltName == pFilterExcel97 || aFltName == pFilterEx5Temp || @@ -2231,7 +2231,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) if( (rMed.GetFilter()->GetFilterFlags() & SfxFilterFlags::ENCRYPTION) == SfxFilterFlags::NONE ) { SfxItemSet* pItemSet = rMed.GetItemSet(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( pItemSet && pItemSet->GetItemState( SID_PASSWORD, true, &pItem ) == SfxItemState::SET ) { bDoSave = ScWarnPassword::WarningOnPassword( rMed ); @@ -2508,10 +2508,10 @@ bool ScDocShell::PrepareClose( bool bUI ) { SfxViewShell* p = pFrame->GetViewShell(); ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); - if(pViewSh!=NULL) + if(pViewSh!=nullptr) { vcl::Window *pWin=pViewSh->GetWindow(); - if(pWin!=NULL) pWin->GrabFocus(); + if(pWin!=nullptr) pWin->GrabFocus(); } } @@ -2645,13 +2645,13 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) : bUpdateEnabled ( true ), nDocumentLock ( 0 ), nCanUpdate (css::document::UpdateDocMode::ACCORDING_TO_CONFIG), - pOldAutoDBRange ( NULL ), - pDocHelper ( NULL ), - pAutoStyleList ( NULL ), - pPaintLockData ( NULL ), - pSolverSaveData ( NULL ), - pSheetSaveData ( NULL ), - pModificator ( NULL ) + pOldAutoDBRange ( nullptr ), + pDocHelper ( nullptr ), + pAutoStyleList ( nullptr ), + pPaintLockData ( nullptr ), + pSolverSaveData ( nullptr ), + pSheetSaveData ( nullptr ), + pModificator ( nullptr ) #if ENABLE_TELEPATHY , mpCollaboration( new ScCollaboration( this ) ) #endif @@ -2670,7 +2670,7 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) : if (pStlPool) StartListening(*pStlPool); - GetPageOnFromPageStyleSet( NULL, 0, bHeaderOn, bFooterOn ); + GetPageOnFromPageStyleSet( nullptr, 0, bHeaderOn, bFooterOn ); SetHelpId( HID_SCSHELL_DOCSH ); // InitItems and CalcOutputFactor are called now in Load/ConvertFrom/InitNew @@ -2690,13 +2690,13 @@ ScDocShell::ScDocShell( const SfxModelFlags i_nSfxCreationFlags ) : bUpdateEnabled ( true ), nDocumentLock ( 0 ), nCanUpdate (css::document::UpdateDocMode::ACCORDING_TO_CONFIG), - pOldAutoDBRange ( NULL ), - pDocHelper ( NULL ), - pAutoStyleList ( NULL ), - pPaintLockData ( NULL ), - pSolverSaveData ( NULL ), - pSheetSaveData ( NULL ), - pModificator ( NULL ) + pOldAutoDBRange ( nullptr ), + pDocHelper ( nullptr ), + pAutoStyleList ( nullptr ), + pPaintLockData ( nullptr ), + pSolverSaveData ( nullptr ), + pSheetSaveData ( nullptr ), + pModificator ( nullptr ) #if ENABLE_TELEPATHY , mpCollaboration( new ScCollaboration( this ) ) #endif @@ -2740,7 +2740,7 @@ ScDocShell::~ScDocShell() delete pDocFunc; delete aDocument.mpUndoManager; - aDocument.mpUndoManager = 0; + aDocument.mpUndoManager = nullptr; delete pImpl; delete pPaintLockData; @@ -2906,7 +2906,7 @@ VclPtr<SfxDocumentInfoDialog> ScDocShell::CreateDocumentInfoDialog( pDlg->AddTabPage( 42, ScGlobal::GetRscString( STR_DOC_STAT ), ScDocStatPageCreate, - NULL); + nullptr); } return pDlg; } @@ -3103,7 +3103,7 @@ void ScDocShellModificator::SetDocumentModified() bool ScDocShell::IsChangeRecording() const { ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack(); - return pChangeTrack != NULL; + return pChangeTrack != nullptr; } bool ScDocShell::HasChangeRecordProtection() const diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index ea02ccf165a2..fd8cc681bd46 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -137,7 +137,7 @@ void ScDocShell::ResetDrawObjectShell() { ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer(); if (pDrawLayer) - pDrawLayer->SetObjectShell( NULL ); + pDrawLayer->SetObjectShell( nullptr ); } ScDrawLayer* ScDocShell::MakeDrawLayer() diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 4ac965f4edf9..efcf435a26f0 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -229,7 +229,7 @@ void ScDocShell::UnlockPaint_Impl(bool bDoc) // Paint jetzt ausfuehren ScPaintLockData* pPaint = pPaintLockData; - pPaintLockData = NULL; // nicht weitersammeln + pPaintLockData = nullptr; // nicht weitersammeln ScRangeListRef xRangeList = pPaint->GetRangeList(); if (xRangeList) @@ -438,7 +438,7 @@ void ScDocShell::UpdateFontList() { delete pImpl->pFontList; // pImpl->pFontList = new FontList( GetPrinter(), Application::GetDefaultDevice() ); - pImpl->pFontList = new FontList( GetRefDevice(), NULL, false ); // sal_False or sal_True??? + pImpl->pFontList = new FontList( GetRefDevice(), nullptr, false ); // sal_False or sal_True??? SvxFontListItem aFontListItem( pImpl->pFontList, SID_ATTR_CHAR_FONTLIST ); PutItem( aFontListItem ); @@ -554,11 +554,11 @@ ScChangeAction* ScDocShell::GetChangeAction( const ScAddress& rPos ) { ScChangeTrack* pTrack = GetDocument().GetChangeTrack(); if (!pTrack) - return NULL; + return nullptr; SCTAB nTab = rPos.Tab(); - const ScChangeAction* pFound = NULL; + const ScChangeAction* pFound = nullptr; long nModified = 0; const ScChangeAction* pAction = pTrack->GetFirst(); while (pAction) @@ -850,7 +850,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck { // deleted Table enthaelt deleted Cols, die nicht sal_uLong nStart, nEnd; pSourceTrack->AppendDeleteRange( - pDel->GetOverAllRange().MakeRange(), NULL, nStart, nEnd ); + pDel->GetOverAllRange().MakeRange(), nullptr, nStart, nEnd ); } } break; @@ -858,7 +858,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck { const ScChangeActionMove* pMove = static_cast<const ScChangeActionMove*>(pThisAction); pSourceTrack->AppendMove( pMove->GetFromRange().MakeRange(), - pMove->GetBigRange().MakeRange(), NULL ); + pMove->GetBigRange().MakeRange(), nullptr ); } break; default: @@ -996,7 +996,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck aSourceRange.aEnd.SetRow( aPos.Row() + nRows - 1 ); aValue = aValue.copy(1, aValue.getLength()-2); // remove the 1st and last characters. GetDocFunc().EnterMatrix( aSourceRange, - NULL, NULL, aValue, false, false, + nullptr, nullptr, aValue, false, false, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_DEFAULT ); } break; @@ -1013,10 +1013,10 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck } break; case SC_CAT_INSERT_ROWS: - GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSROWS_BEFORE, true, false ); + GetDocFunc().InsertCells( aSourceRange, nullptr, INS_INSROWS_BEFORE, true, false ); break; case SC_CAT_INSERT_COLS: - GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSCOLS_BEFORE, true, false ); + GetDocFunc().InsertCells( aSourceRange, nullptr, INS_INSCOLS_BEFORE, true, false ); break; case SC_CAT_DELETE_TABS : GetDocFunc().DeleteTable( aSourceRange.aStart.Tab(), true, false ); @@ -1027,7 +1027,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck if ( pDel->IsTopDelete() ) { aSourceRange = pDel->GetOverAllRange().MakeRange(); - GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELROWS, true, false ); + GetDocFunc().DeleteCells( aSourceRange, nullptr, DEL_DELROWS, true, false ); // #i101099# [Collaboration] Changes are not correctly shown if ( bShared ) @@ -1047,7 +1047,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck if ( pDel->IsTopDelete() && !pDel->IsTabDeleteCol() ) { // deleted Table enthaelt deleted Cols, die nicht aSourceRange = pDel->GetOverAllRange().MakeRange(); - GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELCOLS, true, false ); + GetDocFunc().DeleteCells( aSourceRange, nullptr, DEL_DELCOLS, true, false ); } } break; @@ -1190,7 +1190,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) ScConflictsFinder aFinder( pSharedTrack, nActStartShared, nActEndShared, nActStartOwn, nActEndOwn, aConflictsList ); if ( aFinder.Find() ) { - ScConflictsListHelper::TransformConflictsList( aConflictsList, NULL, &aOwnInverseMergeMap ); + ScConflictsListHelper::TransformConflictsList( aConflictsList, nullptr, &aOwnInverseMergeMap ); bool bLoop = true; while ( bLoop ) { @@ -1245,7 +1245,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) // resolve conflicts for shared non-content actions if ( !aConflictsList.empty() ) { - ScConflictsListHelper::TransformConflictsList( aConflictsList, &aSharedMergeMap, NULL ); + ScConflictsListHelper::TransformConflictsList( aConflictsList, &aSharedMergeMap, nullptr ); ScConflictsResolver aResolver( pThisTrack, aConflictsList ); pAction = pThisTrack->GetAction( nEndShared ); while ( pAction && pAction->GetActionNumber() >= nStartShared ) @@ -1274,7 +1274,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) // resolve conflicts for shared content actions and own actions if ( !aConflictsList.empty() ) { - ScConflictsListHelper::TransformConflictsList( aConflictsList, NULL, &aOwnMergeMap ); + ScConflictsListHelper::TransformConflictsList( aConflictsList, nullptr, &aOwnMergeMap ); ScConflictsResolver aResolver( pThisTrack, aConflictsList ); pAction = pThisTrack->GetAction( nEndShared ); while ( pAction && pAction->GetActionNumber() >= nStartShared ) @@ -1317,7 +1317,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) aInfoBox->Execute(); } - return ( pThisAction != NULL ); + return ( pThisAction != nullptr ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index e3fc6a37038b..e729d1e46231 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -571,14 +571,14 @@ void ScDocShell::Execute( SfxRequest& rReq ) // xmlsec05/06: // getting real parent window when called from Security-Options TP - vcl::Window* pParent = NULL; + vcl::Window* pParent = nullptr; const SfxPoolItem* pParentItem; if( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) ) pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr(); // desired state ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack(); - bool bActivateTracking = (pChangeTrack == 0); // toggle + bool bActivateTracking = (pChangeTrack == nullptr); // toggle if ( pItem ) bActivateTracking = pItem->GetValue(); // from argument @@ -598,7 +598,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if (pChangeTrack) { if ( pChangeTrack->IsProtected() ) - bDo = ExecuteChangeProtectionDialog( NULL ); + bDo = ExecuteChangeProtectionDialog( nullptr ); } if ( bDo ) { @@ -633,7 +633,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) case SID_CHG_PROTECT : { - vcl::Window* pParent = NULL; + vcl::Window* pParent = nullptr; const SfxPoolItem* pParentItem; if( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) ) pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr(); @@ -660,12 +660,12 @@ void ScDocShell::Execute( SfxRequest& rReq ) WinBits(WB_YES_NO | WB_DEF_NO), ScGlobal::GetRscString( STR_END_REDLINING ) ); if( aBox->Execute() == RET_YES ) - bDo = ExecuteChangeProtectionDialog( NULL, true ); + bDo = ExecuteChangeProtectionDialog( nullptr, true ); else bDo = false; } else // merge might reject some actions - bDo = ExecuteChangeProtectionDialog( NULL, true ); + bDo = ExecuteChangeProtectionDialog( nullptr, true ); } if ( !bDo ) { @@ -675,7 +675,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) SfxApplication* pApp = SfxGetpApp(); const SfxPoolItem* pItem; const SfxStringItem* pStringItem(nullptr); - SfxMedium* pMed = NULL; + SfxMedium* pMed = nullptr; if (pReqArgs && pReqArgs->GetItemState(SID_FILE_NAME, true, &pItem) == SfxItemState::SET) { pStringItem = dynamic_cast<const SfxStringItem*>(pItem); @@ -752,7 +752,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if ( !pOtherDocSh->GetError() ) // nur Errors { - bool bHadTrack = ( aDocument.GetChangeTrack() != NULL ); + bool bHadTrack = ( aDocument.GetChangeTrack() != nullptr ); #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT sal_uLong nStart = 0; if ( nSlot == SID_DOCUMENT_MERGE && pChangeTrack ) @@ -1535,10 +1535,10 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, case SID_STATUS_PAGESTYLE: // Click auf StatusBar-Control case SID_FORMATPAGE: { - if ( pReqArgs != NULL ) + if ( pReqArgs != nullptr ) { } - else if ( pReqArgs == NULL ) + else if ( pReqArgs == nullptr ) { OUString aOldName = aDocument.GetPageStyle( nCurTab ); ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); @@ -1609,10 +1609,10 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, case SID_HFEDIT: { - if ( pReqArgs != NULL ) + if ( pReqArgs != nullptr ) { } - else if ( pReqArgs == NULL ) + else if ( pReqArgs == nullptr ) { OUString aStr( aDocument.GetPageStyle( nCurTab ) ); @@ -1780,7 +1780,7 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, void ScDocShell::GetState( SfxItemSet &rSet ) { - bool bTabView = GetBestViewShell() != NULL; + bool bTabView = GetBestViewShell() != nullptr; SfxWhichIter aIter(rSet); for (sal_uInt16 nWhich = aIter.FirstWhich(); nWhich; nWhich = aIter.NextWhich()) @@ -1805,7 +1805,7 @@ void ScDocShell::GetState( SfxItemSet &rSet ) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem( nWhich, - aDocument.GetChangeTrack() != NULL ) ); + aDocument.GetChangeTrack() != nullptr ) ); break; case SID_CHG_PROTECT: @@ -1887,7 +1887,7 @@ void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, sal_uI if ( nAspect == ASPECT_THUMBNAIL ) { Rectangle aBoundRect = GetVisArea( ASPECT_THUMBNAIL ); - ScViewData aTmpData( this, NULL ); + ScViewData aTmpData( this, nullptr ); aTmpData.SetTabNo(nVisTab); SnapVisArea( aBoundRect ); aTmpData.SetScreen( aBoundRect ); @@ -1896,7 +1896,7 @@ void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, sal_uI else { Rectangle aBoundRect = SfxObjectShell::GetVisArea(); - ScViewData aTmpData( this, NULL ); + ScViewData aTmpData( this, nullptr ); aTmpData.SetTabNo(nVisTab); SnapVisArea( aBoundRect ); aTmpData.SetScreen( aBoundRect ); @@ -2002,7 +2002,7 @@ void SnapVer( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCROW& rStartRow ) for (SCROW i = nRow; i <= MAXROW; ++i) { SCROW nLastRow; - if (rDoc.RowHidden(i, nTab, NULL, &nLastRow)) + if (rDoc.RowHidden(i, nTab, nullptr, &nLastRow)) { i = nLastRow; continue; @@ -2075,8 +2075,8 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, if (!pStyleSet) return; - const SvxSetItem* pSetItem = NULL; - const SfxItemSet* pSet = NULL; + const SvxSetItem* pSetItem = nullptr; + const SfxItemSet* pSet = nullptr; pSetItem = static_cast<const SvxSetItem*>( &pStyleSet->Get( ATTR_PAGE_HEADERSET ) ); pSet = &pSetItem->GetItemSet(); @@ -2201,7 +2201,7 @@ bool ScDocShell::DdeSetData( const OUString& rItem, bool bValid = ( (aRange.Parse(aPos, &aDocument, formula::FormulaGrammar::CONV_OOO ) & SCA_VALID) || (aRange.aStart.Parse(aPos, &aDocument, formula::FormulaGrammar::CONV_OOO) & SCA_VALID) ); - ScServerObject* pObj = NULL; // NULL = error + ScServerObject* pObj = nullptr; // NULL = error if ( bValid ) pObj = new ScServerObject( this, rItem ); @@ -2214,7 +2214,7 @@ ScViewData* ScDocShell::GetViewData() { SfxViewShell* pCur = SfxViewShell::Current(); ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( pCur ); - return pViewSh ? &pViewSh->GetViewData() : NULL; + return pViewSh ? &pViewSh->GetViewData() : nullptr; } SCTAB ScDocShell::GetCurTab() @@ -2231,7 +2231,7 @@ ScTabViewShell* ScDocShell::GetBestViewShell( bool bOnlyVisible ) ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); // falsches Doc? if( pViewSh && pViewSh->GetViewData().GetDocShell() != this ) - pViewSh = NULL; + pViewSh = nullptr; if( !pViewSh ) { // 1. ViewShell suchen @@ -2253,12 +2253,12 @@ SfxBindings* ScDocShell::GetViewBindings() if (pViewSh) return &pViewSh->GetViewFrame()->GetBindings(); else - return NULL; + return nullptr; } ScDocShell* ScDocShell::GetShellByNum( sal_uInt16 nDocNo ) // static { - ScDocShell* pFound = NULL; + ScDocShell* pFound = nullptr; SfxObjectShell* pShell = SfxObjectShell::GetFirst(); sal_uInt16 nShellCnt = 0; @@ -2299,7 +2299,7 @@ IMPL_LINK_TYPED( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg if ( !sOptions.isEmpty() ) pImpl->pRequest->AppendItem( SfxStringItem( SID_FILE_FILTEROPTIONS, sOptions ) ); } - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; const SfxInt16Item* pInt16Item(nullptr); SfxItemSet* pSet = pMed->GetItemSet(); if (pSet && pSet->GetItemState(SID_VERSION, true, &pItem) == SfxItemState::SET) diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 6150dabfeac1..a2d7dd018549 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -193,7 +193,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe } else if ( eMode == SC_DB_OLD ) { - pData = NULL; // nichts gefunden + pData = nullptr; // nichts gefunden nStartCol = nEndCol = nCol; nStartRow = nEndRow = nRow; nStartTab = nEndTab = nTab; @@ -272,7 +272,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe } else { - ScDBCollection* pUndoColl = NULL; + ScDBCollection* pUndoColl = nullptr; OUString aNewName; if (eMode==SC_DB_IMPORT) @@ -282,7 +282,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe OUString aImport = ScGlobal::GetRscString( STR_DBNAME_IMPORT ); long nCount = 0; - const ScDBData* pDummy = NULL; + const ScDBData* pDummy = nullptr; ScDBCollection::NamedDBs& rDBs = pColl->getNamedDBs(); do { @@ -331,11 +331,11 @@ ScDBData* ScDocShell::GetAnonymousDBData(const ScRange& rRange) { ScDBCollection* pColl = aDocument.GetDBCollection(); if (!pColl) - return NULL; + return nullptr; ScDBData* pData = pColl->getAnonDBs().getByRange(rRange); if (!pData) - return NULL; + return nullptr; if (!pData->HasHeader()) { @@ -350,7 +350,7 @@ ScDBData* ScDocShell::GetAnonymousDBData(const ScRange& rRange) ScDBData* ScDocShell::GetOldAutoDBRange() { ScDBData* pRet = pOldAutoDBRange; - pOldAutoDBRange = NULL; + pOldAutoDBRange = nullptr; return pRet; // has to be deleted by caller! } @@ -384,7 +384,7 @@ void ScDocShell::CancelAutoDBRange() } delete pOldAutoDBRange; - pOldAutoDBRange = NULL; + pOldAutoDBRange = nullptr; } } @@ -548,7 +548,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord ) aData.GetSize( nColSize, nRowSize ); if (bRecord && nColSize > 0 && nRowSize > 0) { - ScDBData* pUndoData = pDestData ? new ScDBData(*pDestData) : NULL; + ScDBData* pUndoData = pDestData ? new ScDBData(*pDestData) : nullptr; SCTAB nDestTab = rParam.nTab; ScArea aDestArea( rParam.nTab, rParam.nCol, rParam.nRow, @@ -563,7 +563,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord ) // alte Outlines ScOutlineTable* pTable = aDocument.GetOutlineTable( nDestTab ); - ScOutlineTable* pUndoTab = pTable ? new ScOutlineTable( *pTable ) : NULL; + ScOutlineTable* pUndoTab = pTable ? new ScOutlineTable( *pTable ) : nullptr; ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &aDocument, 0, nTabCount-1, false, true ); @@ -604,7 +604,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord ) GetUndoManager()->AddUndoAction( new ScUndoConsolidate( this, aDestArea, rParam, pUndoDoc, - false, 0, NULL, pUndoData ) ); + false, 0, nullptr, pUndoData ) ); } } @@ -781,7 +781,7 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const OUString& rName, const OUStrin ++nNewTab; bool bCopyAll = ( (nFlags & SC_SCENARIO_COPYALL) != 0 ); - const ScMarkData* pCopyMark = NULL; + const ScMarkData* pCopyMark = nullptr; if (!bCopyAll) pCopyMark = &rMark; @@ -1011,7 +1011,7 @@ IMPL_LINK_TYPED( ScDocShell, RefreshDBDataHdl, Timer*, pRefreshTimer, void ) { ScRange aRange; pDBData->GetArea( aRange ); - bool bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, NULL, true ); //! Api-Flag as parameter + bool bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, nullptr, true ); //! Api-Flag as parameter // internal operations (sort, query, subtotal) only if no error if (bContinue) { diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 04654b36ba69..1e05785e810d 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -472,7 +472,7 @@ void ScDocShell::SetFormulaOptions( const ScFormulaOptions& rOpt, bool bForLoadi if (rOpt.GetUseEnglishFuncName()) { // switch native symbols to English. - ScCompiler aComp(NULL, ScAddress()); + ScCompiler aComp(nullptr, ScAddress()); ScCompiler::OpCodeMapPtr xMap = aComp.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH); ScCompiler::SetNativeSymbols(xMap); } diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 46468de4cfd7..35cd59f0306e 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -1068,9 +1068,9 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi const sal_Int32* pColLengths = aColLengths.getConstArray(); ScHorizontalCellIterator aIter( &aDocument, nTab, nFirstCol, nDocRow, nLastCol, nDocRow); - ScRefCellValue* pCell = NULL; + ScRefCellValue* pCell = nullptr; bool bTest = true; - while (bTest && ((pCell = aIter.GetNext( nDocCol, nDocRow)) != NULL)) + while (bTest && ((pCell = aIter.GetNext( nDocCol, nDocRow)) != nullptr)) { SCCOL nCol = nDocCol - nFirstCol; switch (pColTypes[nCol]) diff --git a/sc/source/ui/docshell/docshimp.hxx b/sc/source/ui/docshell/docshimp.hxx index a9068cfda859..9acec21110b7 100644 --- a/sc/source/ui/docshell/docshimp.hxx +++ b/sc/source/ui/docshell/docshimp.hxx @@ -32,9 +32,9 @@ struct DocShell_Impl DocShell_Impl() : bIgnoreLostRedliningWarning( false ) - , pFontList( NULL ) - , pDocInserter( NULL ) - , pRequest( NULL ) + , pFontList( nullptr ) + , pDocInserter( nullptr ) + , pRequest( nullptr ) {} ~DocShell_Impl() diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index c442f1b84818..d2fa8d6f93b0 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -492,7 +492,7 @@ const OUString* ScExternalRefCache::getRealTableName(sal_uInt16 nFileId, const O if (itrDoc == maDocs.end()) { // specified document is not cached. - return NULL; + return nullptr; } const DocItem& rDoc = itrDoc->second; @@ -501,7 +501,7 @@ const OUString* ScExternalRefCache::getRealTableName(sal_uInt16 nFileId, const O if (itrTabId == rDoc.maTableNameIndex.end()) { // the specified table is not in cache. - return NULL; + return nullptr; } return &rDoc.maTableNames[itrTabId->second].maRealName; @@ -515,7 +515,7 @@ const OUString* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const O if (itrDoc == maDocs.end()) { // specified document is not cached. - return NULL; + return nullptr; } const DocItem& rDoc = itrDoc->second; @@ -523,7 +523,7 @@ const OUString* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const O ScGlobal::pCharClass->uppercase(rRangeName)); if (itr == rDoc.maRealRangeNameMap.end()) // range name not found. - return NULL; + return nullptr; return &itr->second; } @@ -1276,7 +1276,7 @@ ScExternalRefCache::DocItem* ScExternalRefCache::getDocItem(sal_uInt16 nFileId) if (!res.second) // insertion failed. - return NULL; + return nullptr; itrDoc = res.first; } @@ -1309,7 +1309,7 @@ void ScExternalRefLink::Closed() return SUCCESS; OUString aFile, aFilter; - sfx2::LinkManager::GetDisplayNames(this, NULL, &aFile, NULL, &aFilter); + sfx2::LinkManager::GetDisplayNames(this, nullptr, &aFile, nullptr, &aFilter); ScExternalRefManager* pMgr = mpDoc->GetExternalRefManager(); if (!pMgr->isFileLoadable(aFile)) @@ -1388,7 +1388,7 @@ static FormulaToken* convertToToken( ScDocument* pHostDoc, ScDocument* pSrcDoc, OSL_FAIL("attempted to convert an unknown cell type."); } - return NULL; + return nullptr; } template<class T> @@ -1477,7 +1477,7 @@ static std::unique_ptr<ScTokenArray> convertToTokenArray( // future we can introduce a new stack variable type svMatrixList with // a new token type that can store a 3D matrix value and convert a 3D // range to it. - return NULL; + return nullptr; std::unique_ptr<ScRange> pUsedRange; @@ -1570,7 +1570,7 @@ static std::unique_ptr<ScTokenArray> convertToTokenArray( } if (!pUsedRange.get()) - return NULL; + return nullptr; s.SetCol(pUsedRange->aStart.Col()); s.SetRow(pUsedRange->aStart.Row()); @@ -1766,7 +1766,7 @@ void putRangeDataIntoCache( // Make sure to set this range 'cached', to prevent unnecessarily // accessing the src document time and time again. ScExternalRefCache::TableTypeRef pCacheTab = - rRefCache.getCacheTable(nFileId, rTabName, true, NULL); + rRefCache.getCacheTable(nFileId, rTabName, true, nullptr); if (pCacheTab) pCacheTab->setCachedCellRange( rCacheRange.aStart.Col(), rCacheRange.aStart.Row(), rCacheRange.aEnd.Col(), rCacheRange.aEnd.Row()); @@ -1888,7 +1888,7 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken( // this data, but add it to the cached range to prevent accessing the // source document time and time again. ScExternalRefCache::TableTypeRef pCacheTab = - maRefCache.getCacheTable(nFileId, rTabName, true, NULL); + maRefCache.getCacheTable(nFileId, rTabName, true, nullptr); if (pCacheTab) pCacheTab->setCachedCell(rCell.Col(), rCell.Row()); @@ -1998,7 +1998,7 @@ bool hasRangeName(ScDocument& rDoc, const OUString& rName) ScRangeName* pExtNames = rDoc.GetRangeName(); OUString aUpperName = ScGlobal::pCharClass->uppercase(rName); const ScRangeData* pRangeData = pExtNames->findByUpperName(aUpperName); - return pRangeData != NULL; + return pRangeData != nullptr; } } @@ -2276,9 +2276,9 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId) { const OUString* pFileName = getExternalFileName(nFileId); if (!pFileName) - return NULL; + return nullptr; - ScDocument* pSrcDoc = NULL; + ScDocument* pSrcDoc = nullptr; ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false)); while (pShell) { @@ -2318,7 +2318,7 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId) ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId) { if (!mpDoc->IsExecuteLinkEnabled()) - return NULL; + return nullptr; DocShellMap::iterator itrEnd = maDocShells.end(); DocShellMap::iterator itr = maDocShells.find(nFileId); @@ -2346,7 +2346,7 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId) const OUString* pFile = getExternalFileName(nFileId); if (!pFile) // no file name associated with this ID. - return NULL; + return nullptr; OUString aFilter; SrcShell aSrcDoc; @@ -2360,7 +2360,7 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId) if (!aSrcDoc.maShell.Is()) { // source document could not be loaded. - return NULL; + return nullptr; } return &cacheNewDocShell(nFileId, aSrcDoc); @@ -2370,7 +2370,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt { const SrcFileData* pFileData = getExternalFileData(nFileId); if (!pFileData) - return NULL; + return nullptr; // Always load the document by using the path created from the relative // path. If the referenced document is not there, simply exit. The @@ -2382,7 +2382,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt aFile = pFileData->maRealFileName; if (!isFileLoadable(aFile)) - return NULL; + return nullptr; OUString aOptions = pFileData->maFilterOptions; if ( !pFileData->maFilterName.isEmpty() ) @@ -2428,7 +2428,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt unique_ptr<SfxMedium> pMedium(new SfxMedium(aFile, STREAM_STD_READ, pFilter, pSet)); if (pMedium->GetError() != ERRCODE_NONE) - return NULL; + return nullptr; // To load encrypted documents with password, user interaction needs to be enabled. pMedium->UseInteractionHandler(mbUserInteractionEnabled); @@ -2624,7 +2624,7 @@ sal_uInt16 ScExternalRefManager::getExternalFileId(const OUString& rFile) const OUString* ScExternalRefManager::getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal) { if (nFileId >= maSrcFiles.size()) - return NULL; + return nullptr; if (bForceOriginal) return &maSrcFiles[nFileId].maFileName; @@ -2664,7 +2664,7 @@ bool ScExternalRefManager::hasExternalFile(const OUString& rFile) const const ScExternalRefManager::SrcFileData* ScExternalRefManager::getExternalFileData(sal_uInt16 nFileId) const { if (nFileId >= maSrcFiles.size()) - return NULL; + return nullptr; return &maSrcFiles[nFileId]; } @@ -2710,7 +2710,7 @@ class RefCacheFiller : public sc::ColumnSpanSet::ColumnAction public: RefCacheFiller( svl::SharedStringPool& rStrPool, ScExternalRefCache& rRefCache, sal_uInt16 nFileId ) : - mrStrPool(rStrPool), mrRefCache(rRefCache), mnFileId(nFileId), mpCurCol(NULL) {} + mrStrPool(rStrPool), mrRefCache(rRefCache), mnFileId(nFileId), mpCurCol(nullptr) {} virtual void startColumn( ScColumn* pCol ) override { diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 55bbaede553f..1f84bdcf1da6 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -88,8 +88,8 @@ ScImportExport::ScImportExport( ScDocument* p ) mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ), mExportTextOptions() { - pUndoDoc = NULL; - pExtOptions = NULL; + pUndoDoc = nullptr; + pExtOptions = nullptr; } // Insert am current cell without range(es) @@ -98,13 +98,13 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt ) aRange( rPt ), nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ), bFormulas( false ), bIncludeFiltered( true ), - bAll( false ), bSingle( true ), bUndo( pDocSh != NULL ), + bAll( false ), bSingle( true ), bUndo( pDocSh != nullptr ), bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ), mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ), mExportTextOptions() { - pUndoDoc = NULL; - pExtOptions = NULL; + pUndoDoc = nullptr; + pExtOptions = nullptr; } // ctor with a range is only used for export @@ -114,13 +114,13 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r ) aRange( r ), nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ), bFormulas( false ), bIncludeFiltered( true ), - bAll( false ), bSingle( false ), bUndo( pDocSh != NULL ), + bAll( false ), bSingle( false ), bUndo( pDocSh != nullptr ), bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ), mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ), mExportTextOptions() { - pUndoDoc = NULL; - pExtOptions = NULL; + pUndoDoc = nullptr; + pExtOptions = nullptr; // Only one sheet (table) supported aRange.aEnd.SetTab( aRange.aStart.Tab() ); } @@ -131,13 +131,13 @@ ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos ) : pDocSh( dynamic_cast< ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ), nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ), bFormulas( false ), bIncludeFiltered( true ), - bAll( false ), bSingle( true ), bUndo( pDocSh != NULL ), + bAll( false ), bSingle( true ), bUndo( pDocSh != nullptr ), bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ), mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ), mExportTextOptions() { - pUndoDoc = NULL; - pExtOptions = NULL; + pUndoDoc = nullptr; + pExtOptions = nullptr; SCTAB nTab = ScDocShell::GetCurTab(); aRange.aStart.SetTab( nTab ); @@ -239,9 +239,9 @@ void ScImportExport::EndPaste(bool bAutoRowHeight) ScMarkData aDestMark; aDestMark.SetMarkArea(aRange); pDocSh->GetUndoManager()->AddUndoAction( - new ScUndoPaste(pDocSh, aRange, aDestMark, pUndoDoc, pRedoDoc, InsertDeleteFlags::ALL, NULL)); + new ScUndoPaste(pDocSh, aRange, aDestMark, pUndoDoc, pRedoDoc, InsertDeleteFlags::ALL, nullptr)); } - pUndoDoc = NULL; + pUndoDoc = nullptr; if( pDocSh ) { if (!bHeight) @@ -706,7 +706,7 @@ static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p, OUString& rString, SylkVersion eVersion ) { const sal_Unicode* pStartQuote = p; - const sal_Unicode* pEndQuote = 0; + const sal_Unicode* pEndQuote = nullptr; while( *(++p) ) { if( *p == '"' ) @@ -719,7 +719,7 @@ static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p, if (*(p+2) == ';') { p += 2; // escaped ';' - pEndQuote = 0; + pEndQuote = nullptr; } else break; // end field @@ -730,7 +730,7 @@ static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p, if (*(p+1) == '"') { ++p; // escaped '"' - pEndQuote = 0; + pEndQuote = nullptr; } else if (*(p+1) == ';') break; // end field @@ -1793,7 +1793,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { double fVal = rtl_math_uStringToDouble( p, aLine.getStr() + aLine.getLength(), - cDecSep, cGrpSep, NULL, NULL ); + cDecSep, cGrpSep, nullptr, nullptr ); pDoc->SetValue( nCol, nRow, aRange.aStart.Tab(), fVal ); } } @@ -2217,8 +2217,8 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin { virtual FltError ScImportRTF( SvStream&, const OUString&, ScDocument*, ScRange& ) override { return eERR_INTERN; } virtual FltError ScImportHTML( SvStream&, const OUString&, ScDocument*, ScRange&, double, bool, SvNumberFormatter*, bool ) override { return eERR_INTERN; } - virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) override { return NULL; } - virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const OUString&, const ScRange&, bool ) override { return NULL; } + virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) override { return nullptr; } + virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const OUString&, const ScRange&, bool ) override { return nullptr; } virtual OUString GetHTMLRangeNameList( ScDocument*, const OUString& ) override { return OUString(); } virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel, rtl_TextEncoding ) override { return eERR_INTERN; } @@ -2228,7 +2228,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin { const OUString&, OUString&, const OUString& ) override { return eERR_INTERN; } virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding ) override { return eERR_INTERN; } - virtual ScOrcusFilters* GetOrcusFilters() override { return NULL; } + virtual ScOrcusFilters* GetOrcusFilters() override { return nullptr; } }; extern "C" { static void SAL_CALL thisModule() {} } @@ -2246,7 +2246,7 @@ ScFormatFilterPlugin &ScFormatFilter::Get() { static ScFormatFilterPlugin *plugin; - if (plugin != NULL) + if (plugin != nullptr) return *plugin; #ifndef DISABLE_DYNLOADING @@ -2258,10 +2258,10 @@ ScFormatFilterPlugin &ScFormatFilter::Get() if (bLoaded) { oslGenericFunction fn = aModule.getFunctionSymbol( "ScFilterCreate" ); - if (fn != NULL) + if (fn != nullptr) plugin = reinterpret_cast<FilterFn>(fn)(); } - if (plugin == NULL) + if (plugin == nullptr) plugin = new ScFormatFilterMissing(); #else plugin = ScFilterCreate(); @@ -2281,7 +2281,7 @@ static inline const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr, return pStr; ++pStr; } - return 0; + return nullptr; } OUString ReadCsvLine( SvStream &rStream, bool bEmbeddedLineBreak, @@ -2334,9 +2334,9 @@ OUString ReadCsvLine( SvStream &rStream, bool bEmbeddedLineBreak, // If blank is a separator it starts a field, if it // is not and thus maybe leading before quote we // are still at start of field regarding quotes. - bFieldStart = (*p == ' ' || lcl_UnicodeStrChr( pSeps, *p) != NULL); + bFieldStart = (*p == ' ' || lcl_UnicodeStrChr( pSeps, *p) != nullptr); else - bFieldStart = (lcl_UnicodeStrChr( pSeps, *p) != NULL); + bFieldStart = (lcl_UnicodeStrChr( pSeps, *p) != nullptr); } } else @@ -2354,9 +2354,9 @@ OUString ReadCsvLine( SvStream &rStream, bool bEmbeddedLineBreak, // actually want that or not, but congruent with what // ScanNextFieldFromString() does. if (bFieldStart) - bFieldStart = (*p == ' ' || lcl_UnicodeStrChr( pSeps, *p) != NULL); + bFieldStart = (*p == ' ' || lcl_UnicodeStrChr( pSeps, *p) != nullptr); else - bFieldStart = (lcl_UnicodeStrChr( pSeps, *p) != NULL); + bFieldStart = (lcl_UnicodeStrChr( pSeps, *p) != nullptr); } } // A quote character inside a field content does not start diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 71cb5da6a2d7..875f126b899d 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -84,7 +84,7 @@ bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, bool bColumns, bool b ScDocument& rDoc = rDocShell.GetDocument(); ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab, true ); - ScOutlineTable* pUndoTab = NULL; + ScOutlineTable* pUndoTab = nullptr; if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; @@ -154,7 +154,7 @@ bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, bool bColumns, bool ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab ); if (pTable) { - ScOutlineTable* pUndoTab = NULL; + ScOutlineTable* pUndoTab = nullptr; if (bRecord) pUndoTab = new ScOutlineTable( *pTable ); @@ -241,7 +241,7 @@ bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, bool bRecord ) SelectLevel( nTab, true, pTable->GetColArray().GetDepth(), false, false ); SelectLevel( nTab, false, pTable->GetRowArray().GetDepth(), false, false ); - rDoc.SetOutlineTable( nTab, NULL ); + rDoc.SetOutlineTable( nTab, nullptr ); rDoc.UpdatePageBreaks( nTab ); @@ -272,8 +272,8 @@ bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, bool bRecord ) bRecord = false; ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab ); - ScDocument* pUndoDoc = NULL; - ScOutlineTable* pUndoTab = NULL; + ScDocument* pUndoDoc = nullptr; + ScOutlineTable* pUndoTab = nullptr; if ( pTable ) { @@ -298,7 +298,7 @@ bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, bool bRecord ) // einblenden SelectLevel( nTab, true, pTable->GetColArray().GetDepth(), false, false ); SelectLevel( nTab, false, pTable->GetRowArray().GetDepth(), false, false ); - rDoc.SetOutlineTable( nTab, NULL ); + rDoc.SetOutlineTable( nTab, nullptr ); } rDoc.DoAutoOutline( nStartCol,nStartRow, nEndCol,nEndRow, nTab ); @@ -363,7 +363,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel ScSubOutlineIterator aIter( &rArray ); // alle Eintraege ScOutlineEntry* pEntry; - while ((pEntry=aIter.GetNext()) != NULL) + while ((pEntry=aIter.GetNext()) != nullptr) { sal_uInt16 nThisLevel = aIter.LastLevel(); bool bShow = (nThisLevel < nLevel); @@ -392,7 +392,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel { // show several rows together, don't show filtered rows SCROW nFilterEnd = i; - bool bFiltered = rDoc.RowFiltered( i, nTab, NULL, &nFilterEnd ); + bool bFiltered = rDoc.RowFiltered( i, nTab, nullptr, &nFilterEnd ); nFilterEnd = std::min( nThisEnd, nFilterEnd ); if ( !bShow || !bFiltered ) rDoc.ShowRows( i, nFilterEnd, nTab, bShow ); @@ -458,7 +458,7 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord ) nMax=0; ScOutlineArray& rColArray = pTable->GetColArray(); ScSubOutlineIterator aColIter( &rColArray ); - while ((pEntry=aColIter.GetNext()) != NULL) + while ((pEntry=aColIter.GetNext()) != nullptr) { nStart = pEntry->GetStart(); nEnd = pEntry->GetEnd(); @@ -479,7 +479,7 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord ) nMax=0; ScOutlineArray& rRowArray = pTable->GetRowArray(); ScSubOutlineIterator aRowIter( &rRowArray ); - while ((pEntry=aRowIter.GetNext()) != NULL) + while ((pEntry=aRowIter.GetNext()) != nullptr) { nStart = pEntry->GetStart(); nEnd = pEntry->GetEnd(); @@ -495,7 +495,7 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord ) { // show several rows together, don't show filtered rows SCROW nFilterEnd = i; - bool bFiltered = rDoc.RowFiltered( i, nTab, NULL, &nFilterEnd ); + bool bFiltered = rDoc.RowFiltered( i, nTab, nullptr, &nFilterEnd ); nFilterEnd = std::min( nMax, nFilterEnd ); if ( !bFiltered ) rDoc.ShowRows( i, nFilterEnd, nTab, true ); @@ -653,7 +653,7 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel { // show several rows together, don't show filtered rows SCROW nFilterEnd = i; - bool bFiltered = rDoc.RowFiltered( i, nTab, NULL, &nFilterEnd ); + bool bFiltered = rDoc.RowFiltered( i, nTab, nullptr, &nFilterEnd ); nFilterEnd = std::min( nEnd, nFilterEnd ); if ( !bFiltered ) rDoc.ShowRows( i, nFilterEnd, nTab, true ); @@ -662,7 +662,7 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel } ScSubOutlineIterator aIter( &rArray, nLevel, nEntry ); - while ((pEntry=aIter.GetNext()) != NULL) + while ((pEntry=aIter.GetNext()) != nullptr) { if ( pEntry->IsHidden() ) { diff --git a/sc/source/ui/docshell/pagedata.cxx b/sc/source/ui/docshell/pagedata.cxx index 6c1e32333bf5..7a73ae639ac7 100644 --- a/sc/source/ui/docshell/pagedata.cxx +++ b/sc/source/ui/docshell/pagedata.cxx @@ -26,8 +26,8 @@ ScPrintRangeData::ScPrintRangeData() { nPagesX = nPagesY = 0; - pPageEndX = NULL; - pPageEndY = NULL; + pPageEndX = nullptr; + pPageEndY = nullptr; bTopDown = bAutomatic = true; nFirstPage = 1; } @@ -47,7 +47,7 @@ void ScPrintRangeData::SetPagesX( size_t nCount, const SCCOL* pData ) memcpy( pPageEndX, pData, nCount * sizeof(SCCOL) ); } else - pPageEndX = NULL; + pPageEndX = nullptr; nPagesX = nCount; } @@ -60,7 +60,7 @@ void ScPrintRangeData::SetPagesY( size_t nCount, const SCROW* pData ) memcpy( pPageEndY, pData, nCount * sizeof(SCROW) ); } else - pPageEndY = NULL; + pPageEndY = nullptr; nPagesY = nCount; } @@ -70,7 +70,7 @@ ScPageBreakData::ScPageBreakData(size_t nMax) if (nMax) pData = new ScPrintRangeData[nMax]; else - pData = NULL; + pData = nullptr; nAlloc = nMax; } diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index be22512cb0fb..6cb3fa982890 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -116,7 +116,7 @@ void ScServerObject::Clear() if (pDocSh) { ScDocShell* pTemp = pDocSh; - pDocSh = NULL; + pDocSh = nullptr; pTemp->GetDocument().EndListeningArea(aRange, false, &aForwarder); pTemp->GetDocument().GetLinkManager()->RemoveServer( this ); @@ -204,7 +204,7 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint ); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocSh = NULL; + pDocSh = nullptr; EndListening(*SfxGetpApp()); // don't access DocShell anymore for EndListening etc. } diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index cfe790a21ee0..b6f7883cfba3 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -51,7 +51,7 @@ struct TableLink_Impl VclPtr<vcl::Window> m_pOldParent; Link<sfx2::SvBaseLink&,void> m_aEndEditLink; - TableLink_Impl() : m_pDocSh( NULL ), m_pOldParent( NULL ) {} + TableLink_Impl() : m_pDocSh( nullptr ), m_pOldParent( nullptr ) {} }; TYPEINIT1(ScTableLink, ::sfx2::SvBaseLink); @@ -123,17 +123,17 @@ void ScTableLink::Edit( vcl::Window* pParent, const Link<SvBaseLink&,void>& rEnd const OUString&, const css::uno::Any& ) { sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument().GetLinkManager(); - if (pLinkManager!=NULL) + if (pLinkManager!=nullptr) { OUString aFile, aFilter; - sfx2::LinkManager::GetDisplayNames(this, 0, &aFile, NULL, &aFilter); + sfx2::LinkManager::GetDisplayNames(this, nullptr, &aFile, nullptr, &aFilter); // the file dialog returns the filter name with the application prefix // -> remove prefix ScDocumentLoader::RemoveAppPrefix( aFilter ); if (!bInCreate) - Refresh( aFile, aFilter, NULL, GetRefreshDelay() ); // don't load twice + Refresh( aFile, aFilter, nullptr, GetRefreshDelay() ); // don't load twice } return SUCCESS; } @@ -210,7 +210,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter, // Undo... - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; bool bFirst = true; if (bAddUndo && bUndo) pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -415,7 +415,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter, IMPL_LINK_NOARG_TYPED(ScTableLink, RefreshHdl, Timer *, void) { - Refresh( aFileName, aFilterName, NULL, GetRefreshDelay() ); + Refresh( aFileName, aFilterName, nullptr, GetRefreshDelay() ); } IMPL_LINK_TYPED( ScTableLink, TableEndEditHdl, ::sfx2::SvBaseLink&, rLink, void ) @@ -464,7 +464,7 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName, // Filter-Detection - const SfxFilter* pSfxFilter = NULL; + const SfxFilter* pSfxFilter = nullptr; SfxMedium* pMedium = new SfxMedium( rFileName, STREAM_STD_READ ); if ( pMedium->GetError() == ERRCODE_NONE ) { @@ -513,8 +513,8 @@ SfxMedium* ScDocumentLoader::CreateMedium( const OUString& rFileName, const SfxF ScDocumentLoader::ScDocumentLoader( const OUString& rFileName, OUString& rFilterName, OUString& rOptions, sal_uInt32 nRekCnt, bool bWithInteraction ) : - pDocShell(0), - pMedium(0) + pDocShell(nullptr), + pMedium(nullptr) { if ( rFilterName.isEmpty() ) GetFilterName( rFileName, rFilterName, rOptions, true, bWithInteraction ); @@ -562,15 +562,15 @@ void ScDocumentLoader::ReleaseDocRef() // release reference without calling DoClose - caller must // have another reference to the doc and call DoClose later - pDocShell = NULL; - pMedium = NULL; + pDocShell = nullptr; + pMedium = nullptr; aRef.Clear(); } } ScDocument* ScDocumentLoader::GetDocument() { - return pDocShell ? &pDocShell->GetDocument() : 0; + return pDocShell ? &pDocShell->GetDocument() : nullptr; } bool ScDocumentLoader::IsError() const diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 2a302f4c4864..49069086436e 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -107,7 +107,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); const size_t nMarkCount = rMarkList.GetMarkCount(); - SdrObject* pSingleSelectedObj = NULL; + SdrObject* pSingleSelectedObj = nullptr; if ( nMarkCount > 0 ) pSingleSelectedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); @@ -228,8 +228,8 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); if ( pObj->IsGroupObject() ) { - SdrPageView* pPV = 0; - SdrObject* pHit = 0; + SdrPageView* pPV = nullptr; + SdrObject* pHit = nullptr; if ( pView->PickObj( pWin->PixelToLogic( pViewData->GetMousePosPixel() ), pView->getHitTolLog(), pHit, pPV, SdrSearchOptions::DEEP ) ) pObj = pHit; } @@ -249,7 +249,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) if( !pArgs ) { - if( rMarkList.GetMark(0) != 0 ) + if( rMarkList.GetMark(0) != nullptr ) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if( pObj->GetObjIdentifier() == OBJ_CAPTION ) @@ -379,7 +379,7 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq, sal_uInt16 nTabPage ) { ScDrawView* pView = pViewData->GetScDrawView(); bool bHasMarked = pView->AreObjectsMarked(); - const SdrObject* pObj = NULL; + const SdrObject* pObj = nullptr; const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if( rMarkList.GetMarkCount() == 1 ) diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 67382ca32c01..6ee0f37ae564 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -382,7 +382,7 @@ void ScDrawShell::GetDrawAttrStateForIFBX( SfxItemSet& rSet ) ScDrawView* pView = pViewData->GetScDrawView(); const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - if( rMarkList.GetMark(0) != 0 ) + if( rMarkList.GetMark(0) != nullptr ) { SfxItemSet aNewAttr(pView->GetGeoAttrFromMarked()); rSet.Put(aNewAttr, false); diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx index b9fbb88e13d3..9e620e5099b4 100644 --- a/sc/source/ui/drawfunc/drawsh4.cxx +++ b/sc/source/ui/drawfunc/drawsh4.cxx @@ -33,8 +33,8 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet) { - const SdrObject* pObj = NULL; - SvxFontWorkDialog* pDlg = NULL; + const SdrObject* pObj = nullptr; + SvxFontWorkDialog* pDlg = nullptr; ScDrawView* pDrView = pViewData->GetScDrawView(); const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); @@ -43,7 +43,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet) if (pViewFrm->HasChildWindow(nId)) { SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId); - pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL; + pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : nullptr; } if ( rMarkList.GetMarkCount() == 1 ) diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 65bae265db17..bdef1063be5f 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -487,7 +487,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(NULL, aName)); + std::unique_ptr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(nullptr, aName)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->SetCheckNameHdl(LINK(this, ScDrawShell, NameObjectHdl)); @@ -556,7 +556,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription)); + std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(nullptr, aTitle, aDescription)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if(RET_OK == pDlg->Execute()) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 80462cddc245..a6b69ebde95e 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -114,7 +114,7 @@ void ScDrawTextObjectBar::StateDisableItems( SfxItemSet &rSet ) ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) : SfxShell(pData->GetViewShell()), pViewData(pData), - pClipEvtLstnr(NULL), + pClipEvtLstnr(nullptr), bPastePossible(false) { SetPool( pViewData->GetScDrawView()->GetDefaultAttr().GetPool() ); @@ -218,14 +218,14 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) SvxFontItem aNewItem( EE_CHAR_FONTINFO ); const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( pArgs ) pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); if ( pItem ) { aString = static_cast<const SfxStringItem*>(pItem)->GetValue(); - const SfxPoolItem* pFtItem = NULL; + const SfxPoolItem* pFtItem = nullptr; pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) @@ -787,7 +787,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) } bool bDone = true; - bool bArgsInReq = ( pArgs != NULL ); + bool bArgsInReq = ( pArgs != nullptr ); if ( !bArgsInReq ) { @@ -796,7 +796,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) case SID_TEXT_STANDARD: // Harte Textattributierung loeschen { OutlinerView* pOutView = pView->IsTextEdit() ? - pView->GetTextEditOutlinerView() : NULL; + pView->GetTextEditOutlinerView() : nullptr; if ( pOutView ) pOutView->Paint( Rectangle() ); diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx index 7942caf032d6..9a97a6aed7af 100644 --- a/sc/source/ui/drawfunc/drtxtob2.cxx +++ b/sc/source/ui/drawfunc/drtxtob2.cxx @@ -201,8 +201,8 @@ void ScDrawTextObjectBar::ExecFormText(SfxRequest& rReq) void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet) { - const SdrObject* pObj = NULL; - SvxFontWorkDialog* pDlg = NULL; + const SdrObject* pObj = nullptr; + SvxFontWorkDialog* pDlg = nullptr; ScDrawView* pDrView = pViewData->GetView()->GetScDrawView(); const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); @@ -211,7 +211,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet) if (pViewFrm->HasChildWindow(nId)) { SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId); - pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL; + pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : nullptr; } if ( rMarkList.GetMarkCount() == 1 ) diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx index dcfaa8281380..780af9e0ba1d 100644 --- a/sc/source/ui/drawfunc/fuconarc.cxx +++ b/sc/source/ui/drawfunc/fuconarc.cxx @@ -185,7 +185,7 @@ SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), - 0L, pDrDoc); + nullptr, pDrDoc); if(pObj) { diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx index 6e3272a33ffe..b53cf0f4948c 100644 --- a/sc/source/ui/drawfunc/fuconcustomshape.cxx +++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx @@ -188,7 +188,7 @@ SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, c { SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), - 0L, pDrDoc); + nullptr, pDrDoc); if( pObj ) { Rectangle aRectangle( rRectangle ); diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx index aa8ff4fc65b0..0e0e9bfd0b6f 100644 --- a/sc/source/ui/drawfunc/fuconpol.cxx +++ b/sc/source/ui/drawfunc/fuconpol.cxx @@ -238,7 +238,7 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), - 0L, pDrDoc); + nullptr, pDrDoc); if(pObj) { diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx index 5698732d94c8..c9ff32fd1aa8 100644 --- a/sc/source/ui/drawfunc/fuconrec.cxx +++ b/sc/source/ui/drawfunc/fuconrec.cxx @@ -220,7 +220,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec { SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), - 0L, pDrDoc); + nullptr, pDrDoc); if(pObj) { diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx index b8cc232ca08e..5318084771a1 100644 --- a/sc/source/ui/drawfunc/fuconstr.cxx +++ b/sc/source/ui/drawfunc/fuconstr.cxx @@ -133,7 +133,7 @@ bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt) SdrHdl* pHdl = pView->PickHandle(aMDPos); - if ( pHdl != NULL || pView->IsMarkedHit(aMDPos) ) + if ( pHdl != nullptr || pView->IsMarkedHit(aMDPos) ) { pView->BegDragObj(aMDPos, nullptr, pHdl, 1); bReturn = true; @@ -187,7 +187,7 @@ bool FuConstruct::MouseMove(const MouseEvent& rMEvt) { SdrHdl* pHdl=pView->PickHandle(aPnt); - if ( pHdl != NULL ) + if ( pHdl != nullptr ) { pViewShell->SetActivePointer(pHdl->GetPointer()); } diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx index 518f2548385c..d6bb3d58d402 100644 --- a/sc/source/ui/drawfunc/fuconuno.cxx +++ b/sc/source/ui/drawfunc/fuconuno.cxx @@ -173,7 +173,7 @@ SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, co SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), - 0L, pDrDoc); + nullptr, pDrDoc); if(pObj) { diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 073508bb4aaf..56c519e2f85b 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -208,7 +208,7 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // no RTTI { FuText* pText = static_cast<FuText*>(pPoor); - pText->SetInEditMode( pObj, NULL, true, pInitialKey ); + pText->SetInEditMode( pObj, nullptr, true, pInitialKey ); //! set cursor to end of text } bReturn = true; @@ -276,7 +276,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) // consumed bReturn = true; } - else if ( lcl_KeyEditMode( pObj, pViewShell, NULL ) ) // start text edit for suitable object + else if ( lcl_KeyEditMode( pObj, pViewShell, nullptr ) ) // start text edit for suitable object bReturn = true; } } @@ -293,7 +293,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if ( lcl_KeyEditMode( pObj, pViewShell, NULL ) ) // start text edit for suitable object + if ( lcl_KeyEditMode( pObj, pViewShell, nullptr ) ) // start text edit for suitable object bReturn = true; } } @@ -483,7 +483,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) const SdrHdlList& rHdlList = pView->GetHdlList(); SdrHdl* pHdl = rHdlList.GetFocusHdl(); - if(0L == pHdl) + if(nullptr == pHdl) { // only take action when move is allowed if(pView->IsMoveAllowed()) @@ -540,7 +540,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) const SdrDragStat& rDragStat = pView->GetDragStat(); // start dragging - pView->BegDragObj(aStartPoint, 0, pHdl, 0); + pView->BegDragObj(aStartPoint, nullptr, pHdl, 0); if(pView->IsDragObj()) { @@ -609,10 +609,10 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) pView->MarkPoint(*pHdl); } - if(0L == rHdlList.GetFocusHdl()) + if(nullptr == rHdlList.GetFocusHdl()) { // restore point with focus - SdrHdl* pNewOne = 0L; + SdrHdl* pNewOne = nullptr; for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a) { @@ -698,7 +698,7 @@ static bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, vcl::Window* pWi MouseEvent aMEvt( rPosPixel, 1, MouseEventModifiers::NONE, MOUSE_LEFT ); SdrHitKind eHit = pView->PickAnything( aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ); - if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL ) + if ( eHit != SDRHIT_NONE && aVEvt.pObj != nullptr ) { if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) && ScDrawLayer::GetHitIMapObject( aVEvt.pObj, pWindow->PixelToLogic(rPosPixel), *pWindow ) ) @@ -722,12 +722,12 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) SdrObject* pObj; SdrPageView* pPV; - ScMacroInfo* pInfo = 0; + ScMacroInfo* pInfo = nullptr; if ( pView->PickObj(aPnt, pView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER) ) { if ( pObj->IsGroupObject() ) { - SdrObject* pHit = 0; + SdrObject* pHit = nullptr; if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SdrSearchOptions::DEEP ) ) pObj = pHit; } diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index f79472cbb53c..05bbdd21479e 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -663,7 +663,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY ); if( xChartModel.is() && xInit.is() ) { - uno::Reference< awt::XWindow > xDialogParentWindow(0); + uno::Reference< awt::XWindow > xDialogParentWindow(nullptr); // initialize dialog uno::Sequence<uno::Any> aSeq(2); uno::Any* pArray = aSeq.getArray(); diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx index d0e5d0c76a60..2b09d57c0779 100644 --- a/sc/source/ui/drawfunc/fupoor.cxx +++ b/sc/source/ui/drawfunc/fupoor.cxx @@ -37,7 +37,7 @@ FuPoor::FuPoor(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* pViewP, pWindow(pWin), pDrDoc(pDoc), aSfxRequest(rReq), - pDialog(NULL), + pDialog(nullptr), bIsInDragMode(false), // remember MouseButton state mnCode(0) @@ -215,7 +215,7 @@ IMPL_LINK_NOARG_TYPED(FuPoor, DragHdl, void*, void) { SdrHdl* pHdl = pView->PickHandle(aMDPos); - if ( pHdl==NULL && pView->IsMarkedHit(aMDPos) ) + if ( pHdl==nullptr && pView->IsMarkedHit(aMDPos) ) { pWindow->ReleaseMouse(); bIsInDragMode = true; @@ -240,7 +240,7 @@ bool FuPoor::IsDetectiveHit( const Point& rLogicPos ) { sal_uInt16 nHitLog = (sal_uInt16) pWindow->PixelToLogic( Size(pView->GetHitTolerancePixel(),0)).Width(); - if(SdrObjectPrimitiveHit(*pObject, rLogicPos, nHitLog, *pPV, 0, false)) + if(SdrObjectPrimitiveHit(*pObject, rLogicPos, nHitLog, *pPV, nullptr, false)) { bFound = true; } @@ -266,7 +266,7 @@ void FuPoor::StopDragTimer() SdrObject* FuPoor::CreateDefaultObject(const sal_uInt16 /* nID */, const Rectangle& /* rRectangle */) { // empty base implementation - return 0L; + return nullptr; } void FuPoor::ImpForceQuadratic(Rectangle& rRect) diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index 86885ac16f3b..8626daa97364 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -114,7 +114,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { SdrHdl* pHdl = pView->PickHandle(aMDPos); - if ( pHdl!=NULL || pView->IsMarkedHit(aMDPos) ) + if ( pHdl!=nullptr || pView->IsMarkedHit(aMDPos) ) { // Determine if this is the tail of a SdrCaptionObj i.e. // we need to disable the drag option on the tail of a note @@ -183,7 +183,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) ScMacroInfo* pTmpInfo = ScDrawLayer::GetMacroInfo( pObj ); if ( !pTmpInfo || pTmpInfo->GetMacro().isEmpty() ) { - SdrObject* pHit = NULL; + SdrObject* pHit = nullptr; if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SdrSearchOptions::DEEP ) ) pObj = pHit; } @@ -229,7 +229,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) SdrViewEvent aVEvt; if ( !bAlt && pView->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ) != SDRHIT_NONE && - aVEvt.pObj != NULL ) + aVEvt.pObj != nullptr ) { if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) ) // ImageMap { @@ -379,7 +379,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) bool bReturn = FuDraw::MouseButtonUp(rMEvt); bool bOle = pViewShell && pViewShell->GetViewFrame()->GetFrame().IsInPlace(); - SdrObject* pObj = NULL; + SdrObject* pObj = nullptr; if (aDragTimer.IsActive() ) { aDragTimer.Stop(); @@ -389,10 +389,10 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); bool bCopy = false; - ScViewData* pViewData = ( pViewShell ? &pViewShell->GetViewData() : NULL ); - ScDocument* pDocument = ( pViewData ? pViewData->GetDocument() : NULL ); - SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : NULL ); - SdrPage* pPage = ( pPageView ? pPageView->GetPage() : NULL ); + ScViewData* pViewData = ( pViewShell ? &pViewShell->GetViewData() : nullptr ); + ScDocument* pDocument = ( pViewData ? pViewData->GetDocument() : nullptr ); + SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : nullptr ); + SdrPage* pPage = ( pPageView ? pPageView->GetPage() : nullptr ); ::std::vector< OUString > aExcludedChartNames; ScRangeListVector aProtectedChartRangesVector; @@ -416,7 +416,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) for ( size_t i = 0; i < nMarkCount; ++i ) { SdrMark* pMark = rSdrMarkList.GetMark( i ); - pObj = ( pMark ? pMark->GetMarkedSdrObj() : NULL ); + pObj = ( pMark ? pMark->GetMarkedSdrObj() : nullptr ); if ( pObj ) { ScChartHelper::AddRangesIfProtectedChart( aProtectedChartRangesVector, pDocument, pObj ); @@ -434,7 +434,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) * If a user wants to click on an object in front of a marked * one, he releases the mouse button immediately **************************************************************/ - SdrPageView* pPV = NULL; + SdrPageView* pPV = nullptr; if (pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) { pView->UnmarkAllObj(); @@ -487,7 +487,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) /************************************************************************** * Ggf. OLE-Objekt beruecksichtigen **************************************************************************/ - SfxInPlaceClient* pIPClient = pViewShell ? pViewShell->GetIPClient() : NULL; + SfxInPlaceClient* pIPClient = pViewShell ? pViewShell->GetIPClient() : nullptr; if (pIPClient) { @@ -583,7 +583,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) if ( bCopy && pViewData && pDocument && pPage ) { ScDocShell* pDocShell = pViewData->GetDocShell(); - ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL ); + ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : nullptr ); if ( pModelObj ) { SCTAB nTab = pViewData->GetTabNo(); diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx index 82cb880c0ab9..6894c81cd528 100644 --- a/sc/source/ui/drawfunc/fusel2.cxx +++ b/sc/source/ui/drawfunc/fusel2.cxx @@ -60,7 +60,7 @@ bool FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos ) { sal_uInt16 nHitLog = (sal_uInt16) pWindow->PixelToLogic( Size(pView->GetHitTolerancePixel(),0)).Width(); - if (SdrObjectPrimitiveHit(*pObject, rPos, nHitLog, *pPV, 0, false)) + if (SdrObjectPrimitiveHit(*pObject, rPos, nHitLog, *pPV, nullptr, false)) { ScViewData& rViewData = pViewShell->GetViewData(); ScSplitPos ePos = pViewShell->FindWindow( pWindow ); @@ -121,7 +121,7 @@ bool FuSelection::IsNoteCaptionMarked() const bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const { - SdrPageView* pPageView = pView ? pView->GetSdrPageView() : 0; + SdrPageView* pPageView = pView ? pView->GetSdrPageView() : nullptr; if( pPageView ) { const ScViewData& rViewData = pViewShell->GetViewData(); diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 8f00c253d26c..64c2d79c368f 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -110,7 +110,7 @@ static void lcl_UpdateHyphenator( Outliner& rOutliner, SdrObject* pObj ) FuText::FuText(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* pViewP, SdrModel* pDoc, SfxRequest& rReq) : FuConstruct(pViewSh, pWin, pViewP, pDoc, rReq), - pTextObj(NULL) + pTextObj(nullptr) { } @@ -167,7 +167,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) const size_t nHdlNum = pView->GetHdlNum(pHdl); - if (pHdl != NULL) + if (pHdl != nullptr) { if (pView->HasMarkablePoints() && pView->IsPointMarkable(*pHdl)) { @@ -199,9 +199,9 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) SdrObject* pObj; SdrPageView* pPV; - if ( pHdl != NULL || pView->IsMarkedHit(aMDPos) ) + if ( pHdl != nullptr || pView->IsMarkedHit(aMDPos) ) { - if (pHdl == NULL && + if (pHdl == nullptr && // pView->TakeTextEditObject(aMDPos, pObj, pPV) ) pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SdrSearchOptions::PICKTEXTEDIT) ) { @@ -284,7 +284,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) pHdl=pView->PickHandle(aMDPos); - if (pHdl!=NULL) + if (pHdl!=nullptr) { pView->MarkPoint(*pHdl); pHdl=pView->GetHdl(nHdlNum); @@ -643,7 +643,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel, } } - pTextObj = NULL; + pTextObj = nullptr; if ( pObj ) { @@ -725,7 +725,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), - 0L, pDrDoc); + nullptr, pDrDoc); if(pObj) { diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx index 2c4e8ed7ffc4..f59e88955310 100644 --- a/sc/source/ui/drawfunc/futext3.cxx +++ b/sc/source/ui/drawfunc/futext3.cxx @@ -63,7 +63,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/) OSL_ENSURE( pDrawLayer && (pDrawLayer == pDrDoc), "FuText::StopEditMode - missing or different drawing layers" ); ScAddress aNotePos; - ScPostIt* pNote = 0; + ScPostIt* pNote = nullptr; if( const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObject, rViewData.GetTabNo() ) ) { aNotePos = pCaptData->maStart; @@ -72,7 +72,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/) } ScDocShell* pDocShell = rViewData.GetDocShell(); - ::svl::IUndoManager* pUndoMgr = rDoc.IsUndoEnabled() ? pDocShell->GetUndoManager() : 0; + ::svl::IUndoManager* pUndoMgr = rDoc.IsUndoEnabled() ? pDocShell->GetUndoManager() : nullptr; bool bNewNote = false; if( pNote && pUndoMgr ) { @@ -109,10 +109,10 @@ void FuText::StopEditMode(bool /*bTextDirection*/) deletion by passing sal_True to this function. The return value changes from SDRENDTEXTEDIT_DELETED to SDRENDTEXTEDIT_SHOULDBEDELETED in this case. */ - /*SdrEndTextEditKind eResult =*/ pView->SdrEndTextEdit( pNote != 0 ); + /*SdrEndTextEditKind eResult =*/ pView->SdrEndTextEdit( pNote != nullptr ); // or ScEndTextEdit (with drawview.hxx) - pViewShell->SetDrawTextUndo( 0 ); + pViewShell->SetDrawTextUndo( nullptr ); vcl::Cursor* pCur = pWindow->GetCursor(); if( pCur && pCur->IsVisible() ) @@ -148,7 +148,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/) rDoc.ReleaseNote(aNotePos); } // ScDocument::DeleteNote has deleted the note that pNote points to - pNote = 0; + pNote = nullptr; } // finalize the undo list action diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index 48bde978398b..6f28525abc73 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -228,7 +228,7 @@ void ScGraphicShell::GetCropGraphicState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && 0 != dynamic_cast<const SdrGrafObj*>( pObj) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && nullptr != dynamic_cast<const SdrGrafObj*>( pObj) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) bEnable = true; } @@ -300,7 +300,7 @@ void ScGraphicShell::ExecuteChangePicture(SfxRequest& /*rReq*/) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && 0 != dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && nullptr != dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC)); diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx index a7281ad77115..d04cd4eb1c17 100644 --- a/sc/source/ui/drawfunc/mediash.cxx +++ b/sc/source/ui/drawfunc/mediash.cxx @@ -107,7 +107,7 @@ void ScMediaShell::ExecuteMedia( SfxRequest& rReq ) const SfxPoolItem* pItem; if( !pArgs || ( SfxItemState::SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, false, &pItem ) ) ) - pItem = NULL; + pItem = nullptr; if( pItem ) { diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 1dba9a5976c9..9cb5a305258f 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -97,7 +97,7 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP, aInsertButton ( VclPtr<ImageButton>::Create( this, ResId( IMB_INSERT, *rResId.GetResMgr() ) ) ), aFiFuncDesc ( VclPtr<FixedText>::Create( this, ResId( FI_FUNCDESC, *rResId.GetResMgr() ) ) ), aOldSize (0,0), - pFuncDesc (NULL) + pFuncDesc (nullptr) { FreeResource(); InitLRUList(); @@ -106,7 +106,7 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP, aIdle.SetPriority(SchedulerPriority::LOWER); aIdle.SetIdleHdl(LINK( this, ScFunctionDockWin, TimerHdl)); - if (pCW != NULL) + if (pCW != nullptr) eSfxNewAlignment=GetAlignment(); else eSfxNewAlignment=SfxChildAlignment::RIGHT; @@ -876,7 +876,7 @@ void ScFunctionDockWin::DoEnter() aString += pAllFuncList->GetSelectEntry(); } EditView *pEdView=pHdl->GetActiveView(); - if(pEdView!=NULL) // @ Wegen Absturz bei Namen festlegen + if(pEdView!=nullptr) // @ Wegen Absturz bei Namen festlegen { if(nArgs>0) { @@ -1015,7 +1015,7 @@ IMPL_LINK_NOARG_TYPED(ScFunctionDockWin, TimerHdl, Idle *, void) void ScFunctionDockWin::Initialize(SfxChildWinInfo *pInfo) { OUString aStr; - if(pInfo!=NULL) + if(pInfo!=nullptr) { if ( !pInfo->aExtraString.isEmpty() ) { diff --git a/sc/source/ui/formdlg/formdata.cxx b/sc/source/ui/formdlg/formdata.cxx index c97fa2bf2def..cea864d1330a 100644 --- a/sc/source/ui/formdlg/formdata.cxx +++ b/sc/source/ui/formdlg/formdata.cxx @@ -21,8 +21,8 @@ ScFormEditData::ScFormEditData() : formula::FormEditData() - , pInputHandler(NULL) - , pScDocShell(NULL) + , pInputHandler(nullptr) + , pScDocShell(nullptr) { Reset(); } diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 0a26cd4d77f8..5e1c7e286ea7 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -58,7 +58,7 @@ using namespace formula; using namespace com::sun::star; -ScDocument* ScFormulaDlg::pDoc = NULL; +ScDocument* ScFormulaDlg::pDoc = nullptr; ScAddress ScFormulaDlg::aCursorPos; // init/ shared functions for dialog @@ -71,7 +71,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, m_aHelper.SetWindow(this); ScModule* pScMod = SC_MOD(); pScMod->InputEnterHandler(); - ScTabViewShell* pScViewShell = NULL; + ScTabViewShell* pScViewShell = nullptr; // title has to be from the view that opened the dialog, // even if it's not the current view @@ -91,7 +91,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, } } - if ( pDoc == NULL ) + if ( pDoc == nullptr ) pDoc = pViewData->GetDocument(); m_xParser.set(ScServiceProvider::MakeInstance(SC_SERVICE_FORMULAPARS, static_cast<ScDocShell*>(pDoc->GetDocumentShell())),uno::UNO_QUERY); uno::Reference< beans::XPropertySet> xSet(m_xParser,uno::UNO_QUERY); @@ -104,7 +104,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, OSL_ENSURE( pInputHdl, "Missing input handler :-/" ); if ( pInputHdl ) - pInputHdl->NotifyChange( NULL ); + pInputHdl->NotifyChange( nullptr ); ScFormulaReferenceHelper::enableInput( false ); ScFormulaReferenceHelper::EnableSpreadsheets(); @@ -189,7 +189,7 @@ void ScFormulaDlg::notifyChange() ScInputHandler* pInputHdl = pScMod->GetInputHdl(); if ( pInputHdl ) - pInputHdl->NotifyChange( NULL ); + pInputHdl->NotifyChange( nullptr ); } void ScFormulaDlg::fill() @@ -212,7 +212,7 @@ void ScFormulaDlg::fill() ScTabViewShell* pTabViewShell; ScInputHandler* pInputHdl = GetNextInputHandler(pData->GetDocShell(),&pTabViewShell); - if ( pInputHdl == NULL ) //no more InputHandler for DocShell + if ( pInputHdl == nullptr ) //no more InputHandler for DocShell { disableOk(); pInputHdl = pScMod->GetInputHdl(); @@ -235,7 +235,7 @@ void ScFormulaDlg::fill() Update(); // switch back, maybe new Doc has been opened - pScMod->SetRefInputHdl(NULL); + pScMod->SetRefInputHdl(nullptr); } } @@ -253,7 +253,7 @@ void ScFormulaDlg::dispose() if (pData) // close dosen't destroy; { //set back reference input handler - pScMod->SetRefInputHdl(NULL); + pScMod->SetRefInputHdl(nullptr); StoreFormEditData(pData); } formula::FormulaDlg::dispose(); @@ -279,17 +279,17 @@ bool ScFormulaDlg::IsInputHdl(ScInputHandler* pHdl) ScInputHandler* ScFormulaDlg::GetNextInputHandler(ScDocShell* pDocShell, ScTabViewShell** ppViewSh) { - ScInputHandler* pHdl=NULL; + ScInputHandler* pHdl=nullptr; SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); - while( pFrame && pHdl==NULL) + while( pFrame && pHdl==nullptr) { SfxViewShell* p = pFrame->GetViewShell(); ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); - if(pViewSh!=NULL) + if(pViewSh!=nullptr) { pHdl=pViewSh->GetInputHandler(); - if(ppViewSh!=NULL) *ppViewSh=pViewSh; + if(ppViewSh!=nullptr) *ppViewSh=pViewSh; } pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ); } @@ -441,7 +441,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc ) bool ScFormulaDlg::IsRefInputMode() const { const IFunctionDescription* pDesc = getCurrentFunctionDescription(); - bool bRef = (pDesc && (pDesc->getSuppressedArgumentCount() > 0)) && (pDoc!=NULL); + bool bRef = (pDesc && (pDesc->getSuppressedArgumentCount() > 0)) && (pDoc!=nullptr); return bRef; } @@ -552,11 +552,11 @@ void ScFormulaDlg::deleteFormData() } void ScFormulaDlg::clear() { - pDoc = NULL; + pDoc = nullptr; //restore reference inputhandler ScModule* pScMod = SC_MOD(); - pScMod->SetRefInputHdl(NULL); + pScMod->SetRefInputHdl(nullptr); // force Enable() of edit line ScTabViewShell* pScViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() ); @@ -571,7 +571,7 @@ void ScFormulaDlg::switchBack() ScInputHandler* pHdl = pScMod->GetInputHdl(); if ( pHdl ) { - pHdl->ViewShellGone(NULL); // -> get active view + pHdl->ViewShellGone(nullptr); // -> get active view pHdl->ShowRefFrame(); } diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx index 9256f3152ffa..8dfea5162682 100644 --- a/sc/source/ui/inc/AccessibleText.hxx +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -166,7 +166,7 @@ public: virtual SvxTextForwarder* GetTextForwarder() override; virtual SvxViewForwarder* GetViewForwarder() override; - virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return NULL; } + virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; } private: ScPreviewViewForwarder* mpViewForwarder; @@ -189,7 +189,7 @@ public: virtual SvxTextForwarder* GetTextForwarder() override; virtual SvxViewForwarder* GetViewForwarder() override; - virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return NULL; } + virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; } private: ScPreviewViewForwarder* mpViewForwarder; @@ -215,7 +215,7 @@ public: virtual SvxTextForwarder* GetTextForwarder() override; virtual SvxViewForwarder* GetViewForwarder() override; - virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return NULL; } + virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; } virtual void UpdateData() override { } private: @@ -243,7 +243,7 @@ public: virtual SvxTextForwarder* GetTextForwarder() override; virtual SvxViewForwarder* GetViewForwarder() override; - virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return NULL; } + virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; } virtual void UpdateData() override { } private: diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx b/sc/source/ui/inc/ChildWindowWrapper.hxx index ed41525bbf60..29d6374f139d 100644 --- a/sc/source/ui/inc/ChildWindowWrapper.hxx +++ b/sc/source/ui/inc/ChildWindowWrapper.hxx @@ -50,7 +50,7 @@ public: static void RegisterChildWindow ( bool bVisible = false, - SfxModule* pModule = NULL, + SfxModule* pModule = nullptr, SfxChildWindowFlags nFlags = SfxChildWindowFlags::NONE) { SfxChildWinFactory* pFactory = new SfxChildWinFactory(ChildWindowWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); @@ -75,16 +75,16 @@ private: static ScTabViewShell* getTabViewShell( SfxBindings *pBindings ) { if( !pBindings ) - return NULL; + return nullptr; SfxDispatcher* pDispacher = pBindings ->GetDispatcher(); if( !pDispacher ) - return NULL; + return nullptr; SfxViewFrame* pFrame = pDispacher->GetFrame(); if( !pFrame ) - return NULL; + return nullptr; SfxViewShell* pViewShell = pFrame->GetViewShell(); if( !pViewShell ) - return NULL; + return nullptr; return dynamic_cast<ScTabViewShell*>( pViewShell ); } }; diff --git a/sc/source/ui/inc/IAnyRefDialog.hxx b/sc/source/ui/inc/IAnyRefDialog.hxx index 0f0ee946d694..cbaf82614261 100644 --- a/sc/source/ui/inc/IAnyRefDialog.hxx +++ b/sc/source/ui/inc/IAnyRefDialog.hxx @@ -36,7 +36,7 @@ public: virtual ~IAnyRefDialog(){} virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0; - virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0; + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) = 0; virtual void RefInputDone( bool bForced = false ) = 0; virtual bool IsTableLocked() const = 0; virtual bool IsRefInputMode() const = 0; diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx index 7b5e256d089e..64cae06eb11c 100644 --- a/sc/source/ui/inc/acredlin.hxx +++ b/sc/source/ui/inc/acredlin.hxx @@ -124,12 +124,12 @@ protected: SvTreeListEntry* InsertChangeAction( const ScChangeAction* pScChangeAction,ScChangeActionState eState, - SvTreeListEntry* pParent=NULL,bool bDelMaster = false, + SvTreeListEntry* pParent=nullptr,bool bDelMaster = false, bool bDisabled = false,sal_uLong nPos = TREELIST_APPEND); SvTreeListEntry* InsertFilteredAction( const ScChangeAction* pScChangeAction,ScChangeActionState eState, - SvTreeListEntry* pParent = NULL,bool bDelMaster = false, + SvTreeListEntry* pParent = nullptr,bool bDelMaster = false, bool bDisabled = false, sal_uLong nPos = TREELIST_APPEND); SvTreeListEntry* InsertChangeActionContent(const ScChangeActionContent* pScChangeAction, diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 7889664ca3f7..dd5da2a6d6cb 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -82,11 +82,11 @@ public: void Init(); void ShowReference(const OUString& rStr); - void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ); void HideReference( bool bDoneRefMode = true ); - void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ); void RefInputDone( bool bForced = false ); - void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ); inline void SetWindow(vcl::Window* _pWindow) { m_pWindow = _pWindow; } bool DoClose( sal_uInt16 nId ); @@ -130,7 +130,7 @@ protected: static void SetDispatcherLock( bool bLock ); - virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) override; + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; virtual void RefInputDone( bool bForced = false ) override; bool ParseWithNames( ScRangeList& rRanges, const OUString& rStr, ScDocument* pDoc ); @@ -149,8 +149,8 @@ public: virtual void ShowReference(const OUString& rStr) override; virtual void HideReference( bool bDoneRefMode = true ) override; - virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) override; - virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) override; + virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; + virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; virtual void ViewShellChanged() override; void SwitchToDocument(); @@ -177,10 +177,10 @@ private: TParentWindow* pParent, const OUString& rID, const OUString& rUIXMLDescription ); template<class TParentWindow, class TResId, class TArg> - ScRefHdlrImplBase( TParentWindow* pParent, TResId nResId, const TArg &rArg, SfxBindings *pB = NULL ); + ScRefHdlrImplBase( TParentWindow* pParent, TResId nResId, const TArg &rArg, SfxBindings *pB = nullptr ); template<class TParentWindow, class TArg> - ScRefHdlrImplBase( TParentWindow* pParent, const OUString& rID, const OUString& rUIXMLDescription, const TArg &rArg, SfxBindings *pB = NULL ); + ScRefHdlrImplBase( TParentWindow* pParent, const OUString& rID, const OUString& rUIXMLDescription, const TArg &rArg, SfxBindings *pB = nullptr ); virtual ~ScRefHdlrImplBase(); diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx index 84810ef2b1a7..3208f8502cf9 100644 --- a/sc/source/ui/inc/cellsh.hxx +++ b/sc/source/ui/inc/cellsh.hxx @@ -41,9 +41,9 @@ struct CellShell_Impl SfxRequest* m_pRequest; CellShell_Impl() : - m_pClipEvtLstnr( NULL ), - m_pLinkedDlg( NULL ), - m_pRequest( NULL ) {} + m_pClipEvtLstnr( nullptr ), + m_pLinkedDlg( nullptr ), + m_pRequest( nullptr ) {} }; class ScCellShell: public ScFormatShell diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx index 5c77a0e832cd..4ca6a9f1a38c 100644 --- a/sc/source/ui/inc/condformatdlgentry.hxx +++ b/sc/source/ui/inc/condformatdlgentry.hxx @@ -117,7 +117,7 @@ protected: public: ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, - const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL ); + const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr ); virtual ~ScConditionFrmtEntry(); virtual void dispose() override; @@ -145,7 +145,7 @@ class ScFormulaFrmtEntry : public ScCondFrmtEntry DECL_LINK_TYPED( StyleSelectHdl, ListBox&, void ); public: - ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL ); + ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr ); virtual ~ScFormulaFrmtEntry(); virtual void dispose() override; @@ -178,7 +178,7 @@ class ScColorScale2FrmtEntry : public ScCondFrmtEntry DECL_LINK_TYPED( EntryTypeHdl, ListBox&, void ); public: - ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL ); + ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr ); virtual ~ScColorScale2FrmtEntry(); virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; @@ -213,7 +213,7 @@ class ScColorScale3FrmtEntry : public ScCondFrmtEntry DECL_LINK_TYPED( EntryTypeHdl, ListBox&, void ); public: - ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL ); + ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr ); virtual ~ScColorScale3FrmtEntry(); virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; @@ -245,7 +245,7 @@ class ScDataBarFrmtEntry : public ScCondFrmtEntry DECL_LINK_TYPED( OptionBtnHdl, Button*, void ); DECL_LINK_TYPED( DataBarTypeSelectHdl, ListBox&, void ); public: - ScDataBarFrmtEntry( vcl::Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = NULL ); + ScDataBarFrmtEntry( vcl::Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = nullptr ); virtual ~ScDataBarFrmtEntry(); virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; @@ -258,7 +258,7 @@ public: class ScDateFrmtEntry : public ScCondFrmtEntry, public SfxListener { public: - ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = NULL ); + ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = nullptr ); virtual ~ScDateFrmtEntry(); virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; @@ -302,7 +302,7 @@ class ScIconSetFrmtEntry : public ScCondFrmtEntry DECL_LINK_TYPED( IconSetTypeHdl, ListBox&, void ); public: - ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = NULL ); + ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = nullptr ); virtual ~ScIconSetFrmtEntry(); virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 9d28dfb31e25..ba8b6face8c6 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -126,7 +126,7 @@ public: OUString GetEntryAltText( SvTreeListEntry* pEntry ) const override; OUString GetEntryLongDescription( SvTreeListEntry* pEntry ) const override; - void ObjectFresh( ScContentId nType, SvTreeListEntry* pEntry = NULL); + void ObjectFresh( ScContentId nType, SvTreeListEntry* pEntry = nullptr); bool SetNavigatorDlgFlag(bool isInNavigatoeDlg){ return bisInNavigatoeDlg=isInNavigatoeDlg;}; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; virtual void KeyInput( const KeyEvent& rKEvt ) override; diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx index f5a1238a0a08..e21194815ef3 100644 --- a/sc/source/ui/inc/dbfunc.hxx +++ b/sc/source/ui/inc/dbfunc.hxx @@ -55,7 +55,7 @@ public: SC_DLLPUBLIC void Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource, bool bRecord ); void DoSubTotals( const ScSubTotalParam& rParam, bool bRecord = true, - const ScSortParam* pForceNewSort = NULL ); + const ScSortParam* pForceNewSort = nullptr ); void ToggleAutoFilter(); void HideAutoFilter(); @@ -86,11 +86,11 @@ public: void UngroupDataPilot(); void DataPilotInput( const ScAddress& rPos, const OUString& rString ); - bool DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = NULL ); + bool DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = nullptr ); bool DataPilotMove( const ScRange& rSource, const ScAddress& rDest ); bool HasSelectionForDrillDown( sal_uInt16& rOrientation ); - void SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName = NULL); + void SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName = nullptr); void ShowDataPilotSourceData( ScDPObject& rDPObj, const css::uno::Sequence< css::sheet::DataPilotFieldFilter >& rFilters ); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index a190472a3b73..0a465cbcf2d5 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -249,7 +249,7 @@ public: void GetStatePageStyle( SfxViewShell& rCaller, SfxItemSet& rSet, SCTAB nCurTab ); void CompareDocument( ScDocument& rOtherDoc ); - void MergeDocument( ScDocument& rOtherDoc, bool bShared = false, bool bCheckDuplicates = false, sal_uLong nOffset = 0, ScChangeActionMergeMap* pMergeMap = NULL, bool bInverseMap = false ); + void MergeDocument( ScDocument& rOtherDoc, bool bShared = false, bool bCheckDuplicates = false, sal_uLong nOffset = 0, ScChangeActionMergeMap* pMergeMap = nullptr, bool bInverseMap = false ); bool MergeSharedDocument( ScDocShell* pSharedDocShell ); ScChangeAction* GetChangeAction( const ScAddress& rPos ); @@ -277,7 +277,7 @@ public: bool IsEditable() const; bool AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ); - void UpdateAllRowHeights( const ScMarkData* pTabMark = NULL ); + void UpdateAllRowHeights( const ScMarkData* pTabMark = nullptr ); void UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore = false ); void RefreshPivotTables( const ScRange& rSource ); @@ -326,7 +326,7 @@ public: void PostPaintGridAll(); void PostPaintExtras(); - bool IsPaintLocked() const { return pPaintLockData != NULL; } + bool IsPaintLocked() const { return pPaintLockData != nullptr; } void PostDataChanged(); @@ -474,7 +474,7 @@ namespace HelperNotifyChanges ScModelObj* pModelObj = ScModelObj::getImplementation(rDocShell.GetModel()); if (pModelObj && pModelObj->HasChangesListeners()) return pModelObj; - return NULL; + return nullptr; } inline void Notify(ScModelObj &rModelObj, const ScRangeList &rChangeRanges, diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index e4030752386a..bff1e5c6781c 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -38,8 +38,8 @@ class ScDocument; class ScDPFieldButton { public: - ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX = NULL, const Fraction* pZoomY = NULL, - ScDocument* pDoc = NULL); + ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX = nullptr, const Fraction* pZoomY = nullptr, + ScDocument* pDoc = nullptr); ~ScDPFieldButton(); void setText(const OUString& rText); diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index bf8312eb5abb..0705153de94c 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -71,11 +71,11 @@ public: virtual bool SdrBeginTextEdit( SdrObject* pObj, - SdrPageView* pPV = 0L, - vcl::Window* pWin = 0L, + SdrPageView* pPV = nullptr, + vcl::Window* pWin = nullptr, bool bIsNewObj = false, - SdrOutliner* pGivenOutliner = 0L, - OutlinerView* pGivenOutlinerView = 0L, + SdrOutliner* pGivenOutliner = nullptr, + OutlinerView* pGivenOutlinerView = nullptr, bool bDontDeleteOutliner = false, bool bOnlyOneView = false, bool bGrabFocus = true) override; @@ -118,7 +118,7 @@ public: /** Returns the selected object, if it is the caption object of a cell note. @param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */ - SdrObject* GetMarkedNoteCaption( ScDrawObjData** ppCaptData = 0 ); + SdrObject* GetMarkedNoteCaption( ScDrawObjData** ppCaptData = nullptr ); /** Locks/unlocks the specified layer in the draw page. Unlocked layer is required to be able to edit the contained objects. */ diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index 92be94f60270..7efa75954fa2 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -87,8 +87,8 @@ public: virtual void HideReference( bool bDoneRefMode = true ) override; virtual void SetReference( const ScRange& rRef, ScDocument* pD ) override; - virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) override; - virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) override; + virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; + virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; virtual void RefInputDone( bool bForced = false ) override; virtual bool IsTableLocked() const override; virtual bool IsRefInputMode() const override; @@ -99,7 +99,7 @@ public: virtual void ViewShellChanged() override; protected: - virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) override; + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; static void SaveLRUEntry(const ScFuncDesc* pFuncDesc); static bool IsInputHdl(ScInputHandler* pHdl); diff --git a/sc/source/ui/inc/futext.hxx b/sc/source/ui/inc/futext.hxx index 8e5879aad94c..bb9118207752 100644 --- a/sc/source/ui/inc/futext.hxx +++ b/sc/source/ui/inc/futext.hxx @@ -48,8 +48,8 @@ public: virtual void ForcePointer(const MouseEvent* pMEvt) override; - void SetInEditMode( SdrObject* pObj = NULL, const Point* pMousePixel = NULL, - bool bCursorToEnd = false, const KeyEvent* pInitialKey = NULL ); + void SetInEditMode( SdrObject* pObj = nullptr, const Point* pMousePixel = nullptr, + bool bCursorToEnd = false, const KeyEvent* pInitialKey = nullptr ); void StopEditMode(bool bTextDirection = false); // Create default drawing objects via keyboard diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 4f82167ff775..ba0aabd6d4b6 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -267,15 +267,15 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou void DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext& rRenderContext); bool GetEditUrl( const Point& rPos, - OUString* pName=0, OUString* pUrl=0, OUString* pTarget=0 ); + OUString* pName=nullptr, OUString* pUrl=nullptr, OUString* pTarget=nullptr ); bool IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCROW nRow ); - bool HitRangeFinder( const Point& rMouse, RfCorner& rCorner, sal_uInt16* pIndex = NULL, - SCsCOL* pAddX = NULL, SCsROW* pAddY = NULL ); + bool HitRangeFinder( const Point& rMouse, RfCorner& rCorner, sal_uInt16* pIndex = nullptr, + SCsCOL* pAddX = nullptr, SCsROW* pAddY = nullptr ); - sal_uInt16 HitPageBreak( const Point& rMouse, ScRange* pSource = NULL, - SCCOLROW* pBreak = NULL, SCCOLROW* pPrev = NULL ); + sal_uInt16 HitPageBreak( const Point& rMouse, ScRange* pSource = nullptr, + SCCOLROW* pBreak = nullptr, SCCOLROW* pPrev = nullptr ); /** The cell may be covered by text that overflows from a previous cell. diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 63f5fd218478..52986836d822 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -123,7 +123,7 @@ private: private: void UpdateActiveView(); - void SyncViews( EditView* pSourceView = NULL ); + void SyncViews( EditView* pSourceView = nullptr ); /** * @param cTyped typed character. If 0, look at existing document content * for text or number. @@ -166,7 +166,7 @@ public: ScInputHandler(); virtual ~ScInputHandler(); - void SetMode( ScInputMode eNewMode, const OUString* pInitText = NULL ); + void SetMode( ScInputMode eNewMode, const OUString* pInitText = nullptr ); bool IsInputMode() const { return (eMode != SC_INPUT_NONE); } bool IsEditMode() const { return (eMode != SC_INPUT_NONE && eMode != SC_INPUT_TYPE); } @@ -197,7 +197,7 @@ public: void SetRefViewShell(ScTabViewShell* pRefVsh) {pRefViewSh=pRefVsh;} void NotifyChange( const ScInputHdlState* pState, bool bForce = false, - ScTabViewShell* pSourceSh = NULL, + ScTabViewShell* pSourceSh = nullptr, bool bStopEditing = true); void UpdateCellAdjust( SvxCellHorJustify eJust ); diff --git a/sc/source/ui/inc/inscodlg.hxx b/sc/source/ui/inc/inscodlg.hxx index d321c8b87bac..a1824a819e2d 100644 --- a/sc/source/ui/inc/inscodlg.hxx +++ b/sc/source/ui/inc/inscodlg.hxx @@ -32,7 +32,7 @@ class ScInsertContentsDlg : public ModalDialog public: ScInsertContentsDlg( vcl::Window* pParent, InsertDeleteFlags nCheckDefaults = InsertDeleteFlags::NONE, - const OUString* pStrTitle = NULL ); + const OUString* pStrTitle = nullptr ); virtual ~ScInsertContentsDlg(); virtual void dispose() override; diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx index 07a96810085e..ffa2548d0a18 100644 --- a/sc/source/ui/inc/instbdlg.hxx +++ b/sc/source/ui/inc/instbdlg.hxx @@ -51,8 +51,8 @@ public: bool GetTablesFromFile() const { return m_pBtnFromFile->IsChecked(); } bool GetTablesAsLink() const { return m_pBtnLink->IsChecked(); } - const OUString* GetFirstTable( sal_uInt16* pN = NULL ); - const OUString* GetNextTable( sal_uInt16* pN = NULL ); + const OUString* GetFirstTable( sal_uInt16* pN = nullptr ); + const OUString* GetNextTable( sal_uInt16* pN = nullptr ); ScDocShell* GetDocShellTables() { return pDocShTables; } bool IsTableBefore() const { return m_pBtnBefore->IsChecked(); } SCTAB GetTableCount() const { return nTableCount;} diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx index 4aa8afd4aa46..b6b615227bb4 100644 --- a/sc/source/ui/inc/navipi.hxx +++ b/sc/source/ui/inc/navipi.hxx @@ -273,12 +273,12 @@ private: static ScNavigatorSettings* GetNavigatorSettings(); bool GetViewData(); - void UpdateColumn ( const SCCOL* pCol = NULL ); - void UpdateRow ( const SCROW* pRow = NULL ); - void UpdateTable ( const SCTAB* pTab = NULL ); + void UpdateColumn ( const SCCOL* pCol = nullptr ); + void UpdateRow ( const SCROW* pRow = nullptr ); + void UpdateTable ( const SCTAB* pTab = nullptr ); void UpdateAll (); - void GetDocNames(const OUString* pSelEntry = NULL); + void GetDocNames(const OUString* pSelEntry = nullptr); void SetListMode ( NavListMode eMode, bool bSetSize = true ); void ShowList ( bool bShow, bool bSetSize ); diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index 2dd5dfbb10d7..601a90bfa24d 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -262,8 +262,8 @@ public: SCTAB nNewTab, long nNewScrX, long nNewScrY, SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2, double nPixelPerTwipsX, double nPixelPerTwipsY, - const Fraction* pZoomX = NULL, - const Fraction* pZoomY = NULL ); + const Fraction* pZoomX = nullptr, + const Fraction* pZoomY = nullptr ); ~ScOutputData(); diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx index 7b7e96047cb9..9ba5a366b132 100644 --- a/sc/source/ui/inc/printfun.hxx +++ b/sc/source/ui/inc/printfun.hxx @@ -106,7 +106,7 @@ private: //! Cache Number of really visible? public: - ScPageRowEntry() { nStartRow = nEndRow = 0; nPagesX = 0; pHidden = NULL; } + ScPageRowEntry() { nStartRow = nEndRow = 0; nPagesX = 0; pHidden = nullptr; } ~ScPageRowEntry() { delete[] pHidden; } ScPageRowEntry(const ScPageRowEntry& r); @@ -220,16 +220,16 @@ private: public: ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTab, long nPage = 0, long nDocP = 0, - const ScRange* pArea = NULL, - const ScPrintOptions* pOptions = NULL, - ScPageBreakData* pData = NULL ); + const ScRange* pArea = nullptr, + const ScPrintOptions* pOptions = nullptr, + ScPageBreakData* pData = nullptr ); // ctors for device other than printer - for preview and pdf: ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab, long nPage = 0, long nDocP = 0, - const ScRange* pArea = NULL, - const ScPrintOptions* pOptions = NULL ); + const ScRange* pArea = nullptr, + const ScPrintOptions* pOptions = nullptr ); ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, const ScPrintState& rState, diff --git a/sc/source/ui/inc/scuiimoptdlg.hxx b/sc/source/ui/inc/scuiimoptdlg.hxx index 8d41f081146f..e254d45e2d1c 100644 --- a/sc/source/ui/inc/scuiimoptdlg.hxx +++ b/sc/source/ui/inc/scuiimoptdlg.hxx @@ -30,8 +30,8 @@ class ScImportOptionsDlg : public ModalDialog public: ScImportOptionsDlg( vcl::Window* pParent, bool bAscii = true, - const ScImportOptions* pOptions = NULL, - const OUString* pStrTitle = NULL, + const ScImportOptions* pOptions = nullptr, + const OUString* pStrTitle = nullptr, bool bMultiByte = false, bool bOnlyDbtoolsEncodings = false, bool bImport = true ); diff --git a/sc/source/ui/inc/spellparam.hxx b/sc/source/ui/inc/spellparam.hxx index fb326f60cd8c..061c0c2517a0 100644 --- a/sc/source/ui/inc/spellparam.hxx +++ b/sc/source/ui/inc/spellparam.hxx @@ -55,7 +55,7 @@ public: inline ScConversionType GetType() const { return meConvType; } inline LanguageType GetSourceLang() const { return meSourceLang; } inline LanguageType GetTargetLang() const { return meTargetLang; } - inline const vcl::Font* GetTargetFont() const { return mbUseTargetFont ? &maTargetFont : 0; } + inline const vcl::Font* GetTargetFont() const { return mbUseTargetFont ? &maTargetFont : nullptr; } inline sal_Int32 GetOptions() const { return mnOptions; } inline bool IsInteractive() const { return mbIsInteractive; } diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx index e5dedcc20710..d48d63228b86 100644 --- a/sc/source/ui/inc/tabpages.hxx +++ b/sc/source/ui/inc/tabpages.hxx @@ -40,7 +40,7 @@ public: protected: using SfxTabPage::DeactivatePage; - virtual sfxpg DeactivatePage ( SfxItemSet* pSet = NULL ) override; + virtual sfxpg DeactivatePage ( SfxItemSet* pSet = nullptr ) override; private: ScTabPageProtection( vcl::Window* pParent, diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 820aecd1512a..ddc89eec1f9b 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -204,8 +204,8 @@ private: void PaintRangeFinderEntry (ScRangeFindData* pData, SCTAB nTab); protected: - void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL, - const SCROW* pPosY = NULL ); + void UpdateHeaderWidth( const ScVSplitPos* pWhich = nullptr, + const SCROW* pPosY = nullptr ); void HideTip(); void ShowRefTip(); @@ -350,7 +350,7 @@ public: void ShowAllCursors(); void AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, - const ScSplitPos* pWhich = NULL ); + const ScSplitPos* pWhich = nullptr ); SvxZoomType GetZoomType() const; void SetZoomType( SvxZoomType eNew, bool bAll ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index a1621110d3e0..dc1d8350e5a0 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -352,7 +352,7 @@ public: void InsertURL( const OUString& rName, const OUString& rURL, const OUString& rTarget, sal_uInt16 nMode ); void InsertURLButton( const OUString& rName, const OUString& rURL, const OUString& rTarget, - const Point* pInsPos = NULL ); + const Point* pInsPos = nullptr ); void InsertURLField( const OUString& rName, const OUString& rURL, const OUString& rTarget ); bool SelectObject( const OUString& rName ); diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx index ea7177a9298b..9476ac151cf2 100644 --- a/sc/source/ui/inc/tpcalc.hxx +++ b/sc/source/ui/inc/tpcalc.hxx @@ -38,7 +38,7 @@ public: virtual bool FillItemSet ( SfxItemSet* rCoreSet ) override; virtual void Reset ( const SfxItemSet* rCoreSet ) override; using SfxTabPage::DeactivatePage; - virtual sfxpg DeactivatePage ( SfxItemSet* pSet = NULL ) override; + virtual sfxpg DeactivatePage ( SfxItemSet* pSet = nullptr ) override; private: ScTpCalcOptions( vcl::Window* pParent, diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx index 69e9a78f4274..d0842af95041 100644 --- a/sc/source/ui/inc/tpcompatibility.hxx +++ b/sc/source/ui/inc/tpcompatibility.hxx @@ -24,7 +24,7 @@ public: virtual bool FillItemSet(SfxItemSet* rCoreAttrs) override; virtual void Reset(const SfxItemSet* rCoreAttrs) override; - virtual sfxpg DeactivatePage(SfxItemSet* pSet = NULL) override; + virtual sfxpg DeactivatePage(SfxItemSet* pSet = nullptr) override; virtual ~ScTpCompatOptions(); virtual void dispose() override; diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx index 335b1b0b05d8..9fd14379ee94 100644 --- a/sc/source/ui/inc/tpdefaults.hxx +++ b/sc/source/ui/inc/tpdefaults.hxx @@ -24,7 +24,7 @@ public: virtual bool FillItemSet(SfxItemSet* rCoreSet) override; virtual void Reset(const SfxItemSet* rCoreSet) override; - virtual sfxpg DeactivatePage(SfxItemSet* pSet = NULL) override; + virtual sfxpg DeactivatePage(SfxItemSet* pSet = nullptr) override; private: explicit ScTpDefaultsOptions(vcl::Window* pParent, const SfxItemSet& rCoreSet); diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx index 3c7ed8cae00a..0b0ed6c51b0a 100644 --- a/sc/source/ui/inc/tpformula.hxx +++ b/sc/source/ui/inc/tpformula.hxx @@ -39,7 +39,7 @@ public: virtual bool FillItemSet(SfxItemSet* rCoreSet) override; virtual void Reset( const SfxItemSet* rCoreSet ) override; - virtual sfxpg DeactivatePage(SfxItemSet* pSet = NULL) override; + virtual sfxpg DeactivatePage(SfxItemSet* pSet = nullptr) override; private: explicit ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& rCoreSet); diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx index f3192bbf5fd0..49e1b8ac08bc 100644 --- a/sc/source/ui/inc/tphf.hxx +++ b/sc/source/ui/inc/tphf.hxx @@ -44,7 +44,7 @@ protected: virtual void ActivatePage() override; virtual void DeactivatePage() override; virtual void ActivatePage( const SfxItemSet& rSet ) override; - virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) override; + virtual sfxpg DeactivatePage( SfxItemSet* pSet = nullptr ) override; private: VclPtr<PushButton> m_pBtnEdit; diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx index b006c4411052..27b1334f6bc7 100644 --- a/sc/source/ui/inc/tpprint.hxx +++ b/sc/source/ui/inc/tpprint.hxx @@ -38,7 +38,7 @@ public: virtual bool FillItemSet( SfxItemSet* rCoreSet ) override; virtual void Reset( const SfxItemSet* rCoreSet ) override; using SfxTabPage::DeactivatePage; - virtual sfxpg DeactivatePage( SfxItemSet* pSet = NULL ) override; + virtual sfxpg DeactivatePage( SfxItemSet* pSet = nullptr ) override; }; #endif diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx index 3f54ce4b1587..f777f74e5666 100644 --- a/sc/source/ui/inc/tpsort.hxx +++ b/sc/source/ui/inc/tpsort.hxx @@ -64,7 +64,7 @@ protected: virtual void ActivatePage ( const SfxItemSet& rSet ) override; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; - virtual sfxpg DeactivatePage ( SfxItemSet* pSet = 0) override; + virtual sfxpg DeactivatePage ( SfxItemSet* pSet = nullptr) override; private: OUString aStrUndefined; @@ -122,7 +122,7 @@ protected: virtual void ActivatePage ( const SfxItemSet& rSet ) override; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; - virtual sfxpg DeactivatePage ( SfxItemSet* pSet = 0) override; + virtual sfxpg DeactivatePage ( SfxItemSet* pSet = nullptr) override; private: diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx index 37893831dfa5..e6d0ba17870b 100644 --- a/sc/source/ui/inc/tptable.hxx +++ b/sc/source/ui/inc/tptable.hxx @@ -36,7 +36,7 @@ public: virtual bool FillItemSet ( SfxItemSet* rCoreSet ) override; virtual void Reset ( const SfxItemSet* rCoreSet ) override; using SfxTabPage::DeactivatePage; - virtual sfxpg DeactivatePage ( SfxItemSet* pSet = NULL ) override; + virtual sfxpg DeactivatePage ( SfxItemSet* pSet = nullptr ) override; virtual void DataChanged ( const DataChangedEvent& rDCEvt ) override; virtual ~ScTablePage(); diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx index 3e4a1b8d3c30..912de9102ce3 100644 --- a/sc/source/ui/inc/tpusrlst.hxx +++ b/sc/source/ui/inc/tpusrlst.hxx @@ -39,7 +39,7 @@ public: virtual bool FillItemSet ( SfxItemSet* rCoreAttrs ) override; virtual void Reset ( const SfxItemSet* rCoreAttrs ) override; using SfxTabPage::DeactivatePage; - virtual sfxpg DeactivatePage ( SfxItemSet* pSet = NULL ) override; + virtual sfxpg DeactivatePage ( SfxItemSet* pSet = nullptr ) override; private: ScTpUserLists( vcl::Window* pParent, diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx index 149330b13275..2af7b8f22d54 100644 --- a/sc/source/ui/inc/tpview.hxx +++ b/sc/source/ui/inc/tpview.hxx @@ -78,7 +78,7 @@ public: using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& ) override; - virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) override; + virtual sfxpg DeactivatePage( SfxItemSet* pSet = nullptr ) override; }; @@ -123,7 +123,7 @@ public: using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& ) override; - virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) override; + virtual sfxpg DeactivatePage( SfxItemSet* pSet = nullptr ) override; void SetDocument(ScDocument* pPtr){pDoc = pPtr;} diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx index f69b21c810c2..a29fd4c25838 100644 --- a/sc/source/ui/inc/transobj.hxx +++ b/sc/source/ui/inc/transobj.hxx @@ -61,7 +61,7 @@ private: void InitDocShell(bool bLimitToPageSize); static void StripRefs( ScDocument* pDoc, SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY, - ScDocument* pDestDoc=0, + ScDocument* pDestDoc=nullptr, SCCOL nSubX=0, SCROW nSubY=0 ); static void PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPrintFactor, const ScRange& rBlock, bool bMetaFile ); diff --git a/sc/source/ui/inc/uiitems.hxx b/sc/source/ui/inc/uiitems.hxx index 3e73bf22163f..440234c8fe76 100644 --- a/sc/source/ui/inc/uiitems.hxx +++ b/sc/source/ui/inc/uiitems.hxx @@ -64,7 +64,7 @@ public: virtual ~ScInputStatusItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; const ScAddress& GetPos() const { return aCursorPos; } @@ -144,7 +144,7 @@ public: virtual ~ScSortItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberUd ) const override; ScViewData* GetViewData () const { return pViewData; } @@ -168,7 +168,7 @@ public: virtual ~ScQueryItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; ScViewData* GetViewData () const { return pViewData; } const ScQueryParam& GetQueryData() const; @@ -196,7 +196,7 @@ public: virtual ~ScSubTotalItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberUd ) const override; ScViewData* GetViewData () const { return pViewData; } @@ -216,7 +216,7 @@ public: virtual ~ScUserListItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; void SetUserList ( const ScUserList& rUserList ); ScUserList* GetUserList () const { return pUserList; } @@ -235,7 +235,7 @@ public: virtual ~ScConsolidateItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; const ScConsolidateParam& GetData() const { return theConsData; } @@ -253,7 +253,7 @@ public: virtual ~ScPivotItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; const ScDPSaveData& GetData() const { return *pSaveData; } const ScRange& GetDestRange() const { return aDestRange; } @@ -275,7 +275,7 @@ public: virtual ~ScSolveItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; const ScSolveParam& GetData() const { return theSolveData; } @@ -293,7 +293,7 @@ public: virtual ~ScTabOpItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; const ScTabOpParam& GetData() const { return theTabOpData; } diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx index d092d1f5f2ed..bd9440d13a0a 100644 --- a/sc/source/ui/inc/undobase.hxx +++ b/sc/source/ui/inc/undobase.hxx @@ -131,7 +131,7 @@ protected: public: TYPEINFO_OVERRIDE(); - ScDBFuncUndo( ScDocShell* pDocSh, const ScRange& rOriginal, SdrUndoAction* pDrawUndo = 0 ); + ScDBFuncUndo( ScDocShell* pDocSh, const ScRange& rOriginal, SdrUndoAction* pDrawUndo = nullptr ); virtual ~ScDBFuncUndo(); void BeginUndo(); diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index cefbb40e7a4e..1e29c5b8f274 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -188,7 +188,7 @@ public: InsertDeleteFlags nNewFlags, ScRefUndoData* pRefData, bool bRedoIsFilled = true, - const ScUndoPasteOptions* pOptions = NULL); + const ScUndoPasteOptions* pOptions = nullptr); virtual ~ScUndoPaste(); virtual void Undo() override; @@ -330,8 +330,8 @@ public: SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, ScDocument* pNewUndoDoc, bool bNewMulti, const ScPatternAttr* pNewApply, - const SvxBoxItem* pNewOuter = NULL, - const SvxBoxInfoItem* pNewInner = NULL ); + const SvxBoxItem* pNewOuter = nullptr, + const SvxBoxInfoItem* pNewInner = nullptr ); virtual ~ScUndoSelectionAttr(); virtual void Undo() override; diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx index 2b18611634d9..ab6ea1014ea2 100644 --- a/sc/source/ui/inc/undocell.hxx +++ b/sc/source/ui/inc/undocell.hxx @@ -97,7 +97,7 @@ public: ScUndoEnterData( ScDocShell* pNewDocShell, const ScAddress& rPos, - ValuesType& rOldValues, const OUString& rNewStr, EditTextObject* pObj = NULL ); + ValuesType& rOldValues, const OUString& rNewStr, EditTextObject* pObj = nullptr ); virtual ~ScUndoEnterData(); @@ -319,7 +319,7 @@ public: TYPEINFO_OVERRIDE(); ScUndoDetective( ScDocShell* pNewDocShell, SdrUndoAction* pDraw, const ScDetOpData* pOperation, - ScDetOpList* pUndoList = NULL ); + ScDetOpList* pUndoList = nullptr ); virtual ~ScUndoDetective(); virtual void Undo() override; diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index 2058a05f355c..c02a44d365c2 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -157,8 +157,8 @@ public: ScDocShell* pNewDocShell, ::std::vector<SCTAB>* pOldTabs, ::std::vector<SCTAB>* pNewTabs, - ::std::vector< OUString>* pOldNames = NULL, - ::std::vector< OUString>* pNewNames = NULL ); + ::std::vector< OUString>* pOldNames = nullptr, + ::std::vector< OUString>* pNewNames = nullptr ); virtual ~ScUndoMoveTab(); @@ -186,7 +186,7 @@ public: ScDocShell* pNewDocShell, ::std::vector<SCTAB>* pOldTabs, ::std::vector<SCTAB>* pNewTabs, - ::std::vector< OUString>* pNewNames = NULL ); + ::std::vector< OUString>* pNewNames = nullptr ); virtual ~ScUndoCopyTab(); diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx index 10e4cfe236bc..d39b99b12bac 100644 --- a/sc/source/ui/inc/validate.hxx +++ b/sc/source/ui/inc/validate.hxx @@ -72,7 +72,7 @@ public: void SetRefInputStartPreHdl( PINPUTSTARTDLTYPE pNewHdl ){ m_pRefInputStartPreHdl = pNewHdl; } void SetRefInputDonePostHdl( void (ScRefHandlerCaller::*pNewHdl)() ){ m_pRefInputDonePostHdl = pNewHdl; } - ScRefHandlerHelper():m_pHandler(NULL), m_pSetReferenceHdl( NULL ), m_pSetActiveHdl(NULL), m_pRefInputStartPreHdl( NULL ), m_pRefInputStartPostHdl( NULL ), m_pRefInputDonePreHdl( NULL ), m_pRefInputDonePostHdl( NULL ){} + ScRefHandlerHelper():m_pHandler(nullptr), m_pSetReferenceHdl( nullptr ), m_pSetActiveHdl(nullptr), m_pRefInputStartPreHdl( nullptr ), m_pRefInputStartPostHdl( nullptr ), m_pRefInputDonePreHdl( nullptr ), m_pRefInputDonePostHdl( nullptr ){} }; class ScValidationDlg; @@ -136,7 +136,7 @@ public: public: ScRefButtonEx(vcl::Window* pParent, WinBits nStyle) : ::formula::RefButton(pParent, nStyle) - , m_pPage(NULL) + , m_pPage(nullptr) { } virtual ~ScRefButtonEx(); @@ -181,7 +181,7 @@ class ScValidationDlg bool LeaveRefStatus(); public: - explicit ScValidationDlg( vcl::Window* pParent, const SfxItemSet* pArgSet, ScTabViewShell * pTabViewSh, SfxBindings *pB = NULL ); + explicit ScValidationDlg( vcl::Window* pParent, const SfxItemSet* pArgSet, ScTabViewShell * pTabViewSh, SfxBindings *pB = nullptr ); virtual ~ScValidationDlg() { disposeOnce(); } virtual void dispose() override { @@ -219,7 +219,7 @@ public: bool IsRefInputting(){ return m_bRefInputting; } vcl::Window* get_refinput_shrink_parent() { return m_pHBox; } - virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) override + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override { if( !CanInputStart( pEdit ) ) return; diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 84bf390b170c..590d0d8300cb 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -83,7 +83,7 @@ public: OUString GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr ); void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& rString, - const EditTextObject* pData = NULL ); + const EditTextObject* pData = nullptr ); void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const EditTextObject& rData, bool bTestSimple = false ); void EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rValue ); @@ -98,8 +98,8 @@ public: void EnterDataAtCursor( const OUString& rString ); //! Not used? - SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = NULL, bool bIncludeObjects = false ); - SC_DLLPUBLIC bool CopyToClip( ScDocument* pClipDoc = NULL, bool bCut = false, bool bApi = false, + SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = nullptr, bool bIncludeObjects = false ); + SC_DLLPUBLIC bool CopyToClip( ScDocument* pClipDoc = nullptr, bool bCut = false, bool bApi = false, bool bIncludeObjects = false, bool bStopEdit = true ); SC_DLLPUBLIC bool CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRange, bool bCut = false, bool bApi = false, bool bIncludeObjects = false, bool bStopEdit = true, bool bUseRangeForVBA = true ); @@ -128,11 +128,11 @@ public: bool PasteDataFormat( SotClipboardFormatId nFormatId, const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable, - SCCOL nPosX, SCROW nPosY, Point* pLogicPos = NULL, + SCCOL nPosX, SCROW nPosY, Point* pLogicPos = nullptr, bool bLink = false, bool bAllowDialogs = false ); bool PasteFile( const Point&, const OUString&, bool bLink=false ); - bool PasteObject( const Point&, const css::uno::Reference < css::embed::XEmbeddedObject >&, const Size* = NULL, const Graphic* = NULL, const OUString& = OUString(), sal_Int64 nAspect = css::embed::Aspects::MSOLE_CONTENT ); + bool PasteObject( const Point&, const css::uno::Reference < css::embed::XEmbeddedObject >&, const Size* = nullptr, const Graphic* = nullptr, const OUString& = OUString(), sal_Int64 nAspect = css::embed::Aspects::MSOLE_CONTENT ); bool PasteBitmapEx( const Point&, const BitmapEx& ); bool PasteMetaFile( const Point&, const GDIMetaFile& ); bool PasteGraphic( const Point& rPos, const Graphic& rGraphic, @@ -143,7 +143,7 @@ public: bool PasteLink( const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable ); void InsertBookmark( const OUString& rDescription, const OUString& rURL, - SCCOL nPosX, SCROW nPosY, const OUString* pTarget = NULL, + SCCOL nPosX, SCROW nPosY, const OUString* pTarget = nullptr, bool bTryReplace = false ); bool HasBookmarkAtCursor( SvxHyperlinkItem* pContent ); @@ -198,23 +198,23 @@ public: void SetWidthOrHeight( bool bWidth, const std::vector<sc::ColRowSpan>& rRanges, ScSizeMode eMode, - sal_uInt16 nSizeTwips, bool bRecord = true, bool bPaint = true, ScMarkData* pMarkData = NULL ); + sal_uInt16 nSizeTwips, bool bRecord = true, bool bPaint = true, ScMarkData* pMarkData = nullptr ); void SetMarkedWidthOrHeight( bool bWidth, ScSizeMode eMode, sal_uInt16 nSizeTwips, bool bRecord = true, bool bPaint = true ); - bool AdjustBlockHeight( bool bPaint = true, ScMarkData* pMarkData = NULL ); + bool AdjustBlockHeight( bool bPaint = true, ScMarkData* pMarkData = nullptr ); bool AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, bool bPaint = true ); void ModifyCellSize( ScDirection eDir, bool bOptimal ); SC_DLLPUBLIC void InsertPageBreak( bool bColumn, bool bRecord = true, - const ScAddress* pPos = NULL, + const ScAddress* pPos = nullptr, bool bSetModified = true ); SC_DLLPUBLIC void DeletePageBreak( bool bColumn, bool bRecord = true, - const ScAddress* pPos = NULL, + const ScAddress* pPos = nullptr, bool bSetModified = true ); void RemoveManualBreaks(); @@ -257,7 +257,7 @@ public: bool DeleteTables(SCTAB nTab, SCTAB nSheets); bool RenameTable( const OUString& rName, SCTAB nTabNr ); - void MoveTable( sal_uInt16 nDestDocNo, SCTAB nDestTab, bool bCopy, const OUString* pNewTabName = NULL ); + void MoveTable( sal_uInt16 nDestDocNo, SCTAB nDestTab, bool bCopy, const OUString* pNewTabName = nullptr ); void ImportTables( ScDocShell* pSrcShell, SCTAB nCount, const SCTAB* pSrcTabs, bool bLink,SCTAB nTab); @@ -317,7 +317,7 @@ public: void EditNote(); void ForgetFormatArea() { bFormatValid = false; } - bool SelectionEditable( bool* pOnlyNotBecauseOfMatrix = NULL ); + bool SelectionEditable( bool* pOnlyNotBecauseOfMatrix = nullptr ); SC_DLLPUBLIC void DataFormPutData( SCROW nCurrentRow , @@ -325,7 +325,7 @@ public: SCROW nEndRow , SCCOL nEndCol , std::vector<VclPtr<Edit> >& aEdits, sal_uInt16 aColLength ); - void UpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAttr = NULL ); + void UpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAttr = nullptr ); // Internal helper functions protected: static void UpdateLineAttrs( ::editeng::SvxBorderLine& rLine, diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 08aa8a7216e5..1eff56088626 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -58,7 +58,7 @@ ScRedlinData::ScRedlinData() { nInfo=RD_SPECIAL_NONE; nActionNo=0; - pData=NULL; + pData=nullptr; bDisabled=false; bIsRejectable=false; bIsAcceptable=false; @@ -71,7 +71,7 @@ ScRedlinData::~ScRedlinData() { nInfo=RD_SPECIAL_NONE; nActionNo=0; - pData=NULL; + pData=nullptr; bDisabled=false; bIsRejectable=false; bIsAcceptable=false; @@ -145,7 +145,7 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window UpdateView(); SvTreeListEntry* pEntry=pTheView->First(); - if(pEntry!=NULL) + if(pEntry!=nullptr) { pTheView->Select(pEntry); } @@ -161,7 +161,7 @@ void ScAcceptChgDlg::dispose() ClearView(); ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pChanges!=NULL) + if(pChanges!=nullptr) { Link<ScChangeTrack&,void> aLink; pChanges->SetModifiedLink(aLink); @@ -177,10 +177,10 @@ void ScAcceptChgDlg::dispose() void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData) { pViewData=ptrViewData; - if(pViewData!=NULL) + if(pViewData!=nullptr) pDoc=ptrViewData->GetDocument(); else - pDoc=NULL; + pDoc=nullptr; bNoSelection=false; bNeedsUpdate=false; @@ -211,7 +211,7 @@ void ScAcceptChgDlg::Init() ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pChanges!=NULL) + if(pChanges!=nullptr) { pChanges->SetModifiedLink( LINK( this, ScAcceptChgDlg,ChgTrackModHdl)); aChangeViewSet.SetTheAuthorToShow(pChanges->GetUser()); @@ -223,7 +223,7 @@ void ScAcceptChgDlg::Init() } ScChangeViewSettings* pViewSettings=pDoc->GetChangeViewSettings(); - if ( pViewSettings!=NULL ) + if ( pViewSettings!=nullptr ) aChangeViewSet = *pViewSettings; // adjust TimeField for filter tabpage aChangeViewSet.AdjustDateMode( *pDoc ); @@ -298,7 +298,7 @@ OUString* ScAcceptChgDlg::MakeTypeString(ScChangeActionType eType) bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction) { - if(pScChangeAction==NULL) return false; + if(pScChangeAction==nullptr) return false; bool bFlag = false; @@ -352,9 +352,9 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction( { ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pScChangeAction==NULL || pChanges==NULL) return NULL; + if(pScChangeAction==nullptr || pChanges==nullptr) return nullptr; - SvTreeListEntry* pEntry=NULL; + SvTreeListEntry* pEntry=nullptr; bool bFlag = false; @@ -470,22 +470,22 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction( } } - if(!bFlag&& bUseColor&& pParent==NULL) + if(!bFlag&& bUseColor&& pParent==nullptr) { pEntry = pTheView->InsertEntry( aBuf.makeStringAndClear() ,pNewData, Color(COL_LIGHTBLUE), pParent, nPos); } - else if(bFlag&& bUseColor&& pParent!=NULL) + else if(bFlag&& bUseColor&& pParent!=nullptr) { pEntry = pTheView->InsertEntry( aBuf.makeStringAndClear(), pNewData, Color(COL_GREEN), pParent, nPos); SvTreeListEntry* pExpEntry=pParent; - while(pExpEntry!=NULL && !pTheView->IsExpanded(pExpEntry)) + while(pExpEntry!=nullptr && !pTheView->IsExpanded(pExpEntry)) { SvTreeListEntry* pTmpEntry=pTheView->GetParent(pExpEntry); - if(pTmpEntry!=NULL) pTheView->Expand(pExpEntry); + if(pTmpEntry!=nullptr) pTheView->Expand(pExpEntry); pExpEntry=pTmpEntry; } @@ -505,11 +505,11 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction( ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pScChangeAction==NULL || pChanges==NULL) return NULL; + if(pScChangeAction==nullptr || pChanges==nullptr) return nullptr; bool bIsGenerated = pChanges->IsGenerated(pScChangeAction->GetActionNumber()); - SvTreeListEntry* pEntry=NULL; + SvTreeListEntry* pEntry=nullptr; bool bFlag = false; @@ -628,9 +628,9 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionC SvTreeListEntry* pParent, sal_uLong nSpecial) { ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - SvTreeListEntry* pEntry=NULL; + SvTreeListEntry* pEntry=nullptr; - if(pScChangeAction==NULL || pChanges==NULL) return NULL; + if(pScChangeAction==nullptr || pChanges==nullptr) return nullptr; bool bIsGenerated = pChanges->IsGenerated(pScChangeAction->GetActionNumber()); @@ -768,9 +768,9 @@ bool ScAcceptChgDlg::PreNotify( NotifyEvent& rNEvt ) void ScAcceptChgDlg::UpdateView() { bNeedsUpdate=false; - SvTreeListEntry* pParent=NULL; - ScChangeTrack* pChanges=NULL; - const ScChangeAction* pScChangeAction=NULL; + SvTreeListEntry* pParent=nullptr; + ScChangeTrack* pChanges=nullptr; + const ScChangeAction* pScChangeAction=nullptr; bAcceptEnableFlag=true; bRejectEnableFlag=true; SetPointer(Pointer(PointerStyle::Wait)); @@ -780,15 +780,15 @@ void ScAcceptChgDlg::UpdateView() bUseColor = bFilterFlag; - if(pDoc!=NULL) + if(pDoc!=nullptr) { pChanges=pDoc->GetChangeTrack(); - if(pChanges!=NULL) + if(pChanges!=nullptr) pScChangeAction=pChanges->GetFirst(); } bool bTheFlag = false; - while(pScChangeAction!=NULL) + while(pScChangeAction!=nullptr) { bHasFilterEntry=false; switch(pScChangeAction->GetState()) @@ -803,23 +803,23 @@ void ScAcceptChgDlg::UpdateView() pParent=InsertFilteredAction(pScChangeAction,SC_CAS_VIRGIN); } else - pParent=NULL; + pParent=nullptr; bTheFlag=true; break; case SC_CAS_ACCEPTED: - pParent=NULL; + pParent=nullptr; nAcceptCount++; break; case SC_CAS_REJECTED: - pParent=NULL; + pParent=nullptr; nRejectCount++; break; } - if(pParent!=NULL && pScChangeAction->IsDialogParent()) + if(pParent!=nullptr && pScChangeAction->IsDialogParent()) { if(!bFilterFlag) pParent->EnableChildrenOnDemand(); @@ -846,21 +846,21 @@ void ScAcceptChgDlg::UpdateView() if(nAcceptCount>0) { pParent=pTheView->InsertEntry( - aStrAllAccepted, static_cast< RedlinData * >(NULL), - static_cast< SvTreeListEntry * >(NULL)); + aStrAllAccepted, static_cast< RedlinData * >(nullptr), + static_cast< SvTreeListEntry * >(nullptr)); pParent->EnableChildrenOnDemand(); } if(nRejectCount>0) { pParent=pTheView->InsertEntry( - aStrAllRejected, static_cast< RedlinData * >(NULL), - static_cast< SvTreeListEntry * >(NULL)); + aStrAllRejected, static_cast< RedlinData * >(nullptr), + static_cast< SvTreeListEntry * >(nullptr)); pParent->EnableChildrenOnDemand(); } pTheView->SetUpdateMode(true); SetPointer(Pointer(PointerStyle::Arrow)); SvTreeListEntry* pEntry=pTheView->First(); - if(pEntry!=NULL) + if(pEntry!=nullptr) pTheView->Select(pEntry); } @@ -875,7 +875,7 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, RefHandle, SvxTPFilter*, void) SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame(); ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(pViewFrm->GetChildWindow( nId )); - if(pWnd!=NULL) + if(pWnd!=nullptr) { sal_uInt16 nAcceptId=ScAcceptChgDlgWrapper::GetChildWindowId(); pViewFrm->ShowChildWindow(nAcceptId,false); @@ -897,7 +897,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, RefInfoHandle, const OUString*, pResult, void) ScSimpleRefDlgWrapper::SetAutoReOpen(true); SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame(); - if(pResult!=NULL) + if(pResult!=nullptr) { pTPFilter->SetRange(*pResult); FilterHandle(pTPFilter); @@ -905,7 +905,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, RefInfoHandle, const OUString*, pResult, void) nId = ScSimpleRefDlgWrapper::GetChildWindowId(); ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(pViewFrm->GetChildWindow( nId )); - if(pWnd!=NULL) + if(pWnd!=nullptr) { vcl::Window* pWin=pWnd->GetWindow(); Size aWinSize=pWin->GetSizePixel(); @@ -925,7 +925,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, RefInfoHandle, const OUString*, pResult, void) IMPL_LINK_TYPED( ScAcceptChgDlg, FilterHandle, SvxTPFilter*, pRef, void ) { - if(pRef!=NULL) + if(pRef!=nullptr) { ClearView(); aRangeList.RemoveAll(); @@ -941,13 +941,13 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, RejectHandle, SvxTPView*, pRef, void ) bIgnoreMsg=true; ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pRef!=NULL) + if(pRef!=nullptr) { SvTreeListEntry* pEntry=pTheView->FirstSelected(); - while(pEntry!=NULL) + while(pEntry!=nullptr) { ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) { ScChangeAction* pScChangeAction= static_cast<ScChangeAction*>(pEntryData->pData); @@ -977,13 +977,13 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef, void ) ScChangeTrack* pChanges=pDoc->GetChangeTrack(); bIgnoreMsg=true; - if(pRef!=NULL) + if(pRef!=nullptr) { SvTreeListEntry* pEntry=pTheView->FirstSelected(); - while(pEntry!=NULL) + while(pEntry!=nullptr) { ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) { ScChangeAction* pScChangeAction= static_cast<ScChangeAction*>(pEntryData->pData); @@ -1011,16 +1011,16 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef, void ) void ScAcceptChgDlg::RejectFiltered() { - if(pDoc==NULL) return; + if(pDoc==nullptr) return; ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - const ScChangeAction* pScChangeAction=NULL; + const ScChangeAction* pScChangeAction=nullptr; - if(pChanges!=NULL) + if(pChanges!=nullptr) { pScChangeAction=pChanges->GetLast(); } - while(pScChangeAction!=NULL) + while(pScChangeAction!=nullptr) { if(pScChangeAction->IsDialogRoot()) if(IsValidAction(pScChangeAction)) @@ -1031,14 +1031,14 @@ void ScAcceptChgDlg::RejectFiltered() } void ScAcceptChgDlg::AcceptFiltered() { - if(pDoc==NULL) return; + if(pDoc==nullptr) return; ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - const ScChangeAction* pScChangeAction=NULL; + const ScChangeAction* pScChangeAction=nullptr; - if(pChanges!=NULL) + if(pChanges!=nullptr) pScChangeAction=pChanges->GetLast(); - while(pScChangeAction!=NULL) + while(pScChangeAction!=nullptr) { if(pScChangeAction->IsDialogRoot()) if(IsValidAction(pScChangeAction)) @@ -1053,7 +1053,7 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, RejectAllHandle, SvxTPView*, void) SetPointer(Pointer(PointerStyle::Wait)); bIgnoreMsg=true; ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pChanges!=NULL) + if(pChanges!=nullptr) { if(pTPFilter->IsDate()||pTPFilter->IsAuthor()||pTPFilter->IsRange()||pTPFilter->IsComment()) RejectFiltered(); @@ -1081,7 +1081,7 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, AcceptAllHandle, SvxTPView*, void) bIgnoreMsg=true; ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pChanges!=NULL) + if(pChanges!=nullptr) { if(pTPFilter->IsDate()||pTPFilter->IsAuthor()||pTPFilter->IsRange()||pTPFilter->IsComment()) AcceptFiltered(); @@ -1114,7 +1114,7 @@ void ScAcceptChgDlg::GetDependents( const ScChangeAction* pScChangeAction, ScChangeTrack* pChanges=pDoc->GetChangeTrack(); SvTreeListEntry* pParent=pTheView->GetParent(pEntry); - if(pParent!=NULL) + if(pParent!=nullptr) { ScRedlinData *pParentData=static_cast<ScRedlinData *>(pParent->GetUserData()); ScChangeAction* pParentAction=static_cast<ScChangeAction*>(pParentData->pData); @@ -1149,7 +1149,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL const_cast<ScChangeAction*>( pScChangeAction ) ) ); bParentInserted = true; } - SvTreeListEntry* pEntry=NULL; + SvTreeListEntry* pEntry=nullptr; ScChangeActionMap::iterator itChangeAction = pActionMap->begin(); while( itChangeAction != pActionMap->end() ) @@ -1166,7 +1166,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL dynamic_cast<const ScChangeActionContent*>( itChangeAction->second ), pParent, RD_SPECIAL_CONTENT ); - if(pOriginal!=NULL) + if(pOriginal!=nullptr) { bTheTestFlag=false; ScRedlinData *pParentData=static_cast<ScRedlinData *>(pOriginal->GetUserData()); @@ -1183,7 +1183,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL pEntry = InsertChangeActionContent( dynamic_cast<const ScChangeActionContent*>( itChangeAction->second ), pParent, RD_SPECIAL_NONE ); - if(pEntry!=NULL) + if(pEntry!=nullptr) bTheTestFlag=false; } ++itChangeAction; @@ -1194,7 +1194,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL pEntry=InsertChangeActionContent(static_cast<const ScChangeActionContent*>( pScChangeAction),pParent,RD_SPECIAL_NONE); - if(pEntry!=NULL) + if(pEntry!=nullptr) { bTheTestFlag=false; ScRedlinData *pParentData=static_cast<ScRedlinData *>(pEntry->GetUserData()); @@ -1228,10 +1228,10 @@ bool ScAcceptChgDlg::InsertAcceptedORejected(SvTreeListEntry* pParent) } ScChangeAction* pScChangeAction=pChanges->GetFirst(); - while(pScChangeAction!=NULL) + while(pScChangeAction!=nullptr) { if(pScChangeAction->GetState()==eState && - InsertFilteredAction(pScChangeAction,eState,pParent)!=NULL) + InsertFilteredAction(pScChangeAction,eState,pParent)!=nullptr) bTheTestFlag=false; pScChangeAction=pScChangeAction->GetNext(); } @@ -1248,7 +1248,7 @@ bool ScAcceptChgDlg::InsertChildren(ScChangeActionMap* pActionMap,SvTreeListEntr { SvTreeListEntry* pEntry=InsertChangeAction( itChangeAction->second, SC_CAS_VIRGIN, pParent, false, true ); - if(pEntry!=NULL) + if(pEntry!=nullptr) { bTheTestFlag=false; @@ -1269,7 +1269,7 @@ bool ScAcceptChgDlg::InsertDeletedChildren(const ScChangeAction* pScChangeAction { ScChangeTrack* pChanges=pDoc->GetChangeTrack(); bool bTheTestFlag = true; - SvTreeListEntry* pEntry=NULL; + SvTreeListEntry* pEntry=nullptr; ScChangeActionMap::iterator itChangeAction; for( itChangeAction = pActionMap->begin(); itChangeAction != pActionMap->end(); ++itChangeAction ) @@ -1280,7 +1280,7 @@ bool ScAcceptChgDlg::InsertDeletedChildren(const ScChangeAction* pScChangeAction else pEntry = InsertChangeAction( itChangeAction->second, SC_CAS_VIRGIN, pParent, true, true ); - if(pEntry!=NULL) + if(pEntry!=nullptr) { ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); pEntryData->bIsRejectable=false; @@ -1302,7 +1302,7 @@ bool ScAcceptChgDlg::Expand( { bool bTheTestFlag = true; - if(pChanges!=NULL &&pEntry!=NULL &&pScChangeAction!=NULL) + if(pChanges!=nullptr &&pEntry!=nullptr &&pScChangeAction!=nullptr) { ScChangeActionMap aActionMap; @@ -1340,16 +1340,16 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ExpandingHandle, SvTreeListBox*, pTable, bool ) { ScChangeTrack* pChanges=pDoc->GetChangeTrack(); SetPointer(Pointer(PointerStyle::Wait)); - if(pTable!=NULL && pChanges!=NULL) + if(pTable!=nullptr && pChanges!=nullptr) { ScChangeActionMap aActionMap; SvTreeListEntry* pEntry=pTheView->GetHdlEntry(); - if(pEntry!=NULL) + if(pEntry!=nullptr) { - ScChangeAction* pScChangeAction=NULL; + ScChangeAction* pScChangeAction=nullptr; ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) pScChangeAction=static_cast<ScChangeAction*>(pEntryData->pData); if(pEntry->HasChildrenOnDemand()) @@ -1360,7 +1360,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ExpandingHandle, SvTreeListBox*, pTable, bool ) if (pChildEntry) pTheView->RemoveEntry(pChildEntry); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) { pScChangeAction=static_cast<ScChangeAction*>(pEntryData->pData); @@ -1393,7 +1393,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ExpandingHandle, SvTreeListBox*, pTable, bool ) { bTheTestFlag=InsertAcceptedORejected(pEntry); } - if(bTheTestFlag) pTheView->InsertEntry(aStrNoEntry,NULL,Color(COL_GRAY),pEntry); + if(bTheTestFlag) pTheView->InsertEntry(aStrNoEntry,nullptr,Color(COL_GRAY),pEntry); } } @@ -1405,9 +1405,9 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ExpandingHandle, SvTreeListBox*, pTable, bool ) void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartAction, sal_uLong nEndAction, sal_uLong /* nPos */) { - if(pChanges!=NULL) + if(pChanges!=nullptr) { - SvTreeListEntry* pParent=NULL; + SvTreeListEntry* pParent=nullptr; bAcceptEnableFlag=true; bRejectEnableFlag=true; SetPointer(Pointer(PointerStyle::Wait)); @@ -1423,7 +1423,7 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio for(sal_uLong i=nStartAction;i<=nEndAction;i++) { const ScChangeAction* pScChangeAction=pChanges->GetAction(i); - if(pScChangeAction==NULL) continue; + if(pScChangeAction==nullptr) continue; switch(pScChangeAction->GetState()) { @@ -1437,23 +1437,23 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio pParent=InsertFilteredAction(pScChangeAction,SC_CAS_VIRGIN); } else - pParent=NULL; + pParent=nullptr; bTheFlag=true; break; case SC_CAS_ACCEPTED: - pParent=NULL; + pParent=nullptr; nAcceptCount++; break; case SC_CAS_REJECTED: - pParent=NULL; + pParent=nullptr; nRejectCount++; break; } - if(pParent!=NULL && pScChangeAction->IsDialogParent()) + if(pParent!=nullptr && pScChangeAction->IsDialogParent()) { if(!bFilterFlag) pParent->EnableChildrenOnDemand(); @@ -1487,13 +1487,13 @@ void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction) SvTreeListEntry* pEntry=pTheView->GetCurEntry(); - ScRedlinData *pEntryData=NULL; + ScRedlinData *pEntryData=nullptr; - if(pEntry!=NULL) + if(pEntry!=nullptr) pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); sal_uLong nAction=0; - if(pEntryData!=NULL) + if(pEntryData!=nullptr) nAction=pEntryData->nActionNo; if(nAction>=nStartAction && nAction<=nEndAction) @@ -1502,11 +1502,11 @@ void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction) // MUST do it backwards, don't delete parents before children and GPF pEntry=pTheView->Last(); - while(pEntry!=NULL) + while(pEntry!=nullptr) { bool bRemove = false; pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) { nAction=pEntryData->nActionNo; @@ -1532,13 +1532,13 @@ void ScAcceptChgDlg::UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartActi SvTreeListEntry* pEntry=pTheView->First(); - SvTreeListEntry* pNextEntry = (pEntry ? SvTreeListBox::NextSibling(pEntry) : NULL); - SvTreeListEntry* pLastEntry=NULL; - while(pEntry!=NULL) + SvTreeListEntry* pNextEntry = (pEntry ? SvTreeListBox::NextSibling(pEntry) : nullptr); + SvTreeListEntry* pLastEntry=nullptr; + while(pEntry!=nullptr) { bool bRemove = false; ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) { ScChangeAction* pScChangeAction= static_cast<ScChangeAction*>(pEntryData->pData); @@ -1553,19 +1553,19 @@ void ScAcceptChgDlg::UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartActi nPos=pEntry->GetChildListPos(); pTheView->RemoveEntry(pEntry); - if(pLastEntry==NULL) pLastEntry=pTheView->First(); - if(pLastEntry!=NULL) + if(pLastEntry==nullptr) pLastEntry=pTheView->First(); + if(pLastEntry!=nullptr) { pNextEntry=pTheView->Next(pLastEntry); - if(pNextEntry==NULL) + if(pNextEntry==nullptr) { pNextEntry=pLastEntry; - pLastEntry=NULL; + pLastEntry=nullptr; } } else - pNextEntry=NULL; + pNextEntry=nullptr; } else @@ -1627,7 +1627,7 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, ReOpenTimerHdl, Idle *, void) { ScSimpleRefDlgWrapper::SetAutoReOpen(true); m_pAcceptChgCtr->ShowFilterPage(); - RefHandle(NULL); + RefHandle(nullptr); } IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, UpdateSelectionHdl, Idle *, void) @@ -1690,7 +1690,7 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void) aPopup.SetMenuFlags(MenuFlags::HideDisabledEntries); SvTreeListEntry* pEntry=pTheView->GetCurEntry(); - if(pEntry!=NULL) + if(pEntry!=nullptr) { pTheView->Select(pEntry); } @@ -1715,14 +1715,14 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void) aPopup.EnableItem(SC_CHANGES_COMMENT,false); - if(pDoc->IsDocEditable() && pEntry!=NULL) + if(pDoc->IsDocEditable() && pEntry!=nullptr) { ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) { ScChangeAction* pScChangeAction= static_cast<ScChangeAction*>(pEntryData->pData); - if(pScChangeAction!=NULL && !pTheView->GetParent(pEntry)) + if(pScChangeAction!=nullptr && !pTheView->GetParent(pEntry)) aPopup.EnableItem(SC_CHANGES_COMMENT); } } @@ -1733,10 +1733,10 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void) { if(nCommand==SC_CHANGES_COMMENT) { - if(pEntry!=NULL) + if(pEntry!=nullptr) { ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); - if(pEntryData!=NULL) + if(pEntryData!=nullptr) { ScChangeAction* pScChangeAction= static_cast<ScChangeAction*>(pEntryData->pData); @@ -1767,7 +1767,7 @@ IMPL_LINK_NOARG_TYPED(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void) void ScAcceptChgDlg::Initialize(SfxChildWinInfo *pInfo) { OUString aStr; - if(pInfo!=NULL) + if(pInfo!=nullptr) { if ( !pInfo->aExtraString.isEmpty() ) { @@ -1867,7 +1867,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ColCompareHdl, const SvSortData*, pSortData, sa RedlinData *pLeftData=static_cast<RedlinData *>(pLeft->GetUserData()); RedlinData *pRightData=static_cast<RedlinData *>(pRight->GetUserData()); - if(pLeftData!=NULL && pRightData!=NULL) + if(pLeftData!=nullptr && pRightData!=nullptr) { if(pLeftData->aDateTime < pRightData->aDateTime) nCompare = -1; @@ -1881,7 +1881,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ColCompareHdl, const SvSortData*, pSortData, sa ScRedlinData *pLeftData=static_cast<ScRedlinData *>(pLeft->GetUserData()); ScRedlinData *pRightData=static_cast<ScRedlinData *>(pRight->GetUserData()); - if(pLeftData!=NULL && pRightData!=NULL) + if(pLeftData!=nullptr && pRightData!=nullptr) { nCompare = 1; @@ -1907,7 +1907,7 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ColCompareHdl, const SvSortData*, pSortData, sa SvLBoxItem* pLeftItem = pTheView->GetEntryAtPos( pLeft, static_cast<sal_uInt16>(nSortCol)); SvLBoxItem* pRightItem = pTheView->GetEntryAtPos( pRight, static_cast<sal_uInt16>(nSortCol)); - if(pLeftItem != NULL && pRightItem != NULL) + if(pLeftItem != nullptr && pRightItem != nullptr) { sal_uInt16 nLeftKind = pLeftItem->GetType(); sal_uInt16 nRightKind = pRightItem->GetType(); diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index dfce667e6912..690095acce51 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -46,14 +46,14 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings) : m_pDlg(_pDlg) - , pRefEdit (NULL) - , pRefBtn (NULL) - , m_pWindow(NULL) + , pRefEdit (nullptr) + , pRefBtn (nullptr) + , m_pWindow(nullptr) , m_pBindings(_pBindings) , m_nOldBorderWidth (0) , nRefTab(0) , mnOldEditWidthReq( -1 ) - , mpOldEditParent( NULL ) + , mpOldEditParent( nullptr ) , mbOldDlgLayoutEnabled( false ) , mbOldEditParentLayoutEnabled( false ) , bHighlightRef( false ) @@ -103,7 +103,7 @@ void ScFormulaReferenceHelper::enableInput( bool bEnable ) { SfxViewShell* p = pFrame->GetViewShell(); ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); - if(pViewSh!=NULL) + if(pViewSh!=nullptr) { vcl::Window *pWin=pViewSh->GetWindow(); if(pWin) @@ -211,7 +211,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference(const OUString& rStr) sal_uInt16 nIndex=0; - while(pToken!=NULL) + while(pToken!=nullptr) { bool bDoubleRef=(pToken->GetType()==formula::svDoubleRef); @@ -248,7 +248,7 @@ void ScFormulaReferenceHelper::HideReference( bool bDoneRefMode ) { ScTabViewShell* pTabViewShell=pViewData->GetViewShell(); - if(pTabViewShell!=NULL) + if(pTabViewShell!=nullptr) { // bDoneRefMode is sal_False when called from before SetReference. // In that case, RefMode was just started and must not be ended now. @@ -416,8 +416,8 @@ void ScFormulaReferenceHelper::RefInputDone( bool bForced ) pResizeDialog->setOptimalLayoutSize(); } - pRefEdit = NULL; - pRefBtn = NULL; + pRefEdit = nullptr; + pRefBtn = nullptr; } } @@ -492,7 +492,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: } } - Dialog* pResizeDialog = NULL; + Dialog* pResizeDialog = nullptr; if (!mbOldDlgLayoutEnabled) { @@ -633,7 +633,7 @@ bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId ) } // find parent view frame to close dialog - SfxViewFrame* pMyViewFrm = NULL; + SfxViewFrame* pMyViewFrm = nullptr; if ( m_pBindings ) { SfxDispatcher* pMyDisp = m_pBindings->GetDispatcher(); @@ -693,7 +693,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren) { SfxViewShell* p = pFrame->GetViewShell(); ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); - if(pViewSh!=NULL) + if(pViewSh!=nullptr) { vcl::Window *pWin=pViewSh->GetWindow(); if(pWin) @@ -728,7 +728,7 @@ static void lcl_InvalidateWindows() { SfxViewShell* p = pFrame->GetViewShell(); ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); - if(pViewSh!=NULL) + if(pViewSh!=nullptr) { vcl::Window *pWin=pViewSh->GetWindow(); if(pWin) @@ -764,7 +764,7 @@ ScRefHandler::ScRefHandler( vcl::Window &rWindow, SfxBindings* pB, bool bBindRef m_bInRefMode( false ), m_aHelper(this,pB), pMyBindings( pB ), - pActiveWin(NULL) + pActiveWin(nullptr) { m_aHelper.SetWindow(m_rWindow.get()); reverseUniqueHelpIdHack(*m_rWindow.get()); @@ -780,12 +780,12 @@ bool ScRefHandler::EnterRefMode() SC_MOD()->InputEnterHandler(); - ScTabViewShell* pScViewShell = NULL; + ScTabViewShell* pScViewShell = nullptr; // title has to be from the view that opened the dialog, // even if it's not the current view - SfxObjectShell* pParentDoc = NULL; + SfxObjectShell* pParentDoc = nullptr; if ( pMyBindings ) { SfxDispatcher* pMyDisp = pMyBindings->GetDispatcher(); @@ -811,7 +811,7 @@ bool ScRefHandler::EnterRefMode() OSL_ENSURE( pInputHdl, "Missing input handler :-/" ); if ( pInputHdl ) - pInputHdl->NotifyChange( NULL ); + pInputHdl->NotifyChange( nullptr ); ScFormulaReferenceHelper::enableInput( false ); diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index 18543180f249..8dd2cc9e2767 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -57,7 +57,7 @@ ScAutoFmtPreview::ScAutoFmtPreview(vcl::Window* pParent) : Window(pParent) - , pCurData(NULL) + , pCurData(nullptr) , aVD(*this) , bFitWidth(false) , mbRTL(false) @@ -196,7 +196,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo bool bNumFormat = pCurData->GetIncludeValueFormat(); sal_uLong nNum; double nVal; - Color* pDummy = NULL; + Color* pDummy = nullptr; sal_uInt16 nIndex = static_cast<sal_uInt16>(maArray.GetCellIndex(nCol, nRow, mbRTL)); switch (nIndex) diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index ae00e39adb4c..2d828dbeef9f 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -83,7 +83,7 @@ ScConflictsListEntry* ScConflictsListHelper::GetSharedActionEntry( ScConflictsLi } } - return NULL; + return nullptr; } ScConflictsListEntry* ScConflictsListHelper::GetOwnActionEntry( ScConflictsList& rConflictsList, sal_uLong nOwnAction ) @@ -97,7 +97,7 @@ ScConflictsListEntry* ScConflictsListHelper::GetOwnActionEntry( ScConflictsList& } } - return NULL; + return nullptr; } void ScConflictsListHelper::Transform_Impl( ScChangeActionList& rActionList, ScChangeActionMergeMap* pMergeMap ) @@ -191,7 +191,7 @@ ScConflictsListEntry* ScConflictsFinder::GetIntersectingEntry( const ScChangeAct } } - return NULL; + return nullptr; } ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, const ScChangeActionList& rOwnActions ) @@ -380,10 +380,10 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD ,maStrTitleDate ( ScResId( STR_TITLE_DATE ) ) ,maStrUnknownUser ( ScResId( STR_UNKNOWN_USER_CONFLICT ) ) ,mpViewData ( pViewData ) - ,mpOwnDoc ( NULL ) - ,mpOwnTrack ( NULL ) + ,mpOwnDoc ( nullptr ) + ,mpOwnTrack ( nullptr ) ,mpSharedDoc ( pSharedDoc ) - ,mpSharedTrack ( NULL ) + ,mpSharedTrack ( nullptr ) ,mrConflictsList ( rConflictsList ) ,maDialogSize ( GetSizePixel() ) ,mbInSelectHdl ( false ) @@ -395,12 +395,12 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD get(m_pBtnKeepAllOthers, "keepallothers"); OSL_ENSURE( mpViewData, "ScConflictsDlg CTOR: mpViewData is null!" ); - mpOwnDoc = ( mpViewData ? mpViewData->GetDocument() : NULL ); + mpOwnDoc = ( mpViewData ? mpViewData->GetDocument() : nullptr ); OSL_ENSURE( mpOwnDoc, "ScConflictsDlg CTOR: mpOwnDoc is null!" ); - mpOwnTrack = ( mpOwnDoc ? mpOwnDoc->GetChangeTrack() : NULL ); + mpOwnTrack = ( mpOwnDoc ? mpOwnDoc->GetChangeTrack() : nullptr ); OSL_ENSURE( mpOwnTrack, "ScConflictsDlg CTOR: mpOwnTrack is null!" ); OSL_ENSURE( mpSharedDoc, "ScConflictsDlg CTOR: mpSharedDoc is null!" ); - mpSharedTrack = ( mpSharedDoc ? mpSharedDoc->GetChangeTrack() : NULL ); + mpSharedTrack = ( mpSharedDoc ? mpSharedDoc->GetChangeTrack() : nullptr ); OSL_ENSURE( mpSharedTrack, "ScConflictsDlg CTOR: mpSharedTrack is null!" ); SetMinOutputSizePixel( maDialogSize ); @@ -434,7 +434,7 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD UpdateView(); SvTreeListEntry* pEntry = m_pLbConflicts->First(); - if ( pEntry != NULL ) + if ( pEntry != nullptr ) { m_pLbConflicts->Select( pEntry ); } @@ -600,8 +600,8 @@ IMPL_LINK_NOARG_TYPED(ScConflictsDlg, UpdateSelectionHdl, Idle *, void) void ScConflictsDlg::SetConflictAction( SvTreeListEntry* pRootEntry, ScConflictAction eConflictAction ) { - RedlinData* pUserData = static_cast< RedlinData* >( pRootEntry ? pRootEntry->GetUserData() : NULL ); - ScConflictsListEntry* pConflictEntry = static_cast< ScConflictsListEntry* >( pUserData ? pUserData->pData : NULL ); + RedlinData* pUserData = static_cast< RedlinData* >( pRootEntry ? pRootEntry->GetUserData() : nullptr ); + ScConflictsListEntry* pConflictEntry = static_cast< ScConflictsListEntry* >( pUserData ? pUserData->pData : nullptr ); if ( pConflictEntry ) { pConflictEntry->meConflictAction = eConflictAction; @@ -611,7 +611,7 @@ void ScConflictsDlg::SetConflictAction( SvTreeListEntry* pRootEntry, ScConflictA void ScConflictsDlg::KeepHandler( bool bMine ) { SvTreeListEntry* pEntry = m_pLbConflicts->FirstSelected(); - SvTreeListEntry* pRootEntry = ( pEntry ? m_pLbConflicts->GetRootLevelParent( pEntry ) : NULL ); + SvTreeListEntry* pRootEntry = ( pEntry ? m_pLbConflicts->GetRootLevelParent( pEntry ) : nullptr ); if ( !pRootEntry ) { return; @@ -630,7 +630,7 @@ void ScConflictsDlg::KeepHandler( bool bMine ) void ScConflictsDlg::KeepAllHandler( bool bMine ) { SvTreeListEntry* pEntry = m_pLbConflicts->First(); - SvTreeListEntry* pRootEntry = ( pEntry ? m_pLbConflicts->GetRootLevelParent( pEntry ) : NULL ); + SvTreeListEntry* pRootEntry = ( pEntry ? m_pLbConflicts->GetRootLevelParent( pEntry ) : nullptr ); if ( !pRootEntry ) { return; @@ -684,7 +684,7 @@ void ScConflictsDlg::UpdateView() ScChangeActionList::const_iterator aEndShared = aItr->maSharedActions.end(); for ( ScChangeActionList::const_iterator aItrShared = aItr->maSharedActions.begin(); aItrShared != aEndShared; ++aItrShared ) { - ScChangeAction* pAction = mpSharedTrack ? mpSharedTrack->GetAction(*aItrShared) : NULL; + ScChangeAction* pAction = mpSharedTrack ? mpSharedTrack->GetAction(*aItrShared) : nullptr; if ( pAction ) { // only display shared top content entries @@ -698,14 +698,14 @@ void ScConflictsDlg::UpdateView() } OUString aString( GetActionString( pAction, mpSharedDoc ) ); - m_pLbConflicts->InsertEntry( aString, static_cast< RedlinData* >( NULL ), pRootEntry ); + m_pLbConflicts->InsertEntry( aString, static_cast< RedlinData* >( nullptr ), pRootEntry ); } } ScChangeActionList::const_iterator aEndOwn = aItr->maOwnActions.end(); for ( ScChangeActionList::const_iterator aItrOwn = aItr->maOwnActions.begin(); aItrOwn != aEndOwn; ++aItrOwn ) { - ScChangeAction* pAction = mpOwnTrack ? mpOwnTrack->GetAction(*aItrOwn) : NULL; + ScChangeAction* pAction = mpOwnTrack ? mpOwnTrack->GetAction(*aItrOwn) : nullptr; if ( pAction ) { // only display own top content entries diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index 9fde83cf8d42..fed1d44a0feb 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -46,7 +46,7 @@ ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB, pViewData ( ptrViewData ), pDoc ( ptrViewData->GetDocument() ), - pEdActive ( NULL ), + pEdActive ( nullptr ), bDlgLostFocus ( false ) { get(pLbRange,"range"); @@ -458,11 +458,11 @@ void ScColRowNameRangesDlg::UpdateNames() void ScColRowNameRangesDlg::UpdateRangeData( const ScRange& rRange, bool bColName ) { - ScRangePair* pPair = NULL; + ScRangePair* pPair = nullptr; bool bFound = false; - if ( bColName && (pPair = xColNameRanges->Find( rRange )) != NULL ) + if ( bColName && (pPair = xColNameRanges->Find( rRange )) != nullptr ) bFound = true; - else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != NULL ) + else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != nullptr ) bFound = true; if ( bFound ) @@ -501,7 +501,7 @@ bool ScColRowNameRangesDlg::IsRefInputMode() const // passing the range lists to the document IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, OkBtnHdl, Button*, void) { - AddBtnHdl( 0 ); + AddBtnHdl( nullptr ); // assign RangeLists to the den references in the document pDoc->GetColNameRangesRef() = xColNameRanges; @@ -537,12 +537,12 @@ IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, AddBtnHdl, Button*, void) theCurArea = aRange1; AdjustColRowData( aRange2 ); ScRangePair* pPair; - if ( ( pPair = xColNameRanges->Find( theCurArea ) ) != NULL ) + if ( ( pPair = xColNameRanges->Find( theCurArea ) ) != nullptr ) { xColNameRanges->Remove( pPair ); delete pPair; } - if ( ( pPair = xRowNameRanges->Find( theCurArea ) ) != NULL ) + if ( ( pPair = xRowNameRanges->Find( theCurArea ) ) != nullptr ) { xRowNameRanges->Remove( pPair ); delete pPair; @@ -587,11 +587,11 @@ IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, RemoveBtnHdl, Button*, void) return; const ScRange& rRange = itr->second; - ScRangePair* pPair = NULL; + ScRangePair* pPair = nullptr; bool bFound = false; - if ( bColName && (pPair = xColNameRanges->Find( rRange )) != NULL ) + if ( bColName && (pPair = xColNameRanges->Find( rRange )) != nullptr ) bFound = true; - else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != NULL ) + else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != nullptr ) bFound = true; if ( bFound ) { @@ -805,7 +805,7 @@ IMPL_LINK_TYPED( ScColRowNameRangesDlg, GetFocusHdl, Control&, rCtrl, void ) else if( (&rCtrl == static_cast<Control*>(pEdAssign2)) || (&rCtrl == static_cast<Control*>(pRbAssign2)) ) pEdActive = pEdAssign2; else - pEdActive = NULL; + pEdActive = nullptr; if( pEdActive ) pEdActive->SetSelection( Selection( 0, SELECTION_MAX ) ); diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index 86923ab3ce32..64dd5de5e165 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -173,8 +173,8 @@ ScDataFormDlg::ScDataFormDlg(vcl::Window* pParent, ScTabViewShell* pTabViewShell } else { - maFixedTexts.push_back( NULL ); - maEdits.push_back( NULL ); + maFixedTexts.push_back( nullptr ); + maEdits.push_back( nullptr ); } if (maEdits[nIndex] != nullptr) maEdits[nIndex]->SetModifyHdl( HDL(Impl_DataModifyHdl) ); diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx index a254a0ee8aa8..c2da83919bc2 100644 --- a/sc/source/ui/miscdlgs/filldlg.cxx +++ b/sc/source/ui/miscdlgs/filldlg.cxx @@ -304,7 +304,7 @@ IMPL_LINK_NOARG_TYPED(ScFillSeriesDlg, OKHdl, Button*, void) else if ( m_pBtnYear->IsChecked() ) theFillDateCmd = FILL_YEAR; bool bAllOk = true; - Edit* pEdWrong = NULL; + Edit* pEdWrong = nullptr; if ( !CheckStartVal() ) { bAllOk = false; diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index 38425944bf5c..020066d7c99f 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -92,7 +92,7 @@ void ScHighlightChgDlg::Init() OSL_ENSURE( pViewData && pDoc, "ViewData oder Document nicht gefunden!" ); ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pChanges!=NULL) + if(pChanges!=nullptr) { aChangeViewSet.SetTheAuthorToShow(pChanges->GetUser()); m_pFilterCtr->ClearAuthors(); @@ -104,7 +104,7 @@ void ScHighlightChgDlg::Init() ScChangeViewSettings* pViewSettings=pDoc->GetChangeViewSettings(); - if(pViewSettings!=NULL) + if(pViewSettings!=nullptr) aChangeViewSet=*pViewSettings; m_pHighlightBox->Check(aChangeViewSet.ShowChanges()); m_pFilterCtr->CheckDate(aChangeViewSet.HasDate()); @@ -185,7 +185,7 @@ bool ScHighlightChgDlg::IsRefInputMode() const IMPL_LINK_TYPED( ScHighlightChgDlg, HighlightHandle, Button*, pCb, void ) { - if(pCb!=NULL) + if(pCb!=nullptr) { if(m_pHighlightBox->IsChecked()) { @@ -204,7 +204,7 @@ IMPL_LINK_TYPED( ScHighlightChgDlg, HighlightHandle, Button*, pCb, void ) IMPL_LINK_TYPED( ScHighlightChgDlg, RefHandle, SvxTPFilter*, pRef, void ) { - if(pRef!=NULL) + if(pRef!=nullptr) { SetDispatcherLock( true ); m_pEdAssign->Show(); diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 410b27a8a538..a84d893b3b98 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -38,8 +38,8 @@ ScInsertTableDlg::ScInsertTableDlg( vcl::Window* pParent, ScViewData& rData, SCT : ModalDialog(pParent, "InsertSheetDialog", "modules/scalc/ui/insertsheet.ui") , rViewData(rData) , rDoc(*rData.GetDocument()) - , pDocShTables(NULL) - , pDocInserter(NULL) + , pDocShTables(nullptr) + , pDocInserter(nullptr) , bMustClose(false) , nSelTabIndex(0) , nTableCount(nTabCount) @@ -209,7 +209,7 @@ void ScInsertTableDlg::FillTables_Impl( ScDocument* pSrcDoc ) const OUString* ScInsertTableDlg::GetFirstTable( sal_uInt16* pN ) { - const OUString* pStr = NULL; + const OUString* pStr = nullptr; if ( m_pBtnNew->IsChecked() ) { @@ -230,7 +230,7 @@ const OUString* ScInsertTableDlg::GetFirstTable( sal_uInt16* pN ) const OUString* ScInsertTableDlg::GetNextTable( sal_uInt16* pN ) { - const OUString* pStr = NULL; + const OUString* pStr = nullptr; if ( !m_pBtnNew->IsChecked() && nSelTabIndex < m_pLbTables->GetSelectEntryCount() ) { @@ -353,9 +353,9 @@ IMPL_LINK_TYPED( ScInsertTableDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pF { pDocShTables->DoClose(); aDocShTablesRef.Clear(); - pDocShTables = NULL; + pDocShTables = nullptr; - FillTables_Impl( NULL ); + FillTables_Impl( nullptr ); m_pFtPath->SetText( EMPTY_OUSTRING ); } } diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 7baacc499b47..98b1958f8e1c 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -39,8 +39,8 @@ ScLinkedAreaDlg::ScLinkedAreaDlg(vcl::Window* pParent) : ModalDialog(pParent, "ExternalDataDialog", "modules/scalc/ui/externaldata.ui") - , pSourceShell(NULL) - , pDocInserter(NULL) + , pSourceShell(nullptr) + , pDocInserter(nullptr) { get(m_pCbUrl, "url"); @@ -139,7 +139,7 @@ void ScLinkedAreaDlg::LoadDocument( const OUString& rFile, const OUString& rFilt { // unload old document pSourceShell->DoClose(); - pSourceShell = NULL; + pSourceShell = nullptr; aSourceRef.Clear(); } @@ -252,7 +252,7 @@ IMPL_LINK_TYPED( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFi else { pSourceShell->DoClose(); - pSourceShell = NULL; + pSourceShell = nullptr; aSourceRef.Clear(); m_pCbUrl->SetText( EMPTY_OUSTRING ); diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index 4d25cdad020a..210830fa7188 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -217,7 +217,7 @@ void ScMoveTableDlg::Init() void ScMoveTableDlg::InitDocListBox() { SfxObjectShell* pSh = SfxObjectShell::GetFirst(); - ScDocShell* pScSh = NULL; + ScDocShell* pScSh = nullptr; sal_uInt16 nSelPos = 0; sal_uInt16 i = 0; OUString aEntryName; diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index cd18e0a1911b..76eac3a7538b 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -186,7 +186,7 @@ ScOptSolverDlg::ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Windo , mpDocShell(pDocSh) , mrDoc(pDocSh->GetDocument()) , mnCurTab(aCursorPos.Tab()) - , mpEdActive(NULL) + , mpEdActive(nullptr) , mbDlgLostFocus(false) , nScrollPos(0) { @@ -453,7 +453,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos) m_pRbMax->Check(); OUString aCursorStr; if ( !mrDoc.GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) ) - aCursorStr = rCursorPos.Format(SCA_ABS, NULL, mrDoc.GetAddressConvention()); + aCursorStr = rCursorPos.Format(SCA_ABS, nullptr, mrDoc.GetAddressConvention()); m_pEdObjectiveCell->SetRefString( aCursorStr ); if ( nImplCount > 0 ) maEngine = maImplNames[0]; // use first implementation @@ -643,8 +643,8 @@ IMPL_LINK_TYPED( ScOptSolverDlg, BtnHdl, Button*, pBtn, void ) IMPL_LINK_TYPED( ScOptSolverDlg, GetFocusHdl, Control&, rCtrl, void ) { - Edit* pEdit = NULL; - mpEdActive = NULL; + Edit* pEdit = nullptr; + mpEdActive = nullptr; if( &rCtrl == m_pEdObjectiveCell || &rCtrl == m_pRBObjectiveCell ) pEdit = mpEdActive = m_pEdObjectiveCell; @@ -745,7 +745,7 @@ IMPL_LINK_TYPED( ScOptSolverDlg, CursorUpHdl, ScCursorRefEdit&, rEdit, void ) } else { - formula::RefEdit* pFocus = NULL; + formula::RefEdit* pFocus = nullptr; for ( sal_uInt16 nRow = 1; nRow < EDIT_ROW_COUNT; ++nRow ) // second row or below: move focus { if ( &rEdit == mpLeftEdit[nRow] ) @@ -774,7 +774,7 @@ IMPL_LINK_TYPED( ScOptSolverDlg, CursorDownHdl, ScCursorRefEdit&, rEdit, void ) } else { - formula::RefEdit* pFocus = NULL; + formula::RefEdit* pFocus = nullptr; for ( sal_uInt16 nRow = 0; nRow+1 < EDIT_ROW_COUNT; ++nRow ) // before last row: move focus { if ( &rEdit == mpLeftEdit[nRow] ) @@ -908,7 +908,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal ScRange aLeftRange; if ( !ParseRef( aLeftRange, aConstrIter->aLeftStr, true ) ) { - ShowError( true, NULL ); + ShowError( true, nullptr ); return false; } @@ -924,7 +924,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal bIsRange = true; // same size as "left" range, resolve into single cells else { - ShowError( true, NULL ); + ShowError( true, nullptr ); return false; } } @@ -937,7 +937,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal else if ( aConstraint.Operator != sheet::SolverConstraintOperator_INTEGER && aConstraint.Operator != sheet::SolverConstraintOperator_BINARY ) { - ShowError( true, NULL ); + ShowError( true, nullptr ); return false; } } diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx index d8bd6b757d3f..8d38287f303e 100644 --- a/sc/source/ui/miscdlgs/redcom.cxx +++ b/sc/source/ui/miscdlgs/redcom.cxx @@ -28,9 +28,9 @@ ScRedComDialog::ScRedComDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet, ScDocShell *pShell, ScChangeAction *pAction, bool bPrevNext) - : pChangeAction(NULL) - , pDocShell(NULL) - , pDlg(NULL) + : pChangeAction(nullptr) + , pDocShell(nullptr) + , pDlg(nullptr) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) @@ -55,14 +55,14 @@ ScRedComDialog::~ScRedComDialog() ScChangeAction *ScRedComDialog::FindPrev(ScChangeAction *pAction) { - if(pAction!=NULL && pDocShell !=NULL) + if(pAction!=nullptr && pDocShell !=nullptr) { ScDocument& rDoc = pDocShell->GetDocument(); ScChangeViewSettings* pSettings = rDoc.GetChangeViewSettings(); pAction=pAction->GetPrev(); - while(pAction!=NULL) + while(pAction!=nullptr) { if( pAction->GetState()==SC_CAS_VIRGIN && pAction->IsDialogRoot() && @@ -76,14 +76,14 @@ ScChangeAction *ScRedComDialog::FindPrev(ScChangeAction *pAction) ScChangeAction *ScRedComDialog::FindNext(ScChangeAction *pAction) { - if(pAction!=NULL && pDocShell !=NULL) + if(pAction!=nullptr && pDocShell !=nullptr) { ScDocument& rDoc = pDocShell->GetDocument(); ScChangeViewSettings* pSettings = rDoc.GetChangeViewSettings(); pAction=pAction->GetNext(); - while(pAction!=NULL) + while(pAction!=nullptr) { if( pAction->GetState()==SC_CAS_VIRGIN && pAction->IsDialogRoot() && @@ -98,15 +98,15 @@ ScChangeAction *ScRedComDialog::FindNext(ScChangeAction *pAction) void ScRedComDialog::ReInit(ScChangeAction *pAction) { pChangeAction=pAction; - if(pChangeAction!=NULL && pDocShell !=NULL) + if(pChangeAction!=nullptr && pDocShell !=nullptr) { OUString aTitle; pChangeAction->GetDescription( aTitle, &pDocShell->GetDocument()); pDlg->SetText(aTitle); aComment=pChangeAction->GetComment(); - bool bNext=FindNext(pChangeAction)!=NULL; - bool bPrev=FindPrev(pChangeAction)!=NULL; + bool bNext=FindNext(pChangeAction)!=nullptr; + bool bPrev=FindPrev(pChangeAction)!=nullptr; pDlg->EnableTravel(bNext,bPrev); OUString aAuthor = pChangeAction->GetUser(); @@ -127,7 +127,7 @@ short ScRedComDialog::Execute() if(nRet== RET_OK ) { - if ( pDocShell!=NULL && pDlg->GetNote() != aComment ) + if ( pDocShell!=nullptr && pDlg->GetNote() != aComment ) pDocShell->SetChangeComment( pChangeAction, pDlg->GetNote()); } @@ -136,7 +136,7 @@ short ScRedComDialog::Execute() void ScRedComDialog::SelectCell() { - if(pChangeAction!=NULL) + if(pChangeAction!=nullptr) { const ScChangeAction* pAction=pChangeAction; const ScBigRange& rRange = pAction->GetBigRange(); @@ -153,7 +153,7 @@ void ScRedComDialog::SelectCell() IMPL_LINK_TYPED(ScRedComDialog, PrevHdl, AbstractSvxPostItDialog&, rDlgP, void ) { - if (pDocShell!=NULL && rDlgP.GetNote() != aComment ) + if (pDocShell!=nullptr && rDlgP.GetNote() != aComment ) pDocShell->SetChangeComment( pChangeAction, rDlgP.GetNote()); ReInit(FindPrev(pChangeAction)); @@ -162,7 +162,7 @@ IMPL_LINK_TYPED(ScRedComDialog, PrevHdl, AbstractSvxPostItDialog&, rDlgP, void ) IMPL_LINK_TYPED(ScRedComDialog, NextHdl, AbstractSvxPostItDialog&, rDlgP, void ) { - if ( pDocShell!=NULL && rDlgP.GetNote() != aComment ) + if ( pDocShell!=nullptr && rDlgP.GetNote() != aComment ) pDocShell->SetChangeComment( pChangeAction, rDlgP.GetNote()); ReInit(FindNext(pChangeAction)); diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index 080e8c4eeed1..e7ccc2d025b0 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -34,7 +34,7 @@ ScRetypePassDlg::ScRetypePassDlg(vcl::Window* pParent) : maTextHashGood(ScResId(STR_HASH_GOOD)), maTextHashRegen(ScResId(STR_HASH_REGENERATED)), - mpDocItem(static_cast<ScDocProtection*>(NULL)), + mpDocItem(static_cast<ScDocProtection*>(nullptr)), mnCurScrollPos(0), meDesiredHash(PASSHASH_SHA1) { @@ -270,7 +270,7 @@ IMPL_LINK_NOARG_TYPED(ScRetypePassDlg, OKHdl, Button*, void) IMPL_LINK_TYPED( ScRetypePassDlg, RetypeBtnHdl, Button*, pBtn, void ) { - ScPassHashProtectable* pProtected = NULL; + ScPassHashProtectable* pProtected = nullptr; if (pBtn == mpBtnRetypeDoc) { // document protection. @@ -283,7 +283,7 @@ IMPL_LINK_TYPED( ScRetypePassDlg, RetypeBtnHdl, Button*, pBtn, void ) while(aPos < maSheets.size() && pBtn != maSheets[aPos]->GetChild(2)) ++aPos; - pProtected = aPos < maSheets.size() ? maTableItems[aPos].mpProtect.get() : 0; + pProtected = aPos < maSheets.size() ? maTableItems[aPos].mpProtect.get() : nullptr; } if (!pProtected) diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index c3c54ea560f0..213b93a4cdf4 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -72,10 +72,10 @@ public: ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewData ) : ModalDialog(pParent, "ShareDocumentDialog", "modules/scalc/ui/sharedocumentdlg.ui") , mpViewData(pViewData) - , mpDocShell(NULL) + , mpDocShell(nullptr) { OSL_ENSURE( mpViewData, "ScShareDocumentDlg CTOR: mpViewData is null!" ); - mpDocShell = ( mpViewData ? mpViewData->GetDocShell() : NULL ); + mpDocShell = ( mpViewData ? mpViewData->GetDocShell() : nullptr ); OSL_ENSURE( mpDocShell, "ScShareDocumentDlg CTOR: mpDocShell is null!" ); get(m_pCbShare, "share"); diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx index 50309ea5e219..efb13fba9973 100644 --- a/sc/source/ui/miscdlgs/simpref.cxx +++ b/sc/source/ui/miscdlgs/simpref.cxx @@ -205,7 +205,7 @@ IMPL_LINK_NOARG_TYPED(ScSimpleRefDlg, CancelBtnHdl, Button*, void) { bAutoReOpen=false; OUString aResult=m_pEdAssign->GetText(); - aCloseHdl.Call(NULL); + aCloseHdl.Call(nullptr); Link<const OUString&,void> aUnoLink = aAbortedHdl; // stack var because this is deleted in DoClose DoClose( ScSimpleRefDlgWrapper::GetChildWindowId() ); aUnoLink.Call( aResult ); diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index bd7965b285cf..0b74046f7c81 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -110,7 +110,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( vcl::Window* pParent, const uno::Sequence<beans::PropertyValue>& rProperties ) : ModalDialog(pParent, "SolverOptionsDialog", "modules/scalc/ui/solveroptionsdialog.ui") - , mpCheckButtonData(NULL) + , mpCheckButtonData(nullptr) , maImplNames(rImplNames) , maDescriptions(rDescriptions) , maEngine(rEngine) @@ -251,7 +251,7 @@ void ScSolverOptionsDialog::FillListBox() mpCheckButtonData = new SvLBoxButtonData(m_pLbSettings); SvTreeList* pModel = m_pLbSettings->GetModel(); - SvTreeListEntry* pEntry = NULL; + SvTreeListEntry* pEntry = nullptr; for (sal_Int32 nPos=0; nPos<nCount; nPos++) { diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx index bf775e7233de..28df67176ec7 100644 --- a/sc/source/ui/miscdlgs/solvrdlg.cxx +++ b/sc/source/ui/miscdlgs/solvrdlg.cxx @@ -48,7 +48,7 @@ ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPa , theVariableCell(aCursorPos) , pDoc(pDocument) , nCurTab(aCursorPos.Tab()) - , pEdActive(NULL) + , pEdActive(nullptr) , bDlgLostFocus(false) , errMsgInvalidVar(ScGlobal::GetRscString(STR_INVALIDVAR)) , errMsgInvalidForm(ScGlobal::GetRscString(STR_INVALIDFORM)) @@ -109,7 +109,7 @@ void ScSolverDlg::Init() m_pEdVariableCell->SetLoseFocusHdl ( aLink ); m_pRBVariableCell->SetLoseFocusHdl ( aLink ); - OUString aStr(theFormulaCell.Format(SCA_ABS, NULL, pDoc->GetAddressConvention())); + OUString aStr(theFormulaCell.Format(SCA_ABS, nullptr, pDoc->GetAddressConvention())); m_pEdFormulaCell->SetText( aStr ); m_pEdFormulaCell->GrabFocus(); @@ -257,8 +257,8 @@ IMPL_LINK_TYPED( ScSolverDlg, BtnHdl, Button*, pBtn, void ) IMPL_LINK_TYPED( ScSolverDlg, GetFocusHdl, Control&, rCtrl, void ) { - Edit* pEdit = NULL; - pEdActive = NULL; + Edit* pEdit = nullptr; + pEdActive = nullptr; if( (&rCtrl == static_cast<Control*>(m_pEdFormulaCell)) || (&rCtrl == static_cast<Control*>(m_pRBFormulaCell)) ) pEdit = pEdActive = m_pEdFormulaCell; diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx index 60b1d6d9751d..a8993d851bd1 100644 --- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx +++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx @@ -77,14 +77,14 @@ void ScTabBgColorDlg::GetSelectedColor( Color& rColor ) const void ScTabBgColorDlg::FillColorValueSets_Impl() { SfxObjectShell* pDocSh = SfxObjectShell::Current(); - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; XColorListRef pColorList; sal_uInt16 nSelectedItem = 0; OSL_ENSURE( pDocSh, "DocShell not found!" ); - if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem(SID_COLOR_TABLE) ) ) ) + if ( pDocSh && ( nullptr != ( pItem = pDocSh->GetItem(SID_COLOR_TABLE) ) ) ) pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); if ( !pColorList.is() ) pColorList = XColorList::CreateStdColorList(); @@ -135,7 +135,7 @@ IMPL_LINK_NOARG_TYPED(ScTabBgColorDlg, TabBgColorOKHdl_Impl, Button*, void) ScTabBgColorDlg::ScTabBgColorValueSet::ScTabBgColorValueSet(vcl::Window* pParent, WinBits nStyle) : SvxColorValueSet(pParent, nStyle) - , m_pTabBgColorDlg(NULL) + , m_pTabBgColorDlg(nullptr) { } diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx index 50d46e222422..d48918b5dac5 100644 --- a/sc/source/ui/miscdlgs/tabopdlg.cxx +++ b/sc/source/ui/miscdlgs/tabopdlg.cxx @@ -41,7 +41,7 @@ ScTabOpDlg::ScTabOpDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPare , theFormulaCell(rCursorPos) , pDoc(pDocument) , nCurTab(theFormulaCell.Tab()) - , pEdActive(NULL) + , pEdActive(nullptr) , bDlgLostFocus(false) , errMsgNoFormula(ScResId(STR_NOFORMULASPECIFIED)) , errMsgNoColRow(ScResId(STR_NOCOLROW)) @@ -331,7 +331,7 @@ IMPL_LINK_TYPED( ScTabOpDlg, GetFocusHdl, Control&, rCtrl, void ) else if( (&rCtrl == static_cast<Control*>(m_pEdColCell)) || (&rCtrl == static_cast<Control*>(m_pRBColCell)) ) pEdActive = m_pEdColCell; else - pEdActive = NULL; + pEdActive = nullptr; if( pEdActive ) pEdActive->SetSelection( Selection( 0, SELECTION_MAX ) ); diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index fee5baaba4ba..7c813258f283 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -148,7 +148,7 @@ bool ScNameDefDlg::IsNameValid() OUString aScope = m_pLbScope->GetSelectEntry(); OUString aName = m_pEdName->GetText(); - ScRangeName* pRangeName = NULL; + ScRangeName* pRangeName = nullptr; if(aScope == maGlobalNameStr) { pRangeName = maRangeMap.find(OUString(STR_GLOBAL_RANGE_NAME))->second; @@ -207,7 +207,7 @@ void ScNameDefDlg::AddPushed() return; } - ScRangeName* pRangeName = NULL; + ScRangeName* pRangeName = nullptr; if(aScope == maGlobalNameStr) { pRangeName = maRangeMap.find(OUString(STR_GLOBAL_RANGE_NAME))->second; @@ -244,7 +244,7 @@ void ScNameDefDlg::AddPushed() if ( 0 == pNewEntry->GetErrCode() ) { if ( !pRangeName->insert( pNewEntry ) ) - pNewEntry = NULL; + pNewEntry = nullptr; if (mbUndo) { diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index 655fce68b964..0a557a627586 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -62,7 +62,7 @@ ScRangeManagerTable::ScRangeManagerTable(SvSimpleTableContainer& rParent, ShowTable(); SetSelectionMode(MULTIPLE_SELECTION); SetScrolledHdl( LINK( this, ScRangeManagerTable, ScrollHdl ) ); - HeaderEndDragHdl(NULL); + HeaderEndDragHdl(nullptr); } void ScRangeManagerTable::Resize() @@ -100,7 +100,7 @@ void ScRangeManagerTable::setColWidths() rHeaderBar.SetItemSize( ITEMID_SCOPE, nTabSize); static long aStaticTabs[] = {3, 0, nTabSize, 2*nTabSize }; SetTabs( &aStaticTabs[0], MAP_PIXEL ); - HeaderEndDragHdl(NULL); + HeaderEndDragHdl(nullptr); } ScRangeManagerTable::~ScRangeManagerTable() diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 0247cdffeb39..29535bd4b2f2 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -82,7 +82,7 @@ bool ScContentTree::bIsInDrag = false; ScDocShell* ScContentTree::GetManualOrCurrent() { - ScDocShell* pSh = NULL; + ScDocShell* pSh = nullptr; if ( !aManualDoc.isEmpty() ) { SfxObjectShell* pObjSh = SfxObjectShell::GetFirst( checkSfxObjectShell<ScDocShell> ); @@ -116,7 +116,7 @@ ScContentTree::ScContentTree( vcl::Window* pParent, const ResId& rResId ) : aEntryImages ( ScResId( RID_IMAGELIST_NAVCONT ) ), nRootType ( ScContentId::ROOT ), bHiddenDoc ( false ), - pHiddenDocument ( NULL ), + pHiddenDocument ( nullptr ), bisInNavigatoeDlg ( false ) { sal_uInt16 i; @@ -125,7 +125,7 @@ ScContentTree::ScContentTree( vcl::Window* pParent, const ResId& rResId ) : pParentWindow = static_cast<ScNavigatorDlg*>(pParent); - pRootNodes[ScContentId::ROOT] = NULL; + pRootNodes[ScContentId::ROOT] = nullptr; for (i=1; i<(int)ScContentId::LAST; i++) InitRoot((ScContentId)i); @@ -133,7 +133,7 @@ ScContentTree::ScContentTree( vcl::Window* pParent, const ResId& rResId ) : SetDoubleClickHdl( LINK( this, ScContentTree, ContentDoubleClickHdl ) ); - pTmpEntry= NULL; + pTmpEntry= nullptr; m_bFirstPaint=true; SetStyle( GetStyle() | WB_QUICK_SEARCH ); @@ -163,7 +163,7 @@ OUString ScContentTree::getAltLongDescText( SvTreeListEntry* pEntry, bool isAltT case ScContentId::GRAPHIC: case ScContentId::DRAWING: { - SdrObject* pFound = NULL; + SdrObject* pFound = nullptr; ScDocument* pDoc = ( const_cast< ScContentTree* >(this) )->GetSourceDocument(); SdrIterMode eIter = ( nType == ScContentId::DRAWING ) ? IM_FLAT : IM_DEEPNOGROUPS; ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); @@ -222,7 +222,7 @@ void ScContentTree::InitRoot( ScContentId nType ) if ( nRootType != ScContentId::ROOT && nRootType != nType ) // ausgeblendet ? { - pRootNodes[nType] = NULL; + pRootNodes[nType] = nullptr; return; } @@ -230,7 +230,7 @@ void ScContentTree::InitRoot( ScContentId nType ) OUString aName( ScResId( SCSTR_CONTENT_ROOT + (int)nType ) ); // wieder an die richtige Position: sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1; - SvTreeListEntry* pNew = InsertEntry( aName, rImage, rImage, NULL, false, nPos ); + SvTreeListEntry* pNew = InsertEntry( aName, rImage, rImage, nullptr, false, nPos ); pRootNodes[nType] = pNew; } @@ -454,7 +454,7 @@ void ScContentTree::KeyInput( const KeyEvent& rKEvt ) Expand( pEntry ); } else - ContentDoubleClickHdl(0); // select content as if double clicked + ContentDoubleClickHdl(nullptr); // select content as if double clicked } bUsed = true; @@ -488,18 +488,18 @@ void ScContentTree::KeyInput( const KeyEvent& rKEvt ) { vcl::Window* pWindow=reinterpret_cast<vcl::Window*>(GetParent(pEntry)); ScNavigatorDlg* pScNavigatorDlg = static_cast<ScNavigatorDlg*>(pWindow); - ScTabViewShell* pScTabViewShell = NULL; - ScDrawView* pScDrawView = NULL; - if (pScNavigatorDlg!=NULL) + ScTabViewShell* pScTabViewShell = nullptr; + ScDrawView* pScDrawView = nullptr; + if (pScNavigatorDlg!=nullptr) pScTabViewShell = ScNavigatorDlg::GetTabViewShell(); - if(pScTabViewShell !=NULL) + if(pScTabViewShell !=nullptr) pScDrawView =pScTabViewShell->GetViewData().GetScDrawView(); - if(pScDrawView!=NULL) + if(pScDrawView!=nullptr) { pScDrawView->SelectCurrentViewObject(aText ); bool bHasMakredObject = false; SvTreeListEntry* pParent = pRootNodes[nType]; - SvTreeListEntry* pBeginEntry = NULL; + SvTreeListEntry* pBeginEntry = nullptr; if( pParent ) pBeginEntry = FirstChild(pParent); while( pBeginEntry ) @@ -570,7 +570,7 @@ void ScContentTree::Command( const CommandEvent& rCEvt ) // den StarView MouseMove-Handler, der Command() aufruft, umbringen. // Deshalb Drag&Drop asynchron: - Application::PostUserEvent( LINK( this, ScContentTree, ExecDragHdl ), NULL, true ); + Application::PostUserEvent( LINK( this, ScContentTree, ExecDragHdl ), nullptr, true ); bDone = true; break; @@ -722,7 +722,7 @@ ScDocument* ScContentTree::GetSourceDocument() return &pSh->GetDocument(); } - return NULL; + return nullptr; } //Move along and draw "*" sign . @@ -741,8 +741,8 @@ void ScContentTree::ObjectFresh( ScContentId nType, SvTreeListEntry* pEntry ) if( pEntry ) { SvTreeListEntry* pParent = pRootNodes[nType]; - SvTreeListEntry* pBeginEntry = NULL; - SvTreeListEntry* pOldEntry = NULL; + SvTreeListEntry* pBeginEntry = nullptr; + SvTreeListEntry* pOldEntry = nullptr; if( pParent ) pBeginEntry = FirstChild(pParent); while( pBeginEntry ) @@ -964,19 +964,19 @@ void ScContentTree::GetDrawNames( ScContentId nType ) SvTreeListEntry* pChild=InsertEntry( aName, pParent ); if(pChild) pChild->SetMarked(false); - vcl::Window* pWindow=NULL; - ScTabViewShell* pScTabViewShell=NULL; - ScDrawView* pScDrawView=NULL; - ScNavigatorDlg* pScNavigatorDlg=NULL; + vcl::Window* pWindow=nullptr; + ScTabViewShell* pScTabViewShell=nullptr; + ScDrawView* pScDrawView=nullptr; + ScNavigatorDlg* pScNavigatorDlg=nullptr; if(pChild) pWindow=reinterpret_cast<vcl::Window*>(GetParent(pChild)); if(pWindow) pScNavigatorDlg = static_cast<ScNavigatorDlg*>(pWindow); - if (pScNavigatorDlg!=NULL) + if (pScNavigatorDlg!=nullptr) pScTabViewShell = ScNavigatorDlg::GetTabViewShell(); - if(pScTabViewShell !=NULL) + if(pScTabViewShell !=nullptr) pScDrawView =pScTabViewShell->GetViewData().GetScDrawView(); - if(pScDrawView!=NULL) + if(pScDrawView!=nullptr) { bool bMarked =pScDrawView->GetObjectIsMarked(pObject); pChild->SetMarked( bMarked ); @@ -1038,7 +1038,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex ) { ScDocument* pDoc = GetSourceDocument(); if (!pDoc) - return NULL; + return nullptr; sal_uLong nFound = 0; sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager(); @@ -1057,7 +1057,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex ) } OSL_FAIL("link not found"); - return NULL; + return nullptr; } static OUString lcl_NoteString( const ScPostIt& rNote ) @@ -1249,7 +1249,7 @@ static void lcl_DoDragObject( ScDocShell* pSrcShell, const OUString& rName, ScCo pTransferObj->SetDragSourceObj( pObject, nTab ); pTransferObj->SetDragSourceFlags( SC_DROP_NAVIGATOR ); - SC_MOD()->SetDragObject( NULL, pTransferObj ); + SC_MOD()->SetDragObject( nullptr, pTransferObj ); pWin->ReleaseMouse(); pTransferObj->StartDrag( pWin, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); } @@ -1283,7 +1283,7 @@ static void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, sal_u pTransferObj->SetDragSource( pSrcShell, aMark ); pTransferObj->SetDragSourceFlags( nFlags ); - SC_MOD()->SetDragObject( pTransferObj, NULL ); // for internal D&D + SC_MOD()->SetDragObject( pTransferObj, nullptr ); // for internal D&D pWin->ReleaseMouse(); pTransferObj->StartDrag( pWin, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); } @@ -1291,7 +1291,7 @@ static void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, sal_u void ScContentTree::DoDrag() { - ScDocumentLoader* pDocLoader = NULL; + ScDocumentLoader* pDocLoader = nullptr; bIsInDrag = true; ScModule* pScMod = SC_MOD(); @@ -1309,7 +1309,7 @@ void ScContentTree::DoDrag() { OUString aText( GetEntryText( pEntry ) ); - ScDocument* pLocalDoc = NULL; // fuer URL-Drop + ScDocument* pLocalDoc = nullptr; // fuer URL-Drop OUString aDocName; if (bHiddenDoc) aDocName = aHiddenName; @@ -1375,7 +1375,7 @@ void ScContentTree::DoDrag() break; case SC_DROPMODE_COPY: { - ScDocShell* pSrcShell = NULL; + ScDocShell* pSrcShell = nullptr; if ( bHiddenDoc ) { OUString aFilter, aOptions; @@ -1468,7 +1468,7 @@ bool ScContentTree::LoadFile( const OUString& rUrl ) Refresh(); // Inhalte aus geladenem Dokument holen - pHiddenDocument = NULL; + pHiddenDocument = nullptr; pParentWindow->GetDocNames( &aHiddenTitle ); // Liste fuellen } @@ -1639,7 +1639,7 @@ void ScContentTree::ApplyNavigatorSettings() // select if( nRootSel == nEntry ) { - SvTreeListEntry* pEntry = NULL; + SvTreeListEntry* pEntry = nullptr; if( bExp && (nChildSel != SC_CONTENT_NOCHILD) ) pEntry = GetEntry( pRootNodes[ nEntry ], nChildSel ); Select( pEntry ? pEntry : pRootNodes[ nEntry ] ); diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 0b564f1c93bd..2c1f1608cd7f 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -564,8 +564,8 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl aStrDisplay ( ScResId( STR_DISPLAY ) ), aStrActiveWin( ScResId( STR_ACTIVEWIN ) ), pContextWin ( pCW ), - pMarkArea ( NULL ), - pViewData ( NULL ), + pMarkArea ( nullptr ), + pViewData ( nullptr ), nListModeHeight( 0 ), nInitListHeight( 0 ), eListMode ( NAV_LMODE_NONE ), @@ -662,7 +662,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl aTbxCmd->SetAccessibleRelationLabeledBy(aTbxCmd.get()); aLbDocuments->SetAccessibleName(aStrActiveWin); - if (pContextWin == NULL) + if (pContextWin == nullptr) { // When the context window is missing then the navigator is // displayed in the sidebar and has the whole deck to fill. @@ -706,7 +706,7 @@ void ScNavigatorDlg::dispose() void ScNavigatorDlg::Resizing( Size& rNewSize ) // Size = Outputsize? { - FloatingWindow* pFloat = pContextWin!=NULL ? pContextWin->GetFloatingWindow() : NULL; + FloatingWindow* pFloat = pContextWin!=nullptr ? pContextWin->GetFloatingWindow() : nullptr; if ( pFloat ) { Size aMinOut = pFloat->GetMinOutputSizePixel(); @@ -810,7 +810,7 @@ void ScNavigatorDlg::DoResize() aLbDocuments->SetSizePixel( aDocSize ); bool bListMode = (eListMode != NAV_LMODE_NONE); - if (pContextWin != NULL) + if (pContextWin != nullptr) { FloatingWindow* pFloat = pContextWin->GetFloatingWindow(); if ( pFloat && bListMode ) @@ -1001,15 +1001,15 @@ ScNavigatorSettings* ScNavigatorDlg::GetNavigatorSettings() // be forgotten when the view is closed. ScTabViewShell* pViewSh = GetTabViewShell(); - return pViewSh ? pViewSh->GetNavigatorSettings() : NULL; + return pViewSh ? pViewSh->GetNavigatorSettings() : nullptr; } bool ScNavigatorDlg::GetViewData() { ScTabViewShell* pViewSh = GetTabViewShell(); - pViewData = pViewSh ? &pViewSh->GetViewData() : NULL; + pViewData = pViewSh ? &pViewSh->GetViewData() : nullptr; - return ( pViewData != NULL ); + return ( pViewData != nullptr ); } void ScNavigatorDlg::UpdateColumn( const SCCOL* pCol ) @@ -1107,7 +1107,7 @@ void ScNavigatorDlg::SetListMode( NavListMode eMode, bool bSetSize ) void ScNavigatorDlg::ShowList( bool bShow, bool bSetSize ) { - FloatingWindow* pFloat = pContextWin!=NULL ? pContextWin->GetFloatingWindow() : NULL; + FloatingWindow* pFloat = pContextWin!=nullptr ? pContextWin->GetFloatingWindow() : nullptr; Size aSize = GetParent()->GetOutputSizePixel(); if ( bShow ) @@ -1142,7 +1142,7 @@ void ScNavigatorDlg::ShowList( bool bShow, bool bSetSize ) else { SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent()); - if (pNav != NULL) + if (pNav != nullptr) { Size aFloating = pNav->GetFloatingSize(); aFloating.Height() = aSize.Height(); @@ -1153,7 +1153,7 @@ void ScNavigatorDlg::ShowList( bool bShow, bool bSetSize ) void ScNavigatorDlg::ShowScenarios( bool bShow, bool bSetSize ) { - FloatingWindow* pFloat = pContextWin!=NULL ? pContextWin->GetFloatingWindow() : NULL; + FloatingWindow* pFloat = pContextWin!=nullptr ? pContextWin->GetFloatingWindow() : nullptr; Size aSize = GetParent()->GetOutputSizePixel(); if ( bShow ) diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index 322a154c9965..501c2c1107d7 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -161,7 +161,7 @@ bool ScScenarioListBox::Notify( NotifyEvent& rNEvt ) const ScScenarioListBox::ScenarioEntry* ScScenarioListBox::GetSelectedEntry() const { size_t nPos = GetSelectEntryPos(); - return (nPos < maEntries.size()) ? &maEntries[ nPos ] : 0; + return (nPos < maEntries.size()) ? &maEntries[ nPos ] : nullptr; } void ScScenarioListBox::ExecuteScenarioSlot( sal_uInt16 nSlotId ) diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx index 078829c159b6..b854ae1f0f07 100644 --- a/sc/source/ui/optdlg/tpdefaults.cxx +++ b/sc/source/ui/optdlg/tpdefaults.cxx @@ -68,7 +68,7 @@ bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet) void ScTpDefaultsOptions::Reset(const SfxItemSet* rCoreSet) { ScDefaultsOptions aOpt; - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCDEFAULTSOPTIONS, false , &pItem)) aOpt = static_cast<const ScTpDefaultsItem*>(pItem)->GetDefaultsOptions(); diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 789555d2ad0a..70f913983fd2 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -308,7 +308,7 @@ bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet) void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet) { ScFormulaOptions aOpt; - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCFORMULAOPTIONS, false , &pItem)) aOpt = static_cast<const ScTpFormulaItem*>(pItem)->GetFormulaOptions(); diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 47db07a3a697..9a4ff48aeea8 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -55,9 +55,9 @@ ScTpUserLists::ScTpUserLists( vcl::Window* pParent, aStrCopyFrom ( ScGlobal::GetRscString( STR_COPYFROM ) ), aStrCopyErr ( ScGlobal::GetRscString( STR_COPYERR ) ), nWhichUserLists ( GetWhich( SID_SCUSERLISTS ) ), - pUserLists ( NULL ), - pDoc ( NULL ), - pViewData ( NULL ), + pUserLists ( nullptr ), + pDoc ( nullptr ), + pViewData ( nullptr ), pRangeUtil ( new ScRangeUtil ), bModifyMode ( false ), bCancelMode ( false ), @@ -222,13 +222,13 @@ bool ScTpUserLists::FillItemSet( SfxItemSet* rCoreAttrs ) ScUserList* pCoreList = rUserListItem.GetUserList(); bool bDataModified = false; - if ( (pUserLists == NULL) && (pCoreList == NULL) ) + if ( (pUserLists == nullptr) && (pCoreList == nullptr) ) { bDataModified = false; } - else if ( pUserLists != NULL ) + else if ( pUserLists != nullptr ) { - if ( pCoreList != NULL ) + if ( pCoreList != nullptr ) bDataModified = (*pUserLists != *pCoreList); else bDataModified = true; diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx index 740702a5d2e2..64550727f236 100644 --- a/sc/source/ui/optdlg/tpview.cxx +++ b/sc/source/ui/optdlg/tpview.cxx @@ -40,7 +40,7 @@ ScTpContentOptions::ScTpContentOptions( vcl::Window* pParent, const SfxItemSet& rArgSet ) : SfxTabPage(pParent, "TpViewPage", "modules/scalc/ui/tpviewpage.ui", &rArgSet), - pLocalOptions(0) + pLocalOptions(nullptr) { get(pGridLB,"grid"); get(pColorFT,"color_label"); @@ -373,7 +373,7 @@ ScTpLayoutOptions::ScTpLayoutOptions( vcl::Window* pParent, SfxTabPage( pParent, "ScGeneralPage", "modules/scalc/ui/scgeneralpage.ui", &rArgSet), aUnitArr( ScResId(SCSTR_UNIT )), - pDoc(NULL) + pDoc(nullptr) { get( m_pUnitLB, "unitlb"); get( m_pTabMF, "tabmf"); @@ -458,7 +458,7 @@ VclPtr<SfxTabPage> ScTpLayoutOptions::Create( vcl::Window* pParent, VclPtrInstance<ScTpLayoutOptions> pNew( pParent, *rCoreSet ); ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() ); - if(pDocSh!=NULL) + if(pDocSh!=nullptr) pNew->SetDocument(&pDocSh->GetDocument()); return pNew; } @@ -596,7 +596,7 @@ void ScTpLayoutOptions::Reset( const SfxItemSet* rCoreSet ) ScLkUpdMode nSet=LM_UNKNOWN; - if(pDoc!=NULL) + if(pDoc!=nullptr) { nSet=pDoc->GetLinkMode(); } diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index ec32d3fd4c33..07e270c9b72f 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -93,8 +93,8 @@ static void printAddressFlags(sal_uInt16 nFlag) ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent ) : ScAnyRefDlg(pB, pCW, pParent, "PrintAreasDialog", "modules/scalc/ui/printareasdialog.ui") , bDlgLostFocus(false) - , pDoc(NULL) - , pViewData(NULL) + , pDoc(nullptr) + , pViewData(nullptr) , nCurTab(0) { get(pLbPrintArea,"lbprintarea"); @@ -367,11 +367,11 @@ bool ScPrintAreasDlg::Impl_CheckRefStrings() bool bRepeatRowOk = aStrRepeatRow.isEmpty(); if ( !bRepeatRowOk ) - bRepeatRowOk = lcl_CheckRepeatString(aStrRepeatRow, pDoc, true, NULL); + bRepeatRowOk = lcl_CheckRepeatString(aStrRepeatRow, pDoc, true, nullptr); bool bRepeatColOk = aStrRepeatCol.isEmpty(); if ( !bRepeatColOk ) - bRepeatColOk = lcl_CheckRepeatString(aStrRepeatCol, pDoc, false, NULL); + bRepeatColOk = lcl_CheckRepeatString(aStrRepeatCol, pDoc, false, nullptr); // Fehlermeldungen @@ -379,7 +379,7 @@ bool ScPrintAreasDlg::Impl_CheckRefStrings() if ( !bOk ) { - Edit* pEd = NULL; + Edit* pEd = nullptr; if ( !bPrintAreaOk ) pEd = pEdPrintArea; else if ( !bRepeatRowOk ) pEd = pEdRepeatRow; @@ -543,7 +543,7 @@ IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_SelectHdl, ListBox&, rLb, void ) { ListBox* pLb = &rLb; const sal_Int32 nSelPos = pLb->GetSelectEntryPos(); - Edit* pEd = NULL; + Edit* pEd = nullptr; // list box positions of specific entries, default to "repeat row/column" list boxes sal_Int32 nAllSheetPos = SC_AREASDLG_RR_NONE; @@ -576,7 +576,7 @@ IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_SelectHdl, ListBox&, rLb, void ) IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_ModifyHdl, Edit&, rEd, void ) { - ListBox* pLb = NULL; + ListBox* pLb = nullptr; // list box positions of specific entries, default to "repeat row/column" list boxes sal_Int32 nUserDefPos = SC_AREASDLG_RR_USER; diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx index b2383f2b7943..14ddddbf1df4 100644 --- a/sc/source/ui/pagedlg/hfedtdlg.cxx +++ b/sc/source/ui/pagedlg/hfedtdlg.cxx @@ -64,8 +64,8 @@ ScHFEditHeaderDlg::ScHFEditHeaderDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "HeaderDialog", "modules/scalc/ui/headerdialog.ui" ) { - AddTabPage( "headerright", ScRightHeaderEditPage::Create, NULL ); - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, NULL ); + AddTabPage( "headerright", ScRightHeaderEditPage::Create, nullptr ); + AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, nullptr ); } ScHFEditFooterDlg::ScHFEditFooterDlg( SfxViewFrame* pFrameP, @@ -75,8 +75,8 @@ ScHFEditFooterDlg::ScHFEditFooterDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "FooterDialog", "modules/scalc/ui/footerdialog.ui" ) { - AddTabPage( "footerright", ScRightFooterEditPage::Create, NULL ); - AddTabPage( "footerleft", ScLeftFooterEditPage::Create, NULL ); + AddTabPage( "footerright", ScRightFooterEditPage::Create, nullptr ); + AddTabPage( "footerleft", ScLeftFooterEditPage::Create, nullptr ); } ScHFEditLeftHeaderDlg::ScHFEditLeftHeaderDlg( SfxViewFrame* pFrameP, @@ -86,7 +86,7 @@ ScHFEditLeftHeaderDlg::ScHFEditLeftHeaderDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "LeftHeaderDialog", "modules/scalc/ui/leftheaderdialog.ui" ) { - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, NULL ); + AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, nullptr ); } ScHFEditRightHeaderDlg::ScHFEditRightHeaderDlg( SfxViewFrame* pFrameP, @@ -96,7 +96,7 @@ ScHFEditRightHeaderDlg::ScHFEditRightHeaderDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "RightHeaderDialog", "modules/scalc/ui/rightheaderdialog.ui" ) { - AddTabPage( "headerright", ScRightHeaderEditPage::Create, NULL ); + AddTabPage( "headerright", ScRightHeaderEditPage::Create, nullptr ); } ScHFEditLeftFooterDlg::ScHFEditLeftFooterDlg( SfxViewFrame* pFrameP, @@ -106,7 +106,7 @@ ScHFEditLeftFooterDlg::ScHFEditLeftFooterDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "LeftFooterDialog", "modules/scalc/ui/leftfooterdialog.ui" ) { - AddTabPage( "footerleft", ScLeftFooterEditPage::Create, NULL ); + AddTabPage( "footerleft", ScLeftFooterEditPage::Create, nullptr ); } ScHFEditRightFooterDlg::ScHFEditRightFooterDlg( SfxViewFrame* pFrameP, @@ -116,7 +116,7 @@ ScHFEditRightFooterDlg::ScHFEditRightFooterDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "RightFooterDialog", "modules/scalc/ui/rightfooterdialog.ui" ) { - AddTabPage( "footerright", ScRightFooterEditPage::Create, NULL ); + AddTabPage( "footerright", ScRightFooterEditPage::Create, nullptr ); } ScHFEditSharedHeaderDlg::ScHFEditSharedHeaderDlg( SfxViewFrame* pFrameP, @@ -126,9 +126,9 @@ ScHFEditSharedHeaderDlg::ScHFEditSharedHeaderDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "SharedHeaderDialog", "modules/scalc/ui/sharedheaderdialog.ui" ) { - AddTabPage( "header", ScRightHeaderEditPage::Create, NULL ); - AddTabPage( "footerright", ScRightFooterEditPage::Create, NULL ); - AddTabPage( "footerleft", ScLeftFooterEditPage::Create, NULL ); + AddTabPage( "header", ScRightHeaderEditPage::Create, nullptr ); + AddTabPage( "footerright", ScRightFooterEditPage::Create, nullptr ); + AddTabPage( "footerleft", ScLeftFooterEditPage::Create, nullptr ); } ScHFEditSharedFooterDlg::ScHFEditSharedFooterDlg( SfxViewFrame* pFrameP, @@ -138,9 +138,9 @@ ScHFEditSharedFooterDlg::ScHFEditSharedFooterDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "SharedFooterDialog", "modules/scalc/ui/sharedfooterdialog.ui" ) { - AddTabPage( "headerright", ScRightHeaderEditPage::Create, NULL ); - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, NULL ); - AddTabPage( "footer", ScRightFooterEditPage::Create, NULL ); + AddTabPage( "headerright", ScRightHeaderEditPage::Create, nullptr ); + AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, nullptr ); + AddTabPage( "footer", ScRightFooterEditPage::Create, nullptr ); } ScHFEditAllDlg::ScHFEditAllDlg( SfxViewFrame* pFrameP, @@ -150,10 +150,10 @@ ScHFEditAllDlg::ScHFEditAllDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "AllHeaderFooterDialog", "modules/scalc/ui/allheaderfooterdialog.ui" ) { - AddTabPage( "headerright", ScRightHeaderEditPage::Create, NULL ); - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, NULL ); - AddTabPage( "footerright", ScRightFooterEditPage::Create, NULL ); - AddTabPage( "footerleft", ScLeftFooterEditPage::Create, NULL ); + AddTabPage( "headerright", ScRightHeaderEditPage::Create, nullptr ); + AddTabPage( "headerleft", ScLeftHeaderEditPage::Create, nullptr ); + AddTabPage( "footerright", ScRightFooterEditPage::Create, nullptr ); + AddTabPage( "footerleft", ScLeftFooterEditPage::Create, nullptr ); } ScHFEditActiveDlg::ScHFEditActiveDlg( SfxViewFrame* pFrameP, @@ -172,8 +172,8 @@ ScHFEditActiveDlg::ScHFEditActiveDlg( SfxViewFrame* pFrameP, if ( bRightPage ) { - AddTabPage( "header", ScRightHeaderEditPage::Create, NULL ); - AddTabPage( "footer", ScRightFooterEditPage::Create, NULL ); + AddTabPage( "header", ScRightHeaderEditPage::Create, nullptr ); + AddTabPage( "footer", ScRightFooterEditPage::Create, nullptr ); } else { @@ -181,15 +181,15 @@ ScHFEditActiveDlg::ScHFEditActiveDlg( SfxViewFrame* pFrameP, bool bShareHeader = IS_SHARE_HEADER(rCoreSet); if ( bShareHeader ) - AddTabPage( "header", ScRightHeaderEditPage::Create, NULL ); + AddTabPage( "header", ScRightHeaderEditPage::Create, nullptr ); else - AddTabPage( "header", ScLeftHeaderEditPage::Create, NULL ); + AddTabPage( "header", ScLeftHeaderEditPage::Create, nullptr ); bool bShareFooter = IS_SHARE_FOOTER(rCoreSet); if ( bShareFooter ) - AddTabPage( "footer", ScRightFooterEditPage::Create, NULL ); + AddTabPage( "footer", ScRightFooterEditPage::Create, nullptr ); else - AddTabPage( "footer", ScLeftFooterEditPage::Create, NULL ); + AddTabPage( "footer", ScLeftFooterEditPage::Create, nullptr ); } } diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index d33cea554748..2b2192f71af8 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -51,7 +51,7 @@ // STATIC DATA ----------------------------------------------------------- -static VclPtr<ScEditWindow> pActiveEdWnd = NULL; +static VclPtr<ScEditWindow> pActiveEdWnd = nullptr; // class ScHFEditPage @@ -193,7 +193,7 @@ void ScHFEditPage::SetNumType(SvxNumType eNumType) void ScHFEditPage::Reset( const SfxItemSet* rCoreSet ) { - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if ( rCoreSet->HasItem(nWhich, &pItem) ) { const ScPageHFItem& rItem = static_cast<const ScPageHFItem&>(*pItem); @@ -253,8 +253,8 @@ void ScHFEditPage::InitPreDefinedList() { SvtUserOptions aUserOpt; - Color* pTxtColour = NULL; - Color* pFldColour = NULL; + Color* pTxtColour = nullptr; + Color* pFldColour = nullptr; // Get the all field values at the outset. OUString aPageFieldValue(m_pWndLeft->GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour)); diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 716e5238debd..614da79e5395 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -47,7 +47,7 @@ ScHFPage::ScHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSe ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT, ATTR_PAGE, ATTR_PAGE, 0 ), nPageUsage ( (sal_uInt16)SVX_PAGE_ALL ), - pStyleDlg ( NULL ) + pStyleDlg ( nullptr ) { get(m_pBtnEdit, "buttonEdit"); @@ -91,7 +91,7 @@ void ScHFPage::dispose() void ScHFPage::Reset( const SfxItemSet* rSet ) { SvxHFPage::Reset( rSet ); - TurnOnHdl( 0 ); + TurnOnHdl( nullptr ); } bool ScHFPage::FillItemSet( SfxItemSet* rOutSet ) @@ -163,7 +163,7 @@ IMPL_LINK_NOARG_TYPED(ScHFPage, BtnHdl, Button*, void) // the GrabFocus from the Edit-Dialog under OS/2 doesn't work.(Bug #41805#). // With the new StarView, this workaround should be again considered! - Application::PostUserEvent( LINK( this, ScHFPage, HFEditHdl ), NULL, true ); + Application::PostUserEvent( LINK( this, ScHFPage, HFEditHdl ), nullptr, true ); } IMPL_LINK_NOARG_TYPED(ScHFPage, HFEditHdl, void*, void) @@ -207,17 +207,17 @@ IMPL_LINK_NOARG_TYPED(ScHFPage, HFEditHdl, void*, void) { aText = ScGlobal::GetRscString( STR_PAGEHEADER ); if ( bRightPage ) - pDlg->SetTabPage( ScRightHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ), NULL, nSettingsId ); + pDlg->SetTabPage( ScRightHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ), nullptr, nSettingsId ); else - pDlg->SetTabPage( ScLeftHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ), NULL, nSettingsId ); + pDlg->SetTabPage( ScLeftHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ), nullptr, nSettingsId ); } else { aText = ScGlobal::GetRscString( STR_PAGEFOOTER ); if ( bRightPage ) - pDlg->SetTabPage( ScRightFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ), NULL, nSettingsId ); + pDlg->SetTabPage( ScRightFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ), nullptr, nSettingsId ); else - pDlg->SetTabPage( ScLeftFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ), NULL, nSettingsId ); + pDlg->SetTabPage( ScLeftFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ), nullptr, nSettingsId ); } SvxNumType eNumType = static_cast<const SvxPageItem&>(aDataSet.Get(ATTR_PAGE)).GetNumType(); diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 24932223c6f1..b5f8bf87e401 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -48,7 +48,7 @@ #include <memory> // STATIC DATA ----------------------------------------------------------- -static VclPtr<ScEditWindow> pActiveEdWnd = NULL; +static VclPtr<ScEditWindow> pActiveEdWnd = nullptr; ScEditWindow* GetScEditWindow () { @@ -72,7 +72,7 @@ static void lcl_GetFieldData( ScHeaderFieldData& rData ) ScEditWindow::ScEditWindow( vcl::Window* pParent, WinBits nBits, ScEditWindowLocation eLoc ) : Control( pParent, nBits ), eLocation(eLoc), - pAcc(NULL) + pAcc(nullptr) { EnableRTL(false); @@ -198,7 +198,7 @@ void ScEditWindow::SetCharAttributes() if ( pDocSh && pViewSh ) { - if(pTabViewSh!=NULL) pTabViewSh->SetInFormatDialog(true); + if(pTabViewSh!=nullptr) pTabViewSh->SetInFormatDialog(true); SfxItemSet aSet( pEdView->GetAttribs() ); @@ -216,7 +216,7 @@ void ScEditWindow::SetCharAttributes() pEdView->SetAttribs( aSet ); } - if(pTabViewSh!=NULL) pTabViewSh->SetInFormatDialog(false); + if(pTabViewSh!=nullptr) pTabViewSh->SetInFormatDialog(false); } } @@ -291,7 +291,7 @@ void ScEditWindow::GetFocus() pAcc->GotFocus(); } else - pAcc = NULL; + pAcc = nullptr; Control::GetFocus(); } @@ -304,7 +304,7 @@ void ScEditWindow::LoseFocus() pAcc->LostFocus(); } else - pAcc = NULL; + pAcc = nullptr; Control::LoseFocus(); } @@ -338,7 +338,7 @@ css::uno::Reference< css::accessibility::XAccessible > ScEditWindow::CreateAcces } ScExtIButton::ScExtIButton(vcl::Window* pParent, WinBits nBits ) - : ImageButton(pParent,nBits), pPopupMenu(NULL) + : ImageButton(pParent,nBits), pPopupMenu(nullptr) { nSelected=0; aIdle.SetPriority(SchedulerPriority::LOWEST); @@ -382,7 +382,7 @@ void ScExtIButton::StartPopup() nSelected=0; aSelectedIdent.clear(); - if(pPopupMenu!=NULL) + if(pPopupMenu!=nullptr) { SetPressed( true ); EndSelection(); diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index 7f308af58276..f7eddeb31822 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -176,7 +176,7 @@ void ScTablePage::Reset( const SfxItemSet* rCoreSet ) sal_uInt16 nPage = GET_USHORT(SID_SCATTR_PAGE_FIRSTPAGENO,*rCoreSet); m_pBtnPageNo->Check( nPage != 0 ); m_pEdPageNo->SetValue( (nPage != 0) ? nPage : 1 ); - PageNoHdl( NULL ); + PageNoHdl( nullptr ); // object representation: m_pBtnCharts->Check( GET_SHOW( SID_SCATTR_PAGE_CHARTS, *rCoreSet ) ); @@ -226,7 +226,7 @@ void ScTablePage::Reset( const SfxItemSet* rCoreSet ) m_pEdScaleAll->SetValue( 100 ); } - PageDirHdl( NULL ); + PageDirHdl( nullptr ); ScaleHdl( *m_pLbScaleMode.get() ); // remember for FillItemSet diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index 6f8a5e6a4e94..4def79cbe17b 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -232,12 +232,12 @@ VclPtr<vcl::Window> AlignmentPropertyPanel::Create ( const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings) { - if (pParent == NULL) - throw lang::IllegalArgumentException("no parent Window given to AlignmentPropertyPanel::Create", NULL, 0); + if (pParent == nullptr) + throw lang::IllegalArgumentException("no parent Window given to AlignmentPropertyPanel::Create", nullptr, 0); if ( ! rxFrame.is()) - throw lang::IllegalArgumentException("no XFrame given to AlignmentPropertyPanel::Create", NULL, 1); - if (pBindings == NULL) - throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", NULL, 2); + throw lang::IllegalArgumentException("no XFrame given to AlignmentPropertyPanel::Create", nullptr, 1); + if (pBindings == nullptr) + throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", nullptr, 2); return VclPtr<AlignmentPropertyPanel>::Create( pParent, rxFrame, pBindings); diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index 7d44922d0c1e..f4f78f1ed37a 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -233,12 +233,12 @@ VclPtr<vcl::Window> CellAppearancePropertyPanel::Create ( const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings) { - if (pParent == NULL) - throw lang::IllegalArgumentException("no parent Window given to CellAppearancePropertyPanel::Create", NULL, 0); + if (pParent == nullptr) + throw lang::IllegalArgumentException("no parent Window given to CellAppearancePropertyPanel::Create", nullptr, 0); if ( ! rxFrame.is()) - throw lang::IllegalArgumentException("no XFrame given to CellAppearancePropertyPanel::Create", NULL, 1); - if (pBindings == NULL) - throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", NULL, 2); + throw lang::IllegalArgumentException("no XFrame given to CellAppearancePropertyPanel::Create", nullptr, 1); + if (pBindings == nullptr) + throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", nullptr, 2); return VclPtr<CellAppearancePropertyPanel>::Create( pParent, rxFrame, pBindings); diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx index 7bcb01f535fd..866f47df3be2 100644 --- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx +++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx @@ -50,7 +50,7 @@ CellBorderStyleControl::CellBorderStyleControl(vcl::Window* pParent, CellAppeara maTBBorder3(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER3))), maFL1(VclPtr<FixedLine>::Create(this, ScResId(FL_1))), maFL2(VclPtr<FixedLine>::Create(this, ScResId(FL_2))), - mpImageList(0) + mpImageList(nullptr) { Initialize(); FreeResource(); @@ -150,8 +150,8 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox, void) sal_uInt16 nId = pToolBox->GetCurItemId(); SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER ); SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER ); - editeng::SvxBorderLine theDefLine(NULL, 1); - editeng::SvxBorderLine *pLeft = 0, *pRight = 0, *pTop = 0, *pBottom = 0; + editeng::SvxBorderLine theDefLine(nullptr, 1); + editeng::SvxBorderLine *pLeft = nullptr, *pRight = nullptr, *pTop = nullptr, *pBottom = nullptr; sal_uInt8 nValidFlags = 0; switch ( nId ) { @@ -160,8 +160,8 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox, void) nValidFlags |= FRM_VALID_ALL; SvxLineItem aLineItem1( SID_ATTR_BORDER_DIAG_BLTR ); SvxLineItem aLineItem2( SID_ATTR_BORDER_DIAG_TLBR ); - aLineItem1.SetLine( NULL ); //modify - aLineItem2.SetLine( NULL ); //modify + aLineItem1.SetLine( nullptr ); //modify + aLineItem2.SetLine( nullptr ); //modify mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_BLTR, SfxCallMode::RECORD, &aLineItem1, 0L); mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_TLBR, SfxCallMode::RECORD, &aLineItem2, 0L); } @@ -209,11 +209,11 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox, void) { SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER ); SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER ); - editeng::SvxBorderLine theDefLine(NULL, 1); - editeng::SvxBorderLine *pLeft = 0, - *pRight = 0, - *pTop = 0, - *pBottom = 0; + editeng::SvxBorderLine theDefLine(nullptr, 1); + editeng::SvxBorderLine *pLeft = nullptr, + *pRight = nullptr, + *pTop = nullptr, + *pBottom = nullptr; sal_uInt8 nValidFlags = 0; switch ( nId ) { @@ -269,14 +269,14 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox, void) } else if(nId == TBI_BORDER2_BLTR) { - editeng::SvxBorderLine aTmp( NULL, 1 ); + editeng::SvxBorderLine aTmp( nullptr, 1 ); SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_BLTR ); aLineItem.SetLine( &aTmp ); mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_BLTR, SfxCallMode::RECORD, &aLineItem, 0L); } else if(nId == TBI_BORDER2_TLBR) { - editeng::SvxBorderLine aTmp( NULL, 1 ); + editeng::SvxBorderLine aTmp( nullptr, 1 ); SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_TLBR ); aLineItem.SetLine( &aTmp ); mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_TLBR, SfxCallMode::RECORD, &aLineItem, 0L); @@ -301,31 +301,31 @@ IMPL_LINK_TYPED(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox, void) switch ( nId ) { case TBI_BORDER3_S1: - pBottom.reset(new editeng::SvxBorderLine(NULL, DEF_LINE_WIDTH_2 )); + pBottom.reset(new editeng::SvxBorderLine(nullptr, DEF_LINE_WIDTH_2 )); nValidFlags |= FRM_VALID_BOTTOM; break; case TBI_BORDER3_S2: - pBottom.reset(new editeng::SvxBorderLine(NULL)); + pBottom.reset(new editeng::SvxBorderLine(nullptr)); pBottom->GuessLinesWidths(DOUBLE, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_1); nValidFlags |= FRM_VALID_BOTTOM; break; case TBI_BORDER3_S3: - pBottom.reset(new editeng::SvxBorderLine(NULL, DEF_LINE_WIDTH_2 )); - pTop.reset(new editeng::SvxBorderLine(NULL, 1)); + pBottom.reset(new editeng::SvxBorderLine(nullptr, DEF_LINE_WIDTH_2 )); + pTop.reset(new editeng::SvxBorderLine(nullptr, 1)); nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP; break; case TBI_BORDER3_S4: - pBottom.reset(new editeng::SvxBorderLine(NULL)); + pBottom.reset(new editeng::SvxBorderLine(nullptr)); pBottom->GuessLinesWidths(DOUBLE, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_1); - pTop.reset(new editeng::SvxBorderLine(NULL, 1)); + pTop.reset(new editeng::SvxBorderLine(nullptr, 1)); nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP; break; } aBorderOuter.SetLine( pTop.get(), SvxBoxItemLine::TOP ); aBorderOuter.SetLine( pBottom.get(), SvxBoxItemLine::BOTTOM ); - aBorderOuter.SetLine( NULL, SvxBoxItemLine::LEFT ); - aBorderOuter.SetLine( NULL, SvxBoxItemLine::RIGHT ); + aBorderOuter.SetLine( nullptr, SvxBoxItemLine::LEFT ); + aBorderOuter.SetLine( nullptr, SvxBoxItemLine::RIGHT ); aBorderInner.SetValid( SvxBoxInfoItemValidFlags::TOP, 0 != (nValidFlags&FRM_VALID_TOP )); aBorderInner.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, 0 != (nValidFlags&FRM_VALID_BOTTOM )); diff --git a/sc/source/ui/sidebar/CellBorderUpdater.cxx b/sc/source/ui/sidebar/CellBorderUpdater.cxx index 83f1ee8a3d6f..a7c3d5c13684 100644 --- a/sc/source/ui/sidebar/CellBorderUpdater.cxx +++ b/sc/source/ui/sidebar/CellBorderUpdater.cxx @@ -53,7 +53,7 @@ void CellBorderUpdater::UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool else if( aBmpEx.IsTransparent() ) pMskAcc = ( aMsk = aBmpEx.GetMask() ).AcquireWriteAccess(); else - pMskAcc = NULL; + pMskAcc = nullptr; pBmpAcc->SetLineColor( ::Application::GetSettings().GetStyleSettings().GetFieldTextColor() ) ; pBmpAcc->SetFillColor( COL_BLACK); diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx index dadc65d63f40..6040969e8de2 100644 --- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx +++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx @@ -25,7 +25,7 @@ namespace sc { namespace sidebar { CellLineStyleValueSet::CellLineStyleValueSet( vcl::Window* pParent, const ResId& rResId) : ValueSet( pParent, rResId ), - pVDev(NULL), + pVDev(nullptr), nSelItem(0) { SetColCount(); diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx index e3e7569eb0af..b4e89076cf1b 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx @@ -158,12 +158,12 @@ VclPtr<vcl::Window> NumberFormatPropertyPanel::Create ( const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings) { - if (pParent == NULL) - throw lang::IllegalArgumentException("no parent Window given to NumberFormatPropertyPanel::Create", NULL, 0); + if (pParent == nullptr) + throw lang::IllegalArgumentException("no parent Window given to NumberFormatPropertyPanel::Create", nullptr, 0); if ( ! rxFrame.is()) - throw lang::IllegalArgumentException("no XFrame given to NumberFormatPropertyPanel::Create", NULL, 1); - if (pBindings == NULL) - throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", NULL, 2); + throw lang::IllegalArgumentException("no XFrame given to NumberFormatPropertyPanel::Create", nullptr, 1); + if (pBindings == nullptr) + throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", nullptr, 2); return VclPtr<NumberFormatPropertyPanel>::Create( pParent, rxFrame, pBindings); diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx index 7857685aa1c2..1e634954aa77 100644 --- a/sc/source/ui/sidebar/ScPanelFactory.cxx +++ b/sc/source/ui/sidebar/ScPanelFactory.cxx @@ -71,18 +71,18 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); - if ( ! xParentWindow.is() || pParentWindow==NULL) + if ( ! xParentWindow.is() || pParentWindow==nullptr) throw RuntimeException( "PanelFactory::createUIElement called without ParentWindow", - NULL); + nullptr); if ( ! xFrame.is()) throw RuntimeException( "PanelFactory::createUIElement called without Frame", - NULL); - if (pBindings == NULL) + nullptr); + if (pBindings == nullptr) throw RuntimeException( "PanelFactory::createUIElement called without SfxBindings", - NULL); + nullptr); sal_Int32 nMinimumSize = -1; VclPtr<vcl::Window> pPanel; @@ -118,7 +118,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( { throw lang::WrappedTargetRuntimeException( OUString("ScPanelFactory::createUIElement exception"), - 0, uno::makeAny(e)); + nullptr, uno::makeAny(e)); } return xElement; diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx index b8678f376c1a..da50ea4ac2ed 100644 --- a/sc/source/ui/undo/areasave.cxx +++ b/sc/source/ui/undo/areasave.cxx @@ -134,7 +134,7 @@ static ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScArea return static_cast<ScAreaLink*>(pBase); // found } } - return NULL; // not found + return nullptr; // not found } void ScAreaLinkSaveCollection::Restore( ScDocument* pDoc ) @@ -163,7 +163,7 @@ void ScAreaLinkSaveCollection::Restore( ScDocument* pDoc ) ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocument* pDoc ) { - ScAreaLinkSaveCollection* pColl = NULL; + ScAreaLinkSaveCollection* pColl = nullptr; sfx2::LinkManager* pLinkManager = const_cast<ScDocument*>(pDoc)->GetLinkManager(); if (pLinkManager) diff --git a/sc/source/ui/undo/refundo.cxx b/sc/source/ui/undo/refundo.cxx index f782f7e7aa24..a7c209634fda 100644 --- a/sc/source/ui/undo/refundo.cxx +++ b/sc/source/ui/undo/refundo.cxx @@ -35,14 +35,14 @@ #include <refupdatecontext.hxx> ScRefUndoData::ScRefUndoData( const ScDocument* pDoc ) : - pDBCollection(NULL), - pRangeName(NULL), + pDBCollection(nullptr), + pRangeName(nullptr), pPrintRanges(pDoc->CreatePrintRangeSaver()), - pDPCollection(NULL), - pDetOpList(NULL), - pChartListenerCollection(NULL), - pAreaLinks(NULL), - pUnoRefs(NULL) + pDPCollection(nullptr), + pDetOpList(nullptr), + pChartListenerCollection(nullptr), + pAreaLinks(nullptr), + pUnoRefs(nullptr) { const ScDBCollection* pOldDBColl = pDoc->GetDBCollection(); if (pOldDBColl && !pOldDBColl->empty()) diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 909e78ca549c..127c8168f54c 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -44,7 +44,7 @@ TYPEINIT1(ScUndoWrapper, SfxUndoAction); ScSimpleUndo::ScSimpleUndo( ScDocShell* pDocSh ) : pDocShell( pDocSh ), - pDetectiveUndo( NULL ) + pDetectiveUndo( nullptr ) { } @@ -443,7 +443,7 @@ void ScMoveUndo::UndoRef() { ScDocument& rDoc = pDocShell->GetDocument(); ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1); - pRefUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::FORMULA, false, &rDoc, NULL, false ); + pRefUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::FORMULA, false, &rDoc, nullptr, false ); if (pRefUndoData) pRefUndoData->DoUndo( &rDoc, (eMode == SC_UNDO_REFFIRST) ); // HACK: ScDragDropUndo is the only one with REFFIRST. @@ -579,7 +579,7 @@ ScUndoWrapper::~ScUndoWrapper() void ScUndoWrapper::ForgetWrappedUndo() { - pWrappedUndo = NULL; // don't delete in dtor - pointer must be stored outside + pWrappedUndo = nullptr; // don't delete in dtor - pointer must be stored outside } OUString ScUndoWrapper::GetComment() const diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 42e541b2b3e1..55f5e1ad2d87 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -95,7 +95,7 @@ ScUndoInsertCells::ScUndoInsertCells( ScDocShell* pNewDocShell, pScenarios( pNewScenarios ), eCmd( eNewCmd ), bPartOfPaste( bNewPartOfPaste ), - pPasteUndo( NULL ) + pPasteUndo( nullptr ) { if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER) // whole row? { @@ -836,7 +836,7 @@ void ScUndoCut::Redo() void ScUndoCut::Repeat(SfxRepeatTarget& rTarget) { if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr) - static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->CutToClip( NULL, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->CutToClip( nullptr, true ); } bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const @@ -856,7 +856,7 @@ ScUndoPaste::ScUndoPaste( ScDocShell* pNewDocShell, const ScRangeList& rRanges, pRedoDoc( pNewRedoDoc ), nFlags( nNewFlags ), pRefUndoData( pRefData ), - pRefRedoData( NULL ), + pRefRedoData( nullptr ), bRedoFilled( bRedoIsFilled ) { if ( pRefUndoData ) @@ -1407,7 +1407,7 @@ void ScUndoDragDrop::Redo() bool bIncludeFiltered = bCut; // TODO: restore old note captions instead of cloning new captions... - rDoc.CopyFromClip( aDestRange, aDestMark, InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS, NULL, pClipDoc.get(), true, false, bIncludeFiltered ); + rDoc.CopyFromClip( aDestRange, aDestMark, InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS, nullptr, pClipDoc.get(), true, false, bIncludeFiltered ); if (bCut) for (nTab=aSrcRange.aStart.Tab(); nTab<=aSrcRange.aEnd.Tab(); nTab++) @@ -2000,7 +2000,7 @@ ScUndoClearItems::ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& ScBlockUndo( pNewDocShell, lcl_GetMultiMarkRange(rMark), SC_UNDO_AUTOHEIGHT ), aMarkData( rMark ), pUndoDoc( pNewUndoDoc ), - pWhich( NULL ) + pWhich( nullptr ) { OSL_ENSURE( pW, "ScUndoClearItems: Which-Pointer ist 0" ); diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx index 7abfac0ccb07..4539c96f62cc 100644 --- a/sc/source/ui/undo/undoblk2.cxx +++ b/sc/source/ui/undo/undoblk2.cxx @@ -51,7 +51,7 @@ ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell, nNewSize( nNewSizeTwips ), bWidth( bNewWidth ), eMode( eNewMode ), - pDrawUndo( NULL ) + pDrawUndo( nullptr ) { pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ); } diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 475cf1d280e8..08504a597f45 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -87,7 +87,7 @@ ScUndoDeleteContents::ScUndoDeleteContents( aRange ( rRange ), aMarkData ( rMark ), pUndoDoc ( std::move(pNewUndoDoc) ), - pDrawUndo ( NULL ), + pDrawUndo ( nullptr ), nFlags ( nNewFlags ), bMulti ( bNewMulti ) // unnecessary { @@ -373,8 +373,8 @@ ScUndoSelectionAttr::ScUndoSelectionAttr( ScDocShell* pNewDocShell, { ScDocumentPool* pPool = pDocShell->GetDocument().GetPool(); pApplyPattern = const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>( &pPool->Put( *pNewApply ) )); - pLineOuter = pNewOuter ? const_cast<SvxBoxItem*>(static_cast<const SvxBoxItem*>( &pPool->Put( *pNewOuter ) )) : NULL; - pLineInner = pNewInner ? const_cast<SvxBoxInfoItem*>(static_cast<const SvxBoxInfoItem*>( &pPool->Put( *pNewInner ) )) : NULL; + pLineOuter = pNewOuter ? const_cast<SvxBoxItem*>(static_cast<const SvxBoxItem*>( &pPool->Put( *pNewOuter ) )) : nullptr; + pLineInner = pNewInner ? const_cast<SvxBoxInfoItem*>(static_cast<const SvxBoxInfoItem*>( &pPool->Put( *pNewInner ) )) : nullptr; } ScUndoSelectionAttr::~ScUndoSelectionAttr() @@ -452,14 +452,14 @@ void ScUndoSelectionAttr::ChangeEditData( const bool bUndo ) if (bUndo) { if (pItem->GetOldData()) - rDoc.SetEditText(aPos, *pItem->GetOldData(), NULL); + rDoc.SetEditText(aPos, *pItem->GetOldData(), nullptr); else rDoc.SetEmptyCell(aPos); } else { if (pItem->GetNewData()) - rDoc.SetEditText(aPos, *pItem->GetNewData(), NULL); + rDoc.SetEditText(aPos, *pItem->GetNewData(), nullptr); else rDoc.SetEmptyCell(aPos); } @@ -998,7 +998,7 @@ void ScUndoReplace::Undo() InsertDeleteFlags nUndoFlags = (pSearchItem->GetPattern()) ? InsertDeleteFlags::ATTRIB : InsertDeleteFlags::CONTENTS; pUndoDoc->CopyToDocument( 0, 0, 0, MAXCOL, MAXROW, MAXTAB, - nUndoFlags, false, &rDoc, NULL, false ); // without row flags + nUndoFlags, false, &rDoc, nullptr, false ); // without row flags pDocShell->PostPaintGridAll(); } else if (pSearchItem->GetPattern() && @@ -1370,7 +1370,7 @@ ScUndoRefreshLink::ScUndoRefreshLink( ScDocShell* pNewDocShell, ScDocument* pNewUndoDoc ) : ScSimpleUndo( pNewDocShell ), pUndoDoc( pNewUndoDoc ), - pRedoDoc( NULL ) + pRedoDoc( nullptr ) { } @@ -1489,7 +1489,7 @@ static ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const OUSt } OSL_FAIL("ScAreaLink not found"); - return NULL; + return nullptr; } ScUndoInsertAreaLink::ScUndoInsertAreaLink( ScDocShell* pShell, diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 205d90285751..6909e64c1ccf 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -86,8 +86,8 @@ ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell, nCol( nNewCol ), nRow( nNewRow ), nTab( nNewTab ), - pOldEditData( static_cast<EditTextObject*>(NULL) ), - pNewEditData( static_cast<EditTextObject*>(NULL) ), + pOldEditData( static_cast<EditTextObject*>(nullptr) ), + pNewEditData( static_cast<EditTextObject*>(nullptr) ), bIsAutomatic( bAutomatic ) { ScDocumentPool* pPool = pDocShell->GetDocument().GetPool(); @@ -125,7 +125,7 @@ void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern, const share rDoc.SetPattern( nCol, nRow, nTab, *pWhichPattern, true ); if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT && pEditData) - rDoc.SetEditText(aPos, *pEditData, NULL); + rDoc.SetEditText(aPos, *pEditData, nullptr); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) @@ -295,7 +295,7 @@ void ScUndoEnterData::Redo() ScAddress aPos = maPos; aPos.SetTab(nTab); // edit text wil be cloned. - rDoc.SetEditText(aPos, *mpNewEditData, NULL); + rDoc.SetEditText(aPos, *mpNewEditData, nullptr); } else rDoc.SetString(maPos.Col(), maPos.Row(), nTab, maNewString); @@ -871,7 +871,7 @@ ScUndoDetective::ScUndoDetective( ScDocShell* pNewDocShell, nAction ( 0 ), pDrawUndo ( pDraw ) { - bIsDelete = ( pOperation == NULL ); + bIsDelete = ( pOperation == nullptr ); if (!bIsDelete) { nAction = (sal_uInt16) pOperation->GetOperation(); diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index e35a15880b39..82e0a4c1ab40 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -741,7 +741,7 @@ ScUndoQuery::ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab, const ScQuery const ScRange* pOld, bool bSize, const ScRange* pAdvSrc ) : ScDBFuncUndo( pNewDocShell, ScRange( rParam.nCol1, rParam.nRow1, nNewTab, rParam.nCol2, rParam.nRow2, nNewTab ) ), - pDrawUndo( NULL ), + pDrawUndo( nullptr ), nTab( nNewTab ), aQueryParam( rParam ), pUndoDoc( pNewUndoDoc ), @@ -892,7 +892,7 @@ void ScUndoQuery::Redo() if ( bIsAdvanced ) pViewShell->Query( aQueryParam, &aAdvSource, false ); else - pViewShell->Query( aQueryParam, NULL, false ); + pViewShell->Query( aQueryParam, nullptr, false ); EndRedo(); } @@ -930,7 +930,7 @@ void ScUndoAutoFilter::DoChange( bool bUndo ) bool bNewFilter = bUndo ? !bFilterSet : bFilterSet; ScDocument& rDoc = pDocShell->GetDocument(); - ScDBData* pDBData=NULL; + ScDBData* pDBData=nullptr; if (aDBName == STR_DB_LOCAL_NONAME) { SCTAB nTab = aOriginalRange.aStart.Tab(); @@ -1096,7 +1096,7 @@ void ScUndoImportData::Undo() SCTAB nTable; SCCOL nCol1, nCol2; SCROW nRow1, nRow2; - ScDBData* pCurrentData = NULL; + ScDBData* pCurrentData = nullptr; if (pUndoDBData && pRedoDBData) { pRedoDBData->GetArea( nTable, nCol1, nRow1, nCol2, nRow2 ); @@ -1181,7 +1181,7 @@ void ScUndoImportData::Redo() SCTAB nTable; SCCOL nCol1, nCol2; SCROW nRow1, nRow2; - ScDBData* pCurrentData = NULL; + ScDBData* pCurrentData = nullptr; if (pUndoDBData && pRedoDBData) { pUndoDBData->GetArea( nTable, nCol1, nRow1, nCol2, nRow2 ); @@ -1431,8 +1431,8 @@ ScUndoDataPilot::ScUndoDataPilot( ScDocShell* pNewDocShell, ScSimpleUndo( pNewDocShell ), pOldUndoDoc( pOldDoc ), pNewUndoDoc( pNewDoc ), - pOldDPObject( NULL ), - pNewDPObject( NULL ), + pOldDPObject( nullptr ), + pNewDPObject( nullptr ), bAllowMove( bMove ) { if (pOldObj) @@ -1555,7 +1555,7 @@ void ScUndoDataPilot::Redo() ScDocument& rDoc = pDocShell->GetDocument(); - ScDPObject* pSourceObj = NULL; + ScDPObject* pSourceObj = nullptr; if ( pOldDPObject ) { // find object to modify @@ -1812,7 +1812,7 @@ ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell, pRedoDoc( pNewRedoDoc ), nFlags( nNewFlags ), pRefUndoData( pRefData ), - pRefRedoData( NULL ), + pRefRedoData( nullptr ), bRedoFilled( bRedoIsFilled ) { // pFill1,pFill2,pFill3 are there so the ctor calls for simple paste (without cutting) diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx index b46825de8bdc..4665a46a03d1 100644 --- a/sc/source/ui/undo/undodraw.cxx +++ b/sc/source/ui/undo/undodraw.cxx @@ -38,7 +38,7 @@ ScUndoDraw::~ScUndoDraw() void ScUndoDraw::ForgetDrawUndo() { - pDrawUndo = NULL; // do not delete (DrawUndo has to be remembered from outside) + pDrawUndo = nullptr; // do not delete (DrawUndo has to be remembered from outside) } OUString ScUndoDraw::GetComment() const diff --git a/sc/source/ui/undo/undoolk.cxx b/sc/source/ui/undo/undoolk.cxx index aaa8137c08e3..9d80fb1aa64f 100644 --- a/sc/source/ui/undo/undoolk.cxx +++ b/sc/source/ui/undo/undoolk.cxx @@ -29,7 +29,7 @@ SdrUndoAction* GetSdrUndoAction( ScDocument* pDoc ) if (pLayer) return pLayer->GetCalcUndo(); // must exist else - return NULL; + return nullptr; } void DoSdrUndoAction( SdrUndoAction* pUndoAction, ScDocument* pDoc ) diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx index f275cdc783f5..f3878487f050 100644 --- a/sc/source/ui/undo/undorangename.cxx +++ b/sc/source/ui/undo/undorangename.cxx @@ -95,7 +95,7 @@ ScUndoAddRangeData::~ScUndoAddRangeData() void ScUndoAddRangeData::Undo() { ScDocument& rDoc = pDocShell->GetDocument(); - ScRangeName* pRangeName = NULL; + ScRangeName* pRangeName = nullptr; if (mnTab == -1) { pRangeName = rDoc.GetRangeName(); @@ -112,7 +112,7 @@ void ScUndoAddRangeData::Undo() void ScUndoAddRangeData::Redo() { ScDocument& rDoc = pDocShell->GetDocument(); - ScRangeName* pRangeName = NULL; + ScRangeName* pRangeName = nullptr; if (mnTab == -1) { pRangeName = rDoc.GetRangeName(); diff --git a/sc/source/ui/undo/undosort.cxx b/sc/source/ui/undo/undosort.cxx index acdac407b085..7ca1aa485f2a 100644 --- a/sc/source/ui/undo/undosort.cxx +++ b/sc/source/ui/undo/undosort.cxx @@ -42,7 +42,7 @@ void UndoSort::Execute( bool bUndo ) sc::ReorderParam aParam = maParam; if (bUndo) aParam.reverse(); - rDoc.Reorder(aParam, NULL); + rDoc.Reorder(aParam, nullptr); if (maParam.mbHasHeaders) { diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index 6e9c5f61b902..a9a7102e91f7 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -35,7 +35,7 @@ TYPEINIT1(ScUndoApplyPageStyle, ScSimpleUndo); // modify style (cell or page style) ScStyleSaveData::ScStyleSaveData() : - pItems( NULL ) + pItems( nullptr ) { } @@ -46,7 +46,7 @@ ScStyleSaveData::ScStyleSaveData( const ScStyleSaveData& rOther ) : if (rOther.pItems) pItems = new SfxItemSet( *rOther.pItems ); else - pItems = NULL; + pItems = nullptr; } ScStyleSaveData::~ScStyleSaveData() @@ -63,7 +63,7 @@ ScStyleSaveData& ScStyleSaveData::operator=( const ScStyleSaveData& rOther ) if (rOther.pItems) pItems = new SfxItemSet( *rOther.pItems ); else - pItems = NULL; + pItems = nullptr; return *this; } @@ -127,7 +127,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName, bool bDelete = aNewName.isEmpty(); // no new name -> delete style bool bNew = ( rName.isEmpty() && !bDelete ); // creating new style - SfxStyleSheetBase* pStyle = NULL; + SfxStyleSheetBase* pStyle = nullptr; if ( !rName.isEmpty() ) { // find old style to modify diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 46862b68463f..ccfa2ee44234 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -81,7 +81,7 @@ ScUndoInsertTab::ScUndoInsertTab( ScDocShell* pNewDocShell, const OUString& rNewName) : ScSimpleUndo( pNewDocShell ), sNewName( rNewName ), - pDrawUndo( NULL ), + pDrawUndo( nullptr ), nTab( nTabNum ), bAppend( bApp ) { @@ -173,7 +173,7 @@ ScUndoInsertTables::ScUndoInsertTables( ScDocShell* pNewDocShell, SCTAB nTabNum, std::vector<OUString>& newNameList) : ScSimpleUndo( pNewDocShell ), - pDrawUndo( NULL ), + pDrawUndo( nullptr ), aNameList( newNameList ), nTab( nTabNum ) { @@ -592,7 +592,7 @@ ScUndoCopyTab::ScUndoCopyTab( mpOldTabs(pOldTabs), mpNewTabs(pNewTabs), mpNewNames(pNewNames), - pDrawUndo( NULL ) + pDrawUndo( nullptr ) { pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ); @@ -803,7 +803,7 @@ ScUndoMakeScenario::ScUndoMakeScenario( ScDocShell* pNewDocShell, aComment( rC ), aColor( rCol ), nFlags( nF ), - pDrawUndo( NULL ) + pDrawUndo( nullptr ) { pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ); } @@ -882,8 +882,8 @@ ScUndoImportTab::ScUndoImportTab( ScDocShell* pShell, ScSimpleUndo( pShell ), nTab( nNewTab ), nCount( nNewCount ), - pRedoDoc( NULL ), - pDrawUndo( NULL ) + pRedoDoc( nullptr ), + pDrawUndo( nullptr ) { pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ); } @@ -1206,7 +1206,7 @@ void ScUndoDocProtect::DoProtect(bool bProtect) else { // remove protection. - rDoc.SetDocProtection(NULL); + rDoc.SetDocProtection(nullptr); } ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); @@ -1274,7 +1274,7 @@ void ScUndoTabProtect::DoProtect(bool bProtect) else { // remove protection. - rDoc.SetTabProtection(mnTab, NULL); + rDoc.SetTabProtection(mnTab, nullptr); } ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); @@ -1494,7 +1494,7 @@ SdrObject* ScUndoRenameObject::GetObject() } } OSL_FAIL("Object not found"); - return NULL; + return nullptr; } void ScUndoRenameObject::Undo() diff --git a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx index d46429204041..f4686de887e9 100644 --- a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx +++ b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx @@ -69,7 +69,7 @@ void SAL_CALL ScChartRangeSelectionListener::disposing( const lang::EventObject& // ____ WeakComponentImplHelperBase ____ void SAL_CALL ScChartRangeSelectionListener::disposing() { - m_pViewShell = 0; + m_pViewShell = nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx index 9a8a759adf9c..12b41b92cbb0 100644 --- a/sc/source/ui/unoobj/addruno.cxx +++ b/sc/source/ui/unoobj/addruno.cxx @@ -53,7 +53,7 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint ); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // invalid + pDocShell = nullptr; // invalid } } diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index ab104f4a9ab0..c6230719b34c 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -186,7 +186,7 @@ ScAutoFormatObj* ScAutoFormatsObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) if (nIndex < ScGlobal::GetOrCreateAutoFormat()->size()) return new ScAutoFormatObj(nIndex); - return NULL; // falscher Index + return nullptr; // falscher Index } ScAutoFormatObj* ScAutoFormatsObj::GetObjectByName_Impl(const OUString& aName) @@ -196,7 +196,7 @@ ScAutoFormatObj* ScAutoFormatsObj::GetObjectByName_Impl(const OUString& aName) if (lcl_FindAutoFormatIndex( *ScGlobal::GetOrCreateAutoFormat(), aString, nIndex )) return GetObjectByIndex_Impl(nIndex); - return NULL; + return nullptr; } // container::XNameContainer @@ -420,7 +420,7 @@ const uno::Sequence<sal_Int8>& ScAutoFormatObj::getUnoTunnelId() ScAutoFormatObj* ScAutoFormatObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScAutoFormatObj* pRet = NULL; + ScAutoFormatObj* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScAutoFormatObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -439,7 +439,7 @@ ScAutoFormatFieldObj* ScAutoFormatObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) if ( IsInserted() && nIndex < SC_AF_FIELD_COUNT ) return new ScAutoFormatFieldObj( nFormatIndex, nIndex ); - return NULL; + return nullptr; } // container::XEnumerationAccess diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index 417a96e9f7d0..f5036f1b8f6d 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -98,7 +98,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sc_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { if (!pServiceManager) - return NULL; + return nullptr; uno::Reference<lang::XSingleServiceFactory> xFactory; OUString aImpl(OUString::createFromAscii(pImplName)); @@ -160,7 +160,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sc_component_getFactory( ScDocument_getSupportedServiceNames() )); } - void* pRet = NULL; + void* pRet = nullptr; if (xFactory.is()) { xFactory->acquire(); @@ -501,7 +501,7 @@ void SAL_CALL ScRecentFunctionsObj::setRecentFunctionIds( sal_uInt16 nCount = (sal_uInt16) std::min( aRecentFunctionIds.getLength(), (sal_Int32) LRU_MAX ); const sal_Int32* pAry = aRecentFunctionIds.getConstArray(); - std::unique_ptr<sal_uInt16[]> pFuncs(nCount ? new sal_uInt16[nCount] : NULL); + std::unique_ptr<sal_uInt16[]> pFuncs(nCount ? new sal_uInt16[nCount] : nullptr); for (sal_uInt16 i=0; i<nCount; i++) pFuncs[i] = (sal_uInt16)pAry[i]; //! auf gueltige Werte testen? diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 145ed0c048e2..6bb18847787a 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -935,12 +935,12 @@ const ::editeng::SvxBorderLine* lcl_getBorderLine( { // Convert from 1/100mm to Twips. if (!SvxBoxItem::LineToSvxLine( rStruct, rLine, true)) - return NULL; + return nullptr; if ( rLine.GetOutWidth() || rLine.GetInWidth() || rLine.GetDistance() ) return &rLine; else - return NULL; + return nullptr; } } @@ -1047,7 +1047,7 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r { ScDocument& rDoc = pDocShell->GetDocument(); bool bUndo(rDoc.IsUndoEnabled()); - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if (bUndo) pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); size_t nCount = rRanges.size(); @@ -1117,7 +1117,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, return false; } - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bUndo ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -1215,7 +1215,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, rDocShell.GetUndoManager()->AddUndoAction( new ScUndoPaste( &rDocShell, ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), - aDestMark, pUndoDoc, NULL, InsertDeleteFlags::CONTENTS, NULL, false)); + aDestMark, pUndoDoc, nullptr, InsertDeleteFlags::CONTENTS, nullptr, false)); } if (!bHeight) @@ -1256,7 +1256,7 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, return false; } - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bUndo ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -1316,7 +1316,7 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, rDocShell.GetUndoManager()->AddUndoAction( new ScUndoPaste( &rDocShell, ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), aDestMark, - pUndoDoc, NULL, InsertDeleteFlags::CONTENTS, NULL, false)); + pUndoDoc, nullptr, InsertDeleteFlags::CONTENTS, nullptr, false)); } if (!bHeight) @@ -1389,12 +1389,12 @@ static OUString lcl_GetInputString( ScDocument& rDoc, const ScAddress& rPos, boo ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR) : pPropSet(lcl_GetCellsPropertySet()), pDocShell( pDocSh ), - pValueListener( NULL ), - pCurrentFlat( NULL ), - pCurrentDeep( NULL ), - pCurrentDataSet( NULL ), - pNoDfltCurrentDataSet( NULL ), - pMarkData( NULL ), + pValueListener( nullptr ), + pCurrentFlat( nullptr ), + pCurrentDeep( nullptr ), + pCurrentDataSet( nullptr ), + pNoDfltCurrentDataSet( nullptr ), + pMarkData( nullptr ), nObjectId( 0 ), bChartColAsHdr( false ), bChartRowAsHdr( false ), @@ -1426,12 +1426,12 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR) : ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR) : pPropSet(lcl_GetCellsPropertySet()), pDocShell( pDocSh ), - pValueListener( NULL ), - pCurrentFlat( NULL ), - pCurrentDeep( NULL ), - pCurrentDataSet( NULL ), - pNoDfltCurrentDataSet( NULL ), - pMarkData( NULL ), + pValueListener( nullptr ), + pCurrentFlat( nullptr ), + pCurrentDeep( nullptr ), + pCurrentDataSet( nullptr ), + pNoDfltCurrentDataSet( nullptr ), + pMarkData( nullptr ), aRanges( rR ), nObjectId( 0 ), bChartColAsHdr( false ), @@ -1482,10 +1482,10 @@ void ScCellRangesBase::ForgetCurrentAttrs() delete pCurrentDeep; delete pCurrentDataSet; delete pNoDfltCurrentDataSet; - pCurrentFlat = NULL; - pCurrentDeep = NULL; - pCurrentDataSet = NULL; - pNoDfltCurrentDataSet = NULL; + pCurrentFlat = nullptr; + pCurrentDeep = nullptr; + pCurrentDataSet = nullptr; + pNoDfltCurrentDataSet = nullptr; // #i62483# pMarkData can remain unchanged, is deleted only if the range changes (RefChanged) } @@ -1493,7 +1493,7 @@ void ScCellRangesBase::ForgetCurrentAttrs() void ScCellRangesBase::ForgetMarkData() { delete pMarkData; - pMarkData = NULL; + pMarkData = nullptr; } const ScPatternAttr* ScCellRangesBase::GetCurrentAttrsFlat() @@ -1602,7 +1602,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( nId == SFX_HINT_DYING ) { ForgetCurrentAttrs(); - pDocShell = NULL; // invalid + pDocShell = nullptr; // invalid if ( !aValueListeners.empty() ) { @@ -1693,7 +1693,7 @@ ScDocument* ScCellRangesBase::GetDocument() const if (pDocShell) return &pDocShell->GetDocument(); else - return NULL; + return nullptr; } void ScCellRangesBase::InitInsertRange(ScDocShell* pDocSh, const ScRange& rR) @@ -3069,7 +3069,7 @@ ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const return aArr.CreateMemChart(); } - return NULL; + return nullptr; } uno::Sequence< uno::Sequence<double> > SAL_CALL ScCellRangesBase::getData() @@ -3473,7 +3473,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC SCCOL nCol = 0, nLastCol; while (nCol <= MAXCOL) { - if (rDoc.ColHidden(nCol, nTab, NULL, &nLastCol)) + if (rDoc.ColHidden(nCol, nTab, nullptr, &nLastCol)) // hidden columns. Unselect them. aMarkData.SetMultiMarkArea(ScRange(nCol, 0, nTab, nLastCol, MAXROW, nTab), false); @@ -3483,7 +3483,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC SCROW nRow = 0, nLastRow; while (nRow <= MAXROW) { - if (rDoc.RowHidden(nRow, nTab, NULL, &nLastRow)) + if (rDoc.RowHidden(nRow, nTab, nullptr, &nLastRow)) // These rows are hidden. Unselect them. aMarkData.SetMultiMarkArea(ScRange(0, nRow, nTab, MAXCOL, nLastRow, nTab), false); @@ -3495,7 +3495,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC return new ScCellRangesObj( pDocShell, aNewRanges ); } - return NULL; + return nullptr; } uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCells() @@ -3530,7 +3530,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein } - return NULL; + return nullptr; } uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentCells( @@ -3610,7 +3610,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein } - return NULL; + return nullptr; } uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaCells( @@ -3665,7 +3665,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein } - return NULL; + return nullptr; } uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl( @@ -3749,7 +3749,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl( return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein } - return NULL; + return nullptr; } uno::Reference<sheet::XSheetCellRanges > SAL_CALL ScCellRangesBase::queryColumnDifferences( @@ -3837,7 +3837,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPreceden return new ScCellRangesObj( pDocShell, aNewRanges ); } - return NULL; + return nullptr; } uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependents( @@ -3896,7 +3896,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen return new ScCellRangesObj( pDocShell, aNewRanges ); } - return NULL; + return nullptr; } // XSearchable @@ -4000,7 +4000,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScCellRangesBase::findFirst( throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - return Find_Impl( xDesc, NULL ); + return Find_Impl( xDesc, nullptr ); } uno::Reference<uno::XInterface> SAL_CALL ScCellRangesBase::findNext( @@ -4022,7 +4022,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScCellRangesBase::findNext( } } } - return NULL; + return nullptr; } // XReplaceable @@ -4073,7 +4073,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea SCROW nRow = 0; OUString aUndoStr; - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if (bUndo) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -4143,7 +4143,7 @@ const uno::Sequence<sal_Int8>& ScCellRangesBase::getUnoTunnelId() ScCellRangesBase* ScCellRangesBase::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScCellRangesBase* pRet = NULL; + ScCellRangesBase* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScCellRangesBase*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -4241,7 +4241,7 @@ ScCellRangeObj* ScCellRangesObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const return new ScCellRangeObj( pDocSh, aRange ); } - return NULL; // keine DocShell oder falscher Index + return nullptr; // keine DocShell oder falscher Index } uno::Sequence<table::CellRangeAddress> SAL_CALL ScCellRangesObj::getRangeAddresses() @@ -4281,7 +4281,7 @@ uno::Reference<container::XEnumerationAccess> SAL_CALL ScCellRangesObj::getCells ScDocShell* pDocSh = GetDocShell(); if (pDocSh) return new ScCellsObj( pDocSh, rRanges ); - return NULL; + return nullptr; } OUString SAL_CALL ScCellRangesObj::getRangeAddressesAsString() @@ -4777,7 +4777,7 @@ uno::Reference<table::XCellRange> ScCellRangeObj::CreateRangeFromDoc( ScDocument SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr ) return new ScCellRangeObj( static_cast<ScDocShell*>(pObjSh), rR ); - return NULL; + return nullptr; } ScCellRangeObj::ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR) : @@ -5018,7 +5018,7 @@ uno::Reference<table::XTableColumns> SAL_CALL ScCellRangeObj::getColumns() throw aRange.aStart.Col(), aRange.aEnd.Col() ); OSL_FAIL("Dokument ungueltig"); - return NULL; + return nullptr; } uno::Reference<table::XTableRows> SAL_CALL ScCellRangeObj::getRows() throw(uno::RuntimeException, std::exception) @@ -5030,7 +5030,7 @@ uno::Reference<table::XTableRows> SAL_CALL ScCellRangeObj::getRows() throw(uno:: aRange.aStart.Row(), aRange.aEnd.Row() ); OSL_FAIL("Dokument ungueltig"); - return NULL; + return nullptr; } // XAddressableCellRange @@ -5054,7 +5054,7 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScCellRangeObj::getSpreadsheet() return new ScTableSheetObj( pDocSh, aRange.aStart.Tab() ); OSL_FAIL("Dokument ungueltig"); - return NULL; + return nullptr; } // XArrayFormulaRange @@ -5106,7 +5106,7 @@ void ScCellRangeObj::SetArrayFormula_Impl(const OUString& rFormula, throw uno::RuntimeException(); } - pDocSh->GetDocFunc().EnterMatrix( aRange, NULL, NULL, rFormula, true, true, rFormulaNmsp, eGrammar ); + pDocSh->GetDocFunc().EnterMatrix( aRange, nullptr, nullptr, rFormula, true, true, rFormulaNmsp, eGrammar ); } else { @@ -5183,7 +5183,7 @@ void SAL_CALL ScCellRangeObj::setArrayTokens( const uno::Sequence<sheet::Formula // Actually GRAM_PODF_A1 is a don't-care here because of the token // array being set, it fits with other API compatibility grammars // though. - pDocSh->GetDocFunc().EnterMatrix( aRange, NULL, &aTokenArray, EMPTY_OUSTRING, true, true, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); + pDocSh->GetDocFunc().EnterMatrix( aRange, nullptr, &aTokenArray, EMPTY_OUSTRING, true, true, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); } else { @@ -5349,7 +5349,7 @@ void SAL_CALL ScCellRangeObj::setTableOperation( const table::CellRangeAddress& } if (!bError) - pDocSh->GetDocFunc().TabOp( aRange, NULL, aParam, true, true ); + pDocSh->GetDocFunc().TabOp( aRange, nullptr, aParam, true, true ); } } @@ -5454,7 +5454,7 @@ void SAL_CALL ScCellRangeObj::fillSeries( sheet::FillDirection nFillDirection, } if (!bError) - pDocSh->GetDocFunc().FillSeries( aRange, NULL, eDir, eCmd, eDateCmd, + pDocSh->GetDocFunc().FillSeries( aRange, nullptr, eDir, eCmd, eDateCmd, MAXDOUBLE, fStep, fEndValue, true, true ); } } @@ -5499,7 +5499,7 @@ void SAL_CALL ScCellRangeObj::fillAuto( sheet::FillDirection nFillDirection, bError = true; if (!bError) - pDocSh->GetDocFunc().FillAuto( aSourceRange, NULL, eDir, nCount, true, true ); + pDocSh->GetDocFunc().FillAuto( aSourceRange, nullptr, eDir, nCount, true, true ); } } @@ -5518,7 +5518,7 @@ void SAL_CALL ScCellRangeObj::autoFormat( const OUString& aName ) { ScAutoFormat::const_iterator itBeg = pAutoFormat->begin(); size_t nIndex = std::distance(itBeg, it); - pDocSh->GetDocFunc().AutoFormat(aRange, NULL, nIndex, true, true); + pDocSh->GetDocFunc().AutoFormat(aRange, nullptr, nIndex, true, true); } else throw lang::IllegalArgumentException(); @@ -5707,7 +5707,7 @@ void SAL_CALL ScCellRangeObj::filter( const uno::Reference<sheet::XSheetFilterDe //! if created by createFilterDescriptorByObject ??? ScDBDocFunc aFunc(*pDocSh); - aFunc.Query( nTab, aParam, NULL, true, true ); // Bereich muss angelegt sein + aFunc.Query( nTab, aParam, nullptr, true, true ); // Bereich muss angelegt sein } } @@ -5768,12 +5768,12 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil else { delete pNew; - return NULL; // ungueltig -> null + return nullptr; // ungueltig -> null } } OSL_FAIL("kein Dokument oder kein Bereich"); - return NULL; + return nullptr; } // XSubTotalSource @@ -5854,7 +5854,7 @@ void SAL_CALL ScCellRangeObj::applySubTotals( pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK ); // ggf. Bereich anlegen ScDBDocFunc aFunc(*pDocSh); - aFunc.DoSubTotals( nTab, aParam, NULL, true, true ); // Bereich muss angelegt sein + aFunc.DoSubTotals( nTab, aParam, nullptr, true, true ); // Bereich muss angelegt sein } } @@ -5881,7 +5881,7 @@ void SAL_CALL ScCellRangeObj::removeSubTotals() throw(uno::RuntimeException, std pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK ); // ggf. Bereich anlegen ScDBDocFunc aFunc(*pDocSh); - aFunc.DoSubTotals( nTab, aParam, NULL, true, true ); // Bereich muss angelegt sein + aFunc.DoSubTotals( nTab, aParam, nullptr, true, true ); // Bereich muss angelegt sein } } @@ -5925,7 +5925,7 @@ void SAL_CALL ScCellRangeObj::doImport( const uno::Sequence<beans::PropertyValue pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK ); // ggf. Bereich anlegen ScDBDocFunc aFunc(*pDocSh); // Bereich muss angelegt sein - aFunc.DoImport( nTab, aParam, NULL, true ); //! Api-Flag as parameter + aFunc.DoImport( nTab, aParam, nullptr, true ); //! Api-Flag as parameter } } @@ -5938,7 +5938,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangeObj::getCellFormatRa ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) return new ScCellFormatsObj( pDocSh, aRange ); - return NULL; + return nullptr; } // XUniqueCellFormatRangesSupplier @@ -5950,7 +5950,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangeObj::getUniqueCellFo ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) return new ScUniqueCellFormatsObj( pDocSh, aRange ); - return NULL; + return nullptr; } // XPropertySet erweitert fuer Range-Properties @@ -6619,7 +6619,7 @@ uno::Reference<sheet::XSheetAnnotation> SAL_CALL ScCellObj::getAnnotation() return new ScAnnotationObj( pDocSh, aCellPos ); OSL_FAIL("getAnnotation ohne DocShell"); - return NULL; + return nullptr; } // XFieldTypesSupplier @@ -6635,14 +6635,14 @@ uno::Reference<container::XEnumerationAccess> SAL_CALL ScCellObj::getTextFields( return new ScCellFieldsObj(xContent, pDocSh, aCellPos); } - return NULL; + return nullptr; } uno::Reference<container::XNameAccess> SAL_CALL ScCellObj::getTextFieldMasters() throw(uno::RuntimeException, std::exception) { // sowas gibts nicht im Calc (?) - return NULL; + return nullptr; } // XPropertySet erweitert fuer Zell-Properties @@ -6928,7 +6928,7 @@ uno::Reference<table::XTableCharts> SAL_CALL ScTableSheetObj::getCharts() throw( return new ScChartsObj( pDocSh, GetTab_Impl() ); OSL_FAIL("kein Dokument"); - return NULL; + return nullptr; } uno::Reference<sheet::XDataPilotTables> SAL_CALL ScTableSheetObj::getDataPilotTables() @@ -6940,7 +6940,7 @@ uno::Reference<sheet::XDataPilotTables> SAL_CALL ScTableSheetObj::getDataPilotTa return new ScDataPilotTablesObj( pDocSh, GetTab_Impl() ); OSL_FAIL("kein Dokument"); - return NULL; + return nullptr; } uno::Reference<sheet::XScenarios> SAL_CALL ScTableSheetObj::getScenarios() throw(uno::RuntimeException, std::exception) @@ -6952,7 +6952,7 @@ uno::Reference<sheet::XScenarios> SAL_CALL ScTableSheetObj::getScenarios() throw return new ScScenariosObj( pDocSh, GetTab_Impl() ); OSL_FAIL("kein Dokument"); - return NULL; + return nullptr; } uno::Reference<sheet::XSheetAnnotations> SAL_CALL ScTableSheetObj::getAnnotations() @@ -6965,7 +6965,7 @@ uno::Reference<sheet::XSheetAnnotations> SAL_CALL ScTableSheetObj::getAnnotation return new ScAnnotationsObj( pDocSh, GetTab_Impl() ); OSL_FAIL("kein Dokument"); - return NULL; + return nullptr; } uno::Reference<table::XCellRange> SAL_CALL ScTableSheetObj::getCellRangeByName( @@ -6986,7 +6986,7 @@ uno::Reference<sheet::XSheetCellCursor> SAL_CALL ScTableSheetObj::createCursor() SCTAB nTab = GetTab_Impl(); return new ScCellCursorObj( pDocSh, ScRange( 0,0,nTab, MAXCOL,MAXROW,nTab ) ); } - return NULL; + return nullptr; } uno::Reference<sheet::XSheetCellCursor> SAL_CALL ScTableSheetObj::createCursorByRange( @@ -7005,7 +7005,7 @@ uno::Reference<sheet::XSheetCellCursor> SAL_CALL ScTableSheetObj::createCursorBy return new ScCellCursorObj( pDocSh, *rRanges[ 0 ] ); } } - return NULL; + return nullptr; } // XSheetCellRange @@ -7180,7 +7180,7 @@ uno::Reference<drawing::XDrawPage> SAL_CALL ScTableSheetObj::getDrawPage() // Das DrawPage-Objekt meldet sich als Listener am SdrModel an // und sollte von dort alle Aktionen mitbekommen } - return NULL; + return nullptr; } // XCellMovement @@ -7211,7 +7211,7 @@ void SAL_CALL ScTableSheetObj::insertCells( const table::CellRangeAddress& rRang OSL_ENSURE( rRangeAddress.Sheet == GetTab_Impl(), "falsche Tabelle in CellRangeAddress" ); ScRange aScRange; ScUnoConversion::FillScRange( aScRange, rRangeAddress ); - pDocSh->GetDocFunc().InsertCells( aScRange, NULL, eCmd, true, true ); + pDocSh->GetDocFunc().InsertCells( aScRange, nullptr, eCmd, true, true ); } } } @@ -7242,7 +7242,7 @@ void SAL_CALL ScTableSheetObj::removeRange( const table::CellRangeAddress& rRang OSL_ENSURE( rRangeAddress.Sheet == GetTab_Impl(), "falsche Tabelle in CellRangeAddress" ); ScRange aScRange; ScUnoConversion::FillScRange( aScRange, rRangeAddress ); - pDocSh->GetDocFunc().DeleteCells( aScRange, NULL, eCmd, true, true ); + pDocSh->GetDocFunc().DeleteCells( aScRange, nullptr, eCmd, true, true ); } } } @@ -7302,7 +7302,7 @@ void ScTableSheetObj::PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges ) rDoc.CreatePrintRangeSaver())); // create new ranges // #i120105# ownership of old ranges has changed, mark as consumed - pOldRanges = 0; + pOldRanges = nullptr; } ScPrintFunc(pDocSh, pDocSh->GetPrinter(), nTab).UpdatePages(); @@ -7358,7 +7358,7 @@ void SAL_CALL ScTableSheetObj::setPrintAreas( ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) { - ScPrintRangeSaver* pOldRanges = NULL; + ScPrintRangeSaver* pOldRanges = nullptr; ScDocument& rDoc = pDocSh->GetDocument(); SCTAB nTab = GetTab_Impl(); @@ -7391,7 +7391,7 @@ sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleColumns() throw(uno::RuntimeExce { ScDocument& rDoc = pDocSh->GetDocument(); SCTAB nTab = GetTab_Impl(); - return ( rDoc.GetRepeatColRange(nTab) != NULL ); + return ( rDoc.GetRepeatColRange(nTab) != nullptr ); } return false; } @@ -7417,7 +7417,7 @@ void SAL_CALL ScTableSheetObj::setPrintTitleColumns( sal_Bool bPrintTitleColumns } } else - rDoc.SetRepeatColRange( nTab, NULL ); // abschalten + rDoc.SetRepeatColRange( nTab, nullptr ); // abschalten PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. @@ -7472,7 +7472,7 @@ sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleRows() throw(uno::RuntimeExcepti { ScDocument& rDoc = pDocSh->GetDocument(); SCTAB nTab = GetTab_Impl(); - return ( rDoc.GetRepeatRowRange(nTab) != NULL ); + return ( rDoc.GetRepeatRowRange(nTab) != nullptr ); } return false; } @@ -7498,7 +7498,7 @@ void SAL_CALL ScTableSheetObj::setPrintTitleRows( sal_Bool bPrintTitleRows ) } } else - rDoc.SetRepeatRowRange( nTab, NULL ); // abschalten + rDoc.SetRepeatRowRange( nTab, nullptr ); // abschalten PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. @@ -8098,7 +8098,7 @@ uno::Reference<container::XNameReplace> SAL_CALL ScTableSheetObj::getEvents() th if ( pDocSh ) return new ScSheetEventsObj( pDocSh, GetTab_Impl() ); - return NULL; + return nullptr; } // XPropertySet erweitert fuer Sheet-Properties @@ -8662,7 +8662,7 @@ const uno::Sequence<sal_Int8>& ScTableSheetObj::getUnoTunnelId() ScTableSheetObj* ScTableSheetObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScTableSheetObj* pRet = NULL; + ScTableSheetObj* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScTableSheetObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -9049,7 +9049,7 @@ void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -9061,7 +9061,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScCellsObj::createEnumeration() SolarMutexGuard aGuard; if (pDocShell) return new ScCellsEnumeration( pDocShell, aRanges ); - return NULL; + return nullptr; } uno::Type SAL_CALL ScCellsObj::getElementType() throw(uno::RuntimeException, std::exception) @@ -9087,7 +9087,7 @@ sal_Bool SAL_CALL ScCellsObj::hasElements() throw(uno::RuntimeException, std::ex ScCellsEnumeration::ScCellsEnumeration(ScDocShell* pDocSh, const ScRangeList& rR) : pDocShell( pDocSh ), aRanges( rR ), - pMark( NULL ), + pMark( nullptr ), bAtEnd( false ) { ScDocument& rDoc = pDocShell->GetDocument(); @@ -9168,7 +9168,7 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint ) pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() ); delete pMark; // aus verschobenen Bereichen neu erzeugen - pMark = NULL; + pMark = nullptr; if (!bAtEnd) // aPos anpassen { @@ -9187,7 +9187,7 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -9242,7 +9242,7 @@ void ScCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -9250,7 +9250,7 @@ ScCellRangeObj* ScCellFormatsObj::GetObjectByIndex_Impl(long nIndex) const { //! direkt auf die AttrArrays zugreifen !!!! - ScCellRangeObj* pRet = NULL; + ScCellRangeObj* pRet = nullptr; if (pDocShell) { ScDocument& rDoc = pDocShell->GetDocument(); @@ -9334,13 +9334,13 @@ uno::Reference<container::XEnumeration> SAL_CALL ScCellFormatsObj::createEnumera SolarMutexGuard aGuard; if (pDocShell) return new ScCellFormatsEnumeration( pDocShell, aTotalRange ); - return NULL; + return nullptr; } ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScRange& rRange) : pDocShell( pDocSh ), nTab( rRange.aStart.Tab() ), - pIter( NULL ), + pIter( nullptr ), bAtEnd( false ), bDirty( false ) { @@ -9390,7 +9390,7 @@ void ScCellFormatsEnumeration::Advance_Impl() ScCellRangeObj* ScCellFormatsEnumeration::NextObject_Impl() { - ScCellRangeObj* pRet = NULL; + ScCellRangeObj* pRet = nullptr; if (pDocShell && !bAtEnd) { if ( aNext.aStart == aNext.aEnd ) @@ -9413,9 +9413,9 @@ void ScCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint ) sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden delete pIter; - pIter = NULL; + pIter = nullptr; } else if ( nId == SFX_HINT_DATACHANGED ) { @@ -9475,7 +9475,7 @@ void ScUniqueCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) { sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -9704,7 +9704,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScUniqueCellFormatsObj::createE SolarMutexGuard aGuard; if (pDocShell) return new ScUniqueCellFormatsEnumeration( pDocShell, aRangeLists ); - return NULL; + return nullptr; } ScUniqueCellFormatsEnumeration::ScUniqueCellFormatsEnumeration(ScDocShell* pDocSh, const ScMyRangeLists& rRangeLists) : @@ -9733,7 +9733,7 @@ void ScUniqueCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHi { sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index fb4746c0ce0d..0ef1b0e2707f 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -140,7 +140,7 @@ OUString lcl_createTableNumberList( const ::std::list< SCTAB > & rTableList ) uno::Reference< frame::XModel > lcl_GetXModel( ScDocument * pDoc ) { uno::Reference< frame::XModel > xModel; - SfxObjectShell * pObjSh( pDoc ? pDoc->GetDocumentShell() : 0 ); + SfxObjectShell * pObjSh( pDoc ? pDoc->GetDocumentShell() : nullptr ); if( pObjSh ) xModel.set( pObjSh->GetModel()); return xModel; @@ -1587,7 +1587,7 @@ ScChart2DataProvider::createDataSource( if( nOldIndex < aSeqVector.size() ) { pDS->AddLabeledSequence( aSeqVector[nOldIndex] ); - aSeqVector[nOldIndex] = 0; + aSeqVector[nOldIndex] = nullptr; } } diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 58fc2584e4c6..f5a09a4b94ce 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -84,7 +84,7 @@ static SdrOle2Obj* lcl_FindChartObj( ScDocShell* pDocShell, SCTAB nTab, const OU } } } - return NULL; + return nullptr; } ScChartsObj::ScChartsObj(ScDocShell* pDocSh, SCTAB nT) : @@ -109,7 +109,7 @@ void ScChartsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -150,14 +150,14 @@ ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const if (!aName.isEmpty()) return new ScChartObj( pDocShell, nTab, aName ); - return NULL; + return nullptr; } ScChartObj* ScChartsObj::GetObjectByName_Impl(const OUString& aName) const { if ( lcl_FindChartObj( pDocShell, nTab, aName ) ) return new ScChartObj( pDocShell, nTab, aName ); - return NULL; + return nullptr; } // XTableCharts @@ -437,7 +437,7 @@ sal_Bool SAL_CALL ScChartsObj::hasByName( const OUString& aName ) throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - return ( lcl_FindChartObj( pDocShell, nTab, aName ) != NULL ); + return ( lcl_FindChartObj( pDocShell, nTab, aName ) != nullptr ); } ScChartObj::ScChartObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN) @@ -470,7 +470,7 @@ void ScChartObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -528,7 +528,7 @@ void ScChartObj::GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool& } if( !bFound ) { - rRanges = 0; + rRanges = nullptr; rColHeaders = false; rRowHeaders = false; } @@ -770,7 +770,7 @@ uno::Reference<lang::XComponent> SAL_CALL ScChartObj::getEmbeddedObject() throw( return uno::Reference < lang::XComponent > ( pObject->GetObjRef()->getComponent(), uno::UNO_QUERY ); } - return NULL; + return nullptr; } // XNamed diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx index e561ddfa1158..ef9542e5ea83 100644 --- a/sc/source/ui/unoobj/condformatuno.cxx +++ b/sc/source/ui/unoobj/condformatuno.cxx @@ -327,7 +327,7 @@ void ScCondFormatsObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - mpDocShell = NULL; // ungueltig geworden + mpDocShell = nullptr; // ungueltig geworden } } @@ -477,7 +477,7 @@ void ScCondFormatObj::createEntry(const sal_Int32 nType, const sal_Int32 nPos) if (nPos > sal_Int32(pFormat->size())) throw lang::IllegalArgumentException(); - ScFormatEntry* pNewEntry = NULL; + ScFormatEntry* pNewEntry = nullptr; ScDocument* pDoc = &mpDocShell->GetDocument(); switch (nType) { diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index e4ff166f8e79..ff102347e5b7 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -104,7 +104,7 @@ void ScDocumentConfiguration::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index b5e43b94e4cc..8958182dbaf6 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -248,7 +248,7 @@ static ScDPObject* lcl_GetDPObject( ScDocShell* pDocShell, SCTAB nTab, const OUS } } } - return NULL; // nicht gefunden + return nullptr; // nicht gefunden } static OUString lcl_CreatePivotName( ScDocShell* pDocShell ) @@ -302,7 +302,7 @@ void ScDataPilotTablesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -334,14 +334,14 @@ ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByIndex_Impl( sal_Int32 nInd } } } - return NULL; + return nullptr; } ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByName_Impl(const OUString& rName) { if (hasByName(rName)) return new ScDataPilotTableObj( pDocShell, nTab, rName ); - return 0; + return nullptr; } Reference<XDataPilotDescriptor> SAL_CALL ScDataPilotTablesObj::createDataPilotDescriptor() @@ -350,7 +350,7 @@ Reference<XDataPilotDescriptor> SAL_CALL ScDataPilotTablesObj::createDataPilotDe SolarMutexGuard aGuard; if (pDocShell) return new ScDataPilotDescriptor(pDocShell); - return NULL; + return nullptr; } static bool lcl_IsDuplicated(const Reference<XPropertySet>& rDimProps) @@ -647,7 +647,7 @@ void ScDataPilotDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -1045,7 +1045,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotDescriptorBase::getDataLayoutFi } } } - return 0; + return nullptr; } // XUnoTunnel @@ -1074,7 +1074,7 @@ const Sequence<sal_Int8>& ScDataPilotDescriptorBase::getUnoTunnelId() ScDataPilotDescriptorBase* ScDataPilotDescriptorBase::getImplementation(const Reference<XDataPilotDescriptor>& rObj ) { - ScDataPilotDescriptorBase* pRet = NULL; + ScDataPilotDescriptorBase* pRet = nullptr; Reference<lang::XUnoTunnel> xUT(rObj, UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScDataPilotDescriptorBase*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -1379,7 +1379,7 @@ void ScDataPilotTableObj::Refreshed_Impl() ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) : ScDataPilotDescriptorBase( pDocSh ), - mpDPObject(new ScDPObject(pDocSh ? &pDocSh->GetDocument() : NULL) ) + mpDPObject(new ScDPObject(pDocSh ? &pDocSh->GetDocument() : nullptr) ) { ScDPSaveData aSaveData; // set defaults like in ScPivotParam constructor @@ -1388,7 +1388,7 @@ ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) : aSaveData.SetIgnoreEmptyRows( false ); aSaveData.SetRepeatIfEmpty( false ); mpDPObject->SetSaveData(aSaveData); - ScSheetSourceDesc aSheetDesc(pDocSh ? &pDocSh->GetDocument() : NULL); + ScSheetSourceDesc aSheetDesc(pDocSh ? &pDocSh->GetDocument() : nullptr); mpDPObject->SetSheetDesc(aSheetDesc); mpDPObject->GetSource(); } @@ -1501,7 +1501,7 @@ ScDPSaveDimension* ScDataPilotChildObjBase::GetDPDimension( ScDPObject** ppDPObj } } } - return 0; + return nullptr; } sal_Int32 ScDataPilotChildObjBase::GetMemberCount() const @@ -1693,7 +1693,7 @@ ScDataPilotFieldObj* ScDataPilotFieldsObj::GetObjectByIndex_Impl( sal_Int32 nInd if (lcl_GetFieldDataByIndex( pObj->GetSource(), maOrient, nIndex, aFieldId )) return new ScDataPilotFieldObj( mrParent, aFieldId, maOrient ); } - return 0; + return nullptr; } ScDataPilotFieldObj* ScDataPilotFieldsObj::GetObjectByName_Impl(const OUString& aName) const @@ -1704,7 +1704,7 @@ ScDataPilotFieldObj* ScDataPilotFieldsObj::GetObjectByName_Impl(const OUString& if (lcl_GetFieldDataByName( pDPObj, aName, aFieldId )) return new ScDataPilotFieldObj( mrParent, aFieldId, maOrient ); } - return 0; + return nullptr; } // XEnumerationAccess @@ -1787,7 +1787,7 @@ sal_Bool SAL_CALL ScDataPilotFieldsObj::hasByName( const OUString& aName ) { SolarMutexGuard aGuard; - return GetObjectByName_Impl(aName) != NULL; + return GetObjectByName_Impl(aName) != nullptr; } ScDataPilotFieldObj::ScDataPilotFieldObj( @@ -1835,7 +1835,7 @@ void SAL_CALL ScDataPilotFieldObj::setName(const OUString& rName) throw (RuntimeException, std::exception) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ); if( pDim && !pDim->IsDataLayout() ) { @@ -1895,7 +1895,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa else if ( aNameString == SC_UNONAME_HASAUTOSHOW ) { if (!cppu::any2bool(aValue)) - setAutoShowInfo(NULL); + setAutoShowInfo(nullptr); } else if ( aNameString == SC_UNONAME_AUTOSHOW ) { @@ -1906,7 +1906,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa else if ( aNameString == SC_UNONAME_HASLAYOUTINFO ) { if (!cppu::any2bool(aValue)) - setLayoutInfo(NULL); + setLayoutInfo(nullptr); } else if ( aNameString == SC_UNONAME_LAYOUTINFO ) { @@ -1917,7 +1917,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa else if ( aNameString == SC_UNONAME_HASREFERENCE ) { if (!cppu::any2bool(aValue)) - setReference(NULL); + setReference(nullptr); } else if ( aNameString == SC_UNONAME_REFERENCE ) { @@ -1928,7 +1928,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa else if ( aNameString == SC_UNONAME_HASSORTINFO ) { if (!cppu::any2bool(aValue)) - setSortInfo(NULL); + setSortInfo(nullptr); } else if ( aNameString == SC_UNONAME_SORTINFO ) { @@ -1939,7 +1939,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa else if ( aNameString == SC_UNONAME_ISGROUP ) { if (!cppu::any2bool(aValue)) - setGroupInfo(NULL); + setGroupInfo(nullptr); } else if ( aNameString == SC_UNONAME_GROUPINFO ) { @@ -1976,7 +1976,7 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam else if ( aNameString == SC_UNONAME_USESELPAGE ) aRet <<= false; else if ( aNameString == SC_UNONAME_HASAUTOSHOW ) - aRet <<= (getAutoShowInfo() != NULL); + aRet <<= (getAutoShowInfo() != nullptr); else if ( aNameString == SC_UNONAME_AUTOSHOW ) { const DataPilotFieldAutoShowInfo* pInfo = getAutoShowInfo(); @@ -1984,7 +1984,7 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam aRet <<= DataPilotFieldAutoShowInfo(*pInfo); } else if ( aNameString == SC_UNONAME_HASLAYOUTINFO ) - aRet <<= (getLayoutInfo() != NULL); + aRet <<= (getLayoutInfo() != nullptr); else if ( aNameString == SC_UNONAME_LAYOUTINFO ) { const DataPilotFieldLayoutInfo* pInfo = getLayoutInfo(); @@ -1992,7 +1992,7 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam aRet <<= DataPilotFieldLayoutInfo(*pInfo); } else if ( aNameString == SC_UNONAME_HASREFERENCE ) - aRet <<= (getReference() != NULL); + aRet <<= (getReference() != nullptr); else if ( aNameString == SC_UNONAME_REFERENCE ) { const DataPilotFieldReference* pRef = getReference(); @@ -2000,7 +2000,7 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam aRet <<= DataPilotFieldReference(*pRef); } else if ( aNameString == SC_UNONAME_HASSORTINFO ) - aRet <<= (getSortInfo() != NULL); + aRet <<= (getSortInfo() != nullptr); else if ( aNameString == SC_UNONAME_SORTINFO ) { const DataPilotFieldSortInfo* pInfo = getSortInfo(); @@ -2047,7 +2047,7 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew) if (maOrient.hasValue() && (eNew == maOrient.get< DataPilotFieldOrientation >())) return; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { ScDPSaveData* pSaveData = pDPObj->GetSaveData(); @@ -2060,7 +2060,7 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew) (eNew == DataPilotFieldOrientation_DATA) ) { - ScDPSaveDimension* pNewDim = 0; + ScDPSaveDimension* pNewDim = nullptr; // look for existing duplicate with orientation "hidden" @@ -2118,14 +2118,14 @@ GeneralFunction ScDataPilotFieldObj::getFunction() const void ScDataPilotFieldObj::setFunction(GeneralFunction eNewFunc) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { if( pDim->GetOrientation() != DataPilotFieldOrientation_DATA ) { // for non-data fields, property Function is the subtotals if ( eNewFunc == GeneralFunction_NONE ) - pDim->SetSubTotals( 0, NULL ); + pDim->SetSubTotals( 0, nullptr ); else { sal_uInt16 nFunc = sal::static_int_cast<sal_uInt16>( eNewFunc ); @@ -2162,7 +2162,7 @@ Sequence< GeneralFunction > ScDataPilotFieldObj::getSubtotals() const void ScDataPilotFieldObj::setSubtotals( const Sequence< GeneralFunction >& rSubtotals ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { if( pDim->GetOrientation() != DataPilotFieldOrientation_DATA ) @@ -2172,7 +2172,7 @@ void ScDataPilotFieldObj::setSubtotals( const Sequence< GeneralFunction >& rSubt { // count 1: all values are allowed (including NONE and AUTO) if( rSubtotals[ 0 ] == GeneralFunction_NONE ) - pDim->SetSubTotals( 0, NULL ); + pDim->SetSubTotals( 0, nullptr ); else { sal_uInt16 nFunc = sal::static_int_cast<sal_uInt16>( rSubtotals[ 0 ] ); @@ -2196,7 +2196,7 @@ void ScDataPilotFieldObj::setSubtotals( const Sequence< GeneralFunction >& rSubt } // set values from vector to ScDPSaveDimension if ( aSubt.empty() ) - pDim->SetSubTotals( 0, NULL ); + pDim->SetSubTotals( 0, nullptr ); else pDim->SetSubTotals( static_cast< long >( aSubt.size() ), &aSubt.front() ); } @@ -2213,7 +2213,7 @@ OUString ScDataPilotFieldObj::getCurrentPage() void ScDataPilotFieldObj::setCurrentPage( const OUString& rPage ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { pDim->SetCurrentPage( &rPage ); @@ -2224,7 +2224,7 @@ void ScDataPilotFieldObj::setCurrentPage( const OUString& rPage ) void ScDataPilotFieldObj::setUseCurrentPage( bool bUse ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { if( bUse ) @@ -2235,7 +2235,7 @@ void ScDataPilotFieldObj::setUseCurrentPage( bool bUse ) pDim->SetCurrentPage( &aPage ); } else - pDim->SetCurrentPage( 0 ); + pDim->SetCurrentPage( nullptr ); SetDPObject( pDPObj ); } } @@ -2244,13 +2244,13 @@ const DataPilotFieldAutoShowInfo* ScDataPilotFieldObj::getAutoShowInfo() { SolarMutexGuard aGuard; ScDPSaveDimension* pDim = GetDPDimension(); - return pDim ? pDim->GetAutoShowInfo() : 0; + return pDim ? pDim->GetAutoShowInfo() : nullptr; } void ScDataPilotFieldObj::setAutoShowInfo( const DataPilotFieldAutoShowInfo* pInfo ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { pDim->SetAutoShowInfo( pInfo ); @@ -2262,13 +2262,13 @@ const DataPilotFieldLayoutInfo* ScDataPilotFieldObj::getLayoutInfo() { SolarMutexGuard aGuard; ScDPSaveDimension* pDim = GetDPDimension(); - return pDim ? pDim->GetLayoutInfo() : 0; + return pDim ? pDim->GetLayoutInfo() : nullptr; } void ScDataPilotFieldObj::setLayoutInfo( const DataPilotFieldLayoutInfo* pInfo ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { pDim->SetLayoutInfo( pInfo ); @@ -2280,13 +2280,13 @@ const DataPilotFieldReference* ScDataPilotFieldObj::getReference() { SolarMutexGuard aGuard; ScDPSaveDimension* pDim = GetDPDimension(); - return pDim ? pDim->GetReferenceValue() : 0; + return pDim ? pDim->GetReferenceValue() : nullptr; } void ScDataPilotFieldObj::setReference( const DataPilotFieldReference* pInfo ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { pDim->SetReferenceValue( pInfo ); @@ -2298,13 +2298,13 @@ const DataPilotFieldSortInfo* ScDataPilotFieldObj::getSortInfo() { SolarMutexGuard aGuard; ScDPSaveDimension* pDim = GetDPDimension(); - return pDim ? pDim->GetSortInfo() : 0; + return pDim ? pDim->GetSortInfo() : nullptr; } void ScDataPilotFieldObj::setSortInfo( const DataPilotFieldSortInfo* pInfo ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { pDim->SetSortInfo( pInfo ); @@ -2322,7 +2322,7 @@ bool ScDataPilotFieldObj::getShowEmpty() const void ScDataPilotFieldObj::setShowEmpty( bool bShow ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { pDim->SetShowEmpty( bShow ); @@ -2340,7 +2340,7 @@ bool ScDataPilotFieldObj::getRepeatItemLabels() const void ScDataPilotFieldObj::setRepeatItemLabels( bool bShow ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { pDim->SetRepeatItemLabels( bShow ); @@ -2351,7 +2351,7 @@ void ScDataPilotFieldObj::setRepeatItemLabels( bool bShow ) bool ScDataPilotFieldObj::hasGroupInfo() { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) if( const ScDPDimensionSaveData* pDimData = pDPObj->GetSaveData()->GetExistingDimensionData() ) return pDimData->GetNamedGroupDim( pDim->GetName() ) || pDimData->GetNumGroupDim( pDim->GetName() ); @@ -2362,7 +2362,7 @@ DataPilotFieldGroupInfo ScDataPilotFieldObj::getGroupInfo() { SolarMutexGuard aGuard; DataPilotFieldGroupInfo aInfo; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { if( const ScDPDimensionSaveData* pDimData = pDPObj->GetSaveData()->GetExistingDimensionData() ) @@ -2420,7 +2420,7 @@ DataPilotFieldGroupInfo ScDataPilotFieldObj::getGroupInfo() void ScDataPilotFieldObj::setGroupInfo( const DataPilotFieldGroupInfo* pInfo ) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( /*ScDPSaveDimension* pDim =*/ GetDPDimension( &pDPObj ) ) { ScDPSaveData* pSaveData = pDPObj->GetSaveData(); @@ -2501,7 +2501,7 @@ void ScDataPilotFieldObj::setGroupInfo( const DataPilotFieldGroupInfo* pInfo ) } else // null passed as argument { - pSaveData->SetDimensionData( 0 ); + pSaveData->SetDimensionData( nullptr ); } pDPObj->SetSaveData( *pSaveData ); @@ -2537,7 +2537,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons if( !rItems.hasElements() ) throw IllegalArgumentException(); - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { OUString aDimName = pDim->GetName(); @@ -2582,11 +2582,11 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons } } - ScDPSaveGroupDimension* pNewGroupDim = 0; + ScDPSaveGroupDimension* pNewGroupDim = nullptr; if ( !pGroupDimension ) { // create a new group dimension - sNewDim = pDimData->CreateGroupDimName( aBaseDimName, *pDPObj, false, NULL ); + sNewDim = pDimData->CreateGroupDimName( aBaseDimName, *pDPObj, false, nullptr ); pNewGroupDim = new ScDPSaveGroupDimension( aBaseDimName, sNewDim ); pGroupDimension = pNewGroupDim; // make changes to the new dim if none existed @@ -2658,7 +2658,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons delete pNewGroupDim; // AddGroupDimension copies the object // don't access pGroupDimension after here } - pGroupDimension = pNewGroupDim = NULL; + pGroupDimension = pNewGroupDim = nullptr; // set orientation ScDPSaveDimension* pSaveDimension = aSaveData.GetDimensionByName( aGroupDimName ); @@ -2714,7 +2714,7 @@ Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( con throw IllegalArgumentException(); OUString aGroupDimName; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { ScDPNumGroupInfo aInfo; @@ -2776,7 +2776,7 @@ Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( con else if( (nDateParts & rInfo.GroupBy) == 0 ) // do nothing if date field exists already { // create new named group dimension for additional date groups - aGroupDimName = rDimData.CreateDateGroupDimName( rInfo.GroupBy, *pDPObj, true, 0 ); + aGroupDimName = rDimData.CreateDateGroupDimName( rInfo.GroupBy, *pDPObj, true, nullptr ); ScDPSaveGroupDimension aGroupDim( aSrcDimName, aGroupDimName, aInfo, rInfo.GroupBy ); rDimData.AddGroupDimension( aGroupDim ); @@ -3237,7 +3237,7 @@ ScDataPilotItemsObj::~ScDataPilotItemsObj() ScDataPilotItemObj* ScDataPilotItemsObj::GetObjectByIndex_Impl( sal_Int32 nIndex ) const { return ((0 <= nIndex) && (nIndex < GetMemberCount())) ? - new ScDataPilotItemObj( mrParent, maFieldId, nIndex ) : 0; + new ScDataPilotItemObj( mrParent, maFieldId, nIndex ) : nullptr; } // XNameAccess @@ -3390,7 +3390,7 @@ void SAL_CALL ScDataPilotItemObj::setPropertyValue( const OUString& aPropertyNam RuntimeException, std::exception) { SolarMutexGuard aGuard; - ScDPObject* pDPObj = 0; + ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { Reference<XNameAccess> xMembers = GetMembers(); diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 2c98dc3f81b7..5a38f7dd0289 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -525,8 +525,8 @@ void SAL_CALL ScSubTotalFieldObj::setSubTotalColumns( } else { - aParam.pSubTotals[nPos] = NULL; - aParam.pFunctions[nPos] = NULL; + aParam.pSubTotals[nPos] = nullptr; + aParam.pFunctions[nPos] = nullptr; } } //! sonst Exception oder so? (zuviele Spalten) @@ -549,7 +549,7 @@ ScSubTotalFieldObj* ScSubTotalDescriptorBase::GetObjectByIndex_Impl(sal_uInt16 n { if ( nIndex < getCount() ) return new ScSubTotalFieldObj( this, nIndex ); - return NULL; + return nullptr; } void SAL_CALL ScSubTotalDescriptorBase::clear() throw(uno::RuntimeException, std::exception) @@ -604,8 +604,8 @@ void SAL_CALL ScSubTotalDescriptorBase::addNew( } else { - aParam.pSubTotals[nPos] = NULL; - aParam.pFunctions[nPos] = NULL; + aParam.pSubTotals[nPos] = nullptr; + aParam.pFunctions[nPos] = nullptr; } } else // too many fields / columns @@ -779,7 +779,7 @@ const uno::Sequence<sal_Int8>& ScSubTotalDescriptorBase::getUnoTunnelId() ScSubTotalDescriptorBase* ScSubTotalDescriptorBase::getImplementation(const uno::Reference<sheet::XSubTotalDescriptor>& rObj) { - ScSubTotalDescriptorBase* pRet = NULL; + ScSubTotalDescriptorBase* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScSubTotalDescriptorBase*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -997,7 +997,7 @@ void ScFilterDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - pDocSh = NULL; // invalid + pDocSh = nullptr; // invalid } } } @@ -1651,7 +1651,7 @@ void ScDatabaseRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden else if ( dynamic_cast<const ScDBRangeRefreshedHint*>(&rHint) ) { ScDBData* pDBData = GetDBData_Impl(); @@ -1667,7 +1667,7 @@ void ScDatabaseRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScDBData* ScDatabaseRangeObj::GetDBData_Impl() const { - ScDBData* pRet = NULL; + ScDBData* pRet = nullptr; if (pDocShell) { if (bIsUnnamed) @@ -1919,7 +1919,7 @@ void SAL_CALL ScDatabaseRangeObj::refresh() throw(uno::RuntimeException, std::ex SCCOL nDummyCol; SCROW nDummyRow; pData->GetArea( nTab, nDummyCol,nDummyRow,nDummyCol,nDummyRow ); - bContinue = aFunc.DoImport( nTab, aImportParam, NULL, true ); //! Api-Flag as parameter + bContinue = aFunc.DoImport( nTab, aImportParam, nullptr, true ); //! Api-Flag as parameter } // interne Operationen (sort, query, subtotal) nur, wenn kein Fehler @@ -1985,7 +1985,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScDatabaseRangeObj::getReferredCells( else return new ScCellRangeObj( pDocShell, aRange ); } - return NULL; + return nullptr; } // XPropertySet @@ -2048,7 +2048,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue( aNewData.SetAdvancedQuerySource(&aRange); } else - aNewData.SetAdvancedQuerySource(NULL); + aNewData.SetAdvancedQuerySource(nullptr); } else if (aString == SC_UNONAME_FLTCRT ) { @@ -2226,7 +2226,7 @@ void ScDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -2235,15 +2235,15 @@ void ScDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScDatabaseRangeObj* ScDatabaseRangesObj::GetObjectByIndex_Impl(size_t nIndex) { if (!pDocShell) - return NULL; + return nullptr; ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection(); if (!pNames) - return NULL; + return nullptr; const ScDBCollection::NamedDBs& rDBs = pNames->getNamedDBs(); if (rDBs.empty() || nIndex >= rDBs.size()) - return NULL; + return nullptr; ScDBCollection::NamedDBs::const_iterator itr = rDBs.begin(); ::std::advance(itr, nIndex); // boundary check is done above. @@ -2257,7 +2257,7 @@ ScDatabaseRangeObj* ScDatabaseRangesObj::GetObjectByName_Impl(const OUString& aN OUString aString(aName); return new ScDatabaseRangeObj( pDocShell, aString ); } - return NULL; + return nullptr; } void SAL_CALL ScDatabaseRangesObj::addNewByName( const OUString& aName, @@ -2397,7 +2397,7 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const OUString& aName ) { ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection(); if (pNames) - return pNames->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aName)) != NULL; + return pNames->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aName)) != nullptr; } return false; } @@ -2423,7 +2423,7 @@ void ScUnnamedDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index 9e3b939c03d1..f7a02ce8aedd 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -93,7 +93,7 @@ void ScDocDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // document gone + pDocShell = nullptr; // document gone } } @@ -279,7 +279,7 @@ beans::PropertyState SAL_CALL ScDocDefaultsObj::getPropertyState( const OUString // check if pool default is set ScDocumentPool* pPool = pDocShell->GetDocument().GetPool(); - if ( pPool->GetPoolDefaultItem( nWID ) != NULL ) + if ( pPool->GetPoolDefaultItem( nWID ) != nullptr ) eRet = beans::PropertyState_DIRECT_VALUE; } diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index 4fc02fabc82d..f04281e47c26 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -84,7 +84,7 @@ void ScDispatchProviderInterceptor::Notify( SfxBroadcaster&, const SfxHint& rHin { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pViewShell = NULL; + pViewShell = nullptr; } // XDispatchProvider @@ -181,9 +181,9 @@ void SAL_CALL ScDispatchProviderInterceptor::disposing( const lang::EventObject& if (xInterceptedComponent.is()) xInterceptedComponent->removeEventListener(static_cast<lang::XEventListener*>(this)); - m_xMyDispatch = NULL; + m_xMyDispatch = nullptr; } - m_xIntercepted = NULL; + m_xIntercepted = nullptr; } ScDispatch::ScDispatch(ScTabViewShell* pViewSh) : @@ -211,7 +211,7 @@ void ScDispatch::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pViewShell = NULL; + pViewShell = nullptr; } // XDispatch @@ -380,7 +380,7 @@ void SAL_CALL ScDispatch::disposing( const css::lang::EventObject& rSource ) for ( size_t n=0; n<aDataSourceListeners.size(); n++ ) aDataSourceListeners[n]->disposing( aEvent ); - pViewShell = NULL; + pViewShell = nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 69a5cb3133ae..36ba321ce0e7 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -368,8 +368,8 @@ ScModelObj::ScModelObj( ScDocShell* pDocSh ) : SfxBaseModel( pDocSh ), aPropSet( lcl_GetDocOptPropertyMap() ), pDocShell( pDocSh ), - pPrintFuncCache( NULL ), - pPrinterOptions( NULL ), + pPrintFuncCache( nullptr ), + pPrinterOptions( nullptr ), maChangesListeners( m_aMutex ) { // pDocShell may be NULL if this is the base of a ScDocOptionsObj @@ -410,7 +410,7 @@ uno::Reference< uno::XAggregation> ScModelObj::GetFormatter() } // beim setDelegator darf die zusaetzliche Ref nicht mehr existieren - xFormatter = NULL; + xFormatter = nullptr; if (xNumberAgg.is()) xNumberAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) ); @@ -423,7 +423,7 @@ ScDocument* ScModelObj::GetDocument() const { if (pDocShell) return &pDocShell->GetDocument(); - return NULL; + return nullptr; } SfxObjectShell* ScModelObj::GetEmbeddedObject() const @@ -453,7 +453,7 @@ ScSheetSaveData* ScModelObj::GetSheetSaveData() { if (pDocShell) return pDocShell->GetSheetSaveData(); - return NULL; + return nullptr; } void ScModelObj::RepaintRange( const ScRange& rRange ) @@ -724,7 +724,7 @@ OString ScModelObj::getTextSelection(const char* pMimeType, OString& rUsedMimeTy if (( pShell = dynamic_cast<ScEditShell*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )) ) xTransferable = pShell->GetEditView()->GetTransferable(); - else if ( 0 != dynamic_cast<ScDrawTextObjectBar*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )) + else if ( nullptr != dynamic_cast<ScDrawTextObjectBar*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )) { ScDrawView* pView = pViewData->GetScDrawView(); OutlinerView* pOutView = pView->GetTextEditOutlinerView(); @@ -1034,14 +1034,14 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) sal_uLong nId = pSimpleHint->GetId(); if ( nId == SFX_HINT_DYING ) { - pDocShell = NULL; // has become invalid + pDocShell = nullptr; // has become invalid if (xNumberAgg.is()) { SvNumberFormatsSupplierObj* pNumFmt = SvNumberFormatsSupplierObj::getImplementation( uno::Reference<util::XNumberFormatsSupplier>(xNumberAgg, uno::UNO_QUERY) ); if ( pNumFmt ) - pNumFmt->SetNumberFormatter( NULL ); + pNumFmt->SetNumberFormatter( nullptr ); } DELETEZ( pPrintFuncCache ); // must be deleted because it has a pointer to the DocShell @@ -1100,7 +1100,7 @@ uno::Reference<sheet::XSpreadsheets> SAL_CALL ScModelObj::getSheets() throw(uno: SolarMutexGuard aGuard; if (pDocShell) return new ScTableSheetsObj(pDocShell); - return NULL; + return nullptr; } // XStyleFamiliesSupplier @@ -1111,14 +1111,14 @@ uno::Reference<container::XNameAccess> SAL_CALL ScModelObj::getStyleFamilies() SolarMutexGuard aGuard; if (pDocShell) return new ScStyleFamiliesObj(pDocShell); - return NULL; + return nullptr; } // XRenderable static OutputDevice* lcl_GetRenderDevice( const uno::Sequence<beans::PropertyValue>& rOptions ) { - OutputDevice* pRet = NULL; + OutputDevice* pRet = nullptr; const beans::PropertyValue* pPropArray = rOptions.getConstArray(); long nPropCount = rOptions.getLength(); for (long i = 0; i < nPropCount; i++) @@ -1285,7 +1285,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection, uno::Reference< drawing::XShapes > xShapes( xInterface, uno::UNO_QUERY ); if ( pSelObj && pSelObj->GetDocShell() == pDocShell ) { - bool bSheet = ( ScTableSheetObj::getImplementation( xInterface ) != NULL ); + bool bSheet = ( ScTableSheetObj::getImplementation( xInterface ) != nullptr ); bool bCursor = pSelObj->IsCursorOnly(); const ScRangeList& rRanges = pSelObj->GetRangeList(); @@ -1506,7 +1506,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32 SCTAB nTab = pPrintFuncCache->GetTabForPage( nRenderer ); ScRange aRange; - const ScRange* pSelRange = NULL; + const ScRange* pSelRange = nullptr; if ( aMark.IsMarked() ) { aMark.GetMarkArea( aRange ); @@ -1524,7 +1524,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32 long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab ); long nTabStart = pPrintFuncCache->GetTabStart( nTab ); - (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, NULL ); + (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, nullptr ); ScRange aCellRange; bool bWasCellRange = aFunc.GetLastSourceRange( aCellRange ); @@ -1592,7 +1592,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec SCTAB nTab = pPrintFuncCache->GetTabForPage( nRenderer ); ScDocument& rDoc = pDocShell->GetDocument(); - FmFormView* pDrawView = NULL; + FmFormView* pDrawView = nullptr; ScDrawLayer* pModel = rDoc.GetDrawLayer(); @@ -1604,7 +1604,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec } ScRange aRange; - const ScRange* pSelRange = NULL; + const ScRange* pSelRange = nullptr; if ( aMark.IsMarked() ) { aMark.GetMarkArea( aRange ); @@ -1654,7 +1654,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec } } - (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, true, NULL ); + (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, true, nullptr ); // resolve the hyperlinks for PDF export @@ -1761,7 +1761,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScModelObj::getLinks() throw(uno SolarMutexGuard aGuard; if (pDocShell) return new ScLinkTargetTypesObj(pDocShell); - return NULL; + return nullptr; } // XActionLockable @@ -1926,7 +1926,7 @@ uno::Reference<drawing::XDrawPages> SAL_CALL ScModelObj::getDrawPages() throw(un return new ScDrawPagesObj(pDocShell); OSL_FAIL("keine DocShell"); //! Exception oder so? - return NULL; + return nullptr; } // XGoalSeek @@ -2307,7 +2307,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) } else if ( aString == SC_UNO_HASDRAWPAGES ) { - ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetDocument().GetDrawLayer() != 0) ); + ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetDocument().GetDrawLayer() != nullptr) ); } else if ( aString == SC_UNO_BASICLIBRARIES ) { @@ -2446,7 +2446,7 @@ css::uno::Reference<css::uno::XInterface> ScModelObj::create( try { - xRet = arguments == 0 + xRet = arguments == nullptr ? SvxFmMSFactory::createInstance(aServiceSpecifier) : SvxFmMSFactory::createInstanceWithArguments( aServiceSpecifier, *arguments); @@ -2475,7 +2475,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstance( throw(uno::Exception, uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - return create(aServiceSpecifier, 0); + return create(aServiceSpecifier, nullptr); } uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstanceWithArguments( @@ -2593,7 +2593,7 @@ const uno::Sequence<sal_Int8>& ScModelObj::getUnoTunnelId() ScModelObj* ScModelObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScModelObj* pRet = NULL; + ScModelObj* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScModelObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -2958,7 +2958,7 @@ void ScDrawPagesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -2978,7 +2978,7 @@ uno::Reference<drawing::XDrawPage> ScDrawPagesObj::GetObjectByIndex_Impl(sal_Int } } } - return NULL; + return nullptr; } // XDrawPages @@ -3070,7 +3070,7 @@ void ScTableSheetsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -3081,7 +3081,7 @@ ScTableSheetObj* ScTableSheetsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const if ( pDocShell && nIndex >= 0 && nIndex < pDocShell->GetDocument().GetTableCount() ) return new ScTableSheetObj( pDocShell, static_cast<SCTAB>(nIndex) ); - return NULL; + return nullptr; } ScTableSheetObj* ScTableSheetsObj::GetObjectByName_Impl(const OUString& aName) const @@ -3092,7 +3092,7 @@ ScTableSheetObj* ScTableSheetsObj::GetObjectByName_Impl(const OUString& aName) c if ( pDocShell->GetDocument().GetTable( aName, nIndex ) ) return new ScTableSheetObj( pDocShell, nIndex ); } - return NULL; + return nullptr; } void SAL_CALL ScTableSheetsObj::insertNewByName( const OUString& aName, sal_Int16 nPosition ) @@ -3482,7 +3482,7 @@ void ScTableColumnsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -3494,7 +3494,7 @@ ScTableColumnObj* ScTableColumnsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) con if ( pDocShell && nCol <= nEndCol ) return new ScTableColumnObj( pDocShell, nCol, nTab ); - return NULL; // falscher Index + return nullptr; // falscher Index } ScTableColumnObj* ScTableColumnsObj::GetObjectByName_Impl(const OUString& aName) const @@ -3505,7 +3505,7 @@ ScTableColumnObj* ScTableColumnsObj::GetObjectByName_Impl(const OUString& aName) if ( pDocShell && nCol >= nStartCol && nCol <= nEndCol ) return new ScTableColumnObj( pDocShell, nCol, nTab ); - return NULL; + return nullptr; } void SAL_CALL ScTableColumnsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 nCount ) @@ -3518,7 +3518,7 @@ void SAL_CALL ScTableColumnsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 n { ScRange aRange( (SCCOL)(nStartCol+nPosition), 0, nTab, (SCCOL)(nStartCol+nPosition+nCount-1), MAXROW, nTab ); - bDone = pDocShell->GetDocFunc().InsertCells( aRange, NULL, INS_INSCOLS_BEFORE, true, true ); + bDone = pDocShell->GetDocFunc().InsertCells( aRange, nullptr, INS_INSCOLS_BEFORE, true, true ); } if (!bDone) throw uno::RuntimeException(); // no other exceptions specified @@ -3534,7 +3534,7 @@ void SAL_CALL ScTableColumnsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCou { ScRange aRange( (SCCOL)(nStartCol+nIndex), 0, nTab, (SCCOL)(nStartCol+nIndex+nCount-1), MAXROW, nTab ); - bDone = pDocShell->GetDocFunc().DeleteCells( aRange, NULL, DEL_DELCOLS, true, true ); + bDone = pDocShell->GetDocFunc().DeleteCells( aRange, nullptr, DEL_DELCOLS, true, true ); } if (!bDone) throw uno::RuntimeException(); // no other exceptions specified @@ -3750,7 +3750,7 @@ void ScTableRowsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -3762,7 +3762,7 @@ ScTableRowObj* ScTableRowsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const if ( pDocShell && nRow <= nEndRow ) return new ScTableRowObj( pDocShell, nRow, nTab ); - return NULL; // falscher Index + return nullptr; // falscher Index } void SAL_CALL ScTableRowsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 nCount ) @@ -3775,7 +3775,7 @@ void SAL_CALL ScTableRowsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 nCou { ScRange aRange( 0, (SCROW)(nStartRow+nPosition), nTab, MAXCOL, (SCROW)(nStartRow+nPosition+nCount-1), nTab ); - bDone = pDocShell->GetDocFunc().InsertCells( aRange, NULL, INS_INSROWS_BEFORE, true, true ); + bDone = pDocShell->GetDocFunc().InsertCells( aRange, nullptr, INS_INSROWS_BEFORE, true, true ); } if (!bDone) throw uno::RuntimeException(); // no other exceptions specified @@ -3791,7 +3791,7 @@ void SAL_CALL ScTableRowsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCount { ScRange aRange( 0, (SCROW)(nStartRow+nIndex), nTab, MAXCOL, (SCROW)(nStartRow+nIndex+nCount-1), nTab ); - bDone = pDocShell->GetDocFunc().DeleteCells( aRange, NULL, DEL_DELROWS, true, true ); + bDone = pDocShell->GetDocFunc().DeleteCells( aRange, nullptr, DEL_DELROWS, true, true ); } if (!bDone) throw uno::RuntimeException(); // no other exceptions specified @@ -3972,7 +3972,7 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam else if ( aNameString == SC_UNONAME_CELLVIS ) { SCROW nLastRow; - bool bVis = !rDoc.RowHidden(nStartRow, nTab, NULL, &nLastRow); + bool bVis = !rDoc.RowHidden(nStartRow, nTab, nullptr, &nLastRow); ScUnoHelpFunctions::SetBoolInAny( aAny, bVis ); } else if ( aNameString == SC_UNONAME_CELLFILT ) @@ -4025,7 +4025,7 @@ void ScSpreadsheetSettingsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -4035,7 +4035,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScSpreadsheetSettingsObj::getPr throw(uno::RuntimeException, std::exception) { //! muss noch - return NULL; + return nullptr; } void SAL_CALL ScSpreadsheetSettingsObj::setPropertyValue( @@ -4079,7 +4079,7 @@ void ScAnnotationsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -4101,7 +4101,7 @@ ScAnnotationObj* ScAnnotationsObj::GetObjectByIndex_Impl( sal_Int32 nIndex ) con if ( GetAddressByIndex_Impl( nIndex, aPos ) ) return new ScAnnotationObj( pDocShell, aPos ); } - return NULL; + return nullptr; } // XSheetAnnotations @@ -4115,7 +4115,7 @@ void SAL_CALL ScAnnotationsObj::insertNew( { OSL_ENSURE( aPosition.Sheet == nTab, "addAnnotation mit falschem Sheet" ); ScAddress aPos( (SCCOL)aPosition.Column, (SCROW)aPosition.Row, nTab ); - pDocShell->GetDocFunc().ReplaceNote( aPos, rText, 0, 0, true ); + pDocShell->GetDocFunc().ReplaceNote( aPos, rText, nullptr, nullptr, true ); } } @@ -4213,7 +4213,7 @@ void ScScenariosObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -4246,7 +4246,7 @@ ScTableSheetObj* ScScenariosObj::GetObjectByIndex_Impl(sal_Int32 nIndex) if ( pDocShell && nIndex >= 0 && nIndex < nCount ) return new ScTableSheetObj( pDocShell, nTab+static_cast<SCTAB>(nIndex)+1 ); - return NULL; // kein Dokument oder falscher Index + return nullptr; // kein Dokument oder falscher Index } ScTableSheetObj* ScScenariosObj::GetObjectByName_Impl(const OUString& aName) @@ -4255,7 +4255,7 @@ ScTableSheetObj* ScScenariosObj::GetObjectByName_Impl(const OUString& aName) if ( pDocShell && GetScenarioIndex_Impl( aName, nIndex ) ) return new ScTableSheetObj( pDocShell, nTab+nIndex+1 ); - return NULL; // nicht gefunden + return nullptr; // nicht gefunden } void SAL_CALL ScScenariosObj::addNewByName( const OUString& aName, diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx index 8aa5ca94af51..fcfbfc3fb91e 100644 --- a/sc/source/ui/unoobj/drdefuno.cxx +++ b/sc/source/ui/unoobj/drdefuno.cxx @@ -24,7 +24,7 @@ using namespace ::com::sun::star; ScDrawDefaultsObj::ScDrawDefaultsObj(ScDocShell* pDocSh) : - SvxUnoDrawPool( NULL ), + SvxUnoDrawPool( nullptr ), pDocShell( pDocSh ) { // SvxUnoDrawPool is initialized without model, @@ -46,13 +46,13 @@ void ScDrawDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // document gone + pDocShell = nullptr; // document gone } } SfxItemPool* ScDrawDefaultsObj::getModelPool( bool bReadOnly ) throw() { - SfxItemPool* pRet = NULL; + SfxItemPool* pRet = nullptr; try { diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx index 892708d78fb1..219d74b7b559 100644 --- a/sc/source/ui/unoobj/editsrc.cxx +++ b/sc/source/ui/unoobj/editsrc.cxx @@ -110,8 +110,8 @@ ScEditEngineDefaulter* ScCellEditSource::GetEditEngine() ScAnnotationEditSource::ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP) : pDocShell( pDocSh ), aCellPos( rP ), - pEditEngine( NULL ), - pForwarder( NULL ), + pEditEngine( nullptr ), + pForwarder( nullptr ), bDataValid( false ) { if (pDocShell) @@ -137,7 +137,7 @@ SvxEditSource* ScAnnotationEditSource::Clone() const SdrObject* ScAnnotationEditSource::GetCaptionObj() { ScPostIt* pNote = pDocShell->GetDocument().GetNote(aCellPos); - return pNote ? pNote->GetOrCreateCaption( aCellPos ) : 0; + return pNote ? pNote->GetOrCreateCaption( aCellPos ) : nullptr; } SvxTextForwarder* ScAnnotationEditSource::GetTextForwarder() @@ -205,7 +205,7 @@ void ScAnnotationEditSource::Notify( SfxBroadcaster&, const SfxHint& rHint ) sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden DELETEZ( pForwarder ); DELETEZ( pEditEngine ); // EditEngine uses document's pool diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx index 01e42c44a982..4edcceb92672 100644 --- a/sc/source/ui/unoobj/eventuno.cxx +++ b/sc/source/ui/unoobj/eventuno.cxx @@ -49,7 +49,7 @@ void ScSheetEventsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - mpDocShell = NULL; + mpDocShell = nullptr; } } @@ -109,7 +109,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const OUString& aName, const uno: if (!aScript.isEmpty()) aNewEvents.SetScript( nEvent, &aScript ); else - aNewEvents.SetScript( nEvent, NULL ); // reset + aNewEvents.SetScript( nEvent, nullptr ); // reset mpDocShell->GetDocument().SetSheetEvents( mnTab, &aNewEvents ); mpDocShell->SetDocumentModified(); @@ -125,7 +125,7 @@ uno::Any SAL_CALL ScSheetEventsObj::getByName( const OUString& aName ) if (nEvent == ScSheetEventId::NOTFOUND) throw container::NoSuchElementException(); - const OUString* pScript = NULL; + const OUString* pScript = nullptr; if (mpDocShell) { const ScSheetEvents* pEvents = mpDocShell->GetDocument().GetSheetEvents(mnTab); diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 69336affb287..bcb87b94998f 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -180,7 +180,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st if ( xInputStream.is() ) pInStream.reset(utl::UcbStreamHelper::CreateStream( xInputStream )); - std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( NULL, aPrivDatName, pInStream.get(), SC_IMPORTFILE)); + std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( nullptr, aPrivDatName, pInStream.get(), SC_IMPORTFILE)); OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) { @@ -199,7 +199,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st { // HTML import. std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg( - pFact->CreateScTextImportOptionsDlg(NULL)); + pFact->CreateScTextImportOptionsDlg(nullptr)); if (pDlg->Execute() == RET_OK) { @@ -281,7 +281,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding); - std::unique_ptr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg(NULL, + std::unique_ptr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg(nullptr, bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc, !bExport)); OSL_ENSURE(pDlg, "Dialog create fail!"); diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index 02cf321ed616..4a66d9f712f3 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -245,7 +245,7 @@ void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry ScTableConditionalEntry* ScTableConditionalFormat::GetObjectByIndex_Impl(sal_uInt16 nIndex) const { - return nIndex < aEntries.size() ? aEntries[nIndex] : NULL; + return nIndex < aEntries.size() ? aEntries[nIndex] : nullptr; } void SAL_CALL ScTableConditionalFormat::addNew( @@ -492,7 +492,7 @@ const uno::Sequence<sal_Int8>& ScTableConditionalFormat::getUnoTunnelId() ScTableConditionalFormat* ScTableConditionalFormat::getImplementation(const uno::Reference<sheet::XSheetConditionalEntries>& rObj) { - ScTableConditionalFormat* pRet = NULL; + ScTableConditionalFormat* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScTableConditionalFormat*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -1017,7 +1017,7 @@ const uno::Sequence<sal_Int8>& ScTableValidationObj::getUnoTunnelId() ScTableValidationObj* ScTableValidationObj::getImplementation(const uno::Reference<beans::XPropertySet>& rObj) { - ScTableValidationObj* pRet = NULL; + ScTableValidationObj* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScTableValidationObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx index c6fe2d438d9b..708543bd58e3 100644 --- a/sc/source/ui/unoobj/forbiuno.cxx +++ b/sc/source/ui/unoobj/forbiuno.cxx @@ -64,7 +64,7 @@ void ScForbiddenCharsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // document gone + pDocShell = nullptr; // document gone } } diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 84ed978b6295..5dc09a3d9c66 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -80,7 +80,7 @@ ScDocument* ScTempDocSource::CreateDocument() ScTempDocSource::ScTempDocSource( ScTempDocCache& rDocCache ) : rCache( rDocCache ), - pTempDoc( NULL ) + pTempDoc( nullptr ) { if ( rCache.IsInUse() ) pTempDoc = CreateDocument(); @@ -109,7 +109,7 @@ ScDocument* ScTempDocSource::GetDocument() } ScTempDocCache::ScTempDocCache() : - pDoc( NULL ), + pDoc( nullptr ), bInUse( false ) { } @@ -130,7 +130,7 @@ void ScTempDocCache::Clear() { OSL_ENSURE( !bInUse, "ScTempDocCache::Clear: bInUse" ); delete pDoc; - pDoc = NULL; + pDoc = nullptr; } // copy results from one document into another @@ -167,14 +167,14 @@ static bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange, ScMarkData aDestMark; aDestMark.SelectOneTable( nDestTab ); aDestMark.SetMarkArea( aNewRange ); - pDestDoc->CopyFromClip( aNewRange, aDestMark, InsertDeleteFlags::ALL & ~InsertDeleteFlags::FORMULA, NULL, pClipDoc, false ); + pDestDoc->CopyFromClip( aNewRange, aDestMark, InsertDeleteFlags::ALL & ~InsertDeleteFlags::FORMULA, nullptr, pClipDoc, false ); delete pClipDoc; return true; } ScFunctionAccess::ScFunctionAccess() : - pOptions( NULL ), + pOptions( nullptr ), aPropertyMap( ScDocOptionsHelper::GetPropertyMap() ), mbArray( true ), // default according to behaviour of older Office versions mbValid( true ) @@ -620,7 +620,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName, // call GetMatrix before GetErrCode because GetMatrix always recalculates // if there is no matrix result - const ScMatrix* pMat = (mbArray && pFormula) ? pFormula->GetMatrix() : 0; + const ScMatrix* pMat = (mbArray && pFormula) ? pFormula->GetMatrix() : nullptr; sal_uInt16 nErrCode = pFormula ? pFormula->GetErrCode() : errIllegalArgument; if ( nErrCode == 0 ) { diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 5d2694e75757..d4d388b0c320 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -97,7 +97,7 @@ void ScSheetLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( pSimpleHint ) { if ( pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // pointer is invalid + pDocShell = nullptr; // pointer is invalid } else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { @@ -124,7 +124,7 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const } } } - return NULL; // nicht gefunden + return nullptr; // nicht gefunden } // XNamed @@ -149,7 +149,7 @@ void SAL_CALL ScSheetLinkObj::refresh() SolarMutexGuard aGuard; ScTableLink* pLink = GetLink_Impl(); if (pLink) - pLink->Refresh( pLink->GetFileName(), pLink->GetFilterName(), NULL, pLink->GetRefreshDelay() ); + pLink->Refresh( pLink->GetFileName(), pLink->GetFilterName(), nullptr, pLink->GetRefreshDelay() ); } void SAL_CALL ScSheetLinkObj::addRefreshListener( @@ -330,7 +330,7 @@ void ScSheetLinkObj::setFilter(const OUString& Filter) if (pLink) { OUString aFilterStr(Filter); - pLink->Refresh( aFileName, aFilterStr, NULL, pLink->GetRefreshDelay() ); + pLink->Refresh( aFileName, aFilterStr, nullptr, pLink->GetRefreshDelay() ); } } @@ -392,7 +392,7 @@ void ScSheetLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -401,7 +401,7 @@ void ScSheetLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScSheetLinkObj* ScSheetLinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex) { if (!pDocShell) - return NULL; + return nullptr; typedef std::unordered_set<OUString, OUStringHash> StrSetType; StrSetType aNames; @@ -423,7 +423,7 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex) } } - return NULL; // kein Dokument oder Index zu gross + return nullptr; // kein Dokument oder Index zu gross } ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const OUString& aName) @@ -446,7 +446,7 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const OUString& aName) } } - return NULL; + return nullptr; } // XEnumerationAccess @@ -593,7 +593,7 @@ static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, size_t nPos ) } } } - return NULL; // nicht gefunden + return nullptr; // nicht gefunden } ScAreaLinkObj::ScAreaLinkObj(ScDocShell* pDocSh, size_t nP) : @@ -621,7 +621,7 @@ void ScAreaLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( pSimpleHint ) { if ( pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // pointer is invalid + pDocShell = nullptr; // pointer is invalid } else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { @@ -657,7 +657,7 @@ void ScAreaLinkObj::Modify_Impl( const OUString* pNewFile, const OUString* pNewF sfx2::LinkManager* pLinkManager = pDocShell->GetDocument().GetLinkManager(); pLinkManager->Remove( pLink ); - pLink = NULL; // bei Remove geloescht + pLink = nullptr; // bei Remove geloescht bool bFitBlock = true; // verschieben, wenn durch Update Groesse geaendert if (pNewFile) @@ -827,7 +827,7 @@ OUString ScAreaLinkObj::getFileName() const void ScAreaLinkObj::setFileName(const OUString& rNewName) { SolarMutexGuard aGuard; - Modify_Impl( &rNewName, NULL, NULL, NULL, NULL ); + Modify_Impl( &rNewName, nullptr, nullptr, nullptr, nullptr ); } OUString ScAreaLinkObj::getFilter() const @@ -843,7 +843,7 @@ OUString ScAreaLinkObj::getFilter() const void ScAreaLinkObj::setFilter(const OUString& Filter) { SolarMutexGuard aGuard; - Modify_Impl( NULL, &Filter, NULL, NULL, NULL ); + Modify_Impl( nullptr, &Filter, nullptr, nullptr, nullptr ); } OUString ScAreaLinkObj::getFilterOptions() const @@ -859,7 +859,7 @@ OUString ScAreaLinkObj::getFilterOptions() const void ScAreaLinkObj::setFilterOptions(const OUString& FilterOptions) { SolarMutexGuard aGuard; - Modify_Impl( NULL, NULL, &FilterOptions, NULL, NULL ); + Modify_Impl( nullptr, nullptr, &FilterOptions, nullptr, nullptr ); } sal_Int32 ScAreaLinkObj::getRefreshDelay() const @@ -894,7 +894,7 @@ void SAL_CALL ScAreaLinkObj::setSourceArea( const OUString& aSourceArea ) throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - Modify_Impl( NULL, NULL, NULL, &aSourceArea, NULL ); + Modify_Impl( nullptr, nullptr, nullptr, &aSourceArea, nullptr ); } table::CellRangeAddress SAL_CALL ScAreaLinkObj::getDestArea() throw(uno::RuntimeException, std::exception) @@ -911,7 +911,7 @@ void SAL_CALL ScAreaLinkObj::setDestArea( const table::CellRangeAddress& aDestAr throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - Modify_Impl( NULL, NULL, NULL, NULL, &aDestArea ); + Modify_Impl( nullptr, nullptr, nullptr, nullptr, &aDestArea ); } ScAreaLinksObj::ScAreaLinksObj(ScDocShell* pDocSh) : @@ -935,7 +935,7 @@ void ScAreaLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -946,7 +946,7 @@ ScAreaLinkObj* ScAreaLinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex) if ( pDocShell && nIndex >= 0 && nIndex < getCount() ) return new ScAreaLinkObj( pDocShell, (size_t)nIndex ); - return NULL; // nicht gefunden + return nullptr; // nicht gefunden } void SAL_CALL ScAreaLinksObj::insertAtPosition( const table::CellAddress& aDestPos, @@ -1065,7 +1065,7 @@ void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( pSimpleHint ) { if ( pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // pointer is invalid + pDocShell = nullptr; // pointer is invalid } else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { @@ -1260,7 +1260,7 @@ void ScDDELinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -1274,7 +1274,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex) if ( pDocShell->GetDocument().GetDdeLinkData( (size_t)nIndex, aAppl, aTopic, aItem ) ) return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem ); } - return NULL; + return nullptr; } ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName) @@ -1293,7 +1293,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName) return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem ); } } - return NULL; + return nullptr; } // XEnumerationAccess @@ -1620,7 +1620,7 @@ sal_Bool SAL_CALL ScExternalDocLinkObj::hasByName(const OUString &aName) // #i116940# be consistent with getByName: allow only table names which have a cache already ScExternalRefCache::TableTypeRef pTable = mpRefMgr->getCacheTable(mnFileId, aName, false); - return (pTable.get() != NULL); + return (pTable.get() != nullptr); } sal_Int32 SAL_CALL ScExternalDocLinkObj::getCount() diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index f4e328217f0a..2e390f68d068 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -104,14 +104,14 @@ void ScNamedRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // became invalid + pDocShell = nullptr; // became invalid } // Helper functions ScRangeData* ScNamedRangeObj::GetRangeData_Impl() { - ScRangeData* pRet = NULL; + ScRangeData* pRet = nullptr; if (pDocShell) { ScRangeName* pNames; @@ -189,7 +189,7 @@ void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray* if (pNewType) nType = *pNewType; - ScRangeData* pNew = NULL; + ScRangeData* pNew = nullptr; if (pNewTokens) pNew = new ScRangeData( &rDoc, aInsName, *pNewTokens, aPos, nType ); else @@ -206,7 +206,7 @@ void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray* } else { - pNew = NULL; //! uno::Exception/Error or something + pNew = nullptr; //! uno::Exception/Error or something delete pNewRanges; } } @@ -225,7 +225,7 @@ void SAL_CALL ScNamedRangeObj::setName( const OUString& aNewName ) OUString aNewStr(aNewName); // GRAM_PODF_A1 for API compatibility. - Modify_Impl( &aNewStr, NULL, NULL, NULL, NULL,formula::FormulaGrammar::GRAM_PODF_A1 ); + Modify_Impl( &aNewStr, nullptr, nullptr, nullptr, nullptr,formula::FormulaGrammar::GRAM_PODF_A1 ); if ( aName != aNewStr ) // some error occurred... throw uno::RuntimeException(); // no other exceptions specified @@ -248,7 +248,7 @@ void SAL_CALL ScNamedRangeObj::setContent( const OUString& aContent ) SolarMutexGuard aGuard; OUString aContStr(aContent); // GRAM_PODF_A1 for API compatibility. - Modify_Impl( NULL, NULL, &aContStr, NULL, NULL,formula::FormulaGrammar::GRAM_PODF_A1 ); + Modify_Impl( nullptr, nullptr, &aContStr, nullptr, nullptr,formula::FormulaGrammar::GRAM_PODF_A1 ); } table::CellAddress SAL_CALL ScNamedRangeObj::getReferencePosition() @@ -283,7 +283,7 @@ void SAL_CALL ScNamedRangeObj::setReferencePosition( const table::CellAddress& a SolarMutexGuard aGuard; ScAddress aPos( (SCCOL)aReferencePosition.Column, (SCROW)aReferencePosition.Row, aReferencePosition.Sheet ); // GRAM_PODF_A1 for API compatibility. - Modify_Impl( NULL, NULL, NULL, &aPos, NULL,formula::FormulaGrammar::GRAM_PODF_A1 ); + Modify_Impl( nullptr, nullptr, nullptr, &aPos, nullptr,formula::FormulaGrammar::GRAM_PODF_A1 ); } sal_Int32 SAL_CALL ScNamedRangeObj::getType() throw(uno::RuntimeException, std::exception) @@ -315,7 +315,7 @@ void SAL_CALL ScNamedRangeObj::setType( sal_Int32 nUnoType ) if ( nUnoType & sheet::NamedRangeFlag::ROW_HEADER ) nNewType |= RT_ROWHEADER; // GRAM_PODF_A1 for API compatibility. - Modify_Impl( NULL, NULL, NULL, NULL, &nNewType,formula::FormulaGrammar::GRAM_PODF_A1 ); + Modify_Impl( nullptr, nullptr, nullptr, nullptr, &nNewType,formula::FormulaGrammar::GRAM_PODF_A1 ); } // XFormulaTokens @@ -344,7 +344,7 @@ void SAL_CALL ScNamedRangeObj::setTokens( const uno::Sequence<sheet::FormulaToke ScTokenArray aTokenArray; (void)ScTokenConversion::ConvertToTokenArray( pDocShell->GetDocument(), aTokenArray, rTokens ); // GRAM_PODF_A1 for API compatibility. - Modify_Impl( NULL, &aTokenArray, NULL, NULL, NULL, formula::FormulaGrammar::GRAM_PODF_A1 ); + Modify_Impl( nullptr, &aTokenArray, nullptr, nullptr, nullptr, formula::FormulaGrammar::GRAM_PODF_A1 ); } } @@ -365,7 +365,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScNamedRangeObj::getReferredCells() else return new ScCellRangeObj( pDocShell, aRange ); } - return NULL; + return nullptr; } // beans::XPropertySet @@ -489,7 +489,7 @@ void ScNamedRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // became invalid + pDocShell = nullptr; // became invalid } } @@ -527,7 +527,7 @@ void SAL_CALL ScNamedRangesObj::addNewByName( const OUString& aName, } else { - pNew = NULL; + pNew = nullptr; delete pNewRanges; } } @@ -832,11 +832,11 @@ ScGlobalNamedRangesObj::~ScGlobalNamedRangesObj() ScNamedRangeObj* ScGlobalNamedRangesObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) { if (!pDocShell) - return NULL; + return nullptr; ScRangeName* pNames = pDocShell->GetDocument().GetRangeName(); if (!pNames) - return NULL; + return nullptr; ScRangeName::const_iterator itr = pNames->begin(), itrEnd = pNames->end(); sal_uInt16 nPos = 0; @@ -849,14 +849,14 @@ ScNamedRangeObj* ScGlobalNamedRangesObj::GetObjectByIndex_Impl(sal_uInt16 nIndex } ++nPos; } - return NULL; + return nullptr; } ScNamedRangeObj* ScGlobalNamedRangesObj::GetObjectByName_Impl(const OUString& aName) { if ( pDocShell && hasByName(aName) ) return new ScNamedRangeObj(this, pDocShell, aName); - return NULL; + return nullptr; } ScRangeName* ScGlobalNamedRangesObj::GetRangeName_Impl() @@ -885,24 +885,24 @@ ScNamedRangeObj* ScLocalNamedRangesObj::GetObjectByName_Impl(const OUString& aNa { if ( pDocShell && hasByName( aName ) ) return new ScNamedRangeObj( this, pDocShell, aName, mxSheet); - return NULL; + return nullptr; } ScNamedRangeObj* ScLocalNamedRangesObj::GetObjectByIndex_Impl( sal_uInt16 nIndex ) { if (!pDocShell) - return NULL; + return nullptr; OUString aName = mxSheet->getName(); ScDocument& rDoc = pDocShell->GetDocument(); SCTAB nTab; if (!rDoc.GetTable(aName, nTab)) - return NULL; + return nullptr; ScRangeName* pNames = rDoc.GetRangeName( nTab ); if (!pNames) - return NULL; + return nullptr; ScRangeName::const_iterator itr = pNames->begin(), itrEnd = pNames->end(); sal_uInt16 nPos = 0; @@ -915,7 +915,7 @@ ScNamedRangeObj* ScLocalNamedRangesObj::GetObjectByIndex_Impl( sal_uInt16 nIndex } ++nPos; } - return NULL; + return nullptr; } ScRangeName* ScLocalNamedRangesObj::GetRangeName_Impl() @@ -953,14 +953,14 @@ void ScLabelRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // became invalid + pDocShell = nullptr; // became invalid } // Helper functions ScRangePair* ScLabelRangeObj::GetData_Impl() { - ScRangePair* pRet = NULL; + ScRangePair* pRet = nullptr; if (pDocShell) { ScDocument& rDoc = pDocShell->GetDocument(); @@ -1030,7 +1030,7 @@ void SAL_CALL ScLabelRangeObj::setLabelArea( const table::CellRangeAddress& aLab SolarMutexGuard aGuard; ScRange aLabelRange; ScUnoConversion::FillScRange( aLabelRange, aLabelArea ); - Modify_Impl( &aLabelRange, NULL ); + Modify_Impl( &aLabelRange, nullptr ); } table::CellRangeAddress SAL_CALL ScLabelRangeObj::getDataArea() @@ -1050,7 +1050,7 @@ void SAL_CALL ScLabelRangeObj::setDataArea( const table::CellRangeAddress& aData SolarMutexGuard aGuard; ScRange aDataRange; ScUnoConversion::FillScRange( aDataRange, aDataArea ); - Modify_Impl( NULL, &aDataRange ); + Modify_Impl( nullptr, &aDataRange ); } ScLabelRangesObj::ScLabelRangesObj(ScDocShell* pDocSh, bool bCol) : @@ -1075,7 +1075,7 @@ void ScLabelRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // became invalid + pDocShell = nullptr; // became invalid } } @@ -1094,7 +1094,7 @@ ScLabelRangeObj* ScLabelRangesObj::GetObjectByIndex_Impl(size_t nIndex) return new ScLabelRangeObj( pDocShell, bColumn, pData->GetRange(0) ); } } - return NULL; + return nullptr; } void SAL_CALL ScLabelRangesObj::addNew( const table::CellRangeAddress& aLabelArea, diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx index 73b15fd6824b..ad2f39948878 100644 --- a/sc/source/ui/unoobj/notesuno.cxx +++ b/sc/source/ui/unoobj/notesuno.cxx @@ -58,7 +58,7 @@ SC_SIMPLE_SERVICE_INFO( ScAnnotationObj, "ScAnnotationObj", "com.sun.star.sheet. ScAnnotationObj::ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos) : pDocShell( pDocSh ), aCellPos( rPos ), - pUnoText( NULL ) + pUnoText( nullptr ) { pDocShell->GetDocument().AddUnoObject(*this); @@ -88,7 +88,7 @@ void ScAnnotationObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -104,7 +104,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScAnnotationObj::getParent() throw(uno: if (pDocShell) return static_cast<cppu::OWeakObject*>(new ScCellObj( pDocShell, aCellPos )); - return NULL; + return nullptr; } void SAL_CALL ScAnnotationObj::setParent( const uno::Reference<uno::XInterface>& /* Parent */ ) @@ -249,6 +249,6 @@ SvxUnoText& ScAnnotationObj::GetUnoText() const ScPostIt* ScAnnotationObj::ImplGetNote() const { - return pDocShell ? pDocShell->GetDocument().GetNote(aCellPos) : 0; + return pDocShell ? pDocShell->GetDocument().GetNote(aCellPos) : nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx index 5315b098b0d6..b158b0e7a2df 100644 --- a/sc/source/ui/unoobj/optuno.cxx +++ b/sc/source/ui/unoobj/optuno.cxx @@ -179,7 +179,7 @@ uno::Any ScDocOptionsHelper::getPropertyValue( } ScDocOptionsObj::ScDocOptionsObj( const ScDocOptions& rOpt ) : - ScModelObj( NULL ), + ScModelObj( nullptr ), aOptions( rOpt ) { } diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx index 12a11be841e0..eac13bb4dff8 100644 --- a/sc/source/ui/unoobj/scdetect.cxx +++ b/sc/source/ui/unoobj/scdetect.cxx @@ -261,7 +261,7 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l // No stream, no detection. return OUString(); - const char* pSearchFilterName = NULL; + const char* pSearchFilterName = nullptr; if (aTypeName == "calc_Lotus") { if (!detectThisFormat(*pStream, pLotus) && !detectThisFormat(*pStream, pLotusNew) && !detectThisFormat(*pStream, pLotus2)) diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 7cefcd509960..bf51c6a0fdc8 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -435,7 +435,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( { case SC_SERVICE_SHEET: // noch nicht eingefuegt - DocShell=Null - xRet.set(static_cast<sheet::XSpreadsheet*>(new ScTableSheetObj(NULL,0))); + xRet.set(static_cast<sheet::XSpreadsheet*>(new ScTableSheetObj(nullptr,0))); break; case SC_SERVICE_URLFIELD: case SC_SERVICE_PAGEFIELD: @@ -449,14 +449,14 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( { uno::Reference<text::XTextRange> xNullContent; xRet.set(static_cast<text::XTextField*>( - new ScEditFieldObj(xNullContent, NULL, getFieldType(nType), ESelection()))); + new ScEditFieldObj(xNullContent, nullptr, getFieldType(nType), ESelection()))); } break; case SC_SERVICE_CELLSTYLE: - xRet.set(static_cast<style::XStyle*>(new ScStyleObj( NULL, SFX_STYLE_FAMILY_PARA, OUString() ))); + xRet.set(static_cast<style::XStyle*>(new ScStyleObj( nullptr, SFX_STYLE_FAMILY_PARA, OUString() ))); break; case SC_SERVICE_PAGESTYLE: - xRet.set(static_cast<style::XStyle*>(new ScStyleObj( NULL, SFX_STYLE_FAMILY_PAGE, OUString() ))); + xRet.set(static_cast<style::XStyle*>(new ScStyleObj( nullptr, SFX_STYLE_FAMILY_PAGE, OUString() ))); break; case SC_SERVICE_AUTOFORMAT: xRet.set(static_cast<container::XIndexAccess*>(new ScAutoFormatObj( SC_AFMTOBJ_INVALID ))); diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index c7e87878f209..019f576376be 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -67,7 +67,7 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems() { static const SvEventDescription aMacroDescriptionsImpl[] = { - { 0, NULL } + { 0, nullptr } }; return aMacroDescriptionsImpl; } @@ -77,7 +77,7 @@ ScMacroInfo* ScShapeObj_getShapeHyperMacroInfo( ScShapeObj* pShape, bool bCreate if( pShape ) if( SdrObject* pObj = pShape->GetSdrObject() ) return ScDrawLayer::GetMacroInfo( pObj, bCreate ); - return 0; + return nullptr; } namespace @@ -90,8 +90,8 @@ namespace } ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& xShape ) : - pShapePropertySet(NULL), - pShapePropertyState(NULL), + pShapePropertySet(nullptr), + pShapePropertyState(nullptr), bIsTextShape(false), bIsNoteCaption(false), bInitializedNotifier(false) @@ -105,13 +105,13 @@ ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& xShape ) : if (mxShapeAgg.is()) { - xShape = NULL; // during setDelegator, mxShapeAgg must be the only ref + xShape = nullptr; // during setDelegator, mxShapeAgg must be the only ref mxShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) ); xShape.set(uno::Reference<drawing::XShape>( mxShapeAgg, uno::UNO_QUERY )); - bIsTextShape = ( SvxUnoTextBase::getImplementation( mxShapeAgg ) != NULL ); + bIsTextShape = ( SvxUnoTextBase::getImplementation( mxShapeAgg ) != nullptr ); } { @@ -1309,7 +1309,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScShapeObj::getParent() throw (uno::R } } - return 0; + return nullptr; } void SAL_CALL ScShapeObj::setParent( const uno::Reference< uno::XInterface >& ) throw (lang::NoSupportException, uno::RuntimeException, std::exception) @@ -1354,7 +1354,7 @@ SdrObject* ScShapeObj::GetSdrObject() const throw() return pShape->GetSdrObject(); } - return NULL; + return nullptr; } #define SC_EVENTACC_ONCLICK "OnClick" diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index 08bcccba422c..edc4809ed342 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -235,7 +235,7 @@ const uno::Sequence<sal_Int8>& ScCellSearchObj::getUnoTunnelId() ScCellSearchObj* ScCellSearchObj::getImplementation(const uno::Reference<util::XSearchDescriptor>& rObj) { - ScCellSearchObj* pRet = NULL; + ScCellSearchObj* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScCellSearchObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index c0d33728dbe6..6dd6b5701a47 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -416,7 +416,7 @@ void ScStyleFamiliesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -432,7 +432,7 @@ ScStyleFamilyObj*ScStyleFamiliesObj::GetObjectByType_Impl(sal_uInt16 nType) cons return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE ); } OSL_FAIL("getStyleFamilyByType: keine DocShell oder falscher Typ"); - return NULL; + return nullptr; } ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByIndex_Impl(sal_uInt32 nIndex) const @@ -440,7 +440,7 @@ ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByIndex_Impl(sal_uInt32 nIndex) c if ( nIndex < SC_STYLE_FAMILY_COUNT ) return GetObjectByType_Impl(aStyleFamilyTypes[nIndex]); - return NULL; // ungueltiger Index + return nullptr; // ungueltiger Index } ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByName_Impl(const OUString& aName) const @@ -454,7 +454,7 @@ ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByName_Impl(const OUString& aName return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE ); } // no assertion - called directly from getByName - return NULL; + return nullptr; } // container::XIndexAccess @@ -633,7 +633,7 @@ void ScStyleFamilyObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -656,7 +656,7 @@ ScStyleObj* ScStyleFamilyObj::GetObjectByIndex_Impl(sal_uInt32 nIndex) } } } - return NULL; + return nullptr; } ScStyleObj* ScStyleFamilyObj::GetObjectByName_Impl(const OUString& aName) @@ -670,7 +670,7 @@ ScStyleObj* ScStyleFamilyObj::GetObjectByName_Impl(const OUString& aName) if ( pStylePool->Find( aString, eFamily ) ) return new ScStyleObj( pDocShell, eFamily, aString ); } - return NULL; + return nullptr; } void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::Any& aElement ) @@ -1011,7 +1011,7 @@ const uno::Sequence<sal_Int8>& ScStyleObj::getUnoTunnelId() ScStyleObj* ScStyleObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScStyleObj* pRet = NULL; + ScStyleObj* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScStyleObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -1025,7 +1025,7 @@ void ScStyleObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) { - pDocShell = NULL; // ungueltig geworden + pDocShell = nullptr; // ungueltig geworden } } @@ -1037,7 +1037,7 @@ SfxStyleSheetBase* ScStyleObj::GetStyle_Impl() ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); return pStylePool->Find( aStyleName, eFamily ); } - return NULL; + return nullptr; } // style::XStyle @@ -1183,7 +1183,7 @@ const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName, SfxStyleSheetBase* pStyle = GetStyle_Impl(); if (pStyle) { - const SfxItemPropertySimpleEntry* pEntry = NULL; + const SfxItemPropertySimpleEntry* pEntry = nullptr; if ( eFamily == SFX_STYLE_FAMILY_PAGE ) { pEntry = lcl_GetHeaderStyleMap()->getByName( rPropName ); @@ -1207,8 +1207,8 @@ const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName, } } - rpResultEntry = NULL; - return NULL; + rpResultEntry = nullptr; + return nullptr; } beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const OUString& aPropertyName ) @@ -1217,7 +1217,7 @@ beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const OUString& aPro SolarMutexGuard aGuard; beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE; - const SfxItemPropertySimpleEntry* pResultEntry = NULL; + const SfxItemPropertySimpleEntry* pResultEntry = nullptr; const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry ); if ( pItemSet && pResultEntry ) @@ -1278,7 +1278,7 @@ void SAL_CALL ScStyleObj::setPropertyToDefault( const OUString& aPropertyName ) if ( !pEntry ) throw beans::UnknownPropertyException(); - SetOnePropertyValue( aPropertyName, pEntry, NULL ); + SetOnePropertyValue( aPropertyName, pEntry, nullptr ); } uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const OUString& aPropertyName ) @@ -1288,7 +1288,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const OUString& aPropertyName SolarMutexGuard aGuard; uno::Any aAny; - const SfxItemPropertySimpleEntry* pResultEntry = NULL; + const SfxItemPropertySimpleEntry* pResultEntry = nullptr; const SfxItemSet* pStyleSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry ); if ( pStyleSet && pResultEntry ) @@ -1506,7 +1506,7 @@ void SAL_CALL ScStyleObj::setPropertiesToDefault( const uno::Sequence<OUString>& for (sal_Int32 i = 0; i < nCount; i++) { const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( pNames[i] ); - SetOnePropertyValue( pNames[i], pEntry, NULL ); + SetOnePropertyValue( pNames[i], pEntry, nullptr ); } } } @@ -1883,7 +1883,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName ) } else { - const SfxItemPropertySimpleEntry* pResultEntry = NULL; + const SfxItemPropertySimpleEntry* pResultEntry = nullptr; const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry ); if ( pItemSet && pResultEntry ) diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx index d4032eb5fd6b..17da342e3ab8 100644 --- a/sc/source/ui/unoobj/targuno.cxx +++ b/sc/source/ui/unoobj/targuno.cxx @@ -85,7 +85,7 @@ void ScLinkTargetTypesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // document gone + pDocShell = nullptr; // document gone } // container::XNameAccess @@ -154,7 +154,7 @@ void ScLinkTargetTypeObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pDocShell = NULL; // document gone + pDocShell = nullptr; // document gone } // document::XLinkTargetSupplier @@ -185,7 +185,7 @@ uno::Reference< container::XNameAccess > SAL_CALL ScLinkTargetTypeObj::getLinks // beans::XPropertySet as ElementType in container::XNameAccess. if ( xCollection.is() ) return new ScLinkTargetsObj( xCollection ); - return NULL; + return nullptr; } // beans::XPropertySet diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index ac01ca7d63cf..736e96140b3f 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -176,11 +176,11 @@ rtl::Reference<ScHeaderFooterContentObj> ScHeaderFooterContentObj::getImplementa ScHeaderFooterTextData::ScHeaderFooterTextData( rtl::Reference<ScHeaderFooterContentObj> const & rContent, sal_uInt16 nP, const EditTextObject* pTextObj) : - mpTextObj(pTextObj ? pTextObj->Clone() : NULL), + mpTextObj(pTextObj ? pTextObj->Clone() : nullptr), rContentObj( rContent ), nPart( nP ), - pEditEngine( NULL ), - pForwarder( NULL ), + pEditEngine( nullptr ), + pForwarder( nullptr ), bDataValid(false) { } @@ -517,7 +517,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScHeaderFooterTextObj::getTextFi throw(uno::RuntimeException, std::exception) { // sowas gibts nicht im Calc (?) - return NULL; + return nullptr; } // XTextRangeMover @@ -649,7 +649,7 @@ const uno::Sequence<sal_Int8>& ScCellTextCursor::getUnoTunnelId() ScCellTextCursor* ScCellTextCursor::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScCellTextCursor* pRet = NULL; + ScCellTextCursor* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScCellTextCursor*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -744,7 +744,7 @@ const uno::Sequence<sal_Int8>& ScHeaderFooterTextCursor::getUnoTunnelId() ScHeaderFooterTextCursor* ScHeaderFooterTextCursor::getImplementation( const uno::Reference<uno::XInterface>& rObj) { - ScHeaderFooterTextCursor* pRet = NULL; + ScHeaderFooterTextCursor* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScHeaderFooterTextCursor*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -837,7 +837,7 @@ const uno::Sequence<sal_Int8>& ScDrawTextCursor::getUnoTunnelId() ScDrawTextCursor* ScDrawTextCursor::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScDrawTextCursor* pRet = NULL; + ScDrawTextCursor* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScDrawTextCursor*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -850,7 +850,7 @@ ScSimpleEditSourceHelper::ScSimpleEditSourceHelper() pEnginePool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); pEnginePool->FreezeIdRanges(); - pEditEngine = new ScFieldEditEngine(NULL, pEnginePool, NULL, true); // TRUE: become owner of pool + pEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); // TRUE: become owner of pool pForwarder = new SvxEditEngineForwarder( *pEditEngine ); pOriginalSource = new ScSimpleEditSource( pForwarder ); } @@ -890,9 +890,9 @@ EditTextObject* ScEditEngineTextObj::CreateTextObject() ScCellTextData::ScCellTextData(ScDocShell* pDocSh, const ScAddress& rP) : pDocShell( pDocSh ), aCellPos( rP ), - pEditEngine( NULL ), - pForwarder( NULL ), - pOriginalSource( NULL ), + pEditEngine( nullptr ), + pForwarder( nullptr ), + pOriginalSource( nullptr ), bDataValid( false ), bInUpdate( false ), bDirty( false ), @@ -948,7 +948,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder() { SfxItemPool* pEnginePool = EditEngine::CreatePool(); pEnginePool->FreezeIdRanges(); - pEditEngine = new ScFieldEditEngine(NULL, pEnginePool, NULL, true); + pEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); } // currently, GetPortions doesn't work if UpdateMode is sal_False, // this will be fixed (in EditEngine) by src600 @@ -1002,7 +1002,7 @@ void ScCellTextData::UpdateData() { if ( bDoUpdate ) { - OSL_ENSURE(pEditEngine != NULL, "no EditEngine for UpdateData()"); + OSL_ENSURE(pEditEngine != nullptr, "no EditEngine for UpdateData()"); if ( pDocShell && pEditEngine ) { // during the own UpdateData call, bDataValid must not be reset, @@ -1032,7 +1032,7 @@ void ScCellTextData::Notify( SfxBroadcaster&, const SfxHint& rHint ) sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) { - pDocShell = NULL; // invalid now + pDocShell = nullptr; // invalid now DELETEZ( pForwarder ); DELETEZ( pEditEngine ); // EditEngine uses document's pool diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index 81cecbdaa3c2..6e769d03bd61 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -82,7 +82,7 @@ void ScFormulaParserObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - mpDocShell = NULL; + mpDocShell = nullptr; } // XFormulaParser diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 1eed0551b3d5..e9a385f2823d 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -138,7 +138,7 @@ void ScViewPaneBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING ) - pViewShell = NULL; + pViewShell = nullptr; } uno::Any SAL_CALL ScViewPaneBase::queryInterface( const uno::Type& rType ) @@ -296,7 +296,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScViewPaneBase::getReferredCells() return new ScCellRangeObj( pDocSh, aRange ); } - return NULL; + return nullptr; } namespace @@ -313,7 +313,7 @@ namespace _rpWindow = _pViewShell->GetWindowByPos( eWhich ); _rpSdrView = _pViewShell->GetSdrView(); _rpFormShell = _pViewShell->GetFormShell(); - return ( _rpFormShell != NULL ) && ( _rpSdrView != NULL )&& ( _rpWindow != NULL ); + return ( _rpFormShell != nullptr ) && ( _rpSdrView != nullptr )&& ( _rpWindow != nullptr ); } } @@ -324,9 +324,9 @@ uno::Reference< form::runtime::XFormController > SAL_CALL ScViewPaneBase::getFor uno::Reference< form::runtime::XFormController > xController; - vcl::Window* pWindow( NULL ); - SdrView* pSdrView( NULL ); - FmFormShell* pFormShell( NULL ); + vcl::Window* pWindow( nullptr ); + SdrView* pSdrView( nullptr ); + FmFormShell* pFormShell( nullptr ); if ( lcl_prepareFormShellCall( pViewShell, nPane, pFormShell, pWindow, pSdrView ) ) xController = FmFormShell::GetFormController( _Form, *pSdrView, *pWindow ); @@ -339,7 +339,7 @@ sal_Bool SAL_CALL ScViewPaneBase::isFormDesignMode( ) throw (uno::RuntimeExcept bool bIsFormDesignMode( true ); - FmFormShell* pFormShell( pViewShell ? pViewShell->GetFormShell() : NULL ); + FmFormShell* pFormShell( pViewShell ? pViewShell->GetFormShell() : nullptr ); if ( pFormShell ) bIsFormDesignMode = pFormShell->IsDesignMode(); @@ -350,9 +350,9 @@ void SAL_CALL ScViewPaneBase::setFormDesignMode( sal_Bool _DesignMode ) throw (u { SolarMutexGuard aGuard; - vcl::Window* pWindow( NULL ); - SdrView* pSdrView( NULL ); - FmFormShell* pFormShell( NULL ); + vcl::Window* pWindow( nullptr ); + SdrView* pSdrView( nullptr ); + FmFormShell* pFormShell( nullptr ); if ( lcl_prepareFormShellCall( pViewShell, nPane, pFormShell, pWindow, pSdrView ) ) pFormShell->SetDesignMode( _DesignMode ); } @@ -367,9 +367,9 @@ uno::Reference<awt::XControl> SAL_CALL ScViewPaneBase::getControl( uno::Reference<awt::XControl> xRet; - vcl::Window* pWindow( NULL ); - SdrView* pSdrView( NULL ); - FmFormShell* pFormShell( NULL ); + vcl::Window* pWindow( nullptr ); + SdrView* pSdrView( nullptr ); + FmFormShell* pFormShell( nullptr ); if ( lcl_prepareFormShellCall( pViewShell, nPane, pFormShell, pWindow, pSdrView ) ) pFormShell->GetFormControl( xModel, *pSdrView, *pWindow, xRet ); @@ -807,7 +807,7 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) long nCount = xShapeColl->getCount(); if (nCount) { - SdrPageView* pPV = NULL; + SdrPageView* pPV = nullptr; bool bAllMarked(true); for ( long i = 0; i < nCount; i++ ) { @@ -865,7 +865,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() { SolarMutexGuard aGuard; ScTabViewShell* pViewSh = GetViewShell(); - ScCellRangesBase* pObj = NULL; + ScCellRangesBase* pObj = nullptr; if (pViewSh) { // Ist auf dem Drawing-Layer etwas selektiert? @@ -1067,7 +1067,7 @@ ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) const return new ScViewPaneObj( pViewSh, sal::static_int_cast<sal_uInt16>(eWhich) ); } - return NULL; + return nullptr; } uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet() @@ -1081,7 +1081,7 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet() SCTAB nTab = rViewData.GetTabNo(); return new ScTableSheetObj( rViewData.GetDocShell(), nTab ); } - return NULL; + return nullptr; } // support expand (but not replace) the active sheet @@ -1129,7 +1129,7 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP ScDocument* pDoc = rData.GetDocument(); if (pDoc && pDoc->GetDrawLayer()) { - SdrPage* pDrawPage = NULL; + SdrPage* pDrawPage = nullptr; ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab)) pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); @@ -1149,7 +1149,7 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP for (size_t i = 0; i < nCount && !bFound; ++i) { SdrObject* pObj = pDrawPage->GetObj(i); - if (pObj && SdrObjectPrimitiveHit(*pObj, aPos, nHitLog, *pDrawView->GetSdrPageView(), 0, false)) + if (pObj && SdrObjectPrimitiveHit(*pObj, aPos, nHitLog, *pDrawView->GetSdrPageView(), nullptr, false)) { xTarget.set(pObj->getUnoShape(), uno::UNO_QUERY); bFound = true; @@ -1955,7 +1955,7 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName vcl::Window* pActiveWin = rViewData.GetActiveWin(); if ( pActiveWin ) { - Rectangle aRect = pActiveWin->GetWindowExtentsRelative( NULL ); + Rectangle aRect = pActiveWin->GetWindowExtentsRelative( nullptr ); aRet <<= AWTRectangle( aRect ); } } @@ -2205,7 +2205,7 @@ const uno::Sequence<sal_Int8>& ScTabViewObj::getUnoTunnelId() ScTabViewObj* ScTabViewObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) { - ScTabViewObj* pRet = NULL; + ScTabViewObj* pRet = nullptr; uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast<ScTabViewObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); @@ -2339,7 +2339,7 @@ void ScPreviewObj::Notify(SfxBroadcaster&, const SfxHint& rHint) { const SfxSimpleHint* p = dynamic_cast<const SfxSimpleHint*>(&rHint); if (p && p->GetId() == SFX_HINT_DYING) - mpViewShell = NULL; + mpViewShell = nullptr; } uno::Sequence<sal_Int32> ScPreviewObj::getSelectedSheets() diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 557764cd4a88..e6f583b8ac39 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -162,10 +162,10 @@ implnCopy( const uno::Reference< frame::XModel>& xModel ) ScTabViewShell* pViewShell = getBestViewShell( xModel ); if ( pViewShell ) { - pViewShell->CopyToClip(NULL,false,false,true); + pViewShell->CopyToClip(nullptr,false,false,true); // mark the copied transfer object so it is used in ScVbaRange::Insert - ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL ); + ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( nullptr ); if (pClipObj) pClipObj->SetUseInApi( true ); } @@ -177,10 +177,10 @@ implnCut( const uno::Reference< frame::XModel>& xModel ) ScTabViewShell* pViewShell = getBestViewShell( xModel ); if ( pViewShell ) { - pViewShell->CutToClip( NULL, true ); + pViewShell->CutToClip( nullptr, true ); // mark the copied transfer object so it is used in ScVbaRange::Insert - ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL ); + ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( nullptr ); if (pClipObj) pClipObj->SetUseInApi( true ); } @@ -199,7 +199,7 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, InsertDele if (pWin) { ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); - ScDocument* pDoc = NULL; + ScDocument* pDoc = nullptr; if ( pOwnClip ) pDoc = pOwnClip->GetDocument(); pTabViewShell->PasteFromClip( nFlags, pDoc, @@ -216,7 +216,7 @@ getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) { uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW ); ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() ); - ScDocShell* pDocShell = NULL; + ScDocShell* pDocShell = nullptr; if ( pModel ) pDocShell = static_cast<ScDocShell*>(pModel->GetEmbeddedObject()); return pDocShell; @@ -229,7 +229,7 @@ getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ScDocShell* pDocShell = getDocShell( xModel ); if ( pDocShell ) return pDocShell->GetBestViewShell(); - return NULL; + return nullptr; } ScTabViewShell* @@ -245,7 +245,7 @@ getViewFrame( const uno::Reference< frame::XModel >& xModel ) ScTabViewShell* pViewShell = getBestViewShell( xModel ); if ( pViewShell ) return pViewShell->GetViewFrame(); - return NULL; + return nullptr; } uno::Reference< XHelperInterface > @@ -371,7 +371,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& SfxItemSet* ScVbaCellRangeAccess::GetDataSet( ScCellRangesBase* pRangeObj ) { - return pRangeObj ? pRangeObj->GetCurrentDataSet( true ) : 0; + return pRangeObj ? pRangeObj->GetCurrentDataSet( true ) : nullptr; } } // namespace excel diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index ef3f6ea6652f..d60d9378017b 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -1085,7 +1085,7 @@ uno::Reference< excel::XRange > lclCreateVbaRange( uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) ); return new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), rxContext, xRanges ); } - return 0; + return nullptr; } } // namespace @@ -1235,7 +1235,7 @@ ScVbaApplication::getDisplayFormulaBar() reqList.Put( sfxFormBar ); pViewShell->GetState( reqList ); - const SfxPoolItem *pItem=0; + const SfxPoolItem *pItem=nullptr; if ( reqList.GetItemState( FID_TOGGLEINPUTLINE, false, &pItem ) == SfxItemState::SET ) bRes = static_cast<const SfxBoolItem*>(pItem)->GetValue(); } diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx index 2ff217c96f24..1c51d1e503a0 100644 --- a/sc/source/ui/vba/vbachartobject.cxx +++ b/sc/source/ui/vba/vbachartobject.cxx @@ -74,7 +74,7 @@ ScVbaChartObject::setShape() throw ( script::BasicErrorException ) { throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), ERRCODE_BASIC_METHOD_FAILED, OUString() ); } - return NULL; + return nullptr; } void SAL_CALL diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx index 812ff0363fef..0a9435d331ed 100644 --- a/sc/source/ui/vba/vbachartobjects.cxx +++ b/sc/source/ui/vba/vbachartobjects.cxx @@ -94,7 +94,7 @@ ScVbaChartObjects::getChartObjectNames() throw( css::script::BasicErrorException // c++ hackery uno::Reference< uno::XInterface > xIf( xDrawPageSupplier, uno::UNO_QUERY_THROW ); ScCellRangesBase* pUno= dynamic_cast< ScCellRangesBase* >( xIf.get() ); - ScDocShell* pDocShell = NULL; + ScDocShell* pDocShell = nullptr; if ( !pUno ) throw uno::RuntimeException("Failed to obtain the impl class from the drawpage" ); pDocShell = pUno->GetDocShell(); diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index 1957fc075c2a..c37b1d6d3be5 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -102,7 +102,7 @@ uno::Reference< awt::XWindow > lclGetWindowForController( const uno::Reference< catch( uno::Exception& ) { } - return 0; + return nullptr; } } // namespace @@ -181,7 +181,7 @@ ScVbaEventListener::ScVbaEventListener( ScVbaEventsHelper& rVbaEvents, const uno mrVbaEvents( rVbaEvents ), mxModel( rxModel ), mpDocShell( pDocShell ), - mpActiveWindow( 0 ), + mpActiveWindow( nullptr ), mbWindowResized( false ), mbBorderChanged( false ), mbDisposed( !rxModel.is() ) @@ -246,7 +246,7 @@ void ScVbaEventListener::stopControllerListening( const uno::Reference< frame::X { maControllers.erase( pWindow ); if( pWindow == mpActiveWindow ) - mpActiveWindow = 0; + mpActiveWindow = nullptr; } } @@ -305,7 +305,7 @@ void SAL_CALL ScVbaEventListener::windowDeactivated( const lang::EventObject& rE if( pWindow && (pWindow == mpActiveWindow) ) processWindowActivateEvent( pWindow, false ); // forget pointer to the active window - mpActiveWindow = 0; + mpActiveWindow = nullptr; } } @@ -522,7 +522,7 @@ ScVbaEventsHelper::ScVbaEventsHelper( const uno::Sequence< uno::Any >& rArgs, co mbOpened( false ) { mpDocShell = dynamic_cast< ScDocShell* >( mpShell ); // mpShell from base class - mpDoc = mpDocShell ? &mpDocShell->GetDocument() : 0; + mpDoc = mpDocShell ? &mpDocShell->GetDocument() : nullptr; if( !mxModel.is() || !mpDocShell || !mpDoc ) return; diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 3af7792cb81f..a66198916a71 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -51,7 +51,7 @@ ScVbaFont::ScVbaFont( SfxItemSet* ScVbaFont::GetDataSet() { - return mpRangeObj ? excel::ScVbaCellRangeAccess::GetDataSet( mpRangeObj ) : 0; + return mpRangeObj ? excel::ScVbaCellRangeAccess::GetDataSet( mpRangeObj ) : nullptr; } ScVbaFont::~ScVbaFont() diff --git a/sc/source/ui/vba/vbafont.hxx b/sc/source/ui/vba/vbafont.hxx index eef3261c3465..7a8032a2dfe2 100644 --- a/sc/source/ui/vba/vbafont.hxx +++ b/sc/source/ui/vba/vbafont.hxx @@ -42,7 +42,7 @@ public: const css::uno::Reference< css::uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, const css::uno::Reference< css::beans::XPropertySet >& xPropertySet, - ScCellRangeObj* pRangeObj = 0, bool bFormControl = false ) throw ( css::uno::RuntimeException ); + ScCellRangeObj* pRangeObj = nullptr, bool bFormControl = false ) throw ( css::uno::RuntimeException ); virtual ~ScVbaFont();// {} // Attributes diff --git a/sc/source/ui/vba/vbainterior.hxx b/sc/source/ui/vba/vbainterior.hxx index ca05bd0894f9..5f64f19a8a62 100644 --- a/sc/source/ui/vba/vbainterior.hxx +++ b/sc/source/ui/vba/vbainterior.hxx @@ -57,7 +57,7 @@ protected: void SetMixedColor(); public: ScVbaInterior( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Reference< css::beans::XPropertySet >& xProps, ScDocument* pScDoc = NULL) throw ( css::lang::IllegalArgumentException); + const css::uno::Reference< css::beans::XPropertySet >& xProps, ScDocument* pScDoc = nullptr) throw ( css::lang::IllegalArgumentException); virtual ~ScVbaInterior(){} diff --git a/sc/source/ui/vba/vbapalette.hxx b/sc/source/ui/vba/vbapalette.hxx index a16b417a1a5b..3f5ef8b0eed6 100644 --- a/sc/source/ui/vba/vbapalette.hxx +++ b/sc/source/ui/vba/vbapalette.hxx @@ -34,7 +34,7 @@ class ScVbaPalette private: SfxObjectShell* m_pShell; public: - explicit ScVbaPalette( SfxObjectShell* pShell = 0 ) : m_pShell( pShell ) {} + explicit ScVbaPalette( SfxObjectShell* pShell = nullptr ) : m_pShell( pShell ) {} explicit ScVbaPalette( const css::uno::Reference< css::frame::XModel >& rxModel ); // if no palette available e.g. because the document doesn't have a // palette defined then a default palette will be returned. diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 28e8d132ff39..ce399b394a01 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1199,7 +1199,7 @@ bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, ScRang ScRangeName* pRangeName = rDoc.GetRangeName(nCurTab); if (pRangeName) { - bool bLocalName = pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(sAddress)) != NULL; + bool bLocalName = pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(sAddress)) != nullptr; // TODO: Handle local names correctly. (void)bLocalName; } @@ -2007,7 +2007,7 @@ ScVbaRange::setFormulaArray(const uno::Any& rFormula) throw (uno::RuntimeExcepti ScTokenArray aTokenArray; (void)ScTokenConversion::ConvertToTokenArray( getScDocument(), aTokenArray, aTokens ); - getScDocShell()->GetDocFunc().EnterMatrix( *getScRangeList()[0], NULL, &aTokenArray, OUString(), true, true, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); + getScDocShell()->GetDocFunc().EnterMatrix( *getScRangeList()[0], nullptr, &aTokenArray, OUString(), true, true, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 ); } OUString @@ -2122,7 +2122,7 @@ ScVbaRange::Font() throw ( script::BasicErrorException, uno::RuntimeException) xProps.set(mxRanges, ::uno::UNO_QUERY ); ScVbaPalette aPalette( rDoc.GetDocumentShell() ); - ScCellRangeObj* pRangeObj = NULL; + ScCellRangeObj* pRangeObj = nullptr; try { pRangeObj = getCellRangeObj(); @@ -2953,7 +2953,7 @@ ScVbaRange::getComment() throw (uno::RuntimeException, std::exception) // comment defined uno::Reference< excel::XComment > xComment( new ScVbaComment( this, mxContext, getUnoModel(), mxRange ) ); if ( xComment->Text( uno::Any(), uno::Any(), uno::Any() ).isEmpty() ) - return NULL; + return nullptr; return xComment; } @@ -4244,7 +4244,7 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC // Helper functions for AutoFilter static ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) { - ScDBData* pRet = NULL; + ScDBData* pRet = nullptr; if (pDocShell) { pRet = pDocShell->GetDocument().GetAnonymousDBData(nSheet); @@ -4260,7 +4260,7 @@ static void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam ) if ( pViewData ) { OSL_TRACE("Pushing out SelectAll query"); - pViewData->GetView()->Query( aParam, NULL, true ); + pViewData->GetView()->Query( aParam, nullptr, true ); } } } @@ -4412,7 +4412,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const RangeHelper multiCellRange( mxRange ); autoFiltAddress = multiCellRange.getCellRangeAddressable()->getRangeAddress(); // #163530# Filter box shows only entry of first row - ScDocument* pDocument = ( pShell ? &pShell->GetDocument() : NULL ); + ScDocument* pDocument = ( pShell ? &pShell->GetDocument() : nullptr ); if ( pDocument ) { SCCOL nStartCol = autoFiltAddress.StartColumn; @@ -4444,7 +4444,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const // set header (autofilter always need column headers) uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW ); bool bHasColHeader = false; - ScDocument* pDoc = pShell ? &pShell->GetDocument() : NULL; + ScDocument* pDoc = pShell ? &pShell->GetDocument() : nullptr; if (pDoc) { bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) ); @@ -4662,7 +4662,7 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& /*CopyOrigin*/ ) thro // Paste from clipboard only if the clipboard content was copied via VBA, and not already pasted via VBA again. // "Insert" behavior should not depend on random clipboard content previously copied by the user. - ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL ); + ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( nullptr ); if ( pClipObj && pClipObj->GetUseInApi() ) { // After the insert ( this range ) actually has moved @@ -4935,7 +4935,7 @@ ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeExceptio void SAL_CALL ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& ActivePrinter, const uno::Any& PrintToFile, const uno::Any& Collate, const uno::Any& PrToFileName ) throw (uno::RuntimeException, std::exception) { - ScDocShell* pShell = NULL; + ScDocShell* pShell = nullptr; sal_Int32 nItems = m_Areas->getCount(); uno::Sequence< table::CellRangeAddress > printAreas( nItems ); @@ -5078,7 +5078,7 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const } double fEndValue = MAXDOUBLE; ScDocShell* pDocSh = getDocShellFromRange( mxRange ); - pDocSh->GetDocFunc().FillAuto( aSourceRange, NULL, eDir, eCmd, eDateCmd, + pDocSh->GetDocFunc().FillAuto( aSourceRange, nullptr, eDir, eCmd, eDateCmd, nCount, fStep, fEndValue, true, true ); } sal_Bool SAL_CALL diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx index 582bb9797d45..27e11885f920 100644 --- a/sc/source/ui/vba/vbasheetobject.cxx +++ b/sc/source/ui/vba/vbasheetobject.cxx @@ -107,7 +107,7 @@ void SAL_CALL ScVbaButtonCharacters::setText( const OUString& rText ) throw (uno uno::Reference< excel::XFont > SAL_CALL ScVbaButtonCharacters::getFont() throw (uno::RuntimeException, std::exception) { - return new ScVbaFont( this, mxContext, maPalette, mxPropSet, 0, true ); + return new ScVbaFont( this, mxContext, maPalette, mxPropSet, nullptr, true ); } void SAL_CALL ScVbaButtonCharacters::setFont( const uno::Reference< excel::XFont >& /*rxFont*/ ) throw (uno::RuntimeException, std::exception) @@ -437,7 +437,7 @@ void SAL_CALL ScVbaButton::setCaption( const OUString& rCaption ) throw (uno::Ru uno::Reference< excel::XFont > SAL_CALL ScVbaButton::getFont() throw (uno::RuntimeException, std::exception) { - return new ScVbaFont( this, mxContext, maPalette, mxControlProps, 0, true ); + return new ScVbaFont( this, mxContext, maPalette, mxControlProps, nullptr, true ); } void SAL_CALL ScVbaButton::setFont( const uno::Reference< excel::XFont >& /*rxFont*/ ) throw (uno::RuntimeException, std::exception) diff --git a/sc/source/ui/vba/vbatextboxshape.cxx b/sc/source/ui/vba/vbatextboxshape.cxx index 747aad67543d..f3f1c7e7221d 100644 --- a/sc/source/ui/vba/vbatextboxshape.cxx +++ b/sc/source/ui/vba/vbatextboxshape.cxx @@ -47,7 +47,7 @@ uno::Reference< excel::XCharacters > SAL_CALL ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) throw (uno::RuntimeException, std::exception) { ScDocShell* pDocShell = excel::getDocShell( m_xModel ); - ScDocument* pDoc = pDocShell ? &pDocShell->GetDocument() : NULL; + ScDocument* pDoc = pDocShell ? &pDocShell->GetDocument() : nullptr; if ( !pDoc ) throw uno::RuntimeException("Failed to access document from shell" ); diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 13ad4ed2173a..2fb6e1843fd9 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -511,7 +511,7 @@ void ScVbaWorksheets::PrintPreview( const css::uno::Any& /*EnableChanges*/ ) thr // need test, print preview current active sheet // !! TODO !! get view shell from controller ScTabViewShell* pViewShell = excel::getBestViewShell( mxModel ); - SfxViewFrame* pViewFrame = NULL; + SfxViewFrame* pViewFrame = nullptr; if ( pViewShell ) pViewFrame = pViewShell->GetViewFrame(); if ( pViewFrame ) diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx index 8314107b1213..cefd3fa790b2 100644 --- a/sc/source/ui/vba/vbawsfunction.cxx +++ b/sc/source/ui/vba/vbawsfunction.cxx @@ -147,7 +147,7 @@ ScVbaWSFunction::invoke(const OUString& FunctionName, const uno::Sequence< uno:: bool bAsArray = true; // special handing for some functions that don't work correctly in FunctionAccess - ScCompiler aCompiler( 0, ScAddress() ); + ScCompiler aCompiler( nullptr, ScAddress() ); OpCode eOpCode = aCompiler.GetEnglishOpCode( FunctionName.toAsciiUpperCase() ); switch( eOpCode ) { @@ -265,7 +265,7 @@ ScVbaWSFunction::hasMethod(const OUString& Name) throw(uno::RuntimeException, s // the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized. // but the function name used in WorksheetFunction is a programmatic name (seems English). // So m_xNameAccess->hasByName( Name ) may fail to find name when a function name has a localized name. - ScCompiler aCompiler( NULL, ScAddress() ); + ScCompiler aCompiler( nullptr, ScAddress() ); if( aCompiler.IsEnglishSymbol( Name ) ) bIsFound = true; } diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 735e2c7e8527..94952800fa03 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -182,7 +182,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_FILL_SERIES: // fill block case SID_OPENDLG_TABOP: // multiple-cell operations, are at least 2 cells marked? - if (pDoc->GetChangeTrack()!=NULL &&nWhich ==SID_OPENDLG_TABOP) + if (pDoc->GetChangeTrack()!=nullptr &&nWhich ==SID_OPENDLG_TABOP) bDisable = true; else bDisable = (!bSimpleArea) || (nCol1 == nCol2 && nRow1 == nRow2); @@ -406,7 +406,7 @@ static bool lcl_TestFormat( SvxClipboardFormatItem& rFormats, const Transferable void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFormatItem& rFormats ) { vcl::Window* pWin = GetViewData()->GetActiveWin(); - bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL ); + bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != nullptr ); TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) ); @@ -438,7 +438,7 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFormatItem& rFormats static bool lcl_IsCellPastePossible( const TransferableDataHelper& rData ) { bool bPossible = false; - if ( ScTransferObj::GetOwnClipboard( NULL ) || ScDrawTransferObj::GetOwnClipboard( NULL ) ) + if ( ScTransferObj::GetOwnClipboard( nullptr ) || ScDrawTransferObj::GetOwnClipboard( nullptr ) ) bPossible = true; else { @@ -876,7 +876,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) { //! test for data pilot operation } - else if (pDoc->GetChangeTrack()!=NULL || GetViewData()->IsMultiMarked()) + else if (pDoc->GetChangeTrack()!=nullptr || GetViewData()->IsMultiMarked()) { rSet.DisableItem( nWhich ); } @@ -1030,7 +1030,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) case SID_OPENDLG_CONSOLIDATE: case SCITEM_CONSOLIDATEDATA: { - if(pDoc->GetChangeTrack()!=NULL) + if(pDoc->GetChangeTrack()!=nullptr) rSet.DisableItem( nWhich); } break; @@ -1070,11 +1070,11 @@ void ScCellShell::GetState(SfxItemSet &rSet) if ( pDoc && pData && pDoc->IsTabProtected( pData->GetTabNo() ) ) { bool bVisible = false; - SfxViewFrame* pViewFrame = ( pTabViewShell ? pTabViewShell->GetViewFrame() : NULL ); + SfxViewFrame* pViewFrame = ( pTabViewShell ? pTabViewShell->GetViewFrame() : nullptr ); if ( pViewFrame && pViewFrame->HasChildWindow( nWhich ) ) { SfxChildWindow* pChild = pViewFrame->GetChildWindow( nWhich ); - vcl::Window* pWin = ( pChild ? pChild->GetWindow() : NULL ); + vcl::Window* pWin = ( pChild ? pChild->GetWindow() : nullptr ); if ( pWin && pWin->IsVisible() ) { bVisible = true; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 27eb61498720..4c332daaeeca 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -750,7 +750,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if( ! rReq.IsAPI() ) { OUString aPara; - Color* pColor=0; + Color* pColor=nullptr; switch( eFillDir ) { @@ -1746,7 +1746,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if( xInit.is() ) { // initialize dialog - Reference< awt::XWindow > xDialogParentWindow(0); + Reference< awt::XWindow > xDialogParentWindow(nullptr); Sequence<Any> aSeq(1); Any* pArray = aSeq.getArray(); PropertyValue aParam; @@ -2314,7 +2314,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { OUString aChars, aFontName; const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if ( pArgs ) pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); if ( pItem ) diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 578f47e45bbf..c2c19baa525e 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -549,7 +549,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) { OSL_FAIL("SID_FILTER with arguments?"); pTabViewShell->Query( static_cast<const ScQueryItem&>( - pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), NULL, true ); + pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), nullptr, true ); rReq.Done(); } else @@ -570,7 +570,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) { OSL_FAIL("SID_SPECIAL_FILTER with arguments?"); pTabViewShell->Query( static_cast<const ScQueryItem&>( - pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), NULL, true ); + pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), nullptr, true ); rReq.Done(); } else @@ -608,7 +608,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if (rQueryItem.GetAdvancedQuerySource(aAdvSource)) pTabViewShell->Query( rQueryItem.GetQueryData(), &aAdvSource, true ); else - pTabViewShell->Query( rQueryItem.GetQueryData(), NULL, true ); + pTabViewShell->Query( rQueryItem.GetQueryData(), nullptr, true ); rReq.Done( *pReqArgs ); } } @@ -624,7 +624,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) for (SCSIZE i=0; i<nEC; i++) aParam.GetEntry(i).bDoQuery = false; aParam.bDuplicate = true; - pTabViewShell->Query( aParam, NULL, true ); + pTabViewShell->Query( aParam, nullptr, true ); rReq.Done(); } break; @@ -844,7 +844,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) } // cell range picker - SfxAbstractTabDialog* pDlg = pFact->CreateScValidationDlg(NULL, &aArgSet, pTabViewShell); + SfxAbstractTabDialog* pDlg = pFact->CreateScValidationDlg(nullptr, &aArgSet, pTabViewShell); assert(pDlg); //Dialog create fail! short nResult = pDlg->Execute(); @@ -976,7 +976,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE( pFact, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pFact is null!" ); std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( - NULL, OUString(), &aStream, SC_TEXTTOCOLUMNS)); + nullptr, OUString(), &aStream, SC_TEXTTOCOLUMNS)); OSL_ENSURE( pDlg, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pDlg is null!" ); if ( pDlg->Execute() == RET_OK ) @@ -1031,7 +1031,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) // or filter,sort,subtotal (also without import) bool bOk = false; ScDBData* pDBData = pTabViewShell->GetDBData(false,SC_DB_OLD); - if (pDBData && rDoc.GetChangeTrack() == NULL) + if (pDBData && rDoc.GetChangeTrack() == nullptr) { if ( pDBData->HasImportParam() ) bOk = !pDBData->HasImportSelection(); @@ -1068,7 +1068,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) { //! move ReadOnly check to idl flags - if ( pDocSh->IsReadOnly() || rDoc.GetChangeTrack()!=NULL || + if ( pDocSh->IsReadOnly() || rDoc.GetChangeTrack()!=nullptr || GetViewData()->IsMultiMarked() ) { rSet.DisableItem( nWhich ); @@ -1081,7 +1081,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) // only imported data without selection ScDBData* pDBData = pTabViewShell->GetDBData(false,SC_DB_OLD); if (!pDBData || !pDBData->HasImportParam() || pDBData->HasImportSelection() || - rDoc.GetChangeTrack()!=NULL) + rDoc.GetChangeTrack()!=nullptr) { rSet.DisableItem( nWhich ); } @@ -1094,7 +1094,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) rSet.Put(SfxVisibilityItem(nWhich, false)); else // get state (BoolItem) from SfxViewFrame - pTabViewShell->GetViewFrame()->GetSlotState( nWhich, NULL, &rSet ); + pTabViewShell->GetViewFrame()->GetSlotState( nWhich, nullptr, &rSet ); } break; case SID_SBA_BRW_INSERT: diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 934295b1c6d2..d2fd259467b8 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -219,7 +219,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) case FID_INPUTLINE_BLOCK: case FID_INPUTLINE_MATRIX: { - if( pReqArgs == 0 ) //XXX temporary HACK to avoid GPF + if( pReqArgs == nullptr ) //XXX temporary HACK to avoid GPF break; const ScInputStatusItem* pStatusItem @@ -259,7 +259,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) const SfxPoolItem* aArgs[2]; aArgs[0] = &aItem; - aArgs[1] = NULL; + aArgs[1] = nullptr; rBindings.Execute( SID_ENTER_STRING, aArgs ); } else @@ -273,7 +273,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) } else if (nSlot == FID_INPUTLINE_BLOCK) { - pTabViewShell->EnterBlock( aString, NULL ); + pTabViewShell->EnterBlock( aString, nullptr ); rReq.Done(); } else @@ -316,7 +316,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) case FID_CELL_FORMAT: { - if ( pReqArgs != NULL ) + if ( pReqArgs != nullptr ) { // set cell attribute without dialog: @@ -331,7 +331,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ATTR_PATTERN_START, ATTR_PATTERN_END )); - const SfxPoolItem* pAttr = NULL; + const SfxPoolItem* pAttr = nullptr; sal_uInt16 nWhich = 0; for ( nWhich=ATTR_PATTERN_START; nWhich<=ATTR_PATTERN_END; nWhich++ ) @@ -345,7 +345,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) rReq.Done(); } - else if ( pReqArgs == NULL ) + else if ( pReqArgs == nullptr ) { pTabViewShell->ExecuteCellFormatDlg( rReq ); } @@ -466,7 +466,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) } while ( !bValid && i <= MAXTAB + 2 ); - if ( pReqArgs != NULL ) + if ( pReqArgs != nullptr ) { OUString aArgName; OUString aArgComment; @@ -729,7 +729,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) case FID_MERGE_TOGGLE: { bCenter = true; - SfxPoolItem* pItem = 0; + SfxPoolItem* pItem = nullptr; if( rBindings.QueryState( nSlot, pItem ) >= SfxItemState::DEFAULT ) bMerge = !static_cast< SfxBoolItem* >( pItem )->GetValue(); diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx index 0cd2a9fd64f7..5fe24c6716c3 100644 --- a/sc/source/ui/view/cellsh4.cxx +++ b/sc/source/ui/view/cellsh4.cxx @@ -40,7 +40,7 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq ) bool bSel = false; bool bKeep = false; - if ( pReqArgs != NULL ) + if ( pReqArgs != nullptr ) { const SfxPoolItem* pItem; if (pReqArgs->HasItem(FN_PARAM_1, &pItem)) @@ -208,7 +208,7 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) SCsCOLROW nRepeat = 1; const SfxItemSet* pReqArgs = rReq.GetArgs(); // get repetition - if ( pReqArgs != NULL ) + if ( pReqArgs != nullptr ) { const SfxPoolItem* pItem; if (pReqArgs->HasItem(FN_PARAM_1, &pItem)) @@ -396,7 +396,7 @@ void ScCellShell::ExecutePage( SfxRequest& rReq ) bool bSel = false; bool bKeep = false; - if ( pReqArgs != NULL ) + if ( pReqArgs != nullptr ) { const SfxPoolItem* pItem; if (pReqArgs->HasItem(FN_PARAM_2, &pItem)) diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index d56a18a8a1ea..027bf58b0cd3 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -235,7 +235,7 @@ sal_uInt16 ScRowBar::GetEntrySize( SCCOLROW nEntryNo ) const ScDocument* pDoc = pViewData->GetDocument(); SCTAB nTab = pViewData->GetTabNo(); SCROW nLastRow = -1; - if (pDoc->RowHidden(nEntryNo, nTab, NULL, &nLastRow)) + if (pDoc->RowHidden(nEntryNo, nTab, nullptr, &nLastRow)) return 0; else return (sal_uInt16) ScViewData::ToPixel( pDoc->GetOriginalHeight( nEntryNo, diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index f9c3c4b7f099..c1de01ee4a33 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -78,7 +78,7 @@ void ScDBFunc::GotoDBArea( const OUString& rDBName ) ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection eSel ) { ScDocShell* pDocSh = GetViewData().GetDocShell(); - ScDBData* pData = NULL; + ScDBData* pData = nullptr; ScRange aRange; ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange); if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED ) @@ -154,7 +154,7 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection e eMode, SC_DBSEL_KEEP ); if (!pData) - return NULL; + return nullptr; if (bMark) { @@ -171,7 +171,7 @@ ScDBData* ScDBFunc::GetAnonymousDBData() ScRange aRange; ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange); if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED) - return NULL; + return nullptr; // Expand to used data area if not explicitly marked. const ScMarkData& rMarkData = GetViewData().GetMarkData(); @@ -340,7 +340,7 @@ void ScDBFunc::ToggleAutoFilter() for (SCSIZE i=0; i<nEC; i++) aParam.GetEntry(i).bDoQuery = false; aParam.bDuplicate = true; - Query( aParam, NULL, true ); + Query( aParam, nullptr, true ); pDocSh->GetUndoManager()->LeaveListAction(); @@ -451,7 +451,7 @@ bool ScDBFunc::ImportData( const ScImportParam& rParam, bool bRecord ) } ScDBDocFunc aDBDocFunc( *GetViewData().GetDocShell() ); - return aDBDocFunc.DoImport( GetViewData().GetTabNo(), rParam, NULL, bRecord ); + return aDBDocFunc.DoImport( GetViewData().GetTabNo(), rParam, nullptr, bRecord ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 4e48e43275bf..02bc6c82e5bb 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -147,7 +147,7 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow ) { ScOutlineArray& rArray = pTable->GetColArray(); ScSubOutlineIterator aColIter( &rArray ); - while ((pEntry=aColIter.GetNext()) != NULL && !bColFound) + while ((pEntry=aColIter.GetNext()) != nullptr && !bColFound) { nStart = pEntry->GetStart(); nEnd = pEntry->GetEnd(); @@ -162,7 +162,7 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow ) { ScOutlineArray& rArray = pTable->GetRowArray(); ScSubOutlineIterator aRowIter( &rArray ); - while ((pEntry=aRowIter.GetNext()) != NULL && !bRowFound) + while ((pEntry=aRowIter.GetNext()) != nullptr && !bRowFound) { nStart = pEntry->GetStart(); nEnd = pEntry->GetEnd(); @@ -277,7 +277,7 @@ bool ScDBFunc::OutlinePossible(bool bHide) ScOutlineArray& rColArray = pTable->GetColArray(); ScSubOutlineIterator aColIter( &rColArray ); - while ((pEntry=aColIter.GetNext()) != NULL && !bEnable) + while ((pEntry=aColIter.GetNext()) != nullptr && !bEnable) { nStart = pEntry->GetStart(); nEnd = pEntry->GetEnd(); @@ -299,7 +299,7 @@ bool ScDBFunc::OutlinePossible(bool bHide) ScOutlineArray& rRowArray = pTable->GetRowArray(); ScSubOutlineIterator aRowIter( &rRowArray ); - while ((pEntry=aRowIter.GetNext()) != NULL) + while ((pEntry=aRowIter.GetNext()) != nullptr) { nStart = pEntry->GetStart(); nEnd = pEntry->GetEnd(); @@ -409,10 +409,10 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord, ScDocShellModificator aModificator( *pDocSh ); ScSubTotalParam aNewParam( rParam ); // change end of range - ScDocument* pUndoDoc = NULL; - ScOutlineTable* pUndoTab = NULL; - ScRangeName* pUndoRange = NULL; - ScDBCollection* pUndoDB = NULL; + ScDocument* pUndoDoc = nullptr; + ScOutlineTable* pUndoTab = nullptr; + ScRangeName* pUndoRange = nullptr; + ScDBCollection* pUndoDB = nullptr; if (bRecord) // record old data { @@ -616,7 +616,7 @@ bool ScDBFunc::MakePivotTable( else aObj.SetSaveData( rData ); - bool bAllowMove = (pDPObj != NULL); // allow re-positioning when editing existing table + bool bAllowMove = (pDPObj != nullptr); // allow re-positioning when editing existing table ScDBDocFunc aFunc( *pDocSh ); bool bSuccess = aFunc.DataPilotUpdate(pDPObj, &aObj, true, false, bAllowMove); @@ -1111,12 +1111,12 @@ void ScDBFunc::GroupDataPilot() } } - ScDPSaveGroupDimension* pNewGroupDim = NULL; + ScDPSaveGroupDimension* pNewGroupDim = nullptr; if ( !pGroupDimension ) { // create a new group dimension OUString aGroupDimName = - pDimData->CreateGroupDimName(aBaseDimName, *pDPObj, false, NULL); + pDimData->CreateGroupDimName(aBaseDimName, *pDPObj, false, nullptr); pNewGroupDim = new ScDPSaveGroupDimension( aBaseDimName, aGroupDimName ); pGroupDimension = pNewGroupDim; // make changes to the new dim if none existed @@ -1174,7 +1174,7 @@ void ScDBFunc::GroupDataPilot() delete pNewGroupDim; // AddGroupDimension copies the object // don't access pGroupDimension after here } - pGroupDimension = pNewGroupDim = NULL; + pGroupDimension = pNewGroupDim = nullptr; // set orientation ScDPSaveDimension* pSaveDimension = aData.GetDimensionByName( aGroupDimName ); @@ -1588,7 +1588,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) static void lcl_MoveToEnd( ScDPSaveDimension& rDim, const OUString& rItemName ) { - ScDPSaveMember* pNewMember = NULL; + ScDPSaveMember* pNewMember = nullptr; const ScDPSaveMember* pOldMember = rDim.GetExistingMemberByName( rItemName ); if ( pOldMember ) pNewMember = new ScDPSaveMember( *pOldMember ); @@ -1908,7 +1908,7 @@ void ScDBFunc::SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName // add the new dimension with the same orientation, at the end ScDPSaveDimension* pNewDim = aData.GetDimensionByName( *pNewDimensionName ); - ScDPSaveDimension* pDuplicated = NULL; + ScDPSaveDimension* pDuplicated = nullptr; if ( pNewDim->GetOrientation() == sheet::DataPilotFieldOrientation_DATA ) { // Need to duplicate the dimension, create column/row in addition to data: @@ -2105,10 +2105,10 @@ void ScDBFunc::RepeatDB( bool bRecord ) //! undo only needed data ? - ScDocument* pUndoDoc = NULL; - ScOutlineTable* pUndoTab = NULL; - ScRangeName* pUndoRange = NULL; - ScDBCollection* pUndoDB = NULL; + ScDocument* pUndoDoc = nullptr; + ScOutlineTable* pUndoTab = nullptr; + ScRangeName* pUndoRange = nullptr; + ScDBCollection* pUndoDB = nullptr; if (bRecord) { @@ -2174,7 +2174,7 @@ void ScDBFunc::RepeatDB( bool bRecord ) Query( aQueryParam, &aAdvSource, false ); } else - Query( aQueryParam, NULL, false ); + Query( aQueryParam, nullptr, false ); // if not inplace the sheet may have changed if ( !aQueryParam.bInplace && aQueryParam.nDestTab != nTab ) @@ -2194,8 +2194,8 @@ void ScDBFunc::RepeatDB( bool bRecord ) SCROW nDummyRow, nNewEndRow; pDBData->GetArea( nDummyTab, nDummyCol,nDummyRow, nDummyCol,nNewEndRow ); - const ScRange* pOld = NULL; - const ScRange* pNew = NULL; + const ScRange* pOld = nullptr; + const ScRange* pNew = nullptr; if (bQuerySize) { ScDBData* pDest = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow, diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx index 668337aac0da..ea4a83fa0d37 100644 --- a/sc/source/ui/view/drawutil.cxx +++ b/sc/source/ui/view/drawutil.cxx @@ -45,7 +45,7 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, for (SCROW nRow = nStartRow; nRow <= nEndRow-1; ++nRow) { SCROW nLastRow = nRow; - if (pDoc->RowHidden(nRow, nTab, NULL, &nLastRow)) + if (pDoc->RowHidden(nRow, nTab, nullptr, &nLastRow)) { nRow = nLastRow; continue; diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx index 43bf80d1206f..85228549b314 100644 --- a/sc/source/ui/view/drawvie3.cxx +++ b/sc/source/ui/view/drawvie3.cxx @@ -40,8 +40,8 @@ ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData ) : pDev( pOut ), pDoc( pData->GetDocument() ), nTab( pData->GetTabNo() ), - pDropMarker( NULL ), - pDropMarkObj( NULL ), + pDropMarker( nullptr ), + pDropMarkObj( nullptr ), bInConstruct( true ) { // #i73602# Use default from the configuration @@ -202,7 +202,7 @@ void ScDrawView::UpdateIMap( SdrObject* pObj ) Graphic aGraphic; TargetList aTargetList; ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo( pObj ); - const ImageMap* pImageMap = NULL; + const ImageMap* pImageMap = nullptr; if ( pIMapInfo ) pImageMap = &pIMapInfo->GetImageMap(); diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 2100793ffdf8..000d36480e79 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -113,7 +113,7 @@ bool ScDrawView::BeginDrag( vcl::Window* pWindow, const Point& rStartPos ) } ScDrawLayer::SetGlobalDrawPersist(aDragShellRef); SdrModel* pModel = GetMarkedObjModel(); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); // Charts now always copy their data in addition to the source reference, so // there's no need to call SchDLL::Update for the charts in the clipboard doc. @@ -133,7 +133,7 @@ bool ScDrawView::BeginDrag( vcl::Window* pWindow, const Point& rStartPos ) pTransferObj->SetDrawPersist( &aDragShellRef ); // keep persist for ole objects alive pTransferObj->SetDragSource( this ); // copies selection - SC_MOD()->SetDragObject( NULL, pTransferObj ); // for internal D&D + SC_MOD()->SetDragObject( nullptr, pTransferObj ); // for internal D&D pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); } @@ -371,7 +371,7 @@ void ScDrawView::DoCopy() copyChartRefDataToClipDoc(pDoc, &rClipDoc, aRanges); } SdrModel* pModel = GetMarkedObjModel(); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); // Charts now always copy their data in addition to the source reference, so // there's no need to call SchDLL::Update for the charts in the clipboard doc. @@ -394,7 +394,7 @@ void ScDrawView::DoCopy() } pTransferObj->CopyToClipboard( pViewData->GetActiveWin() ); // system clipboard - SC_MOD()->SetClipObject( NULL, pTransferObj ); // internal clipboard + SC_MOD()->SetClipObject( nullptr, pTransferObj ); // internal clipboard } uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable() @@ -406,7 +406,7 @@ uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable() // update ScGlobal::xDrawClipDocShellRef ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) ); SdrModel* pModel = GetMarkedObjModel(); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); // Charts now always copy their data in addition to the source reference, so // there's no need to call SchDLL::Update for the charts in the clipboard doc. diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 0ff91a2e2a57..a4827144b7f5 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -123,7 +123,7 @@ void ScDrawView::ImplClearCalcDropMarker() if(pDropMarker) { delete pDropMarker; - pDropMarker = 0L; + pDropMarker = nullptr; } } @@ -378,8 +378,8 @@ void ScDrawView::MarkListHasChanged() // Select Ole object? - SdrOle2Obj* pOle2Obj = NULL; - SdrGrafObj* pGrafObj = NULL; + SdrOle2Obj* pOle2Obj = nullptr; + SdrGrafObj* pGrafObj = nullptr; const SdrMarkList& rMarkList = GetMarkedObjectList(); const size_t nMarkCount = rMarkList.GetMarkCount(); @@ -592,7 +592,7 @@ void ScDrawView::ModelHasChanged() { // SdrObjEditView::ModelHasChanged will end text edit in this case, // so make sure the EditEngine's undo manager is no longer used. - pViewData->GetViewShell()->SetDrawTextUndo(NULL); + pViewData->GetViewShell()->SetDrawTextUndo(nullptr); SetCreateMode(); // don't leave FuText in a funny state } @@ -649,7 +649,7 @@ SdrObject* ScDrawView::GetObjectByName(const OUString& rName) } } } - return 0; + return nullptr; } //realize multi-selection of objects @@ -657,7 +657,7 @@ SdrObject* ScDrawView::GetObjectByName(const OUString& rName) bool ScDrawView::SelectCurrentViewObject( const OUString& rName ) { sal_uInt16 nObjectTab = 0; - SdrObject* pFound = NULL; + SdrObject* pFound = nullptr; bool bUnMark = false; SfxObjectShell* pShell = pDoc->GetDocumentShell(); if (pShell) @@ -712,7 +712,7 @@ bool ScDrawView::SelectObject( const OUString& rName ) UnmarkAll(); SCTAB nObjectTab = 0; - SdrObject* pFound = NULL; + SdrObject* pFound = nullptr; SfxObjectShell* pShell = pDoc->GetDocumentShell(); if (pShell) @@ -765,7 +765,7 @@ bool ScDrawView::SelectObject( const OUString& rName ) MarkObj( pFound, pPV ); } - return ( pFound != NULL ); + return ( pFound != nullptr ); } //If object is marked , return true , else return false . @@ -806,7 +806,7 @@ SdrObject* ScDrawView::GetMarkedNoteCaption( ScDrawObjData** ppCaptData ) return pObj; } } - return 0; + return nullptr; } void ScDrawView::LockCalcLayer( SdrLayerID nLayer, bool bLock ) @@ -828,13 +828,13 @@ void ScDrawView::MakeVisible( const Rectangle& rRect, vcl::Window& rWin ) void ScDrawView::DeleteMarked() { // try to delete a note caption object with its cell note in the Calc document - ScDrawObjData* pCaptData = 0; + ScDrawObjData* pCaptData = nullptr; if( SdrObject* pCaptObj = GetMarkedNoteCaption( &pCaptData ) ) { (void)pCaptObj; // prevent 'unused variable' compiler warning in pro builds ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); - ScDocShell* pDocShell = pViewData ? pViewData->GetDocShell() : 0; - ::svl::IUndoManager* pUndoMgr = pDocShell ? pDocShell->GetUndoManager() : 0; + ScDocShell* pDocShell = pViewData ? pViewData->GetDocShell() : nullptr; + ::svl::IUndoManager* pUndoMgr = pDocShell ? pDocShell->GetUndoManager() : nullptr; bool bUndo = pDrawLayer && pDocShell && pUndoMgr && pDoc->IsUndoEnabled(); // remove the cell note from document, we are its owner now @@ -870,7 +870,7 @@ SdrEndTextEditKind ScDrawView::ScEndTextEdit() SdrEndTextEditKind eKind = SdrEndTextEdit(); if ( bIsTextEdit && pViewData ) - pViewData->GetViewShell()->SetDrawTextUndo(NULL); // the "normal" undo manager + pViewData->GetViewShell()->SetDrawTextUndo(nullptr); // the "normal" undo manager return eKind; } @@ -943,7 +943,7 @@ void ScDrawView::SyncForGrid( SdrObject* pObj ) // support enhanced text edit for draw objects SdrUndoManager* ScDrawView::getSdrUndoManagerForEnhancedTextEdit() const { - return pDoc ? dynamic_cast< SdrUndoManager* >(pDoc->GetUndoManager()) : 0; + return pDoc ? dynamic_cast< SdrUndoManager* >(pDoc->GetUndoManager()) : nullptr; } // #i123922# helper to apply a Graphic to an existing SdrObject @@ -980,7 +980,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject( return &rHitObject; } - return NULL; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 79a1f1092175..2a795a1b7ea2 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -94,7 +94,7 @@ void ScEditShell::InitInterface_Impl() ScEditShell::ScEditShell(EditView* pView, ScViewData* pData) : pEditView (pView), pViewData (pData), - pClipEvtLstnr (NULL), + pClipEvtLstnr (nullptr), bPastePossible (false), bIsInsertMode (true) { @@ -386,14 +386,14 @@ void ScEditShell::Execute( SfxRequest& rReq ) SvxFontItem aNewItem( EE_CHAR_FONTINFO ); const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( pArgs ) pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); if ( pItem ) { aString = static_cast<const SfxStringItem*>(pItem)->GetValue(); - const SfxPoolItem* pFtItem = NULL; + const SfxPoolItem* pFtItem = nullptr; pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) @@ -796,7 +796,7 @@ const SvxURLField* ScEditShell::GetURLField() } } - return NULL; + return nullptr; } IMPL_LINK_TYPED( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper, void ) @@ -1265,7 +1265,7 @@ void ScEditShell::GetUndoState(SfxItemSet &rSet) sal_uInt16 nWhich = aIter.FirstWhich(); while( nWhich ) { - pViewFrm->GetSlotState( nWhich, NULL, &rSet ); + pViewFrm->GetSlotState( nWhich, nullptr, &rSet ); nWhich = aIter.NextWhich(); } } diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index f10a078d1789..0ca101c976f0 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -196,7 +196,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) SCTAB nCurTab = GetViewData()->GetTabNo(); OUString aPageStyle = pDoc->GetPageStyle( nCurTab ); SfxStyleSheet* pStyleSheet = pStylePool ? static_cast<SfxStyleSheet*>(pStylePool-> - Find( aPageStyle, SFX_STYLE_FAMILY_PAGE )) : NULL; + Find( aPageStyle, SFX_STYLE_FAMILY_PAGE )) : nullptr; if ( pStyleSheet ) rSet.Put( SfxTemplateItem( nSlotId, aPageStyle ) ); @@ -213,7 +213,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) case SID_STYLE_UPDATE_BY_EXAMPLE: { - SfxPoolItem* pItem = NULL; + SfxPoolItem* pItem = nullptr; pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); @@ -230,7 +230,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) case SID_STYLE_HIDE: case SID_STYLE_SHOW: { - SfxPoolItem* pItem = NULL; + SfxPoolItem* pItem = nullptr; pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); bool bPage = pFamilyItem && SFX_STYLE_FAMILY_PAGE == SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); @@ -325,7 +325,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) ScPatternAttr aAttr( *rDoc.GetSelectionPattern( aPreviewMark ) ); if ( ScStyleSheet* pPreviewStyle = rDoc.GetPreviewCellStyle() ) aAttr.SetStyleSheet( pPreviewStyle ); - rDoc.SetPreviewCellStyle(NULL); + rDoc.SetPreviewCellStyle(nullptr); SfxItemSet aItemSet( GetPool() ); @@ -348,7 +348,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) || (nSlotId == SID_STYLE_NEW_BY_EXAMPLE) || (nSlotId == SID_STYLE_UPDATE_BY_EXAMPLE) ) { - SfxStyleSheetBase* pStyleSheet = NULL; + SfxStyleSheetBase* pStyleSheet = nullptr; bool bStyleToMarked = false; bool bListAction = false; @@ -382,10 +382,10 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) if (pArgs && SfxItemState::SET == pArgs->GetItemState( nSlotId, true, &pNameItem )) aStyleName = static_cast<const SfxStringItem*>(pNameItem)->GetValue(); - const SfxPoolItem* pRefItem=NULL; + const SfxPoolItem* pRefItem=nullptr; if (pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_REFERENCE, true, &pRefItem )) { - if(pRefItem!=NULL) + if(pRefItem!=nullptr) aRefName = static_cast<const SfxStringItem*>(pRefItem)->GetValue(); } @@ -549,7 +549,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // create/replace style sheet by attributes // at cursor position: - const ScPatternAttr* pAttrItem = NULL; + const ScPatternAttr* pAttrItem = nullptr; // The query if marked, was always wrong here, // so now no more, and just from the cursor. @@ -585,7 +585,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // when a new style is present and is used in the selection, // then the parent can not be adopted: if ( pStyleSheet && pSheetInUse && pStyleSheet == pSheetInUse ) - pSheetInUse = NULL; + pSheetInUse = nullptr; // if already present, first remove ... if ( pStyleSheet ) @@ -663,7 +663,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) { case SID_STYLE_DELETE: { - nRetMask = sal_uInt16( NULL != pStyleSheet ); + nRetMask = sal_uInt16( nullptr != pStyleSheet ); if ( pStyleSheet ) { if ( rDoc.RemovePageStyleInUse( pStyleSheet->GetName() ) ) @@ -684,7 +684,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) case SID_STYLE_HIDE: case SID_STYLE_SHOW: { - nRetMask = sal_uInt16( NULL != pStyleSheet ); + nRetMask = sal_uInt16( nullptr != pStyleSheet ); if ( pStyleSheet ) { pStyleSheet->SetHidden( nSlotId == SID_STYLE_HIDE ); @@ -697,10 +697,10 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) case SID_STYLE_APPLY: { - nRetMask = sal_uInt16( NULL != pStyleSheet ); + nRetMask = sal_uInt16( nullptr != pStyleSheet ); if ( pStyleSheet && !pScMod->GetIsWaterCan() ) { - ScUndoApplyPageStyle* pUndoAction = 0; + ScUndoApplyPageStyle* pUndoAction = nullptr; SCTAB nTabCount = rDoc.GetTableCount(); ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end(); for (; itr != itrEnd && *itr < nTabCount; ++itr) @@ -853,7 +853,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // -> Use NULL if a modal dialog is open, to enable the Dialog's // default parent handling. if ( Application::IsInModalMode() ) - pParent = NULL; + pParent = nullptr; else pParent = pTabViewShell->GetDialogParent(); } @@ -884,7 +884,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) bool bNumFormatChanged; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, rNewSet, aOldSet ) ) - rDoc.InvalidateTextWidth( NULL, NULL, bNumFormatChanged ); + rDoc.InvalidateTextWidth( nullptr, nullptr, bNumFormatChanged ); SCTAB nTabCount = rDoc.GetTableCount(); for (SCTAB nTab=0; nTab<nTabCount; nTab++) @@ -1270,7 +1270,7 @@ void ScFormatShell::ExecuteAlignment( SfxRequest& rReq ) default: if( pSet ) { - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if( pSet->GetItemState(GetPool().GetWhich(nSlot), true, &pItem ) == SfxItemState::SET ) { @@ -1341,7 +1341,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq ) const ScPatternAttr* pAttrs = pTabViewShell->GetSelectionPattern(); const SfxItemSet* pSet = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); - SfxAllItemSet* pNewSet = 0; + SfxAllItemSet* pNewSet = nullptr; pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox @@ -1489,9 +1489,9 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq ) */ const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet(); - const SfxPoolItem* pItem = NULL; - const SvxHorJustifyItem* pHorJustify = NULL; - const SvxVerJustifyItem* pVerJustify = NULL; + const SfxPoolItem* pItem = nullptr; + const SvxHorJustifyItem* pHorJustify = nullptr; + const SvxVerJustifyItem* pVerJustify = nullptr; SvxCellHorJustify eHorJustify = SVX_HOR_JUSTIFY_STANDARD; SvxCellVerJustify eVerJustify = SVX_VER_JUSTIFY_STANDARD; @@ -1629,7 +1629,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) case SID_ATTR_CHAR_ENDPREVIEW_FONT: { - pDoc->SetPreviewFont(NULL); + pDoc->SetPreviewFont(nullptr); pTabViewShell->UpdateSelectionArea( pDoc->GetPreviewSelection() ); break; } @@ -1759,7 +1759,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) ::editeng::SvxBorderLine aDefLine( &aColorBlack, 20, table::BorderLineStyle::SOLID ); pTabViewShell->SetDefaultFrameLine( &aDefLine ); - pTabViewShell->SetSelectionFrameLines( NULL, false ); + pTabViewShell->SetSelectionFrameLines( nullptr, false ); } } break; @@ -1807,7 +1807,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) Get( ATTR_BORDER ); // Evaluate border items from controller: - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if ( pNewAttrs->GetItemState( ATTR_BORDER, true, &pItem ) == SfxItemState::SET ) @@ -1844,8 +1844,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) else { SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER ); - aBoxInfoItem.SetLine( NULL, SvxBoxInfoItemLine::HORI ); - aBoxInfoItem.SetLine( NULL, SvxBoxInfoItemLine::VERT ); + aBoxInfoItem.SetLine( nullptr, SvxBoxInfoItemLine::HORI ); + aBoxInfoItem.SetLine( nullptr, SvxBoxInfoItemLine::VERT ); pNewSet->Put( aBoxInfoItem ); } @@ -1860,7 +1860,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) const ScPatternAttr* pOldAttrs = pTabViewShell->GetSelectionPattern(); std::unique_ptr<SfxItemSet> pOldSet(new SfxItemSet(pOldAttrs->GetItemSet())); std::unique_ptr<SfxItemSet> pNewSet(new SfxItemSet(pOldAttrs->GetItemSet())); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if(SID_ATTR_BORDER_DIAG_TLBR == nSlot) { @@ -1977,7 +1977,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet ) { // handled together because both need the cell border information for decisions Color aCol = 0; - editeng::SvxBorderLine aLine(0,0,0,false); + editeng::SvxBorderLine aLine(nullptr,0,0,false); bool bCol = false; bool bColDisable = false, bStyleDisable = false; SvxBoxItem aBoxItem(ATTR_BORDER); @@ -2201,8 +2201,8 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet ) // horizontal alignment - const SvxHorJustifyItem* pHorJustify = NULL; - const SvxVerJustifyItem* pVerJustify = NULL; + const SvxHorJustifyItem* pHorJustify = nullptr; + const SvxVerJustifyItem* pVerJustify = nullptr; SvxCellVerJustify eVerJustify = SVX_VER_JUSTIFY_STANDARD; sal_uInt16 nWhich = 0; bool bJustifyStd = false; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 9d6639b3be99..94b0be9c5cdd 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -370,7 +370,7 @@ void ScFilterFloatingWindow::dispose() vcl::Window* ScFilterFloatingWindow::GetPreferredKeyInputWindow() { // redirect keyinput in the child window - return GetWindow(GetWindowType::FirstChild) ? GetWindow(GetWindowType::FirstChild)->GetPreferredKeyInputWindow() : NULL; // will be the FilterBox + return GetWindow(GetWindowType::FirstChild) ? GetWindow(GetWindowType::FirstChild)->GetPreferredKeyInputWindow() : nullptr; // will be the FilterBox } static bool lcl_IsEditableMatrix( ScDocument* pDoc, const ScRange& rRange ) @@ -395,7 +395,7 @@ static void lcl_UnLockComment( ScDrawView* pView, const Point& rPos, ScViewData* ScDocument& rDoc = *pViewData->GetDocument(); ScAddress aCellPos( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() ); ScPostIt* pNote = rDoc.GetNote( aCellPos ); - SdrObject* pObj = pNote ? pNote->GetCaption() : 0; + SdrObject* pObj = pNote ? pNote->GetCaption() : nullptr; if( pObj && pObj->GetLogicRect().IsInside( rPos ) && ScDrawLayer::IsNoteCaption( pObj ) ) { const ScProtectionAttr* pProtAttr = static_cast< const ScProtectionAttr* > (rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_PROTECTION ) ); @@ -454,7 +454,7 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData* pData, ScSplitPos mpOODragRect(), mpOOHeader(), mpOOShrink(), - mpAutoFillRect(static_cast<Rectangle*>(NULL)), + mpAutoFillRect(static_cast<Rectangle*>(nullptr)), pViewData( pData ), eWhich( eWhichPos ), mpNoteMarker(), @@ -468,7 +468,7 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData* pData, ScSplitPos nMouseStatus( SC_GM_NONE ), nNestedButtonState( SC_NESTEDBUTTON_NONE ), nDPField( 0 ), - pDragDPObj( NULL ), + pDragDPObj( nullptr ), nRFIndex( 0 ), nRFAddX( 0 ), nRFAddY( 0 ), @@ -619,7 +619,7 @@ void ScGridWindow::ExecPageFieldSelect( SCCOL nCol, SCROW nRow, bool bHasSelecti pDim->SetCurrentPage( &aName ); } else - pDim->SetCurrentPage( NULL ); + pDim->SetCurrentPage( nullptr ); ScDPObject aNewObj( *pDPObj ); aNewObj.SetSaveData( aSaveData ); @@ -910,7 +910,7 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) } } - pViewData->GetView()->Query(aParam, NULL, true); + pViewData->GetView()->Query(aParam, nullptr, true); pDBData->SetQueryParam(aParam); } @@ -1514,7 +1514,7 @@ void ScGridWindow::ExecFilter( sal_uLong nSel, pViewData->GetViewShell()->UpdateInputHandler(); } - pViewData->GetView()->Query( aParam, NULL, true ); + pViewData->GetView()->Query( aParam, nullptr, true ); pDBData->SetQueryParam( aParam ); // save } else // "Too many conditions" @@ -2472,7 +2472,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) aBuf.append('#'); aBuf.append(aExtInfo.maTabName); aBuf.append('.'); - OUString aRefCalcA1(aTempAddr.Format(SCA_ABS, NULL, formula::FormulaGrammar::CONV_OOO)); + OUString aRefCalcA1(aTempAddr.Format(SCA_ABS, nullptr, formula::FormulaGrammar::CONV_OOO)); aBuf.append(aRefCalcA1); ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget); } @@ -2944,7 +2944,7 @@ static void lcl_SetTextCursorPos( ScViewData* pViewData, ScSplitPos eWhich, vcl: { SCCOL nCol = pViewData->GetCurX(); SCROW nRow = pViewData->GetCurY(); - Rectangle aEditArea = pViewData->GetEditArea( eWhich, nCol, nRow, pWin, NULL, true ); + Rectangle aEditArea = pViewData->GetEditArea( eWhich, nCol, nRow, pWin, nullptr, true ); aEditArea.Right() = aEditArea.Left(); aEditArea = pWin->PixelToLogic( aEditArea ); pWin->SetCursorRect( &aEditArea ); @@ -3583,7 +3583,7 @@ static bool lcl_TestScenarioRedliningDrop( ScDocument* pDoc, const ScRange& aDra SCTAB nTab = aDragRange.aStart.Tab(); SCTAB nTabCount = pDoc->GetTableCount(); - if(pDoc->GetChangeTrack()!=NULL) + if(pDoc->GetChangeTrack()!=nullptr) { if( pDoc->IsScenario(nTab) && pDoc->HasScenarioRange(nTab, aDragRange)) { @@ -3721,8 +3721,8 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt ) Window::PointerState aState = GetPointerState(); // check for datapilot item sorting - ScDPObject* pDPObj = NULL; - if ( pThisDoc == pSourceDoc && ( pDPObj = pThisDoc->GetDPAtCursor( nNewDragX, nNewDragY, nTab ) ) != NULL ) + ScDPObject* pDPObj = nullptr; + if ( pThisDoc == pSourceDoc && ( pDPObj = pThisDoc->GetDPAtCursor( nNewDragX, nNewDragY, nTab ) ) != nullptr ) { // drop on DataPilot table: sort or nothing @@ -3847,7 +3847,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) const ScDragData& rData = SC_MOD()->GetDragData(); if ( rEvt.mbLeaving ) { - DrawMarkDropObj( NULL ); + DrawMarkDropObj( nullptr ); if ( rData.pCellTransfer ) return AcceptPrivateDrop( rEvt ); // hide drop marker for internal D&D else @@ -3920,7 +3920,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) } } if (!nRet) - DrawMarkDropObj( NULL ); + DrawMarkDropObj( nullptr ); if (!nRet) { @@ -4249,7 +4249,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos if ( meDragInsertMode != INS_NONE ) { // call with bApi = sal_True to avoid error messages in drop handler - bDone = pDocSh->GetDocFunc().InsertCells( aDest, NULL, meDragInsertMode, true /*bRecord*/, true /*bApi*/, true /*bPartOfPaste*/ ); + bDone = pDocSh->GetDocFunc().InsertCells( aDest, nullptr, meDragInsertMode, true /*bRecord*/, true /*bApi*/, true /*bPartOfPaste*/ ); if ( bDone ) { if ( nThisTab == nSourceTab ) @@ -4302,7 +4302,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos ( eCmd == DEL_CELLSLEFT && nDestPosY == aSource.aStart.Row() ) ) { // call with bApi = sal_True to avoid error messages in drop handler - bDone = pDocSh->GetDocFunc().DeleteCells( aSource, NULL, eCmd, true /*bRecord*/, true /*bApi*/ ); + bDone = pDocSh->GetDocFunc().DeleteCells( aSource, nullptr, eCmd, true /*bRecord*/, true /*bApi*/ ); if ( bDone ) { if ( eCmd == DEL_CELLSUP && nDestPosY > aSource.aEnd.Row() ) @@ -4388,7 +4388,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos if ( meDragInsertMode != INS_NONE ) { // call with bApi = sal_True to avoid error messages in drop handler - bDone = pDocSh->GetDocFunc().InsertCells( aDest, NULL, meDragInsertMode, true /*bRecord*/, true /*bApi*/, true /*bPartOfPaste*/ ); + bDone = pDocSh->GetDocFunc().InsertCells( aDest, nullptr, meDragInsertMode, true /*bRecord*/, true /*bApi*/, true /*bPartOfPaste*/ ); if ( bDone ) { pDocSh->UpdateOle( pViewData ); @@ -4448,7 +4448,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos if ( meDragInsertMode != INS_NONE ) { // call with bApi = sal_True to avoid error messages in drop handler - bDone = pDocSh->GetDocFunc().InsertCells( aDest, NULL, meDragInsertMode, true /*bRecord*/, true /*bApi*/, true /*bPartOfPaste*/ ); + bDone = pDocSh->GetDocFunc().InsertCells( aDest, nullptr, meDragInsertMode, true /*bRecord*/, true /*bApi*/, true /*bPartOfPaste*/ ); if ( bDone ) { pDocSh->UpdateOle( pViewData ); @@ -4481,7 +4481,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt ) { - DrawMarkDropObj( NULL ); // drawing layer + DrawMarkDropObj( nullptr ); // drawing layer ScModule* pScMod = SC_MOD(); const ScDragData& rData = pScMod->GetDragData(); @@ -4699,7 +4699,7 @@ void ScGridWindow::UpdateEditViewPos() else { // bForceToTop = sal_True for editing - Rectangle aPixRect = pViewData->GetEditArea( eWhich, nCol, nRow, this, NULL, true ); + Rectangle aPixRect = pViewData->GetEditArea( eWhich, nCol, nRow, this, nullptr, true ); Point aScrPos = PixelToLogic( aPixRect.TopLeft(), pViewData->GetLogicMode() ); Rectangle aRect = pView->GetOutputArea(); @@ -5333,10 +5333,10 @@ bool ScGridWindow::GetEditUrl( const Point& rPos, OUString* pName, OUString* pUrl, OUString* pTarget ) { ScTabViewShell* pViewSh = pViewData->GetViewShell(); - ScInputHandler* pInputHdl = NULL; + ScInputHandler* pInputHdl = nullptr; if (pViewSh) pInputHdl = pViewSh->GetInputHandler(); - EditView* pView = (pInputHdl && pInputHdl->IsInputMode()) ? pInputHdl->GetTableView() : NULL; + EditView* pView = (pInputHdl && pInputHdl->IsInputMode()) ? pInputHdl->GetTableView() : nullptr; if (pView) return extractURLInfo(pView->GetFieldUnderMousePointer(), pName, pUrl, pTarget); @@ -5608,7 +5608,7 @@ bool ScGridWindow::ContinueOnlineSpelling() return false; ScDocument* pDoc = pViewData->GetDocument(); - ScDPCollection* pDPs = NULL; + ScDPCollection* pDPs = nullptr; if (pDoc->HasPivotTable()) pDPs = pDoc->GetDPCollection(); @@ -5764,10 +5764,10 @@ void ScGridWindow::SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector const std::vector<editeng::MisspellRanges>* ScGridWindow::GetAutoSpellData( SCCOL nPosX, SCROW nPosY ) { if (!mpSpellCheckCxt) - return NULL; + return nullptr; if (!maVisibleRange.isInside(nPosX, nPosY)) - return NULL; + return nullptr; return mpSpellCheckCxt->getMisspellRanges(nPosX, nPosY); } @@ -5943,7 +5943,7 @@ void ScGridWindow::UpdateCopySourceOverlay() * * @param pLogicRects - if not 0, then don't invoke the callback, just collect the rectangles in the pointed vector. */ -static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pDrawLayer, const std::vector<Rectangle>& rRectangles, std::vector<Rectangle>* pLogicRects = 0) +static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pDrawLayer, const std::vector<Rectangle>& rRectangles, std::vector<Rectangle>* pLogicRects = nullptr) { if (!pDrawLayer->isTiledRendering()) return; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index cfa402f302bb..f0b07687998d 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -1063,7 +1063,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp ) else if (!bHide) aNewRanges = aPagebreakDrag.Format(SCA_VALID); - pViewFunc->SetPrintRanges( rDoc.IsPrintEntireSheet( nTab ), &aNewRanges, NULL, NULL, false ); + pViewFunc->SetPrintRanges( rDoc.IsPrintEntireSheet( nTab ), &aNewRanges, nullptr, nullptr, false ); } } diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index 2937507e1e68..97d149c24f34 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -325,7 +325,7 @@ SdrObject* ScGridWindow::GetEditObject() return pDrView->GetTextEditObject(); } - return NULL; + return nullptr; } void ScGridWindow::UpdateStatusPosSize() diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 51ae5fdc8397..e15cb1e1b0c1 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -572,7 +572,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI aOutputData.SetPagebreakMode( pViewData->GetView()->GetPageBreakData() ); } - EditView* pEditView = NULL; + EditView* pEditView = nullptr; bool bEditMode = pViewData->HasEditView(eWhich); if ( bEditMode && pViewData->GetRefTabNo() == nTab ) { @@ -630,7 +630,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI } OutputDevice* pContentDev = &rDevice; // device for document content, used by overlay manager - SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly + SdrPaintWindow* pTargetPaintWindow = nullptr; // #i74769# work with SdrPaintWindow directly { // init redraw @@ -782,7 +782,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI SCTAB nTabCount = rDoc.GetTableCount(); const std::vector<ScHighlightEntry> &rHigh = pViewData->GetView()->GetHighlightRanges(); bool bHasScenario = ( nTab+1<nTabCount && rDoc.IsScenario(nTab+1) && !rDoc.IsScenario(nTab) ); - bool bHasChange = ( rDoc.GetChangeTrack() != NULL ); + bool bHasChange = ( rDoc.GetChangeTrack() != nullptr ); if ( bHasChange || bHasScenario || !rHigh.empty() ) { @@ -1320,7 +1320,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo SCSIZE nArrY; SCSIZE nQuery; SCTAB nTab = pViewData->GetTabNo(); - ScDBData* pDBData = NULL; + ScDBData* pDBData = nullptr; std::unique_ptr<ScQueryParam> pQueryParam; RowInfo* pRowInfo = rTabInfo.mpRowInfo; diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index 2e044cb7e048..2d853957135f 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -71,9 +71,9 @@ bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard ) ScChangeViewSettings* pSettings = pDoc->GetChangeViewSettings(); if ( pTrack && pTrack->GetFirst() && pSettings && pSettings->ShowChanges()) { - const ScChangeAction* pFound = NULL; - const ScChangeAction* pFoundContent = NULL; - const ScChangeAction* pFoundMove = NULL; + const ScChangeAction* pFound = nullptr; + const ScChangeAction* pFoundContent = nullptr; + const ScChangeAction* pFoundMove = nullptr; long nModified = 0; const ScChangeAction* pAction = pTrack->GetFirst(); while (pAction) @@ -190,9 +190,9 @@ bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard ) bool bVSplit = pViewData->GetVSplitMode() != SC_SPLIT_NONE; vcl::Window* pLeft = pViewData->GetView()->GetWindowByPos( bVSplit ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT ); - vcl::Window* pRight = bHSplit ? pViewData->GetView()->GetWindowByPos( bVSplit ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT ) : 0; - vcl::Window* pBottom = bVSplit ? pViewData->GetView()->GetWindowByPos( SC_SPLIT_BOTTOMLEFT ) : 0; - vcl::Window* pDiagonal = (bHSplit && bVSplit) ? pViewData->GetView()->GetWindowByPos( SC_SPLIT_BOTTOMRIGHT ) : 0; + vcl::Window* pRight = bHSplit ? pViewData->GetView()->GetWindowByPos( bVSplit ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT ) : nullptr; + vcl::Window* pBottom = bVSplit ? pViewData->GetView()->GetWindowByPos( SC_SPLIT_BOTTOMLEFT ) : nullptr; + vcl::Window* pDiagonal = (bHSplit && bVSplit) ? pViewData->GetView()->GetWindowByPos( SC_SPLIT_BOTTOMRIGHT ) : nullptr; OSL_ENSURE( pLeft, "ScGridWindow::ShowNoteMarker - missing top-left grid window" ); /* If caption is shown from right or bottom windows, adjust @@ -302,7 +302,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) MouseEvent aMEvt( aPosPixel, 1, MouseEventModifiers::NONE, MOUSE_LEFT ); SdrHitKind eHit = pDrView->PickAnything( aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ); - if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL ) + if ( eHit != SDRHIT_NONE && aVEvt.pObj != nullptr ) { // URL for IMapObject below Pointer is help text if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) ) @@ -340,14 +340,14 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) } else { - SdrObject* pObj = 0; - SdrPageView* pPV = 0; + SdrObject* pObj = nullptr; + SdrPageView* pPV = nullptr; Point aMDPos = PixelToLogic( aPosPixel ); if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER) ) { if ( pObj->IsGroupObject() ) { - SdrObject* pHit = 0; + SdrObject* pHit = nullptr; if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, pPV, SdrSearchOptions::DEEP ) ) pObj = pHit; } @@ -377,7 +377,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) if ( aHelpText.isEmpty() ) // Text-URL { OUString aUrl; - if ( GetEditUrl( aPosPixel, NULL, &aUrl ) ) + if ( GetEditUrl( aPosPixel, nullptr, &aUrl ) ) { aHelpText = INetURLObject::decode( aUrl, INetURLObject::DECODE_UNAMBIGUOUS ); diff --git a/sc/source/ui/view/imapwrap.cxx b/sc/source/ui/view/imapwrap.cxx index 423fb2314a60..9a1ffa400291 100644 --- a/sc/source/ui/view/imapwrap.cxx +++ b/sc/source/ui/view/imapwrap.cxx @@ -38,7 +38,7 @@ const void* ScIMapDlgGetObj( SvxIMapDlg* pDlg ) if ( pDlg ) return pDlg->GetEditingObject(); else - return NULL; + return nullptr; } const ImageMap& ScIMapDlgGetMap( SvxIMapDlg* pDlg ) diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index 24ae12da2063..2af819f9094f 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -47,8 +47,8 @@ ScNoteMarker::ScNoteMarker( vcl::Window* pWin, vcl::Window* pRight, vcl::Window* aMapMode( rMap ), bLeft( bLeftEdge ), bByKeyboard( bKeyboard ), - pModel( NULL ), - pObject( NULL ), + pModel( nullptr ), + pObject( nullptr ), bVisible( false ) { Size aSizePixel = pWindow->GetOutputSizePixel(); @@ -77,7 +77,7 @@ IMPL_LINK_NOARG_TYPED(ScNoteMarker, TimeHdl, Timer *, void) { SvtPathOptions aPathOpt; OUString aPath = aPathOpt.GetPalettePath(); - pModel = new SdrModel(aPath, NULL, NULL, false, false); + pModel = new SdrModel(aPath, nullptr, nullptr, false, false); pModel->SetScaleUnit(MAP_100TH_MM); SfxItemPool& rPool = pModel->GetItemPool(); rPool.SetDefaultMetric(SFX_MAPUNIT_100TH_MM); diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx index 90cc0a40a75d..e80cfd346c56 100644 --- a/sc/source/ui/view/olinewin.cxx +++ b/sc/source/ui/view/olinewin.cxx @@ -45,7 +45,7 @@ ScOutlineWindow::ScOutlineWindow( vcl::Window* pParent, ScOutlineMode eMode, ScV mbHoriz( eMode == SC_OUTLINE_HOR ), mbMirrorEntries( false ), // updated in SetHeaderSize mbMirrorLevels( false ), // updated in SetHeaderSize - mpSymbols( NULL ), + mpSymbols( nullptr ), maLineColor( COL_BLACK ), mnHeaderSize( 0 ), mnHeaderPos( 0 ), @@ -162,14 +162,14 @@ void ScOutlineWindow::InitSettings() const ScOutlineArray* ScOutlineWindow::GetOutlineArray() const { const ScOutlineTable* pTable = GetDoc().GetOutlineTable( GetTab() ); - if ( !pTable ) return NULL; + if ( !pTable ) return nullptr; return mbHoriz ? &pTable->GetColArray() : &pTable->GetRowArray(); } const ScOutlineEntry* ScOutlineWindow::GetOutlineEntry( size_t nLevel, size_t nEntry ) const { const ScOutlineArray* pArray = GetOutlineArray(); - return pArray ? pArray->GetEntry( sal::static_int_cast<sal_uInt16>(nLevel), sal::static_int_cast<sal_uInt16>(nEntry) ) : NULL; + return pArray ? pArray->GetEntry( sal::static_int_cast<sal_uInt16>(nLevel), sal::static_int_cast<sal_uInt16>(nEntry) ) : nullptr; } bool ScOutlineWindow::IsHidden( SCCOLROW nColRowIndex ) const @@ -304,7 +304,7 @@ bool ScOutlineWindow::GetEntryPos( // do not cover previous collapsed image bool bDoNoCover = !bHidden && nEntry; - const ScOutlineEntry* pPrevEntry = bDoNoCover ? GetOutlineEntry(nLevel, nEntry - 1) : NULL; + const ScOutlineEntry* pPrevEntry = bDoNoCover ? GetOutlineEntry(nLevel, nEntry - 1) : nullptr; if (pPrevEntry) { SCCOLROW nPrevEnd = pPrevEntry->GetEnd(); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 83c879875e21..12970ceb0dee 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -163,9 +163,9 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, eType( eNewType ), mnPPTX( nPixelPerTwipsX ), mnPPTY( nPixelPerTwipsY ), - pEditObj( NULL ), - pViewShell( NULL ), - pDrawView( NULL ), + pEditObj( nullptr ), + pViewShell( nullptr ), + pDrawView( nullptr ), bEditMode( false ), nEditCol( 0 ), nEditRow( 0 ), @@ -176,9 +176,9 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, mbUseStyleColor( false ), mbForceAutoColor( SC_MOD()->GetAccessOptions().GetIsAutomaticFontColor() ), mbSyntaxMode( false ), - pValueColor( NULL ), - pTextColor( NULL ), - pFormulaColor( NULL ), + pValueColor( nullptr ), + pTextColor( nullptr ), + pFormulaColor( nullptr ), aGridColor( COL_BLACK ), mbShowNullValues( true ), mbShowFormulas( false ), @@ -187,8 +187,8 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, bSnapPixel( false ), bAnyRotated( false ), bAnyClipped( false ), - mpTargetPaintWindow(NULL), // #i74769# use SdrPaintWindow direct - mpSpellCheckCxt(NULL) + mpTargetPaintWindow(nullptr), // #i74769# use SdrPaintWindow direct + mpSpellCheckCxt(nullptr) { if (pZoomX) aZoomX = *pZoomX; @@ -494,7 +494,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool for (SCROW i = nYplus1; i <= MAXROW; ++i) { if (i > nHiddenEndRow) - bHiddenRow = mpDoc->RowHidden(i, nTab, NULL, &nHiddenEndRow); + bHiddenRow = mpDoc->RowHidden(i, nTab, nullptr, &nHiddenEndRow); /* TODO: optimize the row break thing for large hidden * segments where HasRowBreak() has to be called * nevertheless for each row, as a row break is drawn also @@ -944,23 +944,23 @@ void drawCells(vcl::RenderContext& rRenderContext, const Color* pColor, const Sv if (!pOldColor || *pOldColor != *pColor) pOldColor = pColor; - pOldBackground = NULL; + pOldBackground = nullptr; } else if(pBackground) { pOldBackground = pBackground; - pOldColor = NULL; + pOldColor = nullptr; } if(pDataBarInfo) pOldDataBarInfo = pDataBarInfo; else - pOldDataBarInfo = NULL; + pOldDataBarInfo = nullptr; if(pIconSetInfo) pOldIconSetInfo = pIconSetInfo; else - pOldIconSetInfo = NULL; + pOldIconSetInfo = nullptr; } } @@ -1031,11 +1031,11 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) if (bWorksInPixels) aRect = rRenderContext.PixelToLogic(aRect); // internal data in pixels, but we'll be drawing in logic units - const SvxBrushItem* pOldBackground = NULL; + const SvxBrushItem* pOldBackground = nullptr; const SvxBrushItem* pBackground; - const Color* pOldColor = NULL; - const ScDataBarInfo* pOldDataBarInfo = NULL; - const ScIconSetInfo* pOldIconSetInfo = NULL; + const Color* pOldColor = nullptr; + const ScDataBarInfo* pOldDataBarInfo = nullptr; + const ScIconSetInfo* pOldIconSetInfo = nullptr; SCCOL nMergedCells = 1; SCCOL nOldMerged = 0; @@ -1063,7 +1063,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) pBackground = ScGlobal::GetEmptyBrushItem(); } else - pBackground = NULL; + pBackground = nullptr; } else pBackground = pInfo->pBackground; @@ -1111,7 +1111,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) if (bWorksInPixels) nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X(); - drawCells(rRenderContext, NULL, NULL, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, NULL, pOldDataBarInfo, NULL, pOldIconSetInfo); + drawCells(rRenderContext, nullptr, nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo); nArrY += nSkip; } @@ -1358,7 +1358,7 @@ void ScOutputData::DrawFrame(vcl::RenderContext& rRenderContext) bUseSingleColor = true; } - const Color* pForceColor = bUseSingleColor ? &aSingleColor : 0; + const Color* pForceColor = bUseSingleColor ? &aSingleColor : nullptr; if (bAnyRotated) DrawRotatedFrame(rRenderContext, pForceColor); // removes the lines that must not be painted here @@ -1454,7 +1454,7 @@ static const ::editeng::SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc, bool bTopLine ) { if ( nRotDir != SC_ROTDIR_LEFT && nRotDir != SC_ROTDIR_RIGHT ) - return NULL; + return nullptr; bool bFound = false; while (!bFound) @@ -1465,7 +1465,7 @@ static const ::editeng::SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc, if ( nCol < MAXCOL ) ++nCol; else - return NULL; // couldn't find it + return nullptr; // couldn't find it } else { @@ -1473,7 +1473,7 @@ static const ::editeng::SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc, if ( nCol > 0 ) --nCol; else - return NULL; // couldn't find it + return nullptr; // couldn't find it } const ScPatternAttr* pPattern = pDoc->GetPattern( nCol, nRow, nTab ); const SfxItemSet* pCondSet = pDoc->GetCondResult( nCol, nRow, nTab ); @@ -1489,12 +1489,12 @@ static const ::editeng::SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc, if ( ValidRow(nRow) ) pThisBottom = static_cast<const SvxBoxItem*>(pDoc->GetAttr( nCol, nRow, nTab, ATTR_BORDER ))->GetBottom(); else - pThisBottom = NULL; + pThisBottom = nullptr; const ::editeng::SvxBorderLine* pNextTop; if ( nRow < MAXROW ) pNextTop = static_cast<const SvxBoxItem*>(pDoc->GetAttr( nCol, nRow+1, nTab, ATTR_BORDER ))->GetTop(); else - pNextTop = NULL; + pNextTop = nullptr; if ( ScHasPriority( pThisBottom, pNextTop ) ) return pThisBottom; @@ -1863,7 +1863,7 @@ drawinglayer::processor2d::BaseProcessor2D* ScOutputData::CreateProcessor2D( ) mpDoc->InitDrawLayer(mpDoc->GetDocumentShell()); ScDrawLayer* pDrawLayer = mpDoc->GetDrawLayer(); if (!pDrawLayer) - return NULL; + return nullptr; basegfx::B2DRange aViewRange; SdrPage *pDrawPage = pDrawLayer->GetPage( static_cast< sal_uInt16 >( nTab ) ); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index d40483a16624..e6f57ddf58b6 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -184,15 +184,15 @@ private: ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, bool bPTL) : pOutput ( pData ), - pPattern ( NULL ), - pCondSet ( NULL ), + pPattern ( nullptr ), + pCondSet ( nullptr ), nAscentPixel(0), eAttrOrient ( SVX_ORIENTATION_STANDARD ), eAttrHorJust( SVX_HOR_JUSTIFY_STANDARD ), eAttrVerJust( SVX_VER_JUSTIFY_BOTTOM ), eAttrHorJustMethod( SVX_JUSTIFY_METHOD_AUTO ), eAttrVerJustMethod( SVX_JUSTIFY_METHOD_AUTO ), - pMargin ( NULL ), + pMargin ( nullptr ), nIndent ( 0 ), bRotated ( false ), nOriginalWidth( 0 ), @@ -311,7 +311,7 @@ void ScDrawStringsVars::SetPattern( eColorMode = SC_AUTOCOL_PRINT; if ( bPixelToLogic ) - pPattern->GetFont( aFont, eColorMode, pFmtDevice, NULL, pCondSet, nScript, + pPattern->GetFont( aFont, eColorMode, pFmtDevice, nullptr, pCondSet, nScript, &aBackConfigColor, &aTextConfigColor ); else pPattern->GetFont( aFont, eColorMode, pFmtDevice, &pOutput->aZoomY, pCondSet, nScript, @@ -1110,7 +1110,7 @@ bool ScOutputData::IsEmptyCellText( RowInfo* pThisRowInfo, SCCOL nX, SCROW nY ) void ScOutputData::GetVisibleCell( SCCOL nCol, SCROW nRow, SCTAB nTabP, ScRefCellValue& rCell ) { rCell.assign(*mpDoc, ScAddress(nCol, nRow, nTabP)); - if (!rCell.isEmpty() && IsEmptyCellText(NULL, nCol, nRow)) + if (!rCell.isEmpty() && IsEmptyCellText(nullptr, nCol, nRow)) rCell.clear(); } @@ -1121,7 +1121,7 @@ bool ScOutputData::IsAvailable( SCCOL nX, SCROW nY ) // where a note is empty as well as a cell that's hidden by protection settings ScRefCellValue aCell(*mpDoc, ScAddress(nX, nY, nTab)); - if (!aCell.isEmpty() && !IsEmptyCellText(NULL, nX, nY)) + if (!aCell.isEmpty() && !IsEmptyCellText(nullptr, nX, nY)) return false; const ScPatternAttr* pPattern = mpDoc->GetPattern( nX, nY, nTab ); @@ -1463,10 +1463,10 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA OutputAreaParam aAreaParam; bool bCellIsValue = false; long nNeededWidth = 0; - const ScPatternAttr* pPattern = NULL; - const SfxItemSet* pCondSet = NULL; - const ScPatternAttr* pOldPattern = NULL; - const SfxItemSet* pOldCondSet = NULL; + const ScPatternAttr* pPattern = nullptr; + const SfxItemSet* pCondSet = nullptr; + const ScPatternAttr* pOldPattern = nullptr; + const SfxItemSet* pOldCondSet = nullptr; SvtScriptType nOldScript = SvtScriptType::NONE; // alternative pattern instances in case we need to modify the pattern @@ -1679,7 +1679,7 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA if ( bFormulaCell ) lcl_CreateInterpretProgress(bProgress, mpDoc, aCell.mpFormula); if ( aVars.SetText(aCell) ) - pOldPattern = NULL; + pOldPattern = nullptr; bNeedEdit = aVars.HasEditCharacters() || (bFormulaCell && aCell.mpFormula->IsMultilineResult()); } long nTotalMargin = 0; @@ -1758,7 +1758,7 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA aAreaParam.mnLeftClipLength = aAreaParam.mnRightClipLength = 0; } - pOldPattern = NULL; + pOldPattern = nullptr; } } } @@ -2335,15 +2335,15 @@ ScOutputData::DrawEditParam::DrawEditParam(const ScPatternAttr* pPattern, const mbAsianVertical(false), mbPixelToLogic(false), mbHyphenatorSet(false), - mpEngine(NULL), + mpEngine(nullptr), mpPattern(pPattern), mpCondSet(pCondSet), - mpPreviewFontSet(NULL), - mpOldPattern(NULL), - mpOldCondSet(NULL), - mpOldPreviewFontSet(NULL), - mpThisRowInfo(NULL), - mpMisspellRanges(NULL) + mpPreviewFontSet(nullptr), + mpOldPattern(nullptr), + mpOldCondSet(nullptr), + mpOldPreviewFontSet(nullptr), + mpThisRowInfo(nullptr), + mpMisspellRanges(nullptr) {} bool ScOutputData::DrawEditParam::readCellContent( @@ -3035,7 +3035,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) rParam.mbBreak && bMarkClipped && ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) ) { - CellInfo* pClipMarkCell = NULL; + CellInfo* pClipMarkCell = nullptr; if ( bMerged ) { // anywhere in the merged area... @@ -3087,7 +3087,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) // horizontal alignment if (rParam.adjustHorAlignment(rParam.mpEngine)) // reset adjustment for the next cell - rParam.mpOldPattern = NULL; + rParam.mpOldPattern = nullptr; } if (rParam.meVerJust==SVX_VER_JUSTIFY_BOTTOM || @@ -3165,7 +3165,7 @@ void ScOutputData::ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, con rParam.mbBreak && bMarkClipped && ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) ) { - CellInfo* pClipMarkCell = NULL; + CellInfo* pClipMarkCell = nullptr; if ( bMerged ) { // anywhere in the merged area... @@ -4009,7 +4009,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) rParam.mbBreak && bMarkClipped && ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) ) { - CellInfo* pClipMarkCell = NULL; + CellInfo* pClipMarkCell = nullptr; if ( bMerged ) { // anywhere in the merged area... @@ -4356,7 +4356,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) !rParam.mbAsianVertical && bMarkClipped && ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) ) { - CellInfo* pClipMarkCell = NULL; + CellInfo* pClipMarkCell = nullptr; if ( bMerged ) { // anywhere in the merged area... @@ -4450,9 +4450,9 @@ void ScOutputData::DrawEdit(bool bPixelToLogic) { std::unique_ptr<ScFieldEditEngine> pEngine; bool bHyphenatorSet = false; - const ScPatternAttr* pOldPattern = NULL; - const SfxItemSet* pOldCondSet = NULL; - const SfxItemSet* pOldPreviewFontSet = NULL; + const ScPatternAttr* pOldPattern = nullptr; + const SfxItemSet* pOldCondSet = nullptr; + const SfxItemSet* pOldPreviewFontSet = nullptr; ScRefCellValue aCell; long nInitPosX = nScrX; @@ -4530,8 +4530,8 @@ void ScOutputData::DrawEdit(bool bPixelToLogic) if ( bDoCell && bEditMode && nCellX == nEditCol && nCellY == nEditRow ) bDoCell = false; - const ScPatternAttr* pPattern = NULL; - const SfxItemSet* pCondSet = NULL; + const ScPatternAttr* pPattern = nullptr; + const SfxItemSet* pCondSet = nullptr; if (bDoCell) { if ( nCellY == nY && nCellX >= nX1 && nCellX <= nX2 && @@ -4654,8 +4654,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) bool bHyphenatorSet = false; const ScPatternAttr* pPattern; const SfxItemSet* pCondSet; - const ScPatternAttr* pOldPattern = NULL; - const SfxItemSet* pOldCondSet = NULL; + const ScPatternAttr* pOldPattern = nullptr; + const SfxItemSet* pOldCondSet = nullptr; ScRefCellValue aCell; long nInitPosX = nScrX; diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 496cc5adfa65..42eeeace7160 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -119,7 +119,7 @@ void ScOutputData::PostPrintDrawingLayer(const Point& rMMOffset) // #i74768# { // #i74769# work with SdrPaintWindow directly pLocalDrawView->EndDrawLayers(*mpTargetPaintWindow, true); - mpTargetPaintWindow = 0; + mpTargetPaintWindow = nullptr; } } diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx index 556cd2f42935..4c4024d187f9 100644 --- a/sc/source/ui/view/pfuncache.cxx +++ b/sc/source/ui/view/pfuncache.cxx @@ -40,7 +40,7 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark, SfxPrinter* pPrinter = pDocSh->GetPrinter(); ScRange aRange; - const ScRange* pSelRange = NULL; + const ScRange* pSelRange = nullptr; if ( rMark.IsMarked() ) { rMark.GetMarkArea( aRange ); @@ -84,7 +84,7 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe return; // initialize only once ScRange aRange; - const ScRange* pSelRange = NULL; + const ScRange* pSelRange = nullptr; if ( rMark.IsMarked() ) { rMark.GetMarkArea( aRange ); diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index d1f4a3f2baf8..a2cc775db2a7 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -98,8 +98,8 @@ ScPreview::ScPreview( vcl::Window* pParent, ScDocShell* pDocSh, ScPreviewShell* aDate( Date::SYSTEM ), aTime( tools::Time::SYSTEM ), nTotalPages( 0 ), - pLocationData( NULL ), - pDrawView( NULL ), + pLocationData( nullptr ), + pDrawView( nullptr ), pDocShell( pDocSh ), pViewShell( pViewSh ), bInGetState( false ), @@ -165,7 +165,7 @@ void ScPreview::UpdateDrawView() // nTab must be right { // convert the displayed Page of drawView (see below) does not work?!? delete pDrawView; - pDrawView = NULL; + pDrawView = nullptr; } if ( !pDrawView ) // New Drawing? @@ -182,7 +182,7 @@ void ScPreview::UpdateDrawView() // nTab must be right else if ( pDrawView ) { delete pDrawView; // for this Chart is not needed - pDrawView = NULL; + pDrawView = nullptr; } } @@ -264,7 +264,7 @@ void ScPreview::CalcPages() long nAttrPage = i > 0 ? nFirstAttr[i-1] : 1; long nThisStart = nTotalPages; - ScPrintFunc aPrintFunc( this, pDocShell, i, nAttrPage, 0, NULL, &aOptions ); + ScPrintFunc aPrintFunc( this, pDocShell, i, nAttrPage, 0, nullptr, &aOptions ); long nThisTab = aPrintFunc.GetTotalPages(); if (!aPrintFunc.HasPrintRange()) mbHasEmptyRangeTable = true; @@ -353,7 +353,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); - bool bDoPrint = ( pFillLocation == NULL ); + bool bDoPrint = ( pFillLocation == nullptr ); bool bValidPage = ( nPageNo < nTotalPages ); ScModule* pScMod = SC_MOD(); @@ -392,7 +392,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) if (bStateValid) pPrintFunc = new ScPrintFunc( this, pDocShell, aState, &aOptions ); else - pPrintFunc = new ScPrintFunc( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, NULL, &aOptions ); + pPrintFunc = new ScPrintFunc( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, nullptr, &aOptions ); pPrintFunc->SetOffset(aOffset); pPrintFunc->SetManualZoom(nZoom); @@ -630,7 +630,7 @@ void ScPreview::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& if (bPageMargin) GetLocationData(); // fill location data for column positions - DoPrint( NULL ); + DoPrint( nullptr ); pViewShell->UpdateScrollBars(); bInPaint = bWasInPaint; @@ -897,7 +897,7 @@ void ScPreview::DoInvalidate() // The Invalidate must come behind asynchronously if (bInGetState) - Application::PostUserEvent( LINK( this, ScPreview, InvalidateHdl ), NULL, true ); + Application::PostUserEvent( LINK( this, ScPreview, InvalidateHdl ), nullptr, true ); else StaticInvalidate(); // Immediately } @@ -1185,7 +1185,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) } else if( bHeaderRulerMove && bHeaderRulerChange ) { - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if ( rStyleSet.GetItemState( ATTR_PAGE_HEADERSET, false, &pItem ) == SfxItemState::SET ) { const SfxItemSet& pHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); @@ -1200,7 +1200,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) } else if( bFooterRulerMove && bFooterRulerChange ) { - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; if( rStyleSet.GetItemState( ATTR_PAGE_FOOTERSET, false, &pItem ) == SfxItemState::SET ) { const SfxItemSet& pFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); @@ -1318,7 +1318,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) if (bStateValid) pPrintFunc = new ScPrintFunc( this, pDocShell, aState, &aOptions ); else - pPrintFunc = new ScPrintFunc( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, NULL, &aOptions ); + pPrintFunc = new ScPrintFunc( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, nullptr, &aOptions ); nLeftMargin = (long)( pPrintFunc->GetLeftMargin() * HMM_PER_TWIPS - aOffset.X() ); nRightMargin = (long)( pPrintFunc->GetRightMargin() * HMM_PER_TWIPS ); diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx index b0e407c223e0..aa65184d4aca 100644 --- a/sc/source/ui/view/prevloc.cxx +++ b/sc/source/ui/view/prevloc.cxx @@ -60,8 +60,8 @@ ScPreviewTableInfo::ScPreviewTableInfo() : nTab(0), nCols(0), nRows(0), - pColInfo(NULL), - pRowInfo(NULL) + pColInfo(nullptr), + pRowInfo(nullptr) { } @@ -115,7 +115,7 @@ void ScPreviewTableInfo::LimitToArea( const Rectangle& rPixelArea ) SetColInfo( nNewCount, pNewInfo ); } else - SetColInfo( 0, NULL ); // all invisible + SetColInfo( 0, nullptr ); // all invisible } } @@ -142,7 +142,7 @@ void ScPreviewTableInfo::LimitToArea( const Rectangle& rPixelArea ) SetRowInfo( nNewCount, pNewInfo ); } else - SetRowInfo( 0, NULL ); // all invisible + SetRowInfo( 0, nullptr ); // all invisible } } } @@ -276,7 +276,7 @@ static ScPreviewLocationEntry* lcl_GetEntryByAddress( return it.get(); } - return NULL; + return nullptr; } Rectangle ScPreviewLocationData::GetOffsetPixel( const ScAddress& rCellPos, const ScRange& rRange ) const @@ -592,7 +592,7 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev rInfo.SetColInfo( nColCount, pColInfo ); } else - rInfo.SetColInfo( 0, NULL ); + rInfo.SetColInfo( 0, nullptr ); // get row info @@ -659,7 +659,7 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev rInfo.SetRowInfo( nRowCount, pRowInfo ); } else - rInfo.SetRowInfo( 0, NULL ); + rInfo.SetRowInfo( 0, nullptr ); // limit to visible area diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index b31044a42176..73b90360f6de 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -151,10 +151,10 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame, SfxViewShell* pOldSh ) : SfxViewShell( pViewFrame, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ), pDocShell( static_cast<ScDocShell*>(pViewFrame->GetObjectShell()) ), - mpFrameWindow(NULL), + mpFrameWindow(nullptr), nSourceDesignMode( TRISTATE_INDET ), nMaxVertPos(0), - pAccessibilityBroadcaster( NULL ) + pAccessibilityBroadcaster( nullptr ) { Construct( &pViewFrame->GetWindow() ); @@ -196,7 +196,7 @@ ScPreviewShell::~ScPreviewShell() EndListening(*SfxGetpApp()); EndListening(*pDocShell); - SetWindow(0); + SetWindow(nullptr); pPreview.disposeAndClear(); pHorScroll.disposeAndClear(); pVerScroll.disposeAndClear(); @@ -550,7 +550,7 @@ void ScPreviewShell::Activate(bool bMDI) // InputHdl is now mostly Null, no moreasssertion! ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(); if ( pInputHdl ) - pInputHdl->NotifyChange( NULL ); + pInputHdl->NotifyChange( nullptr ); } } @@ -645,7 +645,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(NULL, aSet)); + std::unique_ptr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(nullptr, aSet)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->SetLimits( 20, 400 ); pDlg->HideButton( ZoomButtonId::OPTIMAL ); diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 8512061f164e..ac16552460d1 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -90,7 +90,7 @@ ScPageRowEntry::ScPageRowEntry(const ScPageRowEntry& r) memcpy( pHidden, r.pHidden, nPagesX * sizeof(bool) ); } else - pHidden = NULL; + pHidden = nullptr; } const ScPageRowEntry& ScPageRowEntry::operator=(const ScPageRowEntry& r) @@ -106,7 +106,7 @@ const ScPageRowEntry& ScPageRowEntry::operator=(const ScPageRowEntry& r) memcpy( pHidden, r.pHidden, nPagesX * sizeof(bool) ); } else - pHidden = NULL; + pHidden = nullptr; return *this; } @@ -117,7 +117,7 @@ void ScPageRowEntry::SetPagesX(size_t nNew) { OSL_FAIL("SetPagesX nicht nach SetHidden"); delete[] pHidden; - pHidden = NULL; + pHidden = nullptr; } nPagesX = nNew; } @@ -177,12 +177,12 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions ) // else, EditEngine outputs different text heights pDev->SetMapMode(MAP_PIXEL); - pBorderItem = NULL; - pBackgroundItem = NULL; - pShadowItem = NULL; + pBorderItem = nullptr; + pBackgroundItem = nullptr; + pShadowItem = nullptr; - pEditEngine = NULL; - pEditDefaults = NULL; + pEditEngine = nullptr; + pEditDefaults = nullptr; ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( @@ -193,7 +193,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions ) else { OSL_FAIL("Seitenvorlage nicht gefunden" ); - pParamSet = NULL; + pParamSet = nullptr; } if (!bState) @@ -205,7 +205,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions ) InitParam(pOptions); - pPageData = NULL; // is only needed for initialisation + pPageData = nullptr; // is only needed for initialisation } ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTab, @@ -214,7 +214,7 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTa ScPageBreakData* pData ) : pDocShell ( pShell ), pPrinter ( pNewPrinter ), - pDrawView ( NULL ), + pDrawView ( nullptr ), nPrintTab ( nTab ), nPageStart ( nPage ), nDocPages ( nDocP ), @@ -240,8 +240,8 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab, long nPage, long nDocP, const ScRange* pArea, const ScPrintOptions* pOptions ) : pDocShell ( pShell ), - pPrinter ( NULL ), - pDrawView ( NULL ), + pPrinter ( nullptr ), + pDrawView ( nullptr ), nPrintTab ( nTab ), nPageStart ( nPage ), nDocPages ( nDocP ), @@ -256,7 +256,7 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab, nPagesX(0), nPagesY(0), nTotalY(0), - pPageData ( NULL ) + pPageData ( nullptr ) { pDev = pOutDev; Construct( pOptions ); @@ -265,9 +265,9 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab, ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, const ScPrintState& rState, const ScPrintOptions* pOptions ) : pDocShell ( pShell ), - pPrinter ( NULL ), - pDrawView ( NULL ), - pUserArea ( NULL ), + pPrinter ( nullptr ), + pDrawView ( nullptr ), + pUserArea ( nullptr ), bSourceRangeValid ( false ), bPrintCurrentTable ( false ), bMultiArea ( false ), @@ -275,7 +275,7 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, nPagesX(0), nPagesY(0), nTotalY(0), - pPageData ( NULL ) + pPageData ( nullptr ) { pDev = pOutDev; @@ -596,12 +596,12 @@ static void lcl_FillHFParam( ScPrintHFParam& rParam, const SfxItemSet* pHFSet ) { // nDistance must be initialized differently before - if ( pHFSet == NULL ) + if ( pHFSet == nullptr ) { rParam.bEnable = false; - rParam.pBorder = NULL; - rParam.pBack = NULL; - rParam.pShadow = NULL; + rParam.pBorder = nullptr; + rParam.pBack = nullptr; + rParam.pShadow = nullptr; } else { @@ -823,7 +823,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) aHdr.pRight = static_cast<const ScPageHFItem*>( &pParamSet->Get(ATTR_PAGE_HEADERRIGHT) ); const SvxSetItem* pHeaderSetItem; - const SfxItemSet* pHeaderSet = NULL; + const SfxItemSet* pHeaderSet = nullptr; if ( pParamSet->GetItemState( ATTR_PAGE_HEADERSET, false, reinterpret_cast<const SfxPoolItem**>(&pHeaderSetItem) ) == SfxItemState::SET ) { @@ -839,7 +839,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) aFtr.pRight = static_cast<const ScPageHFItem*>( &pParamSet->Get(ATTR_PAGE_FOOTERRIGHT) ); const SvxSetItem* pFooterSetItem; - const SfxItemSet* pFooterSet = NULL; + const SfxItemSet* pFooterSet = nullptr; if ( pParamSet->GetItemState( ATTR_PAGE_FOOTERSET, false, reinterpret_cast<const SfxPoolItem**>(&pFooterSetItem) ) == SfxItemState::SET ) { @@ -853,9 +853,9 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) // TabPage "Table" - const SfxUInt16Item* pScaleItem = NULL; - const ScPageScaleToItem* pScaleToItem = NULL; - const SfxUInt16Item* pScaleToPagesItem = NULL; + const SfxUInt16Item* pScaleItem = nullptr; + const ScPageScaleToItem* pScaleToItem = nullptr; + const SfxUInt16Item* pScaleToPagesItem = nullptr; SfxItemState eState; eState = pParamSet->GetItemState( ATTR_PAGE_SCALE, false, @@ -1187,7 +1187,7 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu const double Abitmap( k1/k2 * aSize.Width()*aSize.Height() ); aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0), - NULL, GraphicManagerDrawFlags::STANDARD, + nullptr, GraphicManagerDrawFlags::STANDARD, ::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) ); } else @@ -1223,7 +1223,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, if (pBorderData) if ( !pBorderData->GetTop() && !pBorderData->GetBottom() && !pBorderData->GetLeft() && !pBorderData->GetRight() ) - pBorderData = NULL; + pBorderData = nullptr; if (!pBorderData && !pBackground && !pShadow) return; // nothing to do @@ -2522,7 +2522,7 @@ long ScPrintFunc::CountNotePages() long nNoteAdd; do { - nNoteAdd = PrintNotes( nPages, nNoteNr, false, NULL ); + nNoteAdd = PrintNotes( nPages, nNoteNr, false, nullptr ); if (nNoteAdd) { nNoteNr += nNoteAdd; @@ -2705,7 +2705,7 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges, { bool bPageSelected = rPageRanges.IsSelected( nPageNo+nStartPage+1 ); nNoteAdd = PrintNotes( nPageNo+nStartPage, nNoteNr, bDoPrint && bPageSelected, - ( bPageSelected ? pLocationData : NULL ) ); + ( bPageSelected ? pLocationData : nullptr ) ); if ( nNoteAdd ) { nNoteNr += nNoteAdd; @@ -2731,7 +2731,7 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges, void ScPrintFunc::CalcZoom( sal_uInt16 nRangeNo ) // calculate zoom { sal_uInt16 nRCount = pDoc->GetPrintRangeCount( nPrintTab ); - const ScRange* pThisRange = NULL; + const ScRange* pThisRange = nullptr; if ( nRangeNo != RANGENO_NORANGE || nRangeNo < nRCount ) pThisRange = pDoc->GetPrintRange( nPrintTab, nRangeNo ); if ( pThisRange ) @@ -3069,7 +3069,7 @@ void ScPrintFunc::CalcPages() // calculates aPageRect and pages fr } SCROW nLastRow = -1; - if (!pDoc->RowHidden(nRow, nPrintTab, NULL, &nLastRow)) + if (!pDoc->RowHidden(nRow, nPrintTab, nullptr, &nLastRow)) { bVisRow = true; nLastVisibleRow = nLastRow; diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 4c986dd94f2f..565d989d9ba1 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -140,7 +140,7 @@ ScSimpleRefDlgWrapper::ScSimpleRefDlgWrapper( vcl::Window* pParentP, : SfxChildWindow(pParentP, nId) { - ScTabViewShell* pViewShell = NULL; + ScTabViewShell* pViewShell = nullptr; SfxDispatcher* pDisp = p->GetDispatcher(); if ( pDisp ) { @@ -151,14 +151,14 @@ ScSimpleRefDlgWrapper::ScSimpleRefDlgWrapper( vcl::Window* pParentP, OSL_ENSURE( pViewShell, "missing view shell :-(" ); - if(pInfo!=NULL && bScSimpleRefFlag) + if(pInfo!=nullptr && bScSimpleRefFlag) { pInfo->aPos.X()=nScSimpleRefX; pInfo->aPos.Y()=nScSimpleRefY; pInfo->aSize.Height()=nScSimpleRefHeight; pInfo->aSize.Width()=nScSimpleRefWidth; } - SetWindow(NULL); + SetWindow(nullptr); if(bAutoReOpen && pViewShell) SetWindow( pViewShell->CreateRefDialog( p, this, pInfo, pParentP, WID_SIMPLE_REF) ); @@ -244,7 +244,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( vcl::Window* pParentP, static_cast<ScAcceptChgDlg*>(GetWindow())->Initialize( pInfo ); } else - SetWindow( NULL ); + SetWindow( nullptr ); if (pViewShell && !GetWindow()) pViewShell->GetViewFrame()->SetChildWindow( nId, false ); } @@ -275,7 +275,7 @@ namespace if( SfxViewShell* pViewSh = pFrm->GetViewShell() ) return dynamic_cast<ScTabViewShell*>( pViewSh ); - return NULL; + return nullptr; } } @@ -286,7 +286,7 @@ ScValidityRefChildWin::ScValidityRefChildWin( vcl::Window* pParent : SfxChildWindow(pParentP, nId), m_bVisibleLock( false ), m_bFreeWindowLock( false ), - m_pSavedWndParent( NULL ) + m_pSavedWndParent( nullptr ) { SetWantsFocus( false ); VclPtr<ScValidationDlg> pDlg = ScValidationDlg::Find1AliveObject( pParentP ); diff --git a/sc/source/ui/view/scextopt.cxx b/sc/source/ui/view/scextopt.cxx index dea6e14a6d1b..97475e8ee6fd 100644 --- a/sc/source/ui/view/scextopt.cxx +++ b/sc/source/ui/view/scextopt.cxx @@ -94,7 +94,7 @@ ScExtTabSettingsCont& ScExtTabSettingsCont::operator=( const ScExtTabSettingsCon const ScExtTabSettings* ScExtTabSettingsCont::GetTabSettings( SCTAB nTab ) const { ScExtTabSettingsMap::const_iterator aIt = maMap.find( nTab ); - return (aIt == maMap.end()) ? 0 : aIt->second.get(); + return (aIt == maMap.end()) ? nullptr : aIt->second.get(); } ScExtTabSettings& ScExtTabSettingsCont::GetOrCreateTabSettings( SCTAB nTab ) diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index acbb0f3c95d7..a9b4a20ff2b6 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -48,7 +48,7 @@ static bool bDidSwitch = false; // View (Gridwin / keyboard) ScViewFunctionSet::ScViewFunctionSet( ScViewData* pNewViewData ) : pViewData( pNewViewData ), - pEngine( NULL ), + pEngine( nullptr ), bAnchor( false ), bStarted( false ) { @@ -206,7 +206,7 @@ void ScViewFunctionSet::BeginDrag() if ( pWindow->IsTracking() ) pWindow->EndTracking( TrackingEventFlags::Cancel ); // abort selecting - SC_MOD()->SetDragObject( pTransferObj, NULL ); // for internal D&D + SC_MOD()->SetDragObject( pTransferObj, nullptr ); // for internal D&D pTransferObj->StartDrag( pWindow, nDragActions ); return; // dragging started diff --git a/sc/source/ui/view/spellcheckcontext.cxx b/sc/source/ui/view/spellcheckcontext.cxx index 66c218e679b5..a01df2221058 100644 --- a/sc/source/ui/view/spellcheckcontext.cxx +++ b/sc/source/ui/view/spellcheckcontext.cxx @@ -66,7 +66,7 @@ const std::vector<editeng::MisspellRanges>* SpellCheckContext::getMisspellRanges { CellMapType::const_iterator it = maMisspellCells.find(CellPos(nCol,nRow)); if (it == maMisspellCells.end()) - return NULL; + return nullptr; return &it->second; } diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx index 033bcd207394..5ee00f9bde01 100644 --- a/sc/source/ui/view/spelldialog.cxx +++ b/sc/source/ui/view/spelldialog.cxx @@ -42,10 +42,10 @@ SFX_IMPL_CHILDWINDOW_WITHID( ScSpellDialogChildWindow, SID_SPELL_DIALOG ) ScSpellDialogChildWindow::ScSpellDialogChildWindow( vcl::Window* pParentP, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo ) : svx::SpellDialogChildWindow( pParentP, nId, pBindings, pInfo ), - mpViewShell( 0 ), - mpViewData( 0 ), - mpDocShell( 0 ), - mpDoc( 0 ), + mpViewShell( nullptr ), + mpViewData( nullptr ), + mpDocShell( nullptr ), + mpDoc( nullptr ), mbNeedNextObj( false ), mbOldIdleEnabled(true) { @@ -140,7 +140,7 @@ void ScSpellDialogChildWindow::Reset() mpDocShell->SetDocumentModified(); } - mpViewData->SetSpellingView( 0 ); + mpViewData->SetSpellingView( nullptr ); mpViewShell->KillEditView( true ); mpDocShell->PostPaintGridAll(); mpViewShell->UpdateInputHandler(); @@ -151,10 +151,10 @@ void ScSpellDialogChildWindow::Reset() mxRedoDoc.reset(); mxOldSel.reset(); mxOldRangeList.reset(); - mpViewShell = 0; - mpViewData = 0; - mpDocShell = 0; - mpDoc = 0; + mpViewShell = nullptr; + mpViewData = nullptr; + mpDocShell = nullptr; + mpDoc = nullptr; mbNeedNextObj = false; mbOldIdleEnabled = true; } @@ -163,7 +163,7 @@ void ScSpellDialogChildWindow::Init() { if( mpViewShell ) return; - if( (mpViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() )) == 0 ) + if( (mpViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() )) == nullptr ) return; mpViewData = &mpViewShell->GetViewData(); diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 9b9f4c2572e1..871de86d2c0e 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -79,8 +79,8 @@ bool ScConversionEngineBase::FindNextConversionCell() { ScMarkData& rMark = mrViewData.GetMarkData(); ScTabViewShell* pViewShell = mrViewData.GetViewShell(); - const ScPatternAttr* pPattern = NULL; - const ScPatternAttr* pLastPattern = NULL; + const ScPatternAttr* pPattern = nullptr; + const ScPatternAttr* pLastPattern = nullptr; std::unique_ptr<SfxItemSet> pEditDefaults(new SfxItemSet(GetEmptyItemSet())); diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index ca8c67e62e4e..e10a0a129728 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -478,7 +478,7 @@ void ScTabControl::DoDrag( const vcl::Region& /* rRegion */ ) pTransferObj->SetDragSource( pDocSh, aTabMark ); vcl::Window* pWindow = pViewData->GetActiveWin(); - SC_MOD()->SetDragObject( pTransferObj, NULL ); // for internal D&D + SC_MOD()->SetDragObject( pTransferObj, nullptr ); // for internal D&D pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); } diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 46cbafea8d08..e8a1918844d3 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -194,11 +194,11 @@ bool lcl_HasRowOutline( const ScViewData& rViewData ) ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) : pFrameWin( pParent ), aViewData( &rDocSh, pViewShell ), - pSelEngine( NULL ), + pSelEngine( nullptr ), aFunctionSet( &aViewData ), - pHdrSelEng( NULL ), + pHdrSelEng( nullptr ), aHdrFunc( &aViewData ), - pDrawView( NULL ), + pDrawView( nullptr ), aVScrollTop( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ), aVScrollBottom( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ), aHScrollLeft( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ), @@ -206,11 +206,11 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* aCornerButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, false ) ), aTopButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, true ) ), aScrollBarBox( VclPtr<ScrollBarBox>::Create( pFrameWin, WB_SIZEABLE ) ), - mpInputHintWindow( NULL ), - pPageBreakData( NULL ), - pBrushDocument( NULL ), - pDrawBrushSet( NULL ), - pTimerWindow( NULL ), + mpInputHintWindow( nullptr ), + pPageBreakData( nullptr ), + pBrushDocument( nullptr ), + pDrawBrushSet( nullptr ), + pTimerWindow( nullptr ), nTipVisible( 0 ), nPrevDragPos( 0 ), meBlockMode(None), @@ -266,7 +266,7 @@ void ScTabView::SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt ) void ScTabView::ResetTimer() { aScrollTimer.Stop(); - pTimerWindow = NULL; + pTimerWindow = nullptr; } IMPL_LINK_NOARG_TYPED(ScTabView, TimerHdl, Timer *, void) diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 68744a0c21cc..2d4dbe59ebdf 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -80,7 +80,7 @@ void moveCursorByProtRule( { SCCOL nNewUnhiddenCol = rCol + 1; SCCOL nEndCol = 0; - while(pDoc->ColHidden(nNewUnhiddenCol, nTab, NULL, &nEndCol)) + while(pDoc->ColHidden(nNewUnhiddenCol, nTab, nullptr, &nEndCol)) { if(nNewUnhiddenCol >= MAXCOL) return; @@ -121,7 +121,7 @@ void moveCursorByProtRule( { SCROW nNewUnhiddenRow = rRow + 1; SCROW nEndRow = 0; - while(pDoc->RowHidden(nNewUnhiddenRow, nTab, NULL, &nEndRow)) + while(pDoc->RowHidden(nNewUnhiddenRow, nTab, nullptr, &nEndRow)) { if(nNewUnhiddenRow >= MAXROW) return; @@ -501,7 +501,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, SCsROW nCurYOffset = 0; SCsROW nBlockStartYOffset = 0; bool bBlockStartMerged = false; - const ScMergeAttr* pMergeAttr = NULL; + const ScMergeAttr* pMergeAttr = nullptr; ScDocument* pDocument = aViewData.GetDocument(); // The following block checks whether or not the "BlockStart" (anchor) @@ -802,7 +802,7 @@ void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, S do { SCROW nLastRow = -1; - bSkipCell = pDoc->RowHidden(rCurY, nTab, NULL, &nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab ); + bSkipCell = pDoc->RowHidden(rCurY, nTab, nullptr, &nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab ); if (bSkipProtected && !bSkipCell) bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED); if (bSkipUnprotected && !bSkipCell) @@ -1426,7 +1426,7 @@ void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId ) void ScTabView::UpdatePageBreakData( bool bForcePaint ) { - ScPageBreakData* pNewData = NULL; + ScPageBreakData* pNewData = nullptr; if (aViewData.IsPagebreakMode()) { @@ -1439,7 +1439,7 @@ void ScTabView::UpdatePageBreakData( bool bForcePaint ) nCount = 1; pNewData = new ScPageBreakData(nCount); - ScPrintFunc aPrintFunc( pDocSh, pDocSh->GetPrinter(), nTab, 0,0,NULL, NULL, pNewData ); + ScPrintFunc aPrintFunc( pDocSh, pDocSh->GetPrinter(), nTab, 0,0,nullptr, nullptr, pNewData ); // ScPrintFunc fills the PageBreakData in ctor if ( nCount > 1 ) { diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index c864d2d053d2..8e6d1432f30a 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -323,7 +323,7 @@ void ScTabView::CheckSelectionTransfer() // remove own selection pOld->ForgetView(); - pScMod->SetSelectionTransfer( NULL ); + pScMod->SetSelectionTransfer( nullptr ); TransferableHelper::ClearSelection( GetActiveWin() ); // may delete pOld } // else: selection from outside: leave unchanged @@ -449,7 +449,7 @@ void ScTabView::CursorPosChanged() // Broadcast, so that other Views of the document also switch ScDocument* pDoc = aViewData.GetDocument(); - bool bDP = NULL != pDoc->GetDPAtCursor( + bool bDP = nullptr != pDoc->GetDPAtCursor( aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo() ); aViewData.GetViewShell()->SetPivotShell(bDP); @@ -659,7 +659,7 @@ void ScTabView::TestHintWindow() bool ScTabView::HasHintWindow() const { - return mpInputHintWindow.get() != NULL; + return mpInputHintWindow.get() != nullptr; } void ScTabView::RemoveHintWindow() @@ -696,7 +696,7 @@ static vcl::Window* lcl_GetCareWin(SfxViewFrame* pViewFrm) } } - return NULL; + return nullptr; } // adjust screen with respect to cursor position @@ -1734,7 +1734,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa sal_uInt16 nCurRefDlgId=pScMod->GetCurRefDlgId(); SfxViewFrame* pViewFrm = aViewData.GetViewShell()->GetViewFrame(); SfxChildWindow* pChildWnd = pViewFrm->GetChildWindow( nCurRefDlgId ); - IAnyRefDialog* pRefDlg = pChildWnd ? dynamic_cast<IAnyRefDialog*>(pChildWnd->GetWindow()) : NULL; + IAnyRefDialog* pRefDlg = pChildWnd ? dynamic_cast<IAnyRefDialog*>(pChildWnd->GetWindow()) : nullptr; if (pRefDlg) { pRefDlg->ViewShellChanged(); diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index a91af4d4c39c..cca6f0bac2e6 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -76,7 +76,7 @@ void ScTabView::Init() aScrollTimer.SetTimeoutHdl( LINK( this, ScTabView, TimerHdl ) ); for (i=0; i<4; i++) - pGridWin[i] = NULL; + pGridWin[i] = nullptr; pGridWin[SC_SPLIT_BOTTOMLEFT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT ); pSelEngine = new ScViewSelectionEngine( pGridWin[SC_SPLIT_BOTTOMLEFT], this, @@ -87,12 +87,12 @@ void ScTabView::Init() pColBar[SC_SPLIT_LEFT] = VclPtr<ScColBar>::Create( pFrameWin, &aViewData, SC_SPLIT_LEFT, &aHdrFunc, pHdrSelEng ); - pColBar[SC_SPLIT_RIGHT] = NULL; + pColBar[SC_SPLIT_RIGHT] = nullptr; pRowBar[SC_SPLIT_BOTTOM] = VclPtr<ScRowBar>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOM, &aHdrFunc, pHdrSelEng ); - pRowBar[SC_SPLIT_TOP] = NULL; + pRowBar[SC_SPLIT_TOP] = nullptr; for (i=0; i<2; i++) - pColOutline[i] = pRowOutline[i] = NULL; + pColOutline[i] = pRowOutline[i] = nullptr; pHSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_HSCROLL ), &aViewData ); pVSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_VSCROLL ), &aViewData ); @@ -130,8 +130,8 @@ void ScTabView::Init() // UpdateShow kommt beim Resize, oder bei Kopie einer bestehenden View aus dem ctor - pDrawActual = NULL; - pDrawOld = NULL; + pDrawActual = nullptr; + pDrawOld = nullptr; // DrawView darf nicht im TabView - ctor angelegt werden, // wenn die ViewShell noch nicht konstruiert ist... @@ -150,7 +150,7 @@ ScTabView::~ScTabView() if ( pOld && pOld->GetView() == this ) { pOld->ForgetView(); - pScMod->SetSelectionTransfer( NULL ); + pScMod->SetSelectionTransfer( nullptr ); TransferableHelper::ClearSelection( GetActiveWin() ); // may delete pOld } @@ -219,7 +219,7 @@ void ScTabView::MakeDrawView( TriState nForceDesignMode ) if (pGridWin[i]) { if ( SC_SPLIT_BOTTOMLEFT != (ScSplitPos)i ) - pDrawView->AddWindowToPaintView(pGridWin[i], 0); + pDrawView->AddWindowToPaintView(pGridWin[i], nullptr); } pDrawView->RecalcScale(); for (i=0; i<4; i++) @@ -254,7 +254,7 @@ void ScTabView::DoAddWin( ScGridWindow* pWin ) { if (pDrawView) { - pDrawView->AddWindowToPaintView(pWin, 0); + pDrawView->AddWindowToPaintView(pWin, nullptr); pWin->DrawLayerCreated(); } @@ -602,7 +602,7 @@ void ScTabView::SetBrushDocument( ScDocument* pNew, bool bLock ) delete pDrawBrushSet; pBrushDocument = pNew; - pDrawBrushSet = NULL; + pDrawBrushSet = nullptr; bLockPaintBrush = bLock; @@ -614,7 +614,7 @@ void ScTabView::SetDrawBrushSet( SfxItemSet* pNew, bool bLock ) delete pBrushDocument; delete pDrawBrushSet; - pBrushDocument = NULL; + pBrushDocument = nullptr; pDrawBrushSet = pNew; bLockPaintBrush = bLock; @@ -626,7 +626,7 @@ void ScTabView::ResetBrushDocument() { if ( HasPaintBrush() ) { - SetBrushDocument( NULL, false ); + SetBrushDocument( nullptr, false ); SetActivePointer( Pointer( PointerStyle::Arrow ) ); // switch pointers also when ended with escape key } } diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index 0f3b1d177edc..6aa2bb3c5b89 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -241,7 +241,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) pTabView->GetDrawFuncPtr()->Deactivate(); pTabView->SetDrawFuncOldPtr(pTabView->GetDrawFuncPtr()); - pTabView->SetDrawFuncPtr(NULL); + pTabView->SetDrawFuncPtr(nullptr); } SfxRequest aNewReq(rReq); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index d4badd8cd2d5..957fa3fdfc94 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -199,11 +199,11 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) const SfxPoolItem* pItem; if ( pReqArgs->GetItemState( SID_DEFINE_PRINTAREA, true, &pItem ) == SfxItemState::SET ) aPrintStr = static_cast<const SfxStringItem*>(pItem)->GetValue(); - SetPrintRanges( false, &aPrintStr, NULL, NULL, bAdd ); + SetPrintRanges( false, &aPrintStr, nullptr, nullptr, bAdd ); } else { - SetPrintRanges( false, NULL, NULL, NULL, bAdd ); // from selection + SetPrintRanges( false, nullptr, nullptr, nullptr, bAdd ); // from selection rReq.Done(); } } @@ -214,7 +214,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) // Clear currently defined print range if any, and reset it to // print entire sheet which is the default. OUString aEmpty; - SetPrintRanges(true, &aEmpty, NULL, NULL, false); + SetPrintRanges(true, &aEmpty, nullptr, nullptr, false); rReq.Done(); } break; @@ -472,7 +472,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) OUString aStrDocName( static_cast<const SfxStringItem&>(pReqArgs-> Get(nSlot)).GetValue() ); - SfxViewFrame* pViewFrame = NULL; + SfxViewFrame* pViewFrame = nullptr; ScDocShell* pDocSh = static_cast<ScDocShell*>(SfxObjectShell::GetFirst()); bool bFound = false; @@ -483,7 +483,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) if ( pDocSh->GetTitle() == aStrDocName ) { pViewFrame = SfxViewFrame::GetFirst( pDocSh ); - bFound = ( NULL != pViewFrame ); + bFound = ( nullptr != pViewFrame ); } pDocSh = static_cast<ScDocShell*>(SfxObjectShell::GetNext( *pDocSh )); @@ -623,7 +623,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { sal_uInt16 nId = ScInputWindowWrapper::GetChildWindowId(); SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId ); - bool bSet = ( pWnd == NULL ); + bool bSet = ( pWnd == nullptr ); const SfxPoolItem* pItem; if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET ) bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue(); @@ -748,7 +748,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) case SID_ATTR_ZOOMSLIDER: { - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom(); if ( pReqArgs && pReqArgs->GetItemState(SID_ATTR_ZOOMSLIDER, true, &pItem) == SfxItemState::SET ) { diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 15c4194706b8..faa12b474655 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -137,7 +137,7 @@ void ScTabViewShell::Activate(bool bMDI) ScInputHandler* pOldHdl=pWin->GetInputHandler(); SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> ); - while ( pSh!=NULL && pOldHdl!=NULL) + while ( pSh!=nullptr && pOldHdl!=nullptr) { if (static_cast<ScTabViewShell*>(pSh)->GetInputHandler() == pOldHdl) { @@ -225,7 +225,7 @@ void ScTabViewShell::Deactivate(bool bMDI) ScChangeTrack* pChanges=pDoc->GetChangeTrack(); - if(pChanges!=NULL) + if(pChanges!=nullptr) { Link<ScChangeTrack&,void> aLink; pChanges->SetModifiedLink(aLink); @@ -248,10 +248,10 @@ void ScTabViewShell::Deactivate(bool bMDI) GetViewData().GetDocShell()->UpdateOle(&GetViewData(), true); if ( pHdl ) - pHdl->NotifyChange( NULL, true ); // timer-delayed due to document switching + pHdl->NotifyChange( nullptr, true ); // timer-delayed due to document switching if (pScActiveViewShell == this) - pScActiveViewShell = NULL; + pScActiveViewShell = nullptr; bDontSwitch = bOldDontSwitch; } @@ -824,14 +824,14 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce) { if (svx::checkForSelectedCustomShapes( GetScDrawView(), true /* bOnlyExtruded */ )) { - if (pExtrusionBarShell == 0) + if (pExtrusionBarShell == nullptr) pExtrusionBarShell = new svx::ExtrusionBar(this); AddSubShell( *pExtrusionBarShell ); } sal_uInt32 nCheckStatus = 0; if (svx::checkForSelectedFontWork( GetScDrawView(), nCheckStatus )) { - if (pFontworkBarShell == 0) + if (pFontworkBarShell == nullptr) pFontworkBarShell = new svx::FontworkBar(this); AddSubShell( *pFontworkBarShell ); } @@ -994,7 +994,7 @@ SfxShell* ScTabViewShell::GetMySubShell() const pSub = const_cast<ScTabViewShell*>(this)->GetSubShell(++nPos); } - return NULL; // none from mine present + return nullptr; // none from mine present } bool ScTabViewShell::IsDrawTextShell() const @@ -1062,8 +1062,8 @@ VclPtr<SfxTabPage> ScTabViewShell::CreatePrintOptionsPage( vcl::Window *pParent, void ScTabViewShell::StopEditShell() { - if ( pEditShell != NULL && !bDontSwitch ) - SetEditShell(NULL, false ); + if ( pEditShell != nullptr && !bDontSwitch ) + SetEditShell(nullptr, false ); } // close handler to ensure function of dialog: @@ -1086,7 +1086,7 @@ IMPL_LINK_NOARG_TYPED(ScTabViewShell, SimpleRefClose, const OUString*, void) static ScTabViewObj* lcl_GetViewObj( ScTabViewShell& rShell ) { - ScTabViewObj* pRet = NULL; + ScTabViewObj* pRet = nullptr; SfxViewFrame* pViewFrame = rShell.GetViewFrame(); if (pViewFrame) { @@ -1634,26 +1634,26 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, nDrawSfxId(0), nCtrlSfxId(USHRT_MAX), nFormSfxId(USHRT_MAX), - pDrawShell(NULL), - pDrawTextShell(NULL), - pEditShell(NULL), - pPivotShell(NULL), - pAuditingShell(NULL), - pDrawFormShell(NULL), - pCellShell(NULL), - pOleObjectShell(NULL), - pChartShell(NULL), - pGraphicShell(NULL), - pMediaShell(NULL), - pPageBreakShell(NULL), - pExtrusionBarShell(NULL), - pFontworkBarShell(NULL), - pFormShell(NULL), - pInputHandler(NULL), - pCurFrameLine(NULL), + pDrawShell(nullptr), + pDrawTextShell(nullptr), + pEditShell(nullptr), + pPivotShell(nullptr), + pAuditingShell(nullptr), + pDrawFormShell(nullptr), + pCellShell(nullptr), + pOleObjectShell(nullptr), + pChartShell(nullptr), + pGraphicShell(nullptr), + pMediaShell(nullptr), + pPageBreakShell(nullptr), + pExtrusionBarShell(nullptr), + pFontworkBarShell(nullptr), + pFormShell(nullptr), + pInputHandler(nullptr), + pCurFrameLine(nullptr), aTarget(this), - pDialogDPObject(NULL), - pNavSettings(NULL), + pDialogDPObject(nullptr), + pNavSettings(nullptr), bActiveDrawSh(false), bActiveDrawTextSh(false), bActivePivotSh(false), @@ -1669,11 +1669,11 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, bInFormatDialog(false), bPrintSelected(false), bReadOnly(false), - pScSbxObject(NULL), + pScSbxObject(nullptr), bChartAreaValid(false), bForceFocusOnCurCell(false), nCurRefDlgId(0), - pAccessibilityBroadcaster(NULL), + pAccessibilityBroadcaster(nullptr), mbInSwitch(false) { const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); @@ -1729,7 +1729,7 @@ ScTabViewShell::~ScTabViewShell() SC_MOD()->ViewShellGone(this); RemoveSubShell(); // all - SetWindow(0); + SetWindow(nullptr); // all to NULL, in case the TabView-dtor tries to access them //! (should not really! ??!?!) @@ -1766,7 +1766,7 @@ void ScTabViewShell::SetDialogDPObject( const ScDPObject* pObj ) if (pObj) pDialogDPObject = new ScDPObject( *pObj ); else - pDialogDPObject = NULL; + pDialogDPObject = nullptr; } void ScTabViewShell::FillFieldData( ScHeaderFieldData& rData ) diff --git a/sc/source/ui/view/tabvwsh8.cxx b/sc/source/ui/view/tabvwsh8.cxx index 7485f116f513..2f61df7ecf9e 100644 --- a/sc/source/ui/view/tabvwsh8.cxx +++ b/sc/source/ui/view/tabvwsh8.cxx @@ -35,7 +35,7 @@ void ScTabViewShell::SetDefaultFrameLine( const ::editeng::SvxBorderLine* pLine else if ( pCurFrameLine ) { delete pCurFrameLine; - pCurFrameLine = NULL; + pCurFrameLine = nullptr; } } diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx index d8bbc2f34b45..f0711a953bdc 100644 --- a/sc/source/ui/view/tabvwsh9.cxx +++ b/sc/source/ui/view/tabvwsh9.cxx @@ -122,7 +122,7 @@ void ScTabViewShell::ExecImageMap( SfxRequest& rReq ) case SID_IMAP_EXEC: { SdrView* pDrView = GetSdrView(); - SdrMark* pMark = pDrView ? pDrView->GetMarkedObjectList().GetMark(0) : 0; + SdrMark* pMark = pDrView ? pDrView->GetMarkedObjectList().GetMark(0) : nullptr; if ( pMark ) { diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index f6ac626e1679..9c451be934ee 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -223,7 +223,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case SID_CURRENTCELL: { ScAddress aScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), 0 ); - OUString aAddr(aScAddress.Format(SCA_ABS, NULL, pDoc->GetAddressConvention())); + OUString aAddr(aScAddress.Format(SCA_ABS, nullptr, pDoc->GetAddressConvention())); SfxStringItem aPosItem( SID_CURRENTCELL, aAddr ); rSet.Put( aPosItem ); @@ -371,7 +371,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case SID_AUTO_OUTLINE: { - if (pDoc->GetChangeTrack()!=NULL || GetViewData().IsMultiMarked()) + if (pDoc->GetChangeTrack()!=nullptr || GetViewData().IsMultiMarked()) { rSet.DisableItem( nWhich ); } @@ -382,7 +382,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) { SCTAB nOlTab = GetViewData().GetTabNo(); ScOutlineTable* pOlTable = pDoc->GetOutlineTable( nOlTab ); - if (pOlTable == NULL) + if (pOlTable == nullptr) rSet.DisableItem( nWhich ); } break; @@ -401,7 +401,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case FID_CHG_SHOW: { - if ( pDoc->GetChangeTrack() == NULL || ( pDocShell && pDocShell->IsDocShared() ) ) + if ( pDoc->GetChangeTrack() == nullptr || ( pDocShell && pDocShell->IsDocShared() ) ) rSet.DisableItem( nWhich ); } break; @@ -409,7 +409,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) { rSet.Put(SfxBoolItem(FID_CHG_ACCEPT, pThisFrame->HasChildWindow(FID_CHG_ACCEPT))); - if(pDoc->GetChangeTrack()==NULL) + if(pDoc->GetChangeTrack()==nullptr) { if ( !pThisFrame->HasChildWindow(FID_CHG_ACCEPT) ) { @@ -528,7 +528,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName { const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); - const SfxPoolItem* pItem=NULL; + const SfxPoolItem* pItem=nullptr; if(pOutSet->GetItemState(SID_ATTR_NUMBERFORMAT_INFO,true,&pItem)==SfxItemState::SET) { @@ -602,7 +602,7 @@ void ScTabViewShell::UpdateInputHandler( bool bForce /* = sal_False */, bool bSt if ( pHdl ) { OUString aString; - const EditTextObject* pObject = NULL; + const EditTextObject* pObject = nullptr; ScViewData& rViewData = GetViewData(); ScDocument* pDoc = rViewData.GetDocument(); CellType eType; @@ -675,7 +675,7 @@ void ScTabViewShell::UpdateInputHandler( bool bForce /* = sal_False */, bool bSt // if using the view's local input handler, this view can always be set // as current view inside NotifyChange. - ScTabViewShell* pSourceSh = pInputHandler ? this : NULL; + ScTabViewShell* pSourceSh = pInputHandler ? this : nullptr; pHdl->NotifyChange( &aState, bForce, pSourceSh, bStopEditing ); } @@ -719,7 +719,7 @@ void ScTabViewShell::GetSaveState( SfxItemSet& rSet ) if ( nWhich != SID_SAVEDOC || !GetViewData().GetDocShell()->IsDocShared() ) { // get state from DocShell - pDocSh->GetSlotState( nWhich, NULL, &rSet ); + pDocSh->GetSlotState( nWhich, nullptr, &rSet ); } nWhich = aIter.NextWhich(); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index fdeeda14016e..223e6062cd6a 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -96,7 +96,7 @@ void ScTabViewShell::ConnectObject( SdrOle2Obj* pObj ) aRect.SetSize( aOleSize ); pClient->SetObjArea( aRect ); - static_cast<ScClient*>(pClient)->SetGrafEdit( NULL ); + static_cast<ScClient*>(pClient)->SetGrafEdit( nullptr ); } } @@ -164,7 +164,7 @@ bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) aRect.SetSize( aOleSize ); pClient->SetObjArea( aRect ); - static_cast<ScClient*>(pClient)->SetGrafEdit( NULL ); + static_cast<ScClient*>(pClient)->SetGrafEdit( nullptr ); nErr = pClient->DoVerb( nVerb ); bErrorShown = true; @@ -221,7 +221,7 @@ ErrCode ScTabViewShell::DoVerb(long nVerb) if (!pView) return ERRCODE_SO_NOTIMPL; // should not be - SdrOle2Obj* pOle2Obj = NULL; + SdrOle2Obj* pOle2Obj = nullptr; ErrCode nErr = ERRCODE_NONE; const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); @@ -383,7 +383,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) //! merge with ScViewFunc::PasteDataFormat (SotClipboardFormatId::SBA_FIELDDATAEXCHANGE)? ScDrawView* pDrView = GetScDrawView(); - SdrPageView* pPageView = pDrView ? pDrView->GetSdrPageView() : NULL; + SdrPageView* pPageView = pDrView ? pDrView->GetSdrPageView() : nullptr; if(pPageView) { svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue()); @@ -576,7 +576,7 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet) break; default: // get state from sfx view frame - GetViewFrame()->GetSlotState( nWhich, NULL, &rSet ); + GetViewFrame()->GetSlotState( nWhich, nullptr, &rSet ); } nWhich = aIter.NextWhich(); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 67a73b90b428..bfe6d8e72164 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -123,7 +123,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( // so that it does not re appear for instance after a crash (#42341#). if ( SC_MOD()->GetCurRefDlgId() != nSlotId ) - return NULL; + return nullptr; if ( nCurRefDlgId != nSlotId ) { @@ -131,7 +131,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( // -> lock the dispatcher for this view (modal mode) GetViewData().GetDispatcher().Lock( true ); // lock is reset when closing dialog - return NULL; + return nullptr; } VclPtr<SfxModelessDialog> pResult; @@ -477,11 +477,11 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( condformat::dialog::ScCondFormatDialogType aDialogType; // Get the pool item stored it by Conditional Format Manager Dialog. - const SfxPoolItem* pItem = NULL; + const SfxPoolItem* pItem = nullptr; sal_uInt32 nItems(GetPool().GetItemCount2( SCITEM_STRING )); for( sal_uInt32 nIter = 0; nIter < nItems; ++nIter ) { - if( NULL != (pItem = GetPool().GetItem2( SCITEM_STRING, nIter ) ) ) + if( nullptr != (pItem = GetPool().GetItem2( SCITEM_STRING, nIter ) ) ) { if ( ScCondFormatDlg::ParseXmlString( static_cast<const SfxStringItem*>(pItem)->GetValue(), diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index f8b8d5cd6d98..f2528e7fa02a 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -182,7 +182,7 @@ void ScTabViewShell::InsertURLField( const OUString& rName, const OUString& rURL } // single url in cell is shown in the dialog and replaced - bSelectFirst = HasBookmarkAtCursor( NULL ); + bSelectFirst = HasBookmarkAtCursor( nullptr ); pScMod->SetInputMode( SC_INPUT_TABLE ); } diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 132789c6d05f..cc64215a8696 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -76,7 +76,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) pDoc->GetName( nCurrentTab, aName ); bool bVisible=true; - if( pReqArgs != NULL ) + if( pReqArgs != nullptr ) { const SfxPoolItem* pItem; if( pReqArgs->HasItem( FID_TABLE_VISIBLE, &pItem ) ) @@ -173,7 +173,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) if ( !pDoc->IsDocEditable() ) break; // locked - if ( pReqArgs != NULL ) // from basic + if ( pReqArgs != nullptr ) // from basic { bool bOk = false; const SfxPoolItem* pTabItem; @@ -318,7 +318,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ( pDoc->IsTabProtected( nTabNr ) || nTabSelCount > 1 ) ) break; // no rename - if( pReqArgs != NULL ) + if( pReqArgs != nullptr ) { bool bDone = false; const SfxPoolItem* pItem; @@ -352,7 +352,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) OUString aErrMsg ( ScGlobal::GetRscString( STR_INVALIDTABNAME ) ); OUString aName; OUString aDlgTitle; - const sal_Char* pHelpId = 0; + const sal_Char* pHelpId = nullptr; switch ( nSlot ) { @@ -425,7 +425,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) case FID_TAB_MOVE: { - if ( pDoc->GetChangeTrack() != NULL ) + if ( pDoc->GetChangeTrack() != nullptr ) break; // if ChangeTracking is active, then no TabMove bool bDoIt = false; @@ -435,7 +435,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) OUString aDocName; OUString aTabName; - if( pReqArgs != NULL ) + if( pReqArgs != nullptr ) { SCTAB nTableCount = pDoc->GetTableCount(); const SfxPoolItem* pItem; @@ -455,7 +455,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) if (!aDocName.isEmpty()) { SfxObjectShell* pSh = SfxObjectShell::GetFirst(); - ScDocShell* pScSh = NULL; + ScDocShell* pScSh = nullptr; sal_uInt16 i=0; while ( pSh ) @@ -651,7 +651,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) if ( pDoc->IsTabProtected( nTabNr ) ) // ||nTabSelCount > 1 break; - if( pReqArgs != NULL ) + if( pReqArgs != nullptr ) { bool bDone = false; const SfxPoolItem* pItem; @@ -849,7 +849,7 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet ) case FID_TAB_MOVE: if ( !pDoc->IsDocEditable() - || pDoc->GetChangeTrack() != NULL + || pDoc->GetChangeTrack() != nullptr || nTabCount > MAXTAB) rSet.DisableItem( nWhich ); break; diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index a2ca96ec6883..6aa43f3c2ebd 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -254,7 +254,7 @@ void ScTabViewShell::BroadcastAccessibility( const SfxHint &rHint ) bool ScTabViewShell::HasAccessibilityObjects() { - return pAccessibilityBroadcaster != NULL; + return pAccessibilityBroadcaster != nullptr; } bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index a899178b50d5..6df608ecd656 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -295,11 +295,11 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : mpMarkData(new ScMarkData), pDocShell ( pDocSh ), - pDoc ( NULL ), + pDoc ( nullptr ), pView ( pViewSh ), pViewShell ( pViewSh ), pOptions ( new ScViewOptions ), - pSpellingView ( NULL ), + pSpellingView ( nullptr ), aLogicMode ( MAP_100TH_MM ), eDefZoomType( SvxZoomType::PERCENT ), aDefZoomX ( 1,1 ), @@ -344,7 +344,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : pThisTab = maTabData[nTabNo]; for (sal_uInt16 j=0; j<4; j++) { - pEditView[j] = NULL; + pEditView[j] = nullptr; bEditActive[j] = false; } @@ -364,7 +364,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : while ( !pDoc->IsVisible(nTabNo) && pDoc->HasTable(nTabNo+1) ) { ++nTabNo; - maTabData.push_back(NULL); + maTabData.push_back(nullptr); } maTabData[nTabNo] = new ScViewDataTable() ; pThisTab = maTabData[nTabNo]; @@ -430,7 +430,7 @@ ScViewData::ScViewData( const ScViewData& rViewData ) : pThisTab = maTabData[nTabNo]; for (sal_uInt16 j=0; j<4; j++) { - pEditView[j] = NULL; + pEditView[j] = nullptr; bEditActive[j] = false; } @@ -454,7 +454,7 @@ ScDocument* ScViewData::GetDocument() const return &pDocShell->GetDocument(); OSL_FAIL("no document on ViewData"); - return NULL; + return nullptr; } ScViewData::~ScViewData() @@ -480,7 +480,7 @@ void ScViewData::UpdateCurrentTab() void ScViewData::InsertTab( SCTAB nTab ) { if( nTab >= static_cast<SCTAB>(maTabData.size())) - maTabData.resize(nTab+1, NULL); + maTabData.resize(nTab+1, nullptr); else maTabData.insert( maTabData.begin() + nTab, nullptr ); CreateTabData( nTab ); @@ -492,10 +492,10 @@ void ScViewData::InsertTab( SCTAB nTab ) void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets ) { if( nTab+nNewSheets >= static_cast<SCTAB>(maTabData.size())) - maTabData.resize(nTab+nNewSheets, NULL); + maTabData.resize(nTab+nNewSheets, nullptr); else { - maTabData.insert( maTabData.begin() + nTab, nNewSheets, NULL ); + maTabData.insert( maTabData.begin() + nTab, nNewSheets, nullptr ); } for (SCTAB i = nTab; i < nTab + nNewSheets; ++i) { @@ -555,7 +555,7 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab ) { if (nDestTab==SC_TAB_APPEND) nDestTab = pDoc->GetTableCount() - 1; - ScViewDataTable* pTab = NULL; + ScViewDataTable* pTab = nullptr; if (nSrcTab < static_cast<SCTAB>(maTabData.size())) { pTab = maTabData[nSrcTab]; @@ -1383,7 +1383,7 @@ void ScViewData::EditGrowY( bool bInitial ) void ScViewData::ResetEditView() { - EditEngine* pEngine = NULL; + EditEngine* pEngine = nullptr; for (sal_uInt16 i=0; i<4; i++) if (pEditView[i]) { @@ -1408,7 +1408,7 @@ void ScViewData::KillEditView() if (bEditActive[i]) pEditView[i]->GetEditEngine()->RemoveView(pEditView[i]); delete pEditView[i]; - pEditView[i] = NULL; + pEditView[i] = nullptr; } } @@ -1447,7 +1447,7 @@ void ScViewData::EnsureTabDataSize(size_t nSize) if (nSize >= maTabData.size()) { size_t n = nSize - maTabData.size() + 1; - maTabData.insert(maTabData.end(), n, NULL); + maTabData.insert(maTabData.end(), n, nullptr); } } @@ -1725,7 +1725,7 @@ bool ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& r for (SCROW nRow = nY; nRow <= nY+nCountY-1; ++nRow) { SCROW nLastRow = nRow; - if (pDoc->RowHidden(nRow, nTabNo, NULL, &nLastRow)) + if (pDoc->RowHidden(nRow, nTabNo, nullptr, &nLastRow)) { nRow = nLastRow; continue; @@ -1923,7 +1923,7 @@ void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ) if ( nNewPosY > nOldPosY ) for ( i=nOldPosY; i<nNewPosY; i++ ) { - long nThis = pDoc->GetRowHeight( i, nTabNo, NULL, &nHeightEndRow ); + long nThis = pDoc->GetRowHeight( i, nTabNo, nullptr, &nHeightEndRow ); SCROW nRows = std::min( nNewPosY, nHeightEndRow + 1) - i; i = nHeightEndRow; nTPosY -= nThis * nRows; @@ -1932,7 +1932,7 @@ void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ) else for ( i=nNewPosY; i<nOldPosY; i++ ) { - long nThis = pDoc->GetRowHeight( i, nTabNo, NULL, &nHeightEndRow ); + long nThis = pDoc->GetRowHeight( i, nTabNo, nullptr, &nHeightEndRow ); SCROW nRows = std::min( nOldPosY, nHeightEndRow + 1) - i; i = nHeightEndRow; nTPosY += nThis * nRows; @@ -3073,7 +3073,7 @@ void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY, while (rScrY <= nEndPixels && nRow <= nEndRow) { SCROW nHeightEndRow; - sal_uInt16 nHeight = pDoc->GetRowHeight( nRow, nTabNo, NULL, &nHeightEndRow); + sal_uInt16 nHeight = pDoc->GetRowHeight( nRow, nTabNo, nullptr, &nHeightEndRow); if (nHeightEndRow > nEndRow) nHeightEndRow = nEndRow; if (!nHeight) @@ -3112,7 +3112,7 @@ void ScViewData::AddPixelsWhileBackward( long & rScrY, long nEndPixels, while (rScrY <= nEndPixels && nRow >= nStartRow) { SCROW nHeightStartRow; - sal_uInt16 nHeight = pDoc->GetRowHeight( nRow, nTabNo, &nHeightStartRow, NULL); + sal_uInt16 nHeight = pDoc->GetRowHeight( nRow, nTabNo, &nHeightStartRow, nullptr); if (nHeightStartRow < nStartRow) nHeightStartRow = nStartRow; if (!nHeight) diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 24dd690c9b41..843d4ce71c5e 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -483,7 +483,7 @@ bool ScViewFunc::GetAutoSumArea( ScRangeList& rRangeList ) void ScViewFunc::EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr) { OUString aFormula = GetAutoSumFormula( rRangeList, bSubTotal, rAddr ); - EnterBlock( aFormula, NULL ); + EnterBlock( aFormula, nullptr ); } bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor, bool bContinue ) @@ -764,7 +764,7 @@ void ScViewFunc::EnterBlock( const OUString& rString, const EditTextObject* pDat if (!aTester.NeedsObject()) { aNewStr = aEngine.GetText(); - pData = NULL; + pData = nullptr; } } @@ -956,7 +956,7 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint, if ( pRepCol ) { if ( pRepCol->isEmpty() ) - rDoc.SetRepeatColRange( nTab, NULL ); + rDoc.SetRepeatColRange( nTab, nullptr ); else if ( aRange.ParseAny( *pRepCol, &rDoc, aDetails ) & SCA_VALID ) rDoc.SetRepeatColRange( nTab, &aRange ); @@ -967,7 +967,7 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint, if ( pRepRow ) { if ( pRepRow->isEmpty() ) - rDoc.SetRepeatRowRange( nTab, NULL ); + rDoc.SetRepeatRowRange( nTab, nullptr ); else if ( aRange.ParseAny( *pRepRow, &rDoc, aDetails ) & SCA_VALID ) rDoc.SetRepeatRowRange( nTab, &aRange ); @@ -1445,7 +1445,7 @@ void ScViewFunc::FillTab( InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool else aMarkRange = ScRange( GetViewData().GetCurX(), GetViewData().GetCurY(), nTab ); - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if (bUndo) { @@ -1593,7 +1593,7 @@ void ScViewFunc::TransliterateText( sal_Int32 nType ) ScAutoFormatData* ScViewFunc::CreateAutoFormatData() { - ScAutoFormatData* pData = NULL; + ScAutoFormatData* pData = nullptr; SCCOL nStartCol; SCROW nStartRow; SCTAB nStartTab; @@ -1933,7 +1933,7 @@ void ScViewFunc::Solve( const ScSolveParam& rParam ) } OUString aTargetValStr; - if ( rParam.pStrTargetVal != NULL ) + if ( rParam.pStrTargetVal != nullptr ) aTargetValStr = *(rParam.pStrTargetVal); OUString aMsgStr; @@ -2219,8 +2219,8 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord ) --nNewTab; bool bWasLinked = false; - ScDocument* pUndoDoc = NULL; - ScRefUndoData* pUndoData = NULL; + ScDocument* pUndoDoc = nullptr; + ScRefUndoData* pUndoData = nullptr; if (bRecord) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -2538,9 +2538,9 @@ void ScViewFunc::MoveTable( { ScDocument* pDoc = GetViewData().GetDocument(); ScDocShell* pDocShell = GetViewData().GetDocShell(); - ScDocument* pDestDoc = NULL; - ScDocShell* pDestShell = NULL; - ScTabViewShell* pDestViewSh = NULL; + ScDocument* pDestDoc = nullptr; + ScDocShell* pDestShell = nullptr; + ScTabViewShell* pDestViewSh = nullptr; bool bUndo (pDoc->IsUndoEnabled()); bool bRename = pNewTabName && !pNewTabName->isEmpty(); @@ -3033,7 +3033,7 @@ void ScViewFunc::UpdateLineAttrs( SvxBorderLine& rLine, aBoxItem.SetLine( &aLine, BOXLINE ); \ } \ else \ - aBoxItem.SetLine( NULL, BOXLINE ); \ + aBoxItem.SetLine( nullptr, BOXLINE ); \ } void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine, @@ -3054,13 +3054,13 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine, const ScPatternAttr* pSelAttrs = GetSelectionPattern(); const SfxItemSet& rSelItemSet = pSelAttrs->GetItemSet(); - const SfxPoolItem* pBorderAttr = NULL; + const SfxPoolItem* pBorderAttr = nullptr; SfxItemState eItemState = rSelItemSet.GetItemState( ATTR_BORDER, true, &pBorderAttr ); - const SfxPoolItem* pTLBRItem = 0; + const SfxPoolItem* pTLBRItem = nullptr; SfxItemState eTLBRState = rSelItemSet.GetItemState( ATTR_BORDER_TLBR, true, &pTLBRItem ); - const SfxPoolItem* pBLTRItem = 0; + const SfxPoolItem* pBLTRItem = nullptr; SfxItemState eBLTRState = rSelItemSet.GetItemState( ATTR_BORDER_BLTR, true, &pBLTRItem ); // any of the lines visible? @@ -3082,7 +3082,7 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine, if( pBorderAttr ) { - const SvxBorderLine* pBoxLine = NULL; + const SvxBorderLine* pBoxLine = nullptr; SvxBoxItem aBoxItem( *static_cast<const SvxBoxItem*>(pBorderAttr) ); SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER ); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 95ae35f073f7..027f4f86ae40 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -111,7 +111,7 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects ) ScAddress aOldEnd( aRange.aEnd ); // combined cells in this range? pDoc->ExtendMerge( aRange, true ); - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if ( bRecord ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -249,7 +249,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b if ( bSysClip ) { - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); ScGlobal::SetClipDocName( pDoc->GetDocumentShell()->GetTitle( SFX_TITLE_FULLNAME ) ); } pClipDoc->ExtendMerge( aRange, true ); @@ -271,7 +271,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b } pTransferObj->CopyToClipboard( GetActiveWin() ); - SC_MOD()->SetClipObject( pTransferObj, NULL ); + SC_MOD()->SetClipObject( pTransferObj, nullptr ); } bDone = true; @@ -380,7 +380,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b } pTransferObj->CopyToClipboard( GetActiveWin() ); // system clipboard - SC_MOD()->SetClipObject( pTransferObj, NULL ); // internal clipboard + SC_MOD()->SetClipObject( pTransferObj, nullptr ); // internal clipboard } bSuccess = true; @@ -416,7 +416,7 @@ ScTransferObj* ScViewFunc::CopyToTransferable() ScClipParam aClipParam(aRange, false); pDoc->CopyToClip(aClipParam, pClipDoc, &rMark, false, false, true); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); pClipDoc->ExtendMerge( aRange, true ); ScDocShell* pDocSh = GetViewData().GetDocShell(); @@ -428,7 +428,7 @@ ScTransferObj* ScViewFunc::CopyToTransferable() } } - return NULL; + return nullptr; } // P A S T E @@ -586,8 +586,8 @@ void ScViewFunc::PasteFromSystem() void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTransferable>& rxTransferable ) { - ScTransferObj *pOwnClip=0; - ScDrawTransferObj *pDrawClip=0; + ScTransferObj *pOwnClip=nullptr; + ScDrawTransferObj *pDrawClip=nullptr; uno::Reference<lang::XUnoTunnel> xTunnel( rxTransferable, uno::UNO_QUERY ); if ( xTunnel.is() ) { @@ -726,7 +726,7 @@ bool ScViewFunc::PasteFromSystem( SotClipboardFormatId nFormatId, bool bApi ) bRet = PasteDataFormat( nFormatId, aDataHelper.GetTransferable(), nPosX, nPosY, - NULL, false, !bApi ); // allow warning dialog + nullptr, false, !bApi ); // allow warning dialog if ( !bRet && !bApi ) ErrorMessage(STR_PASTE_ERROR); @@ -891,7 +891,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, bool bPasteDraw = ( pClipDoc->GetDrawLayer() && ( nFlags & (InsertDeleteFlags::OBJECTS|InsertDeleteFlags::NOTE) ) ); ScDocShellRef aTransShellRef; // for objects in xTransClip - must remain valid as long as xTransClip - ScDocument* pOrigClipDoc = NULL; + ScDocument* pOrigClipDoc = nullptr; ::std::unique_ptr< ScDocument > xTransClip; if ( bTranspose ) { @@ -918,7 +918,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, pClipDoc->TransposeClip( xTransClip.get(), nFlags, bAsLink ); pClipDoc = xTransClip.get(); - ScDrawLayer::SetGlobalDrawPersist(NULL); + ScDrawLayer::SetGlobalDrawPersist(nullptr); } SCCOL nStartCol; @@ -1179,11 +1179,11 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, if (lcl_SelHasAttrib( pDoc, nStartCol,nStartRow, nUndoEndCol,nUndoEndRow, aFilteredMark, HASATTR_OVERLAPPED )) { // "Cell merge not possible if cells already merged" ScDocAttrIterator aIter( pDoc, nStartTab, nStartCol, nStartRow, nUndoEndCol, nUndoEndRow ); - const ScPatternAttr* pPattern = NULL; + const ScPatternAttr* pPattern = nullptr; SCCOL nCol = -1; SCROW nRow1 = -1; SCROW nRow2 = -1; - while ( ( pPattern = aIter.GetNext( nCol, nRow1, nRow2 ) ) != NULL ) + while ( ( pPattern = aIter.GetNext( nCol, nRow1, nRow2 ) ) != nullptr ) { const ScMergeAttr* pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem(ATTR_MERGE) ); const ScMergeFlagAttr* pMergeFlagAttr = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem(ATTR_MERGE_FLAG) ); @@ -1207,9 +1207,9 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, bool bColInfo = ( nStartRow==0 && nEndRow==MAXROW ); bool bRowInfo = ( nStartCol==0 && nEndCol==MAXCOL ); - ScDocument* pUndoDoc = NULL; - ScDocument* pRefUndoDoc = NULL; - ScRefUndoData* pUndoData = NULL; + ScDocument* pUndoDoc = nullptr; + ScDocument* pRefUndoDoc = nullptr; + ScRefUndoData* pUndoData = nullptr; if ( bRecord ) { @@ -1273,7 +1273,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, // copy normally (original range) pDoc->CopyFromClip( aUserRange, aFilteredMark, nNoObjFlags, pRefUndoDoc, pClipDoc, true, false, bIncludeFiltered, - bSkipEmpty, (bMarkIsFiltered ? &aRangeList : NULL) ); + bSkipEmpty, (bMarkIsFiltered ? &aRangeList : nullptr) ); // adapt refs manually in case of transpose if ( bTranspose && bCutMode && (nFlags & InsertDeleteFlags::CONTENTS) ) @@ -1307,13 +1307,13 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, AdjustBlockHeight(); // update row heights before pasting objects ::std::vector< OUString > aExcludedChartNames; - SdrPage* pPage = NULL; + SdrPage* pPage = nullptr; if ( nFlags & InsertDeleteFlags::OBJECTS ) { ScDrawView* pScDrawView = GetScDrawView(); - SdrModel* pModel = ( pScDrawView ? pScDrawView->GetModel() : NULL ); - pPage = ( pModel ? pModel->GetPage( static_cast< sal_uInt16 >( nStartTab ) ) : NULL ); + SdrModel* pModel = ( pScDrawView ? pScDrawView->GetModel() : nullptr ); + pPage = ( pModel ? pModel->GetPage( static_cast< sal_uInt16 >( nStartTab ) ) : nullptr ); if ( pPage ) { ScChartHelper::GetChartNames( aExcludedChartNames, pPage ); @@ -1342,7 +1342,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, if ( bRecord ) { - ScDocument* pRedoDoc = NULL; + ScDocument* pRedoDoc = nullptr; // copy redo data after appearance of the first undo // don't create Redo-Doc without RefUndoDoc @@ -1571,7 +1571,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( aOptions.eMoveMode = eMoveMode; ScUndoPaste* pUndo = new ScUndoPaste(pDocSh, - aMarkedRange, aMark, pUndoDoc.release(), NULL, nFlags|nUndoFlags, NULL, false, &aOptions); + aMarkedRange, aMark, pUndoDoc.release(), nullptr, nFlags|nUndoFlags, nullptr, false, &aOptions); if (bInsertCells) pUndoMgr->AddUndoAction(new ScUndoWrapper(pUndo), true); @@ -1689,7 +1689,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( for (size_t i = 0, n = aRanges.size(); i < n; ++i) { pDoc->CopyFromClip( - *aRanges[i], aMark, (nFlags & ~InsertDeleteFlags::OBJECTS), NULL, pClipDoc, + *aRanges[i], aMark, (nFlags & ~InsertDeleteFlags::OBJECTS), nullptr, pClipDoc, false, false, true, bSkipEmpty); } @@ -1707,7 +1707,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( for (size_t i = 0, n = aRanges.size(); i < n; ++i) { pDoc->CopyFromClip( - *aRanges[i], aMark, InsertDeleteFlags::OBJECTS, NULL, pClipDoc, + *aRanges[i], aMark, InsertDeleteFlags::OBJECTS, nullptr, pClipDoc, false, false, true, bSkipEmpty); } } @@ -1731,7 +1731,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( aOptions.eMoveMode = eMoveMode; ScUndoPaste* pUndo = new ScUndoPaste( - pDocSh, aRanges, aMark, pUndoDoc.release(), NULL, nFlags|nUndoFlags, NULL, false, &aOptions); + pDocSh, aRanges, aMark, pUndoDoc.release(), nullptr, nFlags|nUndoFlags, nullptr, false, &aOptions); pUndoMgr->AddUndoAction(pUndo); pUndoMgr->LeaveListAction(); @@ -1918,9 +1918,9 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , if ( pDoc ) { const bool bRecord( pDoc->IsUndoEnabled()); - ScDocument* pUndoDoc = NULL; - ScDocument* pRedoDoc = NULL; - ScRefUndoData* pUndoData = NULL; + ScDocument* pUndoDoc = nullptr; + ScDocument* pRedoDoc = nullptr; + ScRefUndoData* pUndoData = nullptr; SCTAB nTab = GetViewData().GetTabNo(); SCTAB nStartTab = nTab; SCTAB nEndTab = nTab; @@ -1960,7 +1960,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , nStartCol, nCurrentRow, nStartTab, nUndoEndCol, nUndoEndRow, nEndTab, rMark, pUndoDoc, pRedoDoc, nUndoFlags, - pUndoData, NULL, NULL, NULL, + pUndoData, nullptr, nullptr, nullptr, false ); // FALSE = Redo data not yet copied pUndoMgr->AddUndoAction( new ScUndoWrapper( pUndo ), true ); diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 9db01ae474fd..199813fe1d49 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -113,7 +113,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, if (nEndRow > MAXROW) nEndRow = MAXROW; - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if (bRecord) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -146,7 +146,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, aDestMark.SetMarkArea( aMarkRange ); pDocSh->GetUndoManager()->AddUndoAction( new ScUndoPaste( pDocSh, aMarkRange, aDestMark, - pUndoDoc, pRedoDoc, InsertDeleteFlags::ALL, NULL)); + pUndoDoc, pRedoDoc, InsertDeleteFlags::ALL, nullptr)); } } @@ -205,7 +205,7 @@ void ScViewFunc::DoRefConversion( bool bRecord ) ScDocShell* pDocSh = GetViewData().GetDocShell(); bool bOk = false; - ScDocument* pUndoDoc = NULL; + ScDocument* pUndoDoc = nullptr; if (bRecord) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -309,7 +309,7 @@ void ScViewFunc::DoThesaurus( bool bRecord ) ScMarkData& rMark = GetViewData().GetMarkData(); ScSplitPos eWhich = GetViewData().GetActivePart(); EESpellState eState; - EditView* pEditView = NULL; + EditView* pEditView = nullptr; std::unique_ptr<ESelection> pEditSel; std::unique_ptr<ScEditEngineDefaulter> pThesaurusEngine; bool bIsEditMode = GetViewData().HasEditView(eWhich); @@ -352,7 +352,7 @@ void ScViewFunc::DoThesaurus( bool bRecord ) pThesaurusEngine->SetRefDevice(GetViewData().GetActiveWin()); pThesaurusEngine->SetSpeller(xSpeller); MakeEditView(pThesaurusEngine.get(), nCol, nRow ); - const ScPatternAttr* pPattern = NULL; + const ScPatternAttr* pPattern = nullptr; std::unique_ptr<SfxItemSet> pEditDefaults( new SfxItemSet(pThesaurusEngine->GetEmptyItemSet())); pPattern = rDoc.GetPattern(nCol, nRow, nTab); @@ -435,7 +435,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR ScDocument& rDoc = pDocSh->GetDocument(); ScMarkData& rMark = rViewData.GetMarkData(); ScSplitPos eWhich = rViewData.GetActivePart(); - EditView* pEditView = NULL; + EditView* pEditView = nullptr; bool bIsEditMode = rViewData.HasEditView(eWhich); if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; @@ -465,8 +465,8 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR } } - ScDocument* pUndoDoc = NULL; - ScDocument* pRedoDoc = NULL; + ScDocument* pUndoDoc = nullptr; + ScDocument* pRedoDoc = nullptr; if (bRecord) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -554,7 +554,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR // *** final cleanup *** -------------------------------------------------- - rViewData.SetSpellingView( NULL ); + rViewData.SetSpellingView( nullptr ); KillEditView(true); pEngine.reset(); pDocSh->PostPaintGridAll(); @@ -575,7 +575,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink if( ::avmedia::MediaWindow::isMediaURL( aStrURL, ""/*TODO?*/ ) ) { const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, aStrURL ); - return ( 0 != GetViewData().GetDispatcher().Execute( + return ( nullptr != GetViewData().GetDispatcher().Execute( SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON, &aMediaURLItem, 0L ) ); } @@ -583,7 +583,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink if (!bLink) // for bLink only graphics or URL { // 1. can I open the file? - const SfxFilter* pFlt = NULL; + const SfxFilter* pFlt = nullptr; // search only for its own filters, without selection box (as in ScDocumentLoader) SfxFilterMatcher aMatcher( ScDocShell::Factory().GetFilterContainer()->GetName() ); @@ -604,7 +604,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink // Open Asynchronously, because it can also happen from D&D // and that is not so good for the MAC... - return ( 0 != rDispatcher.Execute( SID_OPENDOC, + return ( nullptr != rDispatcher.Execute( SID_OPENDOC, SfxCallMode::ASYNCHRON, &aFileNameItem, &aFilterItem, &aTargetItem, 0L) ); } } @@ -722,7 +722,7 @@ void ScViewFunc::InsertBookmark( const OUString& rDescription, const OUString& r sal_Int32 nTxtLen = aEngine.GetTextLen(nPara); ESelection aInsSel( nPara, nTxtLen, nPara, nTxtLen ); - if ( bTryReplace && HasBookmarkAtCursor( NULL ) ) + if ( bTryReplace && HasBookmarkAtCursor( nullptr ) ) { // if called from hyperlink slot and cell contains only a URL, // replace old URL with new one diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 3e0f57302a82..260f4f8efa46 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -307,7 +307,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, // make sense to do it for other data types too. ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg( - pFact->CreateScTextImportOptionsDlg(NULL)); + pFact->CreateScTextImportOptionsDlg(nullptr)); if (pDlg->Execute() == RET_OK) { @@ -336,7 +336,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); std::unique_ptr<AbstractScImportAsciiDlg> pDlg( - pFact->CreateScImportAsciiDlg( NULL, OUString(), &aStrm, + pFact->CreateScImportAsciiDlg( nullptr, OUString(), &aStrm, SC_PASTETEXT)); if (pDlg->Execute() == RET_OK) @@ -492,7 +492,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, ScDocShellRef aDragShellRef( new ScDocShell ); aDragShellRef->DoInitNew(); - std::unique_ptr<FmFormModel> pModel(new FmFormModel( aPath, NULL, aDragShellRef )); + std::unique_ptr<FmFormModel> pModel(new FmFormModel( aPath, nullptr, aDragShellRef )); pModel->GetItemPool().FreezeIdRanges(); xStm->Seek(0); @@ -544,7 +544,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, { ScRange aSource; const ScExtDocOptions* pExtOpt = pInsDoc->GetExtDocOptions(); - const ScExtTabSettings* pTabSett = pExtOpt ? pExtOpt->GetTabSettings( nSrcTab ) : 0; + const ScExtTabSettings* pTabSett = pExtOpt ? pExtOpt->GetTabSettings( nSrcTab ) : nullptr; if( pTabSett && pTabSett->maUsedArea.IsValid() ) { aSource = pTabSett->maUsedArea; @@ -693,7 +693,7 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r const OUString* pApp = &aStrs[0]; const OUString* pTopic = &aStrs[1]; const OUString* pItem = &aStrs[2]; - const OUString* pExtra = NULL; + const OUString* pExtra = nullptr; if (aStrs.size() > 3) pExtra = &aStrs[3]; diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 79da9e04d826..8cf5de5673a0 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -93,7 +93,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, bool bNegativePage = GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() ); - SdrView* pDragEditView = NULL; + SdrView* pDragEditView = nullptr; ScModule* pScMod = SC_MOD(); const ScDragData& rData = pScMod->GetDragData(); ScDrawTransferObj* pDrawTrans = rData.pDrawTransfer; @@ -157,7 +157,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, SdrObject* pNeuObj=pObj->Clone(); - if (pNeuObj!=NULL) + if (pNeuObj!=nullptr) { pNeuObj->SetModel(pDrawModel); pNeuObj->SetPage(pDestPage); @@ -182,7 +182,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, ScDocument* pDocument = GetViewData().GetDocument(); ScDocShell* pDocShell = GetViewData().GetDocShell(); - ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL ); + ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : nullptr ); if ( pDocument && pDestPage && pModelObj && pDrawTrans ) { const ScRangeListVector& rProtectedChartRangesVector( pDrawTrans->GetProtectedChartRangesVector() ); @@ -223,7 +223,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, if ( !bSameDocClipboard ) GetViewData().GetDocument()->SetPastingDrawFromOtherDoc( true ); - pScDrawView->Paste(*pModel, aPos, NULL, nOptions, rSrcShellID, rDestShellID); + pScDrawView->Paste(*pModel, aPos, nullptr, nOptions, rSrcShellID, rDestShellID); if ( !bSameDocClipboard ) GetViewData().GetDocument()->SetPastingDrawFromOtherDoc( false ); @@ -251,8 +251,8 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, ScDocument* pDocument = GetViewData().GetDocument(); ScDocShell* pDocShell = GetViewData().GetDocShell(); - ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL ); - ScDrawTransferObj* pTransferObj = ScDrawTransferObj::GetOwnClipboard( NULL ); + ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : nullptr ); + ScDrawTransferObj* pTransferObj = ScDrawTransferObj::GetOwnClipboard( nullptr ); if ( pDocument && pPage && pModelObj && ( pTransferObj || pDrawTrans ) ) { const ScRangeListVector& rProtectedChartRangesVector( @@ -390,7 +390,7 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic, SdrPageView* pPageView = pScDrawView->GetSdrPageView(); if (pPageView) { - SdrObject* pPickObj = 0; + SdrObject* pPickObj = nullptr; if (pScDrawView->PickObj(rPos, pScDrawView->getHitTolLog(), pPickObj, pPageView)) { const OUString aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP)); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 2bff93479c03..c5f6f8fda02c 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -662,7 +662,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, // undo - EditTextObject* pUndoData = NULL; + EditTextObject* pUndoData = nullptr; ScUndoEnterData::ValuesType aOldValues; if (bRecord && !bSimple) @@ -774,7 +774,7 @@ void ScViewFunc::EnterMatrix( const OUString& rString, ::formula::FormulaGrammar { ScDocShell* pDocSh = rData.GetDocShell(); bool bSuccess = pDocSh->GetDocFunc().EnterMatrix( - aRange, &rMark, NULL, rString, false, false, EMPTY_OUSTRING, eGram ); + aRange, &rMark, nullptr, rString, false, false, EMPTY_OUSTRING, eGram ); if (bSuccess) pDocSh->UpdateOle(&GetViewData()); } @@ -1148,8 +1148,8 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, SCROW nEndRow = aMarkRange.aEnd.Row(); SCTAB nEndTab = aMarkRange.aEnd.Tab(); - ScUndoSelectionAttr* pUndoAttr = NULL; - ScEditDataArray* pEditDataArray = NULL; + ScUndoSelectionAttr* pUndoAttr = nullptr; + ScEditDataArray* pEditDataArray = nullptr; if (bRecord) { ScRange aCopyRange = aMarkRange; @@ -1188,16 +1188,16 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, SCROW nRow = rViewData.GetCurY(); SCTAB nTab = rViewData.GetTabNo(); - EditTextObject* pOldEditData = NULL; - EditTextObject* pNewEditData = NULL; + EditTextObject* pOldEditData = nullptr; + EditTextObject* pNewEditData = nullptr; ScAddress aPos(nCol, nRow, nTab); if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT) { const EditTextObject* pEditObj = rDoc.GetEditText(aPos); - pOldEditData = pEditObj ? pEditObj->Clone() : NULL; + pOldEditData = pEditObj ? pEditObj->Clone() : nullptr; rDoc.RemoveEditTextCharAttribs(aPos, rAttr); pEditObj = rDoc.GetEditText(aPos); - pNewEditData = pEditObj ? pEditObj->Clone() : NULL; + pNewEditData = pEditObj ? pEditObj->Clone() : nullptr; } aChangeRanges.Append(aPos); @@ -1231,7 +1231,7 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, PropertyEntryVector_t aPropVector = rMap.getPropertyEntries(); for ( sal_uInt16 nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; ++nWhich ) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if ( rNewSet.GetItemState( nWhich, true, &pItem ) == SfxItemState::SET && pItem ) { PropertyEntryVector_t::const_iterator aIt = aPropVector.begin(); @@ -1280,7 +1280,7 @@ const SfxStyleSheet* ScViewFunc::GetStyleSheetFromMarked() // Don't use UnmarkFiltered in slot state functions, for performance reasons. // The displayed state is always that of the whole selection including filtered rows. - const ScStyleSheet* pSheet = NULL; + const ScStyleSheet* pSheet = nullptr; ScViewData& rViewData = GetViewData(); ScDocument* pDoc = rViewData.GetDocument(); ScMarkData& rMark = rViewData.GetMarkData(); @@ -1640,8 +1640,8 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord ) WaitObject aWait( GetFrameWin() ); // important for TrackFormulas in UpdateReference - ScDocument* pUndoDoc = NULL; - ScRefUndoData* pUndoData = NULL; + ScDocument* pUndoDoc = nullptr; + ScRefUndoData* pUndoData = nullptr; if (bRecord) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -1877,8 +1877,8 @@ void ScViewFunc::SetWidthOrHeight( bFormula = rOpts.GetOption( VOPT_FORMULAS ); } - ScDocument* pUndoDoc = NULL; - ScOutlineTable* pUndoTab = NULL; + ScDocument* pUndoDoc = nullptr; + ScOutlineTable* pUndoTab = nullptr; std::vector<sc::ColRowSpan> aUndoRanges; if ( bRecord ) @@ -1945,7 +1945,7 @@ void ScViewFunc::SetWidthOrHeight( for (SCROW nRow = nStartNo; nRow <= nEndNo; ++nRow) { SCROW nLastRow = nRow; - if (rDoc.RowHidden(nRow, nTab, NULL, &nLastRow)) + if (rDoc.RowHidden(nRow, nTab, nullptr, &nLastRow)) { nRow = nLastRow; continue; @@ -2671,7 +2671,7 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol, if ( pList->insert( pNewEntry ) ) bOk = true; - pNewEntry = NULL; // never delete, insert took ownership + pNewEntry = nullptr; // never delete, insert took ownership rDoc.CompileHybridFormula(); diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index aba3a38b5e55..4f71d63bfc8e 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -256,7 +256,7 @@ void ScViewUtil::UnmarkFiltered( ScMarkData& rMark, ScDocument* pDoc ) for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow) { SCROW nLastRow = nRow; - if (pDoc->RowFiltered(nRow, nTab, NULL, &nLastRow)) + if (pDoc->RowFiltered(nRow, nTab, nullptr, &nLastRow)) { // use nStartCol/nEndCol, so the multi mark area isn't extended to all columns // (visible in repaint for indentation) @@ -368,7 +368,7 @@ bool ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont, bool ScViewUtil::IsFullScreen( SfxViewShell& rViewShell ) { SfxBindings& rBindings = rViewShell.GetViewFrame()->GetBindings(); - SfxPoolItem* pItem = 0; + SfxPoolItem* pItem = nullptr; bool bIsFullScreen = false; if (rBindings.QueryState( SID_WIN_FULLSCREEN, pItem ) >= SfxItemState::DEFAULT) diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index f973ef3e2352..57b34dd08f29 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -70,7 +70,7 @@ ScXMLSourceDlg::ScXMLSourceDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, ScDocument* pDoc) : ScAnyRefDlg(pB, pCW, pParent, "XMLSourceDialog", "modules/scalc/ui/xmlsourcedialog.ui") - , mpCurRefEntry(NULL) + , mpCurRefEntry(nullptr) , mpDoc(pDoc) , mbDlgLostFocus(false) { @@ -82,7 +82,7 @@ ScXMLSourceDlg::ScXMLSourceDlg( mpLbTree->set_width_request(aTreeSize.Width()); mpLbTree->set_height_request(aTreeSize.Height()); get(mpRefEdit, "edit"); - mpRefEdit->SetReferences(this, NULL); + mpRefEdit->SetReferences(this, nullptr); get(mpRefBtn, "ref"); mpRefBtn->SetReferences(this, mpRefEdit); get(mpBtnCancel, "cancel"); @@ -227,7 +227,7 @@ void ScXMLSourceDlg::LoadSourceFileStructure(const OUString& rPath) void ScXMLSourceDlg::HandleGetFocus(Control* pCtrl) { - mpActiveEdit = NULL; + mpActiveEdit = nullptr; if (pCtrl == mpRefEdit || pCtrl == mpRefBtn) mpActiveEdit = mpRefEdit; @@ -263,7 +263,7 @@ public: SvTreeListEntry* getReferenceEntry(SvTreeListBox& rTree, SvTreeListEntry* pCurEntry) { SvTreeListEntry* pParent = rTree.GetParent(pCurEntry); - SvTreeListEntry* pRefEntry = NULL; + SvTreeListEntry* pRefEntry = nullptr; while (pParent) { ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); |