.gitreview                                                                 |   
 2 
 android/source/res/values-ab/strings.xml                                   |   
 2 
 android/source/res/values-ast/strings.xml                                  |   
 2 
 android/source/res/values-cs/strings.xml                                   |   
69 
 android/source/res/values-fa/strings.xml                                   |  
127 
 android/source/res/values-gl/strings.xml                                   |  
133 
 android/source/res/values-in/strings.xml                                   |  
102 
 android/source/res/values-it/strings.xml                                   |   
12 
 android/source/res/values-sk/strings.xml                                   |   
27 
 basctl/source/dlged/dlged.cxx                                              |   
 2 
 basic/source/comp/loops.cxx                                                |   
 5 
 canvas/source/cairo/cairo_canvashelper.cxx                                 |   
 2 
 comphelper/source/misc/configuration.cxx                                   |  
107 
 configure.ac                                                               |   
 2 
 cui/source/dialogs/tipofthedaydlg.cxx                                      |   
28 
 cui/source/inc/tipofthedaydlg.hxx                                          |   
 2 
 dictionaries                                                               |   
 2 
 download.lst                                                               |   
34 
 editeng/inc/editattr.hxx                                                   |   
 1 
 editeng/source/editeng/impedit3.cxx                                        |   
 4 
 external/boost/UnpackedTarball_boost.mk                                    |   
 1 
 external/boost/windows-no-utf8-locales.patch.0                             |   
23 
 external/expat/0001-Fix-compiler-warnings.patch                            |   
47 
 external/expat/UnpackedTarball_expat.mk                                    |   
 3 
 external/libxml2/ExternalPackage_libxml2.mk                                |   
 2 
 external/libxml2/UnpackedTarball_libxml2.mk                                |   
 2 
 external/libxml2/libxml2-global-symbols.patch                              |   
 8 
 external/nss/README                                                        |   
26 
 filter/source/config/cache/filtercache.cxx                                 |  
224 
 filter/source/config/cache/filtercache.hxx                                 |   
41 
 filter/source/xsltfilter/LibXSLTTransformer.cxx                            |   
16 
 framework/qa/cppunit/dispatchtest.cxx                                      |   
 3 
 helpcompiler/source/HelpCompiler.cxx                                       |   
14 
 include/comphelper/configuration.hxx                                       |   
22 
 include/test/unoapi_test.hxx                                               |   
 5 
 oox/source/drawingml/table/predefined-table-styles.cxx                     |   
20 
 oox/source/drawingml/table/tablecell.cxx                                   |   
12 
 readlicense_oo/license/CREDITS.fodt                                        | 
4271 +++++-----
 sc/inc/filterentries.hxx                                                   |   
 7 
 sc/inc/typedstrdata.hxx                                                    |   
10 
 sc/qa/extras/macros-test.cxx                                               |   
27 
 sc/qa/extras/testdocuments/tdf159412.fods                                  |   
41 
 sc/qa/uitest/autofilter/autofilterBugs.py                                  |   
24 
 sc/qa/uitest/autofilter2/tdf158314_EmptyError.py                           |   
94 
 sc/qa/uitest/autofilter2/tdf159420.py                                      |  
126 
 sc/qa/unit/data/ods/tdf160003_page_anchored_object.ods                     
|binary
 sc/qa/unit/scshapetest.cxx                                                 |   
24 
 sc/source/core/data/colcontainer.cxx                                       |   
 5 
 sc/source/core/data/column3.cxx                                            |   
19 
 sc/source/core/data/documen3.cxx                                           |   
 2 
 sc/source/core/data/document.cxx                                           |   
18 
 sc/source/core/data/drwlayer.cxx                                           |   
 2 
 sc/source/core/data/table2.cxx                                             |   
 2 
 sc/source/core/data/table4.cxx                                             |   
 2 
 sc/source/core/tool/compiler.cxx                                           |   
10 
 sc/source/core/tool/typedstrdata.cxx                                       |   
54 
 sc/source/filter/rtf/rtfparse.cxx                                          |   
 4 
 sc/source/ui/app/transobj.cxx                                              |   
46 
 sc/source/ui/cctrl/checklistmenu.cxx                                       |   
 9 
 sc/source/ui/view/gridwin.cxx                                              |   
 7 
 sc/source/ui/view/printfun.cxx                                             |   
 3 
 scripting/source/basprov/basscript.cxx                                     |   
19 
 sd/qa/unit/data/pptx/tdf156718.pptx                                        
|binary
 sd/qa/unit/data/tdf159666.odg                                              
|binary
 sd/qa/unit/import-tests.cxx                                                |   
70 
 sd/qa/unit/uiimpress.cxx                                                   |   
21 
 sd/source/ui/animations/CustomAnimationList.cxx                            |   
 8 
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx                      |   
12 
 sfx2/source/view/viewfrm.cxx                                               |  
173 
 sfx2/uiconfig/ui/panel.ui                                                  |   
 3 
 solenv/gbuild/platform/com_MSC_class.mk                                    |   
 8 
 svgio/inc/svgstyleattributes.hxx                                           |   
 3 
 svgio/inc/svgsymbolnode.hxx                                                |   
15 
 svgio/qa/cppunit/SvgImportTest.cxx                                         |   
36 
 svgio/qa/cppunit/data/tdf156834.svg                                        |   
 3 
 svgio/qa/cppunit/data/tdf158445.svg                                        |   
 5 
 svgio/qa/cppunit/data/tdf159594.svg                                        |   
 7 
 svgio/source/svgreader/svgcharacternode.cxx                                |   
 1 
 svgio/source/svgreader/svgstyleattributes.cxx                              |   
 4 
 svgio/source/svgreader/svgsymbolnode.cxx                                   |   
92 
 svl/source/numbers/zforfind.cxx                                            |   
21 
 svx/source/accessibility/AccessibleShape.cxx                               |   
 2 
 svx/source/svdraw/svdhdl.cxx                                               |  
101 
 sw/CppunitTest_sw_ooxmlexport21.mk                                         |   
14 
 sw/Library_sw.mk                                                           |   
 1 
 sw/Module_sw.mk                                                            |   
 1 
 sw/inc/IDocumentMarkAccess.hxx                                             |   
 7 
 sw/inc/anchoreddrawobject.hxx                                              |   
 4 
 sw/inc/anchoredobject.hxx                                                  |   
 4 
 sw/inc/pagedesc.hxx                                                        |   
 8 
 sw/qa/core/text/data/tdf159336.odt                                         
|binary
 sw/qa/core/text/itrform2.cxx                                               |   
40 
 sw/qa/core/text/text.cxx                                                   |   
37 
 sw/qa/extras/accessibility/dialogs.cxx                                     |   
 2 
 sw/qa/extras/layout/data/tdf129357.fodt                                    |   
48 
 sw/qa/extras/layout/layout2.cxx                                            |   
17 
 sw/qa/extras/layout/layout3.cxx                                            |   
 4 
 sw/qa/extras/ooxmlexport/data/tdf153909_followTextFlow.docx                
|binary
 sw/qa/extras/ooxmlexport/data/tdf158044.odt                                
|binary
 sw/qa/extras/ooxmlexport/data/tdf158597.docx                               
|binary
 sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx           
|binary
 sw/qa/extras/ooxmlexport/ooxmlexport21.cxx                                 |  
358 
 sw/qa/extras/ooxmlimport/data/tdf154370.docx                               
|binary
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx                                  |   
77 
 sw/qa/extras/rtfexport/data/fdo55504-1-min.rtf                             |   
49 
 sw/qa/extras/rtfexport/data/piccrop.rtf                                    |   
74 
 sw/qa/extras/rtfexport/data/tdf136445-1-min.rtf                            |   
17 
 sw/qa/extras/rtfexport/data/tdf158586_pageBreak1_header.rtf                |   
17 
 sw/qa/extras/rtfexport/data/tdf158826_extraCR.rtf                          |   
23 
 sw/qa/extras/rtfexport/rtfexport2.cxx                                      |   
 3 
 sw/qa/extras/rtfexport/rtfexport8.cxx                                      |  
116 
 sw/qa/extras/rtfimport/data/fdo52052.rtf                                   |   
 2 
 sw/qa/extras/rtfimport/rtfimport.cxx                                       |   
 7 
 sw/qa/extras/uiwriter/uiwriter5.cxx                                        |   
 4 
 sw/qa/extras/uiwriter/uiwriter7.cxx                                        |   
40 
 sw/qa/extras/uiwriter/uiwriter9.cxx                                        |   
41 
 sw/source/core/access/AccessibilityCheck.cxx                               |   
 4 
 sw/source/core/doc/DocumentContentOperationsManager.cxx                    |   
14 
 sw/source/core/doc/docbm.cxx                                               |   
10 
 sw/source/core/doc/docdraw.cxx                                             |   
17 
 sw/source/core/doc/docfmt.cxx                                              |   
33 
 sw/source/core/doc/doclay.cxx                                              |   
 6 
 sw/source/core/draw/dcontact.cxx                                           |   
 8 
 sw/source/core/draw/dview.cxx                                              |   
23 
 sw/source/core/fields/postithelper.cxx                                     |   
 4 
 sw/source/core/frmedt/fefly1.cxx                                           |   
22 
 sw/source/core/frmedt/feshview.cxx                                         |   
48 
 sw/source/core/frmedt/fews.cxx                                             |   
 4 
 sw/source/core/inc/MarkManager.hxx                                         |   
 1 
 sw/source/core/inc/flyfrm.hxx                                              |   
 4 
 sw/source/core/layout/anchoreddrawobject.cxx                               |   
64 
 sw/source/core/layout/anchoredobject.cxx                                   |  
148 
 sw/source/core/layout/atrfrm.cxx                                           |   
 2 
 sw/source/core/layout/calcmove.cxx                                         |   
 8 
 sw/source/core/layout/flowfrm.cxx                                          |   
16 
 sw/source/core/layout/fly.cxx                                              |   
52 
 sw/source/core/layout/flycnt.cxx                                           |   
10 
 sw/source/core/layout/flyincnt.cxx                                         |   
 2 
 sw/source/core/layout/flylay.cxx                                           |  
117 
 sw/source/core/layout/frmtool.cxx                                          |   
39 
 sw/source/core/layout/layact.cxx                                           |   
 2 
 sw/source/core/layout/objectformattertxtfrm.cxx                            |   
17 
 sw/source/core/layout/pagechg.cxx                                          |   
26 
 sw/source/core/layout/pagedesc.cxx                                         |   
76 
 sw/source/core/layout/sortedobjs.cxx                                       |   
22 
 sw/source/core/layout/tabfrm.cxx                                           |   
32 
 sw/source/core/layout/trvlfrm.cxx                                          |   
74 
 sw/source/core/layout/wsfrm.cxx                                            |   
 6 
 sw/source/core/objectpositioning/anchoredobjectposition.cxx                |   
 2 
 sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx         |   
 4 
 sw/source/core/text/EnhancedPDFExportHelper.cxx                            |   
 7 
 sw/source/core/text/frmform.cxx                                            |   
 2 
 sw/source/core/text/itratr.cxx                                             |   
 2 
 sw/source/core/text/itrcrsr.cxx                                            |   
 5 
 sw/source/core/text/itrform2.cxx                                           |   
13 
 sw/source/core/text/porfld.cxx                                             |   
 7 
 sw/source/core/text/porfly.cxx                                             |   
 2 
 sw/source/core/text/porlay.cxx                                             |   
 2 
 sw/source/core/text/txtfly.cxx                                             |  
178 
 sw/source/core/text/txtfrm.cxx                                             |   
 2 
 sw/source/core/txtnode/ndtxt.cxx                                           |   
 6 
 sw/source/core/undo/untbl.cxx                                              |   
 9 
 sw/source/core/unocore/unomap1.cxx                                         |   
 1 
 sw/source/core/unocore/unoobj.cxx                                          |   
14 
 sw/source/core/unocore/unoobj2.cxx                                         |   
12 
 sw/source/core/unocore/unotext.cxx                                         |   
 3 
 sw/source/filter/writer/writer.cxx                                         |   
 6 
 sw/source/filter/ww8/wrtw8nds.cxx                                          |  
152 
 sw/source/filter/ww8/wrtww8.hxx                                            |   
 2 
 sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx                       |   
 5 
 sw/source/uibase/dochdl/swdtflvr.cxx                                       |   
 3 
 sw/source/uibase/docvw/AnnotationWin2.cxx                                  |   
 2 
 sw/source/uibase/docvw/edtwin.cxx                                          |   
64 
 sw/source/uibase/inc/edtwin.hxx                                            |   
 3 
 sw/source/uibase/shells/drwbassh.cxx                                       |   
16 
 sw/source/uibase/uiview/view2.cxx                                          |   
