From 6ee7900b587d4cba6f6a07548f96adcc42f64eaf Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Thu, 26 Feb 2015 13:00:57 +0100 Subject: [PATCH] more constness Change-Id: I5bbddaebb6cf820afced89e634814f485ec38859 --- sw/source/core/frmedt/fetab.cxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 73d086204110..f38502cd53a6 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -83,20 +83,15 @@ const SwFrm *pRowCacheLastCellFrm = 0; class TblWait { - ::std::unique_ptr m_pWait; + const ::std::unique_ptr m_pWait; + bool ShouldWait(size_t nCnt, SwFrm *pFrm, size_t nCnt2) + { return 20 < nCnt || 20 < nCnt2 || (pFrm && 20 < pFrm->ImplFindTabFrm()->GetTable()->GetTabLines().size()); } public: - TblWait(size_t nCnt, SwFrm *pFrm, SwDocShell &rDocShell, size_t nCnt2 = 0); + TblWait(size_t nCnt, SwFrm *pFrm, SwDocShell &rDocShell, size_t nCnt2 = 0) + : m_pWait( ShouldWait(nCnt, pFrm, nCnt2) ? ::std::unique_ptr(new SwWait( rDocShell, true )) : nullptr ) + { } }; -TblWait::TblWait(size_t const nCnt, SwFrm *pFrm, SwDocShell &rDocShell, size_t const nCnt2): - m_pWait( nullptr ) -{ - const bool bWait = 20 < nCnt || 20 < nCnt2 || (pFrm && - 20 < pFrm->ImplFindTabFrm()->GetTable()->GetTabLines().size()); - if( bWait ) - m_pWait = ::std::unique_ptr(new SwWait( rDocShell, true )); -} - void SwFEShell::ParkCursorInTab() { SwCursor * pSwCrsr = GetSwCrsr();