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

Miklos Vajna vmiklos at collabora.co.uk
Tue Oct 7 04:05:30 PDT 2014


 writerfilter/source/dmapper/DomainMapper.cxx             |    6 +++---
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |    2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx        |    2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx        |    2 +-
 writerfilter/source/dmapper/PropertyMap.cxx              |   10 +++++-----
 writerfilter/source/dmapper/PropertyMap.hxx              |    2 +-
 writerfilter/source/rtftok/rtfdocumentimpl.cxx           |    4 ++--
 7 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 8ab5a090f632507802072b20660c8403bf4bfd39
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Oct 7 12:54:46 2014 +0200

    -Werror=sign-compare
    
    Change-Id: Ic96b85c5c4995f47781eceb6a426a29d8b7679ea

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index a6f76e7..515a1cd 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -537,7 +537,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
             }
             break;
         case NS_ooxml::LN_CT_PageSz_orient:
-            CT_PageSz.orient = (nIntValue != NS_ooxml::LN_Value_ST_PageOrientation_portrait);
+            CT_PageSz.orient = (nIntValue != static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_PageOrientation_portrait));
             break;
         case NS_ooxml::LN_CT_PageSz_w:
             {
@@ -864,7 +864,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                         pSectionContext->SetdxaLnn( nIntValue );
                 break;
                 case NS_ooxml::LN_CT_LineNumber_restart:
-                    aSettings.bRestartAtEachPage = nIntValue == NS_ooxml::LN_Value_ST_LineNumberRestart_newPage;
+                    aSettings.bRestartAtEachPage = nIntValue == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_LineNumberRestart_newPage);
                     OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
                     if( pSectionContext )
                         pSectionContext->SetLnc( nIntValue );
@@ -1653,7 +1653,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
                 bHasPrevSection = true;
                 nPrevBreakType = pLastContext->GetBreakType();
             }
-            if (m_pImpl->GetParaSectpr() || nIntValue != NS_ooxml::LN_Value_ST_SectionMark_continuous || (bHasPrevSection && nPrevBreakType != nIntValue))
+            if (m_pImpl->GetParaSectpr() || nIntValue != static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_continuous) || (bHasPrevSection && nPrevBreakType != nIntValue))
                 pSectionContext->SetBreakType( nIntValue );
         }
         break;
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 3fc80f8..835387d 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -809,7 +809,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
                 const boost::optional<PropertyMap::Property> aCellDirectionVal = (*aCellIterator)->getProperty(PROP_CELL_DIRECTION);
                 if (aCellDirectionVal)
                 {
-                    if (aCellDirectionVal->second.get<sal_Int32>() == NS_ooxml::LN_Value_ST_TextDirection_btLr)
+                    if (aCellDirectionVal->second.get<sal_Int32>() == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_TextDirection_btLr))
                     {
                         // btLr, so map ParagraphAdjust_CENTER to VertOrientation::CENTER.
                         uno::Reference<beans::XPropertySet> xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bec1542..1f98d0c 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4516,7 +4516,7 @@ void  DomainMapper_Impl::ImportGraphic(writerfilter::Reference< Properties >::Po
 
 
 
-void DomainMapper_Impl::SetLineNumbering( sal_Int32 nLnnMod, sal_Int32 nLnc, sal_Int32 ndxaLnn )
+void DomainMapper_Impl::SetLineNumbering( sal_Int32 nLnnMod, sal_uInt32 nLnc, sal_Int32 ndxaLnn )
 {
     if( !m_bLineNumberingSet )
     {
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 817510c..76d6c57 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -680,7 +680,7 @@ public:
             m_aTableManagers.pop( );
     }
 
-    void SetLineNumbering( sal_Int32 nLnnMod, sal_Int32 nLnc, sal_Int32 ndxaLnn );
+    void SetLineNumbering( sal_Int32 nLnnMod, sal_uInt32 nLnc, sal_Int32 ndxaLnn );
     bool IsLineNumberingSet() const {return m_bLineNumberingSet;}
 
     DeletableTabStop                m_aCurrentTabStop;
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index a91f035..b28638e 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1074,7 +1074,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
     // depending on the break type no page styles should be created
     // If the section type is missing, but we have columns, then this should be
     // handled as a continuous section break.
-    if(m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_continuous || (m_nBreakType == -1 && m_nColumnCount > 0))
+    if(m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_continuous) || (m_nBreakType == -1 && m_nColumnCount > 0))
     {
         //todo: insert a section or access the already inserted section
         uno::Reference< beans::XPropertySet > xSection =
@@ -1105,7 +1105,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
     // If the section is of type "New column" (0x01), then simply insert a column break.
     // But only if there actually are columns on the page, otherwise a column break
     // seems to be handled like a page break by MSO.
-    else if(m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_nextColumn && m_nColumnCount > 0 )
+    else if(m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_nextColumn) && m_nColumnCount > 0 )
     {
         uno::Reference< beans::XPropertySet > xRangeProperties;
         if( m_xStartingRange.is() )
@@ -1252,7 +1252,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
                 // Handle page breaks with odd/even page numbering. We need to use an extra page style for setting the page style
                 // to left/right, because if we set it to the normal style, we'd set it to "First Page"/"Default Style", which would
                 // break them (all default pages would be only left or right).
-                if (m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_evenPage || m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_oddPage)
+                if (m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_evenPage) || m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_oddPage))
                 {
                     OUString* pageStyle = m_bTitlePage ? &m_sFirstPageStyleName : &m_sFollowPageStyleName;
                     OUString evenOddStyleName = lcl_FindUnusedPageStyleName(rDM_Impl.GetPageStyles()->getElementNames());
@@ -1274,9 +1274,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
                     evenOddStyle->setPropertyValue("FooterIsOn", uno::makeAny(sal_False));
                     CopyHeaderFooter( pageProperties, evenOddStyle );
                     *pageStyle = evenOddStyleName; // And use it instead of the original one (which is set as follow of this one).
-                    if (m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_evenPage)
+                    if (m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_evenPage))
                         evenOddStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_PAGE_STYLE_LAYOUT), uno::makeAny(style::PageStyleLayout_LEFT));