13 
 sw/source/uibase/utlui/content.cxx                                         |   
20 
 toolkit/source/awt/vclxwindow.cxx                                          |   
 1 
 unotools/source/config/optionsdlg.cxx                                      |   
 4 
 vcl/qa/cppunit/pdfexport/data/LinkPages.fodt                               |  
138 
 vcl/qa/cppunit/pdfexport/pdfexport.cxx                                     |  
591 +
 vcl/qt5/QtWidget.cxx                                                       |   
 3 
 vcl/source/treelist/svimpbox.cxx                                           |   
 2 
 vcl/source/window/window.cxx                                               |   
 1 
 wizards/source/scriptforge/SF_Array.xba                                    |   
 2 
 writerfilter/qa/cppunittests/dmapper/DomainMapper.cxx                      |   
 6 
 writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx          |   
50 
 writerfilter/qa/cppunittests/dmapper/data/floattable-footnote-redline.docx 
|binary
 writerfilter/qa/cppunittests/dmapper/data/floattable-header-overlap.docx   
|binary
 writerfilter/qa/cppunittests/dmapper/data/tdf158360.docx                   
|binary
 writerfilter/source/dmapper/DomainMapper.cxx                               |   
12 
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx                   |   
27 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx                          |  
395 
 writerfilter/source/dmapper/DomainMapper_Impl.hxx                          |  
124 
 writerfilter/source/dmapper/GraphicImport.cxx                              |   
12 
 writerfilter/source/dmapper/PropertyIds.cxx                                |   
 1 
 writerfilter/source/dmapper/PropertyIds.hxx                                |   
 1 
 writerfilter/source/dmapper/SdtHelper.cxx                                  |   
 2 
 writerfilter/source/dmapper/SettingsTable.cxx                              |   
 2 
 writerfilter/source/dmapper/SettingsTable.hxx                              |   
 2 
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx                      |   
14 
 writerfilter/source/rtftok/rtfdispatchflag.cxx                             |   
 4 
 writerfilter/source/rtftok/rtfdispatchsymbol.cxx                           |   
14 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx                             |   
39 
 writerfilter/source/rtftok/rtfdocumentimpl.hxx                             |   
 7 
 writerfilter/source/rtftok/rtfsdrimport.hxx                                |   
 1 
 writerfilter/source/rtftok/rtfsprm.cxx                                     |   
20 
 writerfilter/source/rtftok/rtfsprm.hxx                                     |   
 2 
 writerfilter/source/rtftok/rtfvalue.cxx                                    |   
13 
 writerfilter/source/rtftok/rtfvalue.hxx                                    |   
 6 
 xmlsecurity/source/xmlsec/saxhelper.cxx                                    |   
15 
 211 files changed, 7248 insertions(+), 3291 deletions(-)

New commits:
commit 6c265c8362cd6faa4a250aa57d359a1515c534c3
Merge: 2f1cf8dd8b23 eb1980420545
Author:     Thorsten Behrens <thorsten.behr...@allotropia.de>
AuthorDate: Mon Mar 18 15:42:06 2024 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Mon Mar 18 15:42:06 2024 +0100

    Merge tag 'libreoffice-7.6.6.1' into feature/allo_contract45533
    
    Tag libreoffice-7.6.6.1
    
    Change-Id: I8501d2f958f492473418b3bcf1d504e47d29c70e

diff --cc dictionaries
index c13eb080daf6,388e57d67058..9e9a632d6168
--- a/dictionaries
+++ b/dictionaries
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit c13eb080daf643f007424750d324fb62d6adfe3e
 -Subproject commit 388e57d67058715606aa059f71aac3a3e5aa64c2
++Subproject commit 9e9a632d61687de061a9b376678be5e86841b7a7
commit eb19804205451adb2fc3d6563f0c9693064ecad2
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Tue Mar 5 18:49:06 2024 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Tue Mar 5 18:49:06 2024 +0100

    Version 7.6.6.1, tag libreoffice-7.6.6.1

diff --git a/dictionaries b/dictionaries
index 5736d6d655ef..388e57d67058 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit 5736d6d655ef99f1c8d16d6cfda8f500e905ef73
+Subproject commit 388e57d67058715606aa059f71aac3a3e5aa64c2
diff --git a/helpcontent2 b/helpcontent2
index 3affb7e7199b..4a02b074fcce 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 3affb7e7199bb13613cc4ef47cb64e2ad1d8cdde
+Subproject commit 4a02b074fcceda26f6ec04a41c8a78138d8e1374
diff --git a/translations b/translations
index 45eb5736ddba..26f64f52db9c 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 45eb5736ddba4aefbfe6a95529e54745a3031927
+Subproject commit 26f64f52db9c732ac426e2b9ed7286332c7dec11
commit f10f32c8c8b7cb54acff40bf27884c144047a5e3
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Tue Mar 5 18:46:40 2024 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Tue Mar 5 18:46:40 2024 +0100

    bump product version to 7.6.6.1
    
    Change-Id: I8b7380ff83a5547b55ae9d0cbb9442d512f2cfb0

diff --git a/configure.ac b/configure.ac
index 56847969129e..ca0808baea3e 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([LibreOffice],[7.6.6.0.0+],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[7.6.6.1],[],[],[http://documentfoundation.org/])
 
 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 7a512a554b8ce21ae1c56ef0e011caed945df36e
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Tue Mar 5 18:41:41 2024 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Tue Mar 5 18:41:41 2024 +0100

    Branch libreoffice-7-6-6
    
    This is 'libreoffice-7-6-6' - the stable branch for the 7.6.6 release.
    Only very safe changes, reviewed by three people are allowed.
    
    If you want to commit more complicated fix for the next 7.6.x release,
    please use the 'libreoffice-7-6' branch.
    
    If you want to build something cool, unstable, and risky, use master.

diff --git a/.gitreview b/.gitreview
index 4abdc9f5827b..d62be94cc319 100644
--- a/.gitreview
+++ b/.gitreview
@@ -3,5 +3,5 @@ host=gerrit.libreoffice.org
 port=29418
 project=core
 defaultremote=logerrit
-defaultbranch=libreoffice-7-6
+defaultbranch=libreoffice-7-6-6
 
diff --git a/dictionaries b/dictionaries
index 7aa013596e97..5736d6d655ef 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit 7aa013596e97ce58bb4def48e6952062ae52cf5f
+Subproject commit 5736d6d655ef99f1c8d16d6cfda8f500e905ef73
diff --git a/helpcontent2 b/helpcontent2
index 219add06db0e..3affb7e7199b 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 219add06db0e2193170b462ef74956d559ffcbaa
+Subproject commit 3affb7e7199bb13613cc4ef47cb64e2ad1d8cdde
diff --git a/translations b/translations
index 2ae460df24b1..45eb5736ddba 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 2ae460df24b108145f3315e64aae3552af52db66
+Subproject commit 45eb5736ddba4aefbfe6a95529e54745a3031927
commit ba23eadc772ad983a810addd4df068fd43a7f7d5
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Mar 1 12:14:52 2024 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Tue Mar 5 18:35:01 2024 +0100

    tdf#159955: fix custom page number
    
    Change-Id: I1a56a4ba266dfb3c21e3b77263ecaa44b4e6dad5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164210
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    (cherry picked from commit d440dcfcaf688544a7a6d8bc478048159e5200f0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164281
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 585f38b7cae1..28a096f67a84 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -284,14 +284,21 @@ OUString SwView::GetPageStr(sal_uInt16 nPhyNum, 
sal_uInt16 nVirtNum, const OUStr
                     ? SwResId(STR_PAGE_COUNT_PRINTED)
                     : (extra.isEmpty() ? SwResId(STR_PAGE_COUNT) : 
SwResId(STR_PAGE_COUNT_CUSTOM)));
     aStr = aStr.replaceFirst("%1", OUString::number(nPhyNum));
-    aStr = aStr.replaceFirst("%2", OUString::number(nPageCount));
     if (nPageCount != nPrintedPageCount)
     {
+        aStr = aStr.replaceFirst("%2", OUString::number(nPageCount));
         aStr = aStr.replaceFirst("%3", OUString::number(nPrintedPhyNum));
         aStr = aStr.replaceFirst("%4", OUString::number(nPrintedPageCount));
     }
-    else
-        aStr = aStr.replaceFirst("%3", extra);
+    else {
+        if (extra.isEmpty())
+            aStr = aStr.replaceFirst("%2", OUString::number(nPageCount));
+        else
+        {
+            aStr = aStr.replaceFirst("%2", extra);
+            aStr = aStr.replaceFirst("%3", OUString::number(nPageCount));
+        }
+    }
 
     return aStr;
 }
commit 1434802f097030ce13823aa44034b51106e75af2
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Feb 19 09:59:45 2024 +0000
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Tue Mar 5 18:34:17 2024 +0100

    tdf#155961 put some spacing to the right of the "more options" toolbar
    
    the gtk overlay scrolling is all very pretty, but you can't click things
    underneath, and there is no discoverable way to dismiss the scrollbar
    to get "under" it, move this widget to the left a little to try and get
    it outside the hotzone for the overlay scrolling.
    
    Change-Id: Ic9d48be4a29754e9aff0f29dbe32bea762b6cc09
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163543
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 81359241b6292b178eb8b2050aaad2bbc980def4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163613
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/sfx2/uiconfig/ui/panel.ui b/sfx2/uiconfig/ui/panel.ui
index 981a2f2d6017..fb40097ee6d6 100644
--- a/sfx2/uiconfig/ui/panel.ui
+++ b/sfx2/uiconfig/ui/panel.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="sfx">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkBox" id="Panel">
@@ -64,6 +64,7 @@
           <object class="GtkToolbar" id="toolbar">
             <property name="can-focus">True</property>
             <property name="no-show-all">True</property>
+            <property name="margin-end">9</property>
             <property name="toolbar-style">icons</property>
             <property name="show-arrow">False</property>
             <property name="icon_size">2</property>
commit 494091dd5440f141471f25e18c459e10c1bc4ff1
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Tue Mar 5 18:27:25 2024 +0100
Commit:     Gerrit Code Review <ger...@gerrit.libreoffice.org>
CommitDate: Tue Mar 5 18:27:25 2024 +0100

    Update git submodules
    
    * Update translations from branch 'libreoffice-7-6'
      to 2ae460df24b108145f3315e64aae3552af52db66
      - update translations for 7.6.6 rc1
    
        and force-fix errors using pocheck
    
        Change-Id: Ic01ba3a9ba7c2d63ab2db1892779305cc8942098

diff --git a/translations b/translations
index 36885fbc6d49..2ae460df24b1 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 36885fbc6d49abbdb55f6ef9728ef5f49f61c8af
+Subproject commit 2ae460df24b108145f3315e64aae3552af52db66
commit 45fb563b6e93833a4dbe31bf0b0cc0a51e83f791
Author:     Regina Henschel <rb.hensc...@t-online.de>
AuthorDate: Sun Mar 3 17:19:49 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Mar 4 22:02:49 2024 +0100

    tdf#160003 use correct sheet in clipboard for test
    
    ..whether a page anchored object is contained in the to be copied area.
    
    Change-Id: I816e342770332e6d751b57a38e5ebabe33feb16a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164307
    Tested-by: Jenkins
    Reviewed-by: Regina Henschel <rb.hensc...@t-online.de>
    (cherry picked from commit 199523b553957936dc31b8c3556ef2e47c6bc3a1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164374
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/unit/data/ods/tdf160003_page_anchored_object.ods 
b/sc/qa/unit/data/ods/tdf160003_page_anchored_object.ods
new file mode 100644
index 000000000000..565eb1bf6a26
Binary files /dev/null and 
b/sc/qa/unit/data/ods/tdf160003_page_anchored_object.ods differ
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index b5083544f114..5e4827005388 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -1207,6 +1207,30 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, 
testTdf154821_shape_in_group)
     CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aRectOrig, aRectReload, 1);
 }
 
+CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160003_copy_page_anchored)
+{
+    // Load a document, which has a chart anchored to page on sheet2. 
Copy&paste to other document
+    // had lost the chart object.
+    createScDoc("ods/tdf160003_page_anchored_object.ods");
+
+    // copy range with chart
+    goToCell("$Sheet2.$A$1:$L$24");
+    dispatchCommand(mxComponent, ".uno:Copy", {});
+
+    // close document and create new one
+    createScDoc();
+
+    // paste clipboard
+    goToCell("$Sheet1.$A$1");
+    dispatchCommand(mxComponent, ".uno:Paste", {});
+
+    // Make sure the chart object exists.
+    ScDocument* pDoc = getScDoc();
+    ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+    const SdrPage* pPage = pDrawLayer->GetPage(0);
+    CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 8e989012b4e8..23837e357203 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1993,7 +1993,7 @@ void ScDrawLayer::CopyFromClip(ScDrawLayer* pClipModel, 
SCTAB nSourceTab,
         }
         else // Object is anchored to page.
         {
-            aSrcObjStart = pClipDoc->GetRange(nClipTab, 
pOldObject->GetCurrentBoundRect()).aStart;
+            aSrcObjStart = pClipDoc->GetRange(nSourceTab, 
pOldObject->GetCurrentBoundRect()).aStart;
         }
         if (!rSourceRange.Contains(aSrcObjStart))
         {
commit 1240e6ab49b4d2e8c6f61b94e92ec8a3ed430fbe
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Mar 3 21:00:23 2024 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Mar 4 16:08:13 2024 +0100

    Resolves: tdf#159854 Trigger text is black on dark grey in Animation sidebar
    
    in dark mode
    
    Change-Id: I2cbf9b7d14a501c309a02dd3080511f527f9e1d1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164277
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sd/source/ui/animations/CustomAnimationList.cxx 
b/sd/source/ui/animations/CustomAnimationList.cxx
index fecbfa38c52e..c90ed9426cd6 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -310,12 +310,10 @@ void 
CustomAnimationListEntryItem::PaintTrigger(vcl::RenderContext& rRenderConte
 
     ::tools::Rectangle aOutRect(rRect);
 
-    // fill the background
-    Color 
aColor(rRenderContext.GetSettings().GetStyleSettings().GetDialogColor());
-
     rRenderContext.Push();
-    rRenderContext.SetFillColor(aColor);
+    
rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetDialogColor());
     rRenderContext.SetLineColor();
+    // fill the background with the dialog bg color
     rRenderContext.DrawRect(aOutRect);
 
     // Erase the four corner pixels to make the rectangle appear rounded.
@@ -335,6 +333,8 @@ void 
CustomAnimationListEntryItem::PaintTrigger(vcl::RenderContext& rRenderConte
     aOutRect.AdjustTop( nVertBorder );
     aOutRect.AdjustBottom( -nVertBorder );
 
+    // Draw the text with the dialog text color
+    
rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetDialogTextColor());
     rRenderContext.DrawText(aOutRect, 
rRenderContext.GetEllipsisString(msDescription, aOutRect.GetWidth()));
     rRenderContext.Pop();
 }
commit 2b4a485493add72ec474a3eb175069af6fbeac8b
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Jan 30 13:57:18 2024 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sat Mar 2 10:09:56 2024 +0100

    tdf#159420: Show empty option even if empty is filtered out
    
    in other columns
    
    Regression from 89e032e9c4c51f52680c7d8bacf59ab2a34f2180
    "tdf#158314: show Empty and Error entries as non-selected and inactive...
    ...when hidden by autofilter."
    
    The mbHasEmpties variable was added in
    9c1826d98065c30411cbf2e731560165ca2b7668
    "sc-perf: do not add a million empty filter entries just to sort and
    discard"
    
    Change-Id: Ie0d81fd57f68038fac62cb6a3442e93ed547167a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162752
    Tested-by: Jenkins
    Reviewed-by: Kevin Suo <suokunl...@126.com>
    (cherry picked from commit 98b4ba33a0a698e738db46d5916063de6e74fb96)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164121
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sc/inc/filterentries.hxx b/sc/inc/filterentries.hxx
index 02110c879b03..1ec3f22a324b 100644
--- a/sc/inc/filterentries.hxx
+++ b/sc/inc/filterentries.hxx
@@ -18,11 +18,14 @@ struct ScFilterEntries
 {
     std::vector<ScTypedStrData> maStrData;
     bool                        mbHasDates;
-    bool                        mbHasEmpties;
+    bool                        mbHasHiddenEmpties;
+    bool                        mbHasUnHiddenEmpties;
     std::set<Color>             maTextColors;
     std::set<Color>             maBackgroundColors;
 
-    ScFilterEntries() : mbHasDates(false), mbHasEmpties(false) {}
+    ScFilterEntries() : mbHasDates(false),
+                        mbHasHiddenEmpties(false),
+                        mbHasUnHiddenEmpties(false) {}
 
     std::vector<ScTypedStrData>::iterator       begin()         { return 
maStrData.begin(); }
     std::vector<ScTypedStrData>::iterator       end()           { return 
maStrData.end(); }
diff --git a/sc/qa/uitest/autofilter2/tdf159420.py 
b/sc/qa/uitest/autofilter2/tdf159420.py
new file mode 100644
index 000000000000..87ee159d2223
--- /dev/null
+++ b/sc/qa/uitest/autofilter2/tdf159420.py
@@ -0,0 +1,126 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.calc import enter_text_to_cell
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import is_row_hidden
+
+class tdf159420(UITestCase):
+
+    def testTdf159420(self):
+        with self.ui_test.create_doc_in_start_center("calc") as calcDoc:
+            xCalcDoc = self.xUITest.getTopFocusWindow()
+            xGridWin = xCalcDoc.getChild("grid_window")
+
+            # Fill the sheet with test data
+            enter_text_to_cell(xGridWin, "A1", "a")
+            enter_text_to_cell(xGridWin, "A2", "2")
+            enter_text_to_cell(xGridWin, "A3", "2")
+            enter_text_to_cell(xGridWin, "A4", "2")
+            enter_text_to_cell(xGridWin, "A5", "4")
+
+            enter_text_to_cell(xGridWin, "B1", "b")
+            enter_text_to_cell(xGridWin, "B2", "")
+            enter_text_to_cell(xGridWin, "B3", "")
+            enter_text_to_cell(xGridWin, "B4", "8")
+            enter_text_to_cell(xGridWin, "B5", "8")
+
+            enter_text_to_cell(xGridWin, "C1", "c")
+
+            # Select the data range and set autofilter
+            xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A1:C5"}))
+            self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+
+            # Click the autofilter dropdown in column A
+            xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": 
"", "COL": "0", "ROW": "0"}))
+            xFloatWindow = self.xUITest.getFloatWindow()
+            xCheckListMenu = xFloatWindow.getChild("FilterDropDown")
+            xTreeList = xCheckListMenu.getChild("check_list_box")
+
+            self.assertEqual(2, len(xTreeList.getChildren()))
+
+            xEntry1 = xTreeList.getChild(0)
+            self.assertEqual("2", get_state_as_dict(xEntry1)['Text'])
+            self.assertEqual("true", get_state_as_dict(xEntry1)['IsChecked'])
+            self.assertEqual("false", 
get_state_as_dict(xEntry1)['IsSemiTransparent'])
+
+            xEntry2 = xTreeList.getChild(1)
+            self.assertEqual("4", get_state_as_dict(xEntry2)['Text'])
+            self.assertEqual("true", get_state_as_dict(xEntry2)['IsChecked'])
+            self.assertEqual("false", 
get_state_as_dict(xEntry2)['IsSemiTransparent'])
+
+            #  Uncheck the second entry
+            xEntry2.executeAction("CLICK", tuple())
+
+            xOkButton = xFloatWindow.getChild("ok")
+            xOkButton.executeAction("CLICK", tuple())
+
+            # Check that only row#2 is visible
+            self.assertFalse(is_row_hidden(calcDoc, 1))
+            self.assertFalse(is_row_hidden(calcDoc, 2))
+            self.assertFalse(is_row_hidden(calcDoc, 3))
+            self.assertTrue(is_row_hidden(calcDoc, 4))
+
+            # Click the autofilter dropdown in column B
+            xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": 
"", "COL": "1", "ROW": "0"}))
+            xFloatWindow = self.xUITest.getFloatWindow()
+            xCheckListMenu = xFloatWindow.getChild("FilterDropDown")
+            xTreeList = xCheckListMenu.getChild("check_list_box")
+
+            self.assertEqual(2, len(xTreeList.getChildren()))
+
+            xEntry1 = xTreeList.getChild(0)
+            self.assertEqual("(empty)", get_state_as_dict(xEntry1)['Text'])
+            self.assertEqual("true", get_state_as_dict(xEntry1)['IsChecked'])
+            self.assertEqual("false", 
get_state_as_dict(xEntry1)['IsSemiTransparent'])
+
+            xEntry2 = xTreeList.getChild(1)
+            self.assertEqual("8", get_state_as_dict(xEntry2)['Text'])
+            self.assertEqual("true", get_state_as_dict(xEntry2)['IsChecked'])
+            self.assertEqual("false", 
get_state_as_dict(xEntry2)['IsSemiTransparent'])
+
+            #  Uncheck the first entry
+            xEntry1.executeAction("CLICK", tuple())
+
+            # Close the popup window
+            xOkButton = xFloatWindow.getChild("ok")
+            xOkButton.executeAction("CLICK", tuple())
+
+            self.assertTrue(is_row_hidden(calcDoc, 1))
+            self.assertTrue(is_row_hidden(calcDoc, 2))
+            self.assertFalse(is_row_hidden(calcDoc, 3))
+            self.assertTrue(is_row_hidden(calcDoc, 4))
+
+            # Click the autofilter dropdown in column C
+            xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": 
"", "COL": "2", "ROW": "0"}))
+            xFloatWindow = self.xUITest.getFloatWindow()
+            xCheckListMenu = xFloatWindow.getChild("FilterDropDown")
+            xTreeList = xCheckListMenu.getChild("check_list_box")
+
+            self.assertEqual(1, len(xTreeList.getChildren()))
+
+            xEntry1 = xTreeList.getChild(0)
+            self.assertEqual("(empty)", get_state_as_dict(xEntry1)['Text'])
+
+            # Without the fix in place, this test would have failed with
+            # AssertionError: 'true' != 'false'
+            self.assertEqual("true", get_state_as_dict(xEntry1)['IsChecked'])
+            self.assertEqual("false", 
get_state_as_dict(xEntry1)['IsSemiTransparent'])
+
+            # Close the popup window
+            xOkButton = xFloatWindow.getChild("ok")
+            xOkButton.executeAction("CLICK", tuple())
+
+            self.assertTrue(is_row_hidden(calcDoc, 1))
+            self.assertTrue(is_row_hidden(calcDoc, 2))
+            self.assertFalse(is_row_hidden(calcDoc, 3))
+            self.assertTrue(is_row_hidden(calcDoc, 4))
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 79027226387e..f0f4cc83263b 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2582,10 +2582,21 @@ class FilterEntriesHandler
 
         if (bIsEmptyCell)
         {
-            if (!mrFilterEntries.mbHasEmpties)
+            if (mbFilteredRow)
             {
-                mrFilterEntries.push_back(ScTypedStrData(OUString(), 0.0, 0.0, 
ScTypedStrData::Standard, false, mbFilteredRow));
-                mrFilterEntries.mbHasEmpties = true;
+                if (!mrFilterEntries.mbHasHiddenEmpties)
+                {
+                    mrFilterEntries.push_back(ScTypedStrData(OUString(), 0.0, 
0.0, ScTypedStrData::Standard, false, true));
+                    mrFilterEntries.mbHasHiddenEmpties = true;
+                }
+            }
+            else
+            {
+                if (!mrFilterEntries.mbHasUnHiddenEmpties)
+                {
+                    mrFilterEntries.push_back(ScTypedStrData(OUString(), 0.0, 
0.0, ScTypedStrData::Standard, false, false));
+                    mrFilterEntries.mbHasUnHiddenEmpties = true;
+                }
             }
             return;
         }
commit ffcdd3a72bcacce6c16dec9adc88556fcb83894f
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Feb 22 12:09:10 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Mar 1 12:00:43 2024 +0100

    tdf#157158: always paint the arrow black
    
    The background doesn't change so do not change the arrow color either
    
    Change-Id: I7a5f80e639570e94975b7e033619783d24c95a6f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163737
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit c4553ae6e06ce84c2f477ec85bc2056645eb4833)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163756

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 3f8a1752e890..74310ba99125 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -504,7 +504,7 @@ void SwAnnotationWin::SetMenuButtonColors()
     const tools::Long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) 
+ 500) / 1000;
     aSymbolRect.AdjustBottom( -nBorderDistanceBottom );
     DecorationView aDecoView(xVirDev.get());
-    aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, GetTextColor(),
+    aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, COL_BLACK,
                          DrawSymbolFlags::NONE);
     mxMenuButton->set_image(xVirDev);
     mxMenuButton->set_size_request(aSize.Width() + 4, aSize.Height() + 4);
