[Libreoffice-commits] .: 2 commits - binfilter/bf_sw

Joseph Powers jpowers at kemper.freedesktop.org
Tue Jan 11 21:01:36 PST 2011


 binfilter/bf_sw/source/filter/xml/sw_xmlexp.cxx  |   46 +++++++++++------------
 binfilter/bf_sw/source/filter/xml/sw_xmlfmte.cxx |   12 +++---
 binfilter/bf_sw/source/filter/xml/sw_xmltble.cxx |   37 +++++++++---------
 binfilter/bf_sw/source/filter/xml/xmlexp.hxx     |   20 +++++-----
 4 files changed, 59 insertions(+), 56 deletions(-)

New commits:
commit 041e2e6f529d630bb74e2a9b81765c4e5b2e11ed
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue Jan 11 21:01:30 2011 -0800

    Remove DECLARE_LIST( SwXMLTableLinesCache_Impl, SwXMLTableLinesPtr )

diff --git a/binfilter/bf_sw/source/filter/xml/sw_xmltble.cxx b/binfilter/bf_sw/source/filter/xml/sw_xmltble.cxx
index bfab895..22da1e2 100644
--- a/binfilter/bf_sw/source/filter/xml/sw_xmltble.cxx
+++ b/binfilter/bf_sw/source/filter/xml/sw_xmltble.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -83,6 +83,7 @@
 #include "xmltexte.hxx"
 #include "xmlexp.hxx"
 #include <bf_sw/swrect.hxx>
+
 namespace binfilter {
 
 
@@ -224,7 +225,6 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) :
 }
 
 typedef SwXMLTableLines_Impl *SwXMLTableLinesPtr;
-DECLARE_LIST( SwXMLTableLinesCache_Impl, SwXMLTableLinesPtr )
 
 // ---------------------------------------------------------------------
 
@@ -449,7 +449,7 @@ sal_Bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt,
         {
             if( pNumFmt )
                 continue;
-            
+
         }
 
         if( pVertOrient &&
@@ -567,8 +567,8 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
     SwXMLTableLines_Impl *pLines =
         new SwXMLTableLines_Impl( rLines );
     if( !pTableLines )
-        pTableLines = new SwXMLTableLinesCache_Impl( 5, 5 );
-    pTableLines->Insert( pLines, pTableLines->Count() );
+        pTableLines = new SwXMLTableLinesCache_Impl();
+    pTableLines->push_back( pLines );
 
     OUStringBuffer sBuffer( rNamePrefix.getLength() + 8L );
 
@@ -666,8 +666,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
             // Und ihren Index
             sal_uInt16 nOldCol = nCol;
             SwXMLTableColumn_Impl aCol( nCPos );
-            sal_Bool bFound = pLines->GetColumns().Seek_Entry( &aCol, &nCol );
-            ASSERT( bFound, "couldn't find column" );
+            ASSERT( pLines->GetColumns().Seek_Entry( &aCol, &nCol ), "couldn't find column" );
 
             const SwStartNode *pBoxSttNd = pBox->GetSttNd();
             if( pBoxSttNd )
@@ -677,7 +676,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
                                        bTop) )
                     ExportFmt( *pFrmFmt, XML_TABLE_CELL );
 
