configure.ac                                                    |    2 
 editeng/qa/editeng/editeng.cxx                                  |   32 ++++++
 editeng/source/editeng/impedit4.cxx                             |   14 +-
 include/sfx2/sidebar/ControllerItem.hxx                         |    1 
 sc/source/core/data/documen4.cxx                                |    4 
 sc/source/core/data/postit.cxx                                  |    5 -
 sc/source/ui/app/inputhdl.cxx                                   |    7 -
 sd/source/ui/animations/SlideTransitionPane.cxx                 |    9 +
 sd/source/ui/unoidl/unomodel.cxx                                |    7 +
 sfx2/source/sidebar/ControllerItem.cxx                          |   27 +++--
 starmath/source/mathtype.cxx                                    |    5 -
 svx/source/svdraw/svdedxv.cxx                                   |    2 
 sw/qa/api/SwXAutoTextContainer.cxx                              |    9 +
 sw/qa/core/layout/calcmove.cxx                                  |   18 +++
 sw/qa/core/layout/data/ignore-top-margin-page-style-change.docx |binary
 sw/source/core/layout/calcmove.cxx                              |   10 ++
 sw/source/core/view/vdraw.cxx                                   |   49 
+++++-----
 sw/source/filter/ww8/docxexport.cxx                             |    1 
 sw/source/filter/ww8/rtfattributeoutput.cxx                     |    2 
 sw/source/filter/ww8/ww8par.cxx                                 |   13 ++
 sw/source/filter/xml/xmlimpit.cxx                               |    2 
 tools/qa/cppunit/test_urlobj.cxx                                |   44 ++++++++
 tools/source/fsys/urlobj.cxx                                    |   32 +++++-
 vcl/jsdialog/jsdialogbuilder.cxx                                |    5 -
 24 files changed, 242 insertions(+), 58 deletions(-)

New commits:
commit f49a7e4e5463b55780d5a65f43344e163600beac
Author:     Andras Timar <[email protected]>
AuthorDate: Wed Dec 18 12:43:08 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:43:08 2024 +0100

    Bump version to 24.04.10.3
    
    Change-Id: I18740027c55c8a20f210db915d4c0b5a52765a4b

diff --git a/configure.ac b/configure.ac
index 840b9a2eb0e8..36db23fb0102 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([Collabora Office],[24.04.10.2],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[24.04.10.3],[],[],[https://collaboraoffice.com/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard
commit 9bc34e79b97935be1bd2d18ef6ba5972110e98c9
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Dec 16 11:18:34 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:42:37 2024 +0100

    crashtesting: Error: attempt to increment a singular iterator.
    
    on loading tdf97831-15.xlsx
    
     #0  0x00007fffebea8664 in __pthread_kill_implementation () at 
/lib64/libc.so.6
     #1  0x00007fffebe4fc4e in raise () at /lib64/libc.so.6
     #2  0x00007fffebe37902 in abort () at /lib64/libc.so.6
     #3  0x00007fffebaa84e9 in __gnu_debug::_Error_formatter::_M_error() const 
[clone .cold] () at /lib64/libstdc++.so.6
     #4  0x00007fffa8d75183 in 
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, 
std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, 
std::__debug::vector<unsigned int, std::allocator<unsigned int> >, 
std::forward_iterator_tag>::operator++ (this=0x7fffffff9360) at 
/usr/include/c++/14/debug/safe_iterator.h:392
     #5  0x00007fffa8d73da2 in 
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, 
std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, 
std::__debug::vector<unsigned int, std::allocator<unsigned int> >, 
std::bidirectional_iterator_tag>::operator++ (this=0x7fffffff9360) at 
/usr/include/c++/14/debug/safe_iterator.h:679
     #6  0x00007fffa8d71fd2 in 
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, 
std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, 
std::__debug::vector<unsigned int, std::allocator<unsigned int> >, 
std::random_access_iterator_tag>::operator++ (this=0x7fffffff9360) at 
/usr/include/c++/14/debug/safe_iterator.h:849
     #7  0x00007fffa90d204e in ScDocument::GetCondResult (this=0x18fbcb0, 
rCell=..., rPos=..., rList=..., rIndex=...) at 
co-24.04/sc/source/core/data/documen4.cxx:816
     #8  0x00007fffa90d1ea1 in ScDocument::GetCondResult (this=0x18fbcb0, 
nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at 
co-24.04/sc/source/core/data/documen4.cxx:809
     #9  0x00007fffa8f2740d in ScColumn::GetNeededSize
         (this=0x7fffd000b4d0, nRow=1, pDev=0x1fa6690, 
nPPTX=0.064757526036325508, nPPTY=0.067000000000000004, rZoomX=..., rZoomY=..., 
bWidth=false, rOptions=..., ppPatternChange=0x7fffffff9ba8, 
bInPrintTwips=false) at co-24.04/sc/source/core/data/column2.cxx:139
     #10 0x00007fffa8f2b887 in ScColumn::GetOptimalHeight (this=0x7fffd000b4d0, 
rCxt=..., nStartRow=0, nEndRow=24, nMinHeight=256, nMinStart=0)
         at co-24.04/sc/source/core/data/column2.cxx:1084
     #11 0x00007fffa94a28b7 in (anonymous namespace)::GetOptimalHeightsInColumn 
(rCxt=..., rCol=..., nStartRow=0, nEndRow=24, pProgress=0x0, nProgressStart=0)
         at co-24.04/sc/source/core/data/table1.cxx:120
     #12 0x00007fffa94a47f2 in ScTable::SetOptimalHeight (this=0x1f584a0, 
rCxt=..., nSt
    
    where things go wrong earlier with:
    
     #2  0x00007fffacd716c3 in std::__new_allocator<unsigned int>::deallocate 
(this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at 
/usr/include/c++/14/bits/new_allocator.h:172
     #3  0x00007fffacd65215 in std::allocator<unsigned int>::deallocate 
(this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at 
/usr/include/c++/14/bits/allocator.h:208
     #4  std::allocator_traits<std::allocator<unsigned int> >::deallocate 
(__a=..., __p=0x7fff9c37acf0, __n=1) at 
/usr/include/c++/14/bits/alloc_traits.h:513
     #5  std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned 
int> >::_M_deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at 
/usr/include/c++/14/bits/stl_vector.h:389
     #6  0x00007fffacd60b88 in std::__cxx1998::_Vector_base<unsigned int, 
std::allocator<unsigned int> >::~_Vector_base (this=0x7fff9c1d2030, 
__in_chrg=<optimized out>)
         at /usr/include/c++/14/bits/stl_vector.h:368
     #7  0x00007fffacd60bef in std::__cxx1998::vector<unsigned int, 
std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2030, 
__in_chrg=<optimized out>)
         at /usr/include/c++/14/bits/stl_vector.h:738
     #8  0x00007fffacd5ecd6 in std::__debug::vector<unsigned int, 
std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2018, 
__in_chrg=<optimized out>) at /usr/include/c++/14/debug/vector:245
     #9  0x00007fffacd5feb6 in o3tl::sorted_vector<unsigned int, 
std::less<unsigned int>, o3tl::find_unique, true>::~sorted_vector 
(this=0x7fff9c1d2018, __in_chrg=<optimized out>)
         at co-24.04/include/o3tl/sorted_vector.hxx:39
     #10 0x00007fffacd7a71c in ScCondFormatItem::~ScCondFormatItem 
(this=0x7fff9c1d2000, __in_chrg=<optimized out>) at 
co-24.04/sc/source/core/data/attrib.cxx:722
     #11 0x00007fffacd7a748 in ScCondFormatItem::~ScCondFormatItem 
