From e03e9bfda7c1f5496879587ce1488faf94e6104b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 21 Oct 2013 16:49:24 +0100 Subject: [PATCH] Resolves: fdo#70725 calc export to pdf broken Change-Id: Ibfe1d3a319fc82223f340ebd705a1966b8250089 --- vcl/source/gdi/cvtsvm.cxx | 2 +- vcl/source/gdi/pdfwriter_impl2.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index a58b7194ed5c..bcff2623dad6 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -1705,7 +1705,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction; OString aText(OUStringToOString(pAct->GetText(), rActualCharSet)); - OUString aUniText = pAct->GetText().copy( pAct->GetIndex(), pAct->GetLen() ); + OUString aUniText = pAct->GetText().copy( pAct->GetIndex(), std::min(pAct->GetText().getLength() - pAct->GetIndex(), pAct->GetLen()) ); sal_uLong nAryLen; sal_uLong nLen = pAct->GetLen(); const sal_uLong nTextLen = aText.getLength(); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 9484df20b25f..97d92bad15db 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -842,7 +842,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_TEXT_ACTION ): { const MetaTextAction* pA = (const MetaTextAction*) pAction; - m_rOuterFace.DrawText( pA->GetPoint(), pA->GetText().copy( pA->GetIndex(), pA->GetLen() ) ); + m_rOuterFace.DrawText( pA->GetPoint(), pA->GetText().copy( pA->GetIndex(), std::min(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ) ); } break;