android/source/res/values-cy/strings.xml                           |   14 ++
 android/source/src/main/play/listings/en-US/graphics/icon.png      |    1 
 android/source/src/main/play/listings/en-US/graphics/icon/icon.png |    1 
 comphelper/source/misc/storagehelper.cxx                           |   13 +-
 configure.ac                                                       |    2 
 cui/source/tabpages/autocdlg.cxx                                   |    4 
 distro-configs/LibreOfficeFlatpak.conf                             |    1 
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx            |    6 -
 editeng/source/misc/svxacorr.cxx                                   |    2 
 extras/source/autocorr/lang/el/DocumentList.xml                    |    4 
 include/vcl/filter/PDFiumLibrary.hxx                               |    1 
 package/inc/ZipFile.hxx                                            |    3 
 package/source/zipapi/MemoryByteGrabber.hxx                        |    8 +
 package/source/zipapi/ZipFile.cxx                                  |   53 
++++++++-
 package/source/zippackage/ZipPackage.cxx                           |    6 -
 readlicense_oo/license/license.xml                                 |   12 +-
 sd/source/ui/app/sdmod1.cxx                                        |   39 
+++---
 sd/source/ui/dlg/LayerTabBar.cxx                                   |   53 
++++++---
 sd/source/ui/dlg/sdtreelb.cxx                                      |    9 +
 sd/source/ui/func/fuinsert.cxx                                     |    6 -
 sd/source/ui/slideshow/slideshow.cxx                               |    8 +
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx             |   26 ++--
 sd/source/ui/table/tablefunction.cxx                               |   15 +-
 sd/source/ui/view/ViewShellBase.cxx                                |    4 
 sd/source/ui/view/ViewShellImplementation.cxx                      |   11 +
 sd/source/ui/view/drviews5.cxx                                     |    4 
 sd/source/ui/view/drviews7.cxx                                     |    6 -
 sd/source/ui/view/grviewsh.cxx                                     |    4 
 sfx2/source/doc/objmisc.cxx                                        |    6 +
 sfx2/source/doc/objserv.cxx                                        |   10 +
 sfx2/source/doc/objstor.cxx                                        |    2 
 solenv/flatpak-manifest.in                                         |    8 -
 svx/source/svdraw/svdedtv1.cxx                                     |    9 +
 svx/source/svdraw/svdmrkv.cxx                                      |   25 ++--
 sw/qa/core/text/itrform2.cxx                                       |   56 
++++++++++
 sw/source/core/text/itrform2.cxx                                   |   19 +++
 sw/source/ui/misc/glossary.cxx                                     |    2 
 sw/source/uibase/ribbar/workctrl.cxx                               |    2 
 sw/source/uibase/uno/unotxdoc.cxx                                  |    6 +
 translations                                                       |    2 
 vcl/osx/DataFlavorMapping.cxx                                      |    4 
 vcl/qa/cppunit/pdfexport/pdfexport2.cxx                            |   10 -
 vcl/quartz/CoreTextFontFace.cxx                                    |   53 
+++++----
 vcl/source/bitmap/BitmapEx.cxx                                     |   15 +-
 vcl/source/filter/ieps/ieps.cxx                                    |   12 +-
 vcl/source/pdf/PDFiumLibrary.cxx                                   |    6 +
 wizards/source/sfdocuments/SF_Document.xba                         |    4 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx                  |   22 +++
 xmloff/source/text/XMLTextFrameContext.cxx                         |   27 +++-
 49 files changed, 450 insertions(+), 166 deletions(-)