(this=0x7fff9c1d2000, __in_chrg=<optimized out>) at 
co-24.04/sc/source/core/data/attrib.cxx:722
     #12 0x00007fffef638513 in implCleanupItemEntry (rPool=..., 
pSource=0x7fff9c1d2000) at co-24.04/svl/source/items/itemset.cxx:473
     #13 0x00007fffef638e00 in SfxItemSet::ClearAllItemsImpl 
(this=0x7fffffff8d38) at co-24.04/svl/source/items/itemset.cxx:643
     #14 0x00007fffef638a02 in SfxItemSet::~SfxItemSet (this=0x7fffffff8d38, 
__in_chrg=<optimized out>) at co-24.04/svl/source/items/itemset.cxx:562
     #15 0x00007fffacd5f7d0 in SfxSetItem::~SfxSetItem (this=0x7fffffff8d20, 
__in_chrg=<optimized out>) at co-24.04/include/svl/setitem.hxx:27
     #16 0x00007fffacd5f88e in ScPatternAttr::~ScPatternAttr 
(this=0x7fffffff8d20, __in_chrg=<optimized out>) at 
co-24.04/sc/inc/patattr.hxx:54
     #17 0x00007fffaceab497 in ScColumn::ApplyAttr (this=0x7fff9c027960, 
nRow=1, rAttr=...) at co-24.04/sc/source/core/data/column.cxx:573
     #18 0x00007fffacf38508 in ScColumn::SetNumberFormat (this=0x7fff9c027960, 
nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/column2.cxx:3302
     #19 0x00007fffad4c3b55 in ScTable::SetNumberFormat (this=0x1d93840, 
nCol=7, nRow=1, nNumberFormat=99) at 
co-24.04/sc/source/core/data/table2.cxx:2315
     #20 0x00007fffad114bfa in ScDocument::SetNumberFormat (this=0x1c74100, 
rPos=..., nNumberFormat=99) at co-24.04/sc/source/core/data/document.cxx:3727
     #21 0x00007fffad356c65 in ScFormulaCell::InterpretTail (this=0x1cf9800, 
rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
         at co-24.04/sc/source/core/data/formulacell.cxx:2157
     #22 0x00007fffad354e67 in ScFormulaCell::Interpret (this=0x1cf9800, 
nStartOffset=-1, nEndOffset=-1) at 
co-24.04/sc/source/core/data/formulacell.cxx:1619
     #23 0x00007fffacf8e59f in ScFormulaCell::MaybeInterpret (this=0x1cf9800) 
at co-24.04/sc/inc/formulacell.hxx:470
     #24 0x00007fffad358dd4 in ScFormulaCell::IsValue (this=0x1cf9800) at 
co-24.04/sc/source/core/data/formulacell.cxx:2762
     #25 0x00007fffad025e1b in lcl_GetCellContent (rCell=..., bIsStr1=false, 
rArg=@0x7fffffff9208: 0, rArgStr="", pDoc=0x1c74100)
         at co-24.04/sc/source/core/data/conditio.cxx:764
     #26 0x00007fffad0286c5 in ScConditionEntry::IsCellValid 
(this=0x7fff9c1c73f0, rCell=..., rPos=...) at 
co-24.04/sc/source/core/data/conditio.cxx:1263
     #27 0x00007fffad02b18c in ScConditionalFormat::GetCellStyle 
(this=0x7fff9c02c1d0, rCell=..., rPos=...) at 
co-24.04/sc/source/core/data/conditio.cxx:1863
     #28 0x00007fffad0d20f8 in ScDocument::GetCondResult (this=0x1c74100, 
rCell=..., rPos=..., rList=..., rIndex=...) at 
co-24.04/sc/source/core/data/documen4.cxx:827
     #29 0x00007fffad0d1f91 in ScDocument::GetCondResult (this=0x1c74100, 
nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at 
co-24.04/sc/source/core/data/documen4.cxx:809
    
    very probably this is a problem since ItemSet rework of:
    
    commit 2b4cb63a4450aff4582994ca6ac701287da61ddd
    CommitDate: Tue Nov 21 16:08:57 2023 +0100
    
        Cleanup some ScPatternAttr specific stuff
    
    or similar of that sequence, and likely fixed in upstream later by:
    
    Author:     Armin Le Grand (allotropia) 
