include/rtl/ustring.hxx     |    4 ++--
 sfx2/source/doc/objstor.cxx |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 5354d8fb170418c130c08b070029f09337573ef6
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Apr 26 10:16:32 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Apr 29 09:29:50 2024 +0200

    WaE: C6326: Potential comparison of a constant with another constant
    
    if msvc -analyze is used
    
    Change-Id: I5905447a79e8e50d70281e0c230d1ce3b13fc475
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166704
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 14a9d2cf8b36..39567014c395 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -357,7 +357,7 @@ public:
         assert(
             libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
         pData = NULL;
-        if (libreoffice_internal::ConstCharArrayDetector<T>::length == 0) {
+        if SAL_CONSTEXPR 
(libreoffice_internal::ConstCharArrayDetector<T>::length == 0) {
             rtl_uString_new(&pData);
         } else {
             rtl_uString_newFromLiteral(
@@ -620,7 +620,7 @@ public:
     {
         assert(
             libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
-        if (libreoffice_internal::ConstCharArrayDetector<T>::length == 0) {
+        if SAL_CONSTEXPR 
(libreoffice_internal::ConstCharArrayDetector<T>::length == 0) {
             rtl_uString_new(&pData);
         } else {
             rtl_uString_newFromLiteral(
commit bd4964c57def05936dae00de3e4615eaf9f51cfd
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Apr 26 11:25:11 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Apr 29 09:29:35 2024 +0200

    WaE: C6387 'pEncodingName' could be 0
    
    Change-Id: I3ff5050a88d8e5ae6c6581189597231d49e0f96a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166733
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index e7538813cfdd..a85ba7097b66 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -933,7 +933,7 @@ void SfxObjectShell::DetectCharSet(SvStream& stream, 
rtl_TextEncoding& eCharSet,
     if (U_SUCCESS(uerr))
         pEncodingName = ucsdet_getName(match, &uerr);
 
-    if (U_SUCCESS(uerr))
+    if (U_SUCCESS(uerr) && pEncodingName)
     {
         const auto it = mapCharSets.find(pEncodingName);
         if (it != mapCharSets.end())

Reply via email to