summaryrefslogtreecommitdiff
path: root/filter/source/svg/svgwriter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'filter/source/svg/svgwriter.cxx')
-rw-r--r--filter/source/svg/svgwriter.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 44fe1253bd36..01d218b5c227 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -3427,7 +3427,8 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
if( nWriteFlags & SVGWRITER_WRITE_TEXT )
{
const MetaTextAction* pA = static_cast<const MetaTextAction*>(pAction);
- const OUString aText = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
+ sal_Int32 aLength = std::min( pA->GetText().getLength(), pA->GetLen() );
+ const OUString aText = pA->GetText().copy( pA->GetIndex(), aLength );
if( !aText.isEmpty() )
{
@@ -3474,7 +3475,8 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
if( nWriteFlags & SVGWRITER_WRITE_TEXT )
{
const MetaTextArrayAction* pA = static_cast<const MetaTextArrayAction*>(pAction);
- const OUString aText = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
+ sal_Int32 aLength = std::min( pA->GetText().getLength(), pA->GetLen() );
+ const OUString aText = pA->GetText().copy( pA->GetIndex(), aLength );
if( !aText.isEmpty() )
{
@@ -3498,7 +3500,8 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
if( nWriteFlags & SVGWRITER_WRITE_TEXT )
{
const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pAction);
- const OUString aText = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
+ sal_Int32 aLength = std::min( pA->GetText().getLength(), pA->GetLen() );
+ const OUString aText = pA->GetText().copy( pA->GetIndex(), aLength );
if( !aText.isEmpty() )
{