diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-10 20:47:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-11 11:20:43 +0200 |
commit | 2d582244680e7f6dec6e4a466e276f93ccb01dc9 (patch) | |
tree | b0e880ddfb3ce1ea2f47151b648e7fbb55132f08 /writerperfect | |
parent | 74012c48d99634a7556a86f77e9522024f2afdb2 (diff) |
loplugin:flatten
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/source/writer/exp/XMLBase64ImportContext.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/writerperfect/source/writer/exp/XMLBase64ImportContext.cxx b/writerperfect/source/writer/exp/XMLBase64ImportContext.cxx index f281e39a4556..a7780e2d57db 100644 --- a/writerperfect/source/writer/exp/XMLBase64ImportContext.cxx +++ b/writerperfect/source/writer/exp/XMLBase64ImportContext.cxx @@ -36,23 +36,23 @@ void XMLBase64ImportContext::characters(const OUString& rChars) { OUString aTrimmedChars(rChars.trim()); - if (!aTrimmedChars.isEmpty()) - { - OUString aChars; - if (!m_aBase64CharsLeft.isEmpty()) - { - aChars = m_aBase64CharsLeft + aTrimmedChars; - m_aBase64CharsLeft.clear(); - } - else - aChars = aTrimmedChars; + if (aTrimmedChars.isEmpty()) + return; - uno::Sequence<sal_Int8> aBuffer((aChars.getLength() / 4) * 3); - const sal_Int32 nCharsDecoded = comphelper::Base64::decodeSomeChars(aBuffer, aChars); - m_aStream.WriteBytes(aBuffer.getArray(), aBuffer.getLength()); - if (nCharsDecoded != aChars.getLength()) - m_aBase64CharsLeft = aChars.copy(nCharsDecoded); + OUString aChars; + if (!m_aBase64CharsLeft.isEmpty()) + { + aChars = m_aBase64CharsLeft + aTrimmedChars; + m_aBase64CharsLeft.clear(); } + else + aChars = aTrimmedChars; + + uno::Sequence<sal_Int8> aBuffer((aChars.getLength() / 4) * 3); + const sal_Int32 nCharsDecoded = comphelper::Base64::decodeSomeChars(aBuffer, aChars); + m_aStream.WriteBytes(aBuffer.getArray(), aBuffer.getLength()); + if (nCharsDecoded != aChars.getLength()) + m_aBase64CharsLeft = aChars.copy(nCharsDecoded); } const librevenge::RVNGBinaryData& XMLBase64ImportContext::getBinaryData() const |