diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-24 21:36:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-25 15:37:19 +0000 |
commit | 39e54d04804d1d8ad0d0dc10aad8ef89c2ff1e40 (patch) | |
tree | ec155ff205ced22506792bb2ca92a946830b0080 | |
parent | 0c5ed3541bd857060b046dace291bb7e971dcc73 (diff) |
move ugly WriteLines out of SvStream to beside sole user
-rw-r--r-- | basic/source/runtime/iosys.cxx | 13 | ||||
-rw-r--r-- | tools/inc/tools/stream.hxx | 1 | ||||
-rw-r--r-- | tools/source/stream/stream.cxx | 15 |
3 files changed, 12 insertions, 17 deletions
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(); } } diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index 9fcb72904732..d63b7d3c3059 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -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 ); diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 0e899050fced..db84400b77f9 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -932,21 +932,6 @@ sal_Bool SvStream::WriteLine(const rtl::OString& rStr) /************************************************************************* |* -|* 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() |* *************************************************************************/ |