basic/CppunitTest_basic_scanner.mk                                    |    6 
 basic/Library_sb.mk                                                   |    6 
 basic/source/runtime/runtime.cxx                                      |   46 
+++--
 cui/source/dialogs/SpellDialog.cxx                                    |   13 +
 cui/source/inc/SpellDialog.hxx                                        |    3 
 dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx                     |    6 
 dbaccess/source/ui/dlg/dbwizsetup.cxx                                 |    3 
 dbaccess/source/ui/dlg/generalpage.cxx                                |   32 
+--
 desktop/source/deployment/registry/configuration/dp_configuration.cxx |    8 
 download.lst                                                          |   32 
+--
 editeng/qa/unit/core-test.cxx                                         |   15 -
 editeng/source/editeng/impedit.hxx                                    |    2 
 editeng/source/editeng/impedit2.cxx                                   |    4 
 editeng/source/editeng/impedit4.cxx                                   |   11 -
 external/lcms2/0001-Added-missing-export.patch.1                      |   25 ++
 external/lcms2/ExternalPackage_lcms2.mk                               |    2 
 external/lcms2/UnpackedTarball_lcms2.mk                               |    4 
 external/lcms2/c++17.patch.1                                          |   13 -
 external/libassuan/ExternalPackage_libassuan.mk                       |    2 
 external/libgpg-error/ExternalPackage_libgpg-error.mk                 |    2 
 include/systools/curlinit.hxx                                         |    9 -
 include/systools/opensslinit.hxx                                      |    4 
 sc/CppunitTest_sc_parallelism.mk                                      |   81 
+++++++++
 sc/Module_sc.mk                                                       |    1 
 sc/qa/unit/data/ods/tdf160368.ods                                     |binary
 sc/qa/unit/parallelism.cxx                                            |   88 
++++++++++
 sc/qa/unit/ucalc_parallelism.cxx                                      |    3 
 sc/source/core/data/formulacell.cxx                                   |   11 +
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx                    |   82 
++++++---
 svx/qa/unit/customshapes.cxx                                          |   42 
++++
 svx/qa/unit/data/tdf160421_3D_FlipLight.odp                           |binary
 svx/source/customshapes/EnhancedCustomShape3d.cxx                     |    8 
 svx/source/svdraw/svdpntv.cxx                                         |    7 
 sw/inc/usrfld.hxx                                                     |    2 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx              |   11 +
 sw/qa/core/accessibilitycheck/data/Tabs-in-TOC.odt                    |binary
 sw/qa/extras/htmlexport/data/tdf160390.fodt                           |   17 +
 sw/qa/extras/htmlexport/htmlexport.cxx                                |    7 
 sw/source/core/access/AccessibilityCheck.cxx                          |    5 
 sw/source/core/layout/layact.cxx                                      |    6 
 sw/source/filter/html/htmlatr.cxx                                     |   40 
++--
 sw/source/filter/ww8/ww8par.cxx                                       |   43 
++--
 sw/source/filter/ww8/ww8par5.cxx                                      |   30 
++-
 sw/source/ui/index/swuiidxmrk.cxx                                     |    1 
 sw/source/uibase/shells/textsh.cxx                                    |    9 -
 toolkit/source/awt/vclxmenu.cxx                                       |   23 ++
 vcl/source/app/svmain.cxx                                             |    2 
 vcl/source/treelist/iconviewimpl.cxx                                  |    1 
 vcl/source/window/printdlg.cxx                                        |    2 
 vcl/unx/gtk3/gtkframe.cxx                                             |   22 +-
 vcl/unx/gtk3/gtkinst.cxx                                              |   33 
+++
 51 files changed, 650 insertions(+), 175 deletions(-)

New commits:
commit 560b9055d6b7c00dfed7b528e25cd5136839ad3f
Author:     Michael Stahl <[email protected]>
AuthorDate: Thu Apr 4 19:26:31 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:06 2024 +0200

    sw: layout: remove superfluous pages again in InternalAction()
    
    The bugdoc has a very large header containing hidden text changes height
    when toggling Formatting Marks.  When toggling on, it crashes, because
    UnHide() iterates the text frames in all headers, but after the first
    one empty pages at the end of the document are removed, so UAF.
    
    Remove the pages without content earlier; SwLayAction::InternalAction()
    already does it after the "normal" page loop, but the 2nd page loop
    following that may also move content off pages, so do it again.
    
    Change-Id: Iaae6a16842b3494f25cba8fc036d15049b71961f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165801
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 759d822dac5edc6104ce61b70c578425d9f2470d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165727
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 06c3027bebc5..1a0a1260a135 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -809,6 +809,12 @@ void SwLayAction::InternalAction(OutputDevice* 
pRenderContext)
             unlockPositionOfObjects( pPg );
             pPg = static_cast<SwPageFrame*>(pPg->GetNext());
         }
+        if (m_pRoot->IsSuperfluous()) // could be newly set now!
+        {
+            bool bOld = IsAgain();
+            m_pRoot->RemoveSuperfluous();
+            SetAgain(bOld);
+        }
         // reset flag for special interrupt content formatting.
         mbFormatContentOnInterrupt = false;
     }
commit 0321e8269372d4cd373a276440141d2dbad7fd8c
Author:     Mike Kaganski <[email protected]>
AuthorDate: Wed Apr 3 12:40:06 2024 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:06 2024 +0200

    tdf#160260: make poppler wrapper executable Unicode-aware on Windows
    
    Change-Id: I76dc31ee14d1794fa73f990e641540ff941c7201
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165735
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit 7b9905df455b47977968a185a7c43f35541e018b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165717
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index e924547e9357..383f6810b2a2 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -21,6 +21,8 @@
 #ifdef _WIN32
 # include <io.h>
 # include <fcntl.h>  /*_O_BINARY*/
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
 #endif
 #ifndef SYSTEM_POPPLER
 #include <string>         // std::string
@@ -30,24 +32,58 @@
 
 FILE* g_binary_out=stderr;
 
-static const char *ownerPassword = "";
-static const char *userPassword  = "";
-static const char *outputFile    = "";
-static const char *options       = "";
+#ifdef _WIN32
+
+// Use Unicode API
+
+static const wchar_t *ownerPassword = nullptr;
+static const wchar_t *userPassword  = nullptr;
+static const wchar_t *outputFile    = nullptr;
+static const wchar_t *options       = L"";
+
+#define TO_STRING_VIEW(s) std::wstring_view(L##s)
+using my_string = std::wstring;
+
+// Poppler expects UTF-8 strings on Windows - see its openFile in 
poppler/goo/gfile.cc.
+static std::string myStringToStdString(std::wstring_view s)
+{
+    int len = WideCharToMultiByte(CP_UTF8, 0, s.data(), s.size(), nullptr, 0, 
nullptr, nullptr);
+    char* buff = static_cast<char*>(_alloca(len * sizeof(char)));
+    len = WideCharToMultiByte(CP_UTF8, 0, s.data(), s.size(), buff, len, 
nullptr, nullptr);
+    return std::string(buff, len);
+}
+
+#else // ! _WIN32
+
+static const char *ownerPassword = nullptr;
+static const char *userPassword  = nullptr;
+static const char *outputFile    = nullptr;
+static const char *options       = "";
 
+#define TO_STRING_VIEW(s) std::string_view(s)
+using my_string = std::string;
+
+static std::string myStringToStdString(std::string&& s) { return std::move(s); 
}
+
+#endif
+
+#ifdef _WIN32
+int wmain(int argc, wchar_t **argv)
+#else
 int main(int argc, char **argv)
