desktop/qa/desktop_lib/test_desktop_lib.cxx |   39 +++++++++++++++++++++++++++-
 editeng/source/editeng/editview.cxx         |    5 +++
 editeng/source/outliner/outlvw.cxx          |    5 +++
 include/editeng/editview.hxx                |    1 
 include/editeng/outliner.hxx                |    1 
 sc/source/ui/docshell/docfunc.cxx           |   29 ++++++++++----------
 sfx2/source/view/lokhelper.cxx              |   12 ++++++--
 sw/source/uibase/docvw/AnnotationWin2.cxx   |   12 ++++----
 tools/source/misc/json_writer.cxx           |   21 +++++++++++++++
 uui/source/secmacrowarnings.cxx             |   23 ++++++++++++++--
 uui/source/secmacrowarnings.hxx             |    2 +
 11 files changed, 123 insertions(+), 27 deletions(-)

New commits:
commit 0dda8ba9cdc7fe6806d5ebca98cc628ec3d32db3
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Mar 5 06:45:45 2021 -0400
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:33 2021 +0100

    lok: show only the filename of the Macro Security dialog
    
    Apply the patch for desktop case too.
    
    Change-Id: Ia4cf6d2cefd0e02e11e48ca017f8af9f81600b16
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112003
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113688
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 932c4723ab21..7c853cf2f8e0 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -19,8 +19,6 @@
 
 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
-#include <comphelper/documentconstants.hxx>
-#include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <vcl/svapp.hxx>
 #include <osl/file.hxx>
@@ -29,8 +27,6 @@
 #include <tools/debug.hxx>
 #include <unotools/securityoptions.hxx>
 #include <tools/urlobj.hxx>
-#include <unotools/resmgr.hxx>
-#include <com/sun/star/security/NoPasswordException.hpp>
 
 using namespace ::com::sun::star::security;
 
