[Libreoffice-commits] core.git: 3 commits - sc/source

Eike Rathke erack at redhat.com
Thu May 12 15:59:54 UTC 2016


 sc/source/ui/unoobj/textuno.cxx |    7 +++----
 sc/source/ui/view/output2.cxx   |    8 ++++----
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit e74de117e5b2fd944ac3e0dd5368315331a0d351
Author: Eike Rathke <erack at redhat.com>
Date:   Thu May 12 17:57:50 2016 +0200

    if we can't use assert() as intended then use SAL_WARN()
    
    Change-Id: I5b8d4a8054fb2cfbab2b762371e52fac73cf5e55

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 2cc4f5a..1c42dec 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2633,8 +2633,8 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine()
                 {
                     case SVX_HOR_JUSTIFY_REPEAT:            // repeat is not yet implemented
                     case SVX_HOR_JUSTIFY_STANDARD:
-                        assert(!"meHorJustResult does not match getAlignmentFromContext()");
-                        // fallthru
+                        SAL_WARN("sc.ui","meHorJustResult does not match getAlignmentFromContext()");
+                        SAL_FALLTHROUGH;
                     case SVX_HOR_JUSTIFY_LEFT:
                         eSvxAdjust = SVX_ADJUST_LEFT;
                         break;
commit c0977216d79a15dadbcf1c6805e7d50f83e0265f
Author: Eike Rathke <erack at redhat.com>
Date:   Thu May 12 17:54:30 2016 +0200

    Revert "Silence -Werror,-Wimplicit-fallthrough under NDEBUG"
    
    This reverts commit 1d54b93670ac2c40661e3890ecea987d334cba31.
    
    Calling abort() here was not the intention.

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index c4df00b..2cc4f5a 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -67,7 +67,6 @@
 #include <com/sun/star/i18n/DirectionProperty.hpp>
 #include <comphelper/string.hxx>
 
-#include <cstdlib>
 #include <memory>
 #include <vector>
 
@@ -2632,6 +2631,10 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine()
             if (meOrient == SVX_ORIENTATION_STANDARD)
                 switch (meHorJustResult)
                 {
+                    case SVX_HOR_JUSTIFY_REPEAT:            // repeat is not yet implemented
+                    case SVX_HOR_JUSTIFY_STANDARD:
+                        assert(!"meHorJustResult does not match getAlignmentFromContext()");
+                        // fallthru
                     case SVX_HOR_JUSTIFY_LEFT:
                         eSvxAdjust = SVX_ADJUST_LEFT;
                         break;
@@ -2644,9 +2647,6 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine()
                     case SVX_HOR_JUSTIFY_BLOCK:
                         eSvxAdjust = SVX_ADJUST_BLOCK;
                         break;
-                    case SVX_HOR_JUSTIFY_REPEAT: // repeat is not yet implemented
-                    case SVX_HOR_JUSTIFY_STANDARD:
-                        for (;;) std::abort(); // meHorJustResult does not match getAlignmentFromContext()
                 }
             else
                 switch (meVerJust)
commit c19e7cf433133929c38a58f1addb1fd544ebe02d
Author: Eike Rathke <erack at redhat.com>
Date:   Thu May 12 17:52:22 2016 +0200

    use SAL_WARN()
    
    Change-Id: Ic57614054a7552d778b7bcb36ba3a52865291b5c

diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index f2a9ee9..d5c73d9 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -19,8 +19,6 @@
 
 #include <sal/config.h>
 
-#include <cstdlib>
-
 #include "scitems.hxx"
 #include <editeng/eeitem.hxx>
 #include <svx/svdpool.hxx>
@@ -344,8 +342,9 @@ OUString SAL_CALL ScHeaderFooterTextObj::getString() throw(uno::RuntimeException
         case ScHeaderFooterPart::RIGHT:
             pData = rContentObj->GetRightEditObject();
         break;
-        default: //needed for compiler warning: possible uninitialized pointer
-            for (;;) std::abort();
+        default:
+            SAL_WARN("sc.ui","unexpected enum value of ScHeaderFooterPart");
+            pData = nullptr;
     }
 
     if (pData)


More information about the Libreoffice-commits mailing list