+#endif
 {
-    int k = 0;
+    int k = 1;
     while (k < argc)
     {
-        if (!strcmp(argv[k], "-f"))
+        if (argv[k] == TO_STRING_VIEW("-f"))
         {
             outputFile = argv[k+1];
             argc -= 2;
             for (int j = k; j < argc; ++j)
                 argv[j] = argv[j+2];
         }
-        else if (!strcmp(argv[k], "-o"))
+        else if (argv[k] == TO_STRING_VIEW("-o"))
         {
             options = argv[k+1];
             argc -= 2;
@@ -55,14 +91,14 @@ int main(int argc, char **argv)
                 argv[j] = argv[j+2];
         }
 
-        else if (!strcmp(argv[k], "-opw"))
+        else if (argv[k] == TO_STRING_VIEW("-opw"))
         {
             ownerPassword = argv[k+1];
             argc -= 2;
             for (int j = k; j < argc; ++j)
                 argv[j] = argv[j+2];
         }
-        else if (!strcmp(argv[k], "-upw"))
+        else if (argv[k] == TO_STRING_VIEW("-upw"))
         {
             userPassword = argv[k+1];
             argc -= 2;
@@ -79,10 +115,10 @@ int main(int argc, char **argv)
     /* Creates an absolute path to the poppler_data directory, by taking the 
path
      * to the xpdfimport executable (provided in argv[0], and concatenating a
      * relative path to the poppler_data directory from the program directory. 
*/
-    const std::string execPath = argv[0];
-    const std::size_t filenameStartPos = execPath.find_last_of("/\")+1;
-    const std::string programPath = execPath.substr(0,filenameStartPos);
-    const std::string popplerDataPath = programPath + "../" LIBO_SHARE_FOLDER 
"/xpdfimport/poppler_data";
+    const my_string execPath = argv[0];
+    const std::size_t filenameStartPos = 
execPath.find_last_of(TO_STRING_VIEW("/\")) + 1;
+    const my_string programPath = execPath.substr(0, filenameStartPos);
+    const std::string popplerDataPath = myStringToStdString(programPath + 
my_string(TO_STRING_VIEW("../" LIBO_SHARE_FOLDER "/xpdfimport/poppler_data")));
     const char* datadir = popplerDataPath.c_str();
 #endif
 
@@ -115,22 +151,26 @@ int main(int argc, char **argv)
     }
 
     // PDFDoc takes over ownership for all strings below
-    GooString* pFileName    = new GooString(argv[1]);
-    GooString* pErrFileName = new GooString(argv[2]);
+    GooString* pFileName = new GooString(myStringToStdString(argv[1]));
+    GooString* pErrFileName = new GooString(myStringToStdString(argv[2]));
 
     // check for password string(s)
     GooString* pOwnerPasswordStr( aPwBuf[0] != 0
                                  ? new GooString( aPwBuf )
-                                 : (ownerPassword[0] != ''
-                                    ? new GooString(ownerPassword)
+                                 : (ownerPassword
+                                    ? new 
GooString(myStringToStdString(ownerPassword))
                                     : nullptr ) );
     GooString* pUserPasswordStr( aPwBuf[0] != 0
                                 ? new GooString( aPwBuf )
-                                : (userPassword[0] != ''
-                                  ? new GooString(userPassword)
+                                : (userPassword
+                                  ? new 
GooString(myStringToStdString(userPassword))
                                   : nullptr ) );
-    if( outputFile[0] != '' )
+    if (outputFile)
+#if defined _WIN32
+        g_binary_out = _wfopen(outputFile, L"wb");
+#else
         g_binary_out = fopen(outputFile,"wb");
+#endif
 
 #ifdef _WIN32
     // Win actually modifies output for O_TEXT file mode, so need to
@@ -160,7 +200,7 @@ int main(int argc, char **argv)
     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
 
     pdfi::PDFOutDev aOutDev(&rDoc);
-    if (!strcmp(options, "SkipImages")) {
+    if (options == TO_STRING_VIEW("SkipImages")) {
             aOutDev.setSkipImages(true);
     }
 
commit 5adcc795fd9acab8a8bc61b7a5af0233a0f23405
Author:     Heiko Tietze <[email protected]>
AuthorDate: Thu Apr 4 12:09:33 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    Resolves tdf#154209 - Fixes resize issue in Index Entry dialog
    
    Change-Id: I83400b56d40f145c0e066c0c8b1783a1bae4cf28
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165788
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <[email protected]>
    (cherry picked from commit ebfa0d061fdbca6a25d3efcff72ab5ed184a51dc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165722
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index 8a6f74b86ee8..03d5733a87ad 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -441,6 +441,7 @@ IMPL_LINK_NOARG(SwIndexMarkPane, SyncSelectionHdl, 
weld::Button&, void)
     m_xApplyToAllCB->show();
     m_xSearchCaseSensitiveCB->show();
     m_xSearchCaseWordOnlyCB->show();
+    m_xDialog->resize_to_request();
     m_xApplyToAllCB->set_sensitive(!m_aOrgStr.isEmpty() &&
         !(nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER | 
FrameTypeFlags::FLY_ANY )));
     SearchTypeHdl(*m_xApplyToAllCB);
commit 12b17cb13a7f182d695f2f693e557de68e1c31ca
Author:     Oliver Specht <[email protected]>
AuthorDate: Thu Mar 21 12:10:40 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    tdf#160301 import DOCVARIABLE fields as user fields
    
    DOCVARIBLE fields in *.doc files are imported as user fields.
    
    Change-Id: Ib723d8a586ca644e0b158f839caef33b2b6225a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165096
    Tested-by: Jenkins
    Tested-by: Gabor Kelemen <[email protected]>
    Reviewed-by: Thorsten Behrens <[email protected]>
    (cherry picked from commit ad4b72a0eacf6bb6887236ea3a3807b1264de822)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165721

diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index 28d582c4c5ac..f7371ef52c6e 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -102,7 +102,7 @@ inline void SwUserFieldType::SetType(sal_uInt16 nSub)
  * Tracks the number format and the language, conversion between the float and
  * string representation is independent from the system locale.
  */
-class SwUserField final : public SwValueField
+class SW_DLLPUBLIC SwUserField final : public SwValueField
 {
     sal_uInt16  m_nSubType;
 
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 10ccaa487816..976a68b88a69 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/packages/XPackageEncryption.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/text/XTextFieldsSupplier.hpp>
 
 #include <i18nlangtag/languagetag.hxx>
 
@@ -4808,27 +4809,35 @@ void SwWW8ImplReader::ReadDocVars()
         aDocVarStrings, &aDocVarStringIds, &aDocValueStrings);
     if (m_bVer67)        return;
 
-    uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
-        m_pDocShell->GetModel(), uno::UNO_QUERY_THROW);
-    uno::Reference<document::XDocumentProperties> xDocProps(
-        xDPS->getDocumentProperties());
-    OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
-    uno::Reference<beans::XPropertyContainer> xUserDefinedProps =
-        xDocProps->getUserDefinedProperties();
-    OSL_ENSURE(xUserDefinedProps.is(), "UserDefinedProperties is null");
-
-    for(size_t i=0; i<aDocVarStrings.size(); i++)
+    uno::Reference< text::XTextFieldsSupplier > 
xFieldsSupplier(m_pDocShell->GetModel(), uno::UNO_QUERY_THROW);
+    uno::Reference<css::lang::XMultiServiceFactory> 
xTextFactory(m_pDocShell->GetModel(), uno::UNO_QUERY);
+    uno::Reference< container::XNameAccess > xFieldMasterAccess = 
xFieldsSupplier->getTextFieldMasters();
+    for(size_t i = 0; i < aDocVarStrings.size(); i++)
     {
         const OUString &rName = aDocVarStrings[i];
         uno::Any aValue;
-        aValue <<= rName;
-        try {
-            xUserDefinedProps->addProperty( rName,
-                beans::PropertyAttribute::REMOVABLE,
-                aValue );
-        } catch (const uno::Exception &) {
-            // ignore
+        if (aDocValueStrings.size() > i)
+        {
+            OUString value = aDocValueStrings[i];
+            value = value.replaceAll("
", "
");
+            value = value.replaceAll(" ", "
");
+            aValue <<= value;
+        }
+
+        uno::Reference< beans::XPropertySet > xMaster;
+        OUString sFieldMasterService("com.sun.star.text.FieldMaster.User." + 
rName);
+
+        // Find or create Field Master
+        if (xFieldMasterAccess->hasByName(sFieldMasterService))
+        {
+            xMaster.set(xFieldMasterAccess->getByName(sFieldMasterService), 
uno::UNO_QUERY_THROW);
+        }
+        else
+        {
+            
xMaster.set(xTextFactory->createInstance("com.sun.star.text.FieldMaster.User"), 
uno::UNO_QUERY_THROW);
+            xMaster->setPropertyValue("Name", uno::Any(rName));
         }
+        xMaster->setPropertyValue("Content", aValue);
     }
 }
 
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index c87c33dde0e1..6750fa21ae76 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -58,6 +58,7 @@
 #include <IDocumentState.hxx>
 #include <flddat.hxx>
 #include <docufld.hxx>
+#include <usrfld.hxx>
 #include <reffld.hxx>
 #include <IMark.hxx>
 #include <expfld.hxx>
@@ -1831,12 +1832,29 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* 
pF, OUString& rStr )
         aData = aData.replaceAll("\"", "");
     }
 
-    const auto pType(static_cast<SwDocInfoFieldType*>(
-        
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::DocInfo)));
-    SwDocInfoField aField(pType, nSub|nReg, aData, GetFieldResult(pF), 
nFormat);
-    if (bDateTime)
-        ForceFieldLanguage(aField, nLang);
-    m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, 
SwFormatField(aField));
+    bool bDone = false;
+    if (DI_CUSTOM == nSub)
+    {
+        const auto pType(static_cast<SwUserFieldType*>(
+            m_rDoc.getIDocumentFieldsAccess().GetFieldType(SwFieldIds::User, 
aData, false)));
+        if (pType)
+        {
+            SwUserField aField(pType, 0, nFormat);
+            if (bDateTime)
+                ForceFieldLanguage(aField, nLang);
+            m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, 
SwFormatField(aField));
+            bDone = true;
+        }
+    }
+    if (!bDone)
+    {
+        const auto pType(static_cast<SwDocInfoFieldType*>(
+            
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::DocInfo)));
+        SwDocInfoField aField(pType, nSub|nReg, aData, GetFieldResult(pF), 
nFormat);
+        if (bDateTime)
+            ForceFieldLanguage(aField, nLang);
+        m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, 
SwFormatField(aField));
+    }
 
     return eF_ResT::OK;
 }
commit 53cf1407f387f5910133507f404f72ae4940382b
Author:     Oliver Specht <[email protected]>
AuthorDate: Tue Mar 19 09:19:38 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    tdf#63259 cycle case on sentences
    
    Cycle case will be applied to the sentence if the cursor is at
    a sentence end. Writer now also keeps the word/sentence selection
    after case change.
    
    Change-Id: I9dd561775ac612689526bcb118533ba81b5722be
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165018
    Tested-by: Jenkins
    Tested-by: Gabor Kelemen <[email protected]>
    Reviewed-by: Thorsten Behrens <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165800

diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 3c92a7abfede..0258900725ea 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2702,6 +2702,11 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection& rSelection,
     if ( !aSel.HasRange() )
     {
         aSel = SelectWord( aSel, 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, true, true );
+        if (!aSel.HasRange() && aSel.Min().GetIndex() > 0 &&
+            
OUString(".!?").indexOf(aSel.Min().GetNode()->GetChar(aSel.Min().GetIndex() - 
1)) > -1 )
+        {
+            aSel = SelectSentence(aSel);
+        }
     }
 
     // tdf#107176: if there's still no range, just return aSel
diff --git a/sw/source/uibase/shells/textsh.cxx 
b/sw/source/uibase/shells/textsh.cxx
index 97de98540151..29242d99463b 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -885,10 +885,13 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest 
const & rReq )
         }
         else
         {
-            rSh.Push(); // save cur cursor
-            if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && 
rSh.SelWrd())
+            if (rSh.IsEndSentence())
+            {
+                rSh.BwdSentence(true);
+                rSh.TransliterateText(m_aRotateCase.getNextMode());
+            }
+            else if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) 
&& rSh.SelWrd())
                 rSh.TransliterateText(m_aRotateCase.getNextMode());
-            rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
         }
     }
 }
commit 157f1ad409d10baf7df9f445b181569917990e7f
Author:     Oliver Specht <[email protected]>
AuthorDate: Thu Mar 7 17:06:54 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    tdf#63259 Cycle case should work on end of words
    
    Now words are selected if the cursor is positioned at the end of
    the word. SENTENCE_CASE does not force sentence selection anymore.
    
    Change-Id: I672352b2c18bb695004fd4eb0f20ae5fd7a0ac53
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164546
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165799

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 8d2a6c11d4fc..df9fb6c8ca26 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -1863,14 +1863,15 @@ void Test::testTransliterate()
     int selStart = 12;
     int selEnd = 12;
     ESelection esel(0, selStart, 0, selEnd);
+    ESelection eSentenSel(0, 0, 0, 25);
 
     /* DocumentContentOperationsManager checks if the cursor is inside of a 
word before transliterating,
      * but Edit Engine has no such check. Therefore, behavior is different 
between these two when the
      * cursor is on a word boundary. */
 
-    /* No selection tests. Cursor between the ' ' and 'm' before 'met'. */
+    /* No selection tests. Cursor between the ' ' and 'm' before 'met' - 
except in SENTENCE_CASE where the complete sentence is selected.*/
     CPPUNIT_ASSERT_EQUAL(OUString(""), editEng.GetText(esel));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary jones met joe smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::SENTENCE_CASE));
+    CPPUNIT_ASSERT_EQUAL(OUString("Mary jones met joe smith. Time Passed."), 
lcl_translitTest(editEng, sText2, eSentenSel, TF::SENTENCE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones Met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones MET joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
@@ -1880,9 +1881,8 @@ void Test::testTransliterate()
     selEnd = 14;
     esel = ESelection(0, selStart, 0, selEnd);
     CPPUNIT_ASSERT_EQUAL(OUString(""), editEng.GetText(esel));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary jones met joe smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::SENTENCE_CASE));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
+    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones Met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
+    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones MET joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
 
     /* No selection tests. Cursor between the 'h' and the '.' after 'Smith'. */
@@ -1890,7 +1890,6 @@ void Test::testTransliterate()
     selEnd = 24;
     esel = ESelection(0, selStart, 0, selEnd);
     CPPUNIT_ASSERT_EQUAL(OUString(""), editEng.GetText(esel));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary jones met joe smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::SENTENCE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
@@ -1900,7 +1899,6 @@ void Test::testTransliterate()
     selEnd = 12;
     esel = ESelection(0, selStart, 0, selEnd);
     CPPUNIT_ASSERT_EQUAL(OUString(""), editEng.GetText(esel));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary jones met joe smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::SENTENCE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones Met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones MET joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
@@ -1910,7 +1908,6 @@ void Test::testTransliterate()
     selEnd = 14;
     esel = ESelection(0, selStart, 0, selEnd);
     CPPUNIT_ASSERT_EQUAL(OUString("met"), editEng.GetText(esel));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones Met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::SENTENCE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones Met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones MET joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
