sw/source/filter/ww8/rtfexport.cxx |   37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

New commits:
commit 8cd2a372e3867f99b397b9ec089d6e1f7efd1088
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Sun Jun 21 10:48:09 2015 +0200

    Use more proper integer types
    
    Change-Id: I33bbe7bf21a0758b9f59d78c8e2a32936f845eac

diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index ac6f2f6..8fec63d 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1113,7 +1113,7 @@ sal_uInt16 RtfExport::GetRedline(const OUString& rAuthor)
     if (i != m_aRedlineTable.end())
         return i->second;
 
-    int nId = m_aRedlineTable.size();
+    const sal_uInt16 nId = static_cast<sal_uInt16>(m_aRedlineTable.size());
     m_aRedlineTable.insert(std::pair<OUString,sal_uInt16>(rAuthor,nId));
     return nId;
 }
commit 61609a62a975e105345fcfbe64c7edff551ee1b3
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Sun Jun 21 10:44:34 2015 +0200

    Remove else after return
    
    Change-Id: I95ed091165e3e60d1b162ec6ddca9dda43f8c439

diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 7a2849d..ac6f2f6 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -835,8 +835,8 @@ SvStream& RtfExport::Strm()
 {
     if (m_pStream)
         return *m_pStream;
-    else
-        return m_pWriter->Strm();
+
+    return m_pWriter->Strm();
 }
 
 void RtfExport::setStream()
@@ -911,10 +911,12 @@ void RtfExport::InsColor(const Color& rCol)
     sal_uInt16 n;
     bool bAutoColorInTable = false;
     for (RtfColorTable::iterator it=m_aColTable.begin() ; it != 
m_aColTable.end(); ++it)
+    {
         if ((*it).second == rCol)
             return; // Already in the table
-        else if ((*it).second == COL_AUTO)
+        if ((*it).second == COL_AUTO)
             bAutoColorInTable = true;
+    }
     if (rCol.GetColor() == COL_AUTO)
         // COL_AUTO gets value 0
         n = 0;
@@ -1110,12 +1112,10 @@ sal_uInt16 RtfExport::GetRedline(const OUString& 
rAuthor)
     std::map<OUString,sal_uInt16>::iterator i = m_aRedlineTable.find(rAuthor);
     if (i != m_aRedlineTable.end())
         return i->second;
-    else
-    {
-        int nId = m_aRedlineTable.size();
-        m_aRedlineTable.insert(std::pair<OUString,sal_uInt16>(rAuthor,nId));
-        return nId;
-    }
+
+    int nId = m_aRedlineTable.size();
+    m_aRedlineTable.insert(std::pair<OUString,sal_uInt16>(rAuthor,nId));
+    return nId;
 }
 
 const OUString* RtfExport::GetRedline(sal_uInt16 nId)
commit 11d19a5e35891409da7b9c65c56f26f7d5ae5ad0
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Sun Jun 21 09:54:14 2015 +0200

    Handle special case outside of for loop
    
    Change-Id: I40abac65c4d015157bf0fbc58e78fd16a4adc764

diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 45dc232..7a2849d 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -204,18 +204,15 @@ void RtfExport::BuildNumbering()
 {
     const SwNumRuleTable& rListTable = m_pDoc->GetNumRuleTable();
 
-    for (sal_uInt16 n = rListTable.size()+1; n;)
+    SwNumRule* pOutlineRule = m_pDoc->GetOutlineNumRule();
+    if (IsExportNumRule(*pOutlineRule))
+        GetId(*pOutlineRule);
+
+    for (auto n = rListTable.size(); n;)
     {
-        SwNumRule* pRule;
-        --n;
-        if (n == rListTable.size())
-            pRule = m_pDoc->GetOutlineNumRule();
-        else
-        {
-            pRule = rListTable[ n ];
-            if (!SwDoc::IsUsed(*pRule))
-                continue;
-        }
+        SwNumRule* pRule = rListTable[ --n ];
+        if (!SwDoc::IsUsed(*pRule))
+            continue;
 
         if (IsExportNumRule(*pRule))
             GetId(*pRule);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to