New commits:
commit da09d0110663108481ddeac0eb5b0613e8ed1a99
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Jul 9 21:38:05 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Jul 10 10:45:12 2024 +0200

    Revert "tdf#158556 speedup docx load"
    
    This reverts commit ab29c857c669bcca3d8eea8a5a9e6ad5eae622d7.
    
    As jluth points out, my logic here is wrong.
    
    Change-Id: I8887526a0a96070ad615aa07ef0e77e36214d0d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170252
    Reviewed-by: Justin Luth <[email protected]>
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 6f96e7720f765d4e5e8fdef6a2a2b8cbb75c81ef)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170268
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bc1eae82a01e..86c91db63bbd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3791,14 +3791,26 @@ void 
DomainMapper_Impl::ConvertHeaderFooterToTextFrame(bool bDynamicHeightTop, b
 namespace
 {
 // Determines if the XText content is empty (no text, no shapes, no tables)
-bool isContentEmpty(uno::Reference<text::XText> const& xText)
+bool isContentEmpty(uno::Reference<text::XText> const& xText, 
uno::Reference<text::XTextDocument> const& xTextDocument)
 {
     if (!xText.is())
         return true; // no XText means it's empty
 
-    uno::Reference<css::lang::XServiceInfo> xTextServiceInfo(xText, 
uno::UNO_QUERY);
-    if (xTextServiceInfo && xTextServiceInfo->getImplementationName() == 
"SwXHeadFootText")
-        return false;
+    uno::Reference<drawing::XDrawPageSupplier> 
xDrawPageSupplier(xTextDocument, uno::UNO_QUERY);
+    auto xDrawPage = xDrawPageSupplier->getDrawPage();
+    if (xDrawPage && xDrawPage->hasElements())
+    {
+        for (sal_Int32 i = 0; i < xDrawPage->getCount(); ++i)
+        {
+            uno::Reference<text::XTextContent> 
xShape(xDrawPage->getByIndex(i), uno::UNO_QUERY);
+            if (xShape.is())
+            {
+                uno::Reference<text::XTextRange> xAnchor = xShape->getAnchor();
+                if (xAnchor.is() && xAnchor->getText() == xText)
+                    return false;
+            }
+        }
+    }
 
     uno::Reference<container::XEnumerationAccess> 
xEnumAccess(xText->getText(), uno::UNO_QUERY);
     uno::Reference<container::XEnumeration> xEnum = 
xEnumAccess->createEnumeration();
@@ -3945,7 +3957,7 @@ void 
DomainMapper_Impl::checkIfHeaderFooterIsEmpty(PagePartType ePagePartType, P
     if (!xPageStyle.is())
         return;
 
-    bool bEmpty = isContentEmpty(m_aTextAppendStack.top().xTextAppend);
+    bool bEmpty = isContentEmpty(m_aTextAppendStack.top().xTextAppend, 
GetTextDocument());
 
     if (eType == PageType::FIRST && bEmpty)
     {
commit b0230fbd68924916ffad47958e0ca87bb532d7e3
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Jul 9 13:08:23 2024 +0100
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Jul 10 10:16:10 2024 +0200

    use a throwaway TMPDIR for ghostscript-using helpers
    
    Change-Id: Iba5a475399589c9e2c4fd485d613f0dedfe0dc44
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170124
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/vcl/source/filter/ieps/ieps.cxx b/vcl/source/filter/ieps/ieps.cxx
index bb4ea06b2a7a..93ac0ca2ef8b 100644
--- a/vcl/source/filter/ieps/ieps.cxx
+++ b/vcl/source/filter/ieps/ieps.cxx
@@ -152,6 +152,14 @@ static oslProcessError runProcessWithPathSearch(const 
OUString &rProgName,
     rtl_uString* pArgs[], sal_uInt32 nArgs, oslProcess *pProcess,
     oslFileHandle *pIn, oslFileHandle *pOut, oslFileHandle *pErr)
 {
+    // run things that directly or indirectly might call gs in a tmpdir of 
their own
+    utl::TempFileNamed aTMPDirectory(nullptr, true);
+    aTMPDirectory.EnableKillingFile(true);
+    OUString sTmpDirEnv = u"TMPDIR="_ustr + aTMPDirectory.GetFileName();
+
+    rtl_uString* ustrEnvironment[1];
+    ustrEnvironment[0] = sTmpDirEnv.pData;
+
     oslProcessError result = osl_Process_E_None;
     oslSecurity pSecurity = osl_getCurrentSecurity();
 #ifdef _WIN32
@@ -179,11 +187,11 @@ static oslProcessError runProcessWithPathSearch(const 
OUString &rProgName,
     else
         result = osl_executeProcess_WithRedirectedIO(url.pData,
             pArgs, nArgs, osl_Process_HIDDEN,
-            pSecurity, nullptr, nullptr, 0, pProcess, pIn, pOut, pErr);
+            pSecurity, nullptr, ustrEnvironment, 1, pProcess, pIn, pOut, pErr);
 #else
     result = osl_executeProcess_WithRedirectedIO(rProgName.pData,
         pArgs, nArgs, osl_Process_SEARCHPATH | osl_Process_HIDDEN,
-        pSecurity, nullptr, nullptr, 0, pProcess, pIn, pOut, pErr);
+        pSecurity, nullptr, ustrEnvironment, 1, pProcess, pIn, pOut, pErr);
 #endif
     osl_freeSecurityHandle( pSecurity );
     return result;
commit 161a6e1b2f946ee8f756874d240da738668ccbba
Author:     Jean-Pierre Ledure <[email protected]>
AuthorDate: Mon Jul 8 16:04:04 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Jul 9 22:27:39 2024 +0200

    ScriptForge (Document) tdf#161946 Fix CreateMenu() / Before
    
    A too strict validity check of the Before argument
    prevents the use of numeric values.
    String values work fine.
    
    Fix the arguments of the call to SF_Utils.Validate()
    in SFDocuments.Document.xba
    
    Change-Id: Id1d21cef1c3f056078b0208a8e15c503e1ecb201
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170165
    Reviewed-by: Jean-Pierre Ledure <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit b2b29283c21640d02b12c031963dbd50a646552c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170225
    (cherry picked from commit 42e3bb7cde89db579d5a42a18b7a7a93c6aad059)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170226

diff --git a/wizards/source/sfdocuments/SF_Document.xba 
b/wizards/source/sfdocuments/SF_Document.xba
index 6382b7c62827..43e143f30a59 100644
--- a/wizards/source/sfdocuments/SF_Document.xba
+++ b/wizards/source/sfdocuments/SF_Document.xba
@@ -572,7 +572,7 @@ Check:
        If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
                If Not _IsStillAlive() Then GoTo Finally
                If Not ScriptForge.SF_Utils._Validate(MenuHeader, 
&quot;MenuHeader&quot;, V_STRING) Then GoTo Finally
-               If Not ScriptForge.SF_Utils._Validate(Before, 
&quot;Before&quot;, V_STRING) Then GoTo Finally
+               If Not ScriptForge.SF_Utils._Validate(Before, 
&quot;Before&quot;, Array(V_STRING, ScriptForge.V_NUMERIC)) Then GoTo Finally
                If Not ScriptForge.SF_Utils._Validate(SubmenuChar, 
&quot;SubmenuChar&quot;, V_STRING) Then GoTo Finally
        End If
 
@@ -2138,4 +2138,4 @@ Private Function _Repr() As String
 End Function   &apos;  SFDocuments.SF_Document._Repr
 
 REM ============================================ END OF SFDOCUMENTS.SF_DOCUMENT
-</script:module>
+</script:module>
\ No newline at end of file
commit 2d8b7797d5e99531ebfbbe99c0095782c3b03558
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Tue Jul 9 08:04:57 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Jul 9 17:03:07 2024 +0200

    Adapt flatpak build to upstream changes
    
    
<https://github.com/flathub/org.libreoffice.LibreOffice/commit/4bed50e14d9d106093b027bc8bb780023fb42b55>
    "gvfs: Update gvfs-1.54.1.tar.xz to 1.54.2 (#295)"
    
    
<https://github.com/flathub/org.libreoffice.LibreOffice/commit/88a0d0718a9ddcd75a0842b5173e6d6ecd4d3bde>
    "--enable-ext-nlpsolver (#297)"
    
    Change-Id: Ie39c22c2611a31a8e2a82ae200b7a3836393dff3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170177
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 6b80e0554e4b11f9c1eb955c2d26445bc6855371)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170122
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/distro-configs/LibreOfficeFlatpak.conf 
b/distro-configs/LibreOfficeFlatpak.conf
index ab72dd7ceca1..04df403a9327 100644
--- a/distro-configs/LibreOfficeFlatpak.conf
+++ b/distro-configs/LibreOfficeFlatpak.conf
@@ -1,4 +1,5 @@
 --disable-odk
+--enable-ext-nlpsolver
 --enable-release-build
 --with-ant-home=/run/build/libreoffice/ant
 --with-extra-buildid=Flatpak
diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index 8099a9271b06..ad004c1868bb 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -51,8 +51,8 @@
             "sources": [
                 {
                     "type": "archive",
-                    "url": 
"https://download.gnome.org/sources/gvfs/1.54/gvfs-1.54.1.tar.xz";,
-                    "sha256": 
"ac4a3bccb7fe1502158ef0fde5c979ab44712557d028a8e4f30a29f0fbd9d19f",
+                    "url": 
"https://download.gnome.org/sources/gvfs/1.54/gvfs-1.54.2.tar.xz";,
+                    "sha256": 
"54908f4e10b5f1c231e90330c8c15b7f21f2bb610f194c034b338e379c508e3c",
                     "x-checker-data": {
                         "type": "gnome",
                         "name": "gvfs",
commit bcb6130ef8ab66a99347945c1c30ec0112d6940e
Author:     Michael Stahl <[email protected]>
AuthorDate: Fri Jul 5 13:55:31 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Jul 9 17:01:52 2024 +0200

    package: avoid throwing RuntimeException in getZipFileContents()
    
    Translate it to ZipIOException.
    
    Change-Id: I7a07a59c0ba301b92f31696355c73ccbdf119ff8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170013
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit c409c83d777fdb6291c7cd03186b69fe4e7fd902)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170030
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/package/source/zippackage/ZipPackage.cxx 
b/package/source/zippackage/ZipPackage.cxx
index 0f3fa6ff7dba..a1aff4c54042 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -626,7 +626,11 @@ void ZipPackage::getZipFileContents()
                 if ( !pCurrent->hasByName( sTemp ) )
                 {
                     rtl::Reference<ZipPackageFolder> pPkgFolder = new 
ZipPackageFolder(m_xContext, m_nFormat, m_bAllowRemoveOnInsert);
-                    pPkgFolder->setName( sTemp );
+                    try {
+                        pPkgFolder->setName( sTemp );
+                    } catch (uno::RuntimeException const& e) {
+                        throw css::packages::zip::ZipIOException(e.Message);
+                    }
                     pPkgFolder->doSetParent( pCurrent );
                     pCurrent = pPkgFolder.get();
                 }
commit fca236e6fd7f1b42d8ed23907913036d8140d651
Author:     Michael Stahl <[email protected]>
AuthorDate: Thu Jul 4 17:52:49 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Jul 9 17:01:15 2024 +0200

    package: ZipFile: treat junk at the start of zip as invalid
    
    Probably the only legitimate use of such is self-extracting archives,
    irrelevant for LO.
    
    ofz56826-1.zip is an example; given what Info-Zip unzip prints about
    this file we don't want to successfully open it.
    
    Change-Id: I9568710227e4a152f9dc7bc356184394d7da8eba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170002
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 2afdc61dd3138b383fb73dae2242ba1a9c8de901)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170009
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/package/qa/cppunit/data/pass/ofz56826-1.zip 
b/package/qa/cppunit/data/fail/ofz56826-1.zip
similarity index 100%
rename from package/qa/cppunit/data/pass/ofz56826-1.zip
rename to package/qa/cppunit/data/fail/ofz56826-1.zip
diff --git a/package/source/zipapi/ZipFile.cxx 
b/package/source/zipapi/ZipFile.cxx
index e9a515bc85c7..c7e10cb06e39 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -1077,6 +1077,7 @@ sal_Int32 ZipFile::readCEN()
 
         ZipEntry aEntry;
         sal_Int16 nCommentLen;
+        sal_Int64 nMinOffset{nEndPos};
 
         aEntries.reserve(nTotal);
         for (nCount = 0 ; nCount < nTotal; nCount++)
@@ -1141,6 +1142,7 @@ sal_Int32 ZipFile::readCEN()
 
             if (o3tl::checked_add<sal_Int64>(aEntry.nOffset, nLocPos, 
aEntry.nOffset))
                 throw ZipException("Integer-overflow");
+            nMinOffset = std::min(nMinOffset, aEntry.nOffset);
             if (o3tl::checked_multiply<sal_Int64>(aEntry.nOffset, -1, 
aEntry.nOffset))
                 throw ZipException("Integer-overflow");
 
@@ -1167,6 +1169,10 @@ sal_Int32 ZipFile::readCEN()
 
         if (nCount != nTotal)
             throw ZipException("Count != Total" );
+        if (nMinOffset != 0)
+        {
+            throw ZipException(u"Extra bytes at beginning of zip file"_ustr);
+        }
     }
     catch ( IllegalArgumentException & )
     {
commit fda9ae6f1cef7512f0560828f67553b91641bd26
Author:     Michael Stahl <[email protected]>
AuthorDate: Thu Jul 4 14:07:25 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Jul 9 17:00:16 2024 +0200

    comphelper: treat zip file path segments '.' and '..' as invalid
    
    This will prevent also opening with RepairPackage, would need to adapt
    ZipPackage::getZipFileContents() a bit, but let's hope nobody acutally
    has such files.
    
    Also treat path that starts with "/" as invalid, presumably it's not
    allowed by APPNOTE.TXT:
    "The name of the file, with optional relative path."
    
    Change-Id: Ic694ea2fb34f5de1d490a9a251cf56e4004e9673
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169994
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 6005260078c126bf3f1cf4d6f1ebb631453f5ac7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169964
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/comphelper/source/misc/storagehelper.cxx 
b/comphelper/source/misc/storagehelper.cxx
index 1d504cb91725..734ffbec0be9 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -548,10 +548,17 @@ uno::Sequence< beans::NamedValue > 
OStorageHelper::CreateGpgPackageEncryptionDat
 
 bool OStorageHelper::IsValidZipEntryFileName( std::u16string_view aName, bool 
bSlashAllowed )
 {
+    long nDots{0};
     for ( size_t i = 0; i < aName.size(); i++ )
     {
         switch ( aName[i] )
         {
+            case '.':
+                if (nDots != -1)
+                {
+                    ++nDots;
+                }
+                break;
             case '\':
             case '?':
             case '<':
@@ -561,15 +568,17 @@ bool OStorageHelper::IsValidZipEntryFileName( 
std::u16string_view aName, bool bS
             case ':':
                 return false;
             case '/':
-                if ( !bSlashAllowed )
+                if (!bSlashAllowed || nDots == 1 || nDots == 2 || i == 0)
                     return false;
+                nDots = 0;
                 break;
             default:
+                nDots = -1;
                 if ( aName[i] < 32  || (aName[i] >= 0xD800 && aName[i] <= 
0xDFFF) )
                     return false;
         }
     }
-    return true;
+    return nDots != 1 && nDots != 2;
 }
 
 
commit f3f09269988450011b3d1e5bfe0663746effc436
Author:     Weblate <[email protected]>
AuthorDate: Thu Jun 6 18:36:50 2024 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Jul 8 07:41:33 2024 +0200

    android-viewer translated using Weblate
    
    Welsh currently translated at 100.0% (132 of 132 strings)
    
    Change-Id: I7f7ebcc69ae0da58be041ff8cd5d2c751b697871
    Co-authored-by: Rhoslyn Prys <[email protected]>
    Co-authored-by: Weblate <[email protected]>
    Translate-URL: 
https://translations.documentfoundation.org/projects/android-viewer/android-strings-24-2/cy/
    Translation: android-viewer/android-strings-24-2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169884
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/android/source/res/values-cy/strings.xml 
b/android/source/res/values-cy/strings.xml
index 284265619e18..834bc35103f6 100644
--- a/android/source/res/values-cy/strings.xml
+++ b/android/source/res/values-cy/strings.xml
@@ -118,4 +118,18 @@
     <string name="UNO_commands_string_type_hint">Math</string>
     <string name="alert_cancel">Diddymu</string>
     <string name="unable_to_save">Methu cadw i ffeil</string>
+    <string name="app_about_name"><b>Darllenydd LibreOffice 
\'Beta\'</b></string>
+    <string name="browser_app_name">Porwr LibreOffice</string>
+    <string name="menu_search">Chwilio</string>
+    <string name="search_not_found">Heb ganfod yr allweddair</string>
+    <string name="menu_preferences">Dewisiadau</string>
+    <string name="action_bold">Trwm</string>
+    <string name="action_underline">Tanlinellu</string>
+    <string name="action_italic">Italig</string>
+    <string name="action_strikeout">Taro Allan</string>
+    <string name="message_save_incomplete">Cadw yn anghyflawn. A fu 
newidiadau?</string>
+    <string name="alert_copy_svg_slide_show_to_clipboard">Nid yw eich dyfais 
Android yn cefnogi sioe sleidiau svg o fewn ap. Rydym wedi copïo dolen y sioe 
sleidiau i\'r clipfwrdd. Pwyswch y botwm cartref, agor porwr gwe fodern, gludo 
i\'r bar cyfeiriad a mynd.</string>
+    <string name="alert_copy_svg_slide_show_to_clipboard_dismiss">Iawn</string>
+    <string name="unable_to_go_further">Methu mynd ymhellach.</string>
+    <string name="directory_not_saved">Heb gadw\'r cyfeiriadur.</string>
 </resources>
\ No newline at end of file
commit 065a38184ec47334b6e6b222de1a43b685943f9e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Jul 5 13:05:25 2024 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Sun Jul 7 21:19:08 2024 +0200

    return early if there is no m_pDocShell
    
    Change-Id: Id53115f9cb098b9b8ff1a529f5237054cdfd391e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170014
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170049
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 9e8c9944b9e00e883597495a27f2f03d69016ce2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170038
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index f5e0904fa8d3..06b07d28ad11 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3204,6 +3204,12 @@ void SwXTextDocument::setClipboard(const 
uno::Reference<datatransfer::clipboard:
 {
     SolarMutexGuard aGuard;
 
+    if (!m_bObjectValid)
+    {
+        SAL_WARN("sw.uno", "no DocShell when attempting to setClipboard");
+        return;
+    }
+
     SwView* pView = m_pDocShell->GetView();
     if (pView)
         pView->GetEditWin().SetClipboard(xClipboard);
commit 9e30751ef80686e74e612aec4f881fe6c08eefd7
Author:     Peter Hagen <[email protected]>
AuthorDate: Fri Jul 5 13:51:10 2024 -0400
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Sat Jul 6 14:14:41 2024 +0200

    Related tdf#161461: break out of loop once data flavor is set
    
    Change-Id: I37126d2d77a7a80168bd5ab08fa26e8eabfa22cd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170055
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <[email protected]>
    (cherry picked from commit e4cbe169bd1236698a573bf4758d8ae8519a1c08)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170032
    Tested-by: Ilmari Lauhakangas <[email protected]>
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index c08c32ba9b60..8c44a0d4d09e 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -577,6 +577,10 @@ const NSString* 
DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& oO
                 sysFlavor = flavorMap[i].SystemFlavor;
             else
                 sysFlavor = OUStringToNSString(oOOFlavor.MimeType);
+
+            // Flavor set, then break
+            if (sysFlavor != nullptr)
+                break;
         }
     }
 
commit 127194ebbcbf644148fee81773babaf23eab78d8
Author:     Michael Stahl <[email protected]>
AuthorDate: Thu Jul 4 12:10:29 2024 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Jul 4 18:19:59 2024 +0200

    sfx2: fix signature infobar being shown for every repaired document
    
    (regression from commit 8b333575ee680664fa3d83249ccec90881754ad7)
    
    So it should only be set if the state is still UNKNOWN.  But
    SfxObjectShell::ImplGetSignatureState() is called before the repair
    dialog is shown, so make sure that the second import (with
    RepairPackage) finds both members as SignatureState::UNKOWN.
    
    Change-Id: Ic914016dde6425a4d95fba7f6f66411305553930
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169989
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 8d869b5fe47842df52965804db87db0941f4f2a0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169997
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 9ef1469687b3..a6610661f676 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -953,6 +953,12 @@ void SfxObjectShell::BreakMacroSign_Impl( bool 
bBreakMacroSign )
 
 void SfxObjectShell::CheckSecurityOnLoading_Impl()
 {
+    if (GetErrorCode() == ERRCODE_IO_BROKENPACKAGE)
+    {   // safety first: don't run any macros from broken package.
+        pImpl->aMacroMode.disallowMacroExecution();
+        return; // do not get signature status - needs to be done after 
RepairPackage
+    }
+
     // make sure LO evaluates the macro signatures, so it can be preserved
     GetScriptingSignatureState();
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 4cfdf56e9037..5fb379e8f374 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1902,19 +1902,22 @@ SignatureState SfxObjectShell::ImplGetSignatureState( 
bool bScriptingContent )
 {
     SignatureState* pState = bScriptingContent ? 
&pImpl->nScriptingSignatureState : &pImpl->nDocumentSignatureState;
 
-    // repaired package cannot be trusted
-    SfxBoolItem const*const 
pRepairItem{GetMedium()->GetItemSet().GetItem(SID_REPAIRPACKAGE, false)};
-    if (pRepairItem && pRepairItem->GetValue())
-    {
-        *pState = SignatureState::BROKEN;
-    }
-
     if ( *pState == SignatureState::UNKNOWN )
     {
         *pState = SignatureState::NOSIGNATURES;
 
         uno::Sequence< security::DocumentSignatureInformation > aInfos = 
GetDocumentSignatureInformation( bScriptingContent );
         *pState = DocumentSignatures::getSignatureState(aInfos);
+
+        // repaired package cannot be trusted
+        if (*pState != SignatureState::NOSIGNATURES)
+        {
+            SfxBoolItem const*const 
pRepairItem{GetMedium()->GetItemSet().GetItem(SID_REPAIRPACKAGE, false)};
+            if (pRepairItem && pRepairItem->GetValue())
+            {
+                *pState = SignatureState::BROKEN;
+            }
+        }
     }
 
     if ( *pState == SignatureState::OK || *pState == 
SignatureState::NOTVALIDATED
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index a6aaee75ea87..4cf78b262903 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -401,6 +401,8 @@ void SfxObjectShell::PrepareSecondTryLoad_Impl()
     // only for internal use
     pImpl->m_xDocStorage.clear();
     pImpl->mxObjectContainer.reset();
+    pImpl->nDocumentSignatureState = SignatureState::UNKNOWN;
+    pImpl->nScriptingSignatureState = SignatureState::UNKNOWN;
     pImpl->m_bIsInit = false;
     ResetError();
 }
commit 59ec65756a766720ac4fba0ac880f272ec7d19df
Author:     Patrick Luby <[email protected]>
AuthorDate: Fri Jun 28 18:31:14 2024 -0400
Commit:     Patrick Luby <[email protected]>
CommitDate: Thu Jul 4 15:18:35 2024 +0200

    tdf#161833 treat semi-transparent pixels as opaque
    
    Limiting the contour wrapping polygon to only opaque pixels
    causes clipping of any shadows or other semi-transaprent
    areas in the image. So, instead of testing for fully opaque
    pixels, treat pixels that are not fully transparent as opaque.
    
    Also, tdf#161833 would cause semi-transparent pixels to be
    treated as fully transparent pixels when calculating the wrap
    contour for an image. To force the correct contour when loading
    a document, force the contour to be recalculated by ignoring
    the saved polygon if the contour is set to "recreate on edit".
    
    Change-Id: Ibe256f54e1c82de30c2b7d5b92a69344b4a7ba10
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169745
    Reviewed-by: Patrick Luby <[email protected]>
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 3da1d8a791cff6cf2dad29b64c9ad15b1a65d5b3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169956

diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 571f8d700836..2778a434b390 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -1304,11 +1304,12 @@ tools::Polygon  BitmapEx::GetContour( bool 
bContourEdgeDetect,
             std::unique_ptr<Point[]> pPoints2;
             tools::Long                nX, nY;
             sal_uInt16              nPolyPos = 0;
-            // tdf#161498 use COL_ALPHA_OPAQUE for finding opaque pixels
-            // Starting with commit 81994cb2b8b32453a92bcb011830fcb884f22ff3,
-            // pixels now contain an alpha value instead of a transparency
-            // value.
-            const BitmapColor   aTransparencyOpaque = 
pAcc->GetBestMatchingColor( COL_ALPHA_OPAQUE );
+            // tdf#161833 treat semi-transparent pixels as opaque
+            // Limiting the contour wrapping polygon to only opaque pixels
+            // causes clipping of any shadows or other semi-transaprent
+            // areas in the image. So, instead of testing for fully opaque
+            // pixels, treat pixels that are not fully transparent as opaque.
+            const BitmapColor   aTransparent = pAcc->GetBestMatchingColor( 
COL_ALPHA_TRANSPARENT );
 
             pPoints1.reset(new Point[ nHeight ]);
             pPoints2.reset(new Point[ nHeight ]);
@@ -1321,7 +1322,7 @@ tools::Polygon  BitmapEx::GetContour( bool 
bContourEdgeDetect,
                 // scan row from left to right
                 while( nX < nEndX1 )
                 {
-                    if( aTransparencyOpaque == pAcc->GetPixelFromData( 
pScanline, nX ) )
+                    if( aTransparent != pAcc->GetPixelFromData( pScanline, nX 
) )
                     {
                         pPoints1[ nPolyPos ] = Point( nX, nY );
                         nX = nStartX2;
@@ -1329,7 +1330,7 @@ tools::Polygon  BitmapEx::GetContour( bool 
bContourEdgeDetect,
                         // this loop always breaks eventually as there is at 
least one pixel
                         while( true )
                         {
-                            if( aTransparencyOpaque == pAcc->GetPixelFromData( 
pScanline, nX ) )
+                            if( aTransparent != pAcc->GetPixelFromData( 
pScanline, nX ) )
                             {
                                 pPoints2[ nPolyPos ] = Point( nX, nY );
                                 break;
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx 
b/xmloff/source/text/XMLTextFrameContext.cxx
index b00b2b84d90e..575c7f95c23a 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -271,17 +271,26 @@ 
XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
     const SdXMLImExViewBox aViewBox( sViewBox, 
GetImport().GetMM100UnitConverter());
     basegfx::B2DPolyPolygon aPolyPolygon;
 
-    if( bPath )
+    // Related tdf#161833: ignore saved polygon for "recreate on edit" contours
+    // tdf#161833 would cause semi-transparent pixels to be treated as fully
+    // transparent pixels when calculating the wrap contour for an image. To
+    // force the correct contour when loading a document, force the contour
+    // to be recalculated by ignoring the saved polygon if the contour is set
+    // to "recreate on edit".
+    if( !bAuto )
     {
-        basegfx::utils::importFromSvgD(aPolyPolygon, sD, 
GetImport().needFixPositionAfterZ(), nullptr);
-    }
-    else
-    {
-        basegfx::B2DPolygon aPolygon;
-
-        if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints))
+        if( bPath )
         {
-            aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon);
+            basegfx::utils::importFromSvgD(aPolyPolygon, sD, 
GetImport().needFixPositionAfterZ(), nullptr);
+        }
+        else
+        {
+            basegfx::B2DPolygon aPolygon;
+
+            if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints))
+            {
+                aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon);
+            }
         }
     }
 
commit 05b9e388448b1c8c10b18c22898c4725dd176fed
Author:     Michael Stahl <[email protected]>
AuthorDate: Tue Jul 2 13:24:38 2024 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Jul 4 12:30:30 2024 +0200

    sfx2: SfxObjectShell should not trust any signature on repaired package
    
    Change-Id: I0317f80989e9dabd23e88e3caab26ede3fb5bd56
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169883
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 8b333575ee680664fa3d83249ccec90881754ad7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169930
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index de2e01ff8d76..4cfdf56e9037 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1902,6 +1902,13 @@ SignatureState SfxObjectShell::ImplGetSignatureState( 
bool bScriptingContent )
 {
     SignatureState* pState = bScriptingContent ? 
&pImpl->nScriptingSignatureState : &pImpl->nDocumentSignatureState;
 
+    // repaired package cannot be trusted
+    SfxBoolItem const*const 
pRepairItem{GetMedium()->GetItemSet().GetItem(SID_REPAIRPACKAGE, false)};
+    if (pRepairItem && pRepairItem->GetValue())
+    {
+        *pState = SignatureState::BROKEN;
+    }
+
     if ( *pState == SignatureState::UNKNOWN )
     {
         *pState = SignatureState::NOSIGNATURES;
commit 1150584be851b311067ee6482f51da1ad3b12636
Author:     Michael Stahl <[email protected]>
AuthorDate: Tue Jul 2 11:50:09 2024 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Jul 4 12:30:21 2024 +0200

    package: ZipFile: check Info-ZIP Unicode Path Extra Field
    
    Change-Id: I829eb449e8a0947341f066399be549f56b0f02da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169882
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 67dca5a47d1be1b38edee7d0d81fa9adfce5a22e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169929
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index 2d42ed403136..8bc726af8457 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -86,7 +86,8 @@ class ZipFile
     void recover();
     static void readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 
nExtraLen,
                                 sal_uInt64& nSize, sal_uInt64& nCompressedSize,
-                                sal_uInt64* nOffset);
+                                sal_uInt64* nOffset,
+                                OUString const* pCENFilenameToCheck);
 
 public:
 
diff --git a/package/source/zipapi/MemoryByteGrabber.hxx 
b/package/source/zipapi/MemoryByteGrabber.hxx
index d474be40cda5..dd876d66ebfa 100644
--- a/package/source/zipapi/MemoryByteGrabber.hxx
+++ b/package/source/zipapi/MemoryByteGrabber.hxx
@@ -49,6 +49,14 @@ public:
         mnCurrent += nBytesToSkip;
     }
 
+    sal_Int8 ReadUInt8()
+    {
+        if (mnCurrent + 1 > mnEnd)
+            return 0;
+        sal_uInt8 nInt8 = mpBuffer[mnCurrent++];
+        return nInt8;
+    }
+
     // XSeekable chained...
     sal_Int16 ReadInt16()
     {
diff --git a/package/source/zipapi/ZipFile.cxx 
b/package/source/zipapi/ZipFile.cxx
index b19ebaf2c5e2..e9a515bc85c7 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -36,6 +36,7 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/threadpool.hxx>
 #include <rtl/digest.h>
+#include <rtl/crc.h>
 #include <sal/log.hxx>
 #include <o3tl/safeint.hxx>
 #include <o3tl/string_view.hxx>
@@ -1132,7 +1133,7 @@ sal_Int32 ZipFile::readCEN()
 
             if (aEntry.nExtraLen>0)
             {
-                readExtraFields(aMemGrabber, aEntry.nExtraLen, nSize, 
nCompressedSize, &nOffset);
+                readExtraFields(aMemGrabber, aEntry.nExtraLen, nSize, 
nCompressedSize, &nOffset, &aEntry.sPath);
             }
             aEntry.nCompressedSize = nCompressedSize;
             aEntry.nSize = nSize;
@@ -1176,7 +1177,8 @@ sal_Int32 ZipFile::readCEN()
 }
 
 void ZipFile::readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 
nExtraLen,
-                              sal_uInt64& nSize, sal_uInt64& nCompressedSize, 
sal_uInt64* nOffset)
+        sal_uInt64& nSize, sal_uInt64& nCompressedSize,
+        sal_uInt64* nOffset, OUString const*const pCENFilenameToCheck)
 {
     while (nExtraLen > 0) // Extensible data fields
     {
@@ -1201,6 +1203,35 @@ void ZipFile::readExtraFields(MemoryByteGrabber& 
aMemGrabber, sal_Int16 nExtraLe
             if (dataSize > nReadSize)
                 aMemGrabber.skipBytes(dataSize - nReadSize);
         }
+        // Info-ZIP Unicode Path Extra Field - pointless as we expect UTF-8 in 
CEN already
+        else if (nheaderID == 0x7075 && pCENFilenameToCheck) // ignore in 
recovery mode
+        {
+            if (aMemGrabber.remainingSize() < dataSize)
+            {
+                SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra 
Field: invalid TSize");
+                throw ZipException(u"Invalid Info-ZIP Unicode Path Extra 
Field"_ustr);
+            }
+            auto const nVersion = aMemGrabber.ReadUInt8();
+            if (nVersion != 1)
+            {
+                SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra 
Field: unexpected Version");
+                throw ZipException(u"Invalid Info-ZIP Unicode Path Extra 
Field"_ustr);
+            }
+            // this CRC32 is actually of the pCENFilenameToCheck
+            // so it's pointless to check it if we require the UnicodeName
+            // to be equal to the CEN name anyway (and pCENFilenameToCheck
+            // is already converted to UTF-16 here)
+            (void) aMemGrabber.ReadUInt32();
+            // this is required to be UTF-8
+            OUString const unicodePath(reinterpret_cast<char const 
*>(aMemGrabber.getCurrentPos()),
+                    dataSize - 5, RTL_TEXTENCODING_UTF8);
+            aMemGrabber.skipBytes(dataSize - 5);
+            if (unicodePath != *pCENFilenameToCheck)
+            {
+                SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra 
Field: unexpected UnicodeName");
+                throw ZipException(u"Invalid Info-ZIP Unicode Path Extra 
Field"_ustr);
+            }
+        }
         else
         {
             aMemGrabber.skipBytes(dataSize);
@@ -1303,7 +1334,7 @@ void ZipFile::recover()
                                     if (aEntry.nExtraLen > 0)
                                     {
                                         readExtraFields(aMemGrabberExtra, 
aEntry.nExtraLen, nSize,
-                                                        nCompressedSize, 
nullptr);
+                                                        nCompressedSize, 
nullptr, nullptr);
                                     }
                                 }
 
commit a4f85170623b40d33b914d95be109f6e8fe3c8fa
Author:     Michael Stahl <[email protected]>
AuthorDate: Tue Jul 2 11:47:17 2024 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Jul 4 12:30:13 2024 +0200

    package: ZipFile: don't accept duplicate CEN entries
    
    Change-Id: Ice341a11346b445c555cba276bf2284e4f9b6685
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169881
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 67cb6af482bc5b0f4d310f0a42a85057f3db0267)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169945
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/package/source/zipapi/ZipFile.cxx 
b/package/source/zipapi/ZipFile.cxx
index 72788b625d00..b19ebaf2c5e2 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -1153,7 +1153,15 @@ sal_Int32 ZipFile::readCEN()
                     continue; // This is a directory entry, not a stream - 
skip it
             }
 
-            aEntries[aEntry.sPath] = aEntry;
+            if (auto it = aEntries.find(aEntry.sPath); it == aEntries.end())
+            {
+                aEntries[aEntry.sPath] = aEntry;
+            }
+            else
+            {
+                SAL_INFO("package", "Duplicate CEN entry: \"" << aEntry.sPath 
<< "\"");
+                throw ZipException(u"Duplicate CEN entry"_ustr);
+            }
         }
 
         if (nCount != nTotal)
commit c940f11f203d03165009b2147b8cb7f84fb3e0ed
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jul 1 11:43:51 2024 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Jul 1 20:49:04 2024 +0200

    crashtesting: divide by zero
    
    since:
    
    commit 7b807a6b793198c00db9b2c2c3a5eb3ebfe16ad9
    Date:   Fri Jun 21 12:28:30 2024 +0200
    
        tdf#161086 bitmap location wrong with SVG with an embedded PNG
    
    bodge it by using the requested width/height and not the possibly
    zero on fail actual sizes
    
    Change-Id: Ic55ba6ce3cc14fa598299cdd1f844ee7c63fb174
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169800
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit af2175bb87b8e8a7184916e110e2b22ec542357d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169815
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 362b3a55cabe..45f23af1dd1e 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1084,8 +1084,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
         mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
         Wallpaper aWallpaper(aTileImage);
         aWallpaper.SetColor(COL_TRANSPARENT);
-        Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(),
-                       aMaskRect.getY() % aTileImage.GetSizePixel().Height());
+        Point aPaperPt(aMaskRect.getX() % nTileWidth, aMaskRect.getY() % 
nTileHeight);
         tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel());
         aWallpaper.SetRect(aPaperRect);
         mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper);
@@ -1114,8 +1113,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
     {
         Wallpaper aWallpaper(aTileImage);
         aWallpaper.SetColor(COL_TRANSPARENT);
-        Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(),
-                       aMaskRect.getY() % aTileImage.GetSizePixel().Height());
+        Point aPaperPt(aMaskRect.getX() % nTileWidth, aMaskRect.getY() % 
nTileHeight);
         tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel());
         aWallpaper.SetRect(aPaperRect);
         mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper);
commit 739a66b989e13ff7b931a24107dd319cf2c70a61
Author:     Christian Lohmaier <[email protected]>
AuthorDate: Sun Jun 30 19:41:06 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sun Jun 30 19:41:06 2024 +0200

    bump product version to 24.2.6.0.0+
    
    Change-Id: Ie97a0db6cf91c839fa917e9c81ff679356e1bf42

diff --git a/configure.ac b/configure.ac
index 6c945148b2ff..2fdee1d7d416 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([LibreOffice],[24.2.5.0.0+],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[24.2.6.0.0+],[],[],[http://documentfoundation.org/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard
commit e422554bb465c8647f9ced57a4f525d8224a3ddc
Author:     Christian Lohmaier <[email protected]>
AuthorDate: Sun Jun 30 19:35:30 2024 +0200
Commit:     Gerrit Code Review <[email protected]>
CommitDate: Sun Jun 30 19:35:30 2024 +0200

    Update git submodules
    
    * Update translations from branch 'libreoffice-24-2'
      to 68d5920d2af6c69106b07c701878f5db15b73c8a
      - update translations for 24.2.5 rc1
    
        and force-fix errors using pocheck
    
        Change-Id: If5f86442a5c64c40f13cb2d302a3c38aa9835541

diff --git a/translations b/translations
index 8f2269089353..68d5920d2af6 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 8f2269089353b59fc42b4876a1736c4a54d936ea
+Subproject commit 68d5920d2af6c69106b07c701878f5db15b73c8a
commit c791834c73b2e37d05b6c99e43a6ed2047033e42
Author:     Aron Budea <[email protected]>
AuthorDate: Fri Jun 28 06:09:33 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sun Jun 30 19:31:00 2024 +0200

    tdf#161310 Translate My AutoText in Insert toolbar
    
    Use same pattern as 42e6e26255b21c1bfde893f5aaf23d4a37ecee91
    and dffdc0b1995e2b24304ce0651ca886bbf9cf4f95
    
    Change-Id: If36ecdcbb771bfcde9836203e84586045d039c8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169693
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit 696eb4b4e55ce26cee9aee2c76a7125df91ae0d6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169739
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/sw/source/uibase/ribbar/workctrl.cxx 
b/sw/source/uibase/ribbar/workctrl.cxx
index 9a9b288e142f..f40b9e964b1d 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -91,6 +91,8 @@ void SwTbxAutoTextCtrl::CreatePopupWindow()
         for(size_t i = 1; i <= nGroupCount; ++i)
         {
             OUString sTitle = pGlossaryList->GetGroupTitle(i - 1);
+            if (sTitle == "My AutoText")
+                sTitle = SwResId(STR_MY_AUTOTEXT);
             const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1);
             auto const [it, _] = titles.insert(sTitle);
             size_t const menuIndex(::std::distance(titles.begin(), it));
commit 65e755ebeb17d16a84465ba92fe0f8f5ea1aebd9
Author:     László Németh <[email protected]>
AuthorDate: Fri Jun 28 00:27:57 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sun Jun 30 17:06:45 2024 +0200

    tdf#141773 AutoCorrect: fix broken [All] dictionaries
    
    This reverts commit ae56dc05b27f05ffcee99845d661a237e70a7a51
    "tdf#96787: AutoCorrect: after deleting a replacement entry, it's still 
used".
    
    (Cherry-picked from 50be3fa1f0f3b8870af5bda88b65f835ef37d77e.)
    
    Change-Id: Ifb4cf1b359b852c7610337d4bd389a8ca5dce610
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169735
    Reviewed-by: Christian Lohmaier <[email protected]>
    Tested-by: Jenkins

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 676959d43dbe..cb1c157f23a0 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2021,8 +2021,6 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
             rLang = aLanguageTag;
             return pRet;
         }
-        else
-            return nullptr;
     }
 
     // If it still could not be found here, then keep on searching
commit 0c65059eb7c281e34921ce1297dd3f8ffcc4c790
Author:     László Németh <[email protected]>
AuthorDate: Fri Jun 28 15:49:22 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sun Jun 30 17:05:35 2024 +0200

    tdf#96787 AutoCorrect: find item with ".*" and between :colons:
    
    It was very hard to disable autocorrection of (c)->© and other
    AutoCorrect items, because the searched Replace string "(c)"
    etc. didn't jump the list cursor to the corresponding ".*(c)"
    item.
    
    Now skip ".*" pattern matching marks, also colon (emoji
    replacement) characters, so the list cursor jumps to the
    line ".*(c)"->© typing only "(c" etc., allowing users to press
    Delete to disable its autocorrection without knowing about
    the special AutoCorrect patterns.
    
    Follow-up to commit 50be3fa1f0f3b8870af5bda88b65f835ef37d77e
    "tdf#141773 AutoCorrect: fix broken [All] dictionaries".
    
    Change-Id: I72be1ecb2fdc5ae67c72727ce7fbd70b28a4125b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169714
    Tested-by: Jenkins
    Reviewed-by: László Németh <[email protected]>
    (cherry picked from commit e5507c8a003328f629ae924fbba14155c13e7a12)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169734
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 282e8b5405a1..7b6567b4deaf 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1146,7 +1146,9 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, 
weld::Entry&, rEdt, void)
                 else
                 {
                     aTestStr = pCharClass->lowercase( aTestStr );
-                    if( aTestStr.startsWith(aWordStr) && !bTmpSelEntry )
+                    if( !bTmpSelEntry && ( aTestStr.startsWith(aWordStr)
+                        // find also with ".*" and between :colons:
+                        || aTestStr.replaceAll(".*","").replaceAll(":", 
"").startsWith(aWordStr) ) )
                     {
                         m_xReplaceTLB->scroll_to_row(rIter);
                         bTmpSelEntry = true;
commit 45f75991ff89967a0edbf9e9808835b83108de1b
Author:     Miklos Vajna <[email protected]>
AuthorDate: Fri Jun 28 08:42:37 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sun Jun 30 16:57:50 2024 +0200

    Related: tdf#161708 sw content controls: fix custom default of dropdown to 
PDF
    
    Export the bugdoc to PDF without noticing that there is a content
    control around some of the content and notice how the PDF export lacks
    some words from the body text.
    
    What happens is that content controls are exported to PDF as PDF forms
    by default, and the selected option of a dropdown has to be an index, so
    in case the text of the dropdown content control is not one of the
    options, then the PDF will miss those words.
    
    Fix the problem by inserting the text of the dropdown at the start if
    there would be no valid index for it.
    
    Also add a bit of padding around the rectangle of the content controls,
    it turns out there is a default 1pt border in PDF, and this would lead
    to a cut-off text at the end if we don't compensate for that border.
    
    Change-Id: I99447894b320b42ad9ffe0d54d0190000621616b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169694
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit b3e01bd3bdd37961057026ab7f2b57cbfab35d4a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169671
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 557eaff349f7..d6e57ec99d9b 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -112,6 +112,7 @@ public:
                                                        PDFAnnotAActionType 
eEvent)
         = 0;
     virtual OUString getFormFieldValue(PDFiumDocument* pDoc) = 0;
+    virtual int getOptionCount(PDFiumDocument* pDoc) = 0;
 };
 
 class PDFiumTextPage;
diff --git a/sw/qa/core/text/itrform2.cxx b/sw/qa/core/text/itrform2.cxx
index 930be1b031f4..c9f9e3a9adcc 100644
--- a/sw/qa/core/text/itrform2.cxx
+++ b/sw/qa/core/text/itrform2.cxx
@@ -11,6 +11,9 @@
 
 #include <memory>
 
+#include <com/sun/star/text/XTextDocument.hpp>
+
+#include <comphelper/propertyvalue.hxx>
 #include <editeng/colritem.hxx>
 
 #include <IDocumentLayoutAccess.hxx>
@@ -258,6 +261,59 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFFontColor)
     // i.e. the custom color was lost, the font color was black, not orange.
     CPPUNIT_ASSERT_EQUAL(nOrange, 
pAnnotation->getFontColor(pPdfDocument.get()));
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownText)
+{
+    std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
+    if (!pPDFium)
+        return;
+
+    // Given a document with a dropdown: custom default text and 3 items:
+    createSwDoc();
+    uno::Reference<lang::XMultiServiceFactory> xMSF(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<text::XText> xText = xTextDocument->getText();
+    uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+    xText->insertString(xCursor, u"test"_ustr, /*bAbsorb=*/false);
+    xCursor->gotoStart(/*bExpand=*/false);
+    xCursor->gotoEnd(/*bExpand=*/true);
+    uno::Reference<text::XTextContent> xContentControl(
+        xMSF->createInstance(u"com.sun.star.text.ContentControl"_ustr), 
uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, 
uno::UNO_QUERY);
+    {
+        uno::Sequence<beans::PropertyValues> aListItems = {
+            {
+                comphelper::makePropertyValue(u"DisplayText"_ustr, 
uno::Any(u"red"_ustr)),
+                comphelper::makePropertyValue(u"Value"_ustr, 
uno::Any(u"R"_ustr)),
+            },
+            {
+                comphelper::makePropertyValue(u"DisplayText"_ustr, 
uno::Any(u"green"_ustr)),
+                comphelper::makePropertyValue(u"Value"_ustr, 
uno::Any(u"G"_ustr)),
+            },
+            {
+                comphelper::makePropertyValue(u"DisplayText"_ustr, 
uno::Any(u"blue"_ustr)),
+                comphelper::makePropertyValue(u"Value"_ustr, 
uno::Any(u"B"_ustr)),
+            },
+        };
+        xContentControlProps->setPropertyValue(u"ListItems"_ustr, 
uno::Any(aListItems));
+    }
+    xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true);
+
+    // When exporting that to PDF:
+    save(u"writer_pdf_Export"_ustr);
+
+    // Then make sure that the custom default is not lost:
+    std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = parsePDFExport();
+    std::unique_ptr<vcl::pdf::PDFiumPage> pPage = pPdfDocument->openPage(0);
+    pPage->onAfterLoadPage(pPdfDocument.get());
+    CPPUNIT_ASSERT_EQUAL(1, pPage->getAnnotationCount());
+    std::unique_ptr<vcl::pdf::PDFiumAnnotation> pAnnotation = 
pPage->getAnnotation(0);
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 4
+    // - Actual  : 3
+    // i.e. only the 3 colors were exported, the default "test" text was not.
+    CPPUNIT_ASSERT_EQUAL(4, pAnnotation->getOptionCount(pPdfDocument.get()));
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index c3c1c770c031..221a23c5534a 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1040,13 +1040,24 @@ bool SwContentControlPortion::DescribePDFControl(const 
SwTextPaintInfo& rInf) co
             auto pListWidget = 
static_cast<vcl::PDFWriter::ListBoxWidget*>(pDescriptor.get());
             pListWidget->DropDown = true;
             sal_Int32 nIndex = 0;
+            bool bTextFound = false;
             for (const auto& rItem : pContentControl->GetListItems())
             {
                 pListWidget->Entries.push_back(rItem.m_aDisplayText);
                 if (rItem.m_aDisplayText == aText)
+                {
                     pListWidget->SelectedEntries.push_back(nIndex);
+                    bTextFound = true;
+                }
                 ++nIndex;
             }
+            if (!aText.isEmpty() && !bTextFound)
+            {
+                // The selected entry has to be an index, if there is no index 
for it, insert one at
+                // the start.
+                pListWidget->Entries.insert(pListWidget->Entries.begin(), 
aText);
+                pListWidget->SelectedEntries.push_back(0);
+            }
             break;
         }
         case SwContentControlType::COMBO_BOX:
