diff options
35 files changed, 315 insertions, 315 deletions
diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx index 41ec150cadd6..e57e50c73eae 100644 --- a/starmath/inc/ElementsDockingWindow.hxx +++ b/starmath/inc/ElementsDockingWindow.hxx @@ -108,7 +108,7 @@ class SmElementsControl : public Control //if pContext is not NULL, then draw, otherwise //just layout - void LayoutOrPaintContents(vcl::RenderContext *pContext = NULL); + void LayoutOrPaintContents(vcl::RenderContext *pContext = nullptr); public: SmElementsControl(vcl::Window *pParent); diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx index d7f7b9efa3bb..bb1fc840d385 100644 --- a/starmath/inc/caret.hxx +++ b/starmath/inc/caret.hxx @@ -17,7 +17,7 @@ /** Representation of caret position with an equation */ struct SmCaretPos{ - SmCaretPos(SmNode* selectedNode = NULL, int iIndex = 0) { + SmCaretPos(SmNode* selectedNode = nullptr, int iIndex = 0) { pSelectedNode = selectedNode; Index = iIndex; } @@ -35,7 +35,7 @@ struct SmCaretPos{ //TODO: Consider forgetting about the todo above... As it's really unpleasant. int Index; /** True, if this is a valid caret position */ - bool IsValid() const { return pSelectedNode != NULL; } + bool IsValid() const { return pSelectedNode != nullptr; } bool operator!=(SmCaretPos pos) const { return pos.pSelectedNode != pSelectedNode || Index != pos.Index; } @@ -100,8 +100,8 @@ private: /** An entry in SmCaretPosGraph */ struct SmCaretPosGraphEntry{ SmCaretPosGraphEntry(SmCaretPos pos = SmCaretPos(), - SmCaretPosGraphEntry* left = NULL, - SmCaretPosGraphEntry* right = NULL){ + SmCaretPosGraphEntry* left = nullptr, + SmCaretPosGraphEntry* right = nullptr){ CaretPos = pos; Left = left; Right = right; @@ -128,7 +128,7 @@ public: SmCaretPosGraphIterator(SmCaretPosGraph* graph){ pGraph = graph; nOffset = 0; - pEntry = NULL; + pEntry = nullptr; } /** Get the next entry, NULL if none */ SmCaretPosGraphEntry* Next(); @@ -156,7 +156,7 @@ private: class SmCaretPosGraph{ public: SmCaretPosGraph(){ - pNext = NULL; + pNext = nullptr; nOffset = 0; } ~SmCaretPosGraph(); @@ -168,8 +168,8 @@ public: * @remarks If left and/or right are set NULL, they will point back to the entry. */ SmCaretPosGraphEntry* Add(SmCaretPos pos, - SmCaretPosGraphEntry* left = NULL, - SmCaretPosGraphEntry* right = NULL){ + SmCaretPosGraphEntry* left = nullptr, + SmCaretPosGraphEntry* right = nullptr){ SAL_WARN_IF( pos.Index < 0, "starmath", "Index shouldn't be -1!" ); return Add(SmCaretPosGraphEntry(pos, left, right)); } diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx index 298882839b11..9de6b5309d57 100644 --- a/starmath/inc/cursor.hxx +++ b/starmath/inc/cursor.hxx @@ -215,7 +215,7 @@ public: /** Draw the caret */ void Draw(OutputDevice& pDev, Point Offset, bool isCaretVisible); - bool IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBraceNode = NULL) const; + bool IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBraceNode = nullptr) const; void MoveAfterBracket(SmBraceNode* pBraceNode, bool bMoveAnchor = true); private: @@ -269,9 +269,9 @@ private: if(rpNode && rpNode->GetParent()){ //Don't remove this, correctness relies on it int index = rpNode->GetParent()->IndexOfSubNode(rpNode); if(index != -1) - rpNode->GetParent()->SetSubNode(index, NULL); + rpNode->GetParent()->SetSubNode(index, nullptr); } - rpNode = NULL; + rpNode = nullptr; //Create line from node if(pNode && IsLineCompositionNode(pNode)) return LineToList(static_cast<SmStructureNode*>(pNode), pList); @@ -308,7 +308,7 @@ private: * Call this method with NULL to reset the clipboard * @remarks: This method takes ownership of pList. */ - void SetClipboard(SmNodeList* pList = NULL); + void SetClipboard(SmNodeList* pList = nullptr); /** Clone list of nodes (creates a deep clone) */ static SmNodeList* CloneList(SmNodeList* pList); @@ -350,7 +350,7 @@ private: * @returns An iterator pointing to the element following the selection taken. */ static SmNodeList::iterator TakeSelectedNodesFromList(SmNodeList *pLineList, - SmNodeList *pSelectedNodes = NULL); + SmNodeList *pSelectedNodes = nullptr); /** Create an instance of SmMathSymbolNode usable for brackets */ static SmNode *CreateBracket(SmBracketType eBracketType, bool bIsLeft); @@ -384,7 +384,7 @@ private: SmStructureNode* pParent, int nParentIndex, SmCaretPos PosAfterEdit, - SmNode* pStartLine = NULL); + SmNode* pStartLine = nullptr); /** Request the formula is repainted */ void RequestRepaint(); }; @@ -411,7 +411,7 @@ class SmNodeListParser{ public: /** Create an instance of SmNodeListParser */ SmNodeListParser(){ - pList = NULL; + pList = nullptr; } /** Parse a list of nodes to an expression * @@ -436,7 +436,7 @@ private: SmNode* Terminal(){ if(pList->size() > 0) return pList->front(); - return NULL; + return nullptr; } /** Move to next terminal */ SmNode* Next(){ diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index a76538efda06..b26b3e9a45c6 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -220,7 +220,7 @@ public: /** True, if cursor have previously been requested and thus * has some sort of position. */ - bool HasCursor() { return pCursor != NULL; } + bool HasCursor() { return pCursor != nullptr; } }; #endif diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index c7f71ba99554..f07687ac05f5 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -250,21 +250,21 @@ public: pNode = node; nSize = pNode->GetNumSubNodes(); nIndex = 0; - pChildNode = NULL; + pChildNode = nullptr; bIsReverse = bReverse; } /** Get the subnode or NULL if none */ SmNode* Next(){ while(!bIsReverse && nIndex < nSize){ - if(NULL != (pChildNode = pNode->GetSubNode(nIndex++))) + if(nullptr != (pChildNode = pNode->GetSubNode(nIndex++))) return pChildNode; } while(bIsReverse && nSize > 0){ - if(NULL != (pChildNode = pNode->GetSubNode((nSize--)-1))) + if(nullptr != (pChildNode = pNode->GetSubNode((nSize--)-1))) return pChildNode; } - pChildNode = NULL; - return NULL; + pChildNode = nullptr; + return nullptr; } /** Get the current child node, NULL if none */ SmNode* Current(){ @@ -314,7 +314,7 @@ public: using SmNode::GetSubNode; virtual SmNode * GetSubNode(sal_uInt16 nIndex) override; - void SetSubNodes(SmNode *pFirst, SmNode *pSecond, SmNode *pThird = NULL); + void SetSubNodes(SmNode *pFirst, SmNode *pSecond, SmNode *pThird = nullptr); void SetSubNodes(const SmNodeArray &rNodeArray); SmStructureNode & operator = ( const SmStructureNode &rNode ); @@ -330,7 +330,7 @@ public: aSubNodes.resize(nIndex + 1); //Set new slots to NULL for (size_t i = size; i < nIndex+1; i++) - aSubNodes[i] = NULL; + aSubNodes[i] = nullptr; } aSubNodes[nIndex] = pNode; ClaimPaternity(); diff --git a/starmath/inc/unomodel.hxx b/starmath/inc/unomodel.hxx index 2227e20639a8..6b6ac0779f69 100644 --- a/starmath/inc/unomodel.hxx +++ b/starmath/inc/unomodel.hxx @@ -62,7 +62,7 @@ protected: virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) throw (css::uno::RuntimeException, css::beans::UnknownPropertyException, css::lang::WrappedTargetException, std::exception) override; public: - SmModel( SfxObjectShell *pObjSh = 0 ); + SmModel( SfxObjectShell *pObjSh = nullptr ); virtual ~SmModel() throw (); //XInterface diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx index 2a7bc4b6121c..9fb287374bde 100644 --- a/starmath/inc/visitors.hxx +++ b/starmath/inc/visitors.hxx @@ -340,7 +340,7 @@ private: class SmCloningVisitor : public SmVisitor { public: - SmCloningVisitor( ){ pResult = NULL; } + SmCloningVisitor( ){ pResult = nullptr; } virtual ~SmCloningVisitor() {} void Visit( SmTableNode* pNode ) override; void Visit( SmBraceNode* pNode ) override; diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index 17735bf9e8c6..d3dd525a43d3 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -221,7 +221,7 @@ SmElementsControl::SmElementsControl(vcl::Window *pParent) : Control(pParent, WB_TABSTOP) , mpDocShell(new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT)) , maCurrentSetId(0) - , mpCurrentElement(NULL) + , mpCurrentElement(nullptr) , mbVerticalMode(true) , mxScroll(VclPtr<ScrollBar>::Create(this, WB_VERT)) { @@ -390,7 +390,7 @@ void SmElementsControl::Paint(vcl::RenderContext& rRenderContext, const Rectangl void SmElementsControl::MouseMove( const MouseEvent& rMouseEvent ) { - mpCurrentElement = NULL; + mpCurrentElement = nullptr; OUString tooltip; if (Rectangle(Point(0, 0), GetOutputSizePixel()).IsInside(rMouseEvent.GetPosPixel())) { diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 034b67e2155e..2e81b188d5e7 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -77,7 +77,7 @@ static awt::Rectangle lcl_GetBounds( vcl::Window *pWin ) awt::Rectangle aBounds; if (pWin) { - Rectangle aRect = pWin->GetWindowExtentsRelative( NULL ); + Rectangle aRect = pWin->GetWindowExtentsRelative( nullptr ); aBounds.X = aRect.Left(); aBounds.Y = aRect.Top(); aBounds.Width = aRect.GetWidth(); @@ -85,7 +85,7 @@ static awt::Rectangle lcl_GetBounds( vcl::Window *pWin ) vcl::Window* pParent = pWin->GetAccessibleParentWindow(); if (pParent) { - Rectangle aParentRect = pParent->GetWindowExtentsRelative( NULL ); + Rectangle aParentRect = pParent->GetWindowExtentsRelative( nullptr ); awt::Point aParentScreenLoc( aParentRect.Left(), aParentRect.Top() ); aBounds.X -= aParentScreenLoc.X; aBounds.Y -= aParentScreenLoc.Y; @@ -101,7 +101,7 @@ static awt::Point lcl_GetLocationOnScreen( vcl::Window *pWin ) awt::Point aPos; if (pWin) { - Rectangle aRect = pWin->GetWindowExtentsRelative( NULL ); + Rectangle aRect = pWin->GetWindowExtentsRelative( nullptr ); aPos.X = aRect.Left(); aPos.Y = aRect.Top(); } @@ -125,8 +125,8 @@ SmGraphicAccessible::~SmGraphicAccessible() SmDocShell * SmGraphicAccessible::GetDoc_Impl() { - SmViewShell *pView = pWin ? pWin->GetView() : 0; - return pView ? pView->GetDoc() : 0; + SmViewShell *pView = pWin ? pWin->GetView() : nullptr; + return pView ? pView->GetDoc() : nullptr; } OUString SmGraphicAccessible::GetAccessibleText_Impl() @@ -140,7 +140,7 @@ OUString SmGraphicAccessible::GetAccessibleText_Impl() void SmGraphicAccessible::ClearWin() { - pWin = 0; // implicitly results in AccessibleStateType::DEFUNC set + pWin = nullptr; // implicitly results in AccessibleStateType::DEFUNC set if ( nClientId ) { @@ -192,7 +192,7 @@ uno::Reference< XAccessible > SAL_CALL SmGraphicAccessible::getAccessibleAtPoint throw (RuntimeException, std::exception) { SolarMutexGuard aGuard; - XAccessible *pRes = 0; + XAccessible *pRes = nullptr; if (containsPoint( aPoint )) pRes = this; return pRes; @@ -318,7 +318,7 @@ sal_Int32 SAL_CALL SmGraphicAccessible::getAccessibleIndexInParent() { SolarMutexGuard aGuard; sal_Int32 nIdx = -1; - vcl::Window *pAccParent = pWin ? pWin->GetAccessibleParentWindow() : 0; + vcl::Window *pAccParent = pWin ? pWin->GetAccessibleParentWindow() : nullptr; if (pAccParent) { sal_uInt16 nCnt = pAccParent->GetAccessibleChildWindowCount(); @@ -487,7 +487,7 @@ awt::Rectangle SAL_CALL SmGraphicAccessible::getCharacterBounds( sal_Int32 nInde { // get accessible text SmViewShell *pView = pWin->GetView(); - SmDocShell *pDoc = pView ? pView->GetDoc() : 0; + SmDocShell *pDoc = pView ? pView->GetDoc() : nullptr; if (!pDoc) throw RuntimeException(); OUString aTxt( GetAccessibleText_Impl() ); @@ -572,7 +572,7 @@ sal_Int32 SAL_CALL SmGraphicAccessible::getIndexAtPoint( const awt::Point& aPoin aPos -= pWin->GetFormulaDrawPos(); // if it was inside the formula then get the appropriate node - const SmNode *pNode = 0; + const SmNode *pNode = nullptr; if (pTree->OrientedDist(aPos) <= 0) pNode = pTree->FindRectClosestTo(aPos); @@ -757,7 +757,7 @@ sal_Bool SAL_CALL SmGraphicAccessible::copyText( vcl::unohelper::TextDataObject* pDataObj = new vcl::unohelper::TextDataObject( sText ); SolarMutexReleaser aReleaser; - xClipboard->setContents( pDataObj, NULL ); + xClipboard->setContents( pDataObj, nullptr ); Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( xClipboard, uno::UNO_QUERY ); if( xFlushableClipboard.is() ) @@ -861,13 +861,13 @@ SmViewForwarder::~SmViewForwarder() bool SmViewForwarder::IsValid() const { - return rEditAcc.GetEditView() != 0; + return rEditAcc.GetEditView() != nullptr; } Rectangle SmViewForwarder::GetVisArea() const { EditView *pEditView = rEditAcc.GetEditView(); - OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : 0; + OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr; if( pOutDev && pEditView) { @@ -893,7 +893,7 @@ Rectangle SmViewForwarder::GetVisArea() const Point SmViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const { EditView *pEditView = rEditAcc.GetEditView(); - OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : 0; + OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr; if( pOutDev ) { @@ -910,7 +910,7 @@ Point SmViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMod Point SmViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const { EditView *pEditView = rEditAcc.GetEditView(); - OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : 0; + OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr; if( pOutDev ) { @@ -1033,7 +1033,7 @@ void SmTextForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SfxItemPool* SmTextForwarder::GetPool() const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); - return pEditEngine ? pEditEngine->GetEmptyItemSet().GetPool() : 0; + return pEditEngine ? pEditEngine->GetEmptyItemSet().GetPool() : nullptr; } void SmTextForwarder::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) @@ -1100,7 +1100,7 @@ static SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ES { std::vector<EECharAttrib> aAttribs; - const SfxPoolItem* pLastItem = NULL; + const SfxPoolItem* pLastItem = nullptr; SfxItemState eState = SfxItemState::DEFAULT; @@ -1126,7 +1126,7 @@ static SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ES bool bGaps = false; // we found items but theire gaps between them sal_Int32 nLastEnd = nPos; - const SfxPoolItem* pParaItem = NULL; + const SfxPoolItem* pParaItem = nullptr; for(std::vector<EECharAttrib>::const_iterator i = aAttribs.begin(); i < aAttribs.end(); ++i) { @@ -1175,7 +1175,7 @@ static SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ES // if we already found an item check if we found the same if( pLastItem ) { - if( (pParaItem == NULL) || (*pLastItem != *pParaItem) ) + if( (pParaItem == nullptr) || (*pLastItem != *pParaItem) ) return SfxItemState::DONTCARE; } else @@ -1281,7 +1281,7 @@ MapMode SmTextForwarder::GetMapMode() const OutputDevice* SmTextForwarder::GetRefDevice() const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); - return pEditEngine ? pEditEngine->GetRefDevice() : 0; + return pEditEngine ? pEditEngine->GetRefDevice() : nullptr; } bool SmTextForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const @@ -1405,7 +1405,7 @@ bool SmTextForwarder::InsertText( const OUString& rStr, const ESelection& rSelec const SfxItemSet* SmTextForwarder::GetEmptyItemSetPtr() { - const SfxItemSet *pItemSet = 0; + const SfxItemSet *pItemSet = nullptr; EditEngine *pEditEngine = rEditAcc.GetEditEngine(); if (pEditEngine) { @@ -1471,7 +1471,7 @@ SmEditViewForwarder::~SmEditViewForwarder() bool SmEditViewForwarder::IsValid() const { - return rEditAcc.GetEditView() != 0; + return rEditAcc.GetEditView() != nullptr; } Rectangle SmEditViewForwarder::GetVisArea() const @@ -1479,7 +1479,7 @@ Rectangle SmEditViewForwarder::GetVisArea() const Rectangle aRect(0,0,0,0); EditView *pEditView = rEditAcc.GetEditView(); - OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : 0; + OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr; if( pOutDev && pEditView) { @@ -1505,7 +1505,7 @@ Rectangle SmEditViewForwarder::GetVisArea() const Point SmEditViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const { EditView *pEditView = rEditAcc.GetEditView(); - OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : 0; + OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr; if( pOutDev ) { @@ -1522,7 +1522,7 @@ Point SmEditViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMa Point SmEditViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const { EditView *pEditView = rEditAcc.GetEditView(); - OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : 0; + OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr; if( pOutDev ) { @@ -1601,7 +1601,7 @@ bool SmEditViewForwarder::Paste() SmEditAccessible::SmEditAccessible( SmEditWindow *pEditWin ) : aAccName (SM_RESSTR(STR_CMDBOXWINDOW)), - pTextHelper (0), + pTextHelper (nullptr), pWin (pEditWin) { OSL_ENSURE( pWin, "SmEditAccessible: window missing" ); @@ -1637,14 +1637,14 @@ void SmEditAccessible::ClearWin() if (pEditEngine) pEditEngine->SetNotifyHdl( Link<EENotify&,void>() ); - pWin = 0; // implicitly results in AccessibleStateType::DEFUNC set + pWin = nullptr; // implicitly results in AccessibleStateType::DEFUNC set //! make TextHelper implicitly release C++ references to some core objects pTextHelper->SetEditSource( ::std::unique_ptr<SvxEditSource>() ); //! make TextHelper release references //! (e.g. the one set by the 'SetEventSource' call) pTextHelper->Dispose(); - delete pTextHelper; pTextHelper = 0; + delete pTextHelper; pTextHelper = nullptr; } // XAccessible @@ -1804,7 +1804,7 @@ sal_Int32 SAL_CALL SmEditAccessible::getAccessibleIndexInParent( ) { SolarMutexGuard aGuard; sal_Int32 nIdx = -1; - vcl::Window *pAccParent = pWin ? pWin->GetAccessibleParentWindow() : 0; + vcl::Window *pAccParent = pWin ? pWin->GetAccessibleParentWindow() : nullptr; if (pAccParent) { sal_uInt16 nCnt = pAccParent->GetAccessibleChildWindowCount(); diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx index 103989cbfadd..c4cd3c32177b 100644 --- a/starmath/source/accessibility.hxx +++ b/starmath/source/accessibility.hxx @@ -331,8 +331,8 @@ public: //! access EditEngine and EditView via the functions in the respective window //! pointers may be 0 (e.g. during reload) - EditEngine * GetEditEngine() { return pWin ? pWin->GetEditEngine() : 0; } - EditView * GetEditView() { return pWin ? pWin->GetEditView() : 0; } + EditEngine * GetEditEngine() { return pWin ? pWin->GetEditEngine() : nullptr; } + EditView * GetEditView() { return pWin ? pWin->GetEditView() : nullptr; } // XAccessible virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; diff --git a/starmath/source/caret.cxx b/starmath/source/caret.cxx index 25b4f843382d..5801fea30e6a 100644 --- a/starmath/source/caret.cxx +++ b/starmath/source/caret.cxx @@ -17,7 +17,7 @@ SmCaretPosGraphEntry* SmCaretPosGraphIterator::Next(){ nOffset = 0; pEntry = Next(); }else - pEntry = NULL; + pEntry = nullptr; }else pEntry = pGraph->Graph + nOffset++; return pEntry; @@ -40,7 +40,7 @@ SmCaretPosGraphEntry* SmCaretPosGraph::Add(SmCaretPosGraphEntry entry){ SmCaretPosGraph::~SmCaretPosGraph(){ delete pNext; - pNext = NULL; + pNext = nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 2272437cd698..858479d6cd1f 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -249,7 +249,7 @@ void SmFontFormatList::RemoveFontFormat( const OUString &rFntFmtId ) const SmFontFormat * SmFontFormatList::GetFontFormat( const OUString &rFntFmtId ) const { - const SmFontFormat *pRes = 0; + const SmFontFormat *pRes = nullptr; for (size_t i = 0; i < aEntries.size(); ++i) { @@ -267,7 +267,7 @@ const SmFontFormat * SmFontFormatList::GetFontFormat( const OUString &rFntFmtId const SmFontFormat * SmFontFormatList::GetFontFormat( size_t nPos ) const { - const SmFontFormat *pRes = 0; + const SmFontFormat *pRes = nullptr; if (nPos < aEntries.size()) pRes = &aEntries[nPos].aFntFmt; return pRes; @@ -586,7 +586,7 @@ void SmMathConfig::LoadFontFormatList() ReadFontFormat( aFntFmt, pNode[i], FONT_FORMAT_LIST ); if (!pFontFormatList->GetFontFormat( pNode[i] )) { - OSL_ENSURE( 0 == pFontFormatList->GetFontFormat( pNode[i] ), + OSL_ENSURE( nullptr == pFontFormatList->GetFontFormat( pNode[i] ), "FontFormat ID already exists" ); pFontFormatList->AddFontFormat( pNode[i], aFntFmt ); } @@ -1144,7 +1144,7 @@ void SmMathConfig::Notify( const css::uno::Sequence< OUString >& ) void SmMathConfig::ItemSetToConfig(const SfxItemSet &rSet) { - const SfxPoolItem *pItem = NULL; + const SfxPoolItem *pItem = nullptr; sal_uInt16 nU16; bool bVal; diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 954563ec88d0..8efa9315ea79 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -14,7 +14,7 @@ #include <comphelper/string.hxx> void SmCursor::Move(OutputDevice* pDev, SmMovementDirection direction, bool bMoveAnchor){ - SmCaretPosGraphEntry* NewPos = NULL; + SmCaretPosGraphEntry* NewPos = nullptr; switch(direction){ case MoveLeft: { @@ -76,7 +76,7 @@ void SmCursor::Move(OutputDevice* pDev, SmMovementDirection direction, bool bMov void SmCursor::MoveTo(OutputDevice* pDev, Point pos, bool bMoveAnchor){ SmCaretLine best_line, //Best line found so far, when iterating curr_line; //Current line, when iterating - SmCaretPosGraphEntry* NewPos = NULL; + SmCaretPosGraphEntry* NewPos = nullptr; long dp_sq = 0, //Distance to current line squared dbp_sq = 1; //Distance to best line squared SmCaretPosGraphIterator it = mpGraph->GetIterator(); @@ -252,7 +252,7 @@ void SmCursor::Delete(){ //Find an arbitrary selected node SmNode* pSNode = FindSelectedNode(mpTree); - OSL_ENSURE(pSNode != NULL, "There must be a selection when HasSelection is true!"); + OSL_ENSURE(pSNode != nullptr, "There must be a selection when HasSelection is true!"); //Find the topmost node of the line that holds the selection SmNode* pLine = FindTopMostNodeInLine(pSNode, true); @@ -335,7 +335,7 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){ PosAfterInsert = PatchLineList(pLineList, it); //Release list, we've taken the nodes delete pNewNodes; - pNewNodes = NULL; + pNewNodes = nullptr; //Finish editing FinishEdit(pLineList, pLineParent, nParentIndex, PosAfterInsert); @@ -374,8 +374,8 @@ SmNodeList::iterator SmCursor::FindPositionInLineList(SmNodeList* pLineList, SmC SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator aIter) { //The nodes we should consider merging - SmNode *prev = NULL, - *next = NULL; + SmNode *prev = nullptr, + *next = nullptr; if(aIter != pLineList->end()) next = *aIter; if(aIter != pLineList->begin()) { @@ -498,7 +498,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) { SmNode *pLine; if(HasSelection()) { SmNode *pSNode = FindSelectedNode(mpTree); - OSL_ENSURE(pSNode != NULL, "There must be a selected node when HasSelection is true!"); + OSL_ENSURE(pSNode != nullptr, "There must be a selected node when HasSelection is true!"); pLine = FindTopMostNodeInLine(pSNode, true); } else pLine = FindTopMostNodeInLine(mpPosition->CaretPos.pSelectedNode); @@ -554,7 +554,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) { pSubSup = static_cast<SmSubSupNode*>(pSubject); //pSubject shouldn't be referenced anymore, pSubSup is the SmSubSupNode in pLineList we wish to edit. //and it pointer to the element following pSubSup in pLineList. - pSubject = NULL; + pSubject = nullptr; //Patch the line if we noted that was needed previously if(bPatchLine) @@ -568,7 +568,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) { unsigned int nOldSize = pScriptLineList->size(); pScriptLineList->insert(pScriptLineList->end(), pSelectedNodesList->begin(), pSelectedNodesList->end()); delete pSelectedNodesList; - pSelectedNodesList = NULL; + pSelectedNodesList = nullptr; //Patch pScriptLineList if needed if(0 < nOldSize && nOldSize < pScriptLineList->size()) { @@ -585,7 +585,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) { //Parse pScriptLineList pScriptLine = SmNodeListParser().Parse(pScriptLineList); delete pScriptLineList; - pScriptLineList = NULL; + pScriptLineList = nullptr; //Insert pScriptLine back into the tree pSubSup->SetSubSup(eSubSup, pScriptLine); @@ -596,7 +596,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) { bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) { //Find a subject to set limits on - SmOperNode *pSubject = NULL; + SmOperNode *pSubject = nullptr; //Check if pSelectedNode might be a subject if(mpPosition->CaretPos.pSelectedNode->GetType() == NOPER) pSubject = static_cast<SmOperNode*>(mpPosition->CaretPos.pSelectedNode); @@ -614,7 +614,7 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) { BeginEdit(); //Find the sub sup node - SmSubSupNode *pSubSup = NULL; + SmSubSupNode *pSubSup = nullptr; //Check if there's already one there... if(pSubject->GetSubNode(0)->GetType() == NSUBSUP) pSubSup = static_cast<SmSubSupNode*>(pSubject->GetSubNode(0)); @@ -630,7 +630,7 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) { //Create the limit, if needed SmCaretPos PosAfterLimit; - SmNode *pLine = NULL; + SmNode *pLine = nullptr; if(!pSubSup->GetSubSup(eSubSup)){ pLine = new SmPlaceNode(); pSubSup->SetSubSup(eSubSup, pLine); @@ -669,7 +669,7 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) { SmNode *pLine; if(HasSelection()) { SmNode *pSNode = FindSelectedNode(mpTree); - OSL_ENSURE(pSNode != NULL, "There must be a selected node if HasSelection()"); + OSL_ENSURE(pSNode != nullptr, "There must be a selected node if HasSelection()"); pLine = FindTopMostNodeInLine(pSNode, true); } else pLine = FindTopMostNodeInLine(mpPosition->CaretPos.pSelectedNode); @@ -710,7 +710,7 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) { SmNode *pLeft = CreateBracket(eBracketType, true), *pRight = CreateBracket(eBracketType, false); SmBracebodyNode *pBody = new SmBracebodyNode(SmToken()); - pBody->SetSubNodes(pBodyNode, NULL); + pBody->SetSubNodes(pBodyNode, nullptr); pBrace->SetSubNodes(pLeft, pBody, pRight); pBrace->Prepare(mpDocShell->GetFormat(), *mpDocShell); @@ -806,7 +806,7 @@ bool SmCursor::InsertRow() { SmNode *pLine; if(HasSelection()) { SmNode *pSNode = FindSelectedNode(mpTree); - OSL_ENSURE(pSNode != NULL, "There must be a selected node if HasSelection()"); + OSL_ENSURE(pSNode != nullptr, "There must be a selected node if HasSelection()"); pLine = FindTopMostNodeInLine(pSNode, true); } else pLine = FindTopMostNodeInLine(mpPosition->CaretPos.pSelectedNode); @@ -822,8 +822,8 @@ bool SmCursor::InsertRow() { } //Discover the context of this command - SmTableNode *pTable = NULL; - SmMatrixNode *pMatrix = NULL; + SmTableNode *pTable = nullptr; + SmMatrixNode *pMatrix = nullptr; int nTableIndex = nParentIndex; if(pLineParent->GetType() == NTABLE) pTable = static_cast<SmTableNode*>(pLineParent); @@ -877,7 +877,7 @@ bool SmCursor::InsertRow() { //Wrap pNewLine in SmLineNode if needed if(pLineParent->GetType() == NLINE) { SmLineNode *pNewLineNode = new SmLineNode(SmToken(TNEWLINE, '\0', "newline")); - pNewLineNode->SetSubNodes(pNewLine, NULL); + pNewLineNode->SetSubNodes(pNewLine, nullptr); pNewLine = pNewLineNode; } //Get position @@ -930,7 +930,7 @@ void SmCursor::InsertFraction() { SmNode *pLine; if(HasSelection()) { SmNode *pSNode = FindSelectedNode(mpTree); - OSL_ENSURE(pSNode != NULL, "There must be a selected node when HasSelection is true!"); + OSL_ENSURE(pSNode != nullptr, "There must be a selected node when HasSelection is true!"); pLine = FindTopMostNodeInLine(pSNode, true); } else pLine = FindTopMostNodeInLine(mpPosition->CaretPos.pSelectedNode); @@ -965,7 +965,7 @@ void SmCursor::InsertFraction() { : SmNodeListParser().Parse(pSelectedNodesList); SmNode *pDenom = new SmPlaceNode(); delete pSelectedNodesList; - pSelectedNodesList = NULL; + pSelectedNodesList = nullptr; //Create new fraction SmBinVerNode *pFrac = new SmBinVerNode(SmToken(TOVER, '\0', "over", TGPRODUCT, 0)); @@ -1014,7 +1014,7 @@ void SmCursor::InsertElement(SmFormulaElement element){ Delete(); //Create new node - SmNode* pNewNode = NULL; + SmNode* pNewNode = nullptr; switch(element){ case BlankElement: { @@ -1096,7 +1096,7 @@ void SmCursor::InsertElement(SmFormulaElement element){ default: SAL_WARN("starmath", "Element unknown!"); } - OSL_ENSURE(pNewNode != NULL, "No new node was created!"); + OSL_ENSURE(pNewNode != nullptr, "No new node was created!"); if(!pNewNode) return; @@ -1254,7 +1254,7 @@ void SmCursor::SetClipboard(SmNodeList* pList){ SmNode* SmCursor::FindTopMostNodeInLine(SmNode* pSNode, bool MoveUpIfSelected){ //If we haven't got a subnode if(!pSNode) - return NULL; + return nullptr; //Move up parent until we find a node who's //parent is NULL or isn't selected and not a type of: @@ -1282,7 +1282,7 @@ SmNode* SmCursor::FindSelectedNode(SmNode* pNode){ if(pRetVal) return pRetVal; } - return NULL; + return nullptr; } SmNodeList* SmCursor::LineToList(SmStructureNode* pLine, SmNodeList* list){ @@ -1390,7 +1390,7 @@ void SmCursor::FinishEdit(SmNodeList* pLineList, SmNode *pLeft = CreateBracket(RoundBrackets, true), *pRight = CreateBracket(RoundBrackets, false); SmBracebodyNode *pBody = new SmBracebodyNode(SmToken()); - pBody->SetSubNodes(pLine, NULL); + pBody->SetSubNodes(pLine, nullptr); pBrace->SetSubNodes(pLeft, pBody, pRight); pBrace->Prepare(mpDocShell->GetFormat(), *mpDocShell); pLine = pBrace; @@ -1456,7 +1456,7 @@ void SmCursor::EndEdit(){ //TODO: Consider copying the update accessibility code from SmDocShell::SetText in here... //This somehow updates the size of SmGraphicView if it is running in embedded mode if( mpDocShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) - mpDocShell->OnDocumentPrinterChanged(0); + mpDocShell->OnDocumentPrinterChanged(nullptr); //Request a repaint... RequestRepaint(); @@ -1586,7 +1586,7 @@ SmNode* SmNodeListParser::Parse(SmNodeList* list, bool bDeleteErrorNodes){ } } SmNode* retval = Expression(); - pList = NULL; + pList = nullptr; return retval; } @@ -1678,7 +1678,7 @@ SmNode* SmNodeListParser::Factor(){ SmNode* SmNodeListParser::Postfix(){ if(!Terminal()) return Error(); - SmNode *pArg = NULL; + SmNode *pArg = nullptr; if(IsPostfixOperator(Terminal()->GetToken())) pArg = Error(); else if(IsOperator(Terminal()->GetToken())) diff --git a/starmath/source/detreg.cxx b/starmath/source/detreg.cxx index 1ce1296e309f..54fca7ec2371 100644 --- a/starmath/source/detreg.cxx +++ b/starmath/source/detreg.cxx @@ -35,11 +35,11 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL smd_component_getFactory( const sal_Char* pI void* /*pRegistryKey*/ ) { // Set default return value for this operation - if it failed. - void* pReturn = NULL ; + void* pReturn = nullptr ; if ( - ( pImplementationName != NULL ) && - ( pServiceManager != NULL ) + ( pImplementationName != nullptr ) && + ( pServiceManager != nullptr ) ) { // Define variables which are used in following macros. diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 50d65ad29904..cd53905ee03a 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -505,7 +505,7 @@ IMPL_LINK_TYPED( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu, bool ) case 5: pActiveListBox = m_pSerifFont; bHideCheckboxes = true; break; case 6: pActiveListBox = m_pSansFont; bHideCheckboxes = true; break; case 7: pActiveListBox = m_pFixedFont; bHideCheckboxes = true; break; - default:pActiveListBox = NULL; + default:pActiveListBox = nullptr; } if (pActiveListBox) @@ -667,8 +667,8 @@ SmCategoryDesc::SmCategoryDesc(VclBuilderContainer& rBuilder, sal_uInt16 nCatego } else { - Strings [i] = 0; - Graphics [i] = 0; + Strings [i] = nullptr; + Graphics [i] = nullptr; } const FieldMinMax& rMinMax = pMinMaxData[ nCategoryIdx-1 ][i]; @@ -772,15 +772,15 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) #endif static const char * aCatMf2Hid[10][4] = { - { HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST, HID_SMA_ROOT_DIST, 0 }, - { HID_SMA_SUP_DIST, HID_SMA_SUB_DIST , 0, 0 }, - { HID_SMA_NUMERATOR_DIST, HID_SMA_DENOMINATOR_DIST, 0, 0 }, - { HID_SMA_FRACLINE_EXCWIDTH, HID_SMA_FRACLINE_LINEWIDTH, 0, 0 }, - { HID_SMA_UPPERLIMIT_DIST, HID_SMA_LOWERLIMIT_DIST, 0, 0 }, - { HID_SMA_BRACKET_EXCHEIGHT, HID_SMA_BRACKET_DIST, 0, HID_SMA_BRACKET_EXCHEIGHT2 }, - { HID_SMA_MATRIXROW_DIST, HID_SMA_MATRIXCOL_DIST, 0, 0 }, - { HID_SMA_ATTRIBUT_DIST, HID_SMA_INTERATTRIBUT_DIST, 0, 0 }, - { HID_SMA_OPERATOR_EXCHEIGHT, HID_SMA_OPERATOR_DIST, 0, 0 }, + { HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST, HID_SMA_ROOT_DIST, nullptr }, + { HID_SMA_SUP_DIST, HID_SMA_SUB_DIST , nullptr, nullptr }, + { HID_SMA_NUMERATOR_DIST, HID_SMA_DENOMINATOR_DIST, nullptr, nullptr }, + { HID_SMA_FRACLINE_EXCWIDTH, HID_SMA_FRACLINE_LINEWIDTH, nullptr, nullptr }, + { HID_SMA_UPPERLIMIT_DIST, HID_SMA_LOWERLIMIT_DIST, nullptr, nullptr }, + { HID_SMA_BRACKET_EXCHEIGHT, HID_SMA_BRACKET_DIST, nullptr, HID_SMA_BRACKET_EXCHEIGHT2 }, + { HID_SMA_MATRIXROW_DIST, HID_SMA_MATRIXCOL_DIST, nullptr, nullptr }, + { HID_SMA_ATTRIBUT_DIST, HID_SMA_INTERATTRIBUT_DIST, nullptr, nullptr }, + { HID_SMA_OPERATOR_EXCHEIGHT, HID_SMA_OPERATOR_DIST, nullptr, nullptr }, { HID_SMA_LEFTBORDER_DIST, HID_SMA_RIGHTBORDER_DIST, HID_SMA_UPPERBORDER_DIST, HID_SMA_LOWERBORDER_DIST } }; @@ -820,7 +820,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) // To determine which Controls should be active, the existence // of an associated HelpID is checked - bActive = aCatMf2Hid[nCategory][i] != 0; + bActive = aCatMf2Hid[nCategory][i] != nullptr; pFT->Show(bActive); pFT->Enable(bActive); @@ -1095,7 +1095,7 @@ void SmAlignDialog::WriteTo(SmFormat &rFormat) const SmShowSymbolSetWindow::SmShowSymbolSetWindow(vcl::Window *pParent, WinBits nStyle) : Control(pParent, nStyle) - , m_pVScrollBar(0) + , m_pVScrollBar(nullptr) , nLen(0) , nRows(0) , nColumns(0) @@ -1625,7 +1625,7 @@ bool SmSymbolDialog::SelectSymbolSet(const OUString &rSymbolSetName) void SmSymbolDialog::SelectSymbol(sal_uInt16 nSymbolNo) { - const SmSym *pSym = NULL; + const SmSym *pSym = nullptr; if (!aSymbolSetName.isEmpty() && nSymbolNo < static_cast< sal_uInt16 >(aSymbolSet.size())) pSym = aSymbolSet[ nSymbolNo ]; @@ -1638,7 +1638,7 @@ const SmSym* SmSymbolDialog::GetSymbol() const { sal_uInt16 nSymbolNo = m_pSymbolSetDisplay->GetSelectSymbol(); bool bValid = !aSymbolSetName.isEmpty() && nSymbolNo < static_cast< sal_uInt16 >(aSymbolSet.size()); - return bValid ? aSymbolSet[ nSymbolNo ] : NULL; + return bValid ? aSymbolSet[ nSymbolNo ] : nullptr; } VCL_BUILDER_DECL_FACTORY(SmShowChar) @@ -1954,7 +1954,7 @@ IMPL_LINK_TYPED( SmSymDefineDialog, ChangeClickHdl, Button *, pButton, void ) // clear display for original symbol if necessary if (bNameChanged) - SetOrigSymbol(NULL, OUString()); + SetOrigSymbol(nullptr, OUString()); // update display of new symbol pSymbolDisplay->SetSymbol( &aNewSymbol ); @@ -1984,7 +1984,7 @@ IMPL_LINK_TYPED( SmSymDefineDialog, DeleteClickHdl, Button *, pButton, void ) aSymbolMgrCopy.RemoveSymbol( pOrigSymbol->GetName() ); // clear display for original symbol - SetOrigSymbol(NULL, OUString()); + SetOrigSymbol(nullptr, OUString()); // update list box entries FillSymbolSets(*pOldSymbolSets, false); @@ -2019,7 +2019,7 @@ void SmSymDefineDialog::UpdateButtons() && pCharsetDisplay->GetSelectCharacter() == pOrigSymbol->GetCharacter(); // only add it if there isn't already a symbol with the same name - bAdd = aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL; + bAdd = aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == nullptr; // only delete it if all settings are equal bDelete = bool(pOrigSymbol); @@ -2039,7 +2039,7 @@ SmSymDefineDialog::SmSymDefineDialog(vcl::Window * pParent, rSymbolMgr (rMgr), pOrigSymbol (), pSubsetMap (), - pFontList (NULL) + pFontList (nullptr) { get(pOldSymbols, "oldSymbols"); get(pOldSymbolSets, "oldSymbolSets"); @@ -2302,7 +2302,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, if (bIsOld) { // if there's a change of the old symbol, show only the available ones, otherwise show none - const SmSym *pOldSymbol = NULL; + const SmSym *pOldSymbol = nullptr; OUString aTmpOldSymbolSetName; if (nPos != COMBOBOX_ENTRY_NOTFOUND) { @@ -2339,7 +2339,7 @@ void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyl pFontsSubsetLB->Clear(); bool bFirst = true; const Subset* pSubset; - while( NULL != (pSubset = pSubsetMap->GetNextSubset( bFirst )) ) + while( nullptr != (pSubset = pSubsetMap->GetNextSubset( bFirst )) ) { const sal_Int32 nPos = pFontsSubsetLB->InsertEntry( pSubset->GetName()); pFontsSubsetLB->SetEntryData( nPos, const_cast<Subset *>(pSubset) ); @@ -2352,7 +2352,7 @@ void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyl pFontsSubsetLB->SetNoSelection(); pFontsSubsetLB->Enable( !bFirst ); - pFontCharMap = 0; + pFontCharMap = nullptr; } diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index fcc69d480f07..5ed4579a00b1 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -183,7 +183,7 @@ void SmDocShell::SetText(const OUString& rBuffer) SetModified(true); // launch accessible event if necessary - SmGraphicAccessible *pAcc = pViewSh ? pViewSh->GetGraphicWindow().GetAccessible_Impl() : 0; + SmGraphicAccessible *pAcc = pViewSh ? pViewSh->GetGraphicWindow().GetAccessible_Impl() : nullptr; if (pAcc) { Any aOldValue, aNewValue; @@ -195,7 +195,7 @@ void SmDocShell::SetText(const OUString& rBuffer) } if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) - OnDocumentPrinterChanged(0); + OnDocumentPrinterChanged(nullptr); } } @@ -491,7 +491,7 @@ Size SmDocShell::GetSize() void SmDocShell::InvalidateCursor(){ delete pCursor; - pCursor = NULL; + pCursor = nullptr; } SmCursor& SmDocShell::GetCursor(){ @@ -625,7 +625,7 @@ void SmDocShell::OnDocumentPrinterChanged( Printer *pPrt ) Repaint(); if( aOldSize != GetVisArea().GetSize() && !aText.isEmpty() ) SetModified( true ); - pTmpPrinter = 0; + pTmpPrinter = nullptr; } void SmDocShell::Repaint() @@ -648,15 +648,15 @@ void SmDocShell::Repaint() SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) : SfxObjectShell(i_nSfxCreationFlags) - , pTree(0) - , pEditEngineItemPool(0) - , pEditEngine(0) - , pPrinter(0) - , pTmpPrinter(0) + , pTree(nullptr) + , pEditEngineItemPool(nullptr) + , pEditEngine(nullptr) + , pPrinter(nullptr) + , pTmpPrinter(nullptr) , nModifyCount(0) , bIsFormulaArranged(false) { - pCursor = NULL; + pCursor = nullptr; SetPool(&SfxGetpApp()->GetPool()); @@ -678,7 +678,7 @@ SmDocShell::~SmDocShell() delete pCursor; - pCursor = NULL; + pCursor = nullptr; delete pEditEngine; SfxItemPool::Free(pEditEngineItemPool); @@ -698,7 +698,7 @@ bool SmDocShell::ConvertFrom(SfxMedium &rMedium) if (pTree) { delete pTree; - pTree = 0; + pTree = nullptr; InvalidateCursor(); } Reference<css::frame::XModel> xModel(GetModel()); @@ -1188,7 +1188,7 @@ void SmDocShell::GetState(SfxItemSet &rSet) { SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this ); if( pFrm ) - pFrm->GetSlotState( nWh, NULL, &rSet ); + pFrm->GetSlotState( nWh, nullptr, &rSet ); else rSet.DisableItem( nWh ); } diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 70e976bdd9aa..26ab3433b54c 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -177,7 +177,7 @@ SmViewShell * SmEditWindow::GetView() SmDocShell * SmEditWindow::GetDoc() { SmViewShell *pView = rCmdBox.GetView(); - return pView ? pView->GetDoc() : 0; + return pView ? pView->GetDoc() : nullptr; } EditView * SmEditWindow::GetEditView() @@ -187,7 +187,7 @@ EditView * SmEditWindow::GetEditView() EditEngine * SmEditWindow::GetEditEngine() { - EditEngine *pEditEng = 0; + EditEngine *pEditEng = nullptr; if (pEditView) pEditEng = pEditView->GetEditEngine(); else @@ -203,7 +203,7 @@ EditEngine * SmEditWindow::GetEditEngine() SfxItemPool * SmEditWindow::GetEditEngineItemPool() { SmDocShell *pDoc = GetDoc(); - return pDoc ? &pDoc->GetEditEngineItemPool() : 0; + return pDoc ? &pDoc->GetEditEngineItemPool() : nullptr; } void SmEditWindow::ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg ) @@ -347,7 +347,7 @@ void SmEditWindow::Command(const CommandEvent& rCEvt) std::unique_ptr<PopupMenu> xPopupMenu(new PopupMenu(SmResId(RID_COMMANDMENU))); // added for replaceability of context menus - Menu* pMenu = NULL; + Menu* pMenu = nullptr; css::ui::ContextMenuExecuteEvent aEvent; aEvent.SourceWindow = VCLUnoHelper::GetInterface( this ); aEvent.ExecutePosition.X = aPoint.X(); diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 1749b99be7fd..2492d26d916a 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -106,7 +106,7 @@ bool SmXMLExportWrapper::Export(SfxMedium &rMedium) (xTunnel->getSomething(SmModel::getUnoTunnelId())); SmDocShell *pDocShell = pModel ? - static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0; + static_cast<SmDocShell*>(pModel->GetObjectShell()) : nullptr; if ( pDocShell && SfxObjectCreateMode::EMBEDDED == pDocShell->GetCreateMode() ) bEmbedded = true; @@ -260,7 +260,7 @@ bool SmXMLExportWrapper::WriteThroughComponent( { OSL_ENSURE(xOutputStream.is(), "I really need an output stream!"); OSL_ENSURE(xComponent.is(), "Need component!"); - OSL_ENSURE(NULL != pComponentName, "Need component name!"); + OSL_ENSURE(nullptr != pComponentName, "Need component name!"); // get component Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create(rxContext ); @@ -312,7 +312,7 @@ bool SmXMLExportWrapper::WriteThroughComponent( ) { OSL_ENSURE(xStorage.is(), "Need storage!"); - OSL_ENSURE(NULL != pStreamName, "Need stream name!"); + OSL_ENSURE(nullptr != pStreamName, "Need stream name!"); // open stream Reference < io::XStream > xStream; @@ -361,7 +361,7 @@ SmXMLExport::SmXMLExport( OUString const & implementationName, SvXMLExportFlags nExportFlags) : SvXMLExport(util::MeasureUnit::INCH, rContext, implementationName, XML_MATH, nExportFlags) - , pTree(0) + , pTree(nullptr) , bSuccess(false) { } @@ -475,7 +475,7 @@ void SmXMLExport::_ExportContent() SmModel *pModel = reinterpret_cast<SmModel *> (xTunnel->getSomething(SmModel::getUnoTunnelId())); SmDocShell *pDocShell = pModel ? - static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0; + static_cast<SmDocShell*>(pModel->GetObjectShell()) : nullptr; OSL_ENSURE( pDocShell, "doc shell missing" ); if (pDocShell && !pDocShell->GetFormat().IsTextmode()) @@ -486,7 +486,7 @@ void SmXMLExport::_ExportContent() AddAttribute(XML_NAMESPACE_MATH, XML_DISPLAY, XML_BLOCK); } SvXMLElementExport aEquation(*this, XML_NAMESPACE_MATH, XML_MATH, true, true); - SvXMLElementExport *pSemantics=0; + SvXMLElementExport *pSemantics=nullptr; if (!aText.isEmpty()) { @@ -652,7 +652,7 @@ void SmXMLExport::ExportUnaryHorizontal(const SmNode *pNode, int nLevel) void SmXMLExport::ExportExpression(const SmNode *pNode, int nLevel, bool bNoMrowContainer /*=false*/) { - SvXMLElementExport *pRow=0; + SvXMLElementExport *pRow=nullptr; auto nSize = pNode->GetNumSubNodes(); // #i115443: nodes of type expression always need to be grouped with mrow statement @@ -729,7 +729,7 @@ void SmXMLExport::ExportBinaryDiagonal(const SmNode *pNode, int nLevel) void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel) { - SvXMLElementExport *pTable=0; + SvXMLElementExport *pTable=nullptr; sal_uInt16 nSize = pNode->GetNumSubNodes(); @@ -741,7 +741,7 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel) { const SmNode *pLine = pNode->GetSubNode(nSize-1); if (pLine->GetType() == NLINE && pLine->GetNumSubNodes() == 1 && - pLine->GetSubNode(0) != NULL && + pLine->GetSubNode(0) != nullptr && pLine->GetSubNode(0)->GetToken().eType == TNEWLINE) --nSize; } @@ -754,8 +754,8 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel) for (sal_uInt16 i = 0; i < nSize; i++) if (const SmNode *pTemp = pNode->GetSubNode(i)) { - SvXMLElementExport *pRow=0; - SvXMLElementExport *pCell=0; + SvXMLElementExport *pRow=nullptr; + SvXMLElementExport *pCell=nullptr; if (pTable) { pRow = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MTR, true, true); @@ -798,7 +798,7 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel) void SmXMLExport::ExportMath(const SmNode *pNode, int /*nLevel*/) { const SmMathSymbolNode *pTemp = static_cast<const SmMathSymbolNode *>(pNode); - SvXMLElementExport *pMath = 0; + SvXMLElementExport *pMath = nullptr; if (pNode->GetType() == NMATH || pNode->GetType() == NGLYPH_SPECIAL) { @@ -889,12 +889,12 @@ void SmXMLExport::ExportBlank(const SmNode *pNode, int /*nLevel*/) void SmXMLExport::ExportSubSupScript(const SmNode *pNode, int nLevel) { - const SmNode *pSub = 0; - const SmNode *pSup = 0; - const SmNode *pCSub = 0; - const SmNode *pCSup = 0; - const SmNode *pLSub = 0; - const SmNode *pLSup = 0; + const SmNode *pSub = nullptr; + const SmNode *pSup = nullptr; + const SmNode *pCSub = nullptr; + const SmNode *pCSup = nullptr; + const SmNode *pLSub = nullptr; + const SmNode *pLSup = nullptr; SvXMLElementExport *pThing2 = nullptr; //if we have prescripts at all then we must use the tensor notation @@ -910,18 +910,18 @@ void SmXMLExport::ExportSubSupScript(const SmNode *pNode, int nLevel) XML_MMULTISCRIPTS, true, true); - if (NULL != (pCSub = pNode->GetSubNode(CSUB+1)) - && NULL != (pCSup = pNode->GetSubNode(CSUP+1))) + if (nullptr != (pCSub = pNode->GetSubNode(CSUB+1)) + && nullptr != (pCSup = pNode->GetSubNode(CSUP+1))) { pThing2 = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MUNDEROVER, true, true); } - else if (NULL != (pCSub = pNode->GetSubNode(CSUB+1))) + else if (nullptr != (pCSub = pNode->GetSubNode(CSUB+1))) { pThing2 = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MUNDER, true, true); } - else if (NULL != (pCSup = pNode->GetSubNode(CSUP+1))) + else if (nullptr != (pCSup = pNode->GetSubNode(CSUP+1))) { pThing2 = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MOVER, true, true); @@ -979,35 +979,35 @@ void SmXMLExport::ExportSubSupScript(const SmNode *pNode, int nLevel) else { SvXMLElementExport *pThing = nullptr; - if (NULL != (pSub = pNode->GetSubNode(RSUB+1)) && - NULL != (pSup = pNode->GetSubNode(RSUP+1))) + if (nullptr != (pSub = pNode->GetSubNode(RSUB+1)) && + nullptr != (pSup = pNode->GetSubNode(RSUP+1))) { pThing = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MSUBSUP, true, true); } - else if (NULL != (pSub = pNode->GetSubNode(RSUB+1))) + else if (nullptr != (pSub = pNode->GetSubNode(RSUB+1))) { pThing = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MSUB, true, true); } - else if (NULL != (pSup = pNode->GetSubNode(RSUP+1))) + else if (nullptr != (pSup = pNode->GetSubNode(RSUP+1))) { pThing = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MSUP, true, true); } - if (NULL != (pCSub = pNode->GetSubNode(CSUB+1)) - && NULL != (pCSup=pNode->GetSubNode(CSUP+1))) + if (nullptr != (pCSub = pNode->GetSubNode(CSUB+1)) + && nullptr != (pCSup=pNode->GetSubNode(CSUP+1))) { pThing2 = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MUNDEROVER, true, true); } - else if (NULL != (pCSub = pNode->GetSubNode(CSUB+1))) + else if (nullptr != (pCSub = pNode->GetSubNode(CSUB+1))) { pThing2 = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MUNDER, true, true); } - else if (NULL != (pCSup = pNode->GetSubNode(CSUP+1))) + else if (nullptr != (pCSup = pNode->GetSubNode(CSUP+1))) { pThing2 = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MOVER, true, true); @@ -1033,7 +1033,7 @@ void SmXMLExport::ExportBrace(const SmNode *pNode, int nLevel) const SmNode *pTemp; const SmNode *pLeft=pNode->GetSubNode(0); const SmNode *pRight=pNode->GetSubNode(2); - SvXMLElementExport *pRow=0; + SvXMLElementExport *pRow=nullptr; // This used to generate <mfenced> or <mrow>+<mo> elements according to // the stretchiness of fences. The MathML recommendation defines an @@ -1058,7 +1058,7 @@ void SmXMLExport::ExportBrace(const SmNode *pNode, int nLevel) ExportNodes(pLeft, nLevel+1); } - if (NULL != (pTemp = pNode->GetSubNode(1))) + if (nullptr != (pTemp = pNode->GetSubNode(1))) { // <mrow> SvXMLElementExport aRow(*this, XML_NAMESPACE_MATH, XML_MROW, @@ -1111,7 +1111,7 @@ void SmXMLExport::ExportOperator(const SmNode *pNode, int nLevel) void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel) { - SvXMLElementExport *pElement=0; + SvXMLElementExport *pElement=nullptr; if (pNode->GetToken().eType == TUNDERLINE) { diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 98cb9ad5f5da..7a6038387cd3 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -101,7 +101,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium) (xTunnel->getSomething(SmModel::getUnoTunnelId())); SmDocShell *pDocShell = pModel ? - static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0; + static_cast<SmDocShell*>(pModel->GetObjectShell()) : nullptr; if (pDocShell) { OSL_ENSURE( pDocShell->GetMedium() == &rMedium, @@ -195,7 +195,7 @@ sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium) xStatusIndicator->setValue(nSteps++); nWarn = ReadThroughComponent( - rMedium.GetStorage(), xModelComp, "settings.xml", 0, + rMedium.GetStorage(), xModelComp, "settings.xml", nullptr, xContext, xInfoSet, (bOASIS ? "com.sun.star.comp.Math.XMLOasisSettingsImporter" : "com.sun.star.comp.Math.XMLSettingsImporter" ) ); @@ -246,7 +246,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent( OSL_ENSURE(xInputStream.is(), "input stream missing"); OSL_ENSURE(xModelComponent.is(), "document missing"); OSL_ENSURE(rxContext.is(), "factory missing"); - OSL_ENSURE(NULL != pFilterName,"I need a service name for the component!"); + OSL_ENSURE(nullptr != pFilterName,"I need a service name for the component!"); // prepare ParserInputSrouce xml::sax::InputSource aParserInput; @@ -340,7 +340,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent( const sal_Char* pFilterName ) { OSL_ENSURE(xStorage.is(), "Need storage!"); - OSL_ENSURE(NULL != pStreamName, "Please, please, give me a name!"); + OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!"); // open stream (and set parser input) OUString sStreamName = OUString::createFromAscii(pStreamName); @@ -486,7 +486,7 @@ void SmXMLImport::endDocument() { //Set the resulted tree into the SmDocShell where it belongs SmNode *pTree; - if (NULL != (pTree = GetTree())) + if (nullptr != (pTree = GetTree())) { uno::Reference <frame::XModel> xModel = GetModel(); uno::Reference <lang::XUnoTunnel> xTunnel(xModel,uno::UNO_QUERY); @@ -565,7 +565,7 @@ SvXMLImportContext * SmXMLImportContext::CreateChildContext(sal_uInt16 /*nPrefix const OUString& /*rLocalName*/, const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/) { - return 0; + return nullptr; } @@ -672,7 +672,7 @@ void SmXMLContext_Helper::ApplyAttrs() else aToken.eType = TNBOLD; std::unique_ptr<SmFontNode> pFontNode(new SmFontNode(aToken)); - pFontNode->SetSubNodes(0,popOrZero(rNodeStack)); + pFontNode->SetSubNodes(nullptr,popOrZero(rNodeStack)); rNodeStack.push_front(std::move(pFontNode)); } if (nIsItalic != -1) @@ -682,7 +682,7 @@ void SmXMLContext_Helper::ApplyAttrs() else aToken.eType = TNITALIC; std::unique_ptr<SmFontNode> pFontNode(new SmFontNode(aToken)); - pFontNode->SetSubNodes(0,popOrZero(rNodeStack)); + pFontNode->SetSubNodes(nullptr,popOrZero(rNodeStack)); rNodeStack.push_front(std::move(pFontNode)); } if (nFontSize != 0.0) @@ -703,7 +703,7 @@ void SmXMLContext_Helper::ApplyAttrs() else pFontNode->SetSizeParameter(Fraction(nFontSize),FontSizeType::ABSOLUT); - pFontNode->SetSubNodes(0,popOrZero(rNodeStack)); + pFontNode->SetSubNodes(nullptr,popOrZero(rNodeStack)); rNodeStack.push_front(std::move(pFontNode)); } if (!sFontFamily.isEmpty()) @@ -720,7 +720,7 @@ void SmXMLContext_Helper::ApplyAttrs() aToken.aText = sFontFamily; std::unique_ptr<SmFontNode> pFontNode(new SmFontNode(aToken)); - pFontNode->SetSubNodes(0,popOrZero(rNodeStack)); + pFontNode->SetSubNodes(nullptr,popOrZero(rNodeStack)); rNodeStack.push_front(std::move(pFontNode)); } if (!sColor.isEmpty()) @@ -734,7 +734,7 @@ void SmXMLContext_Helper::ApplyAttrs() { aToken.eType = static_cast<SmTokenType>(tok); std::unique_ptr<SmFontNode> pFontNode(new SmFontNode(aToken)); - pFontNode->SetSubNodes(0,popOrZero(rNodeStack)); + pFontNode->SetSubNodes(nullptr,popOrZero(rNodeStack)); rNodeStack.push_front(std::move(pFontNode)); } } @@ -932,7 +932,7 @@ void SmXMLPhantomContext_Impl::EndElement() std::unique_ptr<SmFontNode> pPhantom(new SmFontNode(aToken)); SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); - pPhantom->SetSubNodes(0,popOrZero(rNodeStack)); + pPhantom->SetSubNodes(nullptr,popOrZero(rNodeStack)); rNodeStack.push_front(std::move(pPhantom)); } @@ -1409,7 +1409,7 @@ void SmXMLSubContext_Impl::GenericEndElement(SmTokenType eType, SmSubSup eSubSup SmNodeArray aSubNodes; aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES); for (size_t i = 1; i < aSubNodes.size(); i++) - aSubNodes[i] = NULL; + aSubNodes[i] = nullptr; aSubNodes[eSubSup+1] = popOrZero(rNodeStack); aSubNodes[0] = popOrZero(rNodeStack); @@ -1469,7 +1469,7 @@ void SmXMLSubSupContext_Impl::GenericEndElement(SmTokenType eType, SmNodeArray aSubNodes; aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES); for (size_t i = 1; i < aSubNodes.size(); i++) - aSubNodes[i] = NULL; + aSubNodes[i] = nullptr; aSubNodes[aSup+1] = popOrZero(rNodeStack); aSubNodes[aSub+1] = popOrZero(rNodeStack); @@ -1767,7 +1767,7 @@ SvXMLImportContext *SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPref const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList) { - SvXMLImportContext *pContext = 0; + SvXMLImportContext *pContext = nullptr; if ( XML_NAMESPACE_OFFICE == nPrefix && rLocalName == GetXMLToken(XML_META) ) { @@ -2026,7 +2026,7 @@ SvXMLImportContext *SmXMLDocContext_Impl::CreateChildContext( const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { - SvXMLImportContext* pContext = 0L; + SvXMLImportContext* pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresLayoutElemTokenMap(); @@ -2211,7 +2211,7 @@ void SmXMLSqrtContext_Impl::EndElement() std::unique_ptr<SmStructureNode> pSNode(new SmRootNode(aToken)); SmNode *pOper = new SmRootSymbolNode(aToken); SmNodeStack &rNodeStack = GetSmImport().GetNodeStack(); - pSNode->SetSubNodes(0,pOper,popOrZero(rNodeStack)); + pSNode->SetSubNodes(nullptr,pOper,popOrZero(rNodeStack)); rNodeStack.push_front(std::move(pSNode)); } @@ -2315,7 +2315,7 @@ SvXMLImportContext *SmXMLRowContext_Impl::StrictCreateChildContext( const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { - SvXMLImportContext* pContext = 0L; + SvXMLImportContext* pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresElemTokenMap(); switch(rTokenMap.Get(nPrefix, rLocalName)) @@ -2389,7 +2389,7 @@ SvXMLImportContext *SmXMLMultiScriptsContext_Impl::CreateChildContext( const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { - SvXMLImportContext* pContext = 0L; + SvXMLImportContext* pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSmImport(). GetPresScriptEmptyElemTokenMap(); @@ -2544,7 +2544,7 @@ SvXMLImportContext *SmXMLTableRowContext_Impl::CreateChildContext( const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { - SvXMLImportContext* pContext = 0L; + SvXMLImportContext* pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSmImport(). GetPresTableElemTokenMap(); @@ -2567,7 +2567,7 @@ SvXMLImportContext *SmXMLTableContext_Impl::CreateChildContext( const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { - SvXMLImportContext* pContext = 0L; + SvXMLImportContext* pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSmImport(). GetPresTableElemTokenMap(); diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 791e698aa2a6..804de7278daf 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -77,7 +77,7 @@ bool MathType::LookupChar(sal_Unicode nChar,OUString &rRet,sal_uInt8 nVersion, sal_uInt8 nTypeFace) { bool bRet=false; - const char *pC = NULL; + const char *pC = nullptr; switch(nChar) { case 0x0000: @@ -523,7 +523,7 @@ bool MathType::LookupChar(sal_Unicode nChar,OUString &rRet,sal_uInt8 nVersion, void MathTypeFont::AppendStyleToText(OUString &rRet) { - const char *pC = NULL; + const char *pC = nullptr; switch (nStyle) { default: @@ -2141,14 +2141,14 @@ void MathType::HandleRoot(SmNode *pNode,int nLevel) pS->WriteUChar( 0x00 ); //variation pS->WriteUChar( 0x00 ); //options - if (NULL != (pTemp = pNode->GetSubNode(2))) + if (nullptr != (pTemp = pNode->GetSubNode(2))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); pS->WriteUChar( END ); } - if (NULL != (pTemp = pNode->GetSubNode(0))) + if (nullptr != (pTemp = pNode->GetSubNode(0))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2197,7 +2197,7 @@ sal_uInt8 MathType::HandleCScript(SmNode *pNode,SmNode *pContent,int nLevel, pS->WriteUChar( 0x0B ); SmNode *pTemp; - if (NULL != (pTemp = pNode->GetSubNode(CSUB+1))) + if (nullptr != (pTemp = pNode->GetSubNode(CSUB+1))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2205,7 +2205,7 @@ sal_uInt8 MathType::HandleCScript(SmNode *pNode,SmNode *pContent,int nLevel, } else pS->WriteUChar( LINE|0x10 ); - if (bTest && NULL != (pTemp = pNode->GetSubNode(CSUP+1))) + if (bTest && nullptr != (pTemp = pNode->GetSubNode(CSUP+1))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2234,7 +2234,7 @@ void MathType::HandleSubSupScript(SmNode *pNode,int nLevel) if (pNode->GetSubNode(LSUB+1)) nVariation=2; } - else if ( NULL != pNode->GetSubNode(LSUB+1) ) + else if ( nullptr != pNode->GetSubNode(LSUB+1) ) nVariation=1; SmNode *pTemp; @@ -2246,7 +2246,7 @@ void MathType::HandleSubSupScript(SmNode *pNode,int nLevel) pS->WriteUChar( 0x00 ); //options pS->WriteUChar( 0x0B ); - if (NULL != (pTemp = pNode->GetSubNode(LSUB+1))) + if (nullptr != (pTemp = pNode->GetSubNode(LSUB+1))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2254,7 +2254,7 @@ void MathType::HandleSubSupScript(SmNode *pNode,int nLevel) } else pS->WriteUChar( LINE|0x10 ); - if (NULL != (pTemp = pNode->GetSubNode(LSUP+1))) + if (nullptr != (pTemp = pNode->GetSubNode(LSUP+1))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2267,9 +2267,9 @@ void MathType::HandleSubSupScript(SmNode *pNode,int nLevel) } - sal_uInt8 nVariation2=HandleCScript(pNode,NULL,nLevel); + sal_uInt8 nVariation2=HandleCScript(pNode,nullptr,nLevel); - if (NULL != (pTemp = pNode->GetSubNode(0))) + if (nullptr != (pTemp = pNode->GetSubNode(0))) { HandleNodes(pTemp,nLevel+1); } @@ -2277,13 +2277,13 @@ void MathType::HandleSubSupScript(SmNode *pNode,int nLevel) if (nVariation2 != 0xff) pS->WriteUChar( END ); - if (NULL != (pNode->GetSubNode(RSUP+1))) + if (nullptr != (pNode->GetSubNode(RSUP+1))) { nVariation=0; if (pNode->GetSubNode(RSUB+1)) nVariation=2; } - else if (NULL != pNode->GetSubNode(RSUB+1)) + else if (nullptr != pNode->GetSubNode(RSUB+1)) nVariation=1; if (nVariation!=0xff) @@ -2294,7 +2294,7 @@ void MathType::HandleSubSupScript(SmNode *pNode,int nLevel) pS->WriteUChar( 0x00 ); //options pS->WriteUChar( 0x0B ); - if (NULL != (pTemp = pNode->GetSubNode(RSUB+1))) + if (nullptr != (pTemp = pNode->GetSubNode(RSUB+1))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2302,7 +2302,7 @@ void MathType::HandleSubSupScript(SmNode *pNode,int nLevel) } else pS->WriteUChar( LINE|0x10 ); - if (NULL != (pTemp = pNode->GetSubNode(RSUP+1))) + if (nullptr != (pTemp = pNode->GetSubNode(RSUP+1))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2329,13 +2329,13 @@ void MathType::HandleFractions(SmNode *pNode,int nLevel) pS->WriteUChar( 0x0A ); pS->WriteUChar( LINE ); //line - if (NULL != (pTemp = pNode->GetSubNode(0))) + if (nullptr != (pTemp = pNode->GetSubNode(0))) HandleNodes(pTemp,nLevel+1); pS->WriteUChar( END ); pS->WriteUChar( 0x0A ); pS->WriteUChar( LINE ); //line - if (NULL != (pTemp = pNode->GetSubNode(2))) + if (nullptr != (pTemp = pNode->GetSubNode(2))) HandleNodes(pTemp,nLevel+1); pS->WriteUChar( END ); @@ -2399,7 +2399,7 @@ void MathType::HandleBrace(SmNode *pNode,int nLevel) } } - if (NULL != (pTemp = pNode->GetSubNode(1))) + if (nullptr != (pTemp = pNode->GetSubNode(1))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2437,14 +2437,14 @@ void MathType::HandleVerticalBrace(SmNode *pNode,int nLevel) pS->WriteUChar( 0 ); //variation pS->WriteUChar( 0 ); //options - if (NULL != (pTemp = pNode->GetSubNode(0))) + if (nullptr != (pTemp = pNode->GetSubNode(0))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); pS->WriteUChar( END ); //options } - if (NULL != (pTemp = pNode->GetSubNode(2))) + if (nullptr != (pTemp = pNode->GetSubNode(2))) { pS->WriteUChar( LINE ); //line HandleNodes(pTemp,nLevel+1); @@ -2965,7 +2965,7 @@ bool MathType::HandleLim(SmNode *pNode,int nLevel) { if (pNode->GetSubNode(1)) { - sal_uInt8 nVariation2=HandleCScript(pNode->GetSubNode(0),NULL, + sal_uInt8 nVariation2=HandleCScript(pNode->GetSubNode(0),nullptr, nLevel); pS->WriteUChar( 0x0A ); @@ -3163,10 +3163,10 @@ void MathType::HandleMath(SmNode *pNode, int /*nLevel*/) void MathType::HandleAttributes(SmNode *pNode,int nLevel) { int nOldPending = 0; - SmNode *pTemp = 0; - SmTextNode *pIsText = 0; + SmNode *pTemp = nullptr; + SmTextNode *pIsText = nullptr; - if (NULL != (pTemp = pNode->GetSubNode(0))) + if (nullptr != (pTemp = pNode->GetSubNode(0))) { pIsText = static_cast<SmTextNode *>(pNode->GetSubNode(1)); @@ -3226,7 +3226,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) nPendingAttributes--; else { - if ((nInsertion != 0) && NULL != (pTemp = pNode->GetSubNode(0))) + if ((nInsertion != 0) && nullptr != (pTemp = pNode->GetSubNode(0))) { sal_uLong nPos = pS->Tell(); nInsertion--; diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx index 80eee96ee266..16cc9e8aa487 100644 --- a/starmath/source/mathtype.hxx +++ b/starmath/source/mathtype.hxx @@ -59,9 +59,9 @@ public: , nProduct(0) , nProdVersion(0) , nProdSubVersion(0) - , pS(NULL) + , pS(nullptr) , rRet(rIn) - , pTree(NULL) + , pTree(nullptr) , nHAlign(0) , nVAlign(0) , nPendingAttributes(0) @@ -87,7 +87,7 @@ public: , nProduct(0) , nProdVersion(0) , nProdSubVersion(0) - , pS(NULL) + , pS(nullptr) , rRet(rIn) , pTree(pIn) , nHAlign(2) @@ -154,7 +154,7 @@ private: void HandleRoot(SmNode *pNode,int nLevel); void HandleSubSupScript(SmNode *pNode,int nLevel); sal_uInt8 HandleCScript(SmNode *pNode,SmNode *pContent,int nLevel, - sal_uLong *pPos=NULL,bool bTest=true); + sal_uLong *pPos=nullptr,bool bTest=true); void HandleFractions(SmNode *pNode,int nLevel); void HandleBrace(SmNode *pNode,int nLevel); void HandleVerticalBrace(SmNode *pNode,int nLevel); diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index aed9dc5585ba..cf50b773e18e 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -88,7 +88,7 @@ sal_uInt16 SmNode::GetNumSubNodes() const SmNode * SmNode::GetSubNode(sal_uInt16 /*nIndex*/) { - return NULL; + return nullptr; } @@ -98,7 +98,7 @@ SmNode * SmNode::GetLeftMost() //! for the current node). { SmNode *pNode = GetNumSubNodes() > 0 ? - GetSubNode(0) : NULL; + GetSubNode(0) : nullptr; return pNode ? pNode->GetLeftMost() : this; } @@ -337,14 +337,14 @@ const SmNode * SmNode::FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const } } - return 0; + return nullptr; } const SmNode * SmNode::FindRectClosestTo(const Point &rPoint) const { long nDist = LONG_MAX; - const SmNode *pResult = 0; + const SmNode *pResult = nullptr; if (IsVisible()) pResult = this; @@ -385,7 +385,7 @@ void SmNode::GetAccessibleText( OUStringBuffer &/*rText*/ ) const const SmNode * SmNode::FindNodeWithAccessibleIndex(sal_Int32 nAccIdx) const { - const SmNode *pResult = 0; + const SmNode *pResult = nullptr; sal_Int32 nIdx = GetAccessibleIndex(); OUStringBuffer aTxt; @@ -533,7 +533,7 @@ SmStructureNode::SmStructureNode( const SmStructureNode &rNode ) : for (i = 0; i < nSize; ++i) { SmNode *pNode = rNode.aSubNodes[i]; - aSubNodes[i] = pNode ? new SmNode( *pNode ) : 0; + aSubNodes[i] = pNode ? new SmNode( *pNode ) : nullptr; } ClaimPaternity(); } @@ -559,7 +559,7 @@ SmStructureNode & SmStructureNode::operator = ( const SmStructureNode &rNode ) for (i = 0; i < nSize; ++i) { SmNode *pNode = rNode.aSubNodes[i]; - aSubNodes[i] = pNode ? new SmNode( *pNode ) : 0; + aSubNodes[i] = pNode ? new SmNode( *pNode ) : nullptr; } ClaimPaternity(); @@ -644,7 +644,7 @@ sal_uInt16 SmVisibleNode::GetNumSubNodes() const SmNode * SmVisibleNode::GetSubNode(sal_uInt16 /*nIndex*/) { - return NULL; + return nullptr; } void SmGraphicNode::GetAccessibleText( OUStringBuffer &rText ) const @@ -696,7 +696,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) nTmp; sal_uInt16 i; for (i = 0; i < nSize; i++) - if (NULL != (pNode = GetSubNode(i))) + if (nullptr != (pNode = GetSubNode(i))) { pNode->Arrange(rDev, rFormat); if ((nTmp = pNode->GetItalicWidth()) > nMaxWidth) nMaxWidth = nTmp; @@ -705,7 +705,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) Point aPos; SmRect::operator = (SmRect(nMaxWidth, 1)); for (i = 0; i < nSize; i++) - { if (NULL != (pNode = GetSubNode(i))) + { if (nullptr != (pNode = GetSubNode(i))) { const SmRect &rNodeRect = pNode->GetRect(); const SmNode *pCoNode = pNode->GetLeftMost(); RectHorAlign eHorAlign = pCoNode->GetRectHorAlign(); @@ -771,7 +771,7 @@ void SmLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) sal_uInt16 nSize = GetNumSubNodes(); sal_uInt16 i; for (i = 0; i < nSize; i++) - if (NULL != (pNode = GetSubNode(i))) + if (nullptr != (pNode = GetSubNode(i))) pNode->Arrange(rDev, rFormat); SmTmpDevice aTmpDev ((OutputDevice &) rDev, true); @@ -800,11 +800,11 @@ void SmLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) Point aPos; // copy the first node into LineNode and extend by the others - if (NULL != (pNode = GetSubNode(0))) + if (nullptr != (pNode = GetSubNode(0))) SmRect::operator = (pNode->GetRect()); for (i = 1; i < nSize; i++) - if (NULL != (pNode = GetSubNode(i))) + if (nullptr != (pNode = GetSubNode(i))) { aPos = pNode->AlignTo(*this, RP_RIGHT, RHA_CENTER, RVA_BASELINE); @@ -1031,9 +1031,9 @@ void SmBinHorNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) SmNode *pLeft = GetSubNode(0), *pOper = GetSubNode(1), *pRight = GetSubNode(2); - OSL_ENSURE(pLeft != NULL, "Sm: NULL pointer"); - OSL_ENSURE(pOper != NULL, "Sm: NULL pointer"); - OSL_ENSURE(pRight != NULL, "Sm: NULL pointer"); + OSL_ENSURE(pLeft != nullptr, "Sm: NULL pointer"); + OSL_ENSURE(pOper != nullptr, "Sm: NULL pointer"); + OSL_ENSURE(pRight != nullptr, "Sm: NULL pointer"); pOper->SetSize(Fraction (rFormat.GetRelSize(SIZ_OPERATOR), 100)); @@ -1510,33 +1510,33 @@ void SmSubSupNode::CreateTextFromNode(OUString &rText) SmNode *pNode; GetSubNode(0)->CreateTextFromNode(rText); - if (NULL != (pNode = GetSubNode(LSUB+1))) + if (nullptr != (pNode = GetSubNode(LSUB+1))) { rText += "lsub "; pNode->CreateTextFromNode(rText); } - if (NULL != (pNode = GetSubNode(LSUP+1))) + if (nullptr != (pNode = GetSubNode(LSUP+1))) { rText += "lsup "; pNode->CreateTextFromNode(rText); } - if (NULL != (pNode = GetSubNode(CSUB+1))) + if (nullptr != (pNode = GetSubNode(CSUB+1))) { rText += "csub "; pNode->CreateTextFromNode(rText); } - if (NULL != (pNode = GetSubNode(CSUP+1))) + if (nullptr != (pNode = GetSubNode(CSUP+1))) { rText += "csup "; pNode->CreateTextFromNode(rText); } - if (NULL != (pNode = GetSubNode(RSUB+1))) + if (nullptr != (pNode = GetSubNode(RSUB+1))) { rText = comphelper::string::stripEnd(rText, ' '); rText += "_"; pNode->CreateTextFromNode(rText); } - if (NULL != (pNode = GetSubNode(RSUP+1))) + if (nullptr != (pNode = GetSubNode(RSUP+1))) { rText = comphelper::string::stripEnd(rText, ' '); rText += "^"; @@ -2498,7 +2498,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) for (i = 0; i < nNodes; i++) { sal_uInt16 nIdx = nNodes - 1 - i; - if (NULL != (pNode = GetSubNode(nIdx))) + if (nullptr != (pNode = GetSubNode(nIdx))) { pNode->Arrange(rDev, rFormat); int nCol = nIdx % nNumCols; @@ -2571,7 +2571,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) aDelta.Y() = aPos.Y() - aLineRect.GetTop(); aLineRect.Move(aDelta); for (j = 0; j < nNumCols; j++) - if (NULL != (pNode = GetSubNode(i * nNumCols + j))) + if (nullptr != (pNode = GetSubNode(i * nNumCols + j))) pNode->Move(aDelta); ExtendBy(aLineRect, RCP_NONE); @@ -2617,7 +2617,7 @@ void SmMathSymbolNode::AdaptToX(const OutputDevice &rDev, sal_uLong nWidth) // get denominator of error factor for width long nTmpBorderWidth = GetFont().GetBorderWidth(); - long nDenom = SmRect(aTmpDev, NULL, GetText(), nTmpBorderWidth).GetItalicWidth(); + long nDenom = SmRect(aTmpDev, nullptr, GetText(), nTmpBorderWidth).GetItalicWidth(); // scale fontwidth with this error factor aFntSize.Width() *= nWidth; @@ -2653,7 +2653,7 @@ void SmMathSymbolNode::AdaptToY(const OutputDevice &rDev, sal_uLong nHeight) // get denominator of error factor for height long nTmpBorderWidth = GetFont().GetBorderWidth(); - long nDenom = SmRect(aTmpDev, NULL, GetText(), nTmpBorderWidth).GetHeight(); + long nDenom = SmRect(aTmpDev, nullptr, GetText(), nTmpBorderWidth).GetHeight(); // scale fontwidth with this error factor aFntSize.Height() *= nHeight; @@ -2730,7 +2730,7 @@ void SmAttributNode::CreateTextFromNode(OUString &rText) OSL_ENSURE(nSize == 2, "Node missing members"); rText += "{"; sal_Unicode nLast=0; - if (NULL != (pNode = GetSubNode(0))) + if (nullptr != (pNode = GetSubNode(0))) { OUString aStr; pNode->CreateTextFromNode(aStr); @@ -2802,7 +2802,7 @@ void SmAttributNode::CreateTextFromNode(OUString &rText) } if (nSize == 2) - if (NULL != (pNode = GetSubNode(1))) + if (nullptr != (pNode = GetSubNode(1))) pNode->CreateTextFromNode(rText); rText = comphelper::string::stripEnd(rText, ' '); @@ -2854,7 +2854,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell SmModule *pp = SM_MOD(); OUString aName(GetToken().aText.copy(1)); - if (NULL != (pSym = pp->GetSymbolManager().GetSymbolByName( aName ))) + if (nullptr != (pSym = pp->GetSymbolManager().GetSymbolByName( aName ))) { sal_UCS4 cChar = pSym->GetCharacter(); OUString aTmp( &cChar, 1 ); diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx index 0573e6478798..5a72ee11784b 100644 --- a/starmath/source/ooxmlexport.cxx +++ b/starmath/source/ooxmlexport.cxx @@ -24,7 +24,7 @@ SmOoxmlExport::SmOoxmlExport( const SmNode* pIn, OoxmlVersion v ) bool SmOoxmlExport::ConvertFromStarMath( ::sax_fastparser::FSHelperPtr serializer ) { - if( m_pTree == NULL ) + if( m_pTree == nullptr ) return false; m_pSerializer = serializer; m_pSerializer->startElementNS( XML_m, XML_oMath, @@ -132,7 +132,7 @@ void SmOoxmlExport::HandleText( const SmNode* pNode, int /*nLevel*/) void SmOoxmlExport::HandleFractions( const SmNode* pNode, int nLevel, const char* type ) { m_pSerializer->startElementNS( XML_m, XML_f, FSEND ); - if( type != NULL ) + if( type != nullptr ) { m_pSerializer->startElementNS( XML_m, XML_fPr, FSEND ); m_pSerializer->singleElementNS( XML_m, XML_type, FSNS( XML_m, XML_val ), type, FSEND ); @@ -260,18 +260,18 @@ void SmOoxmlExport::HandleOperator( const SmOperNode* pNode, int nLevel ) case TSUM: { const SmSubSupNode* subsup = pNode->GetSubNode( 0 )->GetType() == NSUBSUP - ? static_cast< const SmSubSupNode* >( pNode->GetSubNode( 0 )) : NULL; - const SmNode* operation = subsup != NULL ? subsup->GetBody() : pNode->GetSubNode( 0 ); + ? static_cast< const SmSubSupNode* >( pNode->GetSubNode( 0 )) : nullptr; + const SmNode* operation = subsup != nullptr ? subsup->GetBody() : pNode->GetSubNode( 0 ); m_pSerializer->startElementNS( XML_m, XML_nary, FSEND ); m_pSerializer->startElementNS( XML_m, XML_naryPr, FSEND ); m_pSerializer->singleElementNS( XML_m, XML_chr, FSNS( XML_m, XML_val ), mathSymbolToString( operation ).getStr(), FSEND ); - if( subsup == NULL || subsup->GetSubSup( CSUB ) == NULL ) + if( subsup == nullptr || subsup->GetSubSup( CSUB ) == nullptr ) m_pSerializer->singleElementNS( XML_m, XML_subHide, FSNS( XML_m, XML_val ), "1", FSEND ); - if( subsup == NULL || subsup->GetSubSup( CSUP ) == NULL ) + if( subsup == nullptr || subsup->GetSubSup( CSUP ) == nullptr ) m_pSerializer->singleElementNS( XML_m, XML_supHide, FSNS( XML_m, XML_val ), "1", FSEND ); m_pSerializer->endElementNS( XML_m, XML_naryPr ); - if( subsup == NULL || subsup->GetSubSup( CSUB ) == NULL ) + if( subsup == nullptr || subsup->GetSubSup( CSUB ) == nullptr ) m_pSerializer->singleElementNS( XML_m, XML_sub, FSEND ); else { @@ -279,7 +279,7 @@ void SmOoxmlExport::HandleOperator( const SmOperNode* pNode, int nLevel ) HandleNode( subsup->GetSubSup( CSUB ), nLevel + 1 ); m_pSerializer->endElementNS( XML_m, XML_sub ); } - if( subsup == NULL || subsup->GetSubSup( CSUP ) == NULL ) + if( subsup == nullptr || subsup->GetSubSup( CSUP ) == nullptr ) m_pSerializer->singleElementNS( XML_m, XML_sup, FSEND ); else { @@ -302,9 +302,9 @@ void SmOoxmlExport::HandleOperator( const SmOperNode* pNode, int nLevel ) m_pSerializer->endElementNS( XML_m, XML_e ); m_pSerializer->startElementNS( XML_m, XML_lim, FSEND ); if( const SmSubSupNode* subsup = pNode->GetSubNode( 0 )->GetType() == NSUBSUP - ? static_cast< const SmSubSupNode* >( pNode->GetSubNode( 0 )) : NULL ) + ? static_cast< const SmSubSupNode* >( pNode->GetSubNode( 0 )) : nullptr ) { - if( subsup->GetSubSup( CSUB ) != NULL ) + if( subsup->GetSubSup( CSUB ) != nullptr ) HandleNode( subsup->GetSubSup( CSUB ), nLevel + 1 ); } m_pSerializer->endElementNS( XML_m, XML_lim ); diff --git a/starmath/source/ooxmlexport.hxx b/starmath/source/ooxmlexport.hxx index f71cf9e33916..a4740989d79d 100644 --- a/starmath/source/ooxmlexport.hxx +++ b/starmath/source/ooxmlexport.hxx @@ -26,7 +26,7 @@ public: private: virtual void HandleVerticalStack( const SmNode* pNode, int nLevel ) override; virtual void HandleText( const SmNode* pNode, int nLevel ) override; - virtual void HandleFractions( const SmNode* pNode, int nLevel, const char* type = NULL ) override; + virtual void HandleFractions( const SmNode* pNode, int nLevel, const char* type = nullptr ) override; virtual void HandleRoot( const SmRootNode* pNode, int nLevel ) override; virtual void HandleAttribute( const SmAttributNode* pNode, int nLevel ) override; virtual void HandleOperator( const SmOperNode* pNode, int nLevel ) override; diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index d59fed98db98..7cc066797da1 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -297,7 +297,7 @@ static const SmTokenTableEntry aTokenTable[] = const SmTokenTableEntry * SmParser::GetTokenTableEntry( const OUString &rName ) { - const SmTokenTableEntry * pRes = 0; + const SmTokenTableEntry * pRes = nullptr; if (!rName.isEmpty()) { for (size_t i = 0; i < SAL_N_ELEMENTS(aTokenTable); ++i) @@ -992,7 +992,7 @@ void SmParser::DoTable() void SmParser::DoAlign() // parse alignment info (if any), then go on with rest of expression { - SmStructureNode *pSNode = 0; + SmStructureNode *pSNode = nullptr; if (TokenInGroup(TGALIGN)) { @@ -1228,7 +1228,7 @@ void SmParser::DoSubSup(sal_uLong nActiveGroup) aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES); aSubNodes[0] = popOrZero(m_aNodeStack); for (size_t i = 1; i < aSubNodes.size(); i++) - aSubNodes[i] = NULL; + aSubNodes[i] = nullptr; // process all sub-/supscripts int nIndex = 0; @@ -1265,7 +1265,7 @@ void SmParser::DoSubSup(sal_uLong nActiveGroup) "SmParser::Power() : sub-/supscript index falsch"); // set sub-/supscript if not already done - if (aSubNodes[nIndex] != NULL) + if (aSubNodes[nIndex] != nullptr) Error(PE_DOUBLE_SUBSUPSCRIPT); aSubNodes[nIndex] = popOrZero(m_aNodeStack); } @@ -1346,7 +1346,7 @@ void SmParser::DoTerm(bool bGroupNumberIdent) if (bNoSpace) // get rid of the 'no space' node pushed above m_aNodeStack.pop_front(); std::unique_ptr<SmStructureNode> pSNode(new SmExpressionNode(m_aCurToken)); - pSNode->SetSubNodes(NULL, NULL); + pSNode->SetSubNodes(nullptr, nullptr); m_aNodeStack.push_front(std::move(pSNode)); NextToken(); @@ -1550,7 +1550,7 @@ void SmParser::DoTerm(bool bGroupNumberIdent) { SmStructureNode *pNode = aStack.top(); aStack.pop(); - pNode->SetSubNodes(0, pFirstNode); + pNode->SetSubNodes(nullptr, pFirstNode); pFirstNode = pNode; } m_aNodeStack.push_front(std::unique_ptr<SmNode>(pFirstNode)); @@ -1645,7 +1645,7 @@ void SmParser::DoOper() case TLIMSUP : case TLIMINF : { - const sal_Char* pLim = 0; + const sal_Char* pLim = nullptr; switch (eType) { case TLIM : pLim = "lim"; break; @@ -1684,8 +1684,8 @@ void SmParser::DoUnOper() bool bIsPostfix = eType == TFACT; std::unique_ptr<SmStructureNode> pSNode; - SmNode *pOper = 0, - *pExtra = 0, + SmNode *pOper = nullptr, + *pExtra = nullptr, *pArg; switch (eType) @@ -1805,7 +1805,7 @@ void SmParser::DoAttribut() NextToken(); - pSNode->SetSubNodes(pAttr, 0); + pSNode->SetSubNodes(pAttr, nullptr); pSNode->SetScaleMode(eScaleMode); m_aNodeStack.push_front(std::move(pSNode)); } @@ -1978,9 +1978,9 @@ void SmParser::DoBrace() "Sm: kein Klammer Ausdruck"); std::unique_ptr<SmStructureNode> pSNode(new SmBraceNode(m_aCurToken)); - SmNode *pBody = 0, - *pLeft = 0, - *pRight = 0; + SmNode *pBody = nullptr, + *pLeft = nullptr, + *pRight = nullptr; SmScaleMode eScaleMode = SCALE_NONE; SmParseError eError = PE_NONE; @@ -2341,7 +2341,7 @@ void SmParser::Error(SmParseError eError) { SmStructureNode *pSNode = new SmExpressionNode(m_aCurToken); SmErrorNode *pErr = new SmErrorNode(eError, m_aCurToken); - pSNode->SetSubNodes(pErr, 0); + pSNode->SetSubNodes(pErr, nullptr); //! put a structure node on the stack (instead of the error node itself) //! because sometimes such a node is expected in order to attach some @@ -2460,7 +2460,7 @@ const SmErrorDesc *SmParser::NextError() m_nCurError = 0; return m_aErrDescList[ m_nCurError ].get(); } - else return NULL; + else return nullptr; } @@ -2473,7 +2473,7 @@ const SmErrorDesc *SmParser::PrevError() m_nCurError = (int) (m_aErrDescList.size() - 1); return m_aErrDescList[ m_nCurError ].get(); } - else return NULL; + else return nullptr; } @@ -2485,7 +2485,7 @@ const SmErrorDesc *SmParser::GetError(size_t i) if ( (size_t)m_nCurError < m_aErrDescList.size() ) return m_aErrDescList[ m_nCurError ].get(); - return NULL; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/source/register.cxx b/starmath/source/register.cxx index 6f6062caea41..f28171060fd1 100644 --- a/starmath/source/register.cxx +++ b/starmath/source/register.cxx @@ -40,11 +40,11 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL sm_component_getFactory( const sal_Char* pIm void* /*pRegistryKey*/ ) { // Set default return value for this operation - if it failed. - void* pReturn = NULL ; + void* pReturn = nullptr ; if ( - ( pImplementationName != NULL ) && - ( pServiceManager != NULL ) + ( pImplementationName != nullptr ) && + ( pServiceManager != nullptr ) ) { // Define variables which are used in following macros. diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx index bb08685b4d65..de092ea59d76 100644 --- a/starmath/source/rtfexport.cxx +++ b/starmath/source/rtfexport.cxx @@ -15,7 +15,7 @@ SmRtfExport::SmRtfExport(const SmNode* pIn) : SmWordExportBase(pIn) - , m_pBuffer(0) + , m_pBuffer(nullptr) , m_nEncoding(RTL_TEXTENCODING_DONTKNOW) { } @@ -207,7 +207,7 @@ void SmRtfExport::HandleOperator(const SmOperNode* pNode, int nLevel) case TCOPROD: case TSUM: { - const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == NSUBSUP ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : 0; + const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == NSUBSUP ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : nullptr; const SmNode* operation = subsup ? subsup->GetBody() : pNode->GetSubNode(0); m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MNARY " "); m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MNARYPR " "); @@ -249,7 +249,7 @@ void SmRtfExport::HandleOperator(const SmOperNode* pNode, int nLevel) HandleNode(pNode->GetSymbol(), nLevel + 1); m_pBuffer->append("}"); // me m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MLIM " "); - if (const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == NSUBSUP ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : 0) + if (const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == NSUBSUP ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : nullptr) if (subsup->GetSubSup(CSUB)) HandleNode(subsup->GetSubSup(CSUB), nLevel + 1); m_pBuffer->append("}"); // mlim diff --git a/starmath/source/rtfexport.hxx b/starmath/source/rtfexport.hxx index b1332ccdf0f8..24a50d3d31cd 100644 --- a/starmath/source/rtfexport.hxx +++ b/starmath/source/rtfexport.hxx @@ -25,7 +25,7 @@ public: private: virtual void HandleVerticalStack(const SmNode* pNode, int nLevel) override; virtual void HandleText(const SmNode* pNode, int nLevel) override; - virtual void HandleFractions(const SmNode* pNode, int nLevel, const char* type = NULL) override; + virtual void HandleFractions(const SmNode* pNode, int nLevel, const char* type = nullptr) override; virtual void HandleRoot(const SmRootNode* pNode, int nLevel) override; virtual void HandleAttribute(const SmAttributNode* pNode, int nLevel) override; virtual void HandleOperator(const SmOperNode* pNode, int nLevel) override; diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 7e9206e638df..7ded9e325851 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -262,7 +262,7 @@ void SmModule::GetState(SfxItemSet &rSet) SfxItemSet* SmModule::CreateItemSet( sal_uInt16 nId ) { - SfxItemSet* pRet = 0; + SfxItemSet* pRet = nullptr; if(nId == SID_SM_EDITOPTIONS) { pRet = new SfxItemSet(GetPool(), diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 91ce716095da..6de4c34921f2 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -140,7 +140,7 @@ SmSymbolManager& SmSymbolManager::operator = (const SmSymbolManager& rSymbolSetM SmSym *SmSymbolManager::GetSymbolByName(const OUString& rSymbolName) { - SmSym *pRes = NULL; + SmSym *pRes = nullptr; SymbolMap_t::iterator aIt( m_aSymbols.find( rSymbolName ) ); if (aIt != m_aSymbols.end()) pRes = &aIt->second; diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index fe292eb264bb..b1ecf5c4fdc5 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -422,7 +422,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* SmDocShell *pDocSh = static_cast < SmDocShell * > (GetObjectShell()); - if ( NULL == pDocSh ) + if ( nullptr == pDocSh ) throw UnknownPropertyException(); SmFormat aFormat = pDocSh->GetFormat(); @@ -705,7 +705,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu { SmDocShell *pDocSh = static_cast < SmDocShell * > (GetObjectShell()); - if ( NULL == pDocSh ) + if ( nullptr == pDocSh ) throw UnknownPropertyException(); const SmFormat & aFormat = pDocSh->GetFormat(); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 0004a1b61d98..e0489a13cc33 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -95,7 +95,7 @@ using namespace css::uno; SmGraphicWindow::SmGraphicWindow(SmViewShell* pShell) : ScrollableWindow(&pShell->GetViewFrame()->GetWindow(), 0) - , pAccessible(0) + , pAccessible(nullptr) , pViewShell(pShell) , nZoom(100) { @@ -179,7 +179,7 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt) pViewShell->GetDoc()->GetCursor().MoveTo(this, aPos, !rMEvt.IsShift()); return; } - const SmNode *pNode = 0; + const SmNode *pNode = nullptr; // if it was clicked inside the formula then get the appropriate node if (pTree->OrientedDist(aPos) <= 0) pNode = pTree->FindRectClosestTo(aPos); @@ -362,11 +362,11 @@ const SmNode * SmGraphicWindow::SetCursorPos(sal_uInt16 nRow, sal_uInt16 nCol) // In any case the search result is being returned. { if (IsInlineEditEnabled()) - return NULL; + return nullptr; // find visible node with token at nRow, nCol const SmNode *pTree = pViewShell->GetDoc()->GetFormulaTree(), - *pNode = 0; + *pNode = nullptr; if (pTree) pNode = pTree->FindTokenAt(nRow, nCol); @@ -515,7 +515,7 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt) default: { sal_Unicode code = rKEvt.GetCharCode(); - SmBraceNode* pBraceNode = NULL; + SmBraceNode* pBraceNode = nullptr; if(code == ' ') { rCursor.InsertElement(BlankElement); @@ -698,7 +698,7 @@ void SmEditController::StateChanged(sal_uInt16 nSID, SfxItemState eState, const { const SfxStringItem *pItem = dynamic_cast<const SfxStringItem*>( pState); - if ((pItem != NULL) && (rEdit.GetText() != OUString(pItem->GetValue()))) + if ((pItem != nullptr) && (rEdit.GetText() != OUString(pItem->GetValue()))) rEdit.SetText(pItem->GetValue()); SfxControllerItem::StateChanged (nSID, eState, pState); } @@ -738,7 +738,7 @@ void SmCmdBoxWindow::dispose() SmViewShell * SmCmdBoxWindow::GetView() { SfxDispatcher *pDispatcher = GetBindings().GetDispatcher(); - SfxViewShell *pView = pDispatcher ? pDispatcher->GetFrame()->GetViewShell() : NULL; + SfxViewShell *pView = pDispatcher ? pDispatcher->GetFrame()->GetViewShell() : nullptr; return dynamic_cast<SmViewShell*>( pView); } @@ -1295,7 +1295,7 @@ SfxPrinter* SmViewShell::GetPrinter(bool bCreate) SmDocShell* pDoc = GetDoc(); if (pDoc->HasPrinter() || bCreate) return pDoc->GetPrinter(); - return 0; + return nullptr; } sal_uInt16 SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags, bool ) @@ -1349,7 +1349,7 @@ void SmViewShell::SetStatusText(const OUString& rText) void SmViewShell::ShowError(const SmErrorDesc* pErrorDesc) { SAL_WARN_IF( !GetDoc(), "starmath", "Document missing" ); - if (pErrorDesc || 0 != (pErrorDesc = GetDoc()->GetParser().GetError(0)) ) + if (pErrorDesc || nullptr != (pErrorDesc = GetDoc()->GetParser().GetError(0)) ) { SetStatusText( pErrorDesc->m_aText ); GetEditWindow()->MarkError( Point( pErrorDesc->m_pNode->GetColumn(), @@ -1478,7 +1478,7 @@ void SmViewShell::Execute(SfxRequest& rReq) { GetDoc()->SetText( pWin->GetText() ); SetStatusText(OUString()); - ShowError( 0 ); + ShowError( nullptr ); GetDoc()->Repaint(); } break; @@ -1567,7 +1567,7 @@ void SmViewShell::Execute(SfxRequest& rReq) case SID_PASTE: { - bool bCallExec = 0 == pWin; + bool bCallExec = nullptr == pWin; if( !bCallExec ) { TransferableDataHelper aDataHelper( @@ -1752,7 +1752,7 @@ void SmViewShell::Execute(SfxRequest& rReq) case SID_TEXTSTATUS: { - if (rReq.GetArgs() != NULL) + if (rReq.GetArgs() != nullptr) { const SfxStringItem& rItem = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(SID_TEXTSTATUS)); @@ -1848,11 +1848,11 @@ void SmViewShell::Execute(SfxRequest& rReq) case SID_UNICODE_NOTATION_TOGGLE: { - EditEngine* pEditEngine = 0; + EditEngine* pEditEngine = nullptr; if( pWin ) pEditEngine = pWin->GetEditEngine(); - EditView* pEditView = 0; + EditView* pEditView = nullptr; if( pEditEngine ) pEditView = pEditEngine->GetView(); @@ -2062,7 +2062,7 @@ IMPL_LINK_TYPED( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDl { SfxMedium* pMedium = pImpl->pDocInserter->CreateMedium(); - if ( pMedium != NULL ) + if ( pMedium != nullptr ) { if ( pMedium->IsStorage() ) Insert( *pMedium ); diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 54e696188fb4..24c54462cd56 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -992,7 +992,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode ) bodyRight->SetRight( right ); //Get subsup pNode if any - SmSubSupNode* pSubSup = pOper->GetType( ) == NSUBSUP ? static_cast<SmSubSupNode*>(pOper) : NULL; + SmSubSupNode* pSubSup = pOper->GetType( ) == NSUBSUP ? static_cast<SmSubSupNode*>(pOper) : nullptr; SmNode* pChild; SmCaretPosGraphEntry *childLeft; @@ -1638,10 +1638,10 @@ void SmCloningVisitor::CloneKids( SmStructureNode* pSource, SmStructureNode* pTa //Clone children for( sal_uInt16 i = 0; i < nSize; i++ ){ SmNode* pKid; - if( NULL != ( pKid = pSource->GetSubNode( i ) ) ) + if( nullptr != ( pKid = pSource->GetSubNode( i ) ) ) pKid->Accept( this ); else - pResult = NULL; + pResult = nullptr; aNodes[i] = pResult; } diff --git a/starmath/source/wordexportbase.cxx b/starmath/source/wordexportbase.cxx index 21b330130654..99420d8005f4 100644 --- a/starmath/source/wordexportbase.cxx +++ b/starmath/source/wordexportbase.cxx @@ -125,7 +125,7 @@ void SmWordExportBase::HandleAllSubNodes(const SmNode* pNode, int nLevel) ++i) { // TODO remove when all types of nodes are handled properly - if (pNode->GetSubNode(i) == NULL) + if (pNode->GetSubNode(i) == nullptr) { SAL_WARN("starmath.wordbase", "Subnode is NULL, parent node not handled properly"); continue; @@ -180,12 +180,12 @@ void SmWordExportBase::HandleMath(const SmNode* pNode, int nLevel) void SmWordExportBase::HandleSubSupScript(const SmSubSupNode* pNode, int nLevel) { // set flags to a bitfield of which sub/sup items exists - int flags = (pNode->GetSubSup(CSUB) != NULL ? (1 << CSUB) : 0) - | (pNode->GetSubSup(CSUP) != NULL ? (1 << CSUP) : 0) - | (pNode->GetSubSup(RSUB) != NULL ? (1 << RSUB) : 0) - | (pNode->GetSubSup(RSUP) != NULL ? (1 << RSUP) : 0) - | (pNode->GetSubSup(LSUB) != NULL ? (1 << LSUB) : 0) - | (pNode->GetSubSup(LSUP) != NULL ? (1 << LSUP) : 0); + int flags = (pNode->GetSubSup(CSUB) != nullptr ? (1 << CSUB) : 0) + | (pNode->GetSubSup(CSUP) != nullptr ? (1 << CSUP) : 0) + | (pNode->GetSubSup(RSUB) != nullptr ? (1 << RSUB) : 0) + | (pNode->GetSubSup(RSUP) != nullptr ? (1 << RSUP) : 0) + | (pNode->GetSubSup(LSUB) != nullptr ? (1 << LSUB) : 0) + | (pNode->GetSubSup(LSUP) != nullptr ? (1 << LSUP) : 0); HandleSubSupScriptInternal(pNode, nLevel, flags); } diff --git a/starmath/source/wordexportbase.hxx b/starmath/source/wordexportbase.hxx index 059db4f08a20..b8aac113334a 100644 --- a/starmath/source/wordexportbase.hxx +++ b/starmath/source/wordexportbase.hxx @@ -27,7 +27,7 @@ protected: virtual void HandleVerticalStack( const SmNode* pNode, int nLevel ) = 0; virtual void HandleText( const SmNode* pNode, int nLevel ) = 0; void HandleMath( const SmNode* pNode, int nLevel ); - virtual void HandleFractions( const SmNode* pNode, int nLevel, const char* type = NULL ) = 0; + virtual void HandleFractions( const SmNode* pNode, int nLevel, const char* type = nullptr ) = 0; void HandleUnaryOperation( const SmUnHorNode* pNode, int nLevel ); void HandleBinaryOperation( const SmBinHorNode* pNode, int nLevel ); virtual void HandleRoot( const SmRootNode* pNode, int nLevel ) = 0; |