diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-28 18:07:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-29 12:14:02 +0200 |
commit | a612d738a8c909e18ed89675432ca42b376ef624 (patch) | |
tree | 67729979d1f7b14726dce15f3d44faaf54e28bde /sdext | |
parent | 415436ad27b4522102d3fbbb6003935871029fc6 (diff) |
loplugin:stringloop in sd
Change-Id: I5b0cd65b6e69490c79e0ac37c137283d19711787
Reviewed-on: https://gerrit.libreoffice.org/58252
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/pdfimport/pdfparse/pdfentries.cxx | 18 | ||||
-rw-r--r-- | sdext/source/pdfimport/pdfparse/pdfparse.cxx | 11 |
2 files changed, 14 insertions, 15 deletions
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index a55c45e7a093..64338984907d 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -1276,10 +1276,10 @@ PDFFileImplData* PDFFile::impl_getData() const if( pStr ) m_pData->m_aDocID = pStr->getFilteredString(); #if OSL_DEBUG_LEVEL > 0 - OUString aTmp; + OUStringBuffer aTmp; for( int i = 0; i < m_pData->m_aDocID.getLength(); i++ ) - aTmp += OUString::number(static_cast<unsigned int>(sal_uInt8(m_pData->m_aDocID[i])), 16); - SAL_INFO("sdext.pdfimport.pdfparse", "DocId is <" << aTmp << ">"); + aTmp.append(OUString::number(static_cast<unsigned int>(sal_uInt8(m_pData->m_aDocID[i])), 16)); + SAL_INFO("sdext.pdfimport.pdfparse", "DocId is <" << aTmp.makeStringAndClear() << ">"); #endif } } @@ -1340,11 +1340,11 @@ PDFFileImplData* PDFFile::impl_getData() const #if OSL_DEBUG_LEVEL > 0 else { - OUString aTmp; + OUStringBuffer aTmp; for( int i = 0; i < aEnt.getLength(); i++ ) - aTmp += " " + OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16); + aTmp.append(" ").append(OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16)); SAL_WARN("sdext.pdfimport.pdfparse", - "O entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp << ">" ); + "O entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp.makeStringAndClear() << ">" ); } #endif } @@ -1360,11 +1360,11 @@ PDFFileImplData* PDFFile::impl_getData() const #if OSL_DEBUG_LEVEL > 0 else { - OUString aTmp; + OUStringBuffer aTmp; for( int i = 0; i < aEnt.getLength(); i++ ) - aTmp += " " + OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16); + aTmp.append(" ").append(OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16)); SAL_WARN("sdext.pdfimport.pdfparse", - "U entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp << ">" ); + "U entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp.makeStringAndClear() << ">" ); } #endif } diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx index 97ba78d2a80b..64dcf7d71989 100644 --- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx @@ -37,6 +37,7 @@ #include <string.h> #include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> #include <rtl/alloc.h> // disable warnings again because someone along the line has enabled them @@ -648,16 +649,14 @@ PDFEntry* PDFReader::read( const char* pFileName ) { SAL_WARN("sdext.pdfimport.pdfparse", "parse error: " << rError.descriptor << " at buffer pos " << rError.where - file_start); #if OSL_DEBUG_LEVEL > 0 - OUString aTmp; + OUStringBuffer aTmp; unsigned int nElem = aGrammar.m_aObjectStack.size(); for( unsigned int i = 0; i < nElem; i++ ) { - aTmp += " "; - aTmp += OUString(typeid( *(aGrammar.m_aObjectStack[i]) ).name(), - strlen(typeid( *(aGrammar.m_aObjectStack[i]) ).name()), - RTL_TEXTENCODING_ASCII_US); + aTmp.append(" "); + aTmp.appendAscii(typeid( *(aGrammar.m_aObjectStack[i]) ).name()); } - SAL_WARN("sdext.pdfimport.pdfparse", "parse error object stack: " << aTmp); + SAL_WARN("sdext.pdfimport.pdfparse", "parse error object stack: " << aTmp.makeStringAndClear()); #endif } |