<[email protected]>
    CommitDate: Thu Dec 28 19:38:15 2023 +0100
    
        Decouple ScPatternAttr from SfxItemPool
    
    but that's a very sizable rework, so here apply a conservative simpler
    workaround to avoid the crash.
    
    Change-Id: I309953015d39bce4796a2cf99666603b00c34d24
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178579
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index e9a4fea132f2..40862f813ff5 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -813,8 +813,10 @@ const SfxItemSet* ScDocument::GetCondResult(
     ScRefCellValue& rCell, const ScAddress& rPos, const 
ScConditionalFormatList& rList,
     const ScCondFormatIndexes& rIndex ) const
 {
-    for (const auto& rItem : rIndex)
+    for (size_t i = 0, nLen = rIndex.size(); i < nLen; ++i)
     {
+        const auto& rItem = rIndex[i];
+
         const ScConditionalFormat* pForm = rList.GetFormat(rItem);
         if (!pForm)
             continue;
commit 3f02c4e1ceda3c772fdf282ed422f2624c3aea2e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Dec 16 12:22:07 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:42:02 2024 +0100

    crashtesting: unable to import docx export of forum-de2-10510.ott
    
    "No namespace defined for pic at sax/source/fastparser/fastparser.cxx:718"
    
    Change-Id: I417ee6608b63f27b92236ab96cc705d4261b8350
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178597
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index c02703184fc1..f8ed32ae415c 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1990,6 +1990,7 @@ rtl::Reference<FastAttributeList> 
DocxExport::MainXmlNamespaces()
     pAttr->add( FSNS( XML_xmlns, XML_w ), 
OUStringToOString(m_rFilter.getNamespaceURL(OOX_NS(doc)), 
RTL_TEXTENCODING_UTF8) );
     pAttr->add( FSNS( XML_xmlns, XML_w10 ), 
OUStringToOString(m_rFilter.getNamespaceURL(OOX_NS(vmlWord)), 
RTL_TEXTENCODING_UTF8) );
     pAttr->add( FSNS( XML_xmlns, XML_wp ), 
OUStringToOString(m_rFilter.getNamespaceURL(OOX_NS(dmlWordDr)), 
RTL_TEXTENCODING_UTF8) );
+    pAttr->add( FSNS( XML_xmlns, XML_pic ), 
OUStringToOString(m_rFilter.getNamespaceURL(OOX_NS(dmlPicture)), 
RTL_TEXTENCODING_UTF8) );
     pAttr->add( FSNS( XML_xmlns, XML_wps ), 
OUStringToOString(m_rFilter.getNamespaceURL(OOX_NS(wps)), 
RTL_TEXTENCODING_UTF8) );
     pAttr->add( FSNS( XML_xmlns, XML_wpg ), 
OUStringToOString(m_rFilter.getNamespaceURL(OOX_NS(wpg)), 
RTL_TEXTENCODING_UTF8) );
     pAttr->add( FSNS( XML_xmlns, XML_mc ), 
OUStringToOString(m_rFilter.getNamespaceURL(OOX_NS(mce)), 
RTL_TEXTENCODING_UTF8) );
commit 0fd9920be025cc28a9c2c971dac1ec79289f350f
Author:     Miklos Vajna <[email protected]>
AuthorDate: Tue Dec 17 16:02:48 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:41:53 2024 +0100

    tdf#164359 editeng RTF export: track unused parent styles recursively
    
    Start edit mode for the shape in the document, double-click on a word
    which has a "level 2" bullet associated with it -> crash.
    
    This is a regression from c8b607b7c0096c58dc5187262bf0133dee728d50
    (tdf#163883 editeng RTF export: fix broken offsets into the para style
    table, 2024-11-19), the direct cause is that ImpEditEngine::WriteRTF()
    maps all style pointers to a style ID and once we write the parent
    property in the style table, we unconditionally dereference our search
    result, because we know all styles should be in that map.
    
    The root of the problem seems to be that once parent styles are marked
    as used for the "only write used styles for the clipboard" case, those
    parents themselves can have parents, and we didn't mark those as used.
    Combined with the unconditional dereference, this leads to a crash. Fix
    this by walking up the parent chain till we get no parent.
    
    This assumes that importers create a valid document model, so there
    can't be loops while walking the parent chain. If that would be a
    problem in practice, we could check for that in the future.
    
    Change-Id: I4b416e78f26bf455040d95ee8ed220cfe870e33a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178677
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/editeng/qa/editeng/editeng.cxx b/editeng/qa/editeng/editeng.cxx
index 5a4ed4d051cc..6c44c557d9b3 100644
--- a/editeng/qa/editeng/editeng.cxx
+++ b/editeng/qa/editeng/editeng.cxx
@@ -128,6 +128,38 @@ CPPUNIT_TEST_FIXTURE(Test, testRTFStyleExportReferToStyle)
     // i.e. \s2 was used to refer to \s1, so the paragraph style was lost.
     CPPUNIT_ASSERT_EQUAL(xReader->m_aStyleValues[0], 
xReader->m_aStyleValues[1]);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testRTFStyleExportParentRecursive)
+{
+    // Given a document with text that has a paragraph style with a parent 
that itself has a parent:
+    EditEngine aEditEngine(mpItemPool.get());
+    rtl::Reference<SfxStyleSheetPool> xStyles(new 
SfxStyleSheetPool(*mpItemPool));
+    xStyles->Make("mystyle1", SfxStyleFamily::Para);
+    xStyles->Make("mystyle2", SfxStyleFamily::Para);
+    xStyles->Make("mystyle3", SfxStyleFamily::Para);
+    auto pStyle1 = static_cast<SfxStyleSheet*>(xStyles->Find("mystyle1", 
SfxStyleFamily::Para));
+    auto pStyle2 = static_cast<SfxStyleSheet*>(xStyles->Find("mystyle2", 
SfxStyleFamily::Para));
+    pStyle2->SetParent(pStyle1->GetName());
+    auto pStyle3 = static_cast<SfxStyleSheet*>(xStyles->Find("mystyle3", 
SfxStyleFamily::Para));
+    pStyle3->SetParent(pStyle2->GetName());
+    pStyle3->GetItemSet().SetRanges(svl::Items<WEIGHT_BOLD, EE_CHAR_WEIGHT>);
+    SvxWeightItem aItem(WEIGHT_BOLD, EE_CHAR_WEIGHT);
+    pStyle3->GetItemSet().Put(aItem);
+    aEditEngine.SetStyleSheetPool(xStyles.get());
+    OUString aText = u"mytest"_ustr;
+    aEditEngine.SetText(aText);
+    aEditEngine.SetStyleSheet(0, pStyle3);
+
+    // When copying to the clipboard as RTF:
+    // Without the accompanying fix in place, this test would have crashed 
here:
+    uno::Reference<datatransfer::XTransferable> xData
+        = aEditEngine.CreateTransferable(ESelection(0, 0, 0, 
aText.getLength()));
+
+    // Then make sure we produce RTF and not crash:
+    auto pData = dynamic_cast<EditDataObject*>(xData.get());
+    SvMemoryStream& rStream = pData->GetRTFStream();
+    CPPUNIT_ASSERT_GREATER(static_cast<sal_uInt64>(0), 
rStream.remainingSize());
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 1a5685256536..17d3c8cd7495 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -443,15 +443,19 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, 
EditSelection aSel, bool bCl
 
                 aUsedParagraphStyles.insert(pParaStyle);
 
-                const OUString& rParent = pParaStyle->GetParent();
-                if (!rParent.isEmpty())
+                // Collect parents of the style recursively.
+                OUString aParent = pParaStyle->GetParent();
+                while (!aParent.isEmpty())
                 {
                     auto pParent = static_cast<SfxStyleSheet*>(
-                        GetStyleSheetPool()->Find(rParent, 
pParaStyle->GetFamily()));
-                    if (pParent)
+                        GetStyleSheetPool()->Find(aParent, 
pParaStyle->GetFamily()));
+                    if (!pParent)
                     {
-                        aUsedParagraphStyles.insert(pParent);
+                        break;
                     }
+
+                    aUsedParagraphStyles.insert(pParent);
+                    aParent = pParent->GetParent();
                 }
 
                 const OUString& rFollow = pParaStyle->GetFollow();
commit 52fb90e2457f15baa6384697796b2e6f2b728e4d
Author:     Szymon Kłos <[email protected]>
AuthorDate: Tue Dec 17 12:11:36 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:41:47 2024 +0100

    jsdialog: check button before use after dynamic_cast
    
    Change-Id: I9e3587c3037af76eb1bec64ffa0a86c84d275906
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178648
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index bc5d7d21fd57..1808cab0fd02 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1432,7 +1432,10 @@ weld::Button* JSDialog::weld_widget_for_response(int 
nResponse)
 {
     PushButton* pButton
         = 
dynamic_cast<::PushButton*>(m_xDialog->get_widget_for_response(nResponse));
-    auto pWeldWidget = pButton ? new JSButton(m_pSender, pButton, nullptr, 
false) : nullptr;
+    if (!pButton)
+        return nullptr;
+
+    JSButton* pWeldWidget = new JSButton(m_pSender, pButton, nullptr, false);
 
     if (pWeldWidget)
     {
commit b043750df887b5fb796fa6a1ede65589f31b58ce
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Dec 13 11:33:25 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:41:27 2024 +0100

    crashtesting: assert on reimport of docx export of ooo102874-2.doc
    
     #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, 
nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
     #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, 
nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
     #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter 
(this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
     #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection 
(pShape=0x4c3a660, pObj=0x4c3d730) at 
core/sw/source/core/doc/textboxhelper.cxx:1638
     #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, 
pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
     #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
         (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, 
SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
         at core/sw/source/core/doc/textboxhelper.cxx:1652
     #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, 
rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
         at core/sw/source/core/draw/dcontact.cxx:1250
     #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, 
rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
         at core/sw/source/core/draw/dcontact.cxx:1005
     #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, 
eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at 
core/svx/source/svdraw/svdobj.cxx:2827
     #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, 
rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
     #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = 
{...}) at core/svx/source/svdraw/svdogrp.cxx:561
     #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
         
(unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error 
reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading 
variable: Unhandled DWARF expression opcode 0x0>) at 
core/sw/source/core/view/vdraw.cxx:274
     #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at 
core/sw/source/core/layout/pagechg.cxx:851
     #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, 
pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
     #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at 
core/sw/source/core/layout/pagechg.cxx:921
     #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, 
pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
         at core/sw/source/core/layout/pagechg.cxx:1518
     #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) 
at core/sw/source/core/layout/pagechg.cxx:1557
     #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction 
(this=0x7fffffff1a30, pRenderContext=0x5211510) at 
core/sw/source/core/layout/layact.cxx:694
     #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, 
pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
     #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at 
core/sw/source/core/view/viewsh.cxx:1197
     #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at 
core/sw/source/core/edit/edws.cxx:111
    
    Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 71a9de600abb46e9f8bf61fd3c139dd895c60c28)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178544
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 5a95053cd7b9..86d9d022175c 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -212,6 +212,7 @@ void SwViewShellImp::NotifySizeChg( const Size &rNewSz )
 
     OSL_ENSURE( m_pShell->getIDocumentDrawModelAccess().GetDrawModel(), 
"NotifySizeChg without DrawModel" );
     SdrPage* pPage = 
m_pShell->getIDocumentDrawModelAccess().GetDrawModel()->GetPage( 0 );
+    std::vector<SdrObject*> aCandidatesToMove;
     for (const rtl::Reference<SdrObject>& pObj : *pPage)
     {
         if( dynamic_cast<const SwVirtFlyDrawObj*>( pObj.get()) ==  nullptr )
@@ -252,27 +253,33 @@ void SwViewShellImp::NotifySizeChg( const Size &rNewSz )
                 continue;
             }
 
-            const tools::Rectangle aObjBound( pObj->GetCurrentBoundRect() );
-            if ( !aDocRect.Contains( aObjBound ) )
-            {
-                Size aSz;
-                if ( aObjBound.Left() > aDocRect.Right() )
-                    aSz.setWidth( (aDocRect.Right() - aObjBound.Left()) - 
MINFLY );
-                if ( aObjBound.Top() > aDocRect.Bottom() )
-                    aSz.setHeight( (aDocRect.Bottom() - aObjBound.Top()) - 
MINFLY );
-                if ( aSz.Width() || aSz.Height() )
-                    pObj->Move( aSz );
-
-                // Don't let large objects disappear to the top
-                aSz.setWidth(0);
-                aSz.setHeight(0);
-                if ( aObjBound.Right() < aDocRect.Left() )
-                    aSz.setWidth( (aDocRect.Left() - aObjBound.Right()) + 
MINFLY );
-                if ( aObjBound.Bottom() < aDocRect.Top() )
-                    aSz.setHeight( (aDocRect.Top() - aObjBound.Bottom()) + 
MINFLY );
-                if ( aSz.Width() || aSz.Height() )
-                    pObj->Move( aSz );
-            }
+            aCandidatesToMove.push_back(pObj.get());
+        }
+    }
+
+    // Moving a SdrObject can invalidate their positions in SdrPage's 
container of objects
+    for (const auto pObj : aCandidatesToMove)
+    {
+        const tools::Rectangle aObjBound( pObj->GetCurrentBoundRect() );
+        if ( !aDocRect.Contains( aObjBound ) )
+        {
+            Size aSz;
+            if ( aObjBound.Left() > aDocRect.Right() )
+                aSz.setWidth( (aDocRect.Right() - aObjBound.Left()) - MINFLY );
+            if ( aObjBound.Top() > aDocRect.Bottom() )
+                aSz.setHeight( (aDocRect.Bottom() - aObjBound.Top()) - MINFLY 
);
+            if ( aSz.Width() || aSz.Height() )
+                pObj->Move( aSz );
+
+            // Don't let large objects disappear to the top
+            aSz.setWidth(0);
+            aSz.setHeight(0);
+            if ( aObjBound.Right() < aDocRect.Left() )
+                aSz.setWidth( (aDocRect.Left() - aObjBound.Right()) + MINFLY );
+            if ( aObjBound.Bottom() < aDocRect.Top() )
+                aSz.setHeight( (aDocRect.Top() - aObjBound.Bottom()) + MINFLY 
);
+            if ( aSz.Width() || aSz.Height() )
+                pObj->Move( aSz );
         }
     }
 }