@@ -92,15 +88,11 @@ IMPL_STATIC_LINK_NOARG(MacroWarning, InstallLOKNotifierHdl, 
void*, vcl::ILibreOf
 
 void MacroWarning::SetDocumentURL( const OUString& rDocURL )
 {
-    OUString aAbbreviatedPath;
-    if (comphelper::LibreOfficeKit::isActive())
-    {
-        osl::FileBase::getFileURLFromSystemPath(rDocURL, aAbbreviatedPath);
-        aAbbreviatedPath = INetURLObject(aAbbreviatedPath).GetLastName();
-    }
-    else
-        osl_abbreviateSystemPath(rDocURL.pData, &aAbbreviatedPath.pData, 50, 
nullptr);
-    m_xDialog->set_primary_text(aAbbreviatedPath);
+    OUString aPath;
+
+    osl::FileBase::getFileURLFromSystemPath(rDocURL, aPath);
+    aPath = INetURLObject(aPath).GetLastName();
+    m_xDialog->set_primary_text(aPath);
 }
 
 IMPL_LINK_NOARG(MacroWarning, ViewSignsBtnHdl, weld::Button&, void)
commit 8640c1249b675bd6bd3489e901234ac04c37bd7d
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Mar 3 18:17:31 2021 -0400
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:33 2021 +0100

    lok: strip directory and suffix from filenames
    
    The Macro Warning dialog should only show the filename
    
    Change-Id: I04f1d3a1b945d65276187ca0a284e41bd08ed298
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111941
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Tested-by: Michael Meeks <michael.me...@collabora.com>
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113687
    Tested-by: Jenkins

diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 90d76d75e6ce..932c4723ab21 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -19,12 +19,18 @@
 
 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <vcl/svapp.hxx>
+#include <osl/file.hxx>
 #include <osl/file.h>
 #include <rtl/ustrbuf.hxx>
 #include <tools/debug.hxx>
 #include <unotools/securityoptions.hxx>
+#include <tools/urlobj.hxx>
+#include <unotools/resmgr.hxx>
+#include <com/sun/star/security/NoPasswordException.hpp>
 
 using namespace ::com::sun::star::security;
 
@@ -87,7 +93,13 @@ IMPL_STATIC_LINK_NOARG(MacroWarning, InstallLOKNotifierHdl, 
void*, vcl::ILibreOf
 void MacroWarning::SetDocumentURL( const OUString& rDocURL )
 {
     OUString aAbbreviatedPath;
-    osl_abbreviateSystemPath(rDocURL.pData, &aAbbreviatedPath.pData, 50, 
nullptr);
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        osl::FileBase::getFileURLFromSystemPath(rDocURL, aAbbreviatedPath);
+        aAbbreviatedPath = INetURLObject(aAbbreviatedPath).GetLastName();
+    }
+    else
+        osl_abbreviateSystemPath(rDocURL.pData, &aAbbreviatedPath.pData, 50, 
nullptr);
     m_xDialog->set_primary_text(aAbbreviatedPath);
 }
 
commit acbf57b47fecc78ab31af151f6540c83ecc1d983
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Dec 25 13:36:03 2020 -0400
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:33 2021 +0100

    lok: add global notifier to the "Macro Security Warning"
    
    dialog.
    
    This message dialog is especial, because it is shown before
    loading the document so no way to get access to view shell
    notifier when the model/view/controller were not created.
    
    Change-Id: I5da3ca9d1009f174f2d96c1302770f4509a807cf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108291
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 7a657d03ca2d..90d76d75e6ce 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -20,6 +20,7 @@
 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <comphelper/processfactory.hxx>
+#include <vcl/svapp.hxx>
 #include <osl/file.h>
 #include <rtl/ustrbuf.hxx>
 #include <tools/debug.hxx>
@@ -75,6 +76,12 @@ MacroWarning::MacroWarning(weld::Window* pParent, bool 
_bWithSignatures)
     mxEnableBtn->connect_clicked(LINK(this, MacroWarning, EnableBtnHdl));
     mxDisableBtn->connect_clicked(LINK(this, MacroWarning, DisableBtnHdl));
     mxDisableBtn->grab_focus(); // Default button, but focus is on view button
+    m_xDialog->SetInstallLOKNotifierHdl(LINK(this, MacroWarning, 
InstallLOKNotifierHdl));
+}
+
+IMPL_STATIC_LINK_NOARG(MacroWarning, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+{
+    return GetpApp();
 }
 
 void MacroWarning::SetDocumentURL( const OUString& rDocURL )
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 6a0c97e5f8d2..b91cc092c708 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -50,6 +50,7 @@ private:
     DECL_LINK(EnableBtnHdl, weld::Button&, void);
     DECL_LINK(DisableBtnHdl, weld::Button&, void);
     DECL_LINK(AlwaysTrustCheckHdl, weld::Button&, void);
+    DECL_STATIC_LINK(MacroWarning, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
 
     void                InitControls();
 
commit 110438d568e15c4b6c0baa91d32f53bd9f752d53
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Dec 29 16:40:14 2020 -0400
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:33 2021 +0100

    lok: fix the "disable button" of the "Macro Security Warning"...
    
    Dialog.
    
    The client side cannot disable macros and close the message dialog
    
    Change-Id: Id78060d3c2b3c9c8ac010d8b951e7640b02ca715
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108489
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 1f048f0cb663..7a657d03ca2d 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -73,6 +73,7 @@ MacroWarning::MacroWarning(weld::Window* pParent, bool 
_bWithSignatures)
     InitControls();
 
     mxEnableBtn->connect_clicked(LINK(this, MacroWarning, EnableBtnHdl));
+    mxDisableBtn->connect_clicked(LINK(this, MacroWarning, DisableBtnHdl));
     mxDisableBtn->grab_focus(); // Default button, but focus is on view button
 }
 
@@ -120,6 +121,11 @@ IMPL_LINK_NOARG(MacroWarning, EnableBtnHdl, weld::Button&, 
void)
     m_xDialog->response(RET_OK);
 }
 
+IMPL_LINK_NOARG(MacroWarning, DisableBtnHdl, weld::Button&, void)
+{
+    m_xDialog->response(RET_CANCEL);
+}
+
 IMPL_LINK_NOARG(MacroWarning, AlwaysTrustCheckHdl, weld::Button&, void)
 {
     const bool bEnable = (mnActSecLevel < 2 || mxAlwaysTrustCB->get_active());
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 536f70e09fc2..6a0c97e5f8d2 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -48,6 +48,7 @@ private:
 
     DECL_LINK(ViewSignsBtnHdl, weld::Button&, void);
     DECL_LINK(EnableBtnHdl, weld::Button&, void);
+    DECL_LINK(DisableBtnHdl, weld::Button&, void);
     DECL_LINK(AlwaysTrustCheckHdl, weld::Button&, void);
 
     void                InitControls();
commit 2c3f08f3fb0e4d3389e953e6b0ad103ef914a7ce
Author:     mert <mert.tu...@collabora.com>
AuthorDate: Mon Feb 22 11:17:27 2021 +0300
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:32 2021 +0100

    Fix non-valid json generation on NotifyOtherViews
    
    Change-Id: I82aa0aefcd1de14b4c1bb2bbe3f087b60d691beb
    Signed-off-by: mert <mert.tu...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111299
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111515
    Tested-by: Jenkins

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 295bc59a70dd..53f95e60e737 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -305,7 +305,11 @@ void SfxLokHelper::setDeviceFormFactor(const OUString& 
rDeviceFormFactor)
         g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN;
 }
 