-                    else if (m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_oddPage)
+                    else if (m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_oddPage))
                         evenOddStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_PAGE_STYLE_LAYOUT), uno::makeAny(style::PageStyleLayout_RIGHT));
                 }
 
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index dd6d2a7..339f740 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -236,7 +236,7 @@ class SectionPropertyMap : public PropertyMap
 
     //line numbering
     sal_Int32                               m_nLnnMod;
-    sal_Int32                               m_nLnc;
+    sal_uInt32                              m_nLnc;
     sal_Int32                               m_ndxaLnn;
     sal_Int32                               m_nLnnMin;
 
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 8dd76c7..1c07fb8 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -585,7 +585,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
     SAL_INFO("writerfilter", OSL_THIS_FUNC << ": final? " << bFinal << ", needed? " << m_bNeedSect);
     bool bNeedSect = m_bNeedSect;
     RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type);
-    bool bContinuous = pBreak.get() && pBreak->getInt() == NS_ooxml::LN_Value_ST_SectionMark_continuous;
+    bool bContinuous = pBreak.get() && pBreak->getInt() == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_continuous);
     // If there is no paragraph in this section, then insert a dummy one, as required by Writer,
     // unless this is the end of the doc, we had nothing since the last section break and this is not a continuous one.
     if (m_bNeedPar && !(bFinal && !m_bNeedSect && !bContinuous) && !isSubstream())
@@ -2329,7 +2329,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
         RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type);
         // Unless we're on a title page.
         RTFValue::Pointer_t pTitlePg = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_titlePg);
-        if (((pBreak.get() && pBreak->getInt() == NS_ooxml::LN_Value_ST_SectionMark_continuous)
+        if (((pBreak.get() && pBreak->getInt() == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_continuous))
                 || m_nResetBreakOnSectBreak == RTF_SBKNONE)
                 && !(pTitlePg.get() && pTitlePg->getInt()))
         {


More information about the Libreoffice-commits mailing list