[Libreoffice-commits] .: 5 commits - sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Jan 6 06:56:32 PST 2011


 sw/source/core/SwNumberTree/SwNodeNum.cxx |    2 -
 sw/source/filter/ww8/WW8TableInfo.cxx     |   22 +++++++--------
 sw/source/filter/ww8/rtfexport.cxx        |    4 +-
 sw/source/filter/ww8/ww8scan.cxx          |   16 +++++++++++
 sw/source/ui/docvw/PostItMgr.cxx          |   42 +++++++++++++++---------------
 5 files changed, 51 insertions(+), 35 deletions(-)

New commits:
commit c96651f17eb2bbdf54f9dd453cb2fbda343f6fe5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 6 14:12:01 2011 +0000

    cppunit: prefer prefix variant

diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index 73c19f2..dcb9490 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -229,7 +229,7 @@ bool SwNodeNum::HasCountedChildren() const
 
     tSwNumberTreeChildren::iterator aIt;
 
-    for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
+    for (aIt = mChildren.begin(); aIt != mChildren.end(); ++aIt)
     {
         SwNodeNum* pChild( dynamic_cast<SwNodeNum*>(*aIt) );
         OSL_ENSURE( pChild,
commit 97c9dc815396773f01ffed8f707fc74f3e0c882c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 6 14:06:07 2011 +0000

    cppunit: prefer prefix variant

diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 021e429..e06d558 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -155,7 +155,7 @@ SwPostItMgr::~SwPostItMgr()
     RemoveSidebarWin();
     EndListening( *mpView->GetDocShell() );
 
-    for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; i++)
+    for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; ++i)
         delete (*i);
     mPages.clear();
 