-static OString lcl_escapeQuotes(const OString &rStr)
+/*
+* Used for putting a whole JSON string into a string value
+* e.g { key: "{JSON}" }
+*/
+static OString lcl_sanitizeJSONAsValue(const OString &rStr)
 {
     if (rStr.getLength() < 1)
         return rStr;
@@ -315,7 +319,9 @@ static OString lcl_escapeQuotes(const OString &rStr)
     {
         if (rStr[i] == '"' || rStr[i] == '\\')
             aBuf.append('\\');
-        aBuf.append(rStr[i]);
+
+        if (rStr[i] != '\n')
+            aBuf.append(rStr[i]);
     }
     return aBuf.makeStringAndClear();
 }
@@ -338,7 +344,7 @@ static inline OString lcl_generateJSON(const SfxViewShell* 
pView, const OString&
     assert(pView != nullptr && "pView must be valid");
     return OStringLiteral("{ \"viewId\": \"") + 
OString::number(SfxLokHelper::getView(pView))
            + "\", \"part\": \"" + OString::number(pView->getPart()) + "\", \"" 
+ rKey + "\": \""
-           + lcl_escapeQuotes(rPayload) + "\" }";
+           + lcl_sanitizeJSONAsValue(rPayload) + "\" }";
 }
 
 void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell 
const* pOtherView,
commit 4c926cf7d70a3dc0c4f2eeb8531c72e563b02348
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Mon Feb 1 13:18:23 2021 +0200
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:32 2021 +0100

    Probably this LOK invalidation should be done only if something changed
    
    Change-Id: I0164ac8d74c08abce0a1d8c2e7a7dd9679da91fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110256
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110282
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index a1bc0551f3cd..e533d0b634fe 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -152,20 +152,6 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, 
bool bPaint )
     SCROW nStartRow = rRange.aStart.Row();
     SCROW nEndRow   = rRange.aEnd.Row();
 
-    if (comphelper::LibreOfficeKit::isActive())
-    {
-        SfxViewShell* pViewShell = SfxViewShell::GetFirst();
-        while (pViewShell)
-        {
-            ScTabViewShell* pTabViewShell = 
dynamic_cast<ScTabViewShell*>(pViewShell);
-            if (pTabViewShell && pTabViewShell->GetDocId() == 
pSomeViewForThisDoc->GetDocId())
-            {
-                
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
-            }
-            pViewShell = SfxViewShell::GetNext(*pViewShell);
-        }
-    }
-
     ScSizeDeviceProvider aProv( &rDocShell );
     Fraction aOne(1,1);
 
@@ -173,7 +159,22 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, 
bool bPaint )
     bool bChanged = rDoc.SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab);
     // tdf#76183: recalculate objects' positions
     if (bChanged)
+    {
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+            while (pViewShell)
+            {
+                ScTabViewShell* pTabViewShell = 
dynamic_cast<ScTabViewShell*>(pViewShell);
+                if (pTabViewShell && pTabViewShell->GetDocId() == 
pSomeViewForThisDoc->GetDocId())
+                {
+                    
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
+                }
+                pViewShell = SfxViewShell::GetNext(*pViewShell);
+            }
+        }
         rDoc.SetDrawPageSize(nTab);
