Rebased ref, commits from common ancestor:
commit fa5575a45fe33edcb6b802c413124327b5b9e2f0
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Thu Mar 24 10:21:11 2022 +0530
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:19 2022 +0200

    lok: paste-undo: invalidate sheetgeometry
    
    In case of copy/pasting of whole column(row) and its undo/redo may
    result in column(row) width(height) changes. Hence a corresponding
    sheet-geometry invalidation message needs to be sent to the lok
    client(s).
    
    Change-Id: I7aa471d9770fc21c567a3c6f5d5926df0fd5dacb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132015
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index e217157b6744..d1ae29a93ee7 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1094,6 +1094,11 @@ void ScUndoPaste::DoChange(bool bUndo)
 
     ScRangeList aDrawRanges(maBlockRanges);
     PaintPartFlags nPaint = PaintPartFlags::Grid;
+
+    // For sheet geometry invalidation.
+    bool bColsAffected = false;
+    bool bRowsAffected = false;
+
     for (size_t i = 0, n = aDrawRanges.size(); i < n; ++i)
     {
         ScRange& rDrawRange = aDrawRanges[i];
@@ -1116,11 +1121,13 @@ void ScUndoPaste::DoChange(bool bUndo)
             {
                 nPaint |= PaintPartFlags::Top;
                 rDrawRange.aEnd.SetCol(rDoc.MaxCol());
+                bColsAffected = true;
             }
             if (maBlockRanges[i].aStart.Col() == 0 && 
maBlockRanges[i].aEnd.Col() == rDoc.MaxCol()) // whole row
             {
                 nPaint |= PaintPartFlags::Left;
                 rDrawRange.aEnd.SetRow(rDoc.MaxRow());
+                bRowsAffected = true;
             }
             if (pViewShell && pViewShell->AdjustBlockHeight(false, &aData))
             {
@@ -1142,6 +1149,13 @@ void ScUndoPaste::DoChange(bool bUndo)
     pDocShell->PostDataChanged();
     if (pViewShell)
         pViewShell->CellContentChanged();
+
+    if (bColsAffected || bRowsAffected)
+        ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+            pViewShell,
+            bColsAffected, bRowsAffected,
+            true /* bSizes*/, true /* bHidden */, true /* bFiltered */,
+            true /* bGroups */, aDrawRanges[0].aStart.Tab());
 }
 
 void ScUndoPaste::Undo()
commit 2cec7913df83276e03423bed8f40cd7e341e9be6
Author:     Tor Lillqvist <t...@iki.fi>
AuthorDate: Mon Mar 28 14:51:43 2022 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:19 2022 +0200

    Make slideshow touch gestures work again in the mobile apps
    
    Need to s/lool/cool/ here, too.
    
    Change-Id: Ib6762f196ca2b1c2e8735c6ff3e591164d34fb0b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132202
    Tested-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 636fc3a50d37..370bacc5cd72 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -18622,8 +18622,8 @@ SlideShow.prototype.exitSlideShowInApp = function()
 {
     if (window.webkit !== undefined &&
         window.webkit.messageHandlers !== undefined &&
-        window.webkit.messageHandlers.lool !== undefined)
-        window.webkit.messageHandlers.lool.postMessage('EXITSLIDESHOW', '*');
+        window.webkit.messageHandlers.cool !== undefined)
+        window.webkit.messageHandlers.cool.postMessage('EXITSLIDESHOW', '*');
 }
 
 SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition )
commit 1d84d14d55046039713a22911c86987e732011d3
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu Mar 24 11:29:59 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:18 2022 +0200

    lok: use JsonWriter for annotations notification
    
    This will unify received objects in LOK.
    boost::property_tree used "string" for number values
    we expect them to be a "number" type.
    
    Change-Id: Ie90d7e2dd98bb371fc09878dcc6e96f4cdf73f3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132054
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/sd/source/core/annotations/Annotation.cxx 
b/sd/source/core/annotations/Annotation.cxx
index 1d1ca39fc9dd..991412f063d5 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -22,8 +22,6 @@
 #include <Annotation.hxx>
 #include <drawdoc.hxx>
 
-#include <boost/property_tree/json_parser.hpp>
-
 #include <com/sun/star/drawing/XDrawPage.hpp>
 
 #include <comphelper/processfactory.hxx>
@@ -38,6 +36,8 @@
 
 #include <notifydocumentevent.hxx>
 
+#include <tools/json_writer.hxx>
+
 using namespace css;
 
 namespace com::sun::star::uno { class XComponentContext; }
@@ -342,34 +342,33 @@ namespace
 {
 std::string lcl_LOKGetCommentPayload(CommentNotificationType nType, 
uno::Reference<office::XAnnotation> const & rxAnnotation)
 {
-    boost::property_tree::ptree aAnnotation;
-    aAnnotation.put("action", (nType == CommentNotificationType::Add ? "Add" :
-                               (nType == CommentNotificationType::Remove ? 
"Remove" :
-                                (nType == CommentNotificationType::Modify ? 
"Modify" : "???"))));
-    aAnnotation.put("id", sd::getAnnotationId(rxAnnotation));
-    if (nType != CommentNotificationType::Remove && rxAnnotation.is())
+    ::tools::JsonWriter aJsonWriter;
     {
-        aAnnotation.put("id", sd::getAnnotationId(rxAnnotation));
-        aAnnotation.put("author", rxAnnotation->getAuthor());
-        aAnnotation.put("dateTime", 
utl::toISO8601(rxAnnotation->getDateTime()));
-        uno::Reference<text::XText> xText(rxAnnotation->getTextRange());
-        aAnnotation.put("text", xText->getString());
-        const SdPage* pPage = sd::getAnnotationPage(rxAnnotation);
-        aAnnotation.put("parthash", pPage ? 
OString::number(pPage->GetHashCode()) : OString());
-        geometry::RealPoint2D const & rPoint = rxAnnotation->getPosition();
-        geometry::RealSize2D const & rSize = rxAnnotation->getSize();
-        ::tools::Rectangle aRectangle(Point(rPoint.X * 100.0, rPoint.Y * 
100.0), Size(rSize.Width * 100.0, rSize.Height * 100.0));
-        aRectangle = o3tl::convert(aRectangle, o3tl::Length::mm100, 
o3tl::Length::twip);
-        OString sRectangle = aRectangle.toString();
-        aAnnotation.put("rectangle", sRectangle.getStr());
+        auto aCommentNode = aJsonWriter.startNode("comment");
+
+        aJsonWriter.put("action", (nType == CommentNotificationType::Add ? 
"Add" :
+                                (nType == CommentNotificationType::Remove ? 
"Remove" :
+                                    (nType == CommentNotificationType::Modify 
? "Modify" : "???"))));
+        aJsonWriter.put("id", sd::getAnnotationId(rxAnnotation));
+
+        if (nType != CommentNotificationType::Remove && rxAnnotation.is())
+        {
+            aJsonWriter.put("id", sd::getAnnotationId(rxAnnotation));
+            aJsonWriter.put("author", rxAnnotation->getAuthor());
+            aJsonWriter.put("dateTime", 
utl::toISO8601(rxAnnotation->getDateTime()));
+            uno::Reference<text::XText> xText(rxAnnotation->getTextRange());
+            aJsonWriter.put("text", xText->getString());
+            const SdPage* pPage = sd::getAnnotationPage(rxAnnotation);
+            aJsonWriter.put("parthash", pPage ? 
OString::number(pPage->GetHashCode()) : OString());
+            geometry::RealPoint2D const & rPoint = rxAnnotation->getPosition();
+            geometry::RealSize2D const & rSize = rxAnnotation->getSize();
+            ::tools::Rectangle aRectangle(Point(rPoint.X * 100.0, rPoint.Y * 
100.0), Size(rSize.Width * 100.0, rSize.Height * 100.0));
+            aRectangle = OutputDevice::LogicToLogic(aRectangle, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+            OString sRectangle = aRectangle.toString();
+            aJsonWriter.put("rectangle", sRectangle.getStr());
+        }
     }
-
-    boost::property_tree::ptree aTree;
-    aTree.add_child("comment", aAnnotation);
-    std::stringstream aStream;
-    boost::property_tree::write_json(aStream, aTree);
-
-    return aStream.str();
+    return aJsonWriter.extractData();
 }
 } // anonymous ns
 
commit 3d00c8a13fcb4af557f2856626764da0fbc7ca5b
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Fri Mar 18 12:48:30 2022 +0530
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:09 2022 +0200

    lok: unit-test: add comment unique id checks
    
    Change-Id: I588484955ad3ad4c5ec3bfa9f5a844096c768ff2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131725
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 499f4d8950f1..09c198adbf1b 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -38,6 +38,7 @@
 #include <comphelper/string.hxx>
 #include <tools/json_writer.hxx>
 #include <docoptio.hxx>
+#include <postit.hxx>
 #include <test/lokcallback.hxx>
 
 #include <chrono>
@@ -124,6 +125,7 @@ public:
     void testTextSelectionBounds();
     void testSheetViewDataCrash();
     void testTextBoxInsert();
+    void testCommentCellCopyPaste();
 
     CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
     CPPUNIT_TEST(testRowColumnHeaders);
@@ -179,6 +181,7 @@ public:
     CPPUNIT_TEST(testTextSelectionBounds);
     CPPUNIT_TEST(testSheetViewDataCrash);
     CPPUNIT_TEST(testTextBoxInsert);
+    CPPUNIT_TEST(testCommentCellCopyPaste);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2942,6 +2945,105 @@ void ScTiledRenderingTest::testTextBoxInsert()
     Scheduler::ProcessEventsToIdle();
 }
 