commit 1f8e5f673f7dd0cd531b3fb0a5cb5a7d2535b36f
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Feb 15 18:51:27 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Mar 1 12:00:33 2024 +0100

    tdf#159502 libxml2: apply Solaris ld patch only on Solaris
    
    Diverging from upstream by inventing a LIBXML2_GLOBAL_VARIABLES version
    should only be done if actually required.
    
    Change-Id: I1520ca5078dc24ffd83e927f9c857d625e71749b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163455
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit eebdda4e221327cae5a9177893394819ca510d5f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163492
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/external/libxml2/UnpackedTarball_libxml2.mk 
b/external/libxml2/UnpackedTarball_libxml2.mk
index d50d52cbeef8..489fb007572b 100644
--- a/external/libxml2/UnpackedTarball_libxml2.mk
+++ b/external/libxml2/UnpackedTarball_libxml2.mk
@@ -14,7 +14,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,libxml2,$(LIBXML_TARBALL),,libxml2)
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libxml2))
 
 $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\
-       external/libxml2/libxml2-global-symbols.patch \
+       $(if $(filter 
SOLARIS,$(OS)),external/libxml2/libxml2-global-symbols.patch) \
        external/libxml2/libxml2-vc10.patch \
        external/libxml2/libxml2-XMLCALL-redefine.patch.0 \
        $(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \
commit 97a2f97bf994b9804fa509e06e352ce99b02007b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Feb 28 12:18:40 2024 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Feb 29 11:13:28 2024 +0100

    tdf#159735 a11y: Dispose win accessible with VCLXWindow
    
    `Window::dispose` takes care of disposing its
    accessible as well.
    
    However, `VCLXWindow::dispose` was explicitly unsetting
    the accessible before disposing its `vcl::Window`, resulting
    in it not getting disposed, in turn resulting in a crash on exit
    for the tdf#159735 case.
    
    Potentially related:
    
        commit 5aa60be574ece81b27c8f63e6e809871c694dba0
        Date:   Wed May 12 11:33:06 2021 +0200
    
            fix leak in VCLXWindow
    
            which is a little tricky because dispose() can be called from either
            side (vcl::Window or VCLXWindow)
    
    Before that commit, setting a nullptr accessible happened
    in the `VCLXWindow` dtor, which is meant to get called after
    the `vcl::Window` got disposed in `VCLXWindow::dispose`.
    (In the Linux bibisect repo, the commit before that one is fine
    and at that commit, the tdf#159735 comment 5 scenario even
    crashes in step 3 already.)
    
    Don't unset the `vcl::Window`'s accessible any more in
    `VCLXWindow::dispose`, but do that after disposing it in
    `vcl::Window::dispose` instead, which seems to be the
    natural place to do that anyway.
    
    Backtrace of crash:
    
        Thread 1 received signal SIGSEGV, Segmentation fault.
        0x00007fd754ae6fe9 in 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear
 (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at 
include/comphelper/interfacecontainer4.hxx:397
        397                     aIt.next()->disposing(rEvt);
        (gdb) bt
        #0  0x00007fd754ae6fe9 in 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear(std::unique_lock<std::mutex>&,
 com::sun::star::lang::EventObject const&)
            (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at 
include/comphelper/interfacecontainer4.hxx:397
        #1  0x00007fd754ae6014 in 
comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, 
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
            (_nClient=28, _rxEventSource=uno::Reference to 
(accessibility::AccessibleListBox *) 0x55bf49c0ad00) at 
.../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:204
        #2  0x00007fd754ae1424 in 
comphelper::OCommonAccessibleComponent::disposing() (this=0x55bf49c0ad00) at 
.../libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:61
        #3  0x00007fd74e884512 in VCLXAccessibleComponent::disposing() 
(this=0x55bf49c0ad00) at 
.../libreoffice/toolkit/source/awt/vclxaccessiblecomponent.cxx:376
        #4  0x00007fd6a3d506b7 in accessibility::AccessibleListBox::disposing() 
(this=0x55bf49c0ad00) at 
.../libreoffice/accessibility/source/extended/accessiblelistbox.cxx:246
        #5  0x00007fd75453f544 in cppu::WeakComponentImplHelperBase::dispose() 
(this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:104
        #6  0x00007fd6a3d45fd5 in 
cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2,
 com::sun::star::accessibility::XAccessibleEventBroadcaster>::dispose() 
(this=0x55bf49c0ad00)
            at include/cppuhelper/compbase.hxx:90
        #7  0x00007fd75453f1fe in cppu::WeakComponentImplHelperBase::release() 
(this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:79
        #8  0x00007fd6a3d47d85 in 
cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2,
 com::sun::star::accessibility::XAccessibleEventBroadcaster>::release() 
(this=0x55bf49c0ad00)
            at include/cppuhelper/compbase.hxx:86
        #9  0x00007fd6a3d47ca5 in 
cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, 
com::sun::star::accessibility::XAccessibleExtendedComponent>::release() 
(this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
        #10 0x00007fd6a3d47c85 in 
cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper, 
com::sun::star::lang::XServiceInfo>::release() (this=0x55bf49c0ad00) at 
include/cppuhelper/implbase.hxx:171
        #11 0x00007fd6a3d45f55 in 
cppu::ImplInheritanceHelper<VCLXAccessibleComponent, 
com::sun::star::accessibility::XAccessible, 
com::sun::star::accessibility::XAccessibleSelection>::release() 
(this=0x55bf49c0ad00)
            at include/cppuhelper/implbase.hxx:171
        #12 0x00007fd74282e13e in 
com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference() 
(this=0x55bf49c0e860) at include/com/sun/star/uno/Reference.hxx:114
        #13 0x00007fd7428524c5 in 
std::destroy_at<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> 
>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) 
(__location=0x55bf49c0e860)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
        #14 0x00007fd7428524a5 in 
std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> 
>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) 
(__pointer=0x55bf49c0e860)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
        #15 0x00007fd742852477 in 
std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*,
 com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) 
(__first=0x55bf49c0e860, __last=0x55bf49c0e868) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
        #16 0x00007fd74285243d in 
std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*,
 com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) 
(__first=0x55bf49c0e860, __last=0x55bf49c0e868) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
        #17 0x00007fd742852379 in 
std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, 
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> 
>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, 
com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, 
std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> 
>&) (__first=0x55bf49c0e860, __last=0x55bf49c0e868)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
        #18 
std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>,
 std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> 
> >::~vector() (this=0x55bf4d1120f8)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
        #19 0x00007fd74285231d in 
std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>,
 std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> 
> >::~vector() (this=0x55bf4d1120e0)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
        #20 0x00007fd7428522f5 in 
o3tl::sorted_vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>,
 std::less<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, 
o3tl::find_unique>::~sorted_vector()
            (this=0x55bf4d1120e0) at include/o3tl/sorted_vector.hxx:47
        #21 0x00007fd74284f83d in 
DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at 
vcl/inc/unx/gtk/gtkdata.hxx:221
        #22 0x00007fd74284f869 in 
DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at 
vcl/inc/unx/gtk/gtkdata.hxx:221
        #23 0x00007fd7546453a0 in cppu::OWeakObject::release() 
(this=0x55bf4d1120b0) at .../libreoffice/cppuhelper/source/weak.cxx:230
        #24 0x00007fd742834415 in 
cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release()
 (this=0x55bf4d1120b0) at include/cppuhelper/implbase.hxx:115
        #25 0x00007fd754aec91e in 
com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>::~Reference()
 (this=0x55bf4896c088) at include/com/sun/star/uno/Reference.hxx:114
        #26 0x00007fd754aec8e5 in 
std::destroy_at<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 
>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
            (__location=0x55bf4896c088) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
        #27 0x00007fd754aec8c5 in 
std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 
>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
            (__pointer=0x55bf4896c088) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
        #28 0x00007fd754aec897 in 
std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*,
 
com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
 (__first=0x55bf4896c088, __last=0x55bf4896c090)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
        #29 0x00007fd754aec85d in 
std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*,
 
com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
 (__first=0x55bf4896c080, __last=0x55bf4896c090) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
        #30 0x00007fd754aec799 in 
std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*,
 
com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 
>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*,
 
com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*,
 
std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 >&) (__first=0x55bf4896c080, __last=0x55bf4896c090) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
        --Type <RET> for more, q to quit, c to continue without paging--
        #31 
std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>,
 
std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 > >::~vector()
            (this=0x55bf49866bc8) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
        #32 0x00007fd754aec73d in 
std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>,
 
std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 > >::~vector() (this=0x55bf49866bb0) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
        #33 0x00007fd754aec715 in 
o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>,
 
std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 > >, o3tl::ThreadSafeRefCountingPolicy>::impl_t::~impl_t() 
(this=0x55bf49866bb0) at include/o3tl/cow_wrapper.hxx:176
        #34 0x00007fd754aec6e4 in 
o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>,
 
std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 > >, o3tl::ThreadSafeRefCountingPolicy>::release() (this=0x55bf49b28380) at 
include/o3tl/cow_wrapper.hxx:207
        #35 0x00007fd754aec675 in 
o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>,
 
std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>
 > >, o3tl::ThreadSafeRefCountingPolicy>::~cow_wrapper() (this=0x55bf49b28380) 
at include/o3tl/cow_wrapper.hxx:271
        #36 0x00007fd754ae6ae5 in 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::~OInterfaceContainerHelper4()
 (this=0x55bf49b28380) at include/comphelper/interfacecontainer4.hxx:126
        #37 0x00007fd754ae7c49 in std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >::~pair() (this=0x55bf49b28378)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_pair.h:187
        #38 0x00007fd754ae7c25 in std::destroy_at<std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 > >(std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >*) (__location=0x55bf49b28378) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
        #39 0x00007fd754ae7b4b in 
std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<unsigned
 int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >, false> > >::destroy<std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 > >(std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >, false> >&, std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >*)
            (__a=..., __p=0x55bf49b28378) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:560
        #40 
std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned
 int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >, false> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<unsigned 
int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >, false>*)
            (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, 
__n=0x55bf49b28370) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2011
        #41 0x00007fd754ae7ab5 in 
std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned
 int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >, false> > 
>::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >, false>*)
            (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, 
__n=0x0) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2033
        #42 0x00007fd754ae79df in std::_Hashtable<unsigned int, 