@@ -1920,7 +1917,6 @@ void Test::testTransliterate()
     selEnd = 14;
     esel = ESelection(0, selStart, 0, selEnd);
     CPPUNIT_ASSERT_EQUAL(OUString("et"), editEng.GetText(esel));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones mEt joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::SENTENCE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones mEt joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones mET joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
@@ -1930,7 +1926,6 @@ void Test::testTransliterate()
     selEnd = 13;
     esel = ESelection(0, selStart, 0, selEnd);
     CPPUNIT_ASSERT_EQUAL(OUString("me"), editEng.GetText(esel));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones Met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::SENTENCE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones Met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones MEt joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index e4352f298fd8..0aabebe2ab46 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -702,7 +702,7 @@ private:
     EditPaM             WordRight( const EditPaM& rPaM, sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
     EditPaM             StartOfWord( const EditPaM& rPaM );
     EditPaM             EndOfWord( const EditPaM& rPaM );
-    EditSelection       SelectWord( const EditSelection& rCurSelection, 
sal_Int16 nWordType = css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, bool 
bAcceptStartOfWord = true );
+    EditSelection       SelectWord( const EditSelection& rCurSelection, 
sal_Int16 nWordType = css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, bool 
bAcceptStartOfWord = true, bool bAcceptEndOfWord = false );
     EditSelection       SelectSentence( const EditSelection& rCurSel ) const;
     EditPaM             CursorVisualLeftRight( EditView const * pEditView, 
const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, bool bToLeft );
     EditPaM             CursorVisualStartEnd( EditView const * pEditView, 
const EditPaM& rPaM, bool bStart );
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index a9d55f0d6afa..a2ed3c0566ed 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1573,7 +1573,7 @@ EditPaM ImpEditEngine::EndOfWord( const EditPaM& rPaM )
     return aNewPaM;
 }
 
-EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, 
sal_Int16 nWordType, bool bAcceptStartOfWord )
+EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, 
sal_Int16 nWordType, bool bAcceptStartOfWord, bool bAcceptEndOfWord )
 {
     EditSelection aNewSel( rCurSel );
     EditPaM aPaM( rCurSel.Max() );
@@ -1595,7 +1595,7 @@ EditSelection ImpEditEngine::SelectWord( const 
EditSelection& rCurSel, sal_Int16
             aPaM.GetNode()->GetString(), aPaM.GetIndex(), aLocale, nWordType, 
true);
 
         // don't select when cursor at end of word
-        if ( ( aBoundary.endPos > aPaM.GetIndex() ) &&
+        if ( ( aBoundary.endPos > aPaM.GetIndex() || ( bAcceptEndOfWord && 
aBoundary.endPos == aPaM.GetIndex() ) ) &&
              ( ( aBoundary.startPos < aPaM.GetIndex() ) || ( 
bAcceptStartOfWord && ( aBoundary.startPos == aPaM.GetIndex() ) ) ) )
         {
             aNewSel.Min().SetIndex( aBoundary.startPos );
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 3bf44cdb9174..3c92a7abfede 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2701,11 +2701,7 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection& rSelection,
 
     if ( !aSel.HasRange() )
     {
-        /* Cursor is inside of a word */
-        if (nTransliterationMode == TransliterationFlags::SENTENCE_CASE)
-            aSel = SelectSentence( aSel );
-        else
-            aSel = SelectWord( aSel );
+        aSel = SelectWord( aSel, 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, true, true );
     }
 
     // tdf#107176: if there's still no range, just return aSel
commit fa2623dfe5d8b909d75388559a7e0dbd6dbdbf73
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Mar 25 13:45:24 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    mariadb connector: upgrade to release 3.3.8
    
    Change-Id: I21cf511a2b6c040d4a64ca720606af9312130045
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165284
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit e201b8916decefe4e5ad62718d33eb1ec1de4306)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165244
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/download.lst b/download.lst
index 1afa8b77875a..de36c3422314 100644
--- a/download.lst
+++ b/download.lst
@@ -509,8 +509,8 @@ LXML_TARBALL := lxml-4.9.2.tgz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-MARIADB_CONNECTOR_C_SHA256SUM := 
975a9a862fed80f84e0206373f7ef05537aada5b65d99b71b36ab892b44240bf
-MARIADB_CONNECTOR_C_TARBALL := mariadb-connector-c-3.3.7-src.tar.gz
+MARIADB_CONNECTOR_C_SHA256SUM := 
f9f076b4aa9fb22cc94b24f82c80f9ef063805ecd6533a2eb5d5060cf93833e8
+MARIADB_CONNECTOR_C_TARBALL := mariadb-connector-c-3.3.8-src.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
commit 9727755231913f94a46dc1ed37af4af24731f375
Author:     Mike Kaganski <[email protected]>
AuthorDate: Tue Apr 2 20:34:00 2024 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    tdf#160478: fix Basic LIKE operator
    
    1. The regex must match the whole input. Thus, the ^ and $ metacharacters
       must be replaced with \A and \z, which only match beginning and end of
       input, not any line start / end.
    2. The * and ? metacharacters of LIKE must match newline character; thus,
       search flags must include UREGEX_DOTALL. To avoid changing TextSearch
       implementation, I use icu::RegexMatcher directly.
    
    The direct use of icu::RegexMatcher also allowed to simplify the code by
    calling icu::RegexMatcher::matches method.  This may perform better than
    general-purpose utl::TextSearch::SearchForward.
    
    Change-Id: I75776498b36f236da294462362ed5b36ed8cdf68
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165700
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165704

diff --git a/basic/CppunitTest_basic_scanner.mk 
b/basic/CppunitTest_basic_scanner.mk
index 55a6e0faf311..03701864f8f7 100644
--- a/basic/CppunitTest_basic_scanner.mk
+++ b/basic/CppunitTest_basic_scanner.mk
@@ -11,6 +11,12 @@ $(eval $(call gb_CppunitTest_CppunitTest,basic_scanner))
 
 $(eval $(call gb_CppunitTest_use_ure,basic_scanner))
 
+$(eval $(call gb_CppunitTest_use_externals,basic_scanner,\
+       icu_headers \
+    icuuc \
+    icui18n \
+))
+
 $(eval $(call gb_CppunitTest_add_exception_objects,basic_scanner, \
        basic/qa/cppunit/test_scanner \
 ))
diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk
index 8076f0995873..4976eb5eda8b 100644
--- a/basic/Library_sb.mk
+++ b/basic/Library_sb.mk
@@ -25,6 +25,12 @@ $(eval $(call gb_Library_set_include,sb,\
        -I$(SRCDIR)/basic/source/inc \
 ))
 
+$(eval $(call gb_Library_use_externals,sb,\
+       icu_headers \
+    icuuc \
+    icui18n \
+))
+
 $(eval $(call 
gb_Library_set_precompiled_header,sb,basic/inc/pch/precompiled_sb))
 
 $(eval $(call gb_Library_use_custom_headers,sb,\
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index bdde50944a1d..7ae67251160a 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -49,9 +49,7 @@
 #include <svl/numformat.hxx>
 #include <svl/zforlist.hxx>
 
-#include <i18nutil/searchopt.hxx>
-#include <unotools/syslocale.hxx>
-#include <unotools/textsearch.hxx>
+#include <unicode/regex.h>
 
 #include <basic/sbuno.hxx>
 
@@ -1466,7 +1464,7 @@ namespace
 
         int seenright = 0;
 
-        sResult.append('^');
+        sResult.append("\A"); // Match at the beginning of the input
 
         while (start < end)
         {
@@ -1530,7 +1528,7 @@ namespace
             }
         }
 
-        sResult.append('$');
+        sResult.append("\z"); // Match if the current position is at the end 
of input
 
         return sResult.makeStringAndClear();
     }
@@ -1541,15 +1539,8 @@ void SbiRuntime::StepLIKE()
     SbxVariableRef refVar1 = PopVar();
     SbxVariableRef refVar2 = PopVar();
 
-    OUString pattern = VBALikeToRegexp(refVar1->GetOUString());
     OUString value = refVar2->GetOUString();
-
-    i18nutil::SearchOptions2 aSearchOpt;
-
-    aSearchOpt.AlgorithmType2 = css::util::SearchAlgorithms2::REGEXP;
-
-    aSearchOpt.Locale = 
Application::GetSettings().GetLanguageTag().getLocale();
-    aSearchOpt.searchString = pattern;
+    OUString regex = VBALikeToRegexp(refVar1->GetOUString());
 
     bool bTextMode(true);
     bool bCompatibility = ( GetSbData()->pInst && 
GetSbData()->pInst->IsCompatibility() );
@@ -1557,14 +1548,35 @@ void SbiRuntime::StepLIKE()
     {
         bTextMode = IsImageFlag( SbiImageFlags::COMPARETEXT );
     }
+    sal_uInt32 searchFlags = UREGEX_UWORD | UREGEX_DOTALL; // Dot matches 
newline
     if( bTextMode )
     {
-        aSearchOpt.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
+        searchFlags |= UREGEX_CASE_INSENSITIVE;
+    }
+
+    static sal_uInt32 cachedSearchFlags = 0;
+    static OUString cachedRegex;
+    static std::optional<icu::RegexMatcher> oRegexMatcher;
+    UErrorCode nIcuErr = U_ZERO_ERROR;
+    if (regex != cachedRegex || searchFlags != cachedSearchFlags || 
!oRegexMatcher)
+    {
+        cachedRegex = regex;
+        cachedSearchFlags = searchFlags;
+        icu::UnicodeString sRegex(false, reinterpret_cast<const 
UChar*>(cachedRegex.getStr()),
+                                  cachedRegex.getLength());
+        oRegexMatcher.emplace(sRegex, cachedSearchFlags, nIcuErr);
+    }
+
+    icu::UnicodeString sSource(false, reinterpret_cast<const 
UChar*>(value.getStr()),
+                               value.getLength());
+    oRegexMatcher->reset(sSource);
+
+    bool bRes = oRegexMatcher->matches(nIcuErr);
+    if (nIcuErr)
+    {
+        Error(ERRCODE_BASIC_INTERNAL_ERROR);
     }
     SbxVariable* pRes = new SbxVariable;
-    utl::TextSearch aSearch( aSearchOpt);
-    sal_Int32 nStart=0, nEnd=value.getLength();
-    bool bRes = aSearch.SearchForward(value, &nStart, &nEnd);
     pRes->PutBool( bRes );
 
     PushVar( pRes );
commit ddf80dae695f6331636d1478131b8eb32fef89b2
Author:     Patrick Luby <[email protected]>
AuthorDate: Tue Apr 2 10:38:58 2024 -0400
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    tdf#159790 eliminate deadlock on main thread
    
    A separate thread may have already acquired m_aMutex and that
    thread will then try to acquire the solar mutex. However, when
    the main thread calls this method, the main thread has already
    acquired the solar mutex.
    
    So, drop the desktop mutex before calling out.
    
    Change-Id: Ic87063266ac5101b866df9f24067a403e1417745
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165682
    Reviewed-by: Patrick Luby <[email protected]>
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit 89e23bb599104d3bde30878148e15cf4deb1593f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165629
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git 
a/desktop/source/deployment/registry/configuration/dp_configuration.cxx 
b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 622814248670..ceba81f9470a 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -654,7 +654,7 @@ OUString replaceOrigin(
 
 
 void BackendImpl::PackageImpl::processPackage_(
-    ::osl::ResettableMutexGuard &,
+    ::osl::ResettableMutexGuard & guard,
     bool doRegisterPackage,
     bool startup,
     ::rtl::Reference<AbortChannel> const &,
@@ -689,7 +689,10 @@ void BackendImpl::PackageImpl::processPackage_(
             if ((that->m_eContext != Context::Bundled && !startup)
                  || comphelper::LibreOfficeKit::isActive())
             {
-                if (m_isSchema)
+                bool bIsSchema = m_isSchema;
+                // tdf#159790 prevent lock-ordering deadlock, the code below 
might acquire the solar mutex
+                guard.clear();
+                if (bIsSchema)
                 {
                     css::configuration::Update::get(
                         that->m_xComponentContext)->insertExtensionXcsFile(
@@ -701,6 +704,7 @@ void BackendImpl::PackageImpl::processPackage_(
                         that->m_xComponentContext)->insertExtensionXcuFile(
                             that->m_eContext == Context::Shared, 
expandUnoRcUrl(url));
                 }
+                guard.reset();
             }
             that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv );
             data.iniEntry = dp_misc::makeRcTerm(url);
commit 97e9451883d895eed708046561012cd85c3d05b6
Author:     Regina Henschel <[email protected]>
AuthorDate: Fri Mar 29 22:44:45 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    tdf#160421 flip lights too for flipped extruded shapes
    
    If an extruded custom shape is mirrored, the lights in the scene are
    also mirrored. This should not happen. MS Office keeps the light
    direction in relation to the camera direction for binary files and pptx
    files with legacy camera. We should do the same, especially since the UI
    does not allow the user to set the light directions at arbitrary angles.
    Otherwise the shape receives only ambient light.
    
    Change-Id: I091d78c581b3d247f8b0680cd57654e3df330cdd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165562
    Tested-by: Jenkins
    Reviewed-by: Regina Henschel <[email protected]>
    (cherry picked from commit 9761d4239de6398d4f6ecf08356f2ce18e502a04)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165614
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 6ae5cc819c73..fcc68aacf413 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -63,6 +63,9 @@ protected:
     // get shape nShapeIndex from page 0
     uno::Reference<drawing::XShape> getShape(sal_uInt8 nShapeIndex);
     sal_uInt8 countShapes();
+    // fX and fY are positions relative to the size of the bitmap of the shape
+    // Thus the position is indepedent from DPI
+    Color getColor(uno::Reference<drawing::XShape> xShape, const double& fX, 
const double& fY);
 };
 
 uno::Reference<drawing::XShape> CustomshapesTest::getShape(sal_uInt8 
nShapeIndex)
@@ -89,6 +92,18 @@ sal_uInt8 CustomshapesTest::countShapes()
     return xDrawPage->getCount();
 }
 
+Color CustomshapesTest::getColor(uno::Reference<drawing::XShape> xShape, const 
double& fX,
+                                 const double& fY)
+{
+    GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", 
maTempFile.GetURL());
+    SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+    vcl::PngImageReader aPNGReader(aFileStream);
+    Bitmap aBMP = aPNGReader.read().GetBitmap();
+    Size aSize = aBMP.GetSizePixel();
+    BitmapScopedReadAccess pRead(aBMP);
+    return pRead->GetColor(aSize.Height() * fY, aSize.Width() * fX);
+}
+
 CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf150302)
 {
     loadFromFile(u"FontworkSameLetterHeights.fodg");
@@ -1381,6 +1396,33 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf153000_MS0_SPT_25_31)
         CPPUNIT_ASSERT_EQUAL(aExpected[i], aCoordinates.getLength());
     }
 }