@@ -1118,6 +1129,14 @@ bool SwContentControlPortion::DescribePDFControl(const 
SwTextPaintInfo& rInf) co
 
     aLocation = aStartRect;
     aLocation.Union(aEndRect);
+
+    // PDF spec 12.5.2 Annotation Dictionaries says the default border with is 
1pt wide, increase
+    // the rectangle to compensate for that, otherwise the text will be cut 
off at the end.
+    aLocation.AddTop(-20);
+    aLocation.AddBottom(20);
+    aLocation.AddLeft(-20);
+    aLocation.AddRight(20);
+
     pDescriptor->Location = aLocation.SVRect();
 
     pPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Form);
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
index a464798076ed..7da0dbc62f70 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
@@ -4657,11 +4657,11 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152246)
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
 
     // Position array
-    constexpr double aPos[5][4] = { { 56.699, 707.701, 131.401, 721.499 },
-                                    { 198.499, 707.701, 273.201, 721.499 },
-                                    { 303.349, 680.101, 378.051, 693.899 },
-                                    { 480.599, 680.101, 555.301, 693.899 },
-                                    { 56.699, 652.501, 131.401, 666.299 } };
+    constexpr double aPos[5][4] = { { 55.699, 706.701, 132.401, 722.499 },
+                                    { 197.499, 706.701, 274.201, 722.499 },
+                                    { 302.349, 679.101, 379.051, 694.899 },
+                                    { 479.599, 679.101, 556.301, 694.899 },
+                                    { 55.699, 651.501, 132.401, 667.299 } };
 
     // Get page annotations.
     auto pAnnots = 
