diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-08-01 02:13:47 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-08-01 02:23:32 +0200 |
commit | 512b782cf466a19ed77d818fa660e1a0dc74fc35 (patch) | |
tree | 905c5ae71d2556a8658030a97c3aa083c016798f /sw/source/core/crsr/viscrs.cxx | |
parent | 75a84417af72ce0f540e7a5063a81a1e57a5c6a1 (diff) |
LOK: Implement parts for Writer too.
In Writer, the meaning of 'parts' is a bit different than in Calc or Impress.
In Writer, the parts mean pages, and the document does not give a completely
different view, the cursor just jumps to the given page.
It is up to the client to follow the cursor appropriately to have the desired
effect.
Change-Id: I56b3264e0340cd639bdabfa92b74b52bd1f391a5
Diffstat (limited to 'sw/source/core/crsr/viscrs.cxx')
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 44805c67e402..6ff459641d94 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -67,6 +67,7 @@ MapMode* SwSelPaintRects::s_pMapMode = 0; // Starting from here: classes / methods for the non-text-cursor SwVisCrsr::SwVisCrsr( const SwCrsrShell * pCShell ) : m_pCrsrShell( pCShell ) + , m_nPageLastTime(0) { pCShell->GetWin()->SetCursor( &m_aTextCrsr ); m_bIsVisible = m_aTextCrsr.IsVisible(); @@ -179,6 +180,17 @@ void SwVisCrsr::_SetPosAndShow() if (m_pCrsrShell->isTiledRendering()) { + // notify about page number change (if that happened) + sal_uInt16 nPage, nVirtPage; + const_cast<SwCrsrShell*>(m_pCrsrShell)->GetPageNum(nPage, nVirtPage); + if (nPage != m_nPageLastTime) + { + m_nPageLastTime = nPage; + OString aPayload = OString::number(nPage - 1); + m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + } + + // notify about the cursor position & size Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height()); OString sRect = aSVRect.toString(); m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); |