+
+CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf160421_3D_FlipLight)
+{
+    // The document contains (0)an extruded 'rectangle' custom shape which is 
illuminated with front
+    // light, (1) this shape vertically flipped and (2) this shape 
horizontally flipped.
+    // When the shape is flipped vertically or horizontally, the light 
direction should not
+    // change. MS Office behaves in this way for ppt and pptx and it is 
meaningful as flipping is
+    // applied to the shape, not to the scene.
+
+    // Load document.
+    loadFromFile(u"tdf160421_3D_FlipLight.odp");
+
+    // Get color from untransformed shape (0).
+    uno::Reference<drawing::XShape> xShape = getShape(0);
+    Color aNormalColor = getColor(xShape, 0.6, 0.6);
+
+    // Test that color from vertically flipped shape (1) is same as normal 
color. Without the fix
+    // it was only build from ambient light and thus much darker.
+    xShape = getShape(1);
+    sal_uInt16 nColorDistance = aNormalColor.GetColorError(getColor(xShape, 
0.6, 0.6));
+    CPPUNIT_ASSERT_LESS(sal_uInt16(6), nColorDistance);
+
+    // Same for horizontally flipped shape (2)
+    xShape = getShape(2);
+    nColorDistance = aNormalColor.GetColorError(getColor(xShape, 0.6, 0.6));
+    CPPUNIT_ASSERT_LESS(sal_uInt16(6), nColorDistance);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/qa/unit/data/tdf160421_3D_FlipLight.odp 
b/svx/qa/unit/data/tdf160421_3D_FlipLight.odp
new file mode 100644
index 000000000000..2decc51e3e6d
Binary files /dev/null and b/svx/qa/unit/data/tdf160421_3D_FlipLight.odp differ
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index a401246277cc..2a2d049e184a 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -838,6 +838,14 @@ rtl::Reference<SdrObject> 
EnhancedCustomShape3d::Create3DObject(
             basegfx::B3DVector aLight2Vector(aSecondLightDirection.DirectionX, 
-aSecondLightDirection.DirectionY, aSecondLightDirection.DirectionZ);
             aLight2Vector.normalize();
 
+            // tdf#160421 a single flip inverts the light directions currently 
(March 2024). So invert
+            // their directions here for rendering.
+            if (bIsMirroredX != bIsMirroredY)
+            {
+                aLight1Vector *= -1.0;
+                aLight2Vector *= -1.0;
+            }
+
             // Light Intensity
 
             // For "FirstLight" the 3D-Scene light "1" is regularly used. In 
case of surface "Matte"
commit ec76f725e99ad15fab65a3bb766694da64faf886
Author:     Taichi Haradaguchi <[email protected]>
AuthorDate: Tue Mar 26 16:49:26 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    lcms2: upgrade to 2.16
    
    * backport 0001-Added-missing-export.patch to fix the Windows build.
    * drop c++17.patch.1, which fixed uptream.
    
    Change-Id: Ib658ba3067c35ca5cd1ccb7b3f0f2f3bc9f82a43
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165350
    Tested-by: Jenkins
    Reviewed-by: Taichi Haradaguchi <[email protected]>
    (cherry picked from commit c2db961ee69c4fe6a7f7162f2adf712651b6ffcc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165611
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/download.lst b/download.lst
index 84764c19af5e..1afa8b77875a 100644
--- a/download.lst
+++ b/download.lst
@@ -427,8 +427,8 @@ LANGTAGREG_TARBALL := 
language-subtag-registry-2023-08-02.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-LCMS2_SHA256SUM := 
b20cbcbd0f503433be2a4e81462106fa61050a35074dc24a4e356792d971ab39
-LCMS2_TARBALL := lcms2-2.15.tar.gz
+LCMS2_SHA256SUM := 
d873d34ad8b9b4cea010631f1a6228d2087475e4dc5e763eb81acc23d9d45a51
+LCMS2_TARBALL := lcms2-2.16.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/lcms2/0001-Added-missing-export.patch.1 
b/external/lcms2/0001-Added-missing-export.patch.1
new file mode 100644
index 000000000000..ad131e9533d3
--- /dev/null
+++ b/external/lcms2/0001-Added-missing-export.patch.1
@@ -0,0 +1,25 @@
+From f7b3c637c20508655f8b49935a4b556d52937b69 Mon Sep 17 00:00:00 2001
+From: Dirk Lemstra <[email protected]>
+Date: Sun, 10 Dec 2023 20:31:32 +0100
+Subject: [PATCH] Added missing export.
+
+---
+ src/cmsvirt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cmsvirt.c b/src/cmsvirt.c
+index 3d662b2..6615604 100644
+--- a/src/cmsvirt.c
++++ b/src/cmsvirt.c
+@@ -676,7 +676,7 @@ cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(void)
+ * 
+ * This virtual profile cannot be saved as an ICC file
+ */
+-cmsHPROFILE cmsCreate_OkLabProfile(cmsContext ctx)
++cmsHPROFILE CMSEXPORT cmsCreate_OkLabProfile(cmsContext ctx)
+ {
+     cmsStage* XYZPCS = _cmsStageNormalizeFromXyzFloat(ctx);
+     cmsStage* PCSXYZ = _cmsStageNormalizeToXyzFloat(ctx);
+-- 
+2.44.0.windows.1
+
diff --git a/external/lcms2/ExternalPackage_lcms2.mk 
b/external/lcms2/ExternalPackage_lcms2.mk
index a2c051f6eb9a..62e2ebad8981 100644
--- a/external/lcms2/ExternalPackage_lcms2.mk
+++ b/external/lcms2/ExternalPackage_lcms2.mk
@@ -17,7 +17,7 @@ $(eval $(call 
gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.2.dy
 else ifeq ($(COM),MSC)
 $(eval $(call 
gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/lcms2.dll,bin/lcms2.dll))
 else
-$(eval $(call 
gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.15))
+$(eval $(call 
gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.16))
 endif
 endif # $(DISABLE_DYNLOADING)
 
diff --git a/external/lcms2/UnpackedTarball_lcms2.mk 
b/external/lcms2/UnpackedTarball_lcms2.mk
index 28b30ef3acee..745da1a0a782 100644
--- a/external/lcms2/UnpackedTarball_lcms2.mk
+++ b/external/lcms2/UnpackedTarball_lcms2.mk
@@ -15,10 +15,12 @@ $(eval $(call 
gb_UnpackedTarball_update_autoconf_configs,lcms2))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,lcms2,3))
 
+# external/lcms2/0001-Added-missing-export.patch.1:
+# backport of 
https://github.com/mm2/Little-CMS/commit/f7b3c637c20508655f8b49935a4b556d52937b69
 $(eval $(call gb_UnpackedTarball_add_patches,lcms2,\
+       external/lcms2/0001-Added-missing-export.patch.1 \
        external/lcms2/lcms2-2.4-windows.patch \
        external/lcms2/lcms2-windows_aarch64_outdir.patch.1 \
-       external/lcms2/c++17.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/c++17.patch.1 b/external/lcms2/c++17.patch.1
deleted file mode 100644
index dc5b2ccde46c..000000000000
--- a/external/lcms2/c++17.patch.1
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/include/lcms2.h b/include/lcms2.h
-index cf52014..926e2a0 100644
---- a/include/lcms2.h
-+++ b/include/lcms2.h
-@@ -62,7 +62,7 @@
- // #define CMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT
- 
- // Uncomment this to remove the "register" storage class
--// #define CMS_NO_REGISTER_KEYWORD 1
-+#define CMS_NO_REGISTER_KEYWORD 1
- 
- // ********** End of configuration toggles ******************************
- 
commit 50aaacd317da93228b0d0ae4b9acafa75530b742
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Mar 25 11:23:27 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    postgresql: upgrade to release 13.14
    
    Change-Id: Ia9607fd9c8dad9d5936e867ad76b18a476f1057f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165278
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit e311a6a09d753fb566f248d653434f10a4645e63)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165237
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/download.lst b/download.lst
index 771778709e82..84764c19af5e 100644
--- a/download.lst
+++ b/download.lst
@@ -613,8 +613,8 @@ POPPLER_DATA_TARBALL := poppler-data-0.4.12.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-POSTGRESQL_SHA256SUM := 
4992ff647203566b670d4e54dc5317499a26856c93576d0ea951bdf6bee50bfb
-POSTGRESQL_TARBALL := postgresql-13.11.tar.bz2
+POSTGRESQL_SHA256SUM := 
b8df078551898960bd500dc5d38a177e9905376df81fe7f2b660a1407fa6a5ed
+POSTGRESQL_TARBALL := postgresql-13.14.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
commit b9e1784e428d90f720a5a93ee464222419145741
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Mar 31 20:25:41 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    Related: tdf#157480 use SSL_CERT_FILE on macOS too
    
    for SSL use by pyuno emailmerge
    
    another alternative mechanism that could work is to generate one
    with something like: "security find-certificate -a -p > cert.pem"
    ref: https: //hynek.me/articles/apple-openssl-verification-surprises/
    
    Change-Id: I8bff2ca5bbbb4f2c2333a67e0281dd4fa0b06405
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165625
    Reviewed-by: Patrick Luby <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/include/systools/curlinit.hxx b/include/systools/curlinit.hxx
index d03c620a3c75..4b226c7a4218 100644
--- a/include/systools/curlinit.hxx
+++ b/include/systools/curlinit.hxx
@@ -13,12 +13,13 @@
 
 #include <officecfg/Office/Security.hxx>
 
-#if defined(LINUX) && !defined(SYSTEM_CURL)
+// curl is built with --with-secure-transport on macOS and iOS so doesn't need 
these
+// certs. Windows doesn't need them either, but lets assume everything else 
does
+#if !defined(SYSTEM_OPENSSL) && !defined(_WIN32) && !defined(MACOSX) && 
!defined(IOS)
 #include <com/sun/star/uno/RuntimeException.hpp>
 
 #define LO_CURL_NEEDS_CA_BUNDLE
 #include "opensslinit.hxx"
-#undef LO_CURL_NEEDS_CA_BUNDLE
 #endif
 
 #include <rtl/string.hxx>
@@ -31,7 +32,7 @@ static void InitCurl_easy(CURL* const pCURL)
     CURLcode rc;
     (void)rc;
 
-#if defined(LINUX) && !defined(SYSTEM_CURL)
+#if defined(LO_CURL_NEEDS_CA_BUNDLE)
     char const* const path = GetCABundleFile();
     rc = curl_easy_setopt(pCURL, CURLOPT_CAINFO, path);
     if (rc != CURLE_OK) // only if OOM?
@@ -79,4 +80,6 @@ static void InitCurl_easy(CURL* const pCURL)
     assert(rc == CURLE_OK);
 }
 
+#undef LO_CURL_NEEDS_CA_BUNDLE
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/systools/opensslinit.hxx b/include/systools/opensslinit.hxx
index 04f38faa0821..48b38cf67512 100644
--- a/include/systools/opensslinit.hxx
+++ b/include/systools/opensslinit.hxx
@@ -13,8 +13,7 @@
 
 // Also include/systools/curlinit.hxx needs GetCABundleFile() if
 // !defined(SYSTEM_CURL) it defines LO_CURL_NEEDS_CA_BUNDLE.
-#if defined(LINUX) && (!defined(SYSTEM_OPENSSL) || 
defined(LO_CURL_NEEDS_CA_BUNDLE))
-#include <com/sun/star/uno/RuntimeException.hpp>
+#if !defined(_WIN32) && (!defined(SYSTEM_OPENSSL) || 
defined(LO_CURL_NEEDS_CA_BUNDLE))
 
 #include <unistd.h>
 
@@ -27,6 +26,7 @@ static char const* GetCABundleFile()
         "/etc/pki/tls/certs/ca-bundle.trust.crt",
         "/etc/ssl/certs/ca-certificates.crt",
         "/var/lib/ca-certificates/ca-bundle.pem",
+        "/etc/ssl/cert.pem", // macOS has one at this location
     };
     for (char const* const candidate : candidates)
     {
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 3aa2cecf4ec8..9eb99f09e320 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -194,7 +194,7 @@ int ImplSVMain()
 
     const bool bWasInitVCL = IsVCLInit();
 
-#if defined(LINUX) && !defined(SYSTEM_OPENSSL)
+#if !defined(_WIN32) && !defined(SYSTEM_OPENSSL)
     if (!bWasInitVCL)
     {
         OUString constexpr name(u"SSL_CERT_FILE"_ustr);
commit 5dc060ce978bbc45815244ddfabfd76b67ee5645
Author:     Patrick Luby <[email protected]>
AuthorDate: Mon Apr 1 10:01:03 2024 -0400
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    tdf#160444 check device's owner window is a nullptr
    
    Since commit 563f7077f1dbce31ff95ee8d2e8d17b629693db1, the
    device's owner window gets deleted before this object is
    deleted.
    
    Change-Id: I15dc8db60e5520c2f0e73a9a117f25af15845caf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165637
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <[email protected]>
    (cherry picked from commit d034036a049d6dcc8dc62a8e44c1e4befcaa25b0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165623
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index f0928872509a..780227f4a117 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -858,7 +858,12 @@ void SdrPaintView::InvalidateAllWin(const 
tools::Rectangle& rRect)
 void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice)
 {
     // do not erase background, that causes flicker (!)
-    rDevice.GetOwnerWindow()->Invalidate(InvalidateFlags::NoErase);
+    // tdf#160444 check device's owner window is a nullptr
+    // Since commit 563f7077f1dbce31ff95ee8d2e8d17b629693db1, the
+    // device's owner window gets deleted before this object is
+    // deleted.
+    if (rDevice.GetOwnerWindow())
+        rDevice.GetOwnerWindow()->Invalidate(InvalidateFlags::NoErase);
 }
 
 void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice, const 
tools::Rectangle& rRect)
commit 950cca89a1d17a4d1dfdbcbb84c469312d8e4b97
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Apr 1 12:59:17 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:05 2024 +0200

    libtommath: upgrade to 1.3.0
    
    Change-Id: Ica9e2520c7c70a21721f7f389fd3cd8138bf550c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165609
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 45f7af713b303643f524ac9ae7fd41ac56d96bf2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165624
    Reviewed-by: Taichi Haradaguchi <[email protected]>

diff --git a/download.lst b/download.lst
index 64836d231a98..771778709e82 100644
--- a/download.lst
+++ b/download.lst
@@ -472,8 +472,8 @@ LIBNUMBERTEXT_TARBALL := libnumbertext-1.0.11.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-LIBTOMMATH_SHA256SUM := 
986025d7b374276fee2e30e99f3649e4ac0db8a02257a37ee10eae72abed0d1f
-LIBTOMMATH_TARBALL := ltm-1.2.1.tar.xz
+LIBTOMMATH_SHA256SUM := 
296272d93435991308eb73607600c034b558807a07e829e751142e65ccfa9d08
+LIBTOMMATH_TARBALL := ltm-1.3.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
commit 44cac8ce7258e90658c24c0720ca88fff20ab5d6
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Mar 29 10:00:30 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    Resolves: tdf#160368 crash on save after deleting sheet
    
    to reproduce the underlying problem: data, calc, recalculate hard:
    
    which asserts that cell I367 is dirty during parallel calc
    
    checking the dependencies for a parallel calc is supposed to find what
    cells it depends on and either: ensure they are not dirty or detect its
    not possible to do the parallel calc
    
    checking starts in J9 where::
    
    J9:  =SUM(H$8:H9)-SUM(I9:I$9)
    J10  =SUM(H$8:H10)-SUM(I10:I$9)
    
    for the first sum it detects that the input range is H9:H367 and checks
    that for dirty results, but for the second sum it detects a range of
    just I9 and the dirty I367 is not detected and the problem arises on
    calculation
    
    The code to detect the range is:
    
    // The first row that will be referenced through the doubleref.
    SCROW nFirstRefRow = bIsRef1RowRel ? aAbs.aStart.Row() + mnStartOffset : 
aAbs.aStart.Row();
    // The last row that will be referenced through the doubleref.
    SCROW nLastRefRow =  bIsRef2RowRel ? aAbs.aEnd.Row() + mnEndOffset : 
aAbs.aEnd.Row();
    
    where for the I9 case has nFirstRefRow true and nLastRefRow false so we
    just get a range of I9:I9 instead of I9:I367.
    
    Trying to create a doc from scratch to reproduce this case proves
    tricky, so trim down the original document to the sheet and subset
    of columns that can trigger it.
    
    Change-Id: I44bfd1f6d3a3ee13db9024c5b2efa2588cc30521
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165478
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sc/CppunitTest_sc_parallelism.mk b/sc/CppunitTest_sc_parallelism.mk
new file mode 100644
index 000000000000..f7f3cc9fa7b3
--- /dev/null
+++ b/sc/CppunitTest_sc_parallelism.mk
@@ -0,0 +1,81 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# 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/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,sc_parallelism))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_parallelism))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_parallelism, \
+    sc/qa/unit/parallelism \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_parallelism, \
+    boost_headers \
+    mdds_headers \
+    libxml2 \
+    $(call gb_Helper_optional,OPENCL, \
+        clew) \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_parallelism, \
+    basegfx \
+    comphelper \
+    cppu \
+    cppuhelper \
+    i18nlangtag \
+    sal \
+    sax \
+    sc \
+    scqahelper \
+    sfx \
+    subsequenttest \
+    svl \
+    svx \
+    svxcore \
+    test \
+    tl \
+    unotest \
+    utl \
+    vcl \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_parallelism,\
+       -I$(SRCDIR)/sc/source/ui/inc \
+       -I$(SRCDIR)/sc/inc \
+       $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_parallelism,\
+    offapi \
+    udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sc_parallelism,\
+    officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sc_parallelism))
+
+$(eval $(call gb_CppunitTest_use_ure,sc_parallelism))
+
+$(eval $(call gb_CppunitTest_use_vcl,sc_parallelism))
+
+$(eval $(call gb_CppunitTest_use_rdb,sc_parallelism,services))
+
+$(eval $(call gb_CppunitTest_use_components,sc_parallelism))
+
+$(eval $(call gb_CppunitTest_use_configuration,sc_parallelism))
+
+$(eval $(call gb_CppunitTest_add_arguments,sc_parallelism, \
+    
-env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}"
 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 7bb6c0f4732a..fc0d6af35d27 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -62,6 +62,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\
        CppunitTest_sc_core \
        CppunitTest_sc_dataprovider \
        CppunitTest_sc_cache_test \
+       CppunitTest_sc_parallelism \
     CppunitTest_sc_shapetest \
 ))
 endif
