chart2/source/controller/main/ControllerCommandDispatch.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e8a72beea47d583dd5c6c7f7b271594839c3e877
Author:     Justin Luth <[email protected]>
AuthorDate: Fri Jun 27 17:14:56 2025 -0400
Commit:     Justin Luth <[email protected]>
CommitDate: Sat Jun 28 14:26:51 2025 +0200

    fix build: chart2 -Werror=maybe-uninitialized
    
    Not sure why only I'm picking this up on Ubuntu 24.04
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    
    chart2/source/controller/main/ControllerCommandDispatch.cxx:786:49:
    error: ‘nFontWeight’ may be used uninitialized
    [-Werror=maybe-uninitialized]
      786 |                 bool bFontWeight = (nFontWeight > 100.0);
          |                                    ~~~~~~~~~~~~~^~~~~~~~
    libreoffice/chart2/source/controller/main/
    ControllerCommandDispatch.cxx:784:23:
    note: ‘nFontWeight’ was declared here
      784 |                 float nFontWeight;
    
    Added with commit 1160d5b29a9cdae5ec6126663e888b8e5c76aba4
    Author: Attila Szűcs on Thu Apr 24 11:13:08 2025 +0200
        Chart Font sidebar panel
    and commited on May 8.
    
    I'm sure I sucessfully compiled on this machine since May 8,
    but just now I did a make clean and hit this warning.
    I added to autogen.input: --with-distro=LibreOfficeFlatpak
    
    Anyway, now it compiles for me.
    
    Change-Id: I32cd286cdaa607bc4062e9238e9983fd8713f67c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187125
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>

diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx 
b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 9b1dce5ff6d5..e6abe080a655 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -781,7 +781,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
             aPropName = u"CharWeight"_ustr;
             if (lcl_arePropertiesSame(xProperties, aPropName))
             {
-                float nFontWeight;
+                float nFontWeight(0.0);
                 xProperties[0]->getPropertyValue(aPropName) >>= nFontWeight;
                 bool bFontWeight = (nFontWeight > 100.0);
                 m_aCommandArguments[u".uno:Bold"_ustr] <<= bFontWeight;
@@ -799,7 +799,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
             aPropName = u"CharStrikeout"_ustr;
             if (lcl_arePropertiesSame(xProperties, aPropName))
             {
-                sal_Int16 nFontStrikeout;
+                sal_Int16 nFontStrikeout(0);
                 xProperties[0]->getPropertyValue(aPropName) >>= nFontStrikeout;
                 bool bFontStrikeout = (nFontStrikeout > 0);
                 m_aCommandArguments[u".uno:Strikeout"_ustr] <<= bFontStrikeout;
@@ -808,7 +808,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
             aPropName = u"CharUnderline"_ustr;
             if (lcl_arePropertiesSame(xProperties, aPropName))
             {
-                sal_Int16 nFontUnderline;
+                sal_Int16 nFontUnderline(0);
                 xProperties[0]->getPropertyValue(aPropName) >>= nFontUnderline;
                 bool bFontUnderline = (nFontUnderline > 0);
                 m_aCommandArguments[u".uno:Underline"_ustr] <<= bFontUnderline;

Reply via email to