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 | |
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')
-rw-r--r-- | sw/source/core/inc/frame.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/inc/pagefrm.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/inc/swcache.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/calcmove.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/findfrm.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/layout/layact.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 44 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 17 | ||||
-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 |
13 files changed, 100 insertions, 100 deletions
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 251bc15e9d82..943503dce718 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -314,6 +314,8 @@ class SW_DLLPUBLIC SwFrm: public SwClient, public SfxBroadcaster const SwLayoutFrm* ImplGetNextLayoutLeaf( bool bFwd ) const; + SwPageFrm* ImplFindPageFrm(); + protected: SwSortedObjs* mpDrawObjs; // draw objects, can be 0 @@ -582,12 +584,12 @@ public: SwFrm *GetPrev() { return mpPrev; } SwLayoutFrm *GetUpper() { return mpUpper; } SwRootFrm *getRootFrm(){ return mpRoot; } - SwPageFrm *FindPageFrm(); + SwPageFrm *FindPageFrm() { return IsPageFrm() ? reinterpret_cast<SwPageFrm*>(this) : ImplFindPageFrm(); } SwFrm *FindColFrm(); SwRowFrm *FindRowFrm(); - SwFootnoteBossFrm *FindFootnoteBossFrm( bool bFootnotes = false ); + SwFootnoteBossFrm *FindFootnoteBossFrm( bool bFootnotes = false ); SwTabFrm *ImplFindTabFrm(); - SwFootnoteFrm *ImplFindFootnoteFrm(); + SwFootnoteFrm *ImplFindFootnoteFrm(); SwFlyFrm *ImplFindFlyFrm(); SwSectionFrm *ImplFindSctFrm(); SwFrm *FindFooterOrHeader(); diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 2979491b1aff..2c51f2bdc3a8 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -54,12 +54,12 @@ class SwPageFrm: public SwFootnoteBossFrm sal_uInt16 m_nPhyPageNum; // Physical page number - bool m_bInvalidContent :1; + bool m_bInvalidContent :1; bool m_bInvalidLayout :1; - bool m_bInvalidFlyContent :1; + bool m_bInvalidFlyContent :1; bool m_bInvalidFlyLayout :1; bool m_bInvalidFlyInCnt :1; - bool m_bFootnotePage :1; // This Page is for document end footnotes + bool m_bFootnotePage :1; // This Page is for document end footnotes bool m_bEmptyPage :1; // This Page is an explicitly empty page bool m_bEndNotePage :1; // 'Footnote page' for end notes bool m_bInvalidSpelling :1; // We need online spelling diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx index cab91929d1de..4f38ecabb8b4 100644 --- a/sw/source/core/inc/swcache.hxx +++ b/sw/source/core/inc/swcache.hxx @@ -24,7 +24,7 @@ * These objects are created (using new) in cache access classes; they are * destroyed by the cache. * - * One can access these objects by array index or by searching in the array + * One can access these objects by array index or by searching in the array. * If you access it by index, managing the index is the responsibility of * the cache user. * diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 9de4a2ff5e3c..5b32b56acae8 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -254,7 +254,7 @@ void SwFrm::PrepareMake(vcl::RenderContext* pRenderContext) const bool bTab = IsTabFrm(); bool bNoSect = IsInSct(); bool bOldTabLock = false, bFoll = false; - SwFlowFrm* pThis = bCnt ? static_cast<SwContentFrm*>(this) : NULL; + SwFlowFrm* pThis = bCnt ? static_cast<SwContentFrm*>(this) : nullptr; if ( bTab ) { diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index ced90ecc8cf1..8936e25ea4a2 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -393,7 +393,7 @@ const SwContentFrm* SwContentFrm::ImplGetNextContentFrm( bool bFwd ) const return pContentFrm; } -SwPageFrm* SwFrm::FindPageFrm() +SwPageFrm* SwFrm::ImplFindPageFrm() { SwFrm *pRet = this; while ( pRet && !pRet->IsPageFrm() ) @@ -403,13 +403,13 @@ SwPageFrm* SwFrm::FindPageFrm() else if ( pRet->IsFlyFrm() ) { // #i28701# - use new method <GetPageFrm()> - if ( static_cast<SwFlyFrm*>(pRet)->GetPageFrm() ) - pRet = static_cast<SwFlyFrm*>(pRet)->GetPageFrm(); - else - pRet = static_cast<SwFlyFrm*>(pRet)->AnchorFrm(); + const auto pFly(static_cast<SwFlyFrm*>(pRet)); + pRet = pFly->GetPageFrm(); + if (pRet == nullptr) + pRet = pFly->AnchorFrm(); } else - return 0; + return nullptr; } return static_cast<SwPageFrm*>(pRet); } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 989ec2f29257..e9bedbafa2af 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -483,7 +483,8 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) ::SetProgressState( nPercentPageNum, pImp->GetShell()->GetDoc()->GetDocShell()); } pOptTab = 0; - // No Shortcut for Idle or CalcLayout + + // No Shortcut for Idle or CalcLayout if ( !IsIdle() && !IsComplete() && IsShortCut( pPage ) ) { pRoot->DeleteEmptySct(); diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 3c43775dcffe..6d698bdff1b2 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1754,44 +1754,41 @@ static void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset ); static void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset ) { - SwSortedObjs* pSortedObj = 0; const bool bPage = pFrm->IsPageFrm(); + const SwSortedObjs* pSortedObj = bPage + ? static_cast<SwPageFrm*>(pFrm)->GetSortedObjs() + : pFrm->GetDrawObjs(); + if (pSortedObj == nullptr) + return; - if ( bPage ) - pSortedObj = static_cast<SwPageFrm*>(pFrm)->GetSortedObjs(); - else - pSortedObj = pFrm->GetDrawObjs(); - - for ( size_t i = 0; pSortedObj && i < pSortedObj->size(); ++i) + for (SwAnchoredObject* pAnchoredObj : *pSortedObj) { - SwAnchoredObject* pAnchoredObj = (*pSortedObj)[i]; - const SwFrameFormat& rObjFormat = pAnchoredObj->GetFrameFormat(); const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor(); // all except from the as character anchored objects are moved // when processing the page frame: - const bool bAsChar = (rAnchor.GetAnchorId() == FLY_AS_CHAR); - if ( !bPage && !bAsChar ) + if ( !bPage && (rAnchor.GetAnchorId() != FLY_AS_CHAR) ) continue; SwObjPositioningInProgress aPosInProgress( *pAnchoredObj ); - if ( dynamic_cast< const SwFlyFrm *>( pAnchoredObj ) != nullptr ) + if ( dynamic_cast< const SwFlyFrm *>( pAnchoredObj ) != nullptr ) { SwFlyFrm* pFlyFrm( static_cast<SwFlyFrm*>(pAnchoredObj) ); lcl_MoveAllLowers( pFlyFrm, rOffset ); pFlyFrm->NotifyDrawObj(); // --> let the active embedded object be moved - if ( pFlyFrm->Lower() ) + SwFrm* pLower = pFlyFrm->Lower(); + if ( pLower ) { - if ( pFlyFrm->Lower()->IsNoTextFrm() ) + if ( pLower->IsNoTextFrm() ) { - SwContentFrm* pContentFrm = static_cast<SwContentFrm*>(pFlyFrm->Lower()); - SwRootFrm* pRoot = pFlyFrm->Lower()->getRootFrm(); - SwViewShell *pSh = pRoot ? pRoot->GetCurrShell() : 0; + SwRootFrm* pRoot = pLower->getRootFrm(); + SwViewShell *pSh = pRoot ? pRoot->GetCurrShell() : nullptr; if ( pSh ) { + SwContentFrm* pContentFrm = static_cast<SwContentFrm*>(pLower); SwOLENode* pNode = pContentFrm->GetNode()->GetOLENode(); if ( pNode ) { @@ -1815,11 +1812,10 @@ static void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset ) SwAnchoredDrawObject* pAnchoredDrawObj( static_cast<SwAnchoredDrawObject*>(pAnchoredObj) ); // don't touch objects that are not yet positioned: - const bool bNotYetPositioned = pAnchoredDrawObj->NotYetPositioned(); - if ( bNotYetPositioned ) + if ( pAnchoredDrawObj->NotYetPositioned() ) continue; - const Point aCurrAnchorPos = pAnchoredDrawObj->GetDrawObj()->GetAnchorPos(); + const Point& aCurrAnchorPos = pAnchoredDrawObj->GetDrawObj()->GetAnchorPos(); const Point aNewAnchorPos( ( aCurrAnchorPos + rOffset ) ); pAnchoredDrawObj->DrawObj()->SetAnchorPos( aNewAnchorPos ); pAnchoredDrawObj->SetLastObjRect( pAnchoredDrawObj->GetObjRect().SVRect() ); @@ -1874,12 +1870,13 @@ static void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset ) // Calculate how the pages have to be positioned void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVisArea ) { - vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : 0; + SwViewShell* pSh = GetCurrShell(); + vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : nullptr; // #i91432# // No calculation of page positions, if only an empty page is present. // This situation occurs when <SwRootFrm> instance is in construction // and the document contains only left pages. - if ( Lower()->GetNext() == 0 && + if ( Lower()->GetNext() == nullptr && static_cast<SwPageFrm*>(Lower())->IsEmptyPage() ) { return; @@ -1922,7 +1919,6 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi const long nBorder = Frm().Pos().getX(); const long nVisWidth = mnViewWidth - 2 * nBorder; - SwViewShell* pSh = GetCurrShell(); const long nGapBetweenPages = pViewOpt ? pViewOpt->GetGapBetweenPages() : (pSh ? pSh->GetViewOptions()->GetGapBetweenPages() : SwViewOption::GetDefGapBetweenPages()); @@ -1950,7 +1946,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi bool bPageChanged = false; const bool bRTL = !IsLeftToRightViewLayout(); - const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( GetCurrShell() ); + const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( pSh ); while ( pPageFrm ) { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 3f6acc2547d6..b92c6e884839 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -6411,7 +6411,7 @@ SwRect SwPageFrm::GetBoundRect(OutputDevice* pOutputDevice) const /*static*/ SwTwips SwPageFrm::GetSidebarBorderWidth( const SwViewShell* _pViewShell ) { - const SwPostItMgr* pPostItMgr = _pViewShell ? _pViewShell->GetPostItMgr() : 0; + const SwPostItMgr* pPostItMgr = _pViewShell ? _pViewShell->GetPostItMgr() : nullptr; const SwTwips nRet = pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ? pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() : 0; return nRet; } diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index b767f8b19828..fbf706e7f331 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -58,11 +58,11 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) : mbIfAccTableShouldDisposing( false ), //A member to identify if the acc table should dispose mbInDtor(false), mnFrmId( SwFrm::mnLastFrmId++ ), - mpRoot( pSib ? pSib->getRootFrm() : 0 ), - mpUpper( 0 ), - mpNext( 0 ), - mpPrev( 0 ), - mpDrawObjs( 0 ), + mpRoot( pSib ? pSib->getRootFrm() : nullptr ), + mpUpper(nullptr), + mpNext(nullptr), + mpPrev(nullptr), + mpDrawObjs(nullptr), mnFrmType(0), mbInfBody( false ), mbInfTab ( false ), @@ -2157,11 +2157,12 @@ TYPEINIT1(SwLayoutFrm,SwFrm); SwTwips SwLayoutFrm::InnerHeight() const { - if( !Lower() ) - return 0; - SwTwips nRet = 0; const SwFrm* pCnt = Lower(); + if (!pCnt) + return 0; + SWRECTFN( this ) + SwTwips nRet = 0; if( pCnt->IsColumnFrm() || pCnt->IsCellFrm() ) { do 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 ); |