diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-10 11:54:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-10 18:50:52 +0200 |
commit | 241bee7e4be6a205fae0d3f5508e084462c7ca55 (patch) | |
tree | 7d8771a5cbbe7021106852f1a54496faeea6ad4e /dbaccess | |
parent | 36567d58115e21c111b45c011524ddbae540fd91 (diff) |
convert WriteCharPtr..getStr to WriteOString
and improve the WriteOString method, we can avoid the strlen here, we
already have the length
One change in behaviour to be noted - if the string contains
trailing zero bytes, which ARE INCLUDED IN THE STRING LENGTH,
i.e. I'm not talking about the normal terminating zero, then this
patch changes behaviour because we will now write those zeros to
the stream.
Change-Id: I4668b9b9eb877f820b1dc70d6cd10ba2623bc0a2
Reviewed-on: https://gerrit.libreoffice.org/80597
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/misc/TokenWriter.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index fb82d00d1e77..d134f3207d09 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -354,7 +354,7 @@ bool ORTFImportExport::Write() m_pStream->WriteCharPtr( "\\f" ); m_pStream->WriteInt32AsString(++nTok); m_pStream->WriteCharPtr( "\\fcharset0\\fnil " ); - m_pStream->WriteCharPtr( aFonts.getToken(0, ';', nIdx).getStr() ); + m_pStream->WriteOString( aFonts.getToken(0, ';', nIdx) ); m_pStream->WriteChar( ';' ); } while (nIdx>=0); } @@ -522,7 +522,7 @@ void ORTFImportExport::appendRow(OString const * pHorzChar,sal_Int32 _nColumnCou { m_pStream->WriteCharPtr( SAL_NEWLINE_STRING ); m_pStream->WriteChar( '{' ); - m_pStream->WriteCharPtr( pHorzChar[i-1].getStr() ); + m_pStream->WriteOString( pHorzChar[i-1] ); if ( bBold ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_B ); if ( bItalic ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_I ); @@ -659,7 +659,7 @@ void OHTMLImportExport::WriteBody() m_pStream->WriteCharPtr( "<" ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_style ).WriteCharPtr( " " ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_type ).WriteCharPtr( "=\"text/css\">" ); m_pStream->WriteCharPtr( "<!-- " ); OUT_LF(); - m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteCharPtr( " { " ).WriteCharPtr( "font-family: " ).WriteChar( '"' ).WriteCharPtr( OUStringToOString(m_aFont.Name, osl_getThreadTextEncoding()).getStr() ).WriteChar( '\"' ); + m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteCharPtr( " { " ).WriteCharPtr( "font-family: " ).WriteChar( '"' ).WriteOString( OUStringToOString(m_aFont.Name, osl_getThreadTextEncoding()) ).WriteChar( '\"' ); // TODO : think about the encoding of the font name m_pStream->WriteCharPtr( "; " ).WriteCharPtr( "font-size: " ); m_pStream->WriteInt32AsString(m_aFont.Height); @@ -738,7 +738,7 @@ void OHTMLImportExport::WriteTables() TAG_ON( OOO_STRING_SVTOOLS_HTML_caption ); TAG_ON( OOO_STRING_SVTOOLS_HTML_bold ); - m_pStream->WriteCharPtr( OUStringToOString(m_sName, osl_getThreadTextEncoding()).getStr() ); + m_pStream->WriteOString( OUStringToOString(m_sName, osl_getThreadTextEncoding()) ); // TODO : think about the encoding of the name TAG_OFF( OOO_STRING_SVTOOLS_HTML_bold ); TAG_OFF( OOO_STRING_SVTOOLS_HTML_caption ); @@ -941,7 +941,7 @@ void OHTMLImportExport::FontOn() aStrOut = aStrOut + " "; aStrOut = aStrOut + OOO_STRING_SVTOOLS_HTML_O_color; aStrOut = aStrOut + "="; - m_pStream->WriteCharPtr( aStrOut.getStr() ); + m_pStream->WriteOString( aStrOut ); sal_Int32 nColor = 0; if(m_xObject.is()) |