+void ScTiledRenderingTest::testCommentCellCopyPaste()
+{
+    // Load a document
+    comphelper::LibreOfficeKit::setActive();
+    // Comments callback are emitted only if tiled annotations are off
+    comphelper::LibreOfficeKit::setTiledAnnotations(false);
+
+    // FIXME: Hack because previous tests do not destroy ScDocument(with 
annotations) on exit (?).
+    ScPostIt::mnLastPostItId = 1;
+
+    {
+        ScModelObj* pModelObj = createDoc("empty.ods");
+        ViewCallback aView;
+        int nView = SfxLokHelper::getView();
+
+        SfxLokHelper::setView(nView);
+
+        ScTabViewShell* pTabViewShell = 
dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+        CPPUNIT_ASSERT(pTabViewShell);
+
+        lcl_typeCharsInCell("ABC", 0, 0, pTabViewShell, pModelObj); // Type 
"ABC" in A1
+
+        pTabViewShell->SetCursor(1, 1);
+
+        // Add a new comment
+        uno::Sequence<beans::PropertyValue> 
aArgs(comphelper::InitPropertySequence(
+        {
+            {"Text", uno::makeAny(OUString("LOK Comment Cell B2"))},
+            {"Author", uno::makeAny(OUString("LOK Client"))},
+        }));
+        comphelper::dispatchCommand(".uno:InsertAnnotation", aArgs);
+        Scheduler::ProcessEventsToIdle();
+
+        // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' 
action
+        CPPUNIT_ASSERT_EQUAL(std::string("Add"), 
aView.m_aCommentCallbackResult.get<std::string>("action"));
+        CPPUNIT_ASSERT_EQUAL(std::string("1"), 
aView.m_aCommentCallbackResult.get<std::string>("id"));
+        CPPUNIT_ASSERT_EQUAL(std::string("0"), 
aView.m_aCommentCallbackResult.get<std::string>("tab"));
+        CPPUNIT_ASSERT_EQUAL(std::string("LOK Client"), 
aView.m_aCommentCallbackResult.get<std::string>("author"));
+        CPPUNIT_ASSERT_EQUAL(std::string("LOK Comment Cell B2"), 
aView.m_aCommentCallbackResult.get<std::string>("text"));
+
+        uno::Sequence<beans::PropertyValue> aCopyPasteArgs;
+
+        // We need separate tests for single cell copy-paste and cell-range 
copy-paste
+        // since they hit different code paths in ScColumn methods.
+
+        // Single cell(with comment) copy paste test
+        {
+            comphelper::dispatchCommand(".uno:Copy", aCopyPasteArgs);
+            Scheduler::ProcessEventsToIdle();
+
+            pTabViewShell->SetCursor(1, 49);
+            Scheduler::ProcessEventsToIdle();
+            comphelper::dispatchCommand(".uno:Paste", aCopyPasteArgs); // 
Paste to cell B50
+            Scheduler::ProcessEventsToIdle();
+
+            // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' 
action
+            CPPUNIT_ASSERT_EQUAL(std::string("Add"), 
aView.m_aCommentCallbackResult.get<std::string>("action"));
+            // Without the fix the id will be "1".
+            CPPUNIT_ASSERT_EQUAL(std::string("2"), 
aView.m_aCommentCallbackResult.get<std::string>("id"));
+            CPPUNIT_ASSERT_EQUAL(std::string("0"), 
aView.m_aCommentCallbackResult.get<std::string>("tab"));
+            CPPUNIT_ASSERT_EQUAL(std::string("LOK Client"), 
aView.m_aCommentCallbackResult.get<std::string>("author"));
+            CPPUNIT_ASSERT_EQUAL(std::string("LOK Comment Cell B2"), 
aView.m_aCommentCallbackResult.get<std::string>("text"));
+        }
+
+        // Cell range (with a comment) copy paste test
+        {
+            // Select range A1:C3
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_HOME | 
KEY_MOD1);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_HOME | 
KEY_MOD1);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | 
KEY_SHIFT);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | 
KEY_SHIFT);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | 
KEY_SHIFT);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | 
KEY_SHIFT);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | 
KEY_SHIFT);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | 
KEY_SHIFT);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | 
KEY_SHIFT);
+            pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | 
KEY_SHIFT);
+            Scheduler::ProcessEventsToIdle();
+
+            comphelper::dispatchCommand(".uno:Copy", aCopyPasteArgs);
+            Scheduler::ProcessEventsToIdle();
+
+            pTabViewShell->SetCursor(3, 49);
+            Scheduler::ProcessEventsToIdle();
+            comphelper::dispatchCommand(".uno:Paste", aCopyPasteArgs); // 
Paste to cell D50
+            Scheduler::ProcessEventsToIdle();
+
+            // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' 
action
+            CPPUNIT_ASSERT_EQUAL(std::string("Add"), 
aView.m_aCommentCallbackResult.get<std::string>("action"));
+            // Without the fix the id will be "1".
+            CPPUNIT_ASSERT_EQUAL(std::string("3"), 
aView.m_aCommentCallbackResult.get<std::string>("id"));
+            CPPUNIT_ASSERT_EQUAL(std::string("0"), 
aView.m_aCommentCallbackResult.get<std::string>("tab"));
+            CPPUNIT_ASSERT_EQUAL(std::string("LOK Client"), 
aView.m_aCommentCallbackResult.get<std::string>("author"));
+            CPPUNIT_ASSERT_EQUAL(std::string("LOK Comment Cell B2"), 
aView.m_aCommentCallbackResult.get<std::string>("text"));
+        }
+    }
+    comphelper::LibreOfficeKit::setTiledAnnotations(true);
+}
+
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);
commit f0b85666abe77b28732e28bec68e8235779ebb52
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Wed Mar 16 11:27:48 2022 +0530
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:08 2022 +0200

    lok-comments: CopyOneCellFromClip: notify lok clients
    
    Change-Id: I4b433c8f7123fe33f1b106cbf45216d2b0c73dba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131691
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 7222404c5b36..c2fc0e54d33e 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -29,6 +29,7 @@
 #include <drwlayer.hxx>
 #include <compiler.hxx>
 #include <recursionhelper.hxx>
+#include <docsh.hxx>
 
 #include <o3tl/safeint.hxx>
 #include <svl/sharedstringpool.hxx>
@@ -341,6 +342,14 @@ void ScColumn::CopyOneCellFromClip( 
sc::CopyFromClipContext& rCxt, SCROW nRow1,
     pBlockPos->miCellNotePos =
         maCellNotes.set(
             pBlockPos->miCellNotePos, nRow1, aNotes.begin(), aNotes.end());
+
+    // Notify our LOK clients.
+    aDestPos.SetRow(nRow1);
+    for (size_t i = 0; i < nDestSize; ++i)
+    {
+        ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
&rDocument, aDestPos, aNotes[i]);
+        aDestPos.IncRow();
+    }
 }
 
 void ScColumn::SetValues( const SCROW nRow, const std::vector<double>& rVals )
