diff options
author | Ashod Nakashian <ashodnakashian@yahoo.com> | 2015-10-31 21:04:59 -0400 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-07 21:22:01 +0000 |
commit | 04783fd91832fa01a5b096f395edd7ad4f9c0f6b (patch) | |
tree | fd677ba54851b1742ad163e3a27bc6cea314052c /sw/source/uibase | |
parent | 12d973aa9b6b3d962702f27fc46ef05b0151cabc (diff) |
Misc tweaks and cleanups.
Streamlined a couple of hotspots and some
minor cleanups.
Change-Id: I85a9423e03f7e20ce78736a44d668da859a443cd
Reviewed-on: https://gerrit.libreoffice.org/19720
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/PageBreakWin.cxx | 24 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 24 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarWin.cxx | 32 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 24 |
4 files changed, 52 insertions, 52 deletions
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 93e7c427bf7a..7533bce6aa8a 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -93,13 +93,13 @@ namespace SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwFrm *pFrm ) : SwFrameMenuButtonBase( pEditWin, pFrm ), - m_pPopupMenu( NULL ), - m_pLine( NULL ), + m_pPopupMenu( nullptr ), + m_pLine( nullptr ), m_bIsAppearing( false ), m_nFadeRate( 100 ), m_nDelayAppearing( 0 ), m_bDestroyed( false ), - m_pMousePt( NULL ) + m_pMousePt( nullptr ) { // Use pixels for the rest of the drawing SetMapMode( MapMode ( MAP_PIXEL ) ); @@ -128,9 +128,9 @@ void SwPageBreakWin::dispose() m_pLine.disposeAndClear(); delete m_pPopupMenu; - m_pPopupMenu = NULL; + m_pPopupMenu = nullptr; delete m_pMousePt; - m_pMousePt = NULL; + m_pMousePt = nullptr; SwFrameMenuButtonBase::dispose(); } @@ -246,7 +246,7 @@ void SwPageBreakWin::Select( ) SfxStringItem aItem(pEditWin->GetView().GetPool().GetWhich(FN_FORMAT_TABLE_DLG), "textflow"); pEditWin->GetView().GetViewFrame()->GetDispatcher()->Execute( - FN_FORMAT_TABLE_DLG, SfxCallMode::SYNCHRON|SfxCallMode::RECORD, &aItem, NULL ); + FN_FORMAT_TABLE_DLG, SfxCallMode::SYNCHRON|SfxCallMode::RECORD, &aItem, nullptr ); rSh.Pop( false ); } @@ -259,7 +259,7 @@ void SwPageBreakWin::Select( ) SwPaMItem aPaMItem( pEditWin->GetView().GetPool( ).GetWhich( FN_PARAM_PAM ), &aPaM ); SfxStringItem aItem( pEditWin->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), "textflow" ); pEditWin->GetView().GetViewFrame()->GetDispatcher()->Execute( - SID_PARA_DLG, SfxCallMode::SYNCHRON|SfxCallMode::RECORD, &aItem, &aPaMItem, NULL ); + SID_PARA_DLG, SfxCallMode::SYNCHRON|SfxCallMode::RECORD, &aItem, &aPaMItem, nullptr ); } rSh.LockView( bOldLock ); pEditWin->GrabFocus( ); @@ -277,19 +277,19 @@ void SwPageBreakWin::Select( ) SwContentFrm *pCnt = const_cast< SwContentFrm* >( pBodyFrm->ContainsContent() ); SwContentNode* pNd = pCnt->GetNode(); - pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( UNDO_UI_DELETE_PAGE_BREAK, NULL ); + pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( UNDO_UI_DELETE_PAGE_BREAK, nullptr ); SfxItemSet aSet( GetEditWin()->GetView().GetWrtShell().GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC, RES_BREAK, RES_BREAK, - NULL ); + nullptr ); aSet.Put( SvxFormatBreakItem( SVX_BREAK_NONE, RES_BREAK ) ); - aSet.Put( SwFormatPageDesc( NULL ) ); + aSet.Put( SwFormatPageDesc( nullptr ) ); SwPaM aPaM( *pNd ); pNd->GetDoc()->getIDocumentContentOperations().InsertItemSet( aPaM, aSet ); - pNd->GetDoc()->GetIDocumentUndoRedo( ).EndUndo( UNDO_UI_DELETE_PAGE_BREAK, NULL ); + pNd->GetDoc()->GetIDocumentUndoRedo( ).EndUndo( UNDO_UI_DELETE_PAGE_BREAK, nullptr ); } } break; @@ -322,7 +322,7 @@ void SwPageBreakWin::Activate( ) void SwPageBreakWin::UpdatePosition( const Point* pEvtPt ) { - if ( pEvtPt != NULL ) + if ( pEvtPt != nullptr ) { if ( pEvtPt == m_pMousePt ) return; diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 5d0408a32ce3..a80ab3614133 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -468,8 +468,8 @@ bool SwPostItMgr::CalcRects() const SwTextAnnotationField* pTextAnnotationField = dynamic_cast< const SwTextAnnotationField* >( pItem->GetFormatField().GetTextField() ); const ::sw::mark::IMark* pAnnotationMark = - pTextAnnotationField != NULL ? pTextAnnotationField->GetAnnotationMark() : NULL; - if ( pAnnotationMark != NULL ) + pTextAnnotationField != nullptr ? pTextAnnotationField->GetAnnotationMark() : nullptr; + if ( pAnnotationMark != nullptr ) { pItem->mLayoutStatus = SwPostItHelper::getLayoutInfos( @@ -1265,7 +1265,7 @@ class FieldDocWatchingStack : public SfxListener if (pHint->Which() == SwFormatFieldHintWhich::REMOVED) { const SwFormatField* pField = pHint->GetField(); - bAllInvalidated = pField == NULL; + bAllInvalidated = pField == nullptr; if (!bAllInvalidated && m_rFilter(pField)) { EndListening(const_cast<SwFormatField&>(*pField)); @@ -1275,7 +1275,7 @@ class FieldDocWatchingStack : public SfxListener else if (pHint->Which() == SwFormatFieldHintWhich::INSERTED) { const SwFormatField* pField = pHint->GetField(); - bAllInvalidated = pField == NULL; + bAllInvalidated = pField == nullptr; if (!bAllInvalidated && m_rFilter(pField)) { StartListening(const_cast<SwFormatField&>(*pField)); @@ -1330,7 +1330,7 @@ public: const SwFormatField* pop() { if (v.empty()) - return NULL; + return nullptr; const SwFormatField* p = v.back(); EndListening(const_cast<SwFormatField&>(*p)); v.pop_back(); @@ -1510,7 +1510,7 @@ SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) co if ( (*i)->GetBroadCaster() == pBroadcaster) return (*i)->pPostIt; } - return NULL; + return nullptr; } sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItField* pField) const @@ -1520,7 +1520,7 @@ sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItFie if ( (*i)->GetFormatField().GetField() == pField ) return dynamic_cast<sw::annotation::SwAnnotationWin*>((*i)->pPostIt.get()); } - return NULL; + return nullptr; } SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection, @@ -1537,7 +1537,7 @@ SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection, { if ( iNextPostIt == mvPostItFields.begin() ) { - return NULL; + return nullptr; } --iNextPostIt; } @@ -1546,19 +1546,19 @@ SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection, ++iNextPostIt; if ( iNextPostIt == mvPostItFields.end() ) { - return NULL; + return nullptr; } } // lets quit, we are back at the beginning if ( (*iNextPostIt)->pPostIt == aPostIt) - return NULL; + return nullptr; return (*iNextPostIt)->pPostIt; } } - return NULL; + return nullptr; } else - return NULL; + return nullptr; } long SwPostItMgr::GetNextBorder() diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index f5c620a148d8..21f5a6e94d8a 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -107,9 +107,9 @@ SwSidebarWin::SwSidebarWin(SwEditWin& rEditWin, , mpMetadataAuthor(0) , mpMetadataDate(0) , mpMenuButton(0) - , mpAnchor(NULL) - , mpShadow(NULL) - , mpTextRangeOverlay(NULL) + , mpAnchor(nullptr) + , mpShadow(nullptr) + , mpTextRangeOverlay(nullptr) , mColorAnchor() , mColorDark() , mColorLight() @@ -193,13 +193,13 @@ void SwSidebarWin::dispose() RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); AnchorOverlayObject::DestroyAnchorOverlayObject( mpAnchor ); - mpAnchor = NULL; + mpAnchor = nullptr; ShadowOverlayObject::DestroyShadowOverlayObject( mpShadow ); - mpShadow = NULL; + mpShadow = nullptr; delete mpTextRangeOverlay; - mpTextRangeOverlay = NULL; + mpTextRangeOverlay = nullptr; mpMenuButton.disposeAndClear(); @@ -694,14 +694,14 @@ void SwSidebarWin::SetPosAndSize() { const SwTextAnnotationField* pTextAnnotationField = dynamic_cast< const SwTextAnnotationField* >( mrSidebarItem.GetFormatField().GetTextField() ); - if ( pTextAnnotationField != NULL - && pTextAnnotationField->GetpTextNode() != NULL ) + if ( pTextAnnotationField != nullptr + && pTextAnnotationField->GetpTextNode() != nullptr ) { SwTextNode* pTextNode = pTextAnnotationField->GetpTextNode(); SwNodes& rNds = pTextNode->GetDoc()->GetNodes(); SwContentNode* const pContentNd = rNds[mrSidebarItem.maLayoutInfo.mnStartNodeIdx]->GetContentNode(); SwPosition aStartPos( *pContentNd, mrSidebarItem.maLayoutInfo.mnStartContent ); - SwShellCrsr* pTmpCrsr = NULL; + SwShellCrsr* pTmpCrsr = nullptr; const bool bTableCrsrNeeded = pTextNode->FindTableBoxStartNode() != pContentNd->FindTableBoxStartNode(); if ( bTableCrsrNeeded ) { @@ -736,10 +736,10 @@ void SwSidebarWin::SetPosAndSize() } } - if ( mpTextRangeOverlay != NULL ) + if ( mpTextRangeOverlay != nullptr ) { mpTextRangeOverlay->setRanges( aAnnotationTextRanges ); - if ( mpAnchor != NULL && mpAnchor->getLineSolid() ) + if ( mpAnchor != nullptr && mpAnchor->getLineSolid() ) { mpTextRangeOverlay->ShowSolidBorder(); } @@ -762,7 +762,7 @@ void SwSidebarWin::SetPosAndSize() else { delete mpTextRangeOverlay; - mpTextRangeOverlay = NULL; + mpTextRangeOverlay = nullptr; } } @@ -1301,7 +1301,7 @@ void SwSidebarWin::SetViewState(ViewState bViewState) pWin->Anchor()->SetAnchorState(AS_END); } mpAnchor->setLineSolid(true); - if ( mpTextRangeOverlay != NULL ) + if ( mpTextRangeOverlay != nullptr ) { mpTextRangeOverlay->ShowSolidBorder(); } @@ -1315,7 +1315,7 @@ void SwSidebarWin::SetViewState(ViewState bViewState) if (mpAnchor) { mpAnchor->setLineSolid(true); - if ( mpTextRangeOverlay != NULL ) + if ( mpTextRangeOverlay != nullptr ) { mpTextRangeOverlay->ShowSolidBorder(); } @@ -1344,7 +1344,7 @@ void SwSidebarWin::SetViewState(ViewState bViewState) if ( pTopWinSelf != mrMgr.GetActiveSidebarWin() ) { pTopWinSelf->Anchor()->setLineSolid(false); - if ( pTopWinSelf->TextRange() != NULL ) + if ( pTopWinSelf->TextRange() != nullptr ) { pTopWinSelf->TextRange()->HideSolidBorder(); } @@ -1353,7 +1353,7 @@ void SwSidebarWin::SetViewState(ViewState bViewState) } } mpAnchor->setLineSolid(false); - if ( mpTextRangeOverlay != NULL ) + if ( mpTextRangeOverlay != nullptr ) { mpTextRangeOverlay->HideSolidBorder(); } diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 37084876810d..ce012a693a13 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -504,17 +504,17 @@ void SwTableShell::Execute(SfxRequest &rReq) // The attributes of all lines will be read and the strongest wins. const SvxBorderLine* pBorderLine; SvxBorderLine aBorderLine; - if ((pBorderLine = rCoreBox.GetTop()) != NULL) + if ((pBorderLine = rCoreBox.GetTop()) != nullptr) lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = rCoreBox.GetBottom()) != NULL) + if ((pBorderLine = rCoreBox.GetBottom()) != nullptr) lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = rCoreBox.GetLeft()) != NULL) + if ((pBorderLine = rCoreBox.GetLeft()) != nullptr) lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = rCoreBox.GetRight()) != NULL) + if ((pBorderLine = rCoreBox.GetRight()) != nullptr) lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = aCoreInfo.GetHori()) != NULL) + if ((pBorderLine = aCoreInfo.GetHori()) != nullptr) lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = aCoreInfo.GetVert()) != NULL) + if ((pBorderLine = aCoreInfo.GetVert()) != nullptr) lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine); if(aBorderLine.GetOutWidth() == 0) @@ -524,17 +524,17 @@ void SwTableShell::Execute(SfxRequest &rReq) } bool bLine = false; - if( aBox.GetTop() != NULL ) + if( aBox.GetTop() != nullptr ) aBox.SetLine(&aBorderLine, SvxBoxItemLine::TOP), bLine |= true; - if( aBox.GetBottom() != NULL ) + if( aBox.GetBottom() != nullptr ) aBox.SetLine(&aBorderLine, SvxBoxItemLine::BOTTOM), bLine |= true; - if( aBox.GetLeft() != NULL ) + if( aBox.GetLeft() != nullptr ) aBox.SetLine(&aBorderLine, SvxBoxItemLine::LEFT), bLine |= true; - if( aBox.GetRight() != NULL ) + if( aBox.GetRight() != nullptr ) aBox.SetLine(&aBorderLine, SvxBoxItemLine::RIGHT), bLine |= true; - if( aInfo.GetHori() != NULL ) + if( aInfo.GetHori() != nullptr ) aInfo.SetLine(&aBorderLine, SvxBoxInfoItemLine::HORI), bLine |= true; - if( aInfo.GetVert() != NULL ) + if( aInfo.GetVert() != nullptr ) aInfo.SetLine(&aBorderLine, SvxBoxInfoItemLine::VERT), bLine |= true; aCoreSet.Put( aBox ); |