@@ -202,7 +202,7 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b
 {
     if (bCheckExistance)
     {
-        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
         {
             if ( (*i)->GetBroadCaster() == pItem )
                 return;
@@ -218,7 +218,7 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b
 void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
 {
     EndListening(*pBroadcast);
-    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
     {
         if ( (*i)->GetBroadCaster() == pBroadcast )
         {
@@ -343,7 +343,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
             case SWFMTFLD_CHANGED:
             {
                         SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC);
-                for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+                for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
                 {
                             if ( pFmtFld == (*i)->GetBroadCaster() )
                     {
@@ -360,7 +360,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
             case SWFMTFLD_LANGUAGE:
             {
                         SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC);
-                for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+                for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
                 {
                                 if ( pFmtFld == (*i)->GetBroadCaster() )
                     {
@@ -394,7 +394,7 @@ void SwPostItMgr::Focus(SfxBroadcaster& rBC)
         mpView->ExecViewOptions(aRequest);
     }
 
-    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
     {
         // field to get the focus is the broadcaster
         if ( &rBC == (*i)->GetBroadCaster() )
@@ -428,7 +428,7 @@ bool SwPostItMgr::CalcRects()
     PreparePageContainer();
     if ( !mvPostItFlds.empty() )
     {
-        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
         {
             SwSidebarItem* pItem = (*i);
             if ( !pItem->UseElement() )
@@ -460,7 +460,7 @@ bool SwPostItMgr::CalcRects()
         Sort(SORT_POS);
 
         // sort the items into the right page vector, so layout can be done by page
-        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
         {
             SwSidebarItem* pItem = (*i);
             if( SwPostItHelper::INVISIBLE == pItem->mLayoutStatus )
@@ -518,7 +518,7 @@ bool SwPostItMgr::CalcRects()
 
 bool SwPostItMgr::HasScrollbars() const
 {
-    for(std::list<SwSidebarItem*>::const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(std::list<SwSidebarItem*>::const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
     {
         if ((*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->HasScrollbar())
             return true;
@@ -547,7 +547,7 @@ void SwPostItMgr::PreparePageContainer()
         }
     }
     // only clear the list, DO NOT delete the objects itself
-    for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; i++)
+    for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; ++i)
     {
         (*i)->mList->clear();
         if (mvPostItFlds.empty())
@@ -1135,7 +1135,7 @@ void SwPostItMgr::RemoveSidebarWin()
 {
     if (!mvPostItFlds.empty())
     {
-        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
         {
             EndListening( *((*i)->GetBroadCaster()) );
             if ((*i)->pPostIt)
@@ -1167,12 +1167,12 @@ void SwPostItMgr::Delete(String aAuthor)
 
     std::vector<SwFmtFld*> aTmp;
     aTmp.reserve( mvPostItFlds.size() );
-    for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; pPostIt++)
+    for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; ++pPostIt)
     {
         if ((*pPostIt)->GetFmtFld() && ((*pPostIt)->pPostIt->GetAuthor() == aAuthor) )
             aTmp.push_back( (*pPostIt)->GetFmtFld() );
     }
-    for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; i++)
+    for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; ++i)
     {
         mpWrtShell->GotoField( *(*i) );
         mpWrtShell->DelRight();
@@ -1195,12 +1195,12 @@ void SwPostItMgr::Delete()
 
     std::vector<SwFmtFld*> aTmp;
     aTmp.reserve( mvPostItFlds.size() );
-    for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; pPostIt++)
+    for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; ++pPostIt)
     {
         if ((*pPostIt)->GetFmtFld())
             aTmp.push_back( (*pPostIt)->GetFmtFld() );
     }
-    for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; i++)
+    for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; ++i)
     {
         mpWrtShell->GotoField( *(*i) );
         mpWrtShell->DelRight();
@@ -1261,7 +1261,7 @@ void SwPostItMgr::Sort(const short aType)
 
 SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) const
 {
-    for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
     {
         if ( (*i)->GetBroadCaster() == pBroadcaster)
             return (*i)->pPostIt;
@@ -1271,7 +1271,7 @@ SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) co
 
 sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItField* pFld) const
 {
-    for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
     {
         if ( (*i)->GetFmtFld() && ((*i)->GetFmtFld()->GetFld() == pFld))
             return dynamic_cast<sw::annotation::SwAnnotationWin*>((*i)->pPostIt);
@@ -1678,7 +1678,7 @@ IMPL_LINK( SwPostItMgr, CalcHdl, void*, /* pVoid*/  )
 
 void SwPostItMgr::Rescale()
 {
-    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
         if ( (*i)->pPostIt )
             (*i)->pPostIt->Rescale();
 }
@@ -1715,21 +1715,21 @@ sal_Int32 SwPostItMgr::GetSidebarScrollerHeight() const
 
 void SwPostItMgr::SetSpellChecking()
 {
-    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
         if ( (*i)->pPostIt )
             (*i)->pPostIt->SetSpellChecking();
 }
 
 void SwPostItMgr::SetReadOnlyState()
 {
-    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+    for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
         if ( (*i)->pPostIt )
             (*i)->pPostIt->SetReadonly( mbReadOnly );
 }
 
 void SwPostItMgr::CheckMetaText()
 {
-        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+        for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
                 if ( (*i)->pPostIt )
                        (*i)->pPostIt->CheckMetaText();
 
commit 6f8cbb85a472f2b2f802944cebf03aa2eb037d14
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 6 14:00:41 2011 +0000

    cppunit: prefer prefix variant

diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 8f2761a..b7be4bc 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -223,7 +223,7 @@ GridColsPtr WW8TableNodeInfoInner::getGridColsOfRow(AttributeOutputBase & rBase)
     Widths::const_iterator aWidthsEnd = pWidths->end();    
     for ( Widths::const_iterator aIt = pWidths->begin(); 
           aIt != aWidthsEnd; 
-          aIt++)
+          ++aIt)
     {
         nSz += *aIt;
         SwTwips nCalc = nSz;
@@ -1149,7 +1149,7 @@ void WW8TableCellGrid::addShadowCells()
             if (bBeginningOfCell)
             {
                 RowTops_t::const_iterator aRowSpanIt(aTopsIt);
-                aRowSpanIt++;                
+                ++aRowSpanIt;
             
                 if (aRowSpanIt != getRowTopsEnd() && 
                     *aRowSpanIt < aCellIt->bottom())
@@ -1167,7 +1167,7 @@ void WW8TableCellGrid::addShadowCells()
                 while (aRowSpanIt != getRowTopsEnd() && 
                        *aRowSpanIt < aCellIt->bottom())
                 {
-                    aRowSpanIt++;
+                    ++aRowSpanIt;
                     nRowSpan++;
                 }
                 
@@ -1182,7 +1182,7 @@ void WW8TableCellGrid::addShadowCells()
                 pNodeInfo->setVertMerge(bVertMerge);
             }
 
-            aCellIt++;
+            ++aCellIt;
             
             bBeginningOfCell = (aRect.Left() != aCellIt->left());
             aRect = aCellIt->getRect();
@@ -1192,7 +1192,7 @@ void WW8TableCellGrid::addShadowCells()
         if (pRow.get() != NULL)
             pRow->setRowSpans(pRowSpans);
 
-        aTopsIt++;
+        ++aTopsIt;
     }
 #ifdef DEBUG
     ::std::clog << "</addShadowCells>" << ::std::endl;
@@ -1268,7 +1268,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells()
                     pTableBoxes->push_back(NULL);
             }
 
-            aCellIt++;
+            ++aCellIt;
             bBeginningOfCell = false;
 
             if (aCellIt != aCellEndIt && aCellIt->left() != nCellX)
@@ -1301,7 +1301,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells()
 
         nShadows = 0;
 
-        aTopsIt++;
+        ++aTopsIt;
         nRow++;
     }
 
@@ -1335,7 +1335,7 @@ string WW8TableCellGrid::toString()
                 sResult += "<shadow/>\n";
 
             sResult += "</cellInfo>\n";
-            aCellIt++;
+            ++aCellIt;
         }
 
         WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt);
@@ -1347,7 +1347,7 @@ string WW8TableCellGrid::toString()
             Widths::const_iterator aItEnd = pWidths->end();
             for (Widths::const_iterator aIt = pWidths->begin();
                  aIt != aItEnd;
-                 aIt++)
+                 ++aIt)
             {
                 if (aIt != pWidths->begin())
                     sResult += ", ";
@@ -1367,7 +1367,7 @@ string WW8TableCellGrid::toString()
             RowSpans::const_iterator aItEnd = pRowSpans->end();
             for (RowSpans::const_iterator aIt = pRowSpans->begin();
                  aIt != aItEnd;
-                 aIt++)
+                 ++aIt)
             {
                 if (aIt != pRowSpans->begin())
                     sResult += ", ";
@@ -1380,7 +1380,7 @@ string WW8TableCellGrid::toString()
         }
 
         sResult += "</row>\n";
-        aTopsIt++;
+        ++aTopsIt;
     }
 
     sResult += "</WW8TableCellGrid>\n";
commit bf84fd275c5a8e7ef775a40ff4b9c22ea522e1c6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 6 13:43:12 2011 +0000

    cppunit: prefer prefix variant

diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 9025a7e..efcbe47 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -965,7 +965,7 @@ void RtfExport::OutDateTime(const sal_Char* pStr, const util::DateTime& rDT )
 
 USHORT RtfExport::GetColor( const Color& rColor ) const
 {
-    for (RtfColorTbl::const_iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ )
+    for (RtfColorTbl::const_iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); ++it )
         if ((*it).second == rColor) {
             OSL_TRACE("%s returning %d (%d,%d,%d)", OSL_THIS_FUNC, (*it).first, rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue());
             return (*it).first;
@@ -978,7 +978,7 @@ void RtfExport::InsColor( const Color& rCol )
 {
     USHORT n;
     bool bContainsAuto = false;
-    for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ )
+    for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); ++it )
         if ((*it).second == rCol)
             return; // Already in the table
         else if ((*it).second == COL_AUTO)
commit 02d6c4590dc0854ef676662750fb09e8aa3dd725
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 6 11:42:22 2011 +0000

    add a bit of documentation about confusion around word 2 and word 5

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index b1e0351..e05eb2e 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -5211,6 +5211,22 @@ WW8_CP WW8Fib::GetBaseCp(ManTypes nType) const
 ww::WordVersion WW8Fib::GetFIBVersion() const
 {
     ww::WordVersion eVer = ww::eWW8;
+    /*
+     * Word for Windows 2 I think (1.X might work too if anyone has an example.
+     * Various pages claim that the fileformats of Word 1 and 2 for Windows are
+     * equivalent to Word for Macintosh 4 and 5. On the other hand
+     *
+     * wIdents for Word for Mac versions...
+     * 0xFE32 for Word 1
+     * 0xFE34 for Word 3
+     * 0xFE37 for Word 4 et 5.
+     *
+     * and this document
+     * http://cmsdoc.cern.ch/documents/docformat/CMS_CERN_LetterHead.word is
+     * claimed to be "Word 5 for Mac" by Office etc and has that wIdent, but
+     * its format isn't the same as that of Word 2 for windows. Nor is it
+     * the same as that of Word for DOS/PCWord 5
+     */
     if (wIdent == 0xa5db)
         eVer = ww::eWW2;
     else


More information about the Libreoffice-commits mailing list