Kaydet (Commit) 237a840e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Revert "oox: replace boost::ptr_vector with std::vector<std::unique_ptr>"

This reverts commit d29e614f, it broke
CppunitTest_sd_export_tests.

Change-Id: I908cc46cdf4df706ad64d04777b8e1401e0800c1
üst 0db68ef9
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "oox/token/tokens.hxx" #include "oox/token/tokens.hxx"
#include <basegfx/numeric/ftools.hxx> #include <basegfx/numeric/ftools.hxx>
#include <o3tl/make_unique.hxx>
namespace oox { namespace oox {
namespace drawingml { namespace drawingml {
...@@ -29,21 +28,14 @@ void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourcePro ...@@ -29,21 +28,14 @@ void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourcePro
void EffectProperties::assignUsed( const EffectProperties& rSourceProps ) void EffectProperties::assignUsed( const EffectProperties& rSourceProps )
{ {
maShadow.assignUsed(rSourceProps.maShadow); maShadow.assignUsed(rSourceProps.maShadow);
if (!rSourceProps.m_Effects.empty()) if( rSourceProps.maEffects.size() > 0 )
{ maEffects = rSourceProps.maEffects;
m_Effects.reserve(rSourceProps.m_Effects.size());
for (auto const& it : rSourceProps.m_Effects)
{
m_Effects.push_back(o3tl::make_unique<Effect>(*it));
}
}
} }
void EffectProperties::pushToPropMap( PropertyMap& rPropMap, void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
const GraphicHelper& rGraphicHelper ) const 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" ) if( it->msName == "outerShdw" )
{ {
sal_Int32 nAttrDir = 0, nAttrDist = 0; sal_Int32 nAttrDir = 0, nAttrDist = 0;
...@@ -67,7 +59,6 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap, ...@@ -67,7 +59,6 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
rPropMap.setProperty( PROP_ShadowColor, it->moColor.getColor(rGraphicHelper ) ); rPropMap.setProperty( PROP_ShadowColor, it->moColor.getColor(rGraphicHelper ) );
rPropMap.setProperty( PROP_ShadowTransparence, it->moColor.getTransparency()); rPropMap.setProperty( PROP_ShadowTransparence, it->moColor.getTransparency());
} }
}
} }
css::beans::PropertyValue Effect::getEffect() css::beans::PropertyValue Effect::getEffect()
......
...@@ -10,12 +10,11 @@ ...@@ -10,12 +10,11 @@
#ifndef INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX #ifndef INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX
#define INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX #define INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX
#include <map>
#include <oox/drawingml/color.hxx> #include <oox/drawingml/color.hxx>
#include <oox/helper/propertymap.hxx> #include <oox/helper/propertymap.hxx>
#include <memory> #include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
#include <map>
namespace oox { namespace oox {
namespace drawingml { namespace drawingml {
...@@ -45,13 +44,7 @@ struct EffectProperties ...@@ -45,13 +44,7 @@ struct EffectProperties
EffectShadowProperties maShadow; EffectShadowProperties maShadow;
/** Stores all effect properties, including those not supported by core yet */ /** Stores all effect properties, including those not supported by core yet */
std::vector<std::unique_ptr<Effect>> m_Effects; boost::ptr_vector< Effect > maEffects;
EffectProperties() {}
EffectProperties(EffectProperties const& rOther)
{
assignUsed(rOther);
}
/** Overwrites all members that are explicitly set in rSourceProps. */ /** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const EffectProperties& rSourceProps ); void assignUsed( const EffectProperties& rSourceProps );
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include "drawingml/fillpropertiesgroupcontext.hxx" #include "drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/helper/attributelist.hxx" #include "oox/helper/attributelist.hxx"
#include <o3tl/make_unique.hxx>
using namespace ::oox::core; using namespace ::oox::core;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::xml::sax;
...@@ -72,28 +70,28 @@ void EffectPropertiesContext::saveUnsupportedAttribs( Effect& rEffect, const Att ...@@ -72,28 +70,28 @@ void EffectPropertiesContext::saveUnsupportedAttribs( Effect& rEffect, const Att
ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{ {
sal_Int32 nPos = mrEffectProperties.m_Effects.size(); sal_Int32 nPos = mrEffectProperties.maEffects.size();
mrEffectProperties.m_Effects.push_back(o3tl::make_unique<Effect>()); mrEffectProperties.maEffects.push_back( new Effect() );
switch( nElement ) switch( nElement )
{ {
case A_TOKEN( outerShdw ): case A_TOKEN( outerShdw ):
{ {
mrEffectProperties.m_Effects[nPos]->msName = "outerShdw"; mrEffectProperties.maEffects[nPos].msName = "outerShdw";
saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); saveUnsupportedAttribs( mrEffectProperties.maEffects[nPos], rAttribs );
mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 );
mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 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; break;
case A_TOKEN( innerShdw ): case A_TOKEN( innerShdw ):
{ {
mrEffectProperties.m_Effects[nPos]->msName = "innerShdw"; mrEffectProperties.maEffects[nPos].msName = "innerShdw";
saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); saveUnsupportedAttribs( mrEffectProperties.maEffects[nPos], rAttribs );
mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 );
mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 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; break;
case A_TOKEN( glow ): case A_TOKEN( glow ):
...@@ -102,20 +100,20 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, ...@@ -102,20 +100,20 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement,
case A_TOKEN( blur ): case A_TOKEN( blur ):
{ {
if( nElement == A_TOKEN( glow ) ) if( nElement == A_TOKEN( glow ) )
mrEffectProperties.m_Effects[nPos]->msName = "glow"; mrEffectProperties.maEffects[nPos].msName = "glow";
else if( nElement == A_TOKEN( softEdge ) ) else if( nElement == A_TOKEN( softEdge ) )
mrEffectProperties.m_Effects[nPos]->msName = "softEdge"; mrEffectProperties.maEffects[nPos].msName = "softEdge";
else if( nElement == A_TOKEN( reflection ) ) else if( nElement == A_TOKEN( reflection ) )
mrEffectProperties.m_Effects[nPos]->msName = "reflection"; mrEffectProperties.maEffects[nPos].msName = "reflection";
else if( nElement == A_TOKEN( blur ) ) else if( nElement == A_TOKEN( blur ) )
mrEffectProperties.m_Effects[nPos]->msName = "blur"; mrEffectProperties.maEffects[nPos].msName = "blur";
saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); saveUnsupportedAttribs( mrEffectProperties.maEffects[nPos], rAttribs );
return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); return new ColorContext( *this, mrEffectProperties.maEffects[nPos].moColor );
} }
break; break;
} }
mrEffectProperties.m_Effects.pop_back(); mrEffectProperties.maEffects.pop_back();
return 0; return 0;
} }
......
...@@ -953,11 +953,12 @@ Reference< XShape > Shape::createAndInsert( ...@@ -953,11 +953,12 @@ Reference< XShape > Shape::createAndInsert(
} }
// store unsupported effect attributes in the grab bag // 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; 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(); PropertyValue aEffect = it->getEffect();
if( !aEffect.Name.isEmpty() ) if( !aEffect.Name.isEmpty() )
......
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