commit 05ef3039fff9ab632ffcdebe8700492c4074fa51
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Wed Mar 16 11:29:34 2022 +0530
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:07 2022 +0200

    lok: CopyCellNotesHandler: use the cloned object
    
    to get correct id for the new cell-note.
    
    Change-Id: I4df492ad91faad5797ba513f9a3aa9abd2baf88f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131690
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 139462db7f1f..987c7a8fe60f 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1902,9 +1902,10 @@ public:
         SCROW nDestRow = nRow + mnDestOffset;
         ScAddress aSrcPos(mnSrcCol, nRow, mnSrcTab);
         ScAddress aDestPos(mnDestCol, nDestRow, mnDestTab);
-        miPos = mrDestNotes.set(miPos, nDestRow, p->Clone(aSrcPos, 
mrDestCol.GetDoc(), aDestPos, mbCloneCaption).release());
+        ScPostIt* pNew = p->Clone(aSrcPos, mrDestCol.GetDoc(), aDestPos, 
mbCloneCaption).release();
+        miPos = mrDestNotes.set(miPos, nDestRow, pNew);
         // Notify our LOK clients also
-        ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
&mrDestCol.GetDoc(), aDestPos, p);
+        ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
&mrDestCol.GetDoc(), aDestPos, pNew);
     }
 };
 
commit b38738cc618eaa518601538eccd0b3b1be6e24bb
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Tue Mar 15 13:00:35 2022 +0530
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:02 2022 +0200

    lok: ensure unique id for annotations
    
    Problem:
    When a cell containing comment is copied and pasted to another cell, the
    cloned comment/annotation in the target cell has the same id as the
    original one. The lok clients depend upon the id of each comment to
    identify them and update coordinates when updates are requested through
    .uno:ViewAnnotationsPosition. So the client does not have enough
    information to distinguish between comments of same id.
    
    Change-Id: Iebd7281113e0830826aff1bbdaae234bd5d5cd4e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131689
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index ef7ff3bc4725..cd8acfdceec4 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -29,6 +29,7 @@
 #include <editeng/editobj.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <osl/diagnose.h>
+#include <comphelper/lok.hxx>
 
 #include <scitems.hxx>
 #include <svx/xfillit0.hxx>
@@ -877,7 +878,8 @@ ScPostIt::~ScPostIt()
 std::unique_ptr<ScPostIt> ScPostIt::Clone( const ScAddress& rOwnPos, 
ScDocument& rDestDoc, const ScAddress& rDestPos, bool bCloneCaption ) const
 {
     CreateCaptionFromInitData( rOwnPos );
-    return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, 
*this, mnPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos, 
maNoteData, false, mnPostItId );
+    sal_uInt32 nPostItId = comphelper::LibreOfficeKit::isActive() ? 0 : 
mnPostItId;
+    return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, 
*this, nPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos, 
maNoteData, false, mnPostItId );
 }
 
 void ScPostIt::SetDate( const OUString& rDate )
commit 76ae880c33a2875cd446b25ef94351d4cdde24f2
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Fri Mar 25 17:56:30 2022 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:02 2022 +0200

    make default selected table style to Default Table Style for only online
    
    unfortunately when the table has a style 
sw/qa/uitest/writer_tests4/tdf115573.py fails
    because tables that have pre-applied style resets the style of the elements 
in their cells
    when a new row is inserted and the ui test above relies on that. For now 
this is LOK only
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: I2f60376fc2d929498aef45259a5ef291922ccdcd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132124
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Gökay ŞATIR <gokaysa...@collabora.com>

diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 4fa9a34bbae5..28a789db8607 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -148,8 +148,13 @@ void SwInsTableDlg::InitAutoTableFormat()
     // Change this min variable if you add autotable manually.
     minTableIndexInLb = 1;
     maxTableIndexInLb = minTableIndexInLb + 
static_cast<sal_uInt8>(m_xTableTable->size());
-    m_xLbFormat->select( minTableIndexInLb );
-    tbIndex = lbIndexToTableIndex( minTableIndexInLb );
+    // 1 means default table style
+    // unfortunately when the table has a style 
sw/qa/uitest/writer_tests4/tdf115573.py fails
+    // because tables that have pre-applied style resets the style of the 
elements in their cells
+    // when a new row is inserted and the ui test above relies on that. For 
now this is LOK only
+    lbIndex = comphelper::LibreOfficeKit::isActive() ? 1 : 0;
+    m_xLbFormat->select( lbIndex );
+    tbIndex = lbIndexToTableIndex(lbIndex);
 
     SelFormatHdl( *m_xLbFormat );
 }
commit 7538d17ddc41c73cc2ac3a448fa060513c23ec19
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Wed Mar 23 14:23:23 2022 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:07:00 2022 +0200

    sw: change inserttable style option default to 1
    
    Right now it is default to NONE in the list
    if the user explicitly choses otherwise but that
    does not align with inserttable option on the toolbar
    there it is defaulted to "Default Table Style"
    1 means "Default Table Style"
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: I1db19f0292ac6775653b0db3f2860fea9e3b0adf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131971
    Tested-by: Andras Timar <andras.ti...@collabora.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 554e4f2611ee..4fa9a34bbae5 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -148,9 +148,8 @@ void SwInsTableDlg::InitAutoTableFormat()
     // Change this min variable if you add autotable manually.
     minTableIndexInLb = 1;
     maxTableIndexInLb = minTableIndexInLb + 
static_cast<sal_uInt8>(m_xTableTable->size());
-    lbIndex = 0;
-    m_xLbFormat->select( lbIndex );
-    tbIndex = lbIndexToTableIndex(lbIndex);
+    m_xLbFormat->select( minTableIndexInLb );
+    tbIndex = lbIndexToTableIndex( minTableIndexInLb );
 
     SelFormatHdl( *m_xLbFormat );
 }
commit 43e9fb0373435acade7b3ee81dc49133707f1d90
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Tue Mar 8 14:29:54 2022 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:49 2022 +0200

    Trust the family name in the font file if necessary in 
