From 39e54d04804d1d8ad0d0dc10aad8ef89c2ff1e40 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 24 Jan 2012 21:36:38 +0000 Subject: move ugly WriteLines out of SvStream to beside sole user --- basic/source/runtime/iosys.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'basic') diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 64ab1d9d66e0..79dcb0ef8b2d 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -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(); } } -- cgit v1.2.3