Kaydet (Commit) 695c15ed authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Noel Grandin

Replace lists by vectors in oox

Change-Id: I951466552fd1cdb3b8f1cbfc07e64f5e0424552e
Reviewed-on: https://gerrit.libreoffice.org/43469Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 48a67502
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define INCLUDED_OOX_PPT_ANIMATIONSPERSIST_HXX #define INCLUDED_OOX_PPT_ANIMATIONSPERSIST_HXX
#include <array> #include <array>
#include <list> #include <vector>
#include <memory> #include <memory>
#include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Any.hxx>
...@@ -85,7 +85,7 @@ namespace oox { namespace ppt { ...@@ -85,7 +85,7 @@ namespace oox { namespace ppt {
struct AnimationCondition; struct AnimationCondition;
typedef std::list< AnimationCondition > AnimationConditionList; typedef std::vector< AnimationCondition > AnimationConditionList;
/** data for CT_TLTimeCondition */ /** data for CT_TLTimeCondition */
struct AnimationCondition struct AnimationCondition
...@@ -113,7 +113,7 @@ namespace oox { namespace ppt { ...@@ -113,7 +113,7 @@ namespace oox { namespace ppt {
css::uno::Any maValue; css::uno::Any maValue;
}; };
typedef ::std::list< TimeAnimationValue > TimeAnimationValueList; typedef ::std::vector< TimeAnimationValue > TimeAnimationValueList;
} } } }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef INCLUDED_OOX_PPT_SLIDEPERSIST_HXX #ifndef INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
#define INCLUDED_OOX_PPT_SLIDEPERSIST_HXX #define INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
#include <list> #include <vector>
#include <map> #include <map>
#include <memory> #include <memory>
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
const oox::drawingml::ShapePtr& getShapes() { return maShapesPtr; } const oox::drawingml::ShapePtr& getShapes() { return maShapesPtr; }
void hideShapesAsMasterShapes(); void hideShapesAsMasterShapes();
::std::list< std::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; } ::std::vector< std::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; }; oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); } oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
...@@ -138,7 +138,7 @@ private: ...@@ -138,7 +138,7 @@ private:
oox::drawingml::ShapePtr maShapesPtr; oox::drawingml::ShapePtr maShapesPtr;
oox::drawingml::Color maBackgroundColor; oox::drawingml::Color maBackgroundColor;
oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr; oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
::std::list< std::shared_ptr< TimeNode > > maTimeNodeList; ::std::vector< std::shared_ptr< TimeNode > > maTimeNodeList;
oox::ppt::HeaderFooter maHeaderFooter; oox::ppt::HeaderFooter maHeaderFooter;
sal_Int32 mnLayoutValueToken; sal_Int32 mnLayoutValueToken;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#ifndef INCLUDED_OOX_PPT_TIMENODE_HXX #ifndef INCLUDED_OOX_PPT_TIMENODE_HXX
#define INCLUDED_OOX_PPT_TIMENODE_HXX #define INCLUDED_OOX_PPT_TIMENODE_HXX
#include <list> #include <vector>
#include <map> #include <map>
#include <memory> #include <memory>
...@@ -44,7 +44,7 @@ namespace oox { namespace ppt { ...@@ -44,7 +44,7 @@ namespace oox { namespace ppt {
class TimeNode; class TimeNode;
typedef std::shared_ptr< TimeNode > TimeNodePtr; typedef std::shared_ptr< TimeNode > TimeNodePtr;
typedef std::list< TimeNodePtr > TimeNodePtrList; typedef std::vector< TimeNodePtr > TimeNodePtrList;
class TimeNode final class TimeNode final
{ {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIESCONTEXT_HXX #ifndef INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIESCONTEXT_HXX
#define INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIESCONTEXT_HXX #define INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIESCONTEXT_HXX
#include <list> #include <vector>
#include <com/sun/star/style/TabStop.hpp> #include <com/sun/star/style/TabStop.hpp>
#include <oox/drawingml/drawingmltypes.hxx> #include <oox/drawingml/drawingmltypes.hxx>
...@@ -44,7 +44,7 @@ protected: ...@@ -44,7 +44,7 @@ protected:
TextParagraphProperties& mrTextParagraphProperties; TextParagraphProperties& mrTextParagraphProperties;
TextSpacing maLineSpacing; TextSpacing maLineSpacing;
BulletList& mrBulletList; BulletList& mrBulletList;
std::list< css::style::TabStop > maTabList; std::vector< css::style::TabStop > maTabList;
std::shared_ptr< BlipFillProperties > mxBlipProps; std::shared_ptr< BlipFillProperties > mxBlipProps;
}; };
......
...@@ -48,13 +48,13 @@ TextField::TextField() ...@@ -48,13 +48,13 @@ TextField::TextField()
namespace { namespace {
/** intsanciate the textfields. Because of semantics difference between /** instanciate the textfields. Because of semantics difference between
* OpenXML and OpenOffice, some OpenXML field might cause two fields to be created. * OpenXML and OpenOffice, some OpenXML field might cause two fields to be created.
* @param aFields the created fields. The list is empty if no field has been created. * @param aFields the created fields. The list is empty if no field has been created.
* @param xModel the model * @param xModel the model
* @param sType the OpenXML field type. * @param sType the OpenXML field type.
*/ */
void lclCreateTextFields( std::list< Reference< XTextField > > & aFields, void lclCreateTextFields( std::vector< Reference< XTextField > > & aFields,
const Reference< XModel > & xModel, const OUString & sType ) const Reference< XModel > & xModel, const OUString & sType )
{ {
Reference< XInterface > xIface; Reference< XInterface > xIface;
...@@ -204,17 +204,16 @@ sal_Int32 TextField::insertAt( ...@@ -204,17 +204,16 @@ sal_Int32 TextField::insertAt(
nCharHeight = aTextCharacterProps.moHeight.get(); nCharHeight = aTextCharacterProps.moHeight.get();
aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase ); aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase );
std::list< Reference< XTextField > > fields; std::vector< Reference< XTextField > > fields;
lclCreateTextFields( fields, rFilterBase.getModel(), msType ); lclCreateTextFields( fields, rFilterBase.getModel(), msType );
if( !fields.empty() ) if( !fields.empty() )
{ {
bool bFirst = true; bool bFirst = true;
for( std::list< Reference< XTextField > >::iterator iter = fields.begin(); for (auto const& field : fields)
iter != fields.end(); ++iter )
{ {
if( iter->is() ) if( field.is() )
{ {
Reference< XTextContent > xContent( *iter, UNO_QUERY); Reference< XTextContent > xContent( field, UNO_QUERY);
if( bFirst) if( bFirst)
{ {
bFirst = false; bFirst = false;
......
...@@ -138,7 +138,7 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext() ...@@ -138,7 +138,7 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
else else
rPropertyMap.setProperty( PROP_ParaLineSpacing, css::style::LineSpacing( css::style::LineSpacingMode::PROP, 100 )); rPropertyMap.setProperty( PROP_ParaLineSpacing, css::style::LineSpacing( css::style::LineSpacingMode::PROP, 100 ));
::std::list< TabStop >::size_type nTabCount = maTabList.size(); ::std::vector< TabStop >::size_type nTabCount = maTabList.size();
if( nTabCount != 0 ) if( nTabCount != 0 )
{ {
Sequence< TabStop > aSeq( nTabCount ); Sequence< TabStop > aSeq( nTabCount );
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <list> #include <vector>
#include <algorithm> #include <algorithm>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
...@@ -35,7 +35,7 @@ using namespace ::com::sun::star::xml::sax; ...@@ -35,7 +35,7 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace drawingml { namespace oox { namespace drawingml {
TextTabStopListContext::TextTabStopListContext( ContextHandler2Helper const & rParent, std::list< TabStop > & aTabList ) TextTabStopListContext::TextTabStopListContext( ContextHandler2Helper const & rParent, std::vector< TabStop > & aTabList )
: ContextHandler2( rParent ) : ContextHandler2( rParent )
, maTabList( aTabList ) , maTabList( aTabList )
{ {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_TEXTTABSTOPLISTCONTEXT_HXX #ifndef INCLUDED_OOX_SOURCE_DRAWINGML_TEXTTABSTOPLISTCONTEXT_HXX
#define INCLUDED_OOX_SOURCE_DRAWINGML_TEXTTABSTOPLISTCONTEXT_HXX #define INCLUDED_OOX_SOURCE_DRAWINGML_TEXTTABSTOPLISTCONTEXT_HXX
#include <list> #include <vector>
#include <com/sun/star/style/TabStop.hpp> #include <com/sun/star/style/TabStop.hpp>
...@@ -32,13 +32,13 @@ namespace oox { namespace drawingml { ...@@ -32,13 +32,13 @@ namespace oox { namespace drawingml {
{ {
public: public:
TextTabStopListContext( ::oox::core::ContextHandler2Helper const & rParent, TextTabStopListContext( ::oox::core::ContextHandler2Helper const & rParent,
::std::list< css::style::TabStop > & aTabList ); ::std::vector< css::style::TabStop > & aTabList );
virtual ~TextTabStopListContext() override; virtual ~TextTabStopListContext() override;
virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override;
protected: protected:
::std::list< css::style::TabStop > & maTabList; ::std::vector< css::style::TabStop > & maTabList;
}; };
} } } }
......
...@@ -60,14 +60,13 @@ namespace oox { namespace ppt { ...@@ -60,14 +60,13 @@ namespace oox { namespace ppt {
if( !maAttributes.empty() ) if( !maAttributes.empty() )
{ {
OUStringBuffer sAttributes; OUStringBuffer sAttributes;
std::list< Attribute >::const_iterator iter; for (auto const& attribute : maAttributes)
for(iter = maAttributes.begin(); iter != maAttributes.end(); ++iter)
{ {
if( !sAttributes.isEmpty() ) if( !sAttributes.isEmpty() )
{ {
sAttributes.append( ";" ); sAttributes.append( ";" );
} }
sAttributes.append( iter->name ); sAttributes.append( attribute.name );
} }
OUString sTmp( sAttributes.makeStringAndClear() ); OUString sTmp( sAttributes.makeStringAndClear() );
mpNode->getNodeProperties()[ NP_ATTRIBUTENAME ] <<= sTmp; mpNode->getNodeProperties()[ NP_ATTRIBUTENAME ] <<= sTmp;
......
...@@ -53,7 +53,7 @@ namespace oox { namespace ppt { ...@@ -53,7 +53,7 @@ namespace oox { namespace ppt {
private: private:
bool mbInAttrList; bool mbInAttrList;
bool mbIsInAttrName; bool mbIsInAttrName;
std::list< Attribute > maAttributes; std::vector< Attribute > maAttributes;
OUString msCurrentAttribute; OUString msCurrentAttribute;
}; };
......
...@@ -541,33 +541,32 @@ namespace oox { namespace ppt { ...@@ -541,33 +541,32 @@ namespace oox { namespace ppt {
virtual ~AnimContext() throw () override virtual ~AnimContext() throw () override
{ {
::std::list< TimeAnimationValue >::iterator iter, end;
int nKeyTimes = maTavList.size(); int nKeyTimes = maTavList.size();
if( nKeyTimes > 0) if( nKeyTimes > 0)
{ {
int i; int i=0;
Sequence< double > aKeyTimes( nKeyTimes ); Sequence< double > aKeyTimes( nKeyTimes );
Sequence< Any > aValues( nKeyTimes ); Sequence< Any > aValues( nKeyTimes );
NodePropertyMap & aProps( mpNode->getNodeProperties() ); NodePropertyMap & aProps( mpNode->getNodeProperties() );
end = maTavList.end(); for (auto const& tav : maTavList)
for(iter = maTavList.begin(), i=0; iter != end; ++iter,++i)
{ {
// TODO what to do if it is Timing_INFINITE ? // TODO what to do if it is Timing_INFINITE ?
Any aTime = GetTimeAnimateValueTime( iter->msTime ); Any aTime = GetTimeAnimateValueTime( tav.msTime );
aTime >>= aKeyTimes[i]; aTime >>= aKeyTimes[i];
aValues[i] = iter->maValue; aValues[i] = tav.maValue;
OUString aTest; OUString aTest;
iter->maValue >>= aTest; tav.maValue >>= aTest;
if( !aTest.isEmpty() ) if( !aTest.isEmpty() )
{ {
aValues[i] = iter->maValue; aValues[i] = tav.maValue;
} }
else else
{ {
aProps[ NP_FORMULA ] <<= iter->msFormula; aProps[ NP_FORMULA ] <<= tav.msFormula;
} }
++i;
} }
aProps[ NP_VALUES ] <<= aValues; aProps[ NP_VALUES ] <<= aValues;
aProps[ NP_KEYTIMES ] <<= aKeyTimes; aProps[ NP_KEYTIMES ] <<= aKeyTimes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment