desktop/source/lib/init.cxx                |    3 ++
 include/systools/curlinit.hxx              |   13 ++++++++++-
 include/tools/hostfilter.hxx               |    4 +++
 sfx2/source/view/lokhelper.cxx             |    4 +++
 sw/source/uibase/shells/textsh1.cxx        |    7 +++++-
 sw/source/uibase/wrtsh/wrtsh1.cxx          |    3 --
 tools/source/inet/hostfilter.cxx           |   11 +++++++++
 ucb/source/ucp/webdav-curl/CurlSession.cxx |    5 ++++
 vcl/ios/DataFlavorMapping.cxx              |   11 +++++++--
 vcl/osx/DataFlavorMapping.cxx              |   10 +++++++-
 vcl/quartz/salgdi.cxx                      |   33 +++++++++++++++++++++++++++--
 11 files changed, 95 insertions(+), 9 deletions(-)

New commits:
commit 05c7fada04418a181b067fe92c39a5442cd9d4d4
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Jun 4 21:17:59 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jun 25 22:59:47 2024 +0200

    allow an exemption to be made for a specific host
    
    Change-Id: Ie423df7839e793a9c07561efb56d5649876947ee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168826
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index eae08a12889e..ee2ac3508b08 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2843,6 +2843,9 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 
         OutputDevice::StartTrackingFontMappingUse();
 
+        if (const char* pExemptVerifyHost = ::getenv("LOK_EXEMPT_VERIFY_HOST"))
+            HostFilter::setExemptVerifyHost(OUString(pExemptVerifyHost, 
strlen(pExemptVerifyHost), RTL_TEXTENCODING_UTF8));
+
         const int nThisDocumentId = nDocumentIdCounter++;
         SfxViewShell::SetCurrentDocId(ViewShellDocId(nThisDocumentId));
         uno::Reference<lang::XComponent> xComponent = 
xComponentLoader->loadComponentFromURL(
diff --git a/include/tools/hostfilter.hxx b/include/tools/hostfilter.hxx
index afbf885b0cb4..ca2d91355986 100644
--- a/include/tools/hostfilter.hxx
+++ b/include/tools/hostfilter.hxx
@@ -21,6 +21,10 @@ public:
     static void setAllowedHostsRegex(const char* sAllowedRegex);
 
     static bool isForbidden(const OUString& rHost);
+
+    static void setExemptVerifyHost(const OUString& rExemptVerifyHost);
+
+    static bool isExemptVerifyHost(const std::u16string_view rHost);
 };
 
 #endif
diff --git a/tools/source/inet/hostfilter.cxx b/tools/source/inet/hostfilter.cxx
index 5bc63d42cfb7..e13e3d66cab6 100644
--- a/tools/source/inet/hostfilter.cxx
+++ b/tools/source/inet/hostfilter.cxx
@@ -11,6 +11,7 @@
 #include <regex>
 
 static std::regex g_AllowedHostsRegex("");
+static OUString g_ExceptVerifyHost;
 static bool g_AllowedHostsSet = false;
 
 void HostFilter::setAllowedHostsRegex(const char* sAllowedRegex)
@@ -28,4 +29,14 @@ bool HostFilter::isForbidden(const OUString& rHost)
     return !std::regex_match(rHost.toUtf8().getStr(), g_AllowedHostsRegex);
 }
 
+void HostFilter::setExemptVerifyHost(const OUString& rExemptVerifyHost)
+{
+    g_ExceptVerifyHost = rExemptVerifyHost;
+}
+
+bool HostFilter::isExemptVerifyHost(const std::u16string_view rHost)
+{
+    return rHost == g_ExceptVerifyHost;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index a80c19f6d690..7089dcacdbdb 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -694,6 +694,11 @@ 
CurlSession::CurlSession(uno::Reference<uno::XComponentContext> xContext,
         rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_FORBID_REUSE, 1L);
         assert(rc == CURLE_OK);
     }
+    if (HostFilter::isExemptVerifyHost(m_URI.GetHost()))
+    {
+        rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_SSL_VERIFYHOST, 0L);
+        assert(rc == CURLE_OK);
+    }
 }
 
 CurlSession::~CurlSession() {}
commit 6f84f77d9d49dbfecd8a9e212aba5bde1455797d
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Jun 4 16:35:57 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jun 25 22:59:23 2024 +0200

    map LO_CERTIFICATE_AUTHORITY_PATH to CURLOPT_CAPATH
    
    curl has both CURLOPT_CAINFO for the single-file collection
    of certificates case and CURLOPT_CAPATH for the multi-file
    exploder view of certificates, this adds support to
    use CURLOPT_CAPATH as well as CURLOPT_CAINFO
    
    Change-Id: I28163bbe81fa389eea70ef1289ed04a50a029c5f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168825
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/include/systools/curlinit.hxx b/include/systools/curlinit.hxx
index 4b226c7a4218..f65a527999fc 100644
--- a/include/systools/curlinit.hxx
+++ b/include/systools/curlinit.hxx
@@ -30,7 +30,6 @@
 static void InitCurl_easy(CURL* const pCURL)
 {
     CURLcode rc;
-    (void)rc;
 
 #if defined(LO_CURL_NEEDS_CA_BUNDLE)
     char const* const path = GetCABundleFile();
@@ -41,6 +40,18 @@ static void InitCurl_easy(CURL* const pCURL)
     }
 #endif
 
+    // curl: "If you have a CA cert for the server stored someplace else than
+    // in the default bundle, then the CURLOPT_CAPATH option might come handy
+    // for you"
+    if (char const* const capath = getenv("LO_CERTIFICATE_AUTHORITY_PATH"))
+    {
+        rc = curl_easy_setopt(pCURL, CURLOPT_CAPATH, capath);
+        if (rc != CURLE_OK)
+        {
+            throw css::uno::RuntimeException("CURLOPT_CAPATH failed");
+        }
+    }
+
     if (!officecfg::Office::Security::Net::AllowInsecureProtocols::get())
     {
         rc = curl_easy_setopt(pCURL, CURLOPT_SSLVERSION, 
CURL_SSLVERSION_TLSv1_2);
commit abfcd7ce728ff5910f09f0f26834f710f59a7a95
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Tue Jun 11 13:10:36 2024 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jun 25 22:57:43 2024 +0200

    tdf#155212 clear the cached system font list after loading a font
    
    If the system font is not cached in SalData, loading embedded
    fonts will be extremely slow and will trigger each frame and each
    of its internal subframes to reload the system font list when
    loading documents with embedded fonts.
    
    So instead, reenable caching of the system font list in SalData
    by reverting commit 3b6e9582ce43242a2304047561116bb26808408b.
    Then, to prevent tdf#72456 from reoccurring, clear the cached
    system font list after a font has been loaded or unloaded.
    This should cause the first frame's request to reload the cached
    system font list and all subsequent frames will avoid doing
    duplicate font reloads.
    
    Change-Id: If2a36f8c17d8e25f818275f30a19af8517478884
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168734
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>
    Tested-by: Jenkins
    (cherry picked from commit 195ed184dd1552816bdebfe9c54fb6408bf91cc1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168728
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>
    (cherry picked from commit c270131be7a8ecc9599dc0f0fe6ea24c650f32ed)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168801

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 0522ff8d58e7..983a98a5a614 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -216,7 +216,24 @@ static bool AddTempDevFont(const OUString& rFontFileURL)
 
     CFErrorRef error;
     bool success = CTFontManagerRegisterFontsForURL(rFontURL, 
kCTFontManagerScopeProcess, &error);
-    if (!success)
+    if (success)
+    {
+        // tdf155212 clear the cached system font list after loading a font
+        // If the system font is not cached in SalData, loading embedded
+        // fonts will be extremely slow and will trigger each frame and each
+        // of its internal subframes to reload the system font list when
+        // loading documents with embedded fonts.
+        // So instead, reenable caching of the system font list in SalData
+        // by reverting commit 3b6e9582ce43242a2304047561116bb26808408b.
+        // Then, to prevent tdf#72456 from reoccurring, clear the cached
+        // system font list after a font has been loaded or unloaded.
+        // This should cause the first frame's request to reload the cached
+        // system font list and all subsequent frames will avoid doing
+        // duplicate font reloads.
+        SalData* pSalData = GetSalData();
+        pSalData->mpFontList.reset();
+    }
+    else
     {
         CFRelease(error);
     }
@@ -271,8 +288,20 @@ void 
AquaSalGraphics::GetDevFontList(vcl::font::PhysicalFontCollection* pFontCol
 
     AddLocalTempFontDirs();
 
+    // The idea is to cache the list of system fonts once it has been 
generated.
+    // SalData seems to be a good place for this caching. However we have to
+    // carefully make the access to the font list thread-safe. If we register
+    // a font-change event handler to update the font list in case fonts have
+    // changed on the system we have to lock access to the list. The right
+    // way to do that is the solar mutex since GetDevFontList is protected
+    // through it as should be all event handlers
+
+    // Related tdf#155212: the system font list needs to be cached but that
+    // should not cause tdf#72456 to reoccur now that the cached system font
+    // is cleared immediately after a font has been loaded
     SalData* pSalData = GetSalData();
-    pSalData->mpFontList = GetCoretextFontList();
+    if( !pSalData->mpFontList )
+        pSalData->mpFontList = GetCoretextFontList();
 
     // Copy all PhysicalFontFace objects contained in the SystemFontList
     pSalData->mpFontList->AnnounceFonts( *pFontCollection );
commit 19435472d45ac24f4e16f3c6f4cad9cf897c4210
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Fri May 31 16:23:59 2024 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jun 25 22:57:08 2024 +0200

    tdf#160801 fix crash by delaying resetting of attributes
    
    Calling SwWrtShell::ResetAttr() will sometimes delete the
    current SwTextShell instance so call it after clearing the
    direct formatting flag.
    
    Change-Id: I43a66527cee30271447dff30f166086c6759e162
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168304
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>
    (cherry picked from commit 6f4adc1274cfac30b9097411bb193bd4386969f0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168628
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 31c93384ea3b..7f432d5c17d1 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1041,12 +1041,17 @@ void SwTextShell::Execute(SfxRequest &rReq)
                 for (sal_uInt16 i = nBegin; i <= nEnd; ++i)
                     aAttribs.insert( i );
             }
-            rWrtSh.ResetAttr( aAttribs );
 
             // also clear the direct formatting flag inside SwTableBox(es)
             if (SwFEShell* pFEShell = GetView().GetDocShell()->GetFEShell())
                 pFEShell->UpdateTableStyleFormatting(nullptr, true);
 
+            // tdf#160801 fix crash by delaying resetting of attributes
+            // Calling SwWrtShell::ResetAttr() will sometimes delete the
+            // current SwTextShell instance so call it after clearing the
+            // direct formatting flag.
+            rWrtSh.ResetAttr( aAttribs );
+
             rReq.Done();
             break;
         }
commit 9ba503a9459b5bd464fc1df45a16e1b3e2d4b754
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Thu Jun 20 11:11:54 2024 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jun 25 22:56:31 2024 +0200

    tdf#161461 stop crashing by retaining NSString
    
    OUStringToNSString() returns an autoreleased NSString so it
    needs to be retained for the life of maOfficeOnlyTypes.
    
    Change-Id: Ic3777f818b7cada8e88e97965531fc0a7f2e825c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169291
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx
index 14bf0f6f43d7..607f110222bb 100644
--- a/vcl/ios/DataFlavorMapping.cxx
+++ b/vcl/ios/DataFlavorMapping.cxx
@@ -421,10 +421,17 @@ NSString* 
DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor
         OfficeOnlyTypes::const_iterator it = 
maOfficeOnlyTypes.find(oOOFlavor.MimeType);
 
         if (it == maOfficeOnlyTypes.end())
-            sysFlavor = maOfficeOnlyTypes[oOOFlavor.MimeType]
-                = OUStringToNSString(oOOFlavor.MimeType);
+        {
+            // tdf#161461 stop crashing by retaining NSString
+            // OUStringToNSString() returns an autoreleased NSString so it
+            // needs to be retained for the life of maOfficeOnlyTypes.
+            sysFlavor = maOfficeOnlyTypes[oOOFlavor.MimeType] =
+                [OUStringToNSString(oOOFlavor.MimeType) retain];
+        }
         else
+        {
             sysFlavor = it->second;
+        }
     }
 
     return sysFlavor;
diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index ade3f48dd1ab..c08c32ba9b60 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -586,9 +586,17 @@ const NSString* 
DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& oO
         OfficeOnlyTypes::const_iterator it = maOfficeOnlyTypes.find( 
oOOFlavor.MimeType );
 
         if( it == maOfficeOnlyTypes.end() )
-            sysFlavor = maOfficeOnlyTypes[ oOOFlavor.MimeType ] = 
OUStringToNSString( oOOFlavor.MimeType );
+        {
+            // tdf#161461 stop crashing by retaining NSString
+            // OUStringToNSString() returns an autoreleased NSString so it
+            // needs to be retained for the life of maOfficeOnlyTypes.
+            sysFlavor = maOfficeOnlyTypes[oOOFlavor.MimeType] =
+                [OUStringToNSString(oOOFlavor.MimeType) retain];
+        }
         else
+        {
             sysFlavor = it->second;
+        }
     }
 
     return sysFlavor;