commit 491aa6038caa1fca93c700557addc165e67f6938
Author:     Miklos Vajna <[email protected]>
AuthorDate: Mon Dec 16 09:12:32 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:41:20 2024 +0100

    CppunitTest_sw_apitests: remove leftover myNewGroup2.bau before the test
    
    This fails for me in a tree that runs 'make check' and there was a
    previous 'make check' previously.
    
    Seems the trouble is that we have this C++ test creating an autotext
    .bau file, but there is also a Java one, so if we're not lucky with the
    order of these, the C++ one will fail with its hardcoded "must be 3 .bau
    files in instdir" assertion.
    
    Fix the immediate problem by removing the test .bau file before running
    the C++ test.
    
    A better, but more complex fix would be to create the test .bau file in
    the user profile (and not in instdir) for both the Java and C++ cases,
    and then none of these tests would influece other tests during 'make
    check'.
    
    Change-Id: I536d769db733515ec6a7d41fd7dbf601c4b582d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178548
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/sw/qa/api/SwXAutoTextContainer.cxx 
b/sw/qa/api/SwXAutoTextContainer.cxx
index 1f1fc3df1d49..7c116544d9bf 100644
--- a/sw/qa/api/SwXAutoTextContainer.cxx
+++ b/sw/qa/api/SwXAutoTextContainer.cxx
@@ -53,6 +53,15 @@ public:
         Reference<text::XAutoTextContainer> xAutoTextContainer
             = 
text::AutoTextContainer::create(comphelper::getProcessComponentContext());
 
+        try
+        {
+            // See qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java.
+            xAutoTextContainer->removeByName(u"myNewGroup2*1"_ustr);
+        }
+        catch (const container::NoSuchElementException&)
+        {
+        }
+
         Reference<container::XNameAccess> xNA(xAutoTextContainer, 
UNO_QUERY_THROW);
         Sequence<rtl::OUString> aNames = xNA->getElementNames();
         std::cout << aNames[0] << std::endl;
commit 703b7bbd6e20382b71dd4393b24c2c6925c46986
Author:     Justin Luth <[email protected]>
AuthorDate: Thu Dec 12 20:01:34 2024 -0500
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:41:13 2024 +0100

    tdf#163033 sc: fix crash when copying comment to another ScDocument
    
    Fixes a crash that started with
    7.6.0.2 commit eec038b982b4672ac8feb030cb6bae546fa8c901
    
    The crash occurred when comments were copied (without cloning)
    to another document and then the source document was closed,
    removing access to the (uncloned) comment.
    
    Also took the opportunity to put the (minutely) most expensive
    comparison at the end of the if clause.
    
    Change-Id: Ia5c1313aa17550f760d5f870c566f06b7abd598b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178394
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>
    (cherry picked from commit 6edc10c6b0b8322db63230b3a71e393437cbb7ac)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178420
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 695106ee5202..570dd28142f7 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -484,8 +484,9 @@ ScPostIt::~ScPostIt()
 
 std::unique_ptr<ScPostIt> ScPostIt::Clone( const ScAddress& rOwnPos, 
ScDocument& rDestDoc, const ScAddress& rDestPos, bool bCloneCaption ) const
 {
-    // tdf#117307: Don't clone comment, if it is in the same position
-    if ( (rOwnPos == rDestPos) && !mrDoc.IsClipboard() )
+    // tdf#117307: Don't clone comment, if it is in the same position in the 
same document
+    const bool bIsSameDoc = mrDoc.GetPool() == rDestDoc.GetPool();
+    if (bIsSameDoc && !mrDoc.IsClipboard() && rOwnPos == rDestPos)
         bCloneCaption = false;
     CreateCaptionFromInitData( rOwnPos );
     sal_uInt32 nPostItId = comphelper::LibreOfficeKit::isActive() ? 0 : 
mnPostItId;
commit cf11ac040a11bacaa4100f3ebbf5c9506c8bb318
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Dec 13 08:59:43 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:41:02 2024 +0100

    cid#1636690 Dereference after null check
    
    Change-Id: Ie32ffbe6148c2e12aa99068790fa7a1a1c0f27e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178400
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index ca5fc33a08f4..ecc7d7c16f07 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -4510,7 +4510,7 @@ OString SdXImpressDocument::getPresentationInfo() const
                             }
 
                             // Notes
