[Libreoffice-commits] .: 2 commits - .gitignore rsc/source sot/inc sot/source

Joseph Powers jpowers at kemper.freedesktop.org
Sun May 1 07:40:39 PDT 2011


 .gitignore                   |    1 
 rsc/source/parser/rsclex.cxx |    1 
 sot/inc/sot/sotdata.hxx      |    7 +++--
 sot/source/base/exchange.cxx |   52 ++++++++++++++++++++-----------------------
 sot/source/base/factory.cxx  |    5 +---
 5 files changed, 32 insertions(+), 34 deletions(-)

New commits:
commit 9439711cd07345538fef0ff07146cec8d0c30a8c
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sun May 1 06:43:02 2011 -0700

    Ignore .gitattributes

diff --git a/.gitignore b/.gitignore
index 25df106..acaf1d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 # backup and temporary files
 *~
 .*.sw[op]
+.gitattributes
 
 # the build directories
 /*/unxlng??
commit 47828f89a61ae32d6fe7723387b07843603beb87
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sun May 1 06:37:57 2011 -0700

    Convert List* to vector<>

diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index 2ca98e3..b7b7f08 100644
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -49,7 +49,6 @@
 
 #include <rtl/textcvt.h>
 #include <rtl/textenc.h>
-#include <tools/list.hxx>
 
 using ::rtl::OString;
 using ::rtl::OStringBuffer;
diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx
index 517ee3b..b85bf58 100644
--- a/sot/inc/sot/sotdata.hxx
+++ b/sot/inc/sot/sotdata.hxx
@@ -34,25 +34,26 @@
 
 #include <tools/solar.h>
 #include "sot/sotdllapi.h"
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
 #include <vector>
 
 //==================class SotData_Impl====================================
 
-class List;
 class SotFactory;
 class SotObjectList;
 
 typedef ::std::vector< SotFactory* > SotFactoryList;
+typedef ::std::vector< com::sun::star::datatransfer::DataFlavor* > tDataFlavorList;
 
 struct SotData_Impl
 {
-    sal_uInt32				nSvObjCount;
+    sal_uInt32			nSvObjCount;
     SotObjectList *		pObjectList;
     SotFactoryList *	pFactoryList;
     SotFactory *		pSotObjectFactory;
     SotFactory *		pSotStorageStreamFactory;
     SotFactory *		pSotStorageFactory;
-    List*				pDataFlavorList;
+    tDataFlavorList*    pDataFlavorList;
     SotData_Impl();
 };
 
diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 413dfd5..d61b9df 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -33,7 +33,6 @@
 #define _SOT_FORMATS_INCLUDE_SYSTEMFORMATS
 #include <tools/debug.hxx>
 #include <tools/solar.h>
-#include <tools/list.hxx>
 #include <tools/globname.hxx>
 #include <tools/string.hxx>
 #include <sot/sotdata.hxx>
@@ -42,7 +41,6 @@
 #include <sot/clsids.hxx>
 #include <rtl/instance.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/datatransfer/DataFlavor.hpp>
 #include <comphelper/documentconstants.hxx>
 
 #ifdef GetObject
@@ -229,11 +227,11 @@ namespace
 
 //-----------------------------------------------------------------------
 
-static List& InitFormats_Impl()
+static tDataFlavorList& InitFormats_Impl()
 {
     SotData_Impl * pSotData = SOTDATA();
     if( !pSotData->pDataFlavorList )
-        pSotData->pDataFlavorList = new List();
+        pSotData->pDataFlavorList = new tDataFlavorList();
     return *pSotData->pDataFlavorList;
 }
 
@@ -263,10 +261,10 @@ sal_uLong SotExchange::RegisterFormatName( const String& rName )
                      : i );
 
     // dann in der dynamischen Liste
-    List& rL = InitFormats_Impl();
-    for( i = 0, nMax = rL.Count(); i < nMax; i++ )
+    tDataFlavorList& rL = InitFormats_Impl();
+    for( i = 0, nMax = rL.size(); i < nMax; i++ )
     {
-        DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i );
+        DataFlavor* pFlavor = rL[ i ];
         if( pFlavor && rName == String( pFlavor->HumanPresentableName ) )
             return i + SOT_FORMATSTR_ID_USER_END + 1;
     }
@@ -278,7 +276,7 @@ sal_uLong SotExchange::RegisterFormatName( const String& rName )
     pNewFlavor->HumanPresentableName = rName;
     pNewFlavor->DataType = ::getCppuType( (const ::rtl::OUString*) 0 );
 
-    rL.Insert( pNewFlavor, LIST_APPEND );
+    rL.push_back( pNewFlavor );
 
     return nMax + SOT_FORMATSTR_ID_USER_END + 1;
 }
@@ -298,10 +296,10 @@ sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType )
             return i;
 
     // dann in der dynamischen Liste
-    List& rL = InitFormats_Impl();
-    for( i = 0, nMax = rL.Count(); i < nMax; i++ )
+    tDataFlavorList& rL = InitFormats_Impl();
+    for( i = 0, nMax = rL.size(); i < nMax; i++ )
     {
-        DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i );
+        DataFlavor* pFlavor = rL[ i ];
         if( pFlavor && rMimeType == String( pFlavor->MimeType ) )
             return i + SOT_FORMATSTR_ID_USER_END + 1;
     }
@@ -313,7 +311,7 @@ sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType )
     pNewFlavor->HumanPresentableName = rMimeType;
     pNewFlavor->DataType = ::getCppuType( (const ::rtl::OUString*) 0 );
 
-    rL.Insert( pNewFlavor, LIST_APPEND );
+    rL.push_back( pNewFlavor );
 
     return nMax + SOT_FORMATSTR_ID_USER_END + 1;
 }
@@ -330,9 +328,9 @@ sal_uLong SotExchange::RegisterFormat( const DataFlavor& rFlavor )
 
     if( !nRet )
     {
-        List& rL = InitFormats_Impl();
-        nRet = rL.Count() + SOT_FORMATSTR_ID_USER_END + 1;
-        rL.Insert( new DataFlavor( rFlavor ), LIST_APPEND );
+        tDataFlavorList& rL = InitFormats_Impl();
+        nRet = rL.size() + SOT_FORMATSTR_ID_USER_END + 1;
+        rL.push_back( new DataFlavor( rFlavor ) );
     }
 
     return nRet;
@@ -359,13 +357,13 @@ sal_Bool SotExchange::GetFormatDataFlavor( sal_uLong nFormat, DataFlavor& rFlavo
     }
     else
     {
-        List& rL = InitFormats_Impl();
+        tDataFlavorList& rL = InitFormats_Impl();
 
         nFormat -= SOT_FORMATSTR_ID_USER_END + 1;
 
-        if( rL.Count() > nFormat )
+        if( rL.size() > nFormat )
         {
-            rFlavor = *(DataFlavor*) rL.GetObject( nFormat );
+            rFlavor = *rL[ nFormat ];
             bRet = sal_True;
         }
         else
@@ -393,12 +391,12 @@ String SotExchange::GetFormatMimeType( sal_uLong nFormat )
         sMimeType.AssignAscii( FormatArray_Impl::get()[nFormat].pMimeType );
     else
     {
-        List& rL = InitFormats_Impl();
+        tDataFlavorList& rL = InitFormats_Impl();
 
         nFormat -= SOT_FORMATSTR_ID_USER_END + 1;
 
-        if( rL.Count() > nFormat )
-            sMimeType = ((DataFlavor*) rL.GetObject( nFormat ))->MimeType;
+        if( rL.size() > nFormat )
+            sMimeType = rL[ nFormat ]->MimeType;
     }
 
     DBG_ASSERT( sMimeType.Len(), "SotExchange::GetFormatMimeType(): DataFlavor not initialized" );
@@ -431,11 +429,11 @@ sal_uLong SotExchange::GetFormatIdFromMimeType( const String& rMimeType )
                      : i );
 
     // dann in der dynamischen Liste
-    List& rL = InitFormats_Impl();
+    tDataFlavorList& rL = InitFormats_Impl();
     ::rtl::OUString aMimeType( rMimeType );
-    for( i = 0, nMax = rL.Count(); i < nMax; i++ )
+    for( i = 0, nMax = rL.size(); i < nMax; i++ )
     {
-        DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i );
+        DataFlavor* pFlavor = rL[ i ];
         if( pFlavor && aMimeType == pFlavor->MimeType )
             return i + SOT_FORMATSTR_ID_USER_END + 1;
     }
@@ -471,10 +469,10 @@ sal_uLong SotExchange::GetFormat( const DataFlavor& rFlavor )
                      : i );
 
     // dann in der dynamischen Liste
-    List& rL = InitFormats_Impl();
-    for( i = 0, nMax = rL.Count(); i < nMax; i++ )
+    tDataFlavorList& rL = InitFormats_Impl();
+    for( i = 0, nMax = rL.size(); i < nMax; i++ )
     {
-        DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i );
+        DataFlavor* pFlavor = rL[ i ];
         if( pFlavor && rMimeType == pFlavor->MimeType )
             return i + SOT_FORMATSTR_ID_USER_END + 1;
     }
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index 904c6a7..cecd511 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -39,7 +39,6 @@
 #include <sot/sotdata.hxx>
 #include <sot/clsids.hxx>
 #include <rtl/instance.hxx>
-#include <com/sun/star/datatransfer/DataFlavor.hpp>
 
 /************** class SotData_Impl *********************************************/
 /*************************************************************************
@@ -104,8 +103,8 @@ void SotFactory::DeInit()
     if( pSotData->pDataFlavorList )
     {
 
-        for( sal_uLong i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ )
-            delete (::com::sun::star::datatransfer::DataFlavor*) pSotData->pDataFlavorList->GetObject( i );
+        for( size_t i = 0, nMax = pSotData->pDataFlavorList->size(); i < nMax; i++ )
+            delete (*pSotData->pDataFlavorList)[ i ];
         delete pSotData->pDataFlavorList;
         pSotData->pDataFlavorList = NULL;
     }


More information about the Libreoffice-commits mailing list