[Libreoffice-commits] .: svl/inc svl/source
Joseph Powers
jpowers at kemper.freedesktop.org
Mon Feb 21 12:30:24 PST 2011
svl/inc/svl/svdde.hxx | 2 +-
svl/source/svdde/ddesvr.cxx | 29 ++++++++++++++++++-----------
2 files changed, 19 insertions(+), 12 deletions(-)
New commits:
commit 801ecf81f7cbc5a1dada1887f2b930a17990af41
Author: Joseph Powers <jpowers27 at cox.net>
Date: Mon Feb 21 12:30:02 2011 -0800
Remove DECLARE_LIST( DdeFormats, long )
diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx
index 42cff86..b38cf7d 100644
--- a/svl/inc/svl/svdde.hxx
+++ b/svl/inc/svl/svdde.hxx
@@ -67,7 +67,7 @@ typedef List DdeItems;
#endif
DECLARE_LIST( DdeTransactions, DdeTransaction* )
-DECLARE_LIST( DdeFormats, long )
+typedef ::std::vector< long > DdeFormats;
// -----------
// - DdeData -
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index b089a35..22a4d71 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.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
@@ -36,11 +36,6 @@
#include <tools/debug.hxx>
#include <osl/thread.h>
-//static long hCurConv = 0;
-//static DWORD hDdeInst = NULL;
-//static short nInstance = 0;
-//static DdeServices* pServices;
-
enum DdeItemType
{
DDEITEM,
@@ -588,7 +583,10 @@ void DdeService::RemoveTopic( const DdeTopic& rTopic )
BOOL DdeService::HasCbFormat( USHORT nFmt )
{
- return BOOL( aFormats.GetPos( nFmt ) != LIST_ENTRY_NOTFOUND );
+ for ( size_t i = 0, n = aFormats.size(); i < n; ++i )
+ if ( aFormats[ i ] == nFmt )
+ return true;
+ return false;
}
// --- DdeService::HasFormat() -------------------------------------
@@ -603,15 +601,23 @@ BOOL DdeService::HasFormat( ULONG nFmt )
void DdeService::AddFormat( ULONG nFmt )
{
nFmt = DdeData::GetExternalFormat( nFmt );
- aFormats.Remove( nFmt );
- aFormats.Insert( nFmt );
+ for ( size_t i = 0, n = aFormats.size(); i < n; ++i )
+ if ( aFormats[ i ] == nFmt )
+ return;
+ aFormats->push_back( nFmt );
}
// --- DdeService::RemoveFormat() ----------------------------------
void DdeService::RemoveFormat( ULONG nFmt )
{
- aFormats.Remove( DdeData::GetExternalFormat( nFmt ) );
+ nFmt = DdeData::GetExternalFormat( nFmt );
+ for ( DdeFormats::iterator it = aFormats.begin(); it < aFormats.end(); ++it ) {
+ if ( *it == nFmt ) {
+ aFormats.erase( it );
+ break;
+ }
+ }
}
// --- DdeTopic::DdeTopic() ----------------------------------------
@@ -1018,8 +1024,9 @@ String DdeService::Formats()
LPCTSTR p;
short n = 0;
- for ( f = aFormats.First(); f; f = aFormats.Next(), n++ )
+ for ( size_t i = 0; i < aFormats.size(); ++i, n++ )
{
+ f = aFormats[ i ];
if ( n )
s += '\t';
p = buf;
More information about the Libreoffice-commits
mailing list