[Libreoffice-commits] .: binfilter/bf_sc binfilter/inc

Joseph Powers jpowers at kemper.freedesktop.org
Sat Jan 8 13:30:41 PST 2011


 binfilter/bf_sc/source/core/data/sc_bclist.cxx |   54 ++++++++++++-------------
 binfilter/inc/bf_sc/bclist.hxx                 |    6 --
 2 files changed, 28 insertions(+), 32 deletions(-)

New commits:
commit 81a7768d2a4a0b52fe0d2bd110e479cc160e0a5b
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sat Jan 8 13:30:37 2011 -0800

    Remove DECLARE_LIST(ScBroadcasters, SfxBroadcaster*)

diff --git a/binfilter/bf_sc/source/core/data/sc_bclist.cxx b/binfilter/bf_sc/source/core/data/sc_bclist.cxx
index 5b26443..9c7be87 100644
--- a/binfilter/bf_sc/source/core/data/sc_bclist.cxx
+++ b/binfilter/bf_sc/source/core/data/sc_bclist.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
@@ -34,6 +34,7 @@
 
 #include <bf_svtools/lstner.hxx>
 #include <tools/list.hxx>
+#include <vector>
 
 #include "bclist.hxx"
 namespace binfilter {
@@ -42,7 +43,7 @@ namespace binfilter {
 
 #define SC_LISTENERS_MAX 1024
 
-/*N*/ DECLARE_LIST(ScBroadcasters, SfxBroadcaster*)//STRIP008 ;
+typedef ::std::vector< SfxBroadcaster* > ScBroadcasters;
 
 //------------------------------------------------------------------------
 
@@ -55,12 +56,9 @@ namespace binfilter {
 /*N*/ {
 /*N*/ 	if (pMoreBCs)
 /*N*/ 	{
-/*?*/ 		ULONG nCount = pMoreBCs->Count();
-/*?*/ 		for (ULONG i=0; i<nCount; i++)
-/*?*/ 		{
-/*?*/ 			SfxBroadcaster* pBC = pMoreBCs->GetObject(i);
-/*?*/ 			delete pBC;
-/*?*/ 		}
+/*?*/ 		size_t nCount = pMoreBCs->size();
+/*?*/ 		for (size_t i = 0; i < nCount; i++)
+/*?*/ 			delete (*pMoreBCs)[ i ];
 /*?*/ 		delete pMoreBCs;
 /*N*/ 	}
 /*N*/ }
@@ -73,16 +71,16 @@ namespace binfilter {
 /*N*/ 			return;
 /*N*/ 		if (pMoreBCs)
 /*N*/ 		{
-/*?*/ 			ULONG nCount = pMoreBCs->Count();
-/*?*/ 			for (ULONG i=0; i<nCount; i++)
+/*?*/ 			size_t nCount = pMoreBCs->size();
+/*?*/ 			for (size_t i = 0; i < nCount; i++)
 /*?*/ 			{
-/*?*/ 				SfxBroadcaster* pBC = pMoreBCs->GetObject(i);
+/*?*/ 				SfxBroadcaster* pBC = (*pMoreBCs)[ i ];
 /*?*/ 				if (rLst.IsListening(*pBC))
 /*?*/ 					return;
 /*?*/ 			}
 /*N*/ 		}
 /*N*/ 	}
-/*N*/ 
+/*N*/
 /*N*/ 	if ( aFirstBC.GetListenerCount() < SC_LISTENERS_MAX )
 /*N*/ 	{
 /*N*/ 		rLst.StartListening(aFirstBC, FALSE);
@@ -90,10 +88,10 @@ namespace binfilter {
 /*N*/ 	}
 /*N*/ 	if (pMoreBCs)
 /*N*/ 	{
-/*?*/ 		ULONG nCount = pMoreBCs->Count();
-/*?*/ 		for (ULONG i=0; i<nCount; i++)
+/*?*/ 		size_t nCount = pMoreBCs->size();
+/*?*/ 		for (size_t i = 0; i < nCount; i++)
 /*?*/ 		{
-/*?*/ 			SfxBroadcaster* pBC = pMoreBCs->GetObject(i);
+/*?*/ 			SfxBroadcaster* pBC = (*pMoreBCs)[ i ];
 /*?*/ 			if ( pBC->GetListenerCount() < SC_LISTENERS_MAX )
 /*?*/ 			{
 /*?*/ 				rLst.StartListening(*pBC, FALSE);
@@ -105,7 +103,7 @@ namespace binfilter {
 /*?*/ 		pMoreBCs = new ScBroadcasters;
 /*N*/ 	SfxBroadcaster* pNew = new SfxBroadcaster;
 /*N*/ 	rLst.StartListening(*pNew, FALSE);
-/*N*/ 	pMoreBCs->Insert(pNew, (ULONG)0);	// vorne
+/*N*/ 	pMoreBCs->insert( pMoreBCs->begin(), pNew );	// vorne
 /*N*/ }
 
 /*N*/ void ScBroadcasterList::EndBroadcasting( SfxListener& rLst )
@@ -113,10 +111,10 @@ namespace binfilter {
 /*N*/ 	rLst.EndListening(aFirstBC);
 /*N*/ 	if (pMoreBCs)
 /*N*/ 	{
-/*?*/ 		ULONG nCount = pMoreBCs->Count();
-/*?*/ 		for (ULONG i=0; i<nCount; i++)
+/*?*/ 		size_t nCount = pMoreBCs->size();
+/*?*/ 		for (size_t i = 0; i < nCount; i++)
 /*?*/ 		{
-/*?*/ 			SfxBroadcaster* pBC = pMoreBCs->GetObject(i);
+/*?*/ 			SfxBroadcaster* pBC = (*pMoreBCs)[ i ];
 /*?*/ 			rLst.EndListening(*pBC);
 /*?*/ 		}
 /*N*/ 	}
@@ -128,10 +126,10 @@ namespace binfilter {
 /*N*/ 		return TRUE;
 /*N*/ 	if (pMoreBCs)
 /*N*/ 	{
-/*?*/ 		ULONG nCount = pMoreBCs->Count();
-/*?*/ 		for (ULONG i=0; i<nCount; i++)
+/*?*/ 		size_t nCount = pMoreBCs->size();
+/*?*/ 		for (size_t i = 0; i < nCount; i++)
 /*?*/ 		{
-/*?*/ 			SfxBroadcaster* pBC = pMoreBCs->GetObject(i);
+/*?*/ 			SfxBroadcaster* pBC = (*pMoreBCs)[ i ];
 /*?*/ 			if (pBC->HasListeners())
 /*?*/ 				return TRUE;
 /*?*/ 		}
@@ -144,10 +142,10 @@ namespace binfilter {
 /*N*/ 	aFirstBC.Broadcast( rHint );
 /*N*/ 	if (pMoreBCs)
 /*N*/ 	{
-/*?*/ 		ULONG nCount = pMoreBCs->Count();
-/*?*/ 		for (ULONG i=0; i<nCount; i++)
+/*?*/ 		size_t nCount = pMoreBCs->size();
+/*?*/ 		for (size_t i = 0; i < nCount; i++)
 /*?*/ 		{
-/*?*/ 			SfxBroadcaster* pBC = pMoreBCs->GetObject(i);
+/*?*/ 			SfxBroadcaster* pBC = (*pMoreBCs)[ i  ];
 /*?*/ 			pBC->Broadcast( rHint );
 /*?*/ 		}
 /*N*/ 	}
@@ -166,10 +164,10 @@ namespace binfilter {
 /*N*/ 	}
 /*N*/ 	if (pMoreBCs)
 /*N*/ 	{
-/*N*/ 		ULONG nBCCount = pMoreBCs->Count();
-/*N*/ 		for (ULONG i=0; i<nBCCount; i++)
+/*N*/ 		size_t nBCCount = pMoreBCs->size();
+/*N*/ 		for (size_t i = 0; i < nBCCount; i++)
 /*N*/ 		{
-/*N*/ 			SfxBroadcaster* pBC = pMoreBCs->GetObject(i);
+/*N*/ 			SfxBroadcaster* pBC = (*pMoreBCs)[ i ];
 /*N*/ 			nLstCount = pBC->GetListenerCount();
 /*N*/ 			for (nLstPos=nLstCount; nLstPos>0;)
 /*N*/ 			{
diff --git a/binfilter/inc/bf_sc/bclist.hxx b/binfilter/inc/bf_sc/bclist.hxx
index 23fabf7..f0cefad 100644
--- a/binfilter/inc/bf_sc/bclist.hxx
+++ b/binfilter/inc/bf_sc/bclist.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
@@ -32,8 +32,7 @@
 #include <bf_svtools/brdcst.hxx>
 namespace binfilter {
 
-class ScBroadcasters;
-
+typedef ::std::vector< SfxBroadcaster* > ScBroadcasters;
 
 class ScBroadcasterList
 {
@@ -56,7 +55,6 @@ public:
 /*N*/ 	void	MoveListenersTo( ScBroadcasterList& rNew );
 };
 
-
 } //namespace binfilter
 #endif
 


More information about the Libreoffice-commits mailing list