-                            SdPage* pNotesPage = 
mpDoc->GetSdPage((pPage->GetPageNum() - 1) >> 1, PageKind::Notes);
+                            SdPage* pNotesPage = pPage ? 
mpDoc->GetSdPage((pPage->GetPageNum() - 1) >> 1, PageKind::Notes) : nullptr;
                             if (pNotesPage)
                             {
                                 SdrObject* pNotes = 
pNotesPage->GetPresObj(PresObjKind::Notes);
commit e9e489835a32b8da4e8d60b78c2a59a494ca090d
Author:     Darshan-upadhyay1110 <[email protected]>
AuthorDate: Wed Dec 11 15:31:30 2024 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:40:43 2024 +0100

    Broadcast the transition change
    
    - Now multiple user can see the simultaneous changes on transition sidebar
    
    Change-Id: Iae598d2cf106f3fdfb96ce409c31c69d196e8912
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178298
    Reviewed-by: Szymon Kłos <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index ed2c0c270f67..e30661a67fa0 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -543,10 +543,15 @@ void SlideTransitionPane::updateControls()
     {
          // ToDo: That 0 is "no transition" is documented nowhere except in the
         // CTOR of sdpage
+        OUString sSelectedId = mxTransitionsIconView->get_selected_id();
+        auto* pTransitionEntry = weld::fromId<TransitionEntry*>(sSelectedId);
+
         if( aEffect.mnType == 0 )
             mxTransitionsIconView->select(0);
-        else
+        else if(!pTransitionEntry)
             updateVariants(getPreset(aEffect));
+        else
+            updateVariants(pTransitionEntry->mpPreset);
     }
 
     if( aEffect.mbDurationAmbiguous )
@@ -876,6 +881,8 @@ impl::TransitionEffect 
SlideTransitionPane::getTransitionEffectFromControls() co
         aResult.mbLoopSoundAmbiguous = false;
     }
 
+    mpDrawDoc->Broadcast(SdrHint(SdrHintKind::ObjectChange));
+
     return aResult;
 }
 
commit 6e5c2f55009909bc288144d4fad58dac70167baf
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Dec 12 12:13:49 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:40:34 2024 +0100

    Hold vcl::Window by VclPtr
    
    suspicious that there is "delete pOLV" after retrieving a bare pointer,
    holdinf this by VclPtr looks sensible in any case.
    
    program/libmergedlo.so
            OutputDevice::LogicToPixel(tools::Rectangle const&) const
                    
/home/collabora/online-buildscripts/staging/builddir/libreoffice/vcl/source/outdev/map.cxx:906
    program/libmergedlo.so
            vcl::Window::LogicToPixel(tools::Rectangle const&, MapMode const&) 
const
                    
/home/collabora/online-buildscripts/staging/builddir/libreoffice/vcl/source/window/window3.cxx:158
    program/libmergedlo.so
            SdrObjEditView::SdrEndTextEdit(bool)
                    
/home/collabora/online-buildscripts/staging/builddir/libreoffice/svx/source/svdraw/svdedxv.cxx:1796
    program/../program/libsdlo.so
            sd::View::SdrEndTextEdit(bool)
                    
/home/collabora/online-buildscripts/staging/builddir/libreoffice/sd/source/ui/view/sdview.cxx:780
    program/../program/libsdlo.so
            sd::FuText::MouseButtonDown(MouseEvent const&)
                    
/home/collabora/online-buildscripts/staging/builddir/libreoffice/sd/source/ui/func/futext.cxx:290
    
    Change-Id: Ic9e8c8cf4256acfcb45daa4b9d72b0cb1cea635a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178358
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index bc410669546c..3339028ba2dc 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1782,7 +1782,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool 
bDontDeleteReally)
             i--;
             OutlinerView* pOLV = pTEOutliner->GetView(i);
             sal_uInt16 nMorePix = pOLV->GetInvalidateMore() + 10;
-            vcl::Window* pWin = pOLV->GetWindow();
+            VclPtr<vcl::Window> pWin = pOLV->GetWindow();
             tools::Rectangle aRect(pOLV->GetOutputArea());
             pTEOutliner->RemoveView(i);
             if (!mbTextEditDontDelete || i != 0)
commit 4e69f2fbec50a78c0fc8ea213ccbed81693b8214
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Wed Dec 11 22:41:44 2024 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:40:07 2024 +0100

    added nullptr check
    
    Change-Id: I5658108bf39b93579072af7b865b72817481586c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178329
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sfx2/source/sidebar/ControllerItem.cxx 
b/sfx2/source/sidebar/ControllerItem.cxx
index f08bb35d0907..de9f966b3658 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -48,7 +48,7 @@ ControllerItem::~ControllerItem()
 void ControllerItem::ReceiverNotifyItemUpdate(sal_uInt16 nSID, SfxItemState 
eState,
                                               const SfxPoolItem* pState)
 {
-    if (nSID == SID_ATTR_METRIC && comphelper::LibreOfficeKit::isActive())
+    if (nSID == SID_ATTR_METRIC && comphelper::LibreOfficeKit::isActive() && 
pState)
     {
         std::unique_ptr<SfxPoolItem> xClose(pState->Clone());
         MeasurementSystem eSystem
commit 81d82eb3c138cfb75894a279c0cf448ee7c2037d
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Dec 3 12:54:24 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:39:59 2024 +0100

    crashtesting: fix failure of forum-en-13617.odt to reload from .doc
    
    Change-Id: I907e282c9e7b75abca9a4c91ba12a2c57fc45f40
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177735
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index aca49f034ad0..1da9b0f4863d 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -3147,6 +3147,7 @@ void MathType::HandleMath(SmNode *pNode)
 
 void MathType::HandleAttributes(SmNode *pNode,int nLevel)
 {
+    sal_uInt64 nOldInsertion = nInsertion;
     int nOldPending = 0;
     SmNode *pTemp       = nullptr;
     SmTextNode *pIsText = nullptr;
@@ -3220,8 +3221,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
         if ((nInsertion != 0) && nullptr != (pTemp = pNode->GetSubNode(0)))
         {
             auto nPos = pS->Tell();
-            nInsertion--;
-            pS->Seek(nInsertion);
+            pS->Seek(nInsertion - 1);
             switch(pTemp->GetToken().eType)
             {
             case TACUTE: //Not Exportable
@@ -3274,6 +3274,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
             pS->Seek(nPos);
         }
     }
+    nInsertion = nOldInsertion;
 }
 
 void MathType::HandleText(SmNode *pNode)
commit 73a11637abcd63dd42bf29c3724743cab2b5620d
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Sat Dec 7 17:36:22 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:39:51 2024 +0100

    Fix check for further exotic protocols
    
    ...that were added in 59891cd3985469bc44dbd05c9fc704eeb07f0c78 "look at
    'embedded' protocols for protocols that support them"
    
    Change-Id: I42836d6fd27cd99e39ab07e626053f002a2651f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178047
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 8075798b22f2188530f57b8747589923bfd419ef)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178065
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178166
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index fff77e41f5e7..12635eba8dd3 100644
--- a/tools/qa/cppunit/test_urlobj.cxx
+++ b/tools/qa/cppunit/test_urlobj.cxx
@@ -354,6 +354,49 @@ namespace tools_urlobj
             }
         }
 