AddTempDevFontHelper()
    
    If the passed in font name is empty, use the one that has been read
    from the font file.
    
    Seems like a reasonable thing to do, and I have a use for this small
    improvement coming.
    
    Change-Id: I3598179bf85ba3acdaca6058982ba5bf81e68288
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131300
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/vcl/unx/generic/print/genpspgraphics.cxx 
b/vcl/unx/generic/print/genpspgraphics.cxx
index da0a406dea0b..f903b30c6204 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -253,7 +253,8 @@ bool GenPspGraphics::AddTempDevFontHelper( 
vcl::font::PhysicalFontCollection* pF
         // prepare font data
         psp::FastPrintFontInfo aInfo;
         rMgr.getFontFastInfo( elem, aInfo );
-        aInfo.m_aFamilyName = rFontName;
+        if (!rFontName.isEmpty())
+            aInfo.m_aFamilyName = rFontName;
 
         // inform glyph cache of new font
         FontAttributes aDFA = GenPspGraphics::Info2FontAttributes( aInfo );
commit ece3d293c777e9f62c0fd792924b6596d09c62ed
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Mon Mar 21 14:07:13 2022 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:48 2022 +0200

    android: Fix tab name on CSV still becomes tempfile name
    
    Unfortunately, in order for isLOKMObilePhone to work we need
    to send deviceFormFactor on document load but at this stage
    the document is still not loaded and the control does not work here
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: I5388cf4a049dbf007a1fd79abefb64bed580eea1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131900
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d5d3307d6495..052be5984a16 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+ #include <sal/config.h>
+
 #include <docsh.hxx>
 
 #include <config_features.h>
@@ -1289,23 +1291,21 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     sc::SetFormulaDirtyContext aCxt;
                     m_aDocument.SetAllFormulasDirty(aCxt);
 
-                    bool bIsMobile = comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current()
-                        && SfxViewShell::Current()->isLOKMobilePhone();
                     // for mobile case, we use a copy of the original document 
and give it a temporary name before editing
                     // Therefore, the sheet name becomes ugly, long and 
nonsensical.
-                    if (!bIsMobile)
-                        // The same resulting name has to be handled in
-                        // ScExternalRefCache::initializeDoc() and related, 
hence
-                        // pass 'true' for RenameTab()'s bExternalDocument for 
a
-                        // composed name so ValidTabName() will not be checked,
-                        // which could veto the rename in case it contained
-                        // characters that Excel does not handle. If we wanted 
to
-                        // change that then it needed to be handled in all
-                        // corresponding places of the external references
-                        // manager/cache. Likely then we'd also need a method 
to
-                        // compose a name excluding such characters.
-                        m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
-
+#if !(defined ANDROID)
+                    // The same resulting name has to be handled in
+                    // ScExternalRefCache::initializeDoc() and related, hence
+                    // pass 'true' for RenameTab()'s bExternalDocument for a
+                    // composed name so ValidTabName() will not be checked,
+                    // which could veto the rename in case it contained
+                    // characters that Excel does not handle. If we wanted to
+                    // change that then it needed to be handled in all
+                    // corresponding places of the external references
+                    // manager/cache. Likely then we'd also need a method to
+                    // compose a name excluding such characters.
+                    m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
+#endif
                     bOverflowRow = aImpEx.IsOverflowRow();
                     bOverflowCol = aImpEx.IsOverflowCol();
                     bOverflowCell = aImpEx.IsOverflowCell();
commit 9c3e1bfa3153ea265ce4e1417aa25924d818b6cd
Author:     Pedro Pinto Silva <pedro.si...@collabora.com>
AuthorDate: Tue Mar 15 15:21:30 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:47 2022 +0200

    Sidebarparagraph: Replace generic ids
    
    Signed-off-by: Pedro Pinto Silva <pedro.si...@collabora.com>
    Change-Id: Ic6f0195c272f0442dc96cfff0321e15461f8bbc0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131616
    Tested-by: Jenkins
    Reviewed-by: Pranam Lashkari <lpra...@collabora.com>

diff --git a/svx/uiconfig/ui/sidebarparagraph.ui 
b/svx/uiconfig/ui/sidebarparagraph.ui
index e0bf907a231b..a638dceacd51 100644
--- a/svx/uiconfig/ui/sidebarparagraph.ui
+++ b/svx/uiconfig/ui/sidebarparagraph.ui
@@ -248,12 +248,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box11">
+              <object class="GtkBox" id="aboveparaspacingbox">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkImage" id="image6">
+                  <object class="GtkImage" id="aboveparaspacingimg">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
                     <property name="halign">center</property>
@@ -297,12 +297,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box12">
+              <object class="GtkBox" id="belowparaspacingbox">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkImage" id="image7">
+                  <object class="GtkImage" id="belowparaspacingimg">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
                     <property name="halign">center</property>
@@ -448,12 +448,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box14">
+              <object class="GtkBox" id="beforetextindentbox">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkImage" id="image8">
+                  <object class="GtkImage" id="beforetextindentimg">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
                     <property name="halign">center</property>
@@ -497,12 +497,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box15">
+              <object class="GtkBox" id="aftertextindentbox">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkImage" id="image9">
+                  <object class="GtkImage" id="aftertextindentimg">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
                     <property name="halign">center</property>
@@ -546,12 +546,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box16">
+              <object class="GtkBox" id="firstlineindentbox">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkImage" id="image10">
+                  <object class="GtkImage" id="firstlineindentimg">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
                     <property name="halign">center</property>
@@ -708,12 +708,12 @@
   <object class="GtkSizeGroup" id="sizegroup1">
     <property name="mode">vertical</property>
     <widgets>
-      <widget name="box11"/>
-      <widget name="box12"/>
+      <widget name="aboveparaspacingbox"/>
+      <widget name="belowparaspacingbox"/>
       <widget name="linespacing"/>
-      <widget name="box14"/>
-      <widget name="box15"/>
-      <widget name="box16"/>
+      <widget name="beforetextindentbox"/>
+      <widget name="aftertextindentbox"/>
+      <widget name="firstlineindentbox"/>
     </widgets>
   </object>
 </interface>
commit d8318873785585c602e22ae68ab4e2df994c0509
Author:     Pedro Pinto Silva <pedro.si...@collabora.com>
AuthorDate: Mon Mar 14 15:36:32 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:35 2022 +0200

    Fix btn image size inconsistencies on CustomAnimationsPanel
    
    Animations btns (Add, Remove, Move Up, Move Down)
    - Images were being loaded from different locations
    - Images did not share the same size
    
    Signed-off-by: Pedro Pinto Silva <pedro.si...@collabora.com>
    Change-Id: I33c033d50c802b7f2c9506b2c5a7b82967af7db8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131551
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/icon-themes/colibre/cmd/sc_add.png 
b/icon-themes/colibre/cmd/sc_add.png
index 5d1b3b8e8146..7b0680d5c24e 100644
Binary files a/icon-themes/colibre/cmd/sc_add.png and 
b/icon-themes/colibre/cmd/sc_add.png differ
diff --git a/icon-themes/colibre/cmd/sc_list_remove.png 
b/icon-themes/colibre/cmd/sc_list_remove.png
new file mode 100644
index 000000000000..05a11237416f
Binary files /dev/null and b/icon-themes/colibre/cmd/sc_list_remove.png differ
diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui 
b/sd/uiconfig/simpress/ui/customanimationspanel.ui
index 848b40da9661..2d8bd06d6118 100644
--- a/sd/uiconfig/simpress/ui/customanimationspanel.ui
+++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui
@@ -20,7 +20,7 @@
   <object class="GtkImage" id="image_add">
     <property name="visible">True</property>
     <property name="can-focus">False</property>
-    <property name="icon-name">svtools/res/list_add.png</property>
+    <property name="icon_name">cmd/sc_add.png</property>
   </object>
   <object class="GtkImage" id="image_down">
     <property name="visible">True</property>
@@ -35,7 +35,7 @@
   <object class="GtkImage" id="image_remove">
     <property name="visible">True</property>
     <property name="can-focus">False</property>
-    <property name="icon-name">extensions/res/buttonminus.png</property>
+    <property name="icon_name">cmd/sc_list_remove.png</property>
   </object>
   <object class="GtkImage" id="image_up">
     <property name="visible">True</property>
commit 5751ff6248e4bc92947dad275f5c38a7cba33093
Author:     Pedro Pinto Silva <pedro.si...@collabora.com>
AuthorDate: Thu Mar 10 10:47:00 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:30 2022 +0200

    Decrease page outline prominence
    
    Make the page border less prominent so user can focus more in the
    page's content and less in the page's surroundings
    
    Signed-off-by: Pedro Pinto Silva <pedro.si...@collabora.com>
    Change-Id: I54fd21bd9515c9c826ea369fb934dfe9343cf5dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131308
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/icon-themes/colibre/sw/res/page-shadow-mask.png 
b/icon-themes/colibre/sw/res/page-shadow-mask.png
index 107f37d84982..6b0e64697786 100644
Binary files a/icon-themes/colibre/sw/res/page-shadow-mask.png and 
b/icon-themes/colibre/sw/res/page-shadow-mask.png differ
commit d573d55c158bc631d9a34ff339095e31661c2bb6
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Wed Mar 2 09:49:51 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:28 2022 +0200

    Do not pull in X11 dependencies when the build is configured for LOKit
    
    Change-Id: I44a1782cf523bbfbbbb0e0d5333364f36c7ed495
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130781
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh 
b/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
index 338b7919d4ed..9fec571f5f99 100644
--- a/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
+++ b/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
@@ -23,5 +23,7 @@ if [[ "${OS}" == "AIX" ]]; then
   echo "libfreetype.a(libfreetype.so.6${mark64})"
 else
   echo "libfreetype.so.6${mark64}"
-  echo "libXinerama.so.1${mark64}"
+  if [[ "${XINERAMA_LINK}" == "dynamic" ]]; then
+    echo "libXinerama.so.1${mark64}"
+  fi
 fi
commit bc9008b7d048fe396bc8543fafde8674c11969a8
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Mar 23 16:49:03 2022 +0000
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:28 2022 +0200

    forcepoint#83 Invalid read of size 1
    
    Change-Id: I1576dfd8c9731d943107764aeb66bb1c2294ad5f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131996
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/external/liborcus/UnpackedTarball_liborcus.mk 
b/external/liborcus/UnpackedTarball_liborcus.mk
index 87e462e33d91..a87da7edb88d 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -15,8 +15,8 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,liborcus,1))
 
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,liborcus))
 
