Kaydet (Commit) 5eb475f3 authored tarafından Caolán McNamara's avatar Caolán McNamara

ByteString->rtl::OStringBuffer

üst 84841b11
...@@ -923,6 +923,20 @@ String PPDParser::handleTranslation(const rtl::OString& i_rString, bool bIsGloba ...@@ -923,6 +923,20 @@ String PPDParser::handleTranslation(const rtl::OString& i_rString, bool bIsGloba
return OStringToOUString( aTrans.makeStringAndClear(), bIsGlobalized ? RTL_TEXTENCODING_UTF8 : m_aFileEncoding ); return OStringToOUString( aTrans.makeStringAndClear(), bIsGlobalized ? RTL_TEXTENCODING_UTF8 : m_aFileEncoding );
} }
namespace
{
bool oddDoubleQuoteCount(rtl::OStringBuffer &rBuffer)
{
bool bHasOddCount = false;
for (sal_Int32 i = 0; i < rBuffer.getLength(); ++i)
{
if (rBuffer[i] == '"')
bHasOddCount = !bHasOddCount;
}
return bHasOddCount;
}
}
void PPDParser::parse( ::std::list< rtl::OString >& rLines ) void PPDParser::parse( ::std::list< rtl::OString >& rLines )
{ {
std::list< rtl::OString >::iterator line = rLines.begin(); std::list< rtl::OString >::iterator line = rLines.begin();
...@@ -1020,16 +1034,16 @@ void PPDParser::parse( ::std::list< rtl::OString >& rLines ) ...@@ -1020,16 +1034,16 @@ void PPDParser::parse( ::std::list< rtl::OString >& rLines )
aLine = aCurrentLine.Copy( nPos+1 ); aLine = aCurrentLine.Copy( nPos+1 );
if( aLine.Len() ) if( aLine.Len() )
{ {
while( ! ( aLine.GetTokenCount( '"' ) & 1 ) && //while( ! ( aLine.GetTokenCount( '"' ) & 1 ) &&
line != rLines.end() ) rtl::OStringBuffer aBuffer(aLine);
// while there is an even number of tokens; that means while (line != rLines.end() && oddDoubleQuoteCount(aBuffer))
// an odd number of doubleqoutes
{ {
// copy the newlines also // copy the newlines also
aLine += '\n'; aBuffer.append('\n');
aLine += ByteString(*line); aBuffer.append(*line);
++line; ++line;
} }
aLine = aBuffer.makeStringAndClear();
} }
aLine = WhitespaceToSpace( aLine ); aLine = WhitespaceToSpace( aLine );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment