include/systools/win32/winstoreutil.hxx |   10 +++-------
 sw/source/core/unocore/unostyle.cxx     |    6 +++---
 2 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit b083e27de5e3cd7d46df089915572340325b2bd1
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Dec 8 19:08:00 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Dec 8 16:56:00 2024 +0100

    GetCurrentPackageFullName is available in the baseline Windows 10
    
    Change-Id: Ie5d46f6a53af9a9a68ae98d4de28021fa1ee7eaf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178088
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/include/systools/win32/winstoreutil.hxx 
b/include/systools/win32/winstoreutil.hxx
index aa0a70e64423..c3a56c9bbd80 100644
--- a/include/systools/win32/winstoreutil.hxx
+++ b/include/systools/win32/winstoreutil.hxx
@@ -12,6 +12,7 @@
 #include <sal/config.h>
 
 #include <prewin.h>
+#include <appmodel.h>
 #include <postwin.h>
 
 namespace sal::systools
@@ -19,13 +20,8 @@ namespace sal::systools
 // Returns true if the current process is run as a Windows store app, which 
has some specifics
 inline bool IsStorePackagedApp()
 {
-    // GetCurrentPackageFullName is only available since Windows 8
-    HMODULE hDll = GetModuleHandleW(L"kernel32.dll");
-    using Func_t = LONG WINAPI(UINT32*, PWSTR);
-    if (auto pFunc = reinterpret_cast<Func_t*>(GetProcAddress(hDll, 
"GetCurrentPackageFullName")))
-        if (UINT32 size = 0; pFunc(&size, nullptr) == 
ERROR_INSUFFICIENT_BUFFER)
-            return true;
-    return false;
+    UINT32 size = 0;
+    return GetCurrentPackageFullName(&size, nullptr) == 
ERROR_INSUFFICIENT_BUFFER;
 }
 } // sal::systools
 
commit 46cfd8d2a7a06fb5c04c027ce641a766af8a337a
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Dec 8 11:42:12 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Dec 8 16:55:53 2024 +0100

    cid#1636664 Dereference after null check
    
    Change-Id: I916212471a80417a582192920427999ee6a425d2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178078
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 44b710f6d8fc..098750ab418d 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -956,11 +956,11 @@ rtl::Reference<SwXStyle> 
SwXStyleFamily::getParagraphStyleByName(const OUString&
 rtl::Reference<SwXBaseStyle> SwXStyleFamily::getStyleByName(const OUString& 
rName)
 {
     SolarMutexGuard aGuard;
+    if(!m_pBasePool)
+        throw uno::RuntimeException();
     OUString sStyleName;
     SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(),
             !m_pDocShell->GetDoc()->IsInWriterfilterImport());
-    if(!m_pBasePool)
-        throw uno::RuntimeException();
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, 
m_rEntry.family());
     if(!pBase)
         throw container::NoSuchElementException(rName);
@@ -1104,7 +1104,7 @@ void SwXStyleFamily::replaceByName(const OUString& rName, 
const uno::Any& rEleme
         throw uno::RuntimeException();
     OUString sStyleName;
     SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(),
-            m_pDocShell && !m_pDocShell->GetDoc()->IsInWriterfilterImport());
+            !m_pDocShell->GetDoc()->IsInWriterfilterImport());
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, 
m_rEntry.family());
     // replacements only for userdefined styles
     if(!pBase)

Reply via email to