+    }
 
     if ( bPaint && bChanged )
         rDocShell.PostPaint(ScRange(0, nStartRow, nTab, rDoc.MaxCol(), 
rDoc.MaxRow(), nTab),
commit b67a7a34393061d4f84850ec423a38ba01f67785
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Jan 15 16:13:29 2021 -0400
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:32 2021 +0100

    lok: unit test incorrect cursor position
    
    Test to not send client side cursor position (0,0)
    due to:
    
        mpOutlinerView->SetOutputArea( PixelToLogic( tools::Rectangle(0,0,1,1) 
) );
    
    Change-Id: Ib5cd7f1c0c45073c5d2039e8b889d3a6fd7ef70c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109417
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    (cherry picked from commit 08d45119cfb875fa8a5c03d6e946a47f0f680932)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109733
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 701f624038c5..ce99a9356d11 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -196,6 +196,7 @@ public:
     void testControlState();
     void testMetricField();
     void testMultiDocuments();
+    void testJumpCursor();
     void testABI();
 
     CPPUNIT_TEST_SUITE(DesktopLOKTest);
@@ -259,6 +260,7 @@ public:
     CPPUNIT_TEST(testControlState);
     CPPUNIT_TEST(testMetricField);
     CPPUNIT_TEST(testMultiDocuments);
+    CPPUNIT_TEST(testJumpCursor);
     CPPUNIT_TEST(testABI);
     CPPUNIT_TEST_SUITE_END();
 
@@ -1923,6 +1925,7 @@ class ViewCallback
 public:
     OString m_aCellFormula;
     bool m_bTilesInvalidated;
+    bool m_bZeroCursor;
     tools::Rectangle m_aOwnCursor;
     boost::property_tree::ptree m_aCommentCallbackResult;
     boost::property_tree::ptree m_aCallbackWindowResult;
@@ -1930,7 +1933,8 @@ public:
 
     ViewCallback(LibLODocument_Impl* pDocument)
         : mpDocument(pDocument),
-          m_bTilesInvalidated(false)
+          m_bTilesInvalidated(false),
+          m_bZeroCursor(false)
     {
         mnView = SfxLokHelper::getView();
         mpDocument->m_pDocumentClass->registerCallback(pDocument, 
&ViewCallback::callback, this);
@@ -1967,6 +1971,9 @@ public:
             m_aOwnCursor.setY(aSeq[1].toInt32());
             m_aOwnCursor.setWidth(aSeq[2].toInt32());
             m_aOwnCursor.setHeight(aSeq[3].toInt32());
+
+            if (m_aOwnCursor.getX() == 0 && m_aOwnCursor.getY() == 0)
+                m_bZeroCursor = true;
         }
         break;
         case LOK_CALLBACK_COMMENT:
@@ -3077,6 +3084,36 @@ void DesktopLOKTest::testMetricField()
     CPPUNIT_ASSERT_EQUAL(aMap["VALUE"], aRet["Value"]);
 }
 
+void DesktopLOKTest::testJumpCursor()
+{
+    comphelper::LibreOfficeKit::setTiledAnnotations(false);
+
+    LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
+    pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'B', 0);
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'o', 0);
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'l', 0);
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'i', 0);
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'v', 0);
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'i', 0);
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'a', 0);
+    pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 0, 
com::sun::star::awt::Key::ESCAPE);
+    Scheduler::ProcessEventsToIdle();
+
+    // There is a cursor jump to (0, 0) due to
+    // mpOutlinerView->SetOutputArea( PixelToLogic( tools::Rectangle(0,0,1,1) 
) );
+    // when creating a comment
+    ViewCallback aView1(pDocument);
+
+    pDocument->pClass->postUnoCommand(pDocument, ".uno:InsertAnnotation", 
nullptr, true);
+    Scheduler::ProcessEventsToIdle();
+
+    CPPUNIT_ASSERT(!aView1.m_bZeroCursor);
+
+    comphelper::LibreOfficeKit::setTiledAnnotations(true);
+}
+
 namespace {
 
 constexpr size_t classOffset(int i)
commit aab35b69548155ae65e4cf7ac3ab02c8561082ca
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Jan 15 10:14:50 2021 -0400
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:32 2021 +0100

    lok: fix incorrect invalidate cursor position
    
    When the comment is created and it's shown in the "Writer"
    application, it creates an initial output area:
    
    mpOutlinerView->SetOutputArea( PixelToLogic( tools::Rectangle(0,0,1,1) ) );
    
    Unfortunately, it causes that send to client side cursor position
    and scroll to the beginning of the document.
    
    Change-Id: I13e21c71328b7f05781e7cdeed082d6cc2b9d679
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109371
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    (cherry picked from commit 4618849a1cbba4e249ee13c3b6412337160a2816)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109732
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 82cb86add8dd..60a0126584a9 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -704,6 +704,11 @@ void EditView::RegisterViewShell(OutlinerViewShell* 
pViewShell)
     pImpEditView->RegisterViewShell(pViewShell);
 }
 