-                Reference < XCell > xCell = SwXCell::CreateXCell( 
+                Reference < XCell > xCell = SwXCell::CreateXCell(
                                                 (SwFrmFmt *)rTblInfo.GetTblFmt(),
                                                   pBox, 0,
                                                  (SwTable *)rTblInfo.GetTable() );
@@ -813,7 +812,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, sal_uInt16 nColSpan,
                                                         UNO_QUERY);
                 if (xCellPropertySet.is())
                 {
-                    sal_Int32 nNumberFormat;
+                    sal_Int32 nNumberFormat(0);
                     Any aAny = xCellPropertySet->getPropertyValue(sNumberFormat);
                     aAny >>= nNumberFormat;
 
@@ -917,8 +916,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine,
             // Und ihren Index
             sal_uInt16 nOldCol = nCol;
             SwXMLTableColumn_Impl aCol( nCPos );
-            sal_Bool bFound = rLines.GetColumns().Seek_Entry( &aCol, &nCol );
-            ASSERT( bFound, "couldn't find column" );
+            ASSERT( rLines.GetColumns().Seek_Entry( &aCol, &nCol ), "couldn't find column" );
 
             sal_uInt16 nColSpan = nCol - nOldCol + 1U;
             ExportTableBox( *pBox, nColSpan, rTblInfo );
@@ -940,16 +938,16 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines,
 {
     ASSERT( pTableLines && pTableLines->Count(),
             "SwXMLExport::ExportTableLines: table columns infos missing" );
-    if( !pTableLines || 0 == pTableLines->Count() )
+    if( !pTableLines || pTableLines->empty() )
         return;
 
     SwXMLTableLines_Impl *pLines = 0;
-    sal_uInt16 nInfoPos;
-    for( nInfoPos=0; nInfoPos < pTableLines->Count(); nInfoPos++ )
+    size_t nInfoPos;
+    for( nInfoPos=0; nInfoPos < pTableLines->size(); nInfoPos++ )
     {
-        if( pTableLines->GetObject( nInfoPos )->GetLines() == &rLines )
+        if( (*pTableLines)[ nInfoPos ]->GetLines() == &rLines )
         {
-            pLines = pTableLines->GetObject( nInfoPos );
+            pLines = (*pTableLines)[  nInfoPos ];
             break;
         }
     }
@@ -960,8 +958,11 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines,
     if( !pLines )
         return;
 
-    pTableLines->Remove( nInfoPos );
-    if( 0 == pTableLines->Count() )
+    SwXMLTableLinesCache_Impl::iterator it = pTableLines->begin();
+    ::std::advance( it, nInfoPos );
+    pTableLines->erase( it );
+
+    if( pTableLines->empty() )
     {
         delete pTableLines ;
         pTableLines = 0;
diff --git a/binfilter/bf_sw/source/filter/xml/xmlexp.hxx b/binfilter/bf_sw/source/filter/xml/xmlexp.hxx
index 675d726..b7ea00d 100644
--- a/binfilter/bf_sw/source/filter/xml/xmlexp.hxx
+++ b/binfilter/bf_sw/source/filter/xml/xmlexp.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -34,14 +34,16 @@
 #include "xmlitmap.hxx"
 #include <bf_xmloff/uniref.hxx>
 #include <bf_xmloff/xmltoken.hxx>
+#include <vector>
+
 namespace binfilter {
 
 class SwPaM;
 class SwFmt;
 class SwFrmFmt;
-class SvXMLUnitConverter; 
-class SvXMLAutoStylePoolP; 
-class XMLPropertySetMapper; 
+class SvXMLUnitConverter;
+class SvXMLAutoStylePoolP;
+class XMLPropertySetMapper;
 
 class SvXMLExportItemMapper;
 
@@ -50,12 +52,12 @@ class SwTableLines;
 class SwTableBox;
 class SwXMLTableColumn_Impl;
 class SwXMLTableLines_Impl;
-class SwXMLTableLinesCache_Impl;
 class SwXMLTableColumnsSortByWidth_Impl;
 class SwXMLTableFrmFmtsSort_Impl;
 class SwXMLTableInfo_Impl;
 class SwTableNode;
 
+typedef ::std::vector< SwXMLTableLines_Impl* > SwXMLTableLinesCache_Impl;
 
 #ifndef XML_PROGRESS_REF_NOT_SET
 #define XML_PROGRESS_REF_NOT_SET ((sal_Int32)-1)
@@ -148,14 +150,14 @@ public:
 
 #ifdef XML_CORE_API
     // #110680#
-    SwXMLExport( 
+    SwXMLExport(
         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel,
-        SwPaM& rPaM, 
+        SwPaM& rPaM,
         const ::rtl::OUString& rFileName,
         const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
         const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > &,
-        sal_Bool bExpWholeDoc, 
+        sal_Bool bExpWholeDoc,
         sal_Bool bExpFirstTableOnly,
         sal_Bool bShowProgr );
 #endif
@@ -185,7 +187,7 @@ public:
     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
 
     // XServiceInfo (override parent method)
-    ::rtl::OUString SAL_CALL getImplementationName() 
+    ::rtl::OUString SAL_CALL getImplementationName()
         throw( ::com::sun::star::uno::RuntimeException );
 };
 
commit ba1c01c2a5fdd6377b485c94984d8277435a7a6c
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue Jan 11 21:01:00 2011 -0800

    Cleanup Whitespace & Quite Warnings

diff --git a/binfilter/bf_sw/source/filter/xml/sw_xmlexp.cxx b/binfilter/bf_sw/source/filter/xml/sw_xmlexp.cxx
index a0d4b34..c7d04e1 100644
--- a/binfilter/bf_sw/source/filter/xml/sw_xmlexp.cxx
+++ b/binfilter/bf_sw/source/filter/xml/sw_xmlexp.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -89,7 +89,7 @@
 // for locking SolarMutex: svapp + mutex
 #include <vcl/svapp.hxx>
 #include <osl/mutex.hxx>
-#include <legacysmgr/legacy_binfilters_smgr.hxx>	//STRIP002 
+#include <legacysmgr/legacy_binfilters_smgr.hxx>	//STRIP002
 
 #include <bf_svx/xdef.hxx>
 
@@ -123,7 +123,7 @@ void SwXMLExport::SetCurPaM( SwPaM& rPaM, sal_Bool bWhole, sal_Bool bTabOnly )
         *pCurPaM->GetPoint() = *rPaM.Start();
         *pCurPaM->GetMark() = *rPaM.End();
     }
-    
+
     // Set PaM to table/section start node if whole doc should be exported
     if( bWhole )
     {
@@ -151,7 +151,7 @@ void SwXMLExport::SetCurPaM( SwPaM& rPaM, sal_Bool bWhole, sal_Bool bTabOnly )
 // #110680#
 SwXMLExport::SwXMLExport(
     const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
-    sal_uInt16 nExportFlags) 
+    sal_uInt16 nExportFlags)
 :	SvXMLExport( xServiceFactory, MAP_INCH, XML_TEXT, nExportFlags ),
 #ifdef XML_CORE_API
     pCurPaM( 0 ),
@@ -174,15 +174,15 @@ SwXMLExport::SwXMLExport(
 
 #ifdef XML_CORE_API
 // #110680#
-SwXMLExport::SwXMLExport( 
+SwXMLExport::SwXMLExport(
     const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
-    const Reference< XModel >& rModel, 
+    const Reference< XModel >& rModel,
     SwPaM& rPaM,
     const OUString& rFileName,
     const Reference< XDocumentHandler > & rHandler,
     const Reference< XGraphicObjectResolver > & rEmbeddedGrfObjs,
     sal_Bool bExpWholeDoc, sal_Bool bExpFirstTableOnly,
-    sal_Bool bShowProg ) 
+    sal_Bool bShowProg )
 :	SvXMLExport( xServiceFactory, rFileName, rHandler, rModel, rEmbeddedGrfObjs,
                  SW_MOD()->GetMetric( rPaM.GetDoc()->IsHTMLMode() ) ),
     pCurPaM( 0 ),
@@ -252,7 +252,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
             {
                 if( 0 != (pItem = rPool.GetItem( nWhichId , i ) ) )
                 {
-                    const SvXMLAttrContainerItem *pUnknown = 
+                    const SvXMLAttrContainerItem *pUnknown =
                                 PTR_CAST( SvXMLAttrContainerItem, pItem );
                     ASSERT( pUnknown, "illegal attribute container item" );
                     if( pUnknown && (pUnknown->GetAttrCount() > 0) )
@@ -315,9 +315,9 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
             if( aDocStat.bModified )
                 pDoc->UpdateDocStat( aDocStat );
 
-            // count each item once, and then multiply by two to reach the 
+            // count each item once, and then multiply by two to reach the
             // figures given above
-            // The styles in pDoc also count the default style that never 
+            // The styles in pDoc also count the default style that never
             // gets exported -> subtract one.
             sal_Int32 nRef = 1;
             nRef += pDoc->GetCharFmts()->Count() - 1;
@@ -376,7 +376,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
 
     // set redline mode if we export STYLES or CONTENT, unless redline
     // mode is taken care of outside (through info XPropertySet)
-    sal_Bool bSaveRedline = 
+    sal_Bool bSaveRedline =
         ( (getExportFlags() & (EXPORT_CONTENT|EXPORT_STYLES)) != 0 );
     if( bSaveRedline )
     {
@@ -397,7 +397,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
     {
         // now save and switch redline mode
         nRedlineMode = pDoc->GetRedlineMode();
-        pDoc->SetRedlineMode( 
+        pDoc->SetRedlineMode(
             ( nRedlineMode & REDLINE_SHOW_MASK ) | REDLINE_INSERT );
     }
 
@@ -408,7 +408,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
     {
         pDoc->SetRedlineMode( nRedlineMode );
     }
-    
+
 
     if( pGraphicResolver )
         SvXMLGraphicHelper::Destroy( pGraphicResolver );
@@ -559,7 +559,7 @@ void SwXMLExport::GetConfigurationSettings( Sequence < PropertyValue >& rProps)
         Reference< XPropertySet > xProps( xFac->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), UNO_QUERY );
         if( xProps.is() )
             SvXMLUnitConverter::convertPropertySet( rProps, xProps );
-    }	
+    }
 }
 
 void SwXMLExport::_ExportContent()
@@ -575,7 +575,7 @@ void SwXMLExport::_ExportContent()
             // #103597# prevent export of form controls which are embedded in
             // mute sections
             Reference<XIndexAccess> xIAPage( xPage, UNO_QUERY );
-            GetTextParagraphExport()->PreventExportOfControlsInMuteSections( 
+            GetTextParagraphExport()->PreventExportOfControlsInMuteSections(
                 xIAPage, GetFormExport() );
 
             Reference<XFormsSupplier> xFormSupp(xPage, UNO_QUERY);
@@ -597,7 +597,7 @@ void SwXMLExport::_ExportContent()
         Any aAny = xPropSet->getPropertyValue( sTwoDigitYear );
         aAny <<= (sal_Int16)1930;
 
-        sal_Int16 nYear;
+        sal_Int16 nYear(0);
         aAny >>= nYear;
         if (nYear != 1930 )
         {
@@ -666,10 +666,10 @@ Reference< XInterface > SAL_CALL SwXMLExportStyles_createInstance(
     throw( Exception )
 {
     // #110680#
-    //return (cppu::OWeakObject*)new SwXMLExport( 
-    //	EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES | 
+    //return (cppu::OWeakObject*)new SwXMLExport(
+    //	EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES |
     //	EXPORT_FONTDECLS );
-    return (cppu::OWeakObject*)new SwXMLExport( 
+    return (cppu::OWeakObject*)new SwXMLExport(
         rSMgr,
         EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES | EXPORT_FONTDECLS );
 }
@@ -694,11 +694,11 @@ Reference< XInterface > SAL_CALL SwXMLExportContent_createInstance(
 {
     // #110680#
     //return (cppu::OWeakObject*)new SwXMLExport(
-    //	EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS | 
+    //	EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS |
     //	EXPORT_FONTDECLS );
     return (cppu::OWeakObject*)new SwXMLExport(
         rSMgr,
-        EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS | 
+        EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS |
         EXPORT_FONTDECLS );
 }
 
@@ -769,7 +769,7 @@ sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
 
 // XServiceInfo
 // override empty method from parent class
-OUString SAL_CALL SwXMLExport::getImplementationName() 
+OUString SAL_CALL SwXMLExport::getImplementationName()
     throw(RuntimeException)
 {
     switch( getExportFlags() )
@@ -815,7 +815,7 @@ void SwXMLExport::ExportCurPaM( sal_Bool bExportWholePaM )
                                 pCurPaM->GetMark()->nContent.GetIndex() ) )
     {
         SwNode *pNd = pCurPaM->GetNode();
-        
+
         aNextNumInfo.Set( *pNd );
         ExportListChange( aPrevNumInfo, aNextNumInfo );
 
diff --git a/binfilter/bf_sw/source/filter/xml/sw_xmlfmte.cxx b/binfilter/bf_sw/source/filter/xml/sw_xmlfmte.cxx
index 56a541e..24c2959 100644
--- a/binfilter/bf_sw/source/filter/xml/sw_xmlfmte.cxx
+++ b/binfilter/bf_sw/source/filter/xml/sw_xmlfmte.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -89,7 +89,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
 
     if( eFamily != XML_TOKEN_INVALID )
         AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, eFamily );
-    
+
     // style:parent-style-name="..." (if its not the default only)
     const SwFmt* pParent = rFmt.DerivedFrom();
     // Parent-Namen nur uebernehmen, wenn kein Default
@@ -125,7 +125,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
         DBG_ASSERT(RES_FRMFMT == rFmt.Which(), "only frame format");
 
         const SfxPoolItem *pItem;
-        if( SFX_ITEM_SET == 
+        if( SFX_ITEM_SET ==
             rFmt.GetAttrSet().GetItemState( RES_BOXATR_FORMAT,
                                             sal_False, &pItem ) )
         {
@@ -140,7 +140,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
                 addDataStyle(nFormat);
                 OUString sDataStyleName = getDataStyleName(nFormat);
                 if( sDataStyleName.getLength() > 0 )
-                    AddAttribute( XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, 
+                    AddAttribute( XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME,
                                   sDataStyleName );
             }
         }
@@ -278,7 +278,7 @@ protected:
 
     virtual void exportStyleAttributes(
             SvXMLAttributeList& rAttrList,
-            sal_Int32 nFamily, 
+            sal_Int32 nFamily,
             const ::std::vector< XMLPropertyState >& rProperties,
             const SvXMLExportPropertyMapper& rPropExp
             , const SvXMLUnitConverter& rUnitConverter,
@@ -292,7 +292,7 @@ public:
 
 void SwXMLAutoStylePoolP::exportStyleAttributes(
             SvXMLAttributeList& rAttrList,
-            sal_Int32 nFamily, 
+            sal_Int32 nFamily,
             const ::std::vector< XMLPropertyState >& rProperties,
             const SvXMLExportPropertyMapper& rPropExp
             , const SvXMLUnitConverter& rUnitConverter,


More information about the Libreoffice-commits mailing list