[Libreoffice-commits] core.git: writerfilter/source

Stephan Bergmann sbergman at redhat.com
Mon Mar 3 08:05:16 PST 2014


 writerfilter/source/rtftok/rtfcontrolwords.hxx |    1 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 8899b47d2252fd1c2f58ba30558c4ec41d65e442
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Mar 3 17:02:27 2014 +0100

    -Werror,-Wtautological-constant-out-of-range-compare
    
    (If the underlying type of an unscoped enumeration is unfixed, it need not be
    signed.)
    
    Change-Id: I26a406504863512a0d3861ad8b28523b0a6dccaa

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index a29b86d..d38a0b4 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -15,6 +15,7 @@ namespace rtftok {
 
 enum RTFKeyword
 {
+    RTF_invalid = -1,
     RTF_HEXCHAR,
     RTF_OPTHYPH,
     RTF_IGNORE,
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 7464202..712690d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -280,7 +280,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
     m_aHexBuffer(),
     m_bMathNor(false),
     m_bIgnoreNextContSectBreak(false),
-    m_nResetBreakOnSectBreak(static_cast<RTFKeyword>(-1)),
+    m_nResetBreakOnSectBreak(RTF_invalid),
     m_bNeedSect(false), // done by checkFirstRun
     m_bWasInFrame(false),
     m_bHadPicture(false),
@@ -1981,10 +1981,10 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
                 else
                 {
                     sectBreak();
-                    if (m_nResetBreakOnSectBreak != -1)
+                    if (m_nResetBreakOnSectBreak != RTF_invalid)
                     {   // this should run on _second_ \sect after \page
                         dispatchSymbol(m_nResetBreakOnSectBreak); // lazy reset
-                        m_nResetBreakOnSectBreak = static_cast<RTFKeyword>(-1);
+                        m_nResetBreakOnSectBreak = RTF_invalid;
                         m_bNeedSect = false; // dispatchSymbol set it
                     }
                 }
@@ -2349,7 +2349,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
     }
     if (nParam >= 0)
     {
-        if (m_nResetBreakOnSectBreak != -1)
+        if (m_nResetBreakOnSectBreak != RTF_invalid)
         {
             m_nResetBreakOnSectBreak = nKeyword;
         }


More information about the Libreoffice-commits mailing list