+        void testIsExoticProtocol() {
+            {
+                INetURLObject url(u"vnd.sun.star.pkg://slot%3A0");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::VndSunStarPkg, 
url.GetProtocol());
+                CPPUNIT_ASSERT(url.IsExoticProtocol());
+            }
+            {
+                INetURLObject 
url(u"vnd.sun.star.pkg://vnd.sun.star.pkg%3A%2F%2Fslot%253A0");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::VndSunStarPkg, 
url.GetProtocol());
+                CPPUNIT_ASSERT(url.IsExoticProtocol());
+            }
+            {
+                INetURLObject 
url(u"vnd.sun.star.pkg://http%3A%2F%2Fexample.net");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::VndSunStarPkg, 
url.GetProtocol());
+                CPPUNIT_ASSERT(!url.IsExoticProtocol());
+            }
+            {
+                INetURLObject url(u"vnd.sun.star.zip://slot%3A0");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol());
+                CPPUNIT_ASSERT(url.IsExoticProtocol());
+            }
+            {
+                INetURLObject url(u"vnd.sun.star.zip://slot%3A0/foo");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol());
+                CPPUNIT_ASSERT(url.IsExoticProtocol());
+            }
+            {
+                INetURLObject url(u"vnd.sun.star.zip://slot%3A0?foo");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol());
+                CPPUNIT_ASSERT(url.IsExoticProtocol());
+            }
+            {
+                INetURLObject url(u"vnd.sun.star.zip://slot%3A0#foo");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol());
+                CPPUNIT_ASSERT(url.IsExoticProtocol());
+            }
+            {
+                INetURLObject 
url(u"vnd.sun.star.zip://http%3A%2F%2Fexample.net");
+                CPPUNIT_ASSERT_EQUAL(INetProtocol::Generic, url.GetProtocol());
+                CPPUNIT_ASSERT(!url.IsExoticProtocol());
+            }
+        }
+
         // Change the following lines only, if you add, remove or rename
         // member functions of the current class,
         // because these macros are need by auto register mechanism.
@@ -371,6 +414,7 @@ namespace tools_urlobj
         CPPUNIT_TEST( testChangeScheme );
         CPPUNIT_TEST( testTd146382 );
         CPPUNIT_TEST( testParseSmart );
+        CPPUNIT_TEST( testIsExoticProtocol );
         CPPUNIT_TEST_SUITE_END(  );
     };                          // class createPool
 
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 785fbd09404f..a9ce65ecb538 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -4891,10 +4891,21 @@ bool INetURLObject::IsExoticProtocol() const
     {
         return true;
     }
-    if (isSchemeEqualTo(u"vnd.sun.star.pkg") || 
isSchemeEqualTo(u"vnd.sun.star.zip"))
+    if (m_eScheme == INetProtocol::VndSunStarPkg) {
+        return 
INetURLObject(GetHost(INetURLObject::DecodeMechanism::WithCharset))
+            .IsExoticProtocol();
+    }
+    if (isSchemeEqualTo(u"vnd.sun.star.zip"))
     {
-        OUString sPayloadURL = 
GetURLPath(INetURLObject::DecodeMechanism::WithCharset);
-        return sPayloadURL.startsWith(u"//") && 
INetURLObject(sPayloadURL.subView(2)).IsExoticProtocol();
+        OUString sPayloadURL = 
GetURLPath(INetURLObject::DecodeMechanism::NONE);
+        if (!sPayloadURL.startsWith(u"//")) {
+            return false;
+        }
+        auto const find = [&sPayloadURL](auto c) {
+            auto const n = sPayloadURL.indexOf(c, 2);
+            return n == -1 ? sPayloadURL.getLength() : n;
+        };
+        return INetURLObject(decode(sPayloadURL.subView(2, std::min(find('/'), 
find('?')) - 2), 
INetURLObject::DecodeMechanism::WithCharset)).IsExoticProtocol();
     }
     return false;
 }
commit 21c5da1b3dd235bdb462b629c0b8523267200e42
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Thu Dec 5 21:29:16 2024 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:39:39 2024 +0100

    lok: use locale units in dialogs and sidebar
    
    this patch updates fix for the dialog which were not fixed by 
e2708fecb34fb4084f8db5f2c5ffb4d8923002ca
    
    Change-Id: I7a9531d5af5b388cd6d763ea8c8d62ff4e7f12ca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177896
    Tested-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/include/sfx2/sidebar/ControllerItem.hxx 
b/include/sfx2/sidebar/ControllerItem.hxx
index a8f82195a496..5d7e7918a71b 100644
--- a/include/sfx2/sidebar/ControllerItem.hxx
+++ b/include/sfx2/sidebar/ControllerItem.hxx
@@ -70,6 +70,7 @@ private:
 
     virtual void StateChangedAtToolBoxControl (sal_uInt16 nSId, SfxItemState 
eState, const SfxPoolItem* pState) override;
     virtual void GetControlState (sal_uInt16 nSId, 
boost::property_tree::ptree& rState) override;
+    void ReceiverNotifyItemUpdate(sal_uInt16 nSID, SfxItemState eState, const 
SfxPoolItem* pState);
 
     ItemUpdateReceiverInterface& mrItemUpdateReceiver;
 };
diff --git a/sfx2/source/sidebar/ControllerItem.cxx 
b/sfx2/source/sidebar/ControllerItem.cxx
index 28248710f1a6..f08bb35d0907 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -45,12 +45,28 @@ ControllerItem::~ControllerItem()
     dispose();
 }
 
+void ControllerItem::ReceiverNotifyItemUpdate(sal_uInt16 nSID, SfxItemState 
eState,
+                                              const SfxPoolItem* pState)
+{
+    if (nSID == SID_ATTR_METRIC && comphelper::LibreOfficeKit::isActive())
+    {
+        std::unique_ptr<SfxPoolItem> xClose(pState->Clone());
+        MeasurementSystem eSystem
+            = 
LocaleDataWrapper(comphelper::LibreOfficeKit::getLocale()).getMeasurementSystemEnum();
+        FieldUnit eUnit = MeasurementSystem::Metric == eSystem ? FieldUnit::CM 
: FieldUnit::INCH;
+        
static_cast<SfxUInt16Item*>(xClose.get())->SetValue(static_cast<sal_uInt16>(eUnit));
+        mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, xClose.get());
+        return;
+    }
+    mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, pState);
+}
+
 void ControllerItem::StateChangedAtToolBoxControl (
     sal_uInt16 nSID,
     SfxItemState eState,
     const SfxPoolItem* pState)
 {
-    mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, pState);
+    ReceiverNotifyItemUpdate(nSID, eState, pState);
 }
 
 void ControllerItem::GetControlState (
@@ -64,14 +80,7 @@ void ControllerItem::RequestUpdate()
 {
     std::unique_ptr<SfxPoolItem> pState;
     const SfxItemState eState (GetBindings().QueryState(GetId(), pState));
-    if (GetId() == SID_ATTR_METRIC && comphelper::LibreOfficeKit::isActive())
-    {
-        MeasurementSystem eSystem
-            = 
LocaleDataWrapper(comphelper::LibreOfficeKit::getLocale()).getMeasurementSystemEnum();
-        FieldUnit eUnit = MeasurementSystem::Metric == eSystem ? FieldUnit::CM 
: FieldUnit::INCH;
-        
static_cast<SfxUInt16Item*>(pState.get())->SetValue(static_cast<sal_uInt16>(eUnit));
-    }
-    mrItemUpdateReceiver.NotifyItemUpdate(GetId(), eState, pState.get());
+    ReceiverNotifyItemUpdate(GetId(), eState, pState.get());
 }
 
 ControllerItem::ItemUpdateReceiverInterface::~ItemUpdateReceiverInterface()
commit 1a5ff6382c559f1ef8d5c0548182c3d736a6ccc0
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Dec 6 14:41:19 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:39:28 2024 +0100

    look at 'embedded' protocols too
    
    Change-Id: Ie99f5f5a390639bdc69397c831e0a32594a5030c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177981
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 59891cd3985469bc44dbd05c9fc704eeb07f0c78)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177987
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit b63aa51c55244ee67410201fa5e7c003427b1009)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178164
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 23204f43375b..785fbd09404f 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -4882,12 +4882,21 @@ OUString INetURLObject::CutExtension()
 
 bool INetURLObject::IsExoticProtocol() const
 {
-    return m_eScheme == INetProtocol::Slot ||
-           m_eScheme == INetProtocol::Macro ||
-           m_eScheme == INetProtocol::Uno ||
-           m_eScheme == INetProtocol::VndSunStarExpand ||
-           isSchemeEqualTo(u"vnd.sun.star.script") ||
-           isSchemeEqualTo(u"service");
+    if (m_eScheme == INetProtocol::Slot ||
+        m_eScheme == INetProtocol::Macro ||
+        m_eScheme == INetProtocol::Uno ||
+        m_eScheme == INetProtocol::VndSunStarExpand ||
+        isSchemeEqualTo(u"vnd.sun.star.script") ||
+        isSchemeEqualTo(u"service"))
+    {
+        return true;
+    }
+    if (isSchemeEqualTo(u"vnd.sun.star.pkg") || 
isSchemeEqualTo(u"vnd.sun.star.zip"))
+    {
+        OUString sPayloadURL = 
GetURLPath(INetURLObject::DecodeMechanism::WithCharset);
+        return sPayloadURL.startsWith(u"//") && 
INetURLObject(sPayloadURL.subView(2)).IsExoticProtocol();
+    }
+    return false;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f9f0e5ec88f7753cd417f3fd793465e5fa04a073
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Dec 6 16:57:26 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:39:18 2024 +0100

    crashtesting: failure to reimport forum-it-2308.odt rtf export
    
    Change-Id: I9908dea4aa822b7793ece91874de0282239bd17b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177991
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index f39492693c58..b6508007b42e 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2511,12 +2511,12 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const 
ww8::Frame& rFrame, const Poi
                         else
                             SAL_INFO("sw.rtf", __func__ << " unhandled form 
control: '"
                                                         << 
xInfo->getImplementationName() << "'");
-                        m_aRun->append('}');
                     }
                 }
             }
 
             m_aRun->append('}');
+            m_aRun->append('}');
         }
         break;
         case ww8::Frame::eOle:
commit 7b0467497a46fe0a0eff0d325116a5573bddcccf
Author:     Miklos Vajna <[email protected]>
AuthorDate: Fri Dec 6 14:09:28 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:39:06 2024 +0100

    tdf#164095 sw: fix missing top margin on paragraph after changing page style
    
    Open the bugdoc, go to the page after the section break, there is a top
    margin for the first paragraph there in Word, but not in Writer.
    
    This went wrong in commit abd90828cf101581a07b9d1c371a8c3156521e9f
    (tdf#160952 sw: ignore top margin of para on non-first pages with newer
    DOCX, 2024-05-14), where it seemed that all implicit and explicit page
    breaks want to ignore that top margin for the first paragraph.
    
    Turns out this is more complex: implicit breaks and page breaks should
    be followed by an ignore, but not paragraphs after "section break (next
    page)". So restore the margins for the RES_PAGEDESC, but continue to
    have them for RES_BREAK & implicit breaks.
    
    (cherry picked from commit ae7900dd42a65aaf60df6b21b9ad511496b209d9)
    
    Change-Id: If1fcf3077b81a705d3587bdae422dcfa16f1c17c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177982
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
index ad53df9bd0f4..2a14e4cf90dd 100644
--- a/sw/qa/core/layout/calcmove.cxx
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -82,6 +82,24 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginFly)
     // is a Writer feature.
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), nParaTopMargin);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginPageStyleChange)
+{
+    // Given a DOCX (>= Word 2013), section break (next page) between pages 2 
and 3:
+    createSwDoc("ignore-top-margin-page-style-change.docx");
+
+    // When laying out that document:
+    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+    // Then make sure that the top margin is not ignored on page 3:
+    sal_Int32 nParaTopMargin
+        = getXPath(pXmlDoc, "/root/page[3]/body/txt/infos/prtBounds"_ostr, 
"top"_ostr).toInt32();
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 2000
+    // - Actual  : 0
+    // i.e. the top margin was ignored, which is incorrect.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2000), nParaTopMargin);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin-page-style-change.docx 
b/sw/qa/core/layout/data/ignore-top-margin-page-style-change.docx
new file mode 100644
index 000000000000..ea7d16d8851f
Binary files /dev/null and 
b/sw/qa/core/layout/data/ignore-top-margin-page-style-change.docx differ
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 0aac409e155b..89a133bd2393 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1114,6 +1114,16 @@ bool SwFrame::IsCollapseUpper() const
         return false;
     }
 
+    // Avoid the ignore after applying a new page style (but do it after page 
breaks).
+    const SwTextNode* pTextNode = pTextFrame->GetTextNodeForParaProps();
+    if (pTextNode)
+    {
+        if (pTextNode->HasSwAttrSet() && 
pTextNode->GetSwAttrSet().HasItem(RES_PAGEDESC))
+        {
+            return false;
+        }
+    }
+
     return true;
 }
 
commit 7e694202634bbe753b13d4857683604041fce41b
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Dec 5 20:05:43 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:38:57 2024 +0100

    crashtesting: HLINK_MARK embedded null import from forum-mso-en4-7137.doc
    
    which causes problems on export to docx. Sanitize at the original
    import.
    
    Change-Id: I8b9fa86465c455fe872c41386889dc54e38eb9ec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177907
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index cc50f8d76c17..4911a1841501 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -347,6 +347,8 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, 
SwDocShell const * pDocS
     if( ::get_flag( nFlags, WW8_HLINK_MARK ) )
     {
         xTextMark.reset(new 
OUString(read_uInt32_lenPrefixed_uInt16s_ToOUString(rStrm)));
+        if (clipToFirstNull(*xTextMark))
+            SAL_WARN("sw.ww8", "HLINK_MARK with embedded null, truncating to: 
" << *xTextMark);
     }
 
     if (!xLongName && xShortName)
commit 26f130d79361dcb42a708826db0baa6430c92c2b
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Dec 5 12:56:34 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:38:48 2024 +0100

    crashtesting: HLINK embedded null import from ooo98294-1.doc
    
    which causes problems on export to docx. Sanitize at the original
    import.
    
    Change-Id: I3b5521dac6a2b6926db6362d33500b11f0a69098
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177871
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 624fdc2f9b6d..cc50f8d76c17 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -216,6 +216,15 @@ namespace
     }
 }
 