std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 >, std::allocator<std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 > >, std::__detail::_Select1st, std::equal_to<unsigned int>, 
std::hash<unsigned int>, std::__detail::_Mod_range_hashing, 
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, 
std::__detail::_Hashtable_traits<false, false, true> >::clear() 
(this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:2524
        #43 0x00007fd754af6415 in std::__cxx1998::unordered_map<unsigned int, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>,
 std::hash<unsigned int>, std::equal_to<unsigned int>, 
std::allocator<std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 > > >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_map.h:798
        #44 0x00007fd754ae778d in std::__debug::unordered_map<unsigned int, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>,
 std::hash<unsigned int>, std::equal_to<unsigned int>, 
std::allocator<std::pair<unsigned int const, 
comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>
 > > >::clear() (this=0x7fd754d2aa80 <(anonymous namespace)::gaClients>)
            at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/unordered_map:234
        #45 0x00007fd754ae6640 in 
comphelper::AccessibleEventNotifier::shutdown() () at 
.../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:268
        #46 0x00007fd74d3c5e41 in DeInitVCL() () at 
.../libreoffice/vcl/source/app/svmain.cxx:619
        #47 0x00007fd74d3c4031 in ImplSVMain() () at 
.../libreoffice/vcl/source/app/svmain.cxx:254
        #48 0x00007fd74d3c5f79 in SVMain() () at 
.../libreoffice/vcl/source/app/svmain.cxx:261
        #49 0x00007fd7565a4ba3 in soffice_main() () at 
.../libreoffice/desktop/source/app/sofficemain.cxx:94
        #50 0x000055bf472e7a5d in sal_main () at 
.../libreoffice/desktop/source/app/main.c:51
        #51 0x000055bf472e7a37 in main (argc=3, argv=0x7ffccdc2c9a8) at 
.../libreoffice/desktop/source/app/main.c:49
    
    Change-Id: I251b2f97184e0492f02eb772e5906847f9249506
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164090
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 2ea7cdf9876ce2de61458982247ab6861e1aac2f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164113
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/toolkit/source/awt/vclxwindow.cxx 
b/toolkit/source/awt/vclxwindow.cxx
index 930d8fe4eaee..2a4957e7bda9 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -921,7 +921,6 @@ void VCLXWindow::dispose(  )
     {
         pWindow->RemoveEventListener( LINK( this, VCLXWindow, 
WindowEventListener ) );
         pWindow->SetWindowPeer( nullptr, nullptr );
-        pWindow->SetAccessible( nullptr );
 
         SetOutputDevice( nullptr );
         pWindow.disposeAndClear();
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f79918fd7f52..9d74b57b3bdb 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -223,6 +223,7 @@ void Window::dispose()
         Reference< XComponent> xC( mpWindowImpl->mxAccessible, UNO_QUERY );
         if ( xC.is() )
             xC->dispose();
+        mpWindowImpl->mxAccessible.clear();
     }
 
     ImplSVData* pSVData = ImplGetSVData();
commit 8f3fb27880d6374f531cb012fe3b53179ecd4313
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Wed Feb 28 10:30:48 2024 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Feb 28 22:49:55 2024 +0100

    Resolves tdf#131550 - Suppress Donate/Involve infobar if another is visible
    
    Change-Id: I013f0a1f0aa020f10d6beb21940959508eba4547
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164082
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    (cherry picked from commit 607740654f2264e13469e4da1d020448217d7222)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164115
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 4bfb58a724ec..e6f81d53e873 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1450,88 +1450,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
                 rBind.Invalidate( SID_RELOAD );
                 rBind.Invalidate( SID_EDITDOC );
 
-#if !ENABLE_WASM_STRIP_PINGUSER
-                bool bIsHeadlessOrUITest = 
SfxApplication::IsHeadlessOrUITest(); //uitest.uicheck fails when the dialog is 
open
-
-                //what's new infobar
-                if (utl::isProductVersionUpgraded(true) && 
!bIsHeadlessOrUITest)
-                {
-                    VclPtr<SfxInfoBarWindow> pInfoBar = 
AppendInfoBar("whatsnew", "", SfxResId(STR_WHATSNEW_TEXT), InfobarType::INFO);
-                    if (pInfoBar)
-                    {
-                        weld::Button& rWhatsNewButton = pInfoBar->addButton();
-                        
rWhatsNewButton.set_label(SfxResId(STR_WHATSNEW_BUTTON));
-                        rWhatsNewButton.connect_clicked(LINK(this, 
SfxViewFrame, WhatsNewHandler));
-                    }
-                }
-
-                // show tip-of-the-day dialog if it due, but not if there is 
the impress modal template dialog
-                // open where SdModule::ExecuteNewDocument will launch it 
instead when that dialog is dismissed
-                if (SfxApplication::IsTipOfTheDayDue() && !bIsHeadlessOrUITest 
&& !IsInModalMode())
-                {
-                    // tdf#127946 pass in argument for dialog parent
-                    SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
GetFrame().GetFrameInterface());
-                    GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {}, { &aDocFrame });
-                }
-
-                // inform about the community involvement
-                const auto t0 = 
std::chrono::system_clock::now().time_since_epoch();
-                const sal_Int64 nLastGetInvolvedShown = 
officecfg::Setup::Product::LastTimeGetInvolvedShown::get();
-                const sal_Int64 nNow = 
std::chrono::duration_cast<std::chrono::seconds>(t0).count();
-                const sal_Int64 nPeriodSec(60 * 60 * 24 * 180); // 180 days in 
seconds
-                bool bUpdateLastTimeGetInvolvedShown = false;
-
-                if (nLastGetInvolvedShown == 0)
-                    bUpdateLastTimeGetInvolvedShown = true;
-                else if (nPeriodSec < nNow && nLastGetInvolvedShown < (nNow + 
nPeriodSec/2) - nPeriodSec) // 90d alternating with donation
-                {
-                    bUpdateLastTimeGetInvolvedShown = true;
-
-                    VclPtr<SfxInfoBarWindow> pInfoBar = 
AppendInfoBar("getinvolved", "", SfxResId(STR_GET_INVOLVED_TEXT), 
InfobarType::INFO);
-
-                    if (pInfoBar)
-                    {
-                        weld::Button& rGetInvolvedButton = 
pInfoBar->addButton();
-                        
rGetInvolvedButton.set_label(SfxResId(STR_GET_INVOLVED_BUTTON));
-                        rGetInvolvedButton.connect_clicked(LINK(this, 
SfxViewFrame, GetInvolvedHandler));
-                    }
-                }
-
-                if (bUpdateLastTimeGetInvolvedShown
-                    && 
!officecfg::Setup::Product::LastTimeGetInvolvedShown::isReadOnly())
-                {
-                    std::shared_ptr<comphelper::ConfigurationChanges> 
batch(comphelper::ConfigurationChanges::create());
-                    
officecfg::Setup::Product::LastTimeGetInvolvedShown::set(nNow, batch);
-                    batch->commit();
-                }
-
-                // inform about donations
-                const sal_Int64 nLastDonateShown = 
officecfg::Setup::Product::LastTimeDonateShown::get();
-                bool bUpdateLastTimeDonateShown = false;
-
-                if (nLastDonateShown == 0)
-                    bUpdateLastTimeDonateShown = true;
-                else if (nPeriodSec < nNow && nLastDonateShown < nNow - 
nPeriodSec) // 90d alternating with getinvolved
-                {
-                    bUpdateLastTimeDonateShown = true;
-
-                    VclPtr<SfxInfoBarWindow> pInfoBar = 
AppendInfoBar("donate", "", SfxResId(STR_DONATE_TEXT), InfobarType::INFO);
-                    if (pInfoBar)
-                    {
-                        weld::Button& rDonateButton = pInfoBar->addButton();
-                        rDonateButton.set_label(SfxResId(STR_DONATE_BUTTON));
-                        rDonateButton.connect_clicked(LINK(this, SfxViewFrame, 
DonationHandler));
-                    }
-                }
+                bool bIsInfobarShown(false);
 
-                if (bUpdateLastTimeDonateShown
-                    && 
!officecfg::Setup::Product::LastTimeDonateShown::isReadOnly())
-                {
-                    std::shared_ptr<comphelper::ConfigurationChanges> 
batch(comphelper::ConfigurationChanges::create());
-                    officecfg::Setup::Product::LastTimeDonateShown::set(nNow, 
batch);
-                    batch->commit();
-                }
-#endif
                 if (officecfg::Office::Common::Passwords::HasMaster::get() &&
                     
officecfg::Office::Common::Passwords::StorageVersion::get() == 0)
                 {
@@ -1539,6 +1459,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const 
SfxHint& rHint )
                     VclPtr<SfxInfoBarWindow> pOldMasterPasswordInfoBar =
                         AppendInfoBar("oldmasterpassword", "",
                                       SfxResId(STR_REFRESH_MASTER_PASSWORD), 
InfobarType::DANGER, false);
+                    bIsInfobarShown = true;
                     if (pOldMasterPasswordInfoBar)
                     {
                         weld::Button& rButton = 
pOldMasterPasswordInfoBar->addButton();
@@ -1565,10 +1486,14 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
                         (( pVSh = m_xObjSh->GetViewShell()) && (pFSh = 
pVSh->GetFormShell()) && pFSh->IsDesignMode())))
                 {
                     AppendReadOnlyInfobar();
+                    bIsInfobarShown = true;
                 }
 
                 if (!bEmbedded && 
m_xObjSh->Get_Impl()->getCurrentMacroExecMode() == 
css::document::MacroExecMode::NEVER_EXECUTE)
+                {
                     AppendContainsMacrosInfobar();
+                    bIsInfobarShown = true;
+                }
 
                 if 
(vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()) 
== "com.sun.star.text.TextDocument")
                     
sfx2::SfxNotebookBar::ReloadNotebookBar(u"modules/swriter/ui/");
@@ -1609,6 +1534,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const 
SfxHint& rHint )
                             AppendInfoBar(aInfobarData.msId, 
aInfobarData.msPrimaryMessage,
                                   aInfobarData.msSecondaryMessage, 
aInfobarData.maInfobarType,
                                   aInfobarData.mbShowCloseButton);
+                        bIsInfobarShown = true;
 
                         // tdf#148913 don't extend this condition to keep it 
thread-safe
                         if (pInfoBar)
@@ -1634,11 +1560,96 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
                         AppendInfoBar(aInfobarData.msId, 
aInfobarData.msPrimaryMessage,
                                   aInfobarData.msSecondaryMessage, 
aInfobarData.maInfobarType,
                                   aInfobarData.mbShowCloseButton);
+                        bIsInfobarShown = true;
                     }
 
                     aPendingInfobars.pop_back();
                 }
 
+#if !ENABLE_WASM_STRIP_PINGUSER
+                bool bIsHeadlessOrUITest = 
SfxApplication::IsHeadlessOrUITest(); //uitest.uicheck fails when the dialog is 
open
+
+                //what's new infobar
+                if (!bIsInfobarShown && utl::isProductVersionUpgraded(true) && 
!bIsHeadlessOrUITest)
+                {
+                    VclPtr<SfxInfoBarWindow> pInfoBar = 
AppendInfoBar("whatsnew", "", SfxResId(STR_WHATSNEW_TEXT), InfobarType::INFO);
+                    bIsInfobarShown = true;
+                    if (pInfoBar)
+                    {
+                        weld::Button& rWhatsNewButton = pInfoBar->addButton();
+                        
rWhatsNewButton.set_label(SfxResId(STR_WHATSNEW_BUTTON));
+                        rWhatsNewButton.connect_clicked(LINK(this, 
SfxViewFrame, WhatsNewHandler));
+                    }
+                }
+
+                // show tip-of-the-day dialog if it due, but not if there is 
the impress modal template dialog
+                // open where SdModule::ExecuteNewDocument will launch it 
instead when that dialog is dismissed
+                if (SfxApplication::IsTipOfTheDayDue() && !bIsHeadlessOrUITest 
&& !IsInModalMode())
+                {
+                    // tdf#127946 pass in argument for dialog parent
+                    SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
GetFrame().GetFrameInterface());
+                    GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {}, { &aDocFrame });
+                }
+
+                // inform about the community involvement
+                const auto t0 = 
std::chrono::system_clock::now().time_since_epoch();
+                const sal_Int64 nLastGetInvolvedShown = 
officecfg::Setup::Product::LastTimeGetInvolvedShown::get();
+                const sal_Int64 nNow = 
std::chrono::duration_cast<std::chrono::seconds>(t0).count();
+                const sal_Int64 nPeriodSec(60 * 60 * 24 * 180); // 180 days in 
seconds
+                bool bUpdateLastTimeGetInvolvedShown = false;
+
+                if (nLastGetInvolvedShown == 0)
+                    bUpdateLastTimeGetInvolvedShown = true;
+                else if (!bIsInfobarShown && nPeriodSec < nNow && 
nLastGetInvolvedShown < (nNow + nPeriodSec/2) - nPeriodSec) // 90d alternating 
with donation
+                {
+                    bUpdateLastTimeGetInvolvedShown = true;
+
+                    VclPtr<SfxInfoBarWindow> pInfoBar = 
AppendInfoBar("getinvolved", "", SfxResId(STR_GET_INVOLVED_TEXT), 
InfobarType::INFO);
+                    bIsInfobarShown = true;
+                    if (pInfoBar)
+                    {
+                        weld::Button& rGetInvolvedButton = 
pInfoBar->addButton();
+                        
rGetInvolvedButton.set_label(SfxResId(STR_GET_INVOLVED_BUTTON));
+                        rGetInvolvedButton.connect_clicked(LINK(this, 
SfxViewFrame, GetInvolvedHandler));
+                    }
+                }
+
+                if (bUpdateLastTimeGetInvolvedShown
+                    && 
!officecfg::Setup::Product::LastTimeGetInvolvedShown::isReadOnly())
+                {
+                    std::shared_ptr<comphelper::ConfigurationChanges> 
batch(comphelper::ConfigurationChanges::create());
+                    
officecfg::Setup::Product::LastTimeGetInvolvedShown::set(nNow, batch);
+                    batch->commit();
+                }
+
+                // inform about donations
+                const sal_Int64 nLastDonateShown = 
officecfg::Setup::Product::LastTimeDonateShown::get();
+                bool bUpdateLastTimeDonateShown = false;
+
+                if (nLastDonateShown == 0)
+                    bUpdateLastTimeDonateShown = true;
+                else if (!bIsInfobarShown && nPeriodSec < nNow && 
nLastDonateShown < nNow - nPeriodSec) // 90d alternating with getinvolved
+                {
+                    bUpdateLastTimeDonateShown = true;
+
+                    VclPtr<SfxInfoBarWindow> pInfoBar = 
AppendInfoBar("donate", "", SfxResId(STR_DONATE_TEXT), InfobarType::INFO);
+                    if (pInfoBar)
+                    {
+                        weld::Button& rDonateButton = pInfoBar->addButton();
+                        rDonateButton.set_label(SfxResId(STR_DONATE_BUTTON));
+                        rDonateButton.connect_clicked(LINK(this, SfxViewFrame, 
DonationHandler));
+                    }
+                }
+
+                if (bUpdateLastTimeDonateShown
+                    && 
!officecfg::Setup::Product::LastTimeDonateShown::isReadOnly())
+                {
+                    std::shared_ptr<comphelper::ConfigurationChanges> 
batch(comphelper::ConfigurationChanges::create());
+                    officecfg::Setup::Product::LastTimeDonateShown::set(nNow, 
batch);
+                    batch->commit();
+                }
+#endif
+
                 break;
             }
             default: break;
