[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 7 commits - desktop/qa editeng/source include/LibreOfficeKit include/sfx2 sc/inc sc/source sfx2/source sw/source
Marco Cecchetti (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 21 10:50:13 UTC 2019
desktop/qa/desktop_lib/test_desktop_lib.cxx | 32 ++++++++++++++++++++++
editeng/source/editeng/impedit.cxx | 6 +++-
include/LibreOfficeKit/LibreOfficeKitEnums.h | 7 ++++
include/sfx2/lokhelper.hxx | 2 -
sc/inc/global.hxx | 2 -
sc/source/core/data/global.cxx | 4 +-
sc/source/ui/drawfunc/drawsh.cxx | 2 -
sc/source/ui/drawfunc/drtxtob.cxx | 2 -
sc/source/ui/view/editsh.cxx | 2 -
sc/source/ui/view/gridwin2.cxx | 27 +++++++++++--------
sc/source/ui/view/tabview.cxx | 1
sfx2/source/view/lokhelper.cxx | 4 +-
sw/source/core/crsr/viscrs.cxx | 38 ++++++++++++++++++++++++---
sw/source/core/doc/docredln.cxx | 6 ++--
sw/source/uibase/uiview/view2.cxx | 34 ++++++++++++++++++++++--
15 files changed, 138 insertions(+), 31 deletions(-)
New commits:
commit 58f6e7a1af4f4bcc15bfd8e0646e22f288ab40f9
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Sun Oct 20 18:28:07 2019 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Mon Oct 21 12:42:57 2019 +0200
lok: on insert image rotate automatically based on EXIF orientation tag
Change-Id: I55e3e76d7d21c7d0796ec9355f01479232018c66
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index cbf9c177ce37..fefb9af1a8ed 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -232,9 +232,14 @@ ErrCode SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
const sal_uInt16 aRotation = aMetadata.getRotation();
if (aRotation != 0)
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/queryrotateintostandarddialog.ui"));
- std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryRotateIntoStandardOrientationDialog"));
- if (xQueryBox->run() == RET_YES)
+ bool bRotate = comphelper::LibreOfficeKit::isActive();
+ if (!bRotate)
+ {
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/queryrotateintostandarddialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryRotateIntoStandardOrientationDialog"));
+ bRotate = xQueryBox->run() == RET_YES;
+ }
+ if (bRotate)
{
GraphicNativeTransform aTransform( aGraphic );
aTransform.rotate( aRotation );
commit 15999be9f8569e9d2b2f531b34dbc2143f670406
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Sun Oct 20 13:38:56 2019 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Mon Oct 21 12:42:57 2019 +0200
lok: on calc spelling context menu didn't pop up
The problem has been fixed by making visible cell range syncronized
with client visible area
Change-Id: I632f8ef4d5e8fa227b55fcb0459ed89d10798134
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 3864714bb752..f676383a3bd3 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -595,6 +595,17 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
aFunc.UpdatePivotTable(*pDPObj, true, false);
}
+namespace {
+
+template <typename T>
+inline
+static T lcl_getValidValue(T value, T defvalue)
+{
+ return (value <0) ? defvalue : value;
+}
+
+} // anonymous namespace
+
bool ScGridWindow::UpdateVisibleRange()
{
SCCOL nPosX = 0;
@@ -604,17 +615,11 @@ bool ScGridWindow::UpdateVisibleRange()
if (comphelper::LibreOfficeKit::isActive())
{
- // entire table in the tiled rendering case
- SCTAB nTab = pViewData->GetTabNo();
- ScDocument const& rDoc = *pViewData->GetDocument();
- SCCOL nEndCol = 0;
- SCROW nEndRow = 0;
-
- if (rDoc.GetPrintArea(nTab, nEndCol, nEndRow, false))
- {
- nXRight = nEndCol;
- nYBottom = nEndRow;
- }
+ ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ nPosX = lcl_getValidValue(pViewShell->GetLOKStartHeaderCol(), nPosX);
+ nPosY = lcl_getValidValue(pViewShell->GetLOKStartHeaderRow(), nPosY);
+ nXRight = lcl_getValidValue(pViewShell->GetLOKEndHeaderCol(), nXRight);
+ nYBottom = lcl_getValidValue(pViewShell->GetLOKEndHeaderRow(), nYBottom);
}
else
{
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index f0bf950ff996..24794e50d57a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2785,6 +2785,7 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
tools::Rectangle aChangedArea = aNewVisArea.GetBoundRect();
if (!aChangedArea.IsEmpty())
{
+ UpdateVisibleRange();
UpdateFormulas(aChangedArea.Left(), aChangedArea.Top(), aChangedArea.Right(), aChangedArea.Bottom());
}
commit 56bf1745c7636bb04965e63de8d12bb867850391
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Sun Oct 20 13:18:51 2019 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Mon Oct 21 12:42:57 2019 +0200
lok: get spelling context menu on long press
This patch handles a new flag attached to the invalidate view cursor
message for informing the client when the text cursor is inside a
mispelled word.
This information is used for popping up the spelling context menu on a
long press event instead of the standard context menu for a selected
word.
Change-Id: I13fcbe53c83ca6eb56300a601734cdc3211e88a0
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index edf393485b87..8fd2c913c93e 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1118,7 +1118,11 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
}
else
{
- SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect);
+ // is cursor at a mispelled word ?
+ Reference< linguistic2::XSpellChecker1 > xSpeller( pEditEngine->pImpEditEngine->GetSpeller() );
+ bool bIsWrong = xSpeller.is() && IsWrongSpelledWord(aPaM, /*bMarkIfWrong*/ false);
+
+ SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect, bIsWrong);
mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
}
}
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 03c7085b9039..bfc9a12da9db 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -131,7 +131,12 @@ typedef enum
/**
* The size and/or the position of the visible cursor changed.
*
- * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
+ * Old format is the same as LOK_CALLBACK_INVALIDATE_TILES.
+ * New format is a JSON with 3 elements the 'viewId' element represented by
+ * an integer value, a 'rectangle' element in the format "x, y, width, height",
+ * and a 'mispelledWord' element represented by an integer value: '1' when
+ * a mispelled word is at the cursor position, '0' when the word is
+ * not mispelled.
*/
LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR = 1,
/**
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 80f92bb04414..ae796e0c7120 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -55,7 +55,7 @@ public:
/// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed.
static void notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload);
/// Emits a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, but tweaks it according to setOptionalFeatures() if needed.
- static void notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle);
+ static void notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle, bool bMispelledWord = false);
/// Notifies all views with the given type and payload.
static void notifyAllViews(int nType, const OString& rPayload);
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 3b05bd1dd696..e1c1b42a0e53 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -254,13 +254,13 @@ void SfxLokHelper::notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc
}
}
-void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle)
+void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle, bool bMispelledWord)
{
OString sPayload;
if (comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation())
{
sPayload = OString("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView()) +
- "\", \"rectangle\": \"" + rRectangle + "\" }";
+ "\", \"rectangle\": \"" + rRectangle + "\", \"mispelledWord\": \"" + OString::number(bMispelledWord) + "\" }";
}
else
{
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 672184d863a6..2b14ffa27093 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -58,6 +58,7 @@
#include <comphelper/string.hxx>
#include <paintfrm.hxx>
#include <PostItMgr.hxx>
+#include <SwGrammarMarkUp.hxx>
// Here static members are defined. They will get changed on alteration of the
// MapMode. This is done so that on ShowCursor the same size does not have to be
@@ -186,7 +187,8 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell)
m_aTextCursor.SetPos( aRect.Pos() );
bool bPostItActive = false;
- if (auto pView = dynamic_cast<SwView*>(m_pCursorShell->GetSfxViewShell()))
+ SwView* pView = dynamic_cast<SwView*>(m_pCursorShell->GetSfxViewShell());
+ if (pView)
{
if (SwPostItMgr* pPostItMgr = pView->GetPostItMgr())
bPostItActive = pPostItMgr->GetActiveSidebarWin() != nullptr;
@@ -209,18 +211,48 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell)
// notify about the cursor position & size
tools::Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height());
OString sRect = aSVRect.toString();
+
+ // is cursor at a mispelled word ?
+ bool bIsWrong = false;
+ if (pView)
+ {
+ const SwViewOption* pVOpt = pView->GetWrtShell().GetViewOptions();
+ if(pVOpt && pVOpt->IsOnlineSpell())
+ {
+ SwPaM* pCursor = m_pCursorShell->GetCursor();
+ SwPosition aPos(*pCursor->GetPoint());
+ Point aPt = aRect.Pos();
+ SwCursorMoveState eTmpState(MV_SETONLYTEXT);
+ SwTextNode *pNode = nullptr;
+ if (m_pCursorShell->GetLayout()->GetCursorOfst(&aPos, aPt, &eTmpState))
+ pNode = aPos.nNode.GetNode().GetTextNode();
+ if (pNode && !pNode->IsInProtectSect())
+ {
+ sal_Int32 nBegin = aPos.nContent.GetIndex();
+ sal_Int32 nLen = 1;
+
+ SwWrongList *pWrong = nullptr;
+ pWrong = pNode->GetWrong();
+ if (!pWrong)
+ pWrong = pNode->GetGrammarCheck();
+ if (pWrong)
+ bIsWrong = pWrong->InWrongWord(nBegin,nLen) && !pNode->IsSymbolAt(nBegin);
+ }
+ }
+ }
+
if (pViewShell)
{
if (pViewShell == m_pCursorShell->GetSfxViewShell())
{
- SfxLokHelper::notifyVisCursorInvalidation(pViewShell, sRect);
+ SfxLokHelper::notifyVisCursorInvalidation(pViewShell, sRect, bIsWrong);
}
else
SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
}
else
{
- SfxLokHelper::notifyVisCursorInvalidation(m_pCursorShell->GetSfxViewShell(), sRect);
+ SfxLokHelper::notifyVisCursorInvalidation(m_pCursorShell->GetSfxViewShell(), sRect, bIsWrong);
SfxLokHelper::notifyOtherViews(m_pCursorShell->GetSfxViewShell(), LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
}
}
commit 98ca6029423eaa19cd4f163da49410310cdea8ae
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Sun Oct 20 12:57:48 2019 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Mon Oct 21 12:42:57 2019 +0200
lok: unit test dialog text input field
Change-Id: I989086e12ada7c8606f5bfe1534d33360d14031e
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 760831fabb4d..f36f03c33814 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -144,6 +144,7 @@ public:
void testComplexSelection();
void testDialogPaste();
void testCalcSaveAs();
+ void testDialogInput();
void testABI();
CPPUNIT_TEST_SUITE(DesktopLOKTest);
@@ -198,6 +199,7 @@ public:
CPPUNIT_TEST(testComplexSelection);
CPPUNIT_TEST(testDialogPaste);
CPPUNIT_TEST(testCalcSaveAs);
+ CPPUNIT_TEST(testDialogInput);
CPPUNIT_TEST(testABI);
CPPUNIT_TEST_SUITE_END();
@@ -1702,6 +1704,36 @@ void DesktopLOKTest::testPartInInvalidation()
}
}
+void DesktopLOKTest::testDialogInput()
+{
+ comphelper::LibreOfficeKit::setActive();
+ LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
+ pDocument->pClass->postUnoCommand(pDocument, ".uno:HyperlinkDialog", nullptr, false);
+ Scheduler::ProcessEventsToIdle();
+
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ pViewShell->GetViewFrame()->GetBindings().Update();
+
+ VclPtr<vcl::Window> pWindow(Application::GetActiveTopWindow());
+ CPPUNIT_ASSERT(pWindow);
+
+ Control* pCtrlFocused = GetFocusControl(pWindow.get());
+ CPPUNIT_ASSERT(pCtrlFocused);
+ ComboBox* pCtrlURL = dynamic_cast<ComboBox*>(pCtrlFocused);
+ CPPUNIT_ASSERT(pCtrlURL);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), pCtrlURL->GetText());
+
+ vcl::LOKWindowId nDialogId = pWindow->GetLOKWindowId();
+ pDocument->pClass->postWindowExtTextInputEvent(pDocument, nDialogId, LOK_EXT_TEXTINPUT, "wiki.");
+ pDocument->pClass->postWindowExtTextInputEvent(pDocument, nDialogId, LOK_EXT_TEXTINPUT_END, "wiki.");
+ pDocument->pClass->removeTextContext(pDocument, nDialogId, 1, 0);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(OUString("wiki"), pCtrlURL->GetText());
+
+ static_cast<SystemWindow*>(pWindow.get())->Close();
+ Scheduler::ProcessEventsToIdle();
+}
+
void DesktopLOKTest::testInput()
{
// Load a Writer document, enable change recording and press a key.
commit 021caaa7353ced19e4215c01faf98dd2fe4cb9ad
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Sun Oct 20 12:33:07 2019 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Mon Oct 21 12:42:57 2019 +0200
sc: open hyperlinks when requested through context menu
Change-Id: Ied3e70d78094287a6797be559538a20d7bba9580
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index eb737f954790..cb0c522e30ad 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -565,7 +565,7 @@ public:
SC_DLLPUBLIC static ScUserList* GetUserList();
static void SetUserList( const ScUserList* pNewList );
/// Open the specified URL.
- static void OpenURL(const OUString& rURL, const OUString& rTarget);
+ static void OpenURL(const OUString& rURL, const OUString& rTarget, bool bBypassCtrlClickSecurity = false);
SC_DLLPUBLIC static OUString GetAbsDocName( const OUString& rFileName,
const SfxObjectShell* pShell );
SC_DLLPUBLIC static OUString GetDocTabName( const OUString& rFileName,
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 6a59a30e56b5..aed73d93b3bd 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -780,7 +780,7 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
return false;
}
-void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget)
+void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, bool bBypassCtrlClickSecurity)
{
// OpenURL is always called in the GridWindow by mouse clicks in some way or another.
// That's why pScActiveViewShell and nScClickMouseModifier are correct.
@@ -794,7 +794,7 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget)
// ctrl+click security option was disabled, link should not open
return;
}
- else if( ! bCtrlClickHappened && bCtrlClickSecOption )
+ else if( !bBypassCtrlClickSecurity && ! bCtrlClickHappened && bCtrlClickSecOption )
{
// ctrl+click did not happen; only click happened maybe with some
// other key combo. and security option is set, so return
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index c13001d9e294..f4aee82d783f 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -254,7 +254,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( pInfo && !pInfo->GetHlink().isEmpty() )
- ScGlobal::OpenURL( pInfo->GetHlink(), OUString() );
+ ScGlobal::OpenURL( pInfo->GetHlink(), OUString(), /*BypassCtrlClickSecurity:*/ true );
}
break;
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 242c3fc57a75..771bac8ceb19 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -318,7 +318,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SvxFieldData* pField = pFieldItem->GetField();
if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField))
{
- ScGlobal::OpenURL(pURLField->GetURL(), pURLField->GetTargetFrame());
+ ScGlobal::OpenURL(pURLField->GetURL(), pURLField->GetTargetFrame(), /*BypassCtrlClickSecurity:*/ true);
}
}
break;
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index ecef90136b04..f3c7fa8164af 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -619,7 +619,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
const SvxURLField* pURLField = GetURLField();
if ( pURLField )
- ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame() );
+ ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame(), /*BypassCtrlClickSecurity:*/ true );
return;
}
commit 6d204dc027b9880a9e0a8b449de600073b4b9d64
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Sun Oct 6 22:11:30 2019 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Mon Oct 21 12:42:57 2019 +0200
lok: change-annotations: fix not unique id and multiline changes
When a redline was splitted we ended up with 2 redlines with the same
id (note that this id is used only by lok clients).
When a redline is a multiline, the generated rectangles was wrong.
Change-Id: Iaa7599ab16f4c8939606b1da0dcddb4aac6e983f
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 5656f35fb3d1..6c8ef90bbe42 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -385,8 +385,8 @@ void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, SwRangeRe
{
SwShellCursor aCursor(pView->GetWrtShell(), *pStartPos);
aCursor.SetMark();
- aCursor.GetMark()->nNode = *pContentNd;
- aCursor.GetMark()->nContent.Assign(pContentNd, pEndPos->nContent.GetIndex());
+ aCursor.GetMark()->nNode = pEndPos->nNode;
+ aCursor.GetMark()->nContent = pEndPos->nContent;
aCursor.FillRects();
@@ -1069,7 +1069,7 @@ SwRangeRedline::SwRangeRedline( const SwRangeRedline& rCpy )
: SwPaM( *rCpy.GetMark(), *rCpy.GetPoint() ),
m_pRedlineData( new SwRedlineData( *rCpy.m_pRedlineData )),
m_pContentSect( nullptr ),
- m_nId( rCpy.m_nId )
+ m_nId( m_nLastId++ )
{
m_bDelLastPara = false;
m_bIsVisible = true;
commit dde389dd0fa3358faef09158245d41bbacd60d6e
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Sun Oct 6 22:06:28 2019 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Mon Oct 21 12:42:56 2019 +0200
lok: change-annotation navigation through prev/next command
Change-Id: Id62a84e0db24b4d317a5503d468f2e0caf13424b
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 0985ab6b207b..cbf9c177ce37 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -123,6 +123,8 @@
#include <ndtxt.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
@@ -745,7 +747,18 @@ void SwView::Execute(SfxRequest &rReq)
pNext = m_pWrtShell->SelNextRedline();
if (pNext)
+ {
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OString aPayload(".uno:CurrentTrackedChangeId=");
+ sal_uInt32 nRedlineId = pNext->GetId();
+ aPayload += OString::number(nRedlineId);
+ libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
+ }
+
m_pWrtShell->SetInSelect();
+ }
+
}
break;
@@ -754,7 +767,17 @@ void SwView::Execute(SfxRequest &rReq)
const SwRangeRedline *pPrev = m_pWrtShell->SelPrevRedline();
if (pPrev)
+ {
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OString aPayload(".uno:CurrentTrackedChangeId=");
+ sal_uInt32 nRedlineId = pPrev->GetId();
+ aPayload += OString::number(nRedlineId);
+ libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
+ }
+
m_pWrtShell->SetInSelect();
+ }
}
break;
More information about the Libreoffice-commits
mailing list