dynamic_cast<vcl::filter::PDFArrayElement*>(aPages[0]->Lookup("Annots"_ostr));
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index 4a8a40fb6764..f61307b5a44f 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -270,6 +270,7 @@ public:
     OUString getFormAdditionalActionJavaScript(PDFiumDocument* pDoc,
                                                PDFAnnotAActionType eEvent) 
override;
     OUString getFormFieldValue(PDFiumDocument* pDoc) override;
+    int getOptionCount(PDFiumDocument* pDoc) override;
 };
 
 class PDFiumPageObjectImpl final : public PDFiumPageObject
@@ -1288,6 +1289,11 @@ OUString 
PDFiumAnnotationImpl::getFormFieldValue(PDFiumDocument* pDoc)
     }
     return aString;
 }
+int PDFiumAnnotationImpl::getOptionCount(PDFiumDocument* pDoc)
+{
+    auto pDocImpl = static_cast<PDFiumDocumentImpl*>(pDoc);
+    return FPDFAnnot_GetOptionCount(pDocImpl->getFormHandlePointer(), 
mpAnnotation);
+}
 
 OUString 
PDFiumAnnotationImpl::getFormAdditionalActionJavaScript(PDFiumDocument* pDoc,
                                                                  
PDFAnnotAActionType eEvent)
commit b0f047a710dd9bb69a12eeae24a116c74b42ce81
Author:     Patrick Luby <[email protected]>
AuthorDate: Thu Jun 27 20:05:19 2024 -0400
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sat Jun 29 22:35:57 2024 +0200

    tdf#159680 fix memory leak of CTFontRef
    
    The CTFontRef in CoreTextFontFace::GetVariations() was never
    released and a new CTFontRef was allocated in every call to
    CoreTextFontFace::GetVariations(). So release the CTFontRef
    and only allocate it once when mxVariations is populated.
    
    Change-Id: I08999956501d5860fff67e48001ef85a62ca8079
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169690
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <[email protected]>
    (cherry picked from commit 2e87c644245751aea9f50faf16c4ca4d57b0c2f1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169676
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/vcl/quartz/CoreTextFontFace.cxx b/vcl/quartz/CoreTextFontFace.cxx
index 662b439a9eae..47792fff7a58 100644
--- a/vcl/quartz/CoreTextFontFace.cxx
+++ b/vcl/quartz/CoreTextFontFace.cxx
@@ -46,43 +46,46 @@ sal_IntPtr CoreTextFontFace::GetFontId() const
 
 const std::vector<hb_variation_t>& CoreTextFontFace::GetVariations(const 
LogicalFontInstance&) const
 {
-    CTFontRef pFont = CTFontCreateWithFontDescriptor(mxFontDescriptor, 0.0, 
nullptr);
-
     if (!mxVariations)
     {
         mxVariations.emplace();
-        CFArrayRef pAxes = CTFontCopyVariationAxes(pFont);
-        if (pAxes)
+        CTFontRef pFont = CTFontCreateWithFontDescriptor(mxFontDescriptor, 
0.0, nullptr);
+        if (pFont)
         {
-            CFDictionaryRef pVariations = CTFontCopyVariation(pFont);
-            if (pVariations)
+            CFArrayRef pAxes = CTFontCopyVariationAxes(pFont);
+            if (pAxes)
             {
-                CFIndex nAxes = CFArrayGetCount(pAxes);
-                for (CFIndex i = 0; i < nAxes; ++i)
+                CFDictionaryRef pVariations = CTFontCopyVariation(pFont);
+                if (pVariations)
                 {
-                    auto pAxis = 
static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(pAxes, i));
-                    if (pAxis)
+                    CFIndex nAxes = CFArrayGetCount(pAxes);
+                    for (CFIndex i = 0; i < nAxes; ++i)
                     {
-                        hb_tag_t nTag;
-                        auto pTag = static_cast<CFNumberRef>(
-                            CFDictionaryGetValue(pAxis, 
kCTFontVariationAxisIdentifierKey));
-                        if (!pTag)
-                            continue;
-                        CFNumberGetValue(pTag, kCFNumberIntType, &nTag);
+                        auto pAxis = 
static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(pAxes, i));
+                        if (pAxis)
+                        {
+                            hb_tag_t nTag;
+                            auto pTag = static_cast<CFNumberRef>(
+                                CFDictionaryGetValue(pAxis, 
kCTFontVariationAxisIdentifierKey));
+                            if (!pTag)
+                                continue;
+                            CFNumberGetValue(pTag, kCFNumberIntType, &nTag);
 
-                        float fValue;
-                        auto pValue
-                            = 
static_cast<CFNumberRef>(CFDictionaryGetValue(pVariations, pTag));
-                        if (!pValue)
-                            continue;
-                        CFNumberGetValue(pValue, kCFNumberFloatType, &fValue);
+                            float fValue;
+                            auto pValue
+                                = 
static_cast<CFNumberRef>(CFDictionaryGetValue(pVariations, pTag));
+                            if (!pValue)
+                                continue;
+                            CFNumberGetValue(pValue, kCFNumberFloatType, 
&fValue);
 
-                        mxVariations->push_back({ nTag, fValue });
+                            mxVariations->push_back({ nTag, fValue });
+                        }
                     }
+                    CFRelease(pVariations);
                 }
-                CFRelease(pVariations);
+                CFRelease(pAxes);
             }
-            CFRelease(pAxes);
+            CFRelease(pFont);
         }
     }
 
commit 45ef851edabde8c974b4b7435e040a767b51ffb6
Author:     Samuel Mehrbrodt <[email protected]>
AuthorDate: Thu Jun 27 11:10:19 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sat Jun 29 22:33:04 2024 +0200

    Fix autotext shortcut generation
    
    The first character was replaced with a number.
    
    Fallout from 1f93816dd5d75aca98f210017d0b58b7ef1d08da
    
    Change-Id: I3b9a39336d5f6f3c10c85231f86fd196a29e3644
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169621
    Reviewed-by: Thorsten Behrens <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit c519de229627f3c6bb7736c810405b441c07f369)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169684
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 8b2860c20c29..e47f46798530 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -86,7 +86,7 @@ static OUString lcl_GetValidShortCut( const OUString& rName )
     while( rName[nStart-1]==' ' && nStart < nSz )
         nStart++;
 
-    OUStringBuffer aBuf(OUString::number(rName[nStart-1]));
+    OUStringBuffer aBuf(rName.subView(nStart-1, 1));
 
     for( ; nStart < nSz; ++nStart )
     {
commit fa88063f4166a04b146f8d5abc8b0831db724217
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Fri Jun 28 09:34:08 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Sat Jun 29 22:31:40 2024 +0200

    Adapt flatpak build to upstream changes
    
    
<https://github.com/flathub/org.libreoffice.LibreOffice/commit/09d348eefc7d1367073ee4a95513b48f799700f0>
    "krb5: Update krb5-1.21.2.tar.gz to 1.21.3 (#294)"
    
    Change-Id: If99afd812eca43258398d79c1a7c009988d374e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169695
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 80715756c6bd44f24dd6270ccb646f690861901a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169727
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index 0e337d6bbd30..8099a9271b06 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -77,8 +77,8 @@
             "sources": [
                 {
                     "type": "archive",
-                    "url": 
"https://kerberos.org/dist/krb5/1.21/krb5-1.21.2.tar.gz";,
-                    "sha256": 
"9560941a9d843c0243a71b17a7ac6fe31c7cebb5bce3983db79e52ae7e850491",
+                    "url": 
"https://kerberos.org/dist/krb5/1.21/krb5-1.21.3.tar.gz";,
+                    "sha256": 
"b7a4cd5ead67fb08b980b21abd150ff7217e85ea320c9ed0c6dadd304840ad35",
                     "x-checker-data": {
                         "type": "html",
                         "url": "https://kerberos.org/dist/";,
commit 5ba4736a8e1dcf5c8bea267161630818c117c4ce
Author:     Taichi Haradaguchi <[email protected]>
AuthorDate: Thu Jun 27 03:15:09 2024 +0200
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Sat Jun 29 08:16:41 2024 +0200

    licence: Fix div tag and move License Statements
    
    Change-Id: I9547679d0749e1bf539867cb1038c78ef8dcae12
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169586
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Michael Stahl <[email protected]>
    (cherry picked from commit 9fdb50763720a2970ebab39debf26010a8e6bc62)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169681
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/readlicense_oo/license/license.xml 
b/readlicense_oo/license/license.xml
index 61e2df247c2f..d74285e18a57 100644
--- a/readlicense_oo/license/license.xml
+++ b/readlicense_oo/license/license.xml
@@ -2232,12 +2232,6 @@
         CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
         IN THE SOFTWARE.</p>
     </div>
-    <div class="ZXING-CPP">
-        <h2>ZXing-C++</h2>
-        <p>The following software may be included in this product: ZXing-C++. 
Use of any of this software is governed
-        by the terms of the license below:</p>
-        <p><a href="#a__Apache_License_version_2_0">Jump to Apache License 
Version 2.0</a></p>
-    </div>
     <div class="ZLIB">
         <h2>zlib</h2>
         <p>The following software may be included in this product: zlib. Use 
of any of this software is governed by the
@@ -2254,6 +2248,12 @@
         original software.</p>
         <p>3. This notice may not be removed or altered from any source 
distribution.</p>
     </div>
+    <div class="ZXING">
+        <h2>ZXing-C++</h2>
+        <p>The following software may be included in this product: ZXing-C++. 
Use of any of this software is governed
+        by the terms of the license below:</p>
+        <p><a href="#a__Apache_License_version_2_0">Jump to Apache License 
Version 2.0</a></p>
+    </div>
     <div class="SKIA">
         <h2>Skia</h2>
         <p>The following software may be included in this product: Skia. Use 
of any of this software is governed by
commit f655bb238c357aded82cbfe2011e7dce8f127ae3
Author:     Xisco Fauli <[email protected]>
AuthorDate: Fri Jun 28 16:47:12 2024 +0200
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Sat Jun 29 07:50:16 2024 +0200

    tdf#158051: fix *σ’ -> σ’
    
    While writting a test for 7f593484a1f929663ec9ec7def76b63ec3a832b2
    "tdf#158051 AutoCorrect: don't apply final sigma before apostrophe"
    I realized the added rules where *σ’ -> ς’ ( which was the old behavior
    )
    instead of *σ’ -> σ’
    
    Change-Id: Ibff92e74da3d353ba715025b244b614b7fb8f9fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169717
    Reviewed-by: László Németh <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 6c949328650ccc8eeb149631a6368692dc08a309)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169732
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/extras/source/autocorr/lang/el/DocumentList.xml 
b/extras/source/autocorr/lang/el/DocumentList.xml
index 1d9bbeb7efae..3668f00dd9d0 100644
--- a/extras/source/autocorr/lang/el/DocumentList.xml
+++ b/extras/source/autocorr/lang/el/DocumentList.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <block-list:block-list 
xmlns:block-list="http://openoffice.org/2001/block-list";>
-  <block-list:block block-list:abbreviated-name=".*σ&apos;" 
block-list:name="ς’"/>
-  <block-list:block block-list:abbreviated-name=".*σ’" block-list:name="ς’"/>
+  <block-list:block block-list:abbreviated-name=".*σ&apos;" 
block-list:name="σ’"/>
+  <block-list:block block-list:abbreviated-name=".*σ’" block-list:name="σ’"/>
   <block-list:block block-list:abbreviated-name=".*σ" block-list:name="ς"/>
   <block-list:block block-list:abbreviated-name="--&gt;" block-list:name="→"/>
   <block-list:block block-list:abbreviated-name=".*-&gt;.*" 
block-list:name="→"/>
commit 89834ae1ec20fb7c242e697966037e925e1d44f1
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Jun 28 12:13:45 2024 +0200
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Fri Jun 28 23:06:40 2024 +0200

    tdf#157009 android: Add missing subdir for Triple-T/F-Droid icon
    
    Even with
    
        commit 69189de8fa9a9d4973a4304a82780d32e79fbe6f
        Author: Michael Weghorn <[email protected]>
        Date:   Thu May 16 09:26:44 2024 +0200
    
            tdf#157009 android: Add icon symlink for F-Droid
    
    (and its 24-2 backport) in place, the icon is not shown
    for LibreOffice Viewer in the F-Droid app and on the repo
    website [1].
    
    Revisiting the related specs [2] [3], it turns out
    that the icon needs to be in an "icon" subdir in the
    "graphics" directory, so add that missing "icon" subdir
    and move the symlink there.
    
    From [2]:
    
    > └── listings
    >     ├── en-US                           (en-US is the default locale in 
F-Droid)
    >     │   ├── title.txt                   (app name)
    >     │   ├── short-description.txt       (short description, max 80 chars, 
mandatory)
    >     │   ├── full-description.txt        (full app description, mandatory)
    >     │   ├── video-url.txt               (URL to a video introducing the 
app)
    >     │   ├── whatsnew                    (alternative changelog location; 
single file, no .txt)
    >     │   └── graphics
    >     │       ├── icon                    (app icon; mandatory if your app 
doesn't include any png icon)
    >     │       │   └── *.(png|jpg)         1 image, usually 512x512
    
    [1] https://f-droid.org/en/packages/org.documentfoundation.libreoffice/
    [2] 
https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure
    [3] 
https://github.com/Triple-T/gradle-play-publisher?tab=readme-ov-file#uploading-graphic-based-listings
    
    Change-Id: I43c23040bf63a34f8f9648b45fab6c47a8816b8d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169677
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
    Tested-by: Jenkins

diff --git a/android/source/src/main/play/listings/en-US/graphics/icon.png 
b/android/source/src/main/play/listings/en-US/graphics/icon.png
deleted file mode 120000
index f3e316efb456..000000000000
--- a/android/source/src/main/play/listings/en-US/graphics/icon.png
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../ic_launcher-web.png
\ No newline at end of file
diff --git a/android/source/src/main/play/listings/en-US/graphics/icon/icon.png 
b/android/source/src/main/play/listings/en-US/graphics/icon/icon.png
new file mode 120000
index 000000000000..f78b23fa9ae5
--- /dev/null
+++ b/android/source/src/main/play/listings/en-US/graphics/icon/icon.png
@@ -0,0 +1 @@
+../../../../../../../ic_launcher-web.png
\ No newline at end of file
commit bc5ee63d4bbb73b2f574e7002da4aa4b142b03ac
Author:     Xisco Fauli <[email protected]>
AuthorDate: Fri May 31 12:31:47 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Fri Jun 28 13:42:16 2024 +0200

    sd: use SAL_RET_MAYBENULL in GetViewFrame()
    
    Change-Id: If895a550fb2404f1a7cfcc4fb427674a3f6e5fc6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168287
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168367
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 0d9e82f27802..6a7e0e86902c 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -277,26 +277,27 @@ bool SdModule::OutlineToImpress(SfxRequest const & 
rRequest)
                 // AutoLayouts have to be finished
                 pDoc->StopWorkStartupDelay();
 
-                SfxViewFrame* pViewFrame = pViewSh->GetViewFrame();
-
-                // When the view frame has not been just created we have
-                // to switch synchronously to the outline view.
-                // (Otherwise the request will be ignored anyway.)
-                ::sd::ViewShellBase* pBase
-                    = dynamic_cast< 
::sd::ViewShellBase*>(pViewFrame->GetViewShell());
-                if (pBase != nullptr)
+                if (SfxViewFrame* pViewFrame = pViewSh->GetViewFrame())
                 {
-                    std::shared_ptr<FrameworkHelper> pHelper (
-                        FrameworkHelper::Instance(*pBase));
-                    pHelper->RequestView(
-                        FrameworkHelper::msOutlineViewURL,
-                        FrameworkHelper::msCenterPaneURL);
-
-                    pHelper->RunOnResourceActivation(
-                        FrameworkHelper::CreateResourceId(
-                        FrameworkHelper::msOutlineViewURL,
-                        FrameworkHelper::msCenterPaneURL),
-                        OutlineToImpressFinalizer(*pBase, *pDoc, *pBytes));
+                    // When the view frame has not been just created we have
+                    // to switch synchronously to the outline view.
+                    // (Otherwise the request will be ignored anyway.)
+                    ::sd::ViewShellBase* pBase
+                        = dynamic_cast< 
::sd::ViewShellBase*>(pViewFrame->GetViewShell());
+                    if (pBase != nullptr)
+                    {
+                        std::shared_ptr<FrameworkHelper> pHelper (
+                            FrameworkHelper::Instance(*pBase));
+                        pHelper->RequestView(
+                            FrameworkHelper::msOutlineViewURL,
+                            FrameworkHelper::msCenterPaneURL);
+
+                        pHelper->RunOnResourceActivation(
+                            FrameworkHelper::CreateResourceId(
+                            FrameworkHelper::msOutlineViewURL,
+                            FrameworkHelper::msCenterPaneURL),
+                            OutlineToImpressFinalizer(*pBase, *pDoc, *pBytes));
+                    }
                 }
             }
         }
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 96b96068f331..a2ef2001af43 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -133,8 +133,11 @@ bool 
LayerTabBar::IsRealNameOfStandardLayer(std::u16string_view rName)
 
 void LayerTabBar::Select()
 {
-    SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher();
-    pDispatcher->Execute(SID_SWITCHLAYER, SfxCallMode::SYNCHRON);
+    if (SfxViewFrame* pFrame = pDrViewSh->GetViewFrame())
+    {
+        SfxDispatcher* pDispatcher = pFrame->GetDispatcher();
+        pDispatcher->Execute(SID_SWITCHLAYER, SfxCallMode::SYNCHRON);
+    }
 }
 
 void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt)
@@ -147,10 +150,13 @@ void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt)
         sal_uInt16 aTabId = GetPageId( PixelToLogic(aPosPixel) );
         if (aTabId == 0)
         {
-            SfxDispatcher* pDispatcher = 
pDrViewSh->GetViewFrame()->GetDispatcher();
-            pDispatcher->Execute(SID_INSERTLAYER, SfxCallMode::SYNCHRON);
+            if (SfxViewFrame* pFrame = pDrViewSh->GetViewFrame())
+            {
+                SfxDispatcher* pDispatcher = pFrame->GetDispatcher();
+                pDispatcher->Execute(SID_INSERTLAYER, SfxCallMode::SYNCHRON);
 
-            bSetPageID=true;
+                bSetPageID=true;
+            }
         }
         else if (rMEvt.IsMod2())
         {
@@ -251,8 +257,11 @@ void LayerTabBar::DoubleClick()
 {
     if (GetCurPageId() != 0)
     {
-        SfxDispatcher* pDispatcher = 
pDrViewSh->GetViewFrame()->GetDispatcher();
-        pDispatcher->Execute( SID_MODIFYLAYER, SfxCallMode::SYNCHRON );
+        if (SfxViewFrame* pFrame = pDrViewSh->GetViewFrame())
+        {
+            SfxDispatcher* pDispatcher = pFrame->GetDispatcher();
+            pDispatcher->Execute( SID_MODIFYLAYER, SfxCallMode::SYNCHRON );
+        }
     }
 }
 
@@ -302,8 +311,11 @@ void  LayerTabBar::Command(const CommandEvent& rCEvt)
 {
     if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
-        SfxDispatcher* pDispatcher = 
pDrViewSh->GetViewFrame()->GetDispatcher();
-        pDispatcher->ExecutePopup("layertab");
+        if (SfxViewFrame* pFrame = pDrViewSh->GetViewFrame())
+        {
+            SfxDispatcher* pDispatcher = pFrame->GetDispatcher();
+            pDispatcher->ExecutePopup("layertab");
+        }
     }
 }
 