commit b6f2c7a64dd3c80161db630b9b28ad1b228a1c9f
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Feb 28 03:48:55 2024 +0600
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Feb 28 18:26:37 2024 +0100

    tdf#157135 workaround: restore and update windows-no-utf8-locales.patch.0
    
    This partially reverts commit ed259e5efe432386b54c553cbc644b3b64976852
    (Upgrade external/boost to latest Boost 1.81.0, 2023-01-05), which had
    dropped the patch previously introduced with commit
    f046fed2782f0d4244aff719ba70a56399a2583a (Don't ever attempt to initialise
    a std::locale with a UTF-8 locale on Windows, 2018-05-17).
    
    It seems that there is a nightmare going on in MSVCRT, and tdf#157135
    is caused by dome MS bug. The problem happens in a deeply nested call
    to mbstowcs_s (several levels deep from std::locale constructor with
    name of "en_US.UTF-8"), which gets a non-null wcstr and sizeInWords
    equal to zero, which generates an invalid argument handler, resulting
    in a failed assertion "(pwcs == nullptr && sizeInWords == 0) || (pwcs
    != nullptr && sizeInWords > 0)" in _mbstowcs_internal from
    minkernel    The crashreporter initiates, but since it tries to use CRT 
itself,
    which is in fastfail mode, it hangs.
    
    The patch that is restored here was intended for something different;
    but it happily workarounds the nightmare. Until the proper fix found,
    let it be.
    
    Change-Id: Ic978f87e2e7b81fc2e1cd182a4247084ad016a9f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164068
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit 072a25e1ef4815bbef4f18f59f025862a0d8e876)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163985
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/external/boost/UnpackedTarball_boost.mk 
b/external/boost/UnpackedTarball_boost.mk
index d8bd131ac8df..8ab4d7949901 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -26,6 +26,7 @@ boost_patches += boost_1_59_0.property_tree.wreturn-type.patch
 boost_patches += clang-cl.patch.0
 
 boost_patches += boost_1_63_0.undef.warning.patch.1
+boost_patches += windows-no-utf8-locales.patch.0
 
 boost_patches += msvc2017.patch.0
 
diff --git a/external/boost/windows-no-utf8-locales.patch.0 
b/external/boost/windows-no-utf8-locales.patch.0
new file mode 100644
index 000000000000..519d8bde2fe6
--- /dev/null
+++ b/external/boost/windows-no-utf8-locales.patch.0
@@ -0,0 +1,23 @@
+Don't ever attempt to initialise a std::locale with a UTF-8 locale on Windows 
-*- Mode: Diff -*-
+
+--- libs/locale/src/boost/locale/std/std_backend.cpp
++++ libs/locale/src/boost/locale/std/std_backend.cpp
+@@ -86,6 +86,7 @@
+ #endif
+                 utf_mode_ = utf8_support::none;
+             } else {
++                #if !defined(BOOST_WINDOWS)
+                 if(loadable(lid)) {
+                     name_ = lid;
+                     utf_mode_ = utf8_support::native_with_wide;
+@@ -98,8 +99,8 @@
+                     utf_mode_ = utf8_support::from_wide;
+ #endif
+                 }
+-#if defined(BOOST_WINDOWS)
+-                else if(loadable(win_name))
++                #else
++                if(loadable(win_name))
+                 {
+                     name_ = win_name;
+                     utf_mode_ = utf8_support::from_wide;
commit a2c0ab909195c803401cc710985f19723680e0eb
Author:     Sarper Akdemir <sarper.akdemir.ext...@allotropia.de>
AuthorDate: Mon Jan 15 07:01:01 2024 +0300
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 19:31:44 2024 +0100

    tdf#156830: fix faulty transformation order in cairo canvas for patterns
    
    Change-Id: Ib58e845c23dd14bbc3b96e5549a722b650d593a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162069
    Tested-by: Jenkins
    Reviewed-by: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de>
    (cherry picked from commit 84055d875ead6d7862cd8ddc5697a280240411fe)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162008
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    (cherry picked from commit 3add4092d29b9b03c00dfa24caa917a3fc84540b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163972
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx 
b/canvas/source/cairo/cairo_canvashelper.cxx
index 14113e89361f..2bfca55f317c 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -488,7 +488,7 @@ constexpr OUStringLiteral 
PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
                             geometry::IntegerSize2D aSize = 
aTexture.Bitmap->getSize();
 
                             cairo_matrix_init_scale( &aScaleMatrix, 
1.0/aSize.Width, 1.0/aSize.Height );
-                            cairo_matrix_multiply( &aScaledTextureMatrix, 
&aTextureMatrix, &aScaleMatrix );
+                            cairo_matrix_multiply( &aScaledTextureMatrix, 
&aScaleMatrix, &aTextureMatrix );
                             cairo_matrix_invert( &aScaledTextureMatrix );
 
                             // we don't care about repeat mode yet, so the 
workaround is disabled for now
commit 0d341dc692ca4529c012813cae3738aef6128670
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Oct 10 21:23:43 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 19:31:15 2024 +0100

    make CppunitTest_framework_dispatch reliable
    
    the appearance of 2 interceptions is reproducible for me on linux with
    
    make CppunitTest_framework_dispatch VALGRIND=memcheck
    
    1st time
     #1 (anonymous 
namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139
     #2 non-virtual thunk to (anonymous 
namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0
     #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL 
const&, rtl::OUString const&, int) at 
core/framework/source/dispatch/interceptionhelper.cxx:87
     #4 non-virtual thunk to 
framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at 
core/framework/source/dispatch/interceptionhelper.cxx:0
     #5 (anonymous 
namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329
     #6 non-virtual thunk to (anonymous 
namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0
     #7 
framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider>
 const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at 
core/framework/source/services/dispatchhelper.cxx:110
     #8 non-virtual thunk to 
framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider>
 const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at 
core/framework/source/services/dispatchhelper.cxx:0
     #9 
unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent>
 const&, rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at 
core/unotest/source/cpp/macros_test.cxx:94
     #10 (anonymous namespace)::testInterception::TestBody() at 
core/framework/qa/cppunit/dispatchtest.cxx:172
    
    2nd time
     #1 (anonymous 
namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139
     #2 non-virtual thunk to (anonymous 
namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0
     #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL 
const&, rtl::OUString const&, int) at 
core/framework/source/dispatch/interceptionhelper.cxx:87
     #4 non-virtual thunk to 
framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at 
core/framework/source/dispatch/interceptionhelper.cxx:0
     #5 (anonymous 
namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329
     #6 non-virtual thunk to (anonymous 
namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, 
rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0
     #7 SfxStateCache::GetSlotServer(SfxDispatcher&, 
com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> 
const&) at core/sfx2/source/control/statcach.cxx:263
     #8 SfxBindings::UpdateSlotServer_Impl() at 
core/sfx2/source/control/bindings.cxx:1083
     #9 SfxBindings::NextJob_Impl(Timer const*) at 
core/sfx2/source/control/bindings.cxx:1254
     #10 SfxBindings::NextJob(Timer*) at 
core/sfx2/source/control/bindings.cxx:1222
     #11 SfxBindings::LinkStubNextJob(void*, Timer*) at 
core/sfx2/source/control/bindings.cxx:1219
     #12 Link<Timer*, void>::Call(Timer*) const at 
core/include/tools/link.hxx:111
     #13 Timer::Invoke() at core/vcl/source/app/timer.cxx:76
     #14 Scheduler::CallbackTaskScheduling() at 
core/vcl/source/app/scheduler.cxx:480
     #15 SalTimer::CallCallback() at core/vcl/inc/saltimer.hxx:55
     #16 SvpSalInstance::CheckTimeout(bool) at core/vcl/headless/svpinst.cxx:161
     #17 SvpSalInstance::ImplYield(bool, bool) at 
core/vcl/headless/svpinst.cxx:399
     #18 SvpSalInstance::DoYield(bool, bool) at 
core/vcl/headless/svpinst.cxx:471
     #19 ImplYield(bool, bool) at core/vcl/source/app/svapp.cxx:377
     #20 Scheduler::ProcessEventsToIdle() at core/vcl/source/app/svapp.cxx:407
     #21 
unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent>
 const&, rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at 
core/unotest/source/cpp/macros_test.cxx:95
     #22 (anonymous namespace)::testInterception::TestBody() at 
core/framework/qa/cppunit/dispatchtest.cxx:172
    
    setting bold/italic will invalidate the slot for the property and timer
    starts to update the normal listeners to those properties which might
    kick in on a slower run.
    
    Change-Id: Ib37e61c0fbed463f8974d476158e54a0160a2c92
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157798
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164039
    Tested-by: Jenkins

diff --git a/framework/qa/cppunit/dispatchtest.cxx 
b/framework/qa/cppunit/dispatchtest.cxx
index 9549ef150904..43837845b04c 100644
--- a/framework/qa/cppunit/dispatchtest.cxx
+++ b/framework/qa/cppunit/dispatchtest.cxx
@@ -163,10 +163,9 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception)
     xRegistration->registerDispatchProviderInterceptor(pInterceptor);
 
     dispatchCommand(mxComponent, ".uno:Bold", {});
-    CPPUNIT_ASSERT_EQUAL(1, pInterceptor->getExpected());
+    CPPUNIT_ASSERT_GREATER(0, pInterceptor->getExpected());
     CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected());
     dispatchCommand(mxComponent, ".uno:Italic", {});
-    CPPUNIT_ASSERT_EQUAL(1, pInterceptor->getExpected());
     // This was 1: MyInterceptor::queryDispatch() was called for .uno:Italic.
     CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected());
 }
commit 737f8ce51d47e030b4cd6d955ef24cfb71c185c2
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Feb 23 17:18:04 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 14:43:54 2024 +0100

    tdf#147731 sw: fix memory leak in SwDoc::CopyPageDesc()
    
    Commit 963de9feb37105560fde14b44d992e47f341bb5b "sw: fix issue with
    copying stashed frame format" fixed the actual bug here, but introduced
    a new memory leak.
    
    This causes an assert in CppunitTest_uiwriter3:
    cppunittester: svl/source/items/itempool.cxx:779: void 
