summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-24 11:28:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-24 11:29:09 +0000
commitc7cf94f70f4673b1f6933dbd28cbd89ab459fc45 (patch)
treeca423caef138668e03dd638683c5a14d46d5948d
parent2f6f58a06260029e3ef784956114a730d5790adc (diff)
clarify this code a little bit
no logic change intended Change-Id: I620822e71386bae05312474423c22b84d8608cbd
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index b8ac93dcd646..810aa106ccd0 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -537,6 +537,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
if( nLen )
{
sal_Int32 nOriginalTextLen = nLen;
+ sal_Int32 nOriginalBlockLen = ( nOriginalTextLen + 1 ) &~ 1;
Rectangle aRect;
if( nOptions & ETO_CLIPPED )
{
@@ -544,11 +545,11 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
const Point aPt2( ReadPoint() );
aRect = Rectangle( aPt1, aPt2 );
}
- std::unique_ptr<char[]> pChar(new char[ ( nOriginalTextLen + 1 ) &~ 1 ]);
- pWMF->ReadBytes(pChar.get(), (nOriginalTextLen + 1) &~ 1);
- OUString aText( pChar.get(), (sal_uInt16)nOriginalTextLen, pOut->GetCharSet() );// after this conversion the text may contain
- sal_Int32 nNewTextLen = aText.getLength(); // less character (japanese version), so the
- // dxAry will not fit
+ std::unique_ptr<char[]> pChar(new char[nOriginalBlockLen]);
+ pWMF->ReadBytes(pChar.get(), nOriginalBlockLen);
+ OUString aText(pChar.get(), nOriginalTextLen, pOut->GetCharSet()); // after this conversion the text may contain
+ sal_Int32 nNewTextLen = aText.getLength(); // less character (japanese version), so the
+ // dxAry will not fit
if ( nNewTextLen )
{
std::unique_ptr<long[]> pDXAry, pDYAry;