[Libreoffice-commits] .: filter/inc filter/source
Joseph Powers
jpowers at kemper.freedesktop.org
Thu Jun 16 07:33:44 PDT 2011
filter/inc/filter/msfilter/escherex.hxx | 5 ++++-
filter/source/msfilter/escherex.cxx | 25 ++++++++++++++-----------
2 files changed, 18 insertions(+), 12 deletions(-)
New commits:
commit ac17e204c68165df69af7e01d226b6d697b64add
Author: Joseph Powers <jpowers27 at cox.net>
Date: Thu Jun 16 07:33:30 2011 -0700
Convert List to std::vector< EscherShapeListEntry* >
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index a516a93..32192eb 100644
--- a/filter/inc/filter/msfilter/escherex.hxx
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -1114,9 +1114,12 @@ public:
};
+class EscherShapeListEntry;
+typedef ::std::vector< EscherShapeListEntry* > EscherShapeList_impl;
+
class MSFILTER_DLLPUBLIC EscherSolverContainer
{
- List maShapeList;
+ EscherShapeList_impl maShapeList;
List maConnectorList;
public:
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 6c0fd82..468c808 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.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
@@ -4142,31 +4142,34 @@ EscherSolverContainer::~EscherSolverContainer()
{
void* pP;
- for( pP = maShapeList.First(); pP; pP = maShapeList.Next() )
- delete (EscherShapeListEntry*)pP;
+ for( size_t i = 0, n = maShapeList.size(); i < n; ++i ) {
+ delete maShapeList[ i ];
+ }
for( pP = maConnectorList.First(); pP; pP = maConnectorList.Next() )
delete (EscherConnectorListEntry*)pP;
}
void EscherSolverContainer::AddShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32 nId )
{
- maShapeList.Insert( new EscherShapeListEntry( rXShape, nId ), LIST_APPEND );
+ maShapeList.push_back( new EscherShapeListEntry( rXShape, nId ) );
}
-void EscherSolverContainer::AddConnector( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConnector,
- const ::com::sun::star::awt::Point& rPA,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConA,
- const ::com::sun::star::awt::Point& rPB,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB )
+void EscherSolverContainer::AddConnector(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConnector,
+ const ::com::sun::star::awt::Point& rPA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConA,
+ const ::com::sun::star::awt::Point& rPB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB
+)
{
maConnectorList.Insert( new EscherConnectorListEntry( rConnector, rPA, rConA, rPB, rConB ), LIST_APPEND );
}
sal_uInt32 EscherSolverContainer::GetShapeId( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape ) const
{
- for ( EscherShapeListEntry* pPtr = (EscherShapeListEntry*)((List&)maShapeList).First();
- pPtr; pPtr = (EscherShapeListEntry*)((List&)maShapeList).Next() )
+ for ( size_t i = 0, n = maShapeList.size(); i < n; ++i )
{
+ EscherShapeListEntry* pPtr = maShapeList[ i ];
if ( rXShape == pPtr->aXShape )
return ( pPtr->n_EscherId );
}
More information about the Libreoffice-commits
mailing list