@@ -344,12 +356,15 @@ TabBarAllowRenamingReturnCode LayerTabBar::AllowRenaming()
     if (aNewName.isEmpty() ||
         (rLayerAdmin.GetLayer( aNewName ) && aLayerName != aNewName) )
     {
-        // Name already exists.
-        std::unique_ptr<weld::MessageDialog> 
xWarn(Application::CreateMessageDialog(pDrViewSh->GetViewFrame()->GetFrameWeld(),
-                                                   VclMessageType::Warning, 
VclButtonsType::Ok,
-                                                   
SdResId(STR_WARN_NAME_DUPLICATE)));
-        xWarn->run();
-        bOK = false;
+        if (SfxViewFrame* pFrame = pDrViewSh->GetViewFrame())
+        {
+            // Name already exists.
+            std::unique_ptr<weld::MessageDialog> 
xWarn(Application::CreateMessageDialog(pFrame->GetFrameWeld(),
+                                                       
VclMessageType::Warning, VclButtonsType::Ok,
+                                                       
SdResId(STR_WARN_NAME_DUPLICATE)));
+            xWarn->run();
+            bOK = false;
+        }
     }
 
     if (bOK)
@@ -415,9 +430,11 @@ void LayerTabBar::ActivatePage()
 {
     if (pDrViewSh!=nullptr)
     {
-
-        SfxDispatcher* pDispatcher = 
pDrViewSh->GetViewFrame()->GetDispatcher();
-        pDispatcher->Execute(SID_SWITCHLAYER, SfxCallMode::ASYNCHRON);
+        if (SfxViewFrame* pFrame = pDrViewSh->GetViewFrame())
+        {
+            SfxDispatcher* pDispatcher = pFrame->GetDispatcher();
+            pDispatcher->Execute(SID_SWITCHLAYER, SfxCallMode::ASYNCHRON);
+        }
     }
 }
 
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index bb631b06e546..ecf2e612051a 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1099,9 +1099,12 @@ void SdPageObjsTLV::SetViewFrame(const SfxViewFrame* 
pViewFrame)
 {
     if (sd::ViewShellBase* pBase = 
sd::ViewShellBase::GetViewShellBase(pViewFrame))
     {
-        std::shared_ptr<sd::ViewShell> xViewShell = pBase->GetMainViewShell();
-        SAL_WARN_IF(!xViewShell, "sd", "null pBaseViewFrame");
-        const css::uno::Reference< css::frame::XFrame > xFrame = xViewShell ? 
xViewShell->GetViewFrame()->GetFrame().GetFrameInterface() : nullptr;
+        css::uno::Reference< css::frame::XFrame > xFrame;
+        if (std::shared_ptr<sd::ViewShell> xViewShell = 
pBase->GetMainViewShell())
+        {
+            if (SfxViewFrame* pFrame = xViewShell->GetViewFrame())
+                xFrame = pFrame->GetFrame().GetFrameInterface();
+        }
         m_xAccel->init(::comphelper::getProcessComponentContext(), xFrame);
     }
 }
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 31b286c822e3..c25f6cf4004c 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -713,7 +713,11 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
         if( mpWindow )
             mpWindow->EnterWait();
 
