diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-10-23 15:50:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-10-23 16:16:16 +0200 |
commit | 237a840ef768fe3fc8ccde1b69d6f0c29e60711f (patch) | |
tree | 3691ffeae9d447b042af51074fd4e77a1e38c56a /oox | |
parent | 0db68ef9ca624cd0bda45c35c24a9abe106faf57 (diff) |
Revert "oox: replace boost::ptr_vector with std::vector<std::unique_ptr>"
This reverts commit d29e614ff9cd91c4e4a1bada6a21884e33323f8d, it broke
CppunitTest_sd_export_tests.
Change-Id: I908cc46cdf4df706ad64d04777b8e1401e0800c1
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/effectproperties.cxx | 15 | ||||
-rw-r--r-- | oox/source/drawingml/effectproperties.hxx | 13 | ||||
-rw-r--r-- | oox/source/drawingml/effectpropertiescontext.cxx | 32 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 7 |
4 files changed, 25 insertions, 42 deletions
diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx index 631f2fcb5bc9..3fd388215665 100644 --- a/oox/source/drawingml/effectproperties.cxx +++ b/oox/source/drawingml/effectproperties.cxx @@ -14,7 +14,6 @@ #include "oox/token/tokens.hxx" #include <basegfx/numeric/ftools.hxx> -#include <o3tl/make_unique.hxx> namespace oox { namespace drawingml { @@ -29,21 +28,14 @@ void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourcePro void EffectProperties::assignUsed( const EffectProperties& rSourceProps ) { maShadow.assignUsed(rSourceProps.maShadow); - if (!rSourceProps.m_Effects.empty()) - { - m_Effects.reserve(rSourceProps.m_Effects.size()); - for (auto const& it : rSourceProps.m_Effects) - { - m_Effects.push_back(o3tl::make_unique<Effect>(*it)); - } - } + if( rSourceProps.maEffects.size() > 0 ) + maEffects = rSourceProps.maEffects; } void EffectProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelper& rGraphicHelper ) const { - for (auto const& it : m_Effects) - { + for( boost::ptr_vector< Effect >::const_iterator it = maEffects.begin(); it != maEffects.end(); ++it ) if( it->msName == "outerShdw" ) { sal_Int32 nAttrDir = 0, nAttrDist = 0; @@ -67,7 +59,6 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap, rPropMap.setProperty( PROP_ShadowColor, it->moColor.getColor(rGraphicHelper ) ); rPropMap.setProperty( PROP_ShadowTransparence, it->moColor.getTransparency()); } - } } css::beans::PropertyValue Effect::getEffect() diff --git a/oox/source/drawingml/effectproperties.hxx b/oox/source/drawingml/effectproperties.hxx index 9089e1dc0679..4256b8d776d3 100644 --- a/oox/source/drawingml/effectproperties.hxx +++ b/oox/source/drawingml/effectproperties.hxx @@ -10,12 +10,11 @@ #ifndef INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX #define INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX +#include <map> #include <oox/drawingml/color.hxx> #include <oox/helper/propertymap.hxx> -#include <memory> -#include <vector> -#include <map> +#include <boost/ptr_container/ptr_vector.hpp> namespace oox { namespace drawingml { @@ -45,13 +44,7 @@ struct EffectProperties EffectShadowProperties maShadow; /** Stores all effect properties, including those not supported by core yet */ - std::vector<std::unique_ptr<Effect>> m_Effects; - - EffectProperties() {} - EffectProperties(EffectProperties const& rOther) - { - assignUsed(rOther); - } + boost::ptr_vector< Effect > maEffects; /** Overwrites all members that are explicitly set in rSourceProps. */ void assignUsed( const EffectProperties& rSourceProps ); diff --git a/oox/source/drawingml/effectpropertiescontext.cxx b/oox/source/drawingml/effectpropertiescontext.cxx index 3f79cb7a93a3..d1d0cd9e935a 100644 --- a/oox/source/drawingml/effectpropertiescontext.cxx +++ b/oox/source/drawingml/effectpropertiescontext.cxx @@ -13,8 +13,6 @@ #include "drawingml/fillpropertiesgroupcontext.hxx" #include "oox/helper/attributelist.hxx" -#include <o3tl/make_unique.hxx> - using namespace ::oox::core; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; @@ -72,28 +70,28 @@ void EffectPropertiesContext::saveUnsupportedAttribs( Effect& rEffect, const Att ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - sal_Int32 nPos = mrEffectProperties.m_Effects.size(); - mrEffectProperties.m_Effects.push_back(o3tl::make_unique<Effect>()); + sal_Int32 nPos = mrEffectProperties.maEffects.size(); + mrEffectProperties.maEffects.push_back( new Effect() ); switch( nElement ) { case A_TOKEN( outerShdw ): { - mrEffectProperties.m_Effects[nPos]->msName = "outerShdw"; - saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); + mrEffectProperties.maEffects[nPos].msName = "outerShdw"; + saveUnsupportedAttribs( mrEffectProperties.maEffects[nPos], rAttribs ); mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 0 ); - return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); + return new ColorContext( *this, mrEffectProperties.maEffects[nPos].moColor ); } break; case A_TOKEN( innerShdw ): { - mrEffectProperties.m_Effects[nPos]->msName = "innerShdw"; - saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); + mrEffectProperties.maEffects[nPos].msName = "innerShdw"; + saveUnsupportedAttribs( mrEffectProperties.maEffects[nPos], rAttribs ); mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 0 ); - return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); + return new ColorContext( *this, mrEffectProperties.maEffects[nPos].moColor ); } break; case A_TOKEN( glow ): @@ -102,20 +100,20 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, case A_TOKEN( blur ): { if( nElement == A_TOKEN( glow ) ) - mrEffectProperties.m_Effects[nPos]->msName = "glow"; + mrEffectProperties.maEffects[nPos].msName = "glow"; else if( nElement == A_TOKEN( softEdge ) ) - mrEffectProperties.m_Effects[nPos]->msName = "softEdge"; + mrEffectProperties.maEffects[nPos].msName = "softEdge"; else if( nElement == A_TOKEN( reflection ) ) - mrEffectProperties.m_Effects[nPos]->msName = "reflection"; + mrEffectProperties.maEffects[nPos].msName = "reflection"; else if( nElement == A_TOKEN( blur ) ) - mrEffectProperties.m_Effects[nPos]->msName = "blur"; - saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); - return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); + mrEffectProperties.maEffects[nPos].msName = "blur"; + saveUnsupportedAttribs( mrEffectProperties.maEffects[nPos], rAttribs ); + return new ColorContext( *this, mrEffectProperties.maEffects[nPos].moColor ); } break; } - mrEffectProperties.m_Effects.pop_back(); + mrEffectProperties.maEffects.pop_back(); return 0; } diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index c7728bbd1e20..04ca3a158164 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -953,11 +953,12 @@ Reference< XShape > Shape::createAndInsert( } // store unsupported effect attributes in the grab bag - if (!aEffectProperties.m_Effects.empty()) + if( aEffectProperties.maEffects.size() > 0 ) { - Sequence<PropertyValue> aEffects(aEffectProperties.m_Effects.size()); + Sequence< PropertyValue > aEffects( aEffectProperties.maEffects.size() ); sal_uInt32 i = 0; - for (auto const& it : aEffectProperties.m_Effects) + for( boost::ptr_vector< Effect >::iterator it = aEffectProperties.maEffects.begin(); + it != aEffectProperties.maEffects.end(); ++it ) { PropertyValue aEffect = it->getEffect(); if( !aEffect.Name.isEmpty() ) |