commit 3fb0c6baea4ac303b003a6d272bd33f6e8d5ce31
Author:     Darshan-upadhyay1110 <darshan.upadh...@collabora.com>
AuthorDate: Fri Jun 21 09:49:56 2024 +0530
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jun 25 22:56:12 2024 +0200

    Fix insert comment not working after document load.
    
        - In document with comments present insert comment not working document 
after load.
        - remove this condition for insertposIT to work for onload
        - this patch wil fix this issue
    
    Change-Id: I6128053b23678e61548d04979e3b199678a6b708
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169311
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 1e3b12b614ce..07ebe418bef8 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -2216,8 +2216,7 @@ void SwWrtShell::SetShowHeaderFooterSeparator( 
FrameControlType eControl, bool b
 void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq)
 {
     SwPostItField* pPostIt = 
dynamic_cast<SwPostItField*>(rFieldMgr.GetCurField());
-    bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == SwFieldIds::Postit);
-    if (bNew || GetView().GetPostItMgr()->IsAnswer())
+
     {
         const SvxPostItAuthorItem* pAuthorItem = 
rReq.GetArg<SvxPostItAuthorItem>(SID_ATTR_POSTIT_AUTHOR);
         OUString sAuthor;
commit 8fcc65c6fd0097377314df151d26fce1d6caf57e
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Apr 16 17:59:25 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jun 25 22:54:41 2024 +0200

    cool#9309 lok: sync language in comphelper::LibreOfficeKit on view creation
    
    If new view is created using createViewWithOptions API call
    we pass language of that view. We do a setup of that language
    in SfxLokHelper::setViewLanguage but it was only set inside
    ViewShell.
    
    Unfortunately just after we create the view we call setView which
    later checks if comphelper::LibreOfficeKit::getLanguageTag()
    has matching value with ViewShell field.
    It was showing warning in the logs:
    warn:lok:31748:31654:sfx2/source/view/lokhelper.cxx:206: LANGUAGE mismatch 
at setView! ... old (wrong) lang:de new lang:fr
    
    Let's check if the view we try to modify is the current one and
    in that case synchronize value we can get using global
    comphelper::LibreOfficeKit function.
    
    Signed-off-by: Szymon Kłos <szymon.k...@collabora.com>
    Change-Id: Icddfda003522dda661066c4d1c43ca1dec9e5c55
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169107
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 99f39fbf4e8b..66f8be5f2800 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -336,6 +336,10 @@ void SfxLokHelper::setViewLanguage(int nId, const 
OUString& rBcp47LanguageTag)
         if (pViewShell->GetViewShellId() == ViewShellId(nId))
         {
             pViewShell->SetLOKLanguageTag(rBcp47LanguageTag);
+            // sync also global getter if we are the current view
+            bool bIsCurrShell = (pViewShell == SfxViewShell::Current());
+            if (bIsCurrShell)
+                
comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(rBcp47LanguageTag));
             return;
         }
     }

Reply via email to