compilerplugins/clang/stringstatic.cxx | 2 ++ vcl/source/gdi/embeddedfontsmanager.cxx | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-)
New commits: commit 49509ba5221768327ac2d61f8dc3e8dd038ee753 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Aug 14 23:53:29 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Aug 15 07:28:05 2025 +0200 LOK: Set up directory for temporary embedded font files User profile is read-only in LOK. Change-Id: Ie424cdfed36525a293226c601ed7bf349e0856b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189641 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/compilerplugins/clang/stringstatic.cxx b/compilerplugins/clang/stringstatic.cxx index 0d4fc0574bf4..cec45a364e4b 100644 --- a/compilerplugins/clang/stringstatic.cxx +++ b/compilerplugins/clang/stringstatic.cxx @@ -104,6 +104,8 @@ bool StringStatic::VisitVarDecl(VarDecl const* varDecl) // cannot make something constexpr if it is also declared in a header file as extern if (loplugin::hasExternalLinkage(varDecl)) return true; + if (suppressWarningAt(varDecl->getBeginLoc())) + return true; report(DiagnosticsEngine::Warning, "rather declare this as constexpr", varDecl->getLocation()) diff --git a/vcl/source/gdi/embeddedfontsmanager.cxx b/vcl/source/gdi/embeddedfontsmanager.cxx index 5fd98f917d8b..2451761e6035 100644 --- a/vcl/source/gdi/embeddedfontsmanager.cxx +++ b/vcl/source/gdi/embeddedfontsmanager.cxx @@ -29,8 +29,10 @@ #include <com/sun/star/io/XInputStream.hpp> #include <comphelper/diagnose_ex.hxx> #include <comphelper/interaction.hxx> +#include <comphelper/lok.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/storagehelper.hxx> +#include <unotools/tempfile.hxx> #include <font/PhysicalFontFaceCollection.hxx> #include <font/PhysicalFontCollection.hxx> @@ -57,15 +59,20 @@ using namespace vcl; namespace { +OUString GetStandardEmbeddedFontsRoot() +{ + OUString p = u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") "::UserInstallation}"_ustr; + rtl::Bootstrap::expandMacros(p); + (void)osl::FileBase::getAbsoluteFileURL({}, p + "/user/temp/embeddedfonts/", p); + return p; +} + const OUString& GetEmbeddedFontsRoot() { - static const OUString path = []() - { - OUString p = u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") "::UserInstallation}"_ustr; - rtl::Bootstrap::expandMacros(p); - (void)osl::FileBase::getAbsoluteFileURL({}, p + "/user/temp/embeddedfonts/", p); - return p; - }(); + // [-loplugin:stringstatic] false positive: the initializer is not a constant expression + static const OUString path = comphelper::LibreOfficeKit::isActive() + ? utl::CreateTempURL(nullptr, true) + : GetStandardEmbeddedFontsRoot(); return path; }