diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-03-14 15:27:42 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-03-23 20:30:55 +0530 |
commit | c0166f03bf3ab64682b7a12b519551acb8e80726 (patch) | |
tree | 401c0fe3956e2c5c0cac6b459a909ff1a6efad4d /sw/source/core/doc | |
parent | d5b15909bf65e456920e286bee1801c3916f19fc (diff) |
sw lok: Notify when redline position is changed + unit test
Make RedlineNotification function a static member of SwRedlineTable
class
Reviewed-on: https://gerrit.libreoffice.org/35177
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 1eb69f6b9c78b19d3944c90c17ff8d498affc316)
Conflicts:
sw/source/core/doc/docredln.cxx
Change-Id: Ifbd6014198838b1106e873c9563d215e95b3572d
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 28e981704df8..1a80bccab96a 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -60,8 +60,6 @@ using namespace com::sun::star; -enum class RedlineNotification { Add, Remove, Modify }; - #ifdef DBG_UTIL void sw_DebugRedline( const SwDoc* pDoc ) @@ -304,7 +302,7 @@ bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& } /// Emits LOK notification about one addition / removal of a redline item. -static void lcl_RedlineNotification(RedlineNotification nType, size_t nPos, SwRangeRedline* pRedline) +void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, size_t nPos, SwRangeRedline* pRedline) { if (!comphelper::LibreOfficeKit::isActive()) return; @@ -362,8 +360,8 @@ bool SwRedlineTable::Insert( SwRangeRedline* p ) if( p->HasValidRange() ) { std::pair<vector_type::const_iterator, bool> rv = maVector.insert( p ); - size_t nP = rv.first - begin(); - lcl_RedlineNotification(RedlineNotification::Add, nP, p); + size_type nP = rv.first - begin(); + LOKRedlineNotification(RedlineNotification::Add, nP, p); p->CallDisplayFunc(nP); return rv.second; } @@ -523,7 +521,7 @@ bool SwRedlineTable::Remove( const SwRangeRedline* p ) void SwRedlineTable::Remove( sal_uInt16 nP ) { - lcl_RedlineNotification(RedlineNotification::Remove, nP, maVector[nP]); + LOKRedlineNotification(RedlineNotification::Remove, nP, maVector[nP]); SwDoc* pDoc = nullptr; if( !nP && 1 == size() ) pDoc = maVector.front()->GetDoc(); @@ -550,7 +548,7 @@ void SwRedlineTable::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) size_t nCount = 0; for( vector_type::const_iterator it = maVector.begin() + nP; it != maVector.begin() + nP + nL; ++it ) { - lcl_RedlineNotification(RedlineNotification::Remove, nP + nCount, *it); + LOKRedlineNotification(RedlineNotification::Remove, nP + nCount, *it); delete *it; ++nCount; } @@ -997,7 +995,7 @@ void SwRangeRedline::MaybeNotifyModification() { if (rRedTable[i] == this) { - lcl_RedlineNotification(RedlineNotification::Modify, i, this); + SwRedlineTable::LOKRedlineNotification(RedlineNotification::Modify, i, this); break; } } |