-        css::uno::Reference<css::frame::XDispatchProvider> 
xDispatchProvider(mpViewShell->GetViewFrame()->GetFrame().GetFrameInterface(), 
css::uno::UNO_QUERY);
+        SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
+        if (!pFrame)
+            return;
+
+        css::uno::Reference<css::frame::XDispatchProvider> 
xDispatchProvider(pFrame->GetFrame().GetFrameInterface(), css::uno::UNO_QUERY);
 
         rtl::Reference<avmedia::PlayerListener> xPlayerListener(new 
avmedia::PlayerListener(
             [xDispatchProvider, aURL, bLink](const 
css::uno::Reference<css::media::XPlayer>& rPlayer){
diff --git a/sd/source/ui/slideshow/slideshow.cxx 
b/sd/source/ui/slideshow/slideshow.cxx
index 1c21ef7ee08a..f45c374d4fe9 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -615,10 +615,14 @@ WorkWindow *SlideShow::GetWorkWindow()
 
     PresentationViewShell* pShell = 
dynamic_cast<PresentationViewShell*>(mpFullScreenViewShellBase->GetMainViewShell().get());
 
-    if( !pShell || !pShell->GetViewFrame() )
+    if( !pShell)
         return nullptr;
 
-    return 
dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetFrame().GetWindow().GetParent());
+    SfxViewFrame* pFrame = pShell->GetViewFrame();
+    if (!pFrame)
+        return nullptr;
+
+    return 
dynamic_cast<WorkWindow*>(pFrame->GetFrame().GetWindow().GetParent());
 }
 
 bool SlideShow::IsExitAfterPresenting() const
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 0a713c06da8f..3d1d822ee24d 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -175,22 +175,28 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
         case SID_SLIDE_TRANSITIONS_PANEL:
         {
             // First make sure that the sidebar is visible
-            pShell->GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
-            ::sfx2::sidebar::Sidebar::ShowPanel(
-                u"SdSlideTransitionPanel",
-                pShell->GetViewFrame()->GetFrame().GetFrameInterface());
-            rRequest.Ignore ();
+            if (SfxViewFrame* pFrame = pShell->GetViewFrame())
+            {
+                pFrame->ShowChildWindow(SID_SIDEBAR);
+                ::sfx2::sidebar::Sidebar::ShowPanel(
+                    u"SdSlideTransitionPanel",
+                    pFrame->GetFrame().GetFrameInterface());
+                rRequest.Ignore ();
+            }
             break;
         }
 
         case SID_MASTER_SLIDES_PANEL:
         {
             // First make sure that the sidebar is visible
-            pShell->GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
-            ::sfx2::sidebar::Sidebar::ShowPanel(
-                u"SdAllMasterPagesPanel",
-                pShell->GetViewFrame()->GetFrame().GetFrameInterface());
-            rRequest.Ignore ();
+            if (SfxViewFrame* pFrame = pShell->GetViewFrame())
+            {
+                pFrame->ShowChildWindow(SID_SIDEBAR);
+                ::sfx2::sidebar::Sidebar::ShowPanel(
+                    u"SdAllMasterPagesPanel",
+                    pFrame->GetFrame().GetFrameInterface());
+                rRequest.Ignore ();
+            }
             break;
         }
 
diff --git a/sd/source/ui/table/tablefunction.cxx 
b/sd/source/ui/table/tablefunction.cxx
index 67196e864b39..99552d149f50 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -234,13 +234,16 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
     case SID_TABLEDESIGN:
     {
         // First make sure that the sidebar is visible
-        GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
-        ::sfx2::sidebar::Sidebar::TogglePanel(
-            u"SdTableDesignPanel",
-            GetViewFrame()->GetFrame().GetFrameInterface());
+        if (SfxViewFrame* pViewFrame = GetViewFrame())
+        {
+            pViewFrame->ShowChildWindow(SID_SIDEBAR);
+            ::sfx2::sidebar::Sidebar::TogglePanel(
+                u"SdTableDesignPanel",
+                pViewFrame->GetFrame().GetFrameInterface());
 
-        Cancel();
-        rReq.Done ();
+            Cancel();
+            rReq.Done ();
+        }
         break;
     }
     default:
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 9e8e7b1aa5d4..8b0aaf33a870 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -957,7 +957,9 @@ vcl::Window* ViewShellBase::GetViewWindow()
 
 OUString ViewShellBase::RetrieveLabelFromCommand( const OUString& aCmdURL ) 
const
 {
-    OUString 
aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface()));
+    OUString aModuleName;
+    if (SfxViewFrame* pViewFrame = GetMainViewShell()->GetViewFrame())
+        aModuleName = 
vcl::CommandInfoProvider::GetModuleIdentifier(pViewFrame->GetFrame().GetFrameInterface());
     auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCmdURL, 