+const OutlinerViewShell* EditView::GetViewShell()
+{
+    return pImpEditView->GetViewShell();
+}
+
 void EditView::RegisterOtherShell(OutlinerViewShell* pOtherShell)
 {
     pImpEditView->RegisterOtherShell(pOtherShell);
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index aff9992d8b4c..4bdaa16d78e8 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1384,6 +1384,11 @@ void OutlinerView::RegisterViewShell(OutlinerViewShell* 
pViewShell)
     pEditView->RegisterViewShell(pViewShell);
 }
 
+const OutlinerViewShell* OutlinerView::GetViewShell()
+{
+    return pEditView->GetViewShell();
+}
+
 Color const & OutlinerView::GetBackgroundColor() const
 {
     return pEditView->GetBackgroundColor();
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index fdd80b38a926..b18c36444451 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -251,6 +251,7 @@ public:
 
     /// Informs this edit view about which view shell contains it.
     void RegisterViewShell(OutlinerViewShell* pViewShell);
+    const OutlinerViewShell* GetViewShell();
     /// Informs this edit view about which other shell listens to it.
     void RegisterOtherShell(OutlinerViewShell* pOtherShell);
 
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index a6bc9fbd7ff2..16ca1612ee0f 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -258,6 +258,7 @@ public:
 
     /// Informs this edit view about which view shell contains it.
     void RegisterViewShell(OutlinerViewShell* pViewShell);
+    const OutlinerViewShell* GetViewShell();
 
     SfxItemSet  GetAttribs();
 
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 4e17e799e46d..54ea5e58dc68 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -530,12 +530,6 @@ void SwAnnotationWin::InitControls()
 
     mpOutlinerView->SetAttribs(DefaultItem());
 
-    if (comphelper::LibreOfficeKit::isActive())
-    {
-        // If there is a callback already registered, inform the new outliner 
view about it.
-        mpOutlinerView->RegisterViewShell(&mrView);
-    }
-
     //create Scrollbars
     mpVScrollbar = VclPtr<SidebarScrollBar>::Create(*this, WB_3DLOOK 
|WB_VSCROLL|WB_DRAG, mrView);
     mpVScrollbar->EnableNativeWidget(false);
@@ -931,6 +925,12 @@ void SwAnnotationWin::DoResize()
     }
 
     mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ;
+
+    if (comphelper::LibreOfficeKit::isActive() && 
!mpOutlinerView->GetViewShell())
+    {
+        mpOutlinerView->RegisterViewShell(&mrView);
+    }
+
     if (!mpVScrollbar->IsVisible())
     {   // if we do not have a scrollbar anymore, we want to see the complete 
text
         mpOutlinerView->SetVisArea( PixelToLogic( 
tools::Rectangle(0,0,aWidth,aHeight) ) );
commit de656ad6bdfd7d9493945610c22d08d8846fb0d2
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Dec 25 12:55:49 2020 -0400
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Sat Apr 10 15:49:31 2021 +0100

    tools: json: fix missing escaped chars
    
    When client side tries to show the "Macro Security Warning"
    message dialog, it fails to parse the JSON objects
    
    Change-Id: Id73c291ddd9cf739d63d69f06094eacb7b43a2f1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108287
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/tools/source/misc/json_writer.cxx 
b/tools/source/misc/json_writer.cxx
index e211d317b9ad..814f6180a85f 100644
--- a/tools/source/misc/json_writer.cxx
+++ b/tools/source/misc/json_writer.cxx
@@ -154,6 +154,27 @@ void JsonWriter::put(const char* pPropName, const 
OUString& rPropVal)
             *mPos = static_cast<char>(ch);
             ++mPos;
         }
+        else if (ch == '\n')
+        {
+            *mPos = '\\';
+            ++mPos;
+            *mPos = 'n';
+            ++mPos;
+        }
+        else if (ch == '\r')
+        {
+            *mPos = '\\';
+            ++mPos;
+            *mPos = 'r';
+            ++mPos;
+        }
+        else if (ch == '\f')
+        {
+            *mPos = '\\';
+            ++mPos;
+            *mPos = 'f';
+            ++mPos;
+        }
         else if (ch <= 0x7F)
         {
             *mPos = static_cast<char>(ch);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to