summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-01-05 15:41:59 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-01-05 15:41:59 +0100
commitcdff2caffabf97cb87a22548e0d1a55f4e1daf42 (patch)
tree5e779ae1ccd3af918ec88b41355dfbb991e6587d /oox
parent9fc76fd59cb632faa3b9b8467caccfac87d15838 (diff)
No need for heap-allocated OUStringBuffer
Change-Id: Id2dbe3ecce9eba2eefab90f43b9a2a6894839cfb
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/vmlexport.cxx56
1 files changed, 27 insertions, 29 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index c284b5512756..59c1f2084992 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -64,7 +64,7 @@ VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr const & pSerializer, VMLText
, m_pShapeAttrList( nullptr )
, m_nShapeType( ESCHER_ShpInst_Nil )
, m_nShapeFlags(0)
- , m_pShapeStyle( new OStringBuffer( 200 ) )
+ , m_pShapeStyle( 200 )
, m_pShapeTypeWritten( new bool[ ESCHER_ShpInst_COUNT ] )
{
mnGroupLevel = 1;
@@ -80,8 +80,6 @@ VMLExport::~VMLExport()
{
delete mpOutStrm;
mpOutStrm = nullptr;
- delete m_pShapeStyle;
- m_pShapeStyle = nullptr;
delete[] m_pShapeTypeWritten;
m_pShapeTypeWritten = nullptr;
}
@@ -100,10 +98,10 @@ void VMLExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance )
m_nShapeType = ESCHER_ShpInst_Nil;
m_pShapeAttrList = FastSerializerHelper::createAttrList();
- if ( !m_pShapeStyle->isEmpty() )
- m_pShapeStyle->setLength(0);
+ if ( !m_pShapeStyle.isEmpty() )
+ m_pShapeStyle.setLength(0);
- m_pShapeStyle->ensureCapacity( 200 );
+ m_pShapeStyle.ensureCapacity( 200 );
// postpone the output so that we are able to write even the elements
// that we learn inside Commit()
@@ -372,7 +370,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
if ( m_nShapeType == ESCHER_ShpInst_Line )
AddLineDimensions( rRect );
else
- AddRectangleDimensions( *m_pShapeStyle, rRect );
+ AddRectangleDimensions( m_pShapeStyle, rRect );
// properties
bool bAlreadyWritten[ 0xFFF ];
@@ -763,7 +761,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
case ESCHER_Prop_fHidden:
if ( !it->nPropValue )
- m_pShapeStyle->append( ";visibility:hidden" );
+ m_pShapeStyle.append( ";visibility:hidden" );
break;
case ESCHER_Prop_shadowColor:
case ESCHER_Prop_fshadowObscured:
@@ -832,7 +830,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect
case ESCHER_Prop_Rotation:
{
// The higher half of the variable contains the angle.
- m_pShapeStyle->append(";rotation:").append(double(it->nPropValue >> 16));
+ m_pShapeStyle.append(";rotation:").append(double(it->nPropValue >> 16));
bAlreadyWritten[ESCHER_Prop_Rotation] = true;
}
break;
@@ -889,19 +887,19 @@ void VMLExport::AddFlipXY( )
const sal_uInt32 nFlipHandV = SHAPEFLAG_FLIPH + SHAPEFLAG_FLIPV;
switch ( m_nShapeFlags & nFlipHandV )
{
- case SHAPEFLAG_FLIPH: m_pShapeStyle->append( ";flip:x" ); break;
- case SHAPEFLAG_FLIPV: m_pShapeStyle->append( ";flip:y" ); break;
- case nFlipHandV: m_pShapeStyle->append( ";flip:xy" ); break;
+ case SHAPEFLAG_FLIPH: m_pShapeStyle.append( ";flip:x" ); break;
+ case SHAPEFLAG_FLIPV: m_pShapeStyle.append( ";flip:y" ); break;
+ case nFlipHandV: m_pShapeStyle.append( ";flip:xy" ); break;
}
}
void VMLExport::AddLineDimensions( const Rectangle& rRectangle )
{
// style
- if ( !m_pShapeStyle->isEmpty() )
- m_pShapeStyle->append( ";" );
+ if ( !m_pShapeStyle.isEmpty() )
+ m_pShapeStyle.append( ";" );
- m_pShapeStyle->append( "position:absolute" );
+ m_pShapeStyle.append( "position:absolute" );
AddFlipXY();
@@ -1062,19 +1060,19 @@ sal_Int32 VMLExport::StartShape()
switch (m_eHOri)
{
case text::HoriOrientation::LEFT:
- m_pShapeStyle->append(";mso-position-horizontal:left");
+ m_pShapeStyle.append(";mso-position-horizontal:left");
break;
case text::HoriOrientation::CENTER:
- m_pShapeStyle->append(";mso-position-horizontal:center");
+ m_pShapeStyle.append(";mso-position-horizontal:center");
break;
case text::HoriOrientation::RIGHT:
- m_pShapeStyle->append(";mso-position-horizontal:right");
+ m_pShapeStyle.append(";mso-position-horizontal:right");
break;
case text::HoriOrientation::INSIDE:
- m_pShapeStyle->append(";mso-position-horizontal:inside");
+ m_pShapeStyle.append(";mso-position-horizontal:inside");
break;
case text::HoriOrientation::OUTSIDE:
- m_pShapeStyle->append(";mso-position-horizontal:outside");
+ m_pShapeStyle.append(";mso-position-horizontal:outside");
break;
default:
case text::HoriOrientation::NONE:
@@ -1083,15 +1081,15 @@ sal_Int32 VMLExport::StartShape()
switch (m_eHRel)
{
case text::RelOrientation::PAGE_PRINT_AREA:
- m_pShapeStyle->append(";mso-position-horizontal-relative:margin");
+ m_pShapeStyle.append(";mso-position-horizontal-relative:margin");
break;
case text::RelOrientation::PAGE_FRAME:
case text::RelOrientation::PAGE_LEFT:
case text::RelOrientation::PAGE_RIGHT:
- m_pShapeStyle->append(";mso-position-horizontal-relative:page");
+ m_pShapeStyle.append(";mso-position-horizontal-relative:page");
break;
case text::RelOrientation::CHAR:
- m_pShapeStyle->append(";mso-position-horizontal-relative:char");
+ m_pShapeStyle.append(";mso-position-horizontal-relative:char");
break;
default:
break;
@@ -1102,16 +1100,16 @@ sal_Int32 VMLExport::StartShape()
case text::VertOrientation::TOP:
case text::VertOrientation::LINE_TOP:
case text::VertOrientation::CHAR_TOP:
- m_pShapeStyle->append(";mso-position-vertical:top");
+ m_pShapeStyle.append(";mso-position-vertical:top");
break;
case text::VertOrientation::CENTER:
case text::VertOrientation::LINE_CENTER:
- m_pShapeStyle->append(";mso-position-vertical:center");
+ m_pShapeStyle.append(";mso-position-vertical:center");
break;
case text::VertOrientation::BOTTOM:
case text::VertOrientation::LINE_BOTTOM:
case text::VertOrientation::CHAR_BOTTOM:
- m_pShapeStyle->append(";mso-position-vertical:bottom");
+ m_pShapeStyle.append(";mso-position-vertical:bottom");
break;
default:
case text::VertOrientation::NONE:
@@ -1120,17 +1118,17 @@ sal_Int32 VMLExport::StartShape()
switch (m_eVRel)
{
case text::RelOrientation::PAGE_PRINT_AREA:
- m_pShapeStyle->append(";mso-position-vertical-relative:margin");
+ m_pShapeStyle.append(";mso-position-vertical-relative:margin");
break;
case text::RelOrientation::PAGE_FRAME:
- m_pShapeStyle->append(";mso-position-vertical-relative:page");
+ m_pShapeStyle.append(";mso-position-vertical-relative:page");
break;
default:
break;
}
// add style
- m_pShapeAttrList->add( XML_style, m_pShapeStyle->makeStringAndClear() );
+ m_pShapeAttrList->add( XML_style, m_pShapeStyle.makeStringAndClear() );
OUString sAnchorId = lcl_getAnchorIdFromGrabBag(m_pSdrObject);
if (!sAnchorId.isEmpty())