aModuleName);
     return vcl::CommandInfoProvider::GetLabelForCommand(aProperties);
 }
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx 
b/sd/source/ui/view/ViewShellImplementation.cxx
index c76de5a513b6..f97268dc7a5f 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -110,10 +110,13 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
             // First make sure that the sidebar is visible
             mrViewShell.GetDrawView()->SdrEndTextEdit();
             mrViewShell.GetDrawView()->UnmarkAll();
-            mrViewShell.GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
-            sfx2::sidebar::Sidebar::TogglePanel(
-                u"SdLayoutsPanel",
-                mrViewShell.GetViewFrame()->GetFrame().GetFrameInterface());
+            if (SfxViewFrame* pViewFrame = mrViewShell.GetViewFrame())
+            {
+                pViewFrame->ShowChildWindow(SID_SIDEBAR);
+                sfx2::sidebar::Sidebar::TogglePanel(
+                    u"SdLayoutsPanel",
+                    pViewFrame->GetFrame().GetFrameInterface());
+            }
             break;
         }
         else if (pArgs->Count() == 4)
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 8583ecc182c7..8a69b13bf472 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -114,7 +114,9 @@ void DrawViewShell::ArrangeGUIElements()
     if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
         bClientActive = true;
 
-    bool bInPlaceActive = GetViewFrame()->GetFrame().IsInPlace();
+    bool bInPlaceActive = false;
+    if (SfxViewFrame* pViewFrame = GetViewFrame())
+        bInPlaceActive = pViewFrame->GetFrame().IsInPlace();
 
     if ( mbZoomOnPage && !bInPlaceActive && !bClientActive )
     {
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 845bc956ed1b..fe47f9095616 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1644,9 +1644,11 @@ void DrawViewShell::GetModeSwitchingMenuState 
(SfxItemSet &rSet)
     // view mode is allowed.
     const bool bIsRunning = SlideShow::IsRunning(GetViewShellBase());
 
-    if (GetViewFrame()->GetFrame().IsInPlace() || bIsRunning)
+    SfxViewFrame* pViewFrame = GetViewFrame();
+    const bool bIsInPlace = pViewFrame && pViewFrame->GetFrame().IsInPlace() ? 
true : false;
+    if (bIsInPlace || bIsRunning)
     {
-        if ( !GetViewFrame()->GetFrame().IsInPlace() )
+        if (!bIsInPlace)
         {
             rSet.ClearItem( SID_DRAWINGMODE );
             rSet.DisableItem( SID_DRAWINGMODE );
diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx
index b914b2da8cbd..92794299238c 100644
--- a/sd/source/ui/view/grviewsh.cxx
+++ b/sd/source/ui/view/grviewsh.cxx
@@ -70,7 +70,9 @@ void GraphicViewShell::ArrangeGUIElements()
     if (mpLayerTabBar && mpLayerTabBar->IsVisible())
     {
         Size aSize = mpLayerTabBar->GetSizePixel();
-        const Size aFrameSize 
(GetViewFrame()->GetWindow().GetOutputSizePixel());
+        Size aFrameSize;
+        if (SfxViewFrame* pViewFrame = GetViewFrame())
+            aFrameSize = pViewFrame->GetWindow().GetOutputSizePixel();
 
         aSize.setHeight(GetParentWindow()->GetFont().GetFontHeight() + 
TAB_HEIGHT_MARGIN);
         aSize.setWidth( aFrameSize.Width() );
commit de732c870f04921803343578f0601aede389f00d
Author:     Xisco Fauli <[email protected]>
AuthorDate: Fri May 31 13:47:04 2024 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Fri Jun 28 13:41:53 2024 +0200

    svx: use SAL_RET_MAYBENULL in GetSfxViewShell()
    
    Change-Id: I05e66544c08a1ed55a5571f6061b23346235224e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168293
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit cb982975c16e380f88282f03d07f8cfb8421ed77)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168316
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index ee8945a82149..a942af276ee5 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1021,8 +1021,13 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, 
bool bOnlyHardAttr) con
                 }
 
                 if (!sPayload.isEmpty())
-                    
GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
-                        OUStringToOString(sPayload, 
RTL_TEXTENCODING_ASCII_US));
+                {
+                    if (SfxViewShell* pViewShell = GetSfxViewShell())
+                    {
+                        
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                            OUStringToOString(sPayload, 
RTL_TEXTENCODING_ASCII_US));
+                    }
+                }
             }
 
             nWhich = aIter.NextWhich();
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index b0784449f159..3f38c066ee20 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -252,12 +252,15 @@ void SdrMarkView::modelHasChangedLOKit()
             const vcl::Window* pWin = pOut ? pOut->GetOwnerWindow() : nullptr;
             if (pWin && pWin->IsChart())
             {
-                const vcl::Window* pViewShellWindow = 
GetSfxViewShell()->GetEditWindowForActiveOLEObj();
-                if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
+                if (SfxViewShell* pViewShell = GetSfxViewShell())
                 {
-                    Point aOffsetPx = 
pWin->GetOffsetPixelFrom(*pViewShellWindow);
-                    Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
-                    aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY());
+                    const vcl::Window* pViewShellWindow = 
pViewShell->GetEditWindowForActiveOLEObj();
+                    if (pViewShellWindow && 
pViewShellWindow->IsAncestorOf(*pWin))
+                    {
+                        Point aOffsetPx = 
pWin->GetOffsetPixelFrom(*pViewShellWindow);
+                        Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
+                        aSelection.Move(aLogicOffset.getX(), 
aLogicOffset.getY());
+                    }
                 }
             }
         }
@@ -814,7 +817,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
         }
 
         // hide the text selection too
-        pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, 
""_ostr);
+        if (pViewShell)
+            
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, ""_ostr);
     }
 
     {
@@ -945,7 +949,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
                                     + "]");
 
                                 // polygon approximating the pie segment or 
donut segment
-                                if (pO->GetObjIdentifier() == 
SdrObjKind::PathFill)
+                                if (pViewShell && pO->GetObjIdentifier() == 
SdrObjKind::PathFill)
                                 {
                                     const basegfx::B2DPolyPolygon 
aPolyPolygon(pO->TakeXorPoly());
                                     if (aPolyPolygon.count() == 1)
@@ -1122,7 +1126,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
         {
             sSelectionText = "EMPTY"_ostr;
             sSelectionTextView = "EMPTY"_ostr;
-            if (!pOtherShell)
+            if (!pOtherShell && pViewShell)
                 pViewShell->NotifyOtherViews(LOK_CALLBACK_TEXT_VIEW_SELECTION, 
"selection"_ostr, OString());
         }
 
@@ -1137,9 +1141,10 @@ void 
SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
 
             std::stringstream aStream;
             boost::property_tree::write_json(aStream, aTableJsonTree);
-            
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, 
OString(aStream.str()));
+            if (pViewShell)
+                
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, 
OString(aStream.str()));
         }
-        else if (!getSdrModelFromSdrView().IsWriter())
+        else if (!getSdrModelFromSdrView().IsWriter() && pViewShell)
         {
             
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, "{}"_ostr);
         }

Reply via email to