-# crashtesting-crash-on-passing-null-to-std-string_vie.patch.1 submitted as
-# https://gitlab.com/orcus/orcus/-/merge_requests/113
+# forcepoint-83.patch.1 submitted as
+# https://gitlab.com/orcus/orcus/-/merge_requests/117
 
 $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
        external/liborcus/rpath.patch.0 \
@@ -25,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
        external/liborcus/fix-pch.patch.0 \
        external/liborcus/liborcus_newline.patch.1 \
        external/liborcus/std-get-busted.patch.1 \
+       external/liborcus/forcepoint-83.patch.1 \
 ))
 
 ifeq ($(OS),WNT)
diff --git a/external/liborcus/forcepoint-83.patch.1 
b/external/liborcus/forcepoint-83.patch.1
new file mode 100644
index 000000000000..bfd3bb86fcf9
--- /dev/null
+++ b/external/liborcus/forcepoint-83.patch.1
@@ -0,0 +1,38 @@
+From 283b45ba3bcb22dc28303a09a96c9b94f86d1ba2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caol...@redhat.com>
+Date: Wed, 23 Mar 2022 16:44:00 +0000
+Subject: [PATCH] forcepoint#83 Invalid read of size 1
+
+==343916== Invalid read of size 1
+==343916==    at 0x11A7B2F0: orcus::parser_base::cur_char() const 
(parser_base.hpp:79)
+==343916==    by 0x11B7B112: 
orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper,
 orcus::sax_parser_default_config>::element_open(long) (sax_parser.hpp:258)
+==343916==    by 0x11B7A2C7: 
orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper,
 orcus::sax_parser_default_config>::element() (sax_parser.hpp:246)
+==343916==    by 0x11B7A197: 
orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper,
 orcus::sax_parser_default_config>::body() (sax_parser.hpp:214)
+==343916==    by 0x11B79FD9: 
orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper,
 orcus::sax_parser_default_config>::parse() (sax_parser.hpp:182)
+==343916==    by 0x11B79F8B: 
orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::parse()
 (sax_ns_parser.hpp:277)
+==343916==    by 0x11B79768: 
orcus::sax_token_parser<orcus::xml_stream_handler>::parse() 
(sax_token_parser.hpp:215)
+==343916==    by 0x11B79406: orcus::xml_stream_parser::parse() 
(xml_stream_parser.cpp:68)
+==343916==    by 0x11BE3805: orcus::orcus_xlsx::detect(unsigned char const*, 
unsigned long) (orcus_xlsx.cpp:188)
+==343916==    by 0x11AB2482: orcus::detect(unsigned char const*, unsigned 
long) (format_detection.cpp:60)
+==343916==    by 0x30E60945: (anonymous 
namespace)::OrcusFormatDetect::detect(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&)
 (filterdetect.cxx:83)
+==343916==    by 0x30E60ABE: non-virtual thunk to (anonymous 
namespace)::OrcusFormatDetect::detect(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&)
 (filterdetect.cxx:0)
+---
+ include/orcus/sax_parser.hpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/orcus/sax_parser.hpp b/include/orcus/sax_parser.hpp
+index 15e8d917..d0fc45b5 100644
+--- a/include/orcus/sax_parser.hpp
++++ b/include/orcus/sax_parser.hpp
+@@ -255,6 +255,8 @@ void 
sax_parser<_Handler,_Config>::element_open(std::ptrdiff_t begin_pos)
+     while (true)
+     {
+         skip_space_and_control();
++        if (!has_char())
++            return;
+         char c = cur_char();
+         if (c == '/')
+         {
+-- 
+2.35.1
+
commit fbd084fea296cd1d9b81e73aaf4f1a4ecc64eb93
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Mar 25 12:10:32 2022 +0000
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:27 2022 +0200

    forcepoint#89 don't remove page with footnote continuation frame
    
    in browse/html/web mode
    
    Change-Id: Ic821dd7f2cc1f47305b5fe2ced16d5168aedc0b9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132045
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 33a990a15a5a..da6e7c938f6b 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -295,7 +295,8 @@ bool SwLayAction::RemoveEmptyBrowserPages()
         do
         {
             if ( (pPage->GetSortedObjs() && pPage->GetSortedObjs()->size()) ||
-                 pPage->ContainsContent() )
+                 pPage->ContainsContent() ||
+                 pPage->FindFootnoteCont() )
                 pPage = static_cast<SwPageFrame*>(pPage->GetNext());
             else
             {
commit 9e5c88e0fd3c97155a70d63ab8e6d1547c67c174
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Mar 27 12:03:06 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:24 2022 +0200

    forcepoint#92 fix crash on layout of specific doc
    
    Change-Id: Id40d25d05d10d641d071cddd2e1c84594ac777a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132142
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132148
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/qa/extras/layout/data/forcepoint92.doc 
b/sw/qa/extras/layout/data/forcepoint92.doc
new file mode 100644
index 000000000000..49c4a7f11dfe
Binary files /dev/null and b/sw/qa/extras/layout/data/forcepoint92.doc differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 267c20770bef..94c65d7821e2 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2496,6 +2496,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, 
testForcepointFootnoteFrame)
 //FIXME: disabled after failing again with fixed layout
 //CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint76) { 
createSwDoc(DATA_DIRECTORY, "forcepoint76-1.rtf"); }
 
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92)
+{
+    createSwDoc(DATA_DIRECTORY, "forcepoint92.doc");
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058)
 {
     SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118058.fodt");
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 7786f3aec4fc..b405a2124254 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -24,6 +24,7 @@
 #include <viewimp.hxx>
 #include <fesh.hxx>
 #include <swtable.hxx>
+#include <deletelistener.hxx>
 #include <dflyobj.hxx>
 #include <anchoreddrawobject.hxx>
 #include <fmtanchr.hxx>
@@ -2114,13 +2115,18 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
             }
             SwFootnoteBossFrame *pOldBoss = bFootnotesInDoc ? 
FindFootnoteBossFrame( true ) : nullptr;
             bool bReformat;
+            std::optional<SfxDeleteListener> oDeleteListener;
+            if (pOldBoss)
+                oDeleteListener.emplace(*pOldBoss);
             SwFrameDeleteGuard g(this);
             if ( MoveBwd( bReformat ) )
             {
+                SAL_WARN_IF(oDeleteListener && oDeleteListener->WasDeleted(), 
"sw.layout", "SwFootnoteBossFrame unexpectedly deleted");
+
                 aRectFnSet.Refresh(this);
                 bMovedBwd = true;
                 aNotify.SetLowersComplete( false );
-                if ( bFootnotesInDoc )
+                if (bFootnotesInDoc && !oDeleteListener->WasDeleted())
                     MoveLowerFootnotes( nullptr, pOldBoss, nullptr, true );
                 if ( bReformat || bKeep )
                 {
commit 672760f4cb8df5edccda8196da1fd544f770d1d1
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Mar 26 21:50:49 2022 +0000
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:23 2022 +0200

    move DeleteListener contraptions to toplevel writer includes
    
    Change-Id: Ifa1e75b62da4174f27fca52eb86559cd6a381513
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132141
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132147
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/inc/deletelistener.hxx b/sw/inc/deletelistener.hxx
new file mode 100644
index 000000000000..2b212e418fef
--- /dev/null
+++ b/sw/inc/deletelistener.hxx
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <svl/listener.hxx>
+#include <svl/lstner.hxx>
+#include "calbck.hxx"
+
+class SwDeleteListener final : public SwClient
+{
+private:
+    SwModify* m_pModify;
+
+    virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override
+    {
+        if (rHint.GetId() != SfxHintId::SwLegacyModify)
+            return;
+        auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
+        if (pLegacy->GetWhich() == RES_OBJECTDYING)
+        {
+            m_pModify->Remove(this);
+            m_pModify = nullptr;
+        }
+    }
+
+public:
+    SwDeleteListener(SwModify& rModify)
+        : m_pModify(&rModify)
+    {
+        m_pModify->Add(this);
+    }
+
+    bool WasDeleted() const { return !m_pModify; }
+
+    virtual ~SwDeleteListener() override
+    {
+        if (!m_pModify)
+            return;
+        m_pModify->Remove(this);
+    }
+};
+
+class SvtDeleteListener final : public SvtListener
+{
+private:
+    bool bObjectDeleted;
+
+public:
+    explicit SvtDeleteListener(SvtBroadcaster& rNotifier)
+        : bObjectDeleted(false)
+    {
+        StartListening(rNotifier);
+    }
+
+    virtual void Notify(const SfxHint& rHint) override
+    {
+        if (rHint.GetId() == SfxHintId::Dying)
+            bObjectDeleted = true;
+    }
+
+    bool WasDeleted() const { return bObjectDeleted; }
+};
+
+class SfxDeleteListener final : public SfxListener
+{
+private:
+    bool bObjectDeleted;
+
+public:
+    explicit SfxDeleteListener(SfxBroadcaster& rNotifier)
+        : bObjectDeleted(false)
+    {
+        StartListening(rNotifier);
+    }
+
+    virtual void Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) override
+    {
+        if (rHint.GetId() == SfxHintId::Dying)
+            bObjectDeleted = true;
+    }
+
+    bool WasDeleted() const { return bObjectDeleted; }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 3f3c3adfb74f..540b25018743 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -39,6 +39,7 @@
 #include <editeng/pgrditem.hxx>
 #include <msfilter.hxx>
 #include <pam.hxx>
+#include <deletelistener.hxx>
 #include <doc.hxx>
 #include <IDocumentStylePoolAccess.hxx>
 #include <docary.hxx>
@@ -167,32 +168,6 @@ sal_uInt32 wwSectionManager::GetWWPageTopMargin() const
     return !maSegments.empty() ? maSegments.back().maSep.dyaTop : 0;
 }
 
-namespace
-{
-    class DeleteListener final : public SvtListener
-    {
-    private:
-        bool bObjectDeleted;
-    public:
-        explicit DeleteListener(SvtBroadcaster& rNotifier)
-            : bObjectDeleted(false)
-        {
-            StartListening(rNotifier);
-        }
-
-        virtual void Notify(const SfxHint& rHint) override
-        {
-            if (rHint.GetId() == SfxHintId::Dying)
-                bObjectDeleted = true;
-        }
-
-        bool WasDeleted() const
-        {
-            return bObjectDeleted;
-        }
-    };
-}
-
 sal_uInt16 SwWW8ImplReader::End_Footnote()
 {
     /*
@@ -252,7 +227,7 @@ sal_uInt16 SwWW8ImplReader::End_Footnote()
 
         SwFormatFootnote& rFormatFootnote = 
static_cast<SwFormatFootnote&>(pFN->GetAttr());
 
-        DeleteListener aDeleteListener(rFormatFootnote.GetNotifier());
+        SvtDeleteListener aDeleteListener(rFormatFootnote.GetNotifier());
 
         // read content of Ft-/End-Note
         Read_HdFtFootnoteText( pSttIdx, rDesc.mnStartCp, rDesc.mnLen, 
rDesc.meType);
@@ -2783,46 +2758,6 @@ void WW8TabDesc::MoveOutsideTable()
         *m_pIo->m_pPaM->GetPoint() = *m_xTmpPos->GetPoint();
 }
 
-namespace
-{
-    class SwTableNodeListener final : public SwClient
-    {
-    private:
-        SwModify* m_pModify;
-
-        virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) 
override
-        {
-            if (rHint.GetId() != SfxHintId::SwLegacyModify)
-                return;
-            auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
-            if (pLegacy->GetWhich() == RES_OBJECTDYING)
-            {
-                m_pModify->Remove(this);
-                m_pModify = nullptr;
-            }
-        }
-
-    public:
-        SwTableNodeListener(SwModify* pModify)
-            : m_pModify(pModify)
-        {
-            m_pModify->Add(this);
-        }
-
-        bool WasDeleted() const
-        {
-            return !m_pModify;
-        }
-
-        virtual ~SwTableNodeListener() override
-        {
-            if (!m_pModify)
-                return;
-            m_pModify->Remove(this);
-        }
-    };
-}
-
 void WW8TabDesc::FinishSwTable()
 {
     m_pIo->m_xRedlineStack->closeall(*m_pIo->m_pPaM->GetPoint());
@@ -2833,7 +2768,7 @@ void WW8TabDesc::FinishSwTable()
     m_pIo->m_pLastAnchorPos.reset();
 
     SwTableNode* pTableNode = m_pTable->GetTableNode();
-    SwTableNodeListener aListener(pTableNode);
+    SwDeleteListener aListener(*pTableNode);
     m_pIo->m_xRedlineStack = std::move(mxOldRedlineStack);
 
     if (xLastAnchorCursor)
commit e9c5346f4bc502f46ce763839c0d30bfd3d6b290
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Mar 28 11:05:34 2022 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:22 2022 +0200

    tdf#148235 Restore toolbar item to switch XForm to design mode
    
        commit 45b6f096e7ae86d0692ecdfd5b7069622d8a6efa
        Date:   Sun Oct 28 17:02:34 2018 +0100
    
            sw toolbars sync context toolbars between different apps
    
    had replaced the "Form Design" toolbar item to switch
    a complete XForm to design mode with an entry that
    switches the form controls to design mode instead.
    (The former one is labelled "Design Mode On/Off",
    the latter one just "Design Mode" in the English UI.)
    
    This meant that the XForm could no longer be switched
    to design mode from there, unless the toolbar was
    manually customized to add the entry back.
    
    This brings the previous toolbar item back.
    It also removes the one to switch the form controls
    to design mode again, since that one is already contained
    in the "Form Controls" toolbar, where it fits better.
    (And having two different toolbar items with almost
    identical labels but different functionality would
    probably be rather confusing.)
    
    Change-Id: Ia4c98dfa6ad8372eba08a9f08920153133a7f88d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132207
    Reviewed-by: Andreas Kainz <kain...@gmail.com>
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins
    (cherry picked from commit 4f9bf4201bb706cd19142f0805cfc4c859186cd4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132177
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sw/uiconfig/swxform/toolbar/formdesign.xml 
b/sw/uiconfig/swxform/toolbar/formdesign.xml
index 067ddff0675f..f748bcf68e2e 100644
--- a/sw/uiconfig/swxform/toolbar/formdesign.xml
+++ b/sw/uiconfig/swxform/toolbar/formdesign.xml
@@ -44,7 +44,7 @@
  <toolbar:toolbaritem xlink:href=".uno:LeaveGroup" toolbar:visible="false"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:SelectObject"/>
- <toolbar:toolbaritem xlink:href=".uno:SwitchControlDesignMode"/>
+ <toolbar:toolbaritem xlink:href=".uno:SwitchXFormsDesignMode"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ControlProperties"/>
  <toolbar:toolbaritem xlink:href=".uno:FormProperties"/>
commit 6251ee6e0b1c5bd3150c5af1bb7ada8d966beb71
Author:     Mark Hung <mark...@gmail.com>
AuthorDate: Sat Mar 19 21:18:54 2022 +0800
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:21 2022 +0200

    tdf#141671 fix destroyed pargraph style in exported RTF in MSO.
    
    Do not call MoveCharacterProperties() in RtfAttributeOutput
    ::EndParagraphProperties(). RtfAttributeOutput::ParagraphStyle() has
    emited run associated properties defined in paragraph style.
    Calling MoveCharacterProperties() again overwrites them.
    
    As this bug is only visible in MS Word, no unit test case is
    added.
    
    Change-Id: I6e5bfd12e8afa7dc286ca54448c1ff022aade31d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131848
    Tested-by: Jenkins
    Reviewed-by: Mark Hung <mark...@gmail.com>
    (cherry picked from commit 882045b934a3416cc48da2c4e30648892a419577)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132175
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 03f2ca851920..ac45ba2b7c2c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -384,7 +384,9 @@ void RtfAttributeOutput::EndParagraphProperties(
     const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/,
     const SwRedlineData* /*pRedlineParagraphMarkerInserted*/)
 {
-    const OString aProperties = MoveCharacterProperties(true);
+    // Do not call MoveCharacterProperties(),
+    // Otherwise associate properties in the paragraph style are ruined.
+    const OString aProperties = m_aStyles.makeStringAndClear();
     m_rExport.Strm().WriteOString(aProperties);
 }
 
commit a35144a935afb41fc129e46d5c5ac91b23451040
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Mon Mar 28 11:35:35 2022 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:19 2022 +0200

    tdf#148228 sw: fix Undo of tracked table deletion in Hide Changes mode
    
    In Hide Changes mode, tables didn't reappear during
    Undo of their tracked deletion, only by saving and
    reloading the document.
    
    Follow-up to commit 0c6221e1545e7b96d9df23cdc24302c28ae935b8
    "tdf#148227 sw: fix Undo of tracked row deletion in Hide Changes mode".
    
    Change-Id: Ifdc25ab4ae0be25a0c7559ee05b6af2e4f1aa8cf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132169
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit eda1a7aeff42c08e02295e5a8353a6d86a61a118)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132178
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 57f5e6649b70..559d47641a99 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1988,7 +1988,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146962)
     // only a single row is visible again
     assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
 