+// returns true if an embedded null was found
+static bool clipToFirstNull(OUString& rStr)
+{
+    sal_Int32 nEmbeddedNullIdx = rStr.indexOf(0);
+    if (nEmbeddedNullIdx != -1)
+        rStr = rStr.copy(0, nEmbeddedNullIdx);
+    return nEmbeddedNullIdx != -1;
+}
+
 void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * 
pDocShell, struct HyperLinksTable& hlStr)
 {
     // (0x01B8) HLINK
@@ -347,6 +356,8 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, 
SwDocShell const * pDocS
 
     if (xLongName)
     {
+        if (clipToFirstNull(*xLongName))
+            SAL_WARN("sw.ww8", "HLINK with embedded null, truncating to: " << 
*xLongName);
         if (xTextMark)
         {
             if (xLongName->isEmpty())
commit 5906c2c7017f7063b91d45ff54acf9a11296dc47
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Dec 4 11:34:25 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:38:38 2024 +0100

    crashtesting: failure to reimport forum-es-2526.odt after export to odt
    
    2nd arg to copy is len, not index. Probably a problem since:
    
    commit 12a7a3d57d3dcf222b13fa9143c37736f8ea3d0b
    CommitDate: Thu Sep 3 15:33:36 2020 +0200
    
        Fix crashtest fdo77855.odt
    
    in forum-es-2526.odt the input has:
    
    fo:border-=".009cm solid #595959"
    
    where 'fo:border-' is an unknown attr and "fo" ends up truncated to "f".
    On export and reimport the 'f' is further truncated to '' and we assert
    on this oddness.
    
    Change-Id: Ie85d81947504bf15b9caefb92477c7f977eb5cb9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177807
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sw/source/filter/xml/xmlimpit.cxx 
b/sw/source/filter/xml/xmlimpit.cxx
index eaabf789e2ac..085231e02254 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -227,7 +227,7 @@ void SvXMLImportItemMapper::importXMLUnknownAttributes( 
SfxItemSet& rSet,
                 int i = sName.indexOf(':');
                 if (i != -1)
                 {
-                    sPrefix = sName.copy(0, i-1);
+                    sPrefix = sName.copy(0, i);
                     sName = sName.copy(i+1);
                 }
                 // the sax parser doesn't reject these, strangely
commit b0a96b8eae4f44b679effd580567b6daab7fe782
Author:     Xisco Fauli <[email protected]>
AuthorDate: Fri Sep 6 22:41:22 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:38:23 2024 +0100

    tdf#162829: Dereference before null check
    
    Regression from:
    commit 1de1c47471278db2344c986e9d597d6a05e559e9
    Author: Gökay Şatır <[email protected]>
    Date:   Thu Feb 22 13:54:06 2024 +0300
    
        Moving parts of readonly checks from model to view.
    
    Change-Id: I8d0ba914df909bc1a13ce7181b6d05cd0216e468
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172978
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit f42932f23c20122cb7b4537efaf943a8b481752e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177844
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 06f046346e10..5131639bf7b6 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3951,7 +3951,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, 
bool bStartEdit /* = false
         UpdateActiveView();
         bool bNewView = DataChanging( nChar );
 
-        if (bProtected || (pActiveViewSh->GetViewShell() && 
pActiveViewSh->GetViewShell()->IsLokReadOnlyView())) // Protected cell?
+        if (bProtected || (pActiveViewSh && pActiveViewSh->GetViewShell() && 
pActiveViewSh->GetViewShell()->IsLokReadOnlyView())) // Protected cell?
             bUsed = true;                           // Don't forward KeyEvent
         else                                        // Changes allowed
         {
@@ -4185,12 +4185,11 @@ void ScInputHandler::InputCommand( const CommandEvent& 
rCEvt )
         UpdateActiveView();
         bool bNewView = DataChanging( 0, true );
 
-        if (!bProtected && !(pActiveViewSh->GetViewShell() && 
pActiveViewSh->GetViewShell()->IsLokReadOnlyView())) // changes allowed
+        if (!bProtected && pActiveViewSh && !(pActiveViewSh->GetViewShell() && 
pActiveViewSh->GetViewShell()->IsLokReadOnlyView())) // changes allowed
         {
             if (bNewView)                           // create new edit view
             {
-                if (pActiveViewSh)
-                    pActiveViewSh->GetViewData().GetDocShell()->PostEditView( 
mpEditEngine.get(), aCursorPos );
+                pActiveViewSh->GetViewData().GetDocShell()->PostEditView( 
mpEditEngine.get(), aCursorPos );
                 UpdateActiveView();
                 if (eMode==SC_INPUT_NONE)
                     if (pTableView || pTopView)
commit 4f3f0b1671e9cf5318cdcbf3c090f2ac36b82c28
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Dec 4 09:58:08 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Dec 18 12:38:09 2024 +0100

    crash see on SdXImpressDocument::getPartInfo for missing page
    
    possibly after uno.HideSlide
    
     #0  0x00007e697b8c0b97 in SdPage::GetPageInfo (this=this@entry=0x0, 
jsonWriter=...)
         at sd/source/core/sdpage.cxx:1751
     #1  0x00007e697bbda0ab in SdXImpressDocument::getPartInfo (this=<optimized 
out>, nPart=<optimized out>)
         at sd/source/ui/unoidl/unomodel.cxx:3692
     #2  0x00007e698ae7e078 in doc_getPartInfo (pThis=0x121017c0, nPart=9)
         at desktop/source/lib/init.cxx:4176
     #3  0x000000000059bcf4 in LOKitHelper::getPartData (part=9, 
loKitDocument=0x121017c0) at kit/KitHelper.hpp:47
     #4  LOKitHelper::fetchPartsData (loKitDocument=0x121017c0, 
resultInfo=std::unordered_map with 6 elements = {...}, partsCount=84, 
mode=@0x7ffec727bd58: 1)
         at kit/KitHelper.hpp:91
     #5  0x000000000059c6a3 in LOKitHelper::documentStatus 
(loKitDocument=0x121017c0) at kit/KitHelper.hpp:164
     #6  0x000000000057fb7a in ChildSession::selectClientPart (this=0x556fe60, 
tokens=...) at kit/ChildSession.cpp:2964
     #7  0x000000000058a88f in ChildSession::_handleInput (this=<optimized 
out>, buffer=<optimized out>, length=<optimized out>) at 
kit/ChildSession.cpp:495
     #8  0x000000000061c63f in Session::handleMessage (this=0x556fe60, 
data=std::vector of length 29, capacity 29 = {...})
    
    Change-Id: Ib4e532b31cdc6a69f9e54317699f426c12de35d2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177781
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index f7b061a04d1e..ca5fc33a08f4 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -3860,7 +3860,10 @@ OUString SdXImpressDocument::getPartInfo(int nPart)
     jsonWriter.put("innerSpacesX", innerDots.getWidth() ? 
gridCoarse.getWidth() / innerDots.getWidth() : 0);
     jsonWriter.put("innerSpacesY", innerDots.getHeight() ? 
gridCoarse.getHeight() / innerDots.getHeight() : 0);
 
-    pSdPage->GetPageInfo(jsonWriter);
+    if (pSdPage)
+        pSdPage->GetPageInfo(jsonWriter);
+    else
+        SAL_WARN("sd", "getPartInfo request for SdPage " << nPart << " that 
does not exist!");
 
     return OStringToOUString(jsonWriter.finishAndGetAsOString(), 
RTL_TEXTENCODING_UTF8);
 }

Reply via email to