SfxItemPool::Remove(const SfxPoolItem&): Assertion `rItem.GetRefCount() && 
"RefCount == 0, Remove impossible"' failed.
    
    The assert happens only when this is backported to the libreoffice-7-6
    branch, because commit ab7c81f55621d7b0d1468c63305163016dd78837 "ITEM:
    Get away from classic 'poolable' Item flag" removed the assert.
    
    The problem is that a SwFormatFrameSize inside a footer SwFrameFormat is
    leaked 4 times, because 4 SwFrameFormats are leaked; the leak is that
    SwDoc::CopyPageDesc() creates a new pNewFormat, passed it to
    StashFrameFormat(), which copies it but doesn't free it.
    
    There is also a usage of std::shared_ptr here that is very questionable;
    SwFrameFormat should never be shared between different SwPageDesc.
    
    (regression from commit b802ab694a8a7357d4657f3e11b571144fa7c7bf)
    
    Change-Id: I44133bc5e6789a51ce064f1aa5ea8b325224365b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163854
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit 5c4ae1b19c51dcd62dad8e1d3e8beb87a0311352)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163846
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164012

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 11bb347aa1fb..ddc7e659a5bb 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -151,9 +151,9 @@ class SW_DLLPUBLIC SwPageDesc final
 
     struct StashedPageDesc
     {
-        std::shared_ptr<SwFrameFormat> m_pStashedFirst;
-        std::shared_ptr<SwFrameFormat> m_pStashedLeft;
-        std::shared_ptr<SwFrameFormat> m_pStashedFirstLeft;
+        std::optional<SwFrameFormat> m_oStashedFirst;
+        std::optional<SwFrameFormat> m_oStashedLeft;
+        std::optional<SwFrameFormat> m_oStashedFirstLeft;
     };
 
     mutable StashedPageDesc m_aStashedHeader;
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 17eaf5418e61..9145c67ee539 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1556,21 +1556,21 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, 
SwPageDesc& rDstDesc,
                 {
                     if (pStashedFormatSrc->GetDoc() != this)
                     {
-                        SwFrameFormat* pNewFormat = new 
SwFrameFormat(GetAttrPool(), "CopyDesc", GetDfltFrameFormat());
+                        SwFrameFormat newFormat(GetAttrPool(), "CopyDesc", 
GetDfltFrameFormat());
 
                         SfxItemSet aAttrSet(pStashedFormatSrc->GetAttrSet());
                         aAttrSet.ClearItem(RES_HEADER);
                         aAttrSet.ClearItem(RES_FOOTER);
 
-                        pNewFormat->DelDiffs( aAttrSet );
-                        pNewFormat->SetFormatAttr( aAttrSet );
+                        newFormat.DelDiffs(aAttrSet);
+                        newFormat.SetFormatAttr(aAttrSet);
 
                         if (bHeader)
-                            CopyHeader(*pStashedFormatSrc, *pNewFormat);
+                            CopyHeader(*pStashedFormatSrc, newFormat);
                         else
-                            CopyFooter(*pStashedFormatSrc, *pNewFormat);
+                            CopyFooter(*pStashedFormatSrc, newFormat);
 
-                        rDstDesc.StashFrameFormat(*pNewFormat, bHeader, bLeft, 
bFirst);
+                        rDstDesc.StashFrameFormat(newFormat, bHeader, bLeft, 
bFirst);
                     }
                     else
                     {
diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index 40a7b5865766..5bc08706b80a 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -83,13 +83,13 @@ SwPageDesc::SwPageDesc( const SwPageDesc &rCpy )
     , m_FootnoteInfo( rCpy.GetFootnoteInfo() )
     , m_pdList( nullptr )
 {
-    m_aStashedHeader.m_pStashedFirst = rCpy.m_aStashedHeader.m_pStashedFirst;
-    m_aStashedHeader.m_pStashedLeft = rCpy.m_aStashedHeader.m_pStashedLeft;
-    m_aStashedHeader.m_pStashedFirstLeft = 
rCpy.m_aStashedHeader.m_pStashedFirstLeft;
+    m_aStashedHeader.m_oStashedFirst = rCpy.m_aStashedHeader.m_oStashedFirst;
+    m_aStashedHeader.m_oStashedLeft = rCpy.m_aStashedHeader.m_oStashedLeft;
+    m_aStashedHeader.m_oStashedFirstLeft = 
rCpy.m_aStashedHeader.m_oStashedFirstLeft;
 
-    m_aStashedFooter.m_pStashedFirst = rCpy.m_aStashedFooter.m_pStashedFirst;
-    m_aStashedFooter.m_pStashedLeft = rCpy.m_aStashedFooter.m_pStashedLeft;
-    m_aStashedFooter.m_pStashedFirstLeft = 
rCpy.m_aStashedFooter.m_pStashedFirstLeft;
+    m_aStashedFooter.m_oStashedFirst = rCpy.m_aStashedFooter.m_oStashedFirst;
+    m_aStashedFooter.m_oStashedLeft = rCpy.m_aStashedFooter.m_oStashedLeft;
+    m_aStashedFooter.m_oStashedFirstLeft = 
rCpy.m_aStashedFooter.m_oStashedFirstLeft;
 
     if (rCpy.m_pTextFormatColl && 
rCpy.m_aDepends.IsListeningTo(rCpy.m_pTextFormatColl))
     {
@@ -110,13 +110,13 @@ SwPageDesc & SwPageDesc::operator = (const SwPageDesc & 
rSrc)
     m_FirstMaster = rSrc.m_FirstMaster;
     m_FirstLeft = rSrc.m_FirstLeft;
 
-    m_aStashedHeader.m_pStashedFirst = rSrc.m_aStashedHeader.m_pStashedFirst;
-    m_aStashedHeader.m_pStashedLeft = rSrc.m_aStashedHeader.m_pStashedLeft;
-    m_aStashedHeader.m_pStashedFirstLeft = 
rSrc.m_aStashedHeader.m_pStashedFirstLeft;
+    m_aStashedHeader.m_oStashedFirst = rSrc.m_aStashedHeader.m_oStashedFirst;
+    m_aStashedHeader.m_oStashedLeft = rSrc.m_aStashedHeader.m_oStashedLeft;
+    m_aStashedHeader.m_oStashedFirstLeft = 
rSrc.m_aStashedHeader.m_oStashedFirstLeft;
 
-    m_aStashedFooter.m_pStashedFirst = rSrc.m_aStashedFooter.m_pStashedFirst;
-    m_aStashedFooter.m_pStashedLeft = rSrc.m_aStashedFooter.m_pStashedLeft;
-    m_aStashedFooter.m_pStashedFirstLeft = 
rSrc.m_aStashedFooter.m_pStashedFirstLeft;
+    m_aStashedFooter.m_oStashedFirst = rSrc.m_aStashedFooter.m_oStashedFirst;
+    m_aStashedFooter.m_oStashedLeft = rSrc.m_aStashedFooter.m_oStashedLeft;
+    m_aStashedFooter.m_oStashedFirstLeft = 
rSrc.m_aStashedFooter.m_oStashedFirstLeft;
 
     m_aDepends.EndListeningAll();
     if (rSrc.m_pTextFormatColl && 
rSrc.m_aDepends.IsListeningTo(rSrc.m_pTextFormatColl))
@@ -409,30 +409,30 @@ void SwPageDesc::ChgFirstShare( bool bNew )
 void SwPageDesc::StashFrameFormat(const SwFrameFormat& rFormat, bool bHeader, 
bool bLeft, bool bFirst)
 {
     assert(rFormat.GetRegisteredIn());
-    std::shared_ptr<SwFrameFormat>* pFormat = nullptr;
+    std::optional<SwFrameFormat>* pFormat = nullptr;
 
     if (bHeader)
     {
         if (bLeft && !bFirst)
-            pFormat = &m_aStashedHeader.m_pStashedLeft;
+            pFormat = &m_aStashedHeader.m_oStashedLeft;
         else if (!bLeft && bFirst)
-            pFormat = &m_aStashedHeader.m_pStashedFirst;
+            pFormat = &m_aStashedHeader.m_oStashedFirst;
         else if (bLeft && bFirst)
-            pFormat = &m_aStashedHeader.m_pStashedFirstLeft;
+            pFormat = &m_aStashedHeader.m_oStashedFirstLeft;
     }
     else
     {
         if (bLeft && !bFirst)
-            pFormat = &m_aStashedFooter.m_pStashedLeft;
+            pFormat = &m_aStashedFooter.m_oStashedLeft;
         else if (!bLeft && bFirst)
-            pFormat = &m_aStashedFooter.m_pStashedFirst;
+            pFormat = &m_aStashedFooter.m_oStashedFirst;
         else if (bLeft && bFirst)
-            pFormat = &m_aStashedFooter.m_pStashedFirstLeft;
+            pFormat = &m_aStashedFooter.m_oStashedFirstLeft;
     }
 
     if (pFormat)
     {
-        *pFormat = std::make_shared<SwFrameFormat>(rFormat);
+        pFormat->emplace(rFormat);
     }
     else
     {
@@ -444,24 +444,24 @@ void SwPageDesc::StashFrameFormat(const SwFrameFormat& 
rFormat, bool bHeader, bo
 
 const SwFrameFormat* SwPageDesc::GetStashedFrameFormat(bool bHeader, bool 
bLeft, bool bFirst) const
 {
-    std::shared_ptr<SwFrameFormat>* pFormat = nullptr;
+    std::optional<SwFrameFormat>* pFormat = nullptr;
 
     if (bLeft && !bFirst)
     {
-        pFormat = bHeader ? &m_aStashedHeader.m_pStashedLeft : 
&m_aStashedFooter.m_pStashedLeft;
+        pFormat = bHeader ? &m_aStashedHeader.m_oStashedLeft : 
&m_aStashedFooter.m_oStashedLeft;
     }
     else if (!bLeft && bFirst)
     {
-        pFormat = bHeader ? &m_aStashedHeader.m_pStashedFirst : 
&m_aStashedFooter.m_pStashedFirst;
+        pFormat = bHeader ? &m_aStashedHeader.m_oStashedFirst : 
&m_aStashedFooter.m_oStashedFirst;
     }
     else if (bLeft && bFirst)
     {
-        pFormat = bHeader ? &m_aStashedHeader.m_pStashedFirstLeft : 
&m_aStashedFooter.m_pStashedFirstLeft;
+        pFormat = bHeader ? &m_aStashedHeader.m_oStashedFirstLeft : 
&m_aStashedFooter.m_oStashedFirstLeft;
     }
 
     if (pFormat)
     {
-        return pFormat->get();
+        return pFormat->has_value() ? &**pFormat : nullptr;
     }
     else
     {
@@ -476,15 +476,15 @@ bool SwPageDesc::HasStashedFormat(bool bHeader, bool 
bLeft, bool bFirst) const
     {
         if (bLeft && !bFirst)
         {
-            return m_aStashedHeader.m_pStashedLeft != nullptr;
+            return m_aStashedHeader.m_oStashedLeft.has_value();
         }
         else if (!bLeft && bFirst)
         {
-            return m_aStashedHeader.m_pStashedFirst != nullptr;
+            return m_aStashedHeader.m_oStashedFirst.has_value();
         }
         else if (bLeft && bFirst)
         {
-            return m_aStashedHeader.m_pStashedFirstLeft != nullptr;
+            return m_aStashedHeader.m_oStashedFirstLeft.has_value();
         }
         else
         {
@@ -496,15 +496,15 @@ bool SwPageDesc::HasStashedFormat(bool bHeader, bool 
bLeft, bool bFirst) const
     {
         if (bLeft && !bFirst)
         {
-            return m_aStashedFooter.m_pStashedLeft != nullptr;
+            return m_aStashedFooter.m_oStashedLeft.has_value();
         }
         else if (!bLeft && bFirst)
         {
-            return m_aStashedFooter.m_pStashedFirst != nullptr;
+            return m_aStashedFooter.m_oStashedFirst.has_value();
         }
         else if (bLeft && bFirst)
         {
-            return m_aStashedFooter.m_pStashedFirstLeft != nullptr;
+            return m_aStashedFooter.m_oStashedFirstLeft.has_value();
         }
         else
         {
@@ -520,15 +520,15 @@ void SwPageDesc::RemoveStashedFormat(bool bHeader, bool 
bLeft, bool bFirst)
     {
         if (bLeft && !bFirst)
         {
-            m_aStashedHeader.m_pStashedLeft.reset();
+            m_aStashedHeader.m_oStashedLeft.reset();
         }
         else if (!bLeft && bFirst)
         {
-            m_aStashedHeader.m_pStashedFirst.reset();
+            m_aStashedHeader.m_oStashedFirst.reset();
         }
         else if (bLeft && bFirst)
         {
-            m_aStashedHeader.m_pStashedFirstLeft.reset();
+            m_aStashedHeader.m_oStashedFirstLeft.reset();
         }
         else
         {
@@ -539,15 +539,15 @@ void SwPageDesc::RemoveStashedFormat(bool bHeader, bool 
bLeft, bool bFirst)
     {
         if (bLeft && !bFirst)
         {
-            m_aStashedFooter.m_pStashedLeft.reset();
+            m_aStashedFooter.m_oStashedLeft.reset();
         }
         else if (!bLeft && bFirst)
         {
-            m_aStashedFooter.m_pStashedFirst.reset();
+            m_aStashedFooter.m_oStashedFirst.reset();
         }
         else if (bLeft && bFirst)
         {
-            m_aStashedFooter.m_pStashedFirstLeft.reset();
+            m_aStashedFooter.m_oStashedFirstLeft.reset();
         }
         else
         {
commit 4edcb059e9ccc1a3735ba09382cda0e764f49bac
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Thu Nov 30 16:42:26 2023 +0900
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 14:43:37 2024 +0100

    sw: fix issue with copying stashed frame format
    
    When the PageDesc is copied from one document to another, we
    don't make sure the stashed FrameFormat(s) are also properly
    copied to the new document (which can happen at copy/paste). This
    can cause a crash if the stashed FrameFormats are accessed or
    destructed after the original document is destroyed.
    
    This fixes the issue so that when we detect the PageDesc belong
    to different documents, the stashed FrameFormats are copied just
    like the non-stashed FrameFormats (used for headers and footers).
    
    Change-Id: I948068dba4d39bb47c3725dfa8491c53c5833c7e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160065
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164011

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 382bbb5f00cd..11bb347aa1fb 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -223,7 +223,7 @@ public:
     const SwFrameFormat* GetStashedFrameFormat(bool bHeader, bool bLeft, bool 
bFirst) const;
 
     /// Checks if the pagedescriptor has a stashed format according to the 
parameters or not.
-    bool HasStashedFormat(bool bHeader, bool bLeft, bool bFirst);
+    bool HasStashedFormat(bool bHeader, bool bLeft, bool bFirst) const;
 
     /// Gives the feature of removing the stashed format by hand if it is 
necessary.
     void RemoveStashedFormat(bool bHeader, bool bLeft, bool bFirst);
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index c3b70c8cad08..6715aa9dde00 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -417,6 +417,46 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf69282)
     xSourceDoc->dispose();
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testStashedHeaderFooter)
+{
+    createSwDoc();
+    SwDoc* pSourceDocument = getSwDoc();
+    uno::Reference<lang::XComponent> xSourceDocument = mxComponent;
+    mxComponent.clear();
+
+    createSwDoc();
+    SwDoc* pTargetDocument = getSwDoc();
+    uno::Reference<lang::XComponent> xTargetDocument = mxComponent;
+    mxComponent.clear();
+
+    // Source
+    SwPageDesc* pSourcePageDesc = pSourceDocument->MakePageDesc("SourceStyle");
+    pSourcePageDesc->ChgFirstShare(false);
+    CPPUNIT_ASSERT(!pSourcePageDesc->IsFirstShared());
+    pSourcePageDesc->StashFrameFormat(pSourcePageDesc->GetFirstMaster(), true, 
false, true);
+    pSourceDocument->ChgPageDesc("SourceStyle", *pSourcePageDesc);
+    CPPUNIT_ASSERT(pSourcePageDesc->HasStashedFormat(true, false, true));
+
+    // Target
+    SwPageDesc* pTargetPageDesc = pTargetDocument->MakePageDesc("TargetStyle");
+
+    // Copy source to target
+    pTargetDocument->CopyPageDesc(*pSourcePageDesc, *pTargetPageDesc);
+
+    // Check the stashed frame format is copied
+    CPPUNIT_ASSERT(pTargetPageDesc->HasStashedFormat(true, false, true));
+
+    // Check document instance
+    auto pSourceStashedFormat = pSourcePageDesc->GetStashedFrameFormat(true, 
false, true);
+    CPPUNIT_ASSERT_EQUAL(true, pSourceStashedFormat->GetDoc() == 
pSourceDocument);
+
+    auto pTargetStashedFormat = pTargetPageDesc->GetStashedFrameFormat(true, 
false, true);
+    CPPUNIT_ASSERT_EQUAL(true, pTargetStashedFormat->GetDoc() == 
pTargetDocument);
+
+    xSourceDocument->dispose();
+    xTargetDocument->dispose();
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf69282WithMirror)
 {
     createSwDoc();
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 9f0de6aa1e06..17eaf5418e61 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1543,14 +1543,43 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, 
SwPageDesc& rDstDesc,
 
     // Copy the stashed formats as well between the page descriptors...
     for (bool bFirst : { true, false })
+    {
         for (bool bLeft : { true, false })
+        {
             for (bool bHeader : { true, false })
             {
                 if (!bLeft && !bFirst)
                     continue;
-                if (auto pStashedFormat = 
rSrcDesc.GetStashedFrameFormat(bHeader, bLeft, bFirst))
-                    rDstDesc.StashFrameFormat(*pStashedFormat, bHeader, bLeft, 
bFirst);
+
+                // Copy format only if it exists
+                if (auto pStashedFormatSrc = 
rSrcDesc.GetStashedFrameFormat(bHeader, bLeft, bFirst))
+                {
+                    if (pStashedFormatSrc->GetDoc() != this)
+                    {
+                        SwFrameFormat* pNewFormat = new 
SwFrameFormat(GetAttrPool(), "CopyDesc", GetDfltFrameFormat());
+
+                        SfxItemSet aAttrSet(pStashedFormatSrc->GetAttrSet());
+                        aAttrSet.ClearItem(RES_HEADER);
+                        aAttrSet.ClearItem(RES_FOOTER);
+
+                        pNewFormat->DelDiffs( aAttrSet );
+                        pNewFormat->SetFormatAttr( aAttrSet );
+
+                        if (bHeader)
+                            CopyHeader(*pStashedFormatSrc, *pNewFormat);
+                        else
+                            CopyFooter(*pStashedFormatSrc, *pNewFormat);
+
+                        rDstDesc.StashFrameFormat(*pNewFormat, bHeader, bLeft, 
bFirst);
+                    }
+                    else
+                    {
+                        rDstDesc.StashFrameFormat(*pStashedFormatSrc, bHeader, 
bLeft, bFirst);
+                    }
+                }
             }
+        }
+    }
 }
 
 void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles )
diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index d93b47517e5b..40a7b5865766 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -470,7 +470,7 @@ const SwFrameFormat* SwPageDesc::GetStashedFrameFormat(bool 
bHeader, bool bLeft,
     }
 }
 
-bool SwPageDesc::HasStashedFormat(bool bHeader, bool bLeft, bool bFirst)
+bool SwPageDesc::HasStashedFormat(bool bHeader, bool bLeft, bool bFirst) const
 {
     if (bHeader)
     {
commit 398eaaa804961a54ef40d86bc3eee1c1f486500d
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Feb 27 13:44:37 2024 +0600
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 12:56:06 2024 +0100

    tdf#159908: return early to avoid nullptr dereference
    
    When aLvalue is not a variable, its GetRealVar() returns nullptr.
    That was dereferenced unconditionally later in the check of the
    variable after NEXT.
    
    Change-Id: Ia46f23a7e720431bf62ace998848b684aa8449e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164002
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit 8bbfbe92c01bff38ed2241da56560b84f7954beb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163976
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx
index 07aac44943a6..f903f650a2bf 100644
--- a/basic/source/comp/loops.cxx
+++ b/basic/source/comp/loops.cxx
@@ -210,6 +210,11 @@ void SbiParser::For()
     if( bForEach )
         Next();
     SbiExpression aLvalue( this, SbOPERAND );
+    if (!aLvalue.IsVariable())
+    {
+        bAbort = true;
+        return; // the error is alredy set in SbiExpression ctor
+    }
     aLvalue.Gen();      // variable on the Stack
 
     if( bForEach )
commit d2d8332dc9dee0baed504470a3b80d431bc255a8
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Tue Nov 28 18:24:52 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 10:42:01 2024 +0100

    tdf#158326 - Auto Filter: separate sorting and removing of duplicates
    
    Change-Id: Ide74895508af280f4b0c129689d852635e62dbff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160052
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>
    (cherry picked from commit 6d0fddb697fd619d11da3469f4dd72782334f3bb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162891
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 0fc3c31387b0995cbe80ad802e66f84702def7c5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163139

diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx
index b4a9bc5d37c6..b6bed2dfc249 100644
--- a/sc/inc/typedstrdata.hxx
+++ b/sc/inc/typedstrdata.hxx
@@ -54,11 +54,21 @@ public:
         bool operator() (const ScTypedStrData& left, const ScTypedStrData& 
right) const;
     };
 
+    struct LessSortCaseSensitive
+    {
+        bool operator() (const ScTypedStrData& left, const ScTypedStrData& 
right) const;
+    };
+
     struct LessCaseInsensitive
     {
         bool operator() (const ScTypedStrData& left, const ScTypedStrData& 
right) const;
     };
 
+    struct LessSortCaseInsensitive
+    {
+        bool operator() (const ScTypedStrData& left, const ScTypedStrData& 
right) const;
+    };
+
     struct EqualCaseSensitive
     {
         bool operator() (const ScTypedStrData& left, const ScTypedStrData& 
right) const;
diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py 
b/sc/qa/uitest/autofilter/autofilterBugs.py
index 6fa029985fcc..849351861d7f 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -73,6 +73,30 @@ class autofilter(UITestCase):
             
self.assertEqual(get_state_as_dict(xTreeList.getChild("4"))["Text"], "vröude")
             
self.assertEqual(get_state_as_dict(xTreeList.getChild("5"))["Text"], "vröudᵉ")
 
+   def test_tdf158326(self):
+        with self.ui_test.create_doc_in_start_center("calc"):
+            calcDoc = self.xUITest.getTopFocusWindow()
+            xGridWindow = calcDoc.getChild("grid_window")
+            enter_text_to_cell(xGridWindow, "A1", "vröude")
+            enter_text_to_cell(xGridWindow, "A2", "vröudᵉ")
+            enter_text_to_cell(xGridWindow, "A3", "vröude")
+            enter_text_to_cell(xGridWindow, "A4", "vröudᵉ")
+            enter_text_to_cell(xGridWindow, "A5", "vröude")
+            enter_text_to_cell(xGridWindow, "A6", "vröudᵉ")
+            xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A1:A6"}))
+
+            with 
self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", 
close_button="no"):
+                pass
+
+            xGridWindow.executeAction("LAUNCH", 
mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+            xFloatWindow = self.xUITest.getFloatWindow()
+            xTreeList = xFloatWindow.getChild("check_list_box")
+
+            # Without the fix in place, there would be 5 items since they will 
not be removed
+            self.assertEqual(2, len(xTreeList.getChildren()))
+            
self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "vröude")
+            
self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "vröudᵉ")
+
    def test_tdf94055(self):
         with self.ui_test.create_doc_in_start_center("calc") as document:
             calcDoc = self.xUITest.getTopFocusWindow()
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 8d0d2ba9a665..9184ea53c767 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -88,6 +88,7 @@ void sortAndRemoveDuplicates(std::vector<ScTypedStrData>& 
rStrings, bool bCaseSe
         std::vector<ScTypedStrData>::iterator it =
             std::unique(rStrings.begin(), rStrings.end(), 
ScTypedStrData::EqualCaseSensitive());
         rStrings.erase(it, rStrings.end());
+        std::stable_sort(rStrings.begin(), rStrings.end(), 
ScTypedStrData::LessSortCaseSensitive());
     }
     else
     {
@@ -95,6 +96,7 @@ void sortAndRemoveDuplicates(std::vector<ScTypedStrData>& 
rStrings, bool bCaseSe
         std::vector<ScTypedStrData>::iterator it =
             std::unique(rStrings.begin(), rStrings.end(), 
ScTypedStrData::EqualCaseInsensitive());
         rStrings.erase(it, rStrings.end());
+        std::stable_sort(rStrings.begin(), rStrings.end(), 
ScTypedStrData::LessSortCaseInsensitive());
     }
     if (std::any_of(rStrings.begin(), rStrings.end(),
         [](ScTypedStrData& rString) { return rString.IsHiddenByFilter(); })) {
diff --git a/sc/source/core/tool/typedstrdata.cxx 
b/sc/source/core/tool/typedstrdata.cxx
index e00c1bc18d91..4e3f862ae3a4 100644
--- a/sc/source/core/tool/typedstrdata.cxx
+++ b/sc/source/core/tool/typedstrdata.cxx
@@ -34,8 +34,31 @@ bool ScTypedStrData::LessCaseSensitive::operator() (const 
ScTypedStrData& left,
     if (left.mbIsDate != right.mbIsDate)
         return left.mbIsDate < right.mbIsDate;
 
-    sal_Int32 nEqual = ScGlobal::GetCaseCollator().compareString(
-        left.maStrValue, right.maStrValue);
+    sal_Int32 nEqual
+        = ScGlobal::GetCaseTransliteration().compareString(left.maStrValue, 
right.maStrValue);
+
+    if (!nEqual)
+        return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
+
+    return nEqual < 0;
+}
+
+bool ScTypedStrData::LessSortCaseSensitive::operator() (const ScTypedStrData& 
left, const ScTypedStrData& right) const
+{
+    if (left.meStrType != right.meStrType)
+        return left.meStrType < right.meStrType;
+
+    if (left.meStrType == Value)
+    {
+        if (left.mfValue == right.mfValue)
+            return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
+        return left.mfValue < right.mfValue;
+    }
+
+    if (left.mbIsDate != right.mbIsDate)
+        return left.mbIsDate < right.mbIsDate;
+
+    sal_Int32 nEqual = 
ScGlobal::GetCaseCollator().compareString(left.maStrValue, right.maStrValue);
 
     if (!nEqual)
         return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
@@ -58,8 +81,31 @@ bool ScTypedStrData::LessCaseInsensitive::operator() (const 
ScTypedStrData& left
     if (left.mbIsDate != right.mbIsDate)
         return left.mbIsDate < right.mbIsDate;
 
-    sal_Int32 nEqual = ScGlobal::GetCollator().compareString(
-        left.maStrValue, right.maStrValue);
+    sal_Int32 nEqual
+        = ScGlobal::GetTransliteration().compareString(left.maStrValue, 
right.maStrValue);
+
+    if (!nEqual)
+        return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
+
+    return nEqual < 0;
+}
+
+bool ScTypedStrData::LessSortCaseInsensitive::operator() (const 
ScTypedStrData& left, const ScTypedStrData& right) const
+{
+    if (left.meStrType != right.meStrType)
+        return left.meStrType < right.meStrType;
+
+    if (left.meStrType == Value)
+    {
+        if (left.mfValue == right.mfValue)
+            return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
+        return left.mfValue < right.mfValue;
+    }
+
+    if (left.mbIsDate != right.mbIsDate)
+        return left.mbIsDate < right.mbIsDate;
+
+    sal_Int32 nEqual = 
ScGlobal::GetCaseCollator().compareString(left.maStrValue, right.maStrValue);
 
     if (!nEqual)
         return left.mbIsHiddenByFilter < right.mbIsHiddenByFilter;
-e 
... etc. - the rest is truncated

Reply via email to