Kaydet (Commit) 39e54d04 authored tarafından Caolán McNamara's avatar Caolán McNamara

move ugly WriteLines out of SvStream to beside sole user

üst 0c5ed354
......@@ -703,6 +703,17 @@ void SbiStream::ExpandFile()
}
}
namespace
{
void WriteLines(SvStream &rStream, const ByteString& rStr)
{
ByteString aStr( rStr );
aStr.ConvertLineEnd( rStream.GetLineDelimiter() );
rStream.Write( aStr.GetBuffer(), aStr.Len() );
endl( rStream );
}
}
SbError SbiStream::Write( const ByteString& rBuf, sal_uInt16 n )
{
ExpandFile();
......@@ -720,7 +731,7 @@ SbError SbiStream::Write( const ByteString& rBuf, sal_uInt16 n )
aLine.Erase( nLineLen );
if( nLineLen && aLine.GetBuffer()[ --nLineLen ] == 0x0D )
aLine.Erase( nLineLen );
pStrm->WriteLines( aLine );
WriteLines(*pStrm, aLine);
aLine.Erase();
}
}
......
......@@ -383,7 +383,6 @@ public:
sal_Bool ReadLine( ByteString& rStr );
sal_Bool ReadLine( rtl::OString& rStr );
sal_Bool WriteLine( const rtl::OString& rStr );
sal_Bool WriteLines( const ByteString& rStr );
sal_Bool ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet );
sal_Bool WriteByteStringLine( const String& rStr, rtl_TextEncoding eDestCharSet );
......
......@@ -930,21 +930,6 @@ sal_Bool SvStream::WriteLine(const rtl::OString& rStr)
return nError == SVSTREAM_OK;
}
/*************************************************************************
|*
|* Stream::WriteLines()
|*
*************************************************************************/
sal_Bool SvStream::WriteLines( const ByteString& rStr )
{
ByteString aStr( rStr );
aStr.ConvertLineEnd( eLineDelimiter );
Write( aStr.GetBuffer(), aStr.Len() );
endl( *this );
return (sal_Bool)(nError == SVSTREAM_OK);
}
/*************************************************************************
|*
|* Stream::WriteUniOrByteChar()
......
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