-    // check Undo
+    // tdf#148227 check Undo of tracked table row deletion
 
     dispatchCommand(mxComponent, ".uno:Undo", {});
     discardDumpedLayout();
@@ -2040,6 +2040,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147347)
     pXmlDoc = parseLayoutDump();
     // no visible row again
     assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 0);
+
+    // tdf#148228 check Undo of tracked table deletion
+
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+    discardDumpedLayout();
+    pXmlDoc = parseLayoutDump();
+    // This was 0
+    assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135014)
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index d5536b01e624..d5c15a0fbc4a 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -952,14 +952,20 @@ void SaveTable::RestoreAttr( SwTable& rTable, bool 
bMdfyBox )
 
     pFormat->InvalidateInSwCache(RES_ATTRSET_CHG);
 
+    // table without table frame
+    bool bHiddenTable = true;
+
     // for safety, invalidate all TableFrames
     SwIterator<SwTabFrame,SwFormat> aIter( *pFormat );
     for( SwTabFrame* pLast = aIter.First(); pLast; pLast = aIter.Next() )
+    {
         if( pLast->GetTable() == &rTable )
         {
             pLast->InvalidateAll();
             pLast->SetCompletePaint();
+            bHiddenTable = false;
         }
+    }
 
     // fill FrameFormats with defaults (0)
     pFormat = nullptr;
@@ -986,7 +992,19 @@ void SaveTable::RestoreAttr( SwTable& rTable, bool 
bMdfyBox )
     m_bModifyBox = false;
 
     if ( bHideChanges )
-        aTmpBox.MakeFrames( rTable );
+    {
+        if ( bHiddenTable )
+        {
+            SwTableNode* pTableNode = rTable.GetTableNode();
+            pTableNode->DelFrames();
+            SwNodeIndex aTableIdx( *pTableNode->EndOfSectionNode(), 1 );
+            pTableNode->MakeOwnFrames(&aTableIdx);
+        }
+        else
+        {
+            aTmpBox.MakeFrames( rTable );
+        }
+    }
 }
 
 void SaveTable::SaveContentAttrs( SwDoc* pDoc )
commit 2a9281b8dc029dc144a21866c031581a149dcb9f
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Fri Mar 25 15:27:21 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:14 2022 +0200

    tdf#148227 sw: fix Undo of tracked row deletion in Hide Changes mode
    
    In Hide Changes mode, table rows didn't reappear during
    Undo of tracked deletion of table rows, only by saving
    and reloading the document.
    
    Follow-up to commit a74c51025fa4519caaf461492e4ed8e68bd34885
    "tdf#146962 sw: hide deleted row at deletion in Hide Changes"
    and commit 794fd10af7361d5a64a0f8bfbe5c8b5f308617a5
    "tdf#147347 sw: hide deleted table at deletion in Hide Changes".
    
    Change-Id: I7ffe8a3687d1d385a549f7d438f7058d829ffd8c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132123
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 0c6221e1545e7b96d9df23cdc24302c28ae935b8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132049
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index b8cb857043b2..57f5e6649b70 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1987,6 +1987,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146962)
     pXmlDoc = parseLayoutDump();
     // only a single row is visible again
     assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
+
+    // check Undo
+
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+    discardDumpedLayout();
+    pXmlDoc = parseLayoutDump();
+    // This was 1
+    assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147347)
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 80b797384859..b203281506cd 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -2336,6 +2336,10 @@ void FndBox_::MakeFrames( SwTable &rTable )
     // And this for all instances of a table (for example in header/footer).
     sal_uInt16 nStPos = 0;
     sal_uInt16 nEndPos= rTable.GetTabLines().size() - 1;