diff --git a/sc/qa/unit/data/ods/tdf160368.ods 
b/sc/qa/unit/data/ods/tdf160368.ods
new file mode 100644
index 000000000000..f9da81d27846
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf160368.ods differ
diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx
new file mode 100644
index 000000000000..0ced71c44228
--- /dev/null
+++ b/sc/qa/unit/parallelism.cxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <sal/config.h>
+
+#include "helper/qahelper.hxx"
+
+#include <document.hxx>
+#include <formulagroup.hxx>
+
+#include <officecfg/Office/Calc.hxx>
+
+using namespace sc;
+
+// test-suite suitable for loading documents to test parallelism in
+// with access only to exported symbols
+
+class ScParallelismTest : public ScModelTestBase
+{
+public:
+    ScParallelismTest()
+        : ScModelTestBase("sc/qa/unit/data")
+    {
+    }
+
+    virtual void setUp() override;
+    virtual void tearDown() override;
+
+private:
+    bool getThreadingFlag() const;
+    void setThreadingFlag(bool bSet);
+
+    bool m_bThreadingFlagCfg;
+};
+
+bool ScParallelismTest::getThreadingFlag() const
+{
+    return 
officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::
+        get();
+}
+
+void ScParallelismTest::setThreadingFlag(bool bSet)
+{
+    std::shared_ptr<comphelper::ConfigurationChanges> xBatch(
+        comphelper::ConfigurationChanges::create());
+    
officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::set(
+        bSet, xBatch);
+    xBatch->commit();
+}
+
+void ScParallelismTest::setUp()
+{
+    ScModelTestBase::setUp();
+
+    sc::FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly();
+
+    m_bThreadingFlagCfg = getThreadingFlag();
+    if (!m_bThreadingFlagCfg)
+        setThreadingFlag(true);
+}
+
+void ScParallelismTest::tearDown()
+{
+    // Restore threading flag
+    if (!m_bThreadingFlagCfg)
+        setThreadingFlag(false);
+
+    ScModelTestBase::tearDown();
+}
+
+// Dependency range in this document was detected as I9:I9 instead of expected 
I9:I367
+CPPUNIT_TEST_FIXTURE(ScParallelismTest, testTdf160368)
+{
+    createScDoc("ods/tdf160368.ods");
+    ScDocShell* pDocSh = getScDocShell();
+    // without fix: ScFormulaCell::MaybeInterpret(): Assertion 
`!rDocument.IsThreadedGroupCalcInProgress()' failed.
+    pDocSh->DoHardRecalc();
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/qa/unit/ucalc_parallelism.cxx b/sc/qa/unit/ucalc_parallelism.cxx
index 2ee55708db32..8996fb5fdc7b 100644
--- a/sc/qa/unit/ucalc_parallelism.cxx
+++ b/sc/qa/unit/ucalc_parallelism.cxx
@@ -21,6 +21,9 @@
 using namespace css;
 using namespace css::uno;
 
+// test-suite suitable for creating documents to test parallelism in
+// with access to internal unexported symbols
+
 class ScParallelismTest : public ScUcalcTestBase
 {
 public:
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index f278492b0916..93d712d106f9 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4607,10 +4607,17 @@ struct ScDependantsCalculator
                         continue;
                     }
 
+                    SCROW nFirstRefStartRow = bIsRef1RowRel ? 
aAbs.aStart.Row() + mnStartOffset : aAbs.aStart.Row();
+                    SCROW nLastRefEndRow =  bIsRef2RowRel ? aAbs.aEnd.Row() + 
mnEndOffset : aAbs.aEnd.Row();
+
+                    SCROW nFirstRefEndRow = bIsRef1RowRel ? aAbs.aStart.Row() 
+ mnEndOffset : aAbs.aStart.Row();
+                    SCROW nLastRefStartRow =  bIsRef2RowRel ? aAbs.aEnd.Row() 
+ mnStartOffset : aAbs.aEnd.Row();
+
                     // The first row that will be referenced through the 
doubleref.
-                    SCROW nFirstRefRow = bIsRef1RowRel ? aAbs.aStart.Row() + 
mnStartOffset : aAbs.aStart.Row();
+                    SCROW nFirstRefRow = std::min(nFirstRefStartRow, 
nLastRefStartRow);
                     // The last row that will be referenced through the 
doubleref.
-                    SCROW nLastRefRow =  bIsRef2RowRel ? aAbs.aEnd.Row() + 
mnEndOffset : aAbs.aEnd.Row();
+                    SCROW nLastRefRow =  std::max(nLastRefEndRow, 
nFirstRefEndRow);
+
                     // Number of rows to be evaluated from nFirstRefRow.
                     SCROW nArrayLength = nLastRefRow - nFirstRefRow + 1;
                     assert(nArrayLength > 0);
commit c5e991b8103caaebb4c83adb2d62d51b8f13aad6
Author:     Xisco Fauli <[email protected]>
AuthorDate: Thu Mar 28 11:40:25 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    curl: upgrade to release 8.7.1
    
    Change-Id: I0064b4cf6baf1ccd951c95945539961fe72c2a28
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165455
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 2c1a7cb13629177f824ed35138907aef10714e89)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165489
    Reviewed-by: Taichi Haradaguchi <[email protected]>

diff --git a/download.lst b/download.lst
index d1355a75452a..64836d231a98 100644
--- a/download.lst
+++ b/download.lst
@@ -80,8 +80,8 @@ CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-CURL_SHA256SUM := 
3ccd55d91af9516539df80625f818c734dc6f2ecf9bada33c76765e99121db15
-CURL_TARBALL := curl-8.6.0.tar.xz
+CURL_SHA256SUM := 
6fea2aac6a4610fbd0400afb0bcddbe7258a64c63f1f68e5855ebc0c659710cd
+CURL_TARBALL := curl-8.7.1.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
commit 4588f9a2030fe73ceddd536260b2875583fe9721
Author:     Samuel Mehrbrodt <[email protected]>
AuthorDate: Mon Mar 18 15:19:42 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    tdf#159918 a11y check: Don't warn about tabs in ToC
    
    Change-Id: Ifde41deb66c8dcb72842e18e539609ff351be832
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164972
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <[email protected]>
    (cherry picked from commit c6075e716200e9c6bae1b10be2cf10013958e83a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165424
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 117b48d01661..bfe2e08d8543 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -251,6 +251,17 @@ scanAccessibilityIssuesOnNodes(SwDoc* pDocument)
     return aIssues;
 }
 
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckTabsinTOC)
+{
+    createSwDoc("Tabs-in-TOC.odt");
+    SwDoc* pDoc = getSwDoc();
+    CPPUNIT_ASSERT(pDoc);
+    sw::AccessibilityCheck aCheck(pDoc);
+    aCheck.check();
+    auto& aIssues = aCheck.getIssueCollection().getIssues();
+    CPPUNIT_ASSERT_EQUAL(size_t(0), aIssues.size());
+}
+
 void checkIssuePosition(std::shared_ptr<sfx::AccessibilityIssue> const& 
pIssue, int nLine,
                         sal_Int32 nStart, sal_Int32 nEnd, SwNodeOffset nIndex)
 {
diff --git a/sw/qa/core/accessibilitycheck/data/Tabs-in-TOC.odt 
b/sw/qa/core/accessibilitycheck/data/Tabs-in-TOC.odt
new file mode 100644
index 000000000000..2b3ce54cc5a3
Binary files /dev/null and b/sw/qa/core/accessibilitycheck/data/Tabs-in-TOC.odt 
differ
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index e515b5cae7ed..dfa94c3ed9ab 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -901,6 +901,11 @@ public:
                 }
                 case ' ':
                 {
+                    // Don't warn about tabs in ToC
+                    auto pSection = 
SwDoc::GetCurrSection(SwPosition(*pTextNode, 0));
+                    if (pSection && pSection->GetTOXBase())
+                        continue;
+
                     if (bPreviousWasChar)
                     {
                         ++nTabCount;
commit 21faa1fc42dc89cf4bb0c25ca1af7b5b3484dd11
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Mar 30 20:56:37 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    Resolves: tdf#157258 "Always autocorrect to" deletes the word
    
    instead of replacing it, affecting extensions like Grammalecte,
    LanguageTool, Antidote
    
    this began in:
    
    commit afa35742a4633db31b6d6c72cf45741506e9edfb
    Date:   Sat Dec 11 21:09:39 2021 +0000
    
        prefer more css::awt::XPopupMenu api
    
    but the underlying trap was introduced in:
    
    commit 6c84dc18062ec6aad71fd65a409373c274402991
    Date:   Wed Oct 6 10:16:39 2010 +0100
    
        initial commit for vba blob ( not including container_control stuff )
    
    which added creating a VCLXPopupMenu in VCLXMenu::getPopupMenu if there
    was a vcl PopupMenu in the vcl Menu which hadn't been created by calling
    VCLXMenu::setPopupMenu. That didn't take into account that VCLXPopupMenu
    (like VCLXMenu) takes ownership of the PopupMenu and will destroy it in
    its own dtor, so the sub menu Popup get destroyed if the VCLXPopupMenu
    is shorter lived than the VCLXMenu wrapping the parent Menu.
    
    Change-Id: Ic28c27670d846ee9d2ff77d834e43fc157924eb6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165484
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 20d3d5d2d18a..6515258861b4 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -413,11 +413,30 @@ css::uno::Reference< css::awt::XPopupMenu > 
VCLXMenu::getPopupMenu(
                 break;
             }
         }
-        // it seems the popup menu is not insert into maPopupMenuRefs
-        // if the popup men is not created by stardiv.Toolkit.VCLXPopupMenu
+        /*
+           If the popup menu is not inserted via setPopupMenu then
+           maPopupMenuRefs won't have an entry for it, so create an XPopupMenu
+           for it now.
+
+           This means that this vcl PopupMenu "pMenu" either existed as a child
+           of the vcl Menu "mpMenu" before the VCLXMenu was created for that or
+           it was added directly via vcl.
+        */
         if( !aRef.is() )
         {
             aRef = new VCLXPopupMenu( static_cast<PopupMenu*>(pMenu) );
+            /*
+               In any case, the VCLXMenu has ownership of "mpMenu" and will
+               destroy it in the VCLXMenu dtor.
+
+               Similarly because VCLXPopupMenu takes ownership of the vcl
+               PopupMenu "pMenu", the underlying vcl popup will be destroyed
+               when VCLXPopupMenu is, so we should add it now to
+               maPopupMenuRefs to ensure its lifecycle is at least bound to
+               the VCLXMenu that owns the parent "mpMenu" similarly to
+               PopupMenus added via the more conventional setPopupMenu.
+            */
+            maPopupMenuRefs.push_back( aRef );
         }
     }
     return aRef;
commit 7763e10e4dc43f2f8a9f10a84d452478af30bb28
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Mar 30 21:25:51 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    Resolves: tdf#157587 IconView scoll range not updated
    
    IconView::SetUpdateMode(true) doesn't update the scroll
    range for any changes that might have taken place while
    updates were suspended.
    
    The similar SvImpLBox::UpdateAll() for "normal" lists
    does this update, so do the equivalent update here too.
    
    Noticeable since:
    
    commit 666925f2ab06e690c41c470713dc83f2d752bfb7
    Date:   Sat Jun 3 15:23:15 2023 +0100
    
        perf: use freeze/thaw around block insert of multiple icons
    
    Change-Id: I318fc4509c6906161eabf3b312f311cb97ac063a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165485
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/vcl/source/treelist/iconviewimpl.cxx 
b/vcl/source/treelist/iconviewimpl.cxx
index 048e193d4f4b..35025d1c81f4 100644
--- a/vcl/source/treelist/iconviewimpl.cxx
+++ b/vcl/source/treelist/iconviewimpl.cxx
@@ -467,6 +467,7 @@ void IconViewImpl::SyncVerThumb()
 void IconViewImpl::UpdateAll()
 {
     FindMostRight();
+    AdjustScrollBars(m_aOutputSize);
     SyncVerThumb();
     FillView();
     ShowVerSBar();
commit 47d161595f6a68c1905f3b42618b6407bc9b7171
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Mar 31 18:11:42 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    Resolves: tdf#154072 no effect when clicking some dropdown buttons
    
    when toolbar overflows.
    
    A problem since:
    
    commit b534ee2e972711af2dbaadf2190813054adda902
    Date:   Tue Nov 22 11:33:23 2022 +0000
    
        Resolves: tdf#152155 use gtk's knowledge of relative widget positions
    
        rather than effectively emulate it poorly
    
    Change-Id: I18c08e43e9c0b642f2a30b5114d6f0a53f18a331
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165610
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index f996b4359b1d..8c097c526c5b 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -3953,12 +3953,24 @@ void GtkSalFrame::signalRealize(GtkWidget*, gpointer 
frame)
     }
 
     AbsoluteScreenPixelRectangle aFloatRect = 
FloatingWindow::ImplConvertToAbsPos(pVclParent, pThis->m_aFloatRect);
-    if 
(gdk_window_get_window_type(widget_get_surface(pThis->m_pParent->m_pWindow)) != 
GDK_WINDOW_TOPLEVEL)
+    switch 
(gdk_window_get_window_type(widget_get_surface(pThis->m_pParent->m_pWindow)))
     {
-        // See tdf#152155 for an example
-        gtk_coord nX(0), nY(0.0);
-        gtk_widget_translate_coordinates(pThis->m_pParent->m_pWindow, 
widget_get_toplevel(pThis->m_pParent->m_pWindow), 0, 0, &nX, &nY);
-        aFloatRect.Move(nX, nY);
+        case GDK_WINDOW_TOPLEVEL:
+            break;
+        case GDK_WINDOW_CHILD:
+        {
+            // See tdf#152155 for an example
+            gtk_coord nX(0), nY(0.0);
+            gtk_widget_translate_coordinates(pThis->m_pParent->m_pWindow, 
widget_get_toplevel(pThis->m_pParent->m_pWindow), 0, 0, &nX, &nY);
+            aFloatRect.Move(nX, nY);
+            break;
+        }
+        default:
+        {
+            // See tdf#154072 for an example
+            aFloatRect.Move(-pThis->m_pParent->maGeometry.x(), 
-pThis->m_pParent->maGeometry.y());
+            break;
+        }
     }
 
     GdkRectangle rect {static_cast<int>(aFloatRect.Left()), 
static_cast<int>(aFloatRect.Top()),
commit 9fbc48d7fefe1c03f86616adb2a08674a2a8ca91
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Mar 29 20:10:02 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    Resolves: tdf#159498 Items in Template Manager dropdown should be 
left-aligned
    
    Change-Id: I72d32793814b28b7452be701f0732dbd9dbbcb37
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165483
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index d3eb4c5e4418..a899fc16c606 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -5505,8 +5505,9 @@ public:
         {
             GtkBox *pBox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6));
             GtkWidget *pLabel = 
gtk_label_new_with_mnemonic(MapToGtkAccelerator(rStr).getStr());
+            gtk_label_set_xalign(GTK_LABEL(pLabel), 0.0);
             pItem = eCheckRadioFalse != TRISTATE_INDET ? 
gtk_check_menu_item_new() : gtk_menu_item_new();
-            gtk_box_pack_start(pBox, pImage, true, true, 0);
+            gtk_box_pack_start(pBox, pImage, false, true, 0);
             gtk_box_pack_start(pBox, pLabel, true, true, 0);
             gtk_container_add(GTK_CONTAINER(pItem), GTK_WIDGET(pBox));
             gtk_widget_show_all(pItem);
commit 787ca025dad32e67cf6711ce0f7386fd45b4ec93
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Mar 29 17:24:09 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    Resolves: tdf#160028 Type to select currency in dropdown does not work for 
gtk
    
    LibreOffice embeds RTL/LTR direction markers in currency strings, which
    defeats the default gtk search mechanism, so switch in our one instead.
    
    Change-Id: Ia118f8c8e27103c21955683f8a2fd3c17c2b2098
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165477
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 036493239217..d3eb4c5e4418 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14839,6 +14839,32 @@ private:
     }
 #endif
 
+    static gboolean search_equal_func(GtkTreeModel *model,
+                                      int           column,
+                                      const char   *key,
+                                      GtkTreeIter  *iter,
+                                      gpointer    /*user_data*/)
+    {
+        GValue aValue = G_VALUE_INIT;
+        gtk_tree_model_get_value(model, iter, column, &aValue);
+
+        GValue aStringValue = G_VALUE_INIT;
+        g_value_init(&aStringValue, G_TYPE_STRING);
+        const bool fail = !g_value_transform(&aValue, &aStringValue);
+        g_value_unset(&aValue);
+        if (fail)
+            return true;
+
+        bool bNoMatch(true);
+        if (const char *str = g_value_get_string(&aStringValue))
+        {
+            const vcl::I18nHelper& rI18nHelper = 
Application::GetSettings().GetLocaleI18nHelper();
+            bNoMatch = !rI18nHelper.MatchString(OUString::fromUtf8(key), 
OUString::fromUtf8(str));
+        }
+        g_value_unset(&aStringValue);
+        return bNoMatch;
+    }
+
 public:
     GtkInstanceTreeView(GtkTreeView* pTreeView, GtkInstanceBuilder* pBuilder, 
bool bTakeOwnership)
         : GtkInstanceWidget(GTK_WIDGET(pTreeView), pBuilder, bTakeOwnership)
@@ -14970,6 +14996,10 @@ public:
 
         m_nRowDeletedSignalId = g_signal_connect(m_pTreeModel, "row-deleted", 
G_CALLBACK(signalRowDeleted), this);
         m_nRowInsertedSignalId = g_signal_connect(m_pTreeModel, 
"row-inserted", G_CALLBACK(signalRowInserted), this);
+
+        // tdf#160028 LibreOffice embeds RTL/LTR direction markers in currency 
strings, which defeats the
+        // default gtk search mechanism, so switch in our one here
+        gtk_tree_view_set_search_equal_func(m_pTreeView, search_equal_func, 
nullptr, nullptr);
     }
 
     virtual void connect_query_tooltip(const Link<const weld::TreeIter&, 
OUString>& rLink) override
commit d2a2e0ea53028a97ebae8118226b8a06489d24f3
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Mar 29 16:22:10 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    Resolves: tdf#160159 update spellchecking area colors when style changes
    
    so for the case of using "automatic" for the document background the
    spelling checking textbox background area updates to match
    
    Change-Id: I8723afb946176596b0a5fa43aa3bb3c036dee12c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165476
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index dfdad984ec41..9dd877f80cf9 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1152,6 +1152,13 @@ void 
SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 
     m_xEditEngine->SetStatusEventHdl(LINK(this, SentenceEditWindow_Impl, 
EditStatusHdl));
 
+    SetDocumentColor(pDrawingArea);
+}
+
+void SentenceEditWindow_Impl::SetDocumentColor(weld::DrawingArea* pDrawingArea)
+{
+    if (!pDrawingArea || !m_xEditView || !m_xEditEngine)
+        return;
     // tdf#142631 use document background color in this widget
     Color aBgColor = 
svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
     OutputDevice& rDevice = pDrawingArea->get_ref_device();
@@ -1160,6 +1167,12 @@ void 
SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
     m_xEditEngine->SetBackgroundColor(aBgColor);
 }
 
+void SentenceEditWindow_Impl::StyleUpdated()
+{
+    SetDocumentColor(GetDrawingArea());
+    WeldEditView::StyleUpdated();
+}
+
 IMPL_LINK_NOARG(SentenceEditWindow_Impl, EditStatusHdl, EditStatus&, void)
 {
     SetScrollBarRange();
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index fdf5e81bcdf3..81d68e214314 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -71,6 +71,7 @@ private:
 
 protected:
     virtual bool    KeyInput( const KeyEvent& rKEvt ) override;
+    virtual void    StyleUpdated() override;
 
 public:
     SentenceEditWindow_Impl(std::unique_ptr<weld::ScrolledWindow> 
xScrolledWindow);
@@ -120,6 +121,8 @@ public:
     void            MoveErrorEnd(tools::Long nOffset);
 
     void            ResetIgnoreErrorsAt()   { m_aIgnoreErrorsAt.clear(); }
+
+    void            SetDocumentColor(weld::DrawingArea* pDrawingArea);
 };
 
 // class SvxSpellDialog ---------------------------------------------
commit 6c91e590da13287e92df86e515fc48d44438f064
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Mar 25 10:56:38 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    nss: upgrade to release 3.99
    
    Change-Id: I77ccc45854b2d0aecc288f471d94c81ad9089f85
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165273
    Tested-by: Xisco Fauli <[email protected]>
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit c6d791e3d2577498affec491876a0afa441be002)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165245
    Tested-by: Jenkins
    Reviewed-by: Taichi Haradaguchi <[email protected]>

diff --git a/download.lst b/download.lst
index 46cd968ed233..d1355a75452a 100644
--- a/download.lst
+++ b/download.lst
@@ -540,8 +540,8 @@ MYTHES_TARBALL := mythes-1.2.5.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-NSS_SHA256SUM := 
59bb55a59b02e4004fc26ad0aa1a13fe8d73c6c90c447dd2f2efb73fb81083ed
-NSS_TARBALL := nss-3.98-with-nspr-4.35.tar.gz
+NSS_SHA256SUM := 
5f29fea64b3234b33a615b6df40469e239a4168ac0909106bd00e6490b274c31
+NSS_TARBALL := nss-3.99-with-nspr-4.35.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
commit a947e50a6ffde5a651a6fadfb884118662ebdcf9
Author:     Xisco Fauli <[email protected]>
AuthorDate: Thu Mar 28 12:10:17 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    libgpg-error: upgrade to release 1.48
    
    Change-Id: I3920d10657a91b56f484a5a61017d2e2ba3291b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165457
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 65bee6317eafd4d0e449c779c160e9b3017b57ce)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165471
    Reviewed-by: Taichi Haradaguchi <[email protected]>

diff --git a/download.lst b/download.lst
index ef21c405237b..46cd968ed233 100644
--- a/download.lst
+++ b/download.lst
@@ -457,8 +457,8 @@ LIBFFI_TARBALL := libffi-3.4.4.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-LIBGPGERROR_SHA256SUM := 
9e3c670966b96ecc746c28c2c419541e3bcb787d1a73930f5e5f5e1bcbbb9bdb
-LIBGPGERROR_TARBALL := libgpg-error-1.47.tar.bz2
+LIBGPGERROR_SHA256SUM := 
89ce1ae893e122924b858de84dc4f67aae29ffa610ebf668d5aa539045663d6f
+LIBGPGERROR_TARBALL := libgpg-error-1.48.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/libgpg-error/ExternalPackage_libgpg-error.mk 
b/external/libgpg-error/ExternalPackage_libgpg-error.mk
index fd887fb5776d..2c64ba3b5cc6 100644
--- a/external/libgpg-error/ExternalPackage_libgpg-error.mk
+++ b/external/libgpg-error/ExternalPackage_libgpg-error.mk
@@ -15,7 +15,7 @@ ifneq ($(DISABLE_DYNLOADING),TRUE)
 
 ifeq ($(OS),LINUX)
 
-$(eval $(call 
gb_ExternalPackage_add_file,libgpg-error,$(LIBO_LIB_FOLDER)/libgpg-error-lo.so.0,src/.libs/libgpg-error-lo.so.0.34.0))
+$(eval $(call 
gb_ExternalPackage_add_file,libgpg-error,$(LIBO_LIB_FOLDER)/libgpg-error-lo.so.0,src/.libs/libgpg-error-lo.so.0.35.0))
 
 else ifeq ($(OS),MACOSX)
 
commit 05d551453b5abaa87356f49954bad4d939414c44
Author:     Xisco Fauli <[email protected]>
AuthorDate: Thu Mar 28 11:49:58 2024 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:04 2024 +0200

    libassuan: upgrade to 2.5.7
    
    Change-Id: I6114c7a77395f14e83d2315ac6f9b6829ddb1c6a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165456
    Tested-by: Xisco Fauli <[email protected]>
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 0343d7153e77ba79a59bc5f6c51159af9010813e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165472
    Tested-by: Jenkins
    Reviewed-by: Taichi Haradaguchi <[email protected]>

diff --git a/download.lst b/download.lst
index d5654272cd2d..ef21c405237b 100644
--- a/download.lst
+++ b/download.lst
@@ -432,8 +432,8 @@ LCMS2_TARBALL := lcms2-2.15.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-LIBASSUAN_SHA256SUM := 
e9fd27218d5394904e4e39788f9b1742711c3e6b41689a31aa3380bd5aa4f426
-LIBASSUAN_TARBALL := libassuan-2.5.6.tar.bz2
+LIBASSUAN_SHA256SUM := 
0103081ffc27838a2e50479153ca105e873d3d65d8a9593282e9c94c7e6afb76
+LIBASSUAN_TARBALL := libassuan-2.5.7.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/libassuan/ExternalPackage_libassuan.mk 
b/external/libassuan/ExternalPackage_libassuan.mk
index 2df7b562d584..77dc05a665f1 100644
--- a/external/libassuan/ExternalPackage_libassuan.mk
+++ b/external/libassuan/ExternalPackage_libassuan.mk
@@ -15,7 +15,7 @@ ifneq ($(DISABLE_DYNLOADING),TRUE)
 
 ifeq ($(OS),LINUX)
 
-$(eval $(call 
gb_ExternalPackage_add_file,libassuan,$(LIBO_LIB_FOLDER)/libassuan.so.0,src/.libs/libassuan.so.0.8.6))
+$(eval $(call 
gb_ExternalPackage_add_file,libassuan,$(LIBO_LIB_FOLDER)/libassuan.so.0,src/.libs/libassuan.so.0.8.7))
 
 else ifeq ($(OS),MACOSX)
 
commit 352643613cee175888b099be2cf7df51ee59d785
Author:     Mike Kaganski <[email protected]>
AuthorDate: Tue Mar 19 11:47:14 2024 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:03 2024 +0200

    tdf#103068: make sure to update and use current MySQL connection type
    
    1. Don't set selection in OGeneralPageWizard::getEmbeddedDBName. The
    method should only provide a name of an embedded database - either in
    the passed set, or the default one; the activation of controls and
    related actions will be done in the calling implInitControls. This
    makes sure, that ODbTypeWizDialogSetup::m_sURL doesn't get rewritten
    unnecessarily, keeping the current preference intact.
    
    2. In ODbTypeWizDialogSetup::activateDatabasePath, do not use the
    hardcoded MySQL URL from the control, if the current value of m_sURL
    is already a MySQL one. This allows to keep the selected kind intact.
    
    3. In OMySQLIntroPageSetup::implInitControls, do not assume that the
    existing selection means that there's nothing to do. The page keeps
    the selection, even when the wizard's active path was changed; and
    so, the wizard's idea which page to show next may differ from the
    selection. Just make sure to update the setup mode.
    
    Change-Id: Iad98d54a615dccc58b2852a1c0d8aefad6b0b898
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164987
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit 1e66905c840dbee0a67e444fca80bdacfcb6e6b2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165000
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx 
b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 22cdefdd6c31..ad81680ba421 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -239,9 +239,13 @@ using namespace ::com::sun::star;
         if ( bHasMySQLNative )
             m_xNATIVEDatabase->show();
 
-        // if any of the options is checked, then there's nothing to do
+        // tdf#103068: if any of the options is checked, then just update the 
selected kind:
+        // it could happen that the selection and the wizard path are not in 
sync
         if ( m_xODBCDatabase->get_active() || m_xJDBCDatabase->get_active() || 
m_xNATIVEDatabase->get_active() )
+        {
+            maClickHdl.Call(this);
             return;
+        }
 
         // prefer "native" or "JDBC"
         if ( bHasMySQLNative )
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx 
b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 720892e2a015..2fb260e18e75 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -312,6 +312,9 @@ void ODbTypeWizDialogSetup::activateDatabasePath()
     {
         OUString sOld = m_sURL;
         m_sURL = m_pGeneralPage->GetSelectedType();
+        if (m_sURL.startsWith("sdbc:mysql:") && sOld.startsWith("sdbc:mysql:"))
+            m_sURL = sOld; // The type of MySQL connection was already set 
elsewhere; just use it,
+                           // instead of the hardcoded one from the selector
         DataSourceInfoConverter::convert(getORB(), 
m_pCollection,sOld,m_sURL,m_pImpl->getCurrentDataSource());
         ::dbaccess::DATASOURCE_TYPE eType = 
VerifyDataSourceType(m_pCollection->determineType(m_sURL));
         if (eType ==  ::dbaccess::DST_UNKNOWN)
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx 
b/dbaccess/source/ui/dlg/generalpage.cxx
index a2a48158c56d..bb308845528e 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -226,31 +226,29 @@ namespace dbaui
 
     OUString OGeneralPageWizard::getEmbeddedDBName( const SfxItemSet& _rSet )
     {
+        if (!m_pCollection)
+            return {};
         // first check whether or not the selection is invalid or readonly 
(invalid implies readonly, but not vice versa)
         bool bValid, bReadonly;
         getFlags( _rSet, bValid, bReadonly );
-
-        // if the selection is invalid, disable everything
-
-        implSetCurrentType(  OUString() );
+        if (!bValid)
+            return {};
 
         // compare the DSN prefix with the registered ones
-        OUString sDisplayName;
-
-        if (m_pCollection && bValid)
-        {
-            implSetCurrentType( 
dbaccess::ODsnTypeCollection::getEmbeddedDatabase() );
-            sDisplayName = m_pCollection->getTypeDisplayName( 
m_eCurrentSelection );
-            onTypeSelected(m_eCurrentSelection);
-        }
-
-        // select the correct datasource type
-        if  (  dbaccess::ODsnTypeCollection::isEmbeddedDatabase( 
m_eCurrentSelection )
-            && m_xEmbeddedDBType->find_text(sDisplayName) == -1 )
+        OUString sDBURL;
+        if (const SfxStringItem* pUrlItem = 
_rSet.GetItem<SfxStringItem>(DSID_CONNECTURL))
+            if 
(dbaccess::ODsnTypeCollection::isEmbeddedDatabase(pUrlItem->GetValue()))
+                sDBURL = pUrlItem->GetValue();
+        if (sDBURL.isEmpty())
+            sDBURL = dbaccess::ODsnTypeCollection::getEmbeddedDatabase();
+        OUString sDisplayName = m_pCollection->getTypeDisplayName(sDBURL);
+
+        // ensure presence of the correct datasource type
+        if (!sDisplayName.isEmpty() && 
m_xEmbeddedDBType->find_text(sDisplayName) == -1)
         {   // this indicates it's really a type which is known in general, 
but not supported on the current platform
             // show a message saying so
             //  eSpecialMessage = smUnsupportedType;
-            insertEmbeddedDBTypeEntryData( m_eCurrentSelection, sDisplayName );
+            insertEmbeddedDBTypeEntryData(sDBURL, sDisplayName);
         }
 
         return sDisplayName;
commit b5722428b4510bb6cc9d06a8d334aa20c77c492f
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Mar 27 17:23:18 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:03 2024 +0200

    Resolves: tdf#160392 preview's measurement are black on dark bg in dark mode
    
    Change-Id: I538750ef7d20ecc17a60ce47989eeaf0390a0103
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165414
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 9c5f519f7cfb..c001b6e74070 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -122,7 +122,7 @@ void 
PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext,
 {
     rRenderContext.Push();
     weld::SetPointFont(rRenderContext, 
rRenderContext.GetSettings().GetStyleSettings().GetLabelFont());
-
+    
rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetLabelTextColor());
     
rRenderContext.SetBackground(Wallpaper(Application::GetSettings().GetStyleSettings().GetDialogColor()));
     rRenderContext.Erase();
 
commit 153040b2eaa8efe399ba7bc4c0a4c43603b89e40
Author:     Mike Kaganski <[email protected]>
AuthorDate: Wed Mar 27 16:01:51 2024 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Apr 7 13:58:03 2024 +0200

    tdf#160390: make sure to forward the iterator
    
    Change-Id: I302cc4303f083a1024175ce4ba00ce8021c6d4c9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165390
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165404

diff --git a/sw/qa/extras/htmlexport/data/tdf160390.fodt 
b/sw/qa/extras/htmlexport/data/tdf160390.fodt
new file mode 100644
index 000000000000..53d6144ff19b
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/tdf160390.fodt
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:automatic-styles>
+  <style:style style:name="P1" style:family="paragraph">
+   <style:text-properties style:text-underline-style="solid" 
fo:font-weight="bold"/>
+  </style:style>
+  <style:style style:name="T1" style:family="text">
+   <style:text-properties style:text-underline-style="none" 
fo:font-weight="normal"/>
+  </style:style>
+ </office:automatic-styles>
+ <office:body>
+  <office:text>
+   <text:p text:style-name="P1">foo<text:span text:style-name="T1"> 
</text:span></text:p>
+  </office:text>
+ </office:body>
+</office:document>
\ No newline at end of file
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index de2e9da4c678..42099f3bc44f 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -3053,6 +3053,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testHTML_Tdf160017_spanClosingOrder)
     CPPUNIT_ASSERT(parseXml(maTempFile));
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testHTML_Tdf160390)
+{
+    // This document must not hang infinitely on HTML export
+    createSwDoc("tdf160390.fodt");
+    ExportToHTML();
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/htmlatr.cxx 
b/sw/source/filter/html/htmlatr.cxx
index c880082018f1..f298f93dc5b2 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1524,8 +1524,9 @@ void HTMLEndPosLst::SplitItem( const SfxPoolItem& rItem, 
sal_Int32 nStart,
 
         for (auto it = items.begin(); it != items.end();)
         {
-            HTMLStartEndPos* pTest = *it;
-            sal_Int32 nTestEnd = pTest->GetEnd();
+            auto itTest = it++; // forward early, allow 'continue', and keep a 
copy for 'erase'
+            HTMLStartEndPos* pTest = *itTest;
+            const sal_Int32 nTestEnd = pTest->GetEnd();
             if (nTestEnd <= nStart)
                 continue;
 
@@ -1533,28 +1534,25 @@ void HTMLEndPosLst::SplitItem( const SfxPoolItem& 
rItem, sal_Int32 nStart,
             const SfxPoolItem& rTestItem = pTest->GetItem();
 
             // only the corresponding OnTag attributes have to be considered
-            if (rTestItem.Which() == nWhich && HTML_ON_VALUE == 
GetHTMLItemState(rTestItem))
-            {
-                // if necessary, insert the second part of the split
-                // attribute
-                if (nTestEnd > nEnd)
-                    InsertItem(pTest->GetItem(), nEnd, nTestEnd);
+            if (rTestItem.Which() != nWhich || HTML_ON_VALUE != 
GetHTMLItemState(rTestItem))
+                continue;
 
-                if (nTestStart >= nStart)
-                {
-                    // the Test item only starts after the new end of the
-                    // attribute. Therefore, it can be completely erased.
-                    it = items.erase(it);
-                    std::erase(m_aEndLst[pTest->GetEnd()], pTest);
-                    delete pTest;
-                    continue;
-                }
+            // if necessary, insert the second part of the split attribute
+            if (nTestEnd > nEnd)
+                InsertItem(rTestItem, nEnd, nTestEnd);
 
-                // the start of the new attribute corresponds to the new
-                // end of the attribute
-                FixSplittedItem(pTest, nStart);
+            if (nTestStart >= nStart)
+            {
+                // the Test item only starts after the new end of the
-e 
... etc. - the rest is truncated

Reply via email to