+    SwRootFrame* pLayout =
+        
rTable.GetFrameFormat()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout();
+    bool bHideChanges = pLayout && pLayout->IsHideRedlines();
+
     if ( m_pLineBefore )
     {
         nStPos = rTable.GetTabLines().GetPos(
@@ -2389,9 +2393,14 @@ void FndBox_::MakeFrames( SwTable &rTable )
 // ???? or is this the last Follow of the table ????
                 pUpperFrame = pTable;
 
+            SwRedlineTable::size_type nRedlinePos = 0;
             for ( sal_uInt16 j = nStPos; j <= nEndPos; ++j )
-                ::lcl_InsertRow( *rTable.GetTabLines()[j],
+            {
+                SwTableLine * pLine = rTable.GetTabLines()[j];
+                if ( !bHideChanges || !pLine->IsDeleted(nRedlinePos) )
+                    ::lcl_InsertRow( *pLine,
                                 static_cast<SwLayoutFrame*>(pUpperFrame), 
pSibling );
+            }
             if ( pUpperFrame->IsTabFrame() )
                 static_cast<SwTabFrame*>(pUpperFrame)->SetCalcLowers();
         }
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index d3294b5446a3..d5536b01e624 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -34,6 +34,8 @@
 #include <IDocumentRedlineAccess.hxx>
 #include <IDocumentFieldsAccess.hxx>
 #include <IDocumentStylePoolAccess.hxx>
+#include <IDocumentLayoutAccess.hxx>
+#include <rootfrm.hxx>
 #include <editsh.hxx>
 #include <docary.hxx>
 #include <ndtxt.hxx>
@@ -936,6 +938,12 @@ void SaveTable::RestoreAttr( SwTable& rTable, bool 
bMdfyBox )
 {
     m_bModifyBox = bMdfyBox;
 
+    FndBox_ aTmpBox( nullptr, nullptr );
+    bool bHideChanges = 
rTable.GetFrameFormat()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()->IsHideRedlines();
+    // TODO delete/make frames only at changing line attribute TextChangesOnly 
(RES_PRINT) to true again
+    if ( bHideChanges )
+        aTmpBox.DelFrames( rTable );
+
     // first, get back attributes of TableFrameFormat
     SwFrameFormat* pFormat = rTable.GetFrameFormat();
     SfxItemSet& rFormatSet  = const_cast<SfxItemSet&>(static_cast<SfxItemSet 
const &>(pFormat->GetAttrSet()));
@@ -976,6 +984,9 @@ void SaveTable::RestoreAttr( SwTable& rTable, bool bMdfyBox 
)
 
     m_aFrameFormats.clear();
     m_bModifyBox = false;
+
+    if ( bHideChanges )
+        aTmpBox.MakeFrames( rTable );
 }
 
 void SaveTable::SaveContentAttrs( SwDoc* pDoc )
commit 00da8a63b511923ae983d1cca6464638d7357108
Author:     Aron Budea <aron.bu...@collabora.com>
AuthorDate: Sun Feb 13 06:57:16 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:11 2022 +0200

    tdf#147014 Image missing due to integer overflow
    
    32-bit awt::Point/Size/Rectangle cannot fit size of 1M rows with
    larger (eg. 5x the usual) height, and could overflow.
    
    This causes problems in 64-bit Linux builds and, since the
    following commit, in 64-bit Windows builds:
    3d90997fb6f232d8008df4d166d7b97b869c200f
    
    For now, clamp possibly overflowing values to 32-bit.
    
    Change-Id: Ifda7265703388abdfb47f523da4f0c5822358404
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129876
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132168

diff --git a/sc/qa/unit/data/xlsx/tdf147014.xlsx 
b/sc/qa/unit/data/xlsx/tdf147014.xlsx
new file mode 100644
index 000000000000..df4428795d9d
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf147014.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index f5ebba61e50b..70466d7816c8 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -204,6 +204,7 @@ public:
     void testTdf129940();
     void testTdf139612();
     void testTdf144740();
+    void testTdf147014();
     void testTdf139763ShapeAnchor();
     void testAutofilterNamedRangesXLSX();
     void testInvalidBareBiff5();
@@ -312,6 +313,7 @@ public:
     CPPUNIT_TEST(testTdf129940);
     CPPUNIT_TEST(testTdf139612);
     CPPUNIT_TEST(testTdf144740);
+    CPPUNIT_TEST(testTdf147014);
     CPPUNIT_TEST(testTdf139763ShapeAnchor);
     CPPUNIT_TEST(testAutofilterNamedRangesXLSX);
     CPPUNIT_TEST(testInvalidBareBiff5);
@@ -2882,6 +2884,22 @@ void ScFiltersTest2::testTdf144740()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest2::testTdf147014()
+{
+    ScDocShellRef xDocSh = loadDoc(u"tdf147014.", FORMAT_XLSX);
+    CPPUNIT_ASSERT_MESSAGE("Failed to load tdf147014.xlsx", xDocSh.is());
+    uno::Reference<frame::XModel> xModel = xDocSh->GetModel();
+    uno::Reference<sheet::XSpreadsheetDocument> xDoc(xModel, 
uno::UNO_QUERY_THROW);
+    uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), 
uno::UNO_QUERY_THROW);
+    uno::Reference<drawing::XDrawPageSupplier> 
xDrawPageSupplier(xIA->getByIndex(0),
+                                                                 
uno::UNO_QUERY_THROW);
+    xIA.set(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW);
+    // The sheet has a single shape, without the fix it was not imported, 
except in 32-bit builds
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape not imported", 
static_cast<sal_Int32>(1), xIA->getCount());
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest2::testTdf139763ShapeAnchor()
 {
     ScDocShellRef xDocSh = loadDoc(u"tdf139763ShapeAnchor.", FORMAT_XLSX);
diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index 40a99cdb444b..95625751d4a0 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -75,7 +75,7 @@
 #include <editeng/eeitem.hxx>
 #include <editeng/editobj.hxx>
 #include <editeng/flditem.hxx>
-#include <tools/UnitConversion.hxx>
+#include <tools/gen.hxx>
 
 namespace oox::xls {
 
@@ -96,6 +96,18 @@ void lclUpdateProgressBar( const ISegmentProgressBarRef& 
rxProgressBar, double f
         rxProgressBar->setPosition( fPosition );
 }
 
+// TODO Needed because input might be >32-bit (in 64-bit builds),
+//  or a negative, already overflown value (in 32-bit builds)
+sal_Int32 lclClampToNonNegativeInt32( tools::Long aVal )
+{
+    if ( aVal > SAL_MAX_INT32 || aVal < 0 )
+    {
+        SAL_WARN( "sc.filter", "Overflow detected, " << aVal << " does not fit 
into sal_Int32, or is negative." );
+        return SAL_MAX_INT32;
+    }
+    return static_cast<sal_Int32>( aVal );
+}
+
 } // namespace
 
 ColumnModel::ColumnModel() :
@@ -538,9 +550,9 @@ const awt::Size& WorksheetGlobals::getDrawPageSize() const
 
 awt::Point WorksheetGlobals::getCellPosition( sal_Int32 nCol, sal_Int32 nRow ) 
const
 {
-    awt::Point aPoint;
-    PropertySet aCellProp( getCell( ScAddress( nCol, nRow, getSheetIndex() ) ) 
);
-    aCellProp.getProperty( aPoint, PROP_Position );
+    const tools::Rectangle aMMRect( getScDocument().GetMMRect( nCol, nRow, 
nCol, nRow, getSheetIndex() ) );
+    awt::Point aPoint( lclClampToNonNegativeInt32( aMMRect.Left() ),
+                       lclClampToNonNegativeInt32( aMMRect.Top() ) );
     return aPoint;
 }
 
@@ -1360,8 +1372,9 @@ void WorksheetGlobals::groupColumnsOrRows( sal_Int32 
nFirstColRow, sal_Int32 nLa
 void WorksheetGlobals::finalizeDrawings()
 {
     // calculate the current drawing page size (after rows/columns are 
imported)
-    PropertySet aRangeProp( getCellRange( ScRange( 0, 0, getSheetIndex(), 
mrMaxApiPos.Col(), mrMaxApiPos.Row(), getSheetIndex() ) ) );
-    aRangeProp.getProperty( maDrawPageSize, PROP_Size );
+    const Size aPageSize( getScDocument().GetMMRect( 0, 0, mrMaxApiPos.Col(), 
mrMaxApiPos.Row(), getSheetIndex() ).GetSize() );
+    maDrawPageSize.Width = lclClampToNonNegativeInt32( aPageSize.Width() );
+    maDrawPageSize.Height = lclClampToNonNegativeInt32( aPageSize.Height() );
 
     // import DML and VML
     if( !maDrawingPath.isEmpty() )
commit 4fb0807ce06c63de070642a14a359905e9c49a1a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Mar 24 09:33:44 2022 +0000
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:09 2022 +0200

    forcepoint#85 Conditional jump or move depends on uninitialised value
    
    ==398461==    by 0xCDC7960: (anonymous namespace)::CopyUntil(char16_t*&, 
char16_t const*&, char16_t, bool) (strhelper.cxx:88)
    ==398461==    by 0xCDC839F: psp::WhitespaceToSpace(rtl::OUString const&, 
bool) (strhelper.cxx:294)
    ==398461==    by 0xCB54980: vcl::PDFWriterImpl::setOutlineItemText(int, 
rtl::OUString const&) (pdfwriter_impl.cxx:9875)
    ==398461==    by 0xCB547FF: vcl::PDFWriterImpl::createOutlineItem(int, 
rtl::OUString const&, int) (pdfwriter_impl.cxx:9851)
    ==398461==    by 0xCAF39B0: vcl::PDFWriter::CreateOutlineItem(int, 
rtl::OUString const&, int) (pdfwriter.cxx:383)
    ==398461==    by 0xCABD7C8: 
vcl::GlobalSyncData::PlayGlobalActions(vcl::PDFWriter&) 
(pdfextoutdevdata.cxx:250)
    ==398461==    by 0xCAC0628: 
vcl::PDFExtOutDevData::PlayGlobalActions(vcl::PDFWriter&) 
(pdfextoutdevdata.cxx:616)
    ==398461==    by 0x3D06EA0F: PDFExport::Export(rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(pdfexport.cxx:1004)
    
    Change-Id: I6bc086997851ee06531a4a9ae263e2b26edfba84
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132035
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 96e10b4865e8..782c9ce123e1 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -83,7 +83,8 @@ void CopyUntil( sal_Unicode*& pTo, const sal_Unicode*& pFrom, 
sal_Unicode cUntil
             *pTo = *pFrom;
             pTo++;
         }
-        pFrom++;
+        if( *pFrom )
+            pFrom++;
     } while( *pFrom && *pFrom != cUntil );
     // copy the terminating character unless zero or protector
     if( ! isProtect( *pFrom ) || bIncludeUntil )
commit 94f1ee12c9d797ecb1ae4e81b8539fbb8c9458ac
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Wed Mar 30 12:01:02 2022 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 30 12:06:06 2022 +0200

    fix
    
    Change-Id: I74ad7cc53c438f22f1de13f1b9b3d52cb9547b7d

diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index b8ee3e2c6e75..e104b4effdd7 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -353,7 +353,6 @@ CPPUNIT_TEST_FIXTURE(Test, testCameraRevolutionGrabBag)
     assertXPath(pXmlDoc, 
"//p:sp[1]/p:txBody/a:bodyPr/a:scene3d/a:camera/a:rot", 0);
     assertXPath(pXmlDoc, 
"//p:sp[2]/p:txBody/a:bodyPr/a:scene3d/a:camera/a:rot", 0);
 }
-}
 
 CPPUNIT_TEST_FIXTURE(Test, 
testTdf146690_endParagraphRunPropertiesNewLinesTextSize)
 {

Reply via email to