From 2769f2d0615df4b0c720f4b62bfd174f818bd544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 29 Jul 2011 23:22:28 +0100 Subject: [PATCH] simply this and return a new string --- svtools/inc/svtools/htmlout.hxx | 5 +++-- svtools/source/svhtml/htmlout.cxx | 32 +++++++++++++++++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/svtools/inc/svtools/htmlout.hxx b/svtools/inc/svtools/htmlout.hxx index 06caae765b6a..e0099626094c 100644 --- a/svtools/inc/svtools/htmlout.hxx +++ b/svtools/inc/svtools/htmlout.hxx @@ -32,6 +32,7 @@ #include "svtools/svtdllapi.h" #include #include +#include #include class Color; @@ -113,11 +114,11 @@ struct HTMLOutFuncs String *pNonConvertableChars = 0 ); // - SVT_DLLPUBLIC static ByteString& CreateTableDataOptionsValNum( ByteString& aStrTD, + SVT_DLLPUBLIC static rtl::OString CreateTableDataOptionsValNum( sal_Bool bValue, double fVal, sal_uLong nFormat, SvNumberFormatter& rFormatter, rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, - String *pNonConvertableChars = 0 ); + String *pNonConvertableChars = 0); SVT_DLLPUBLIC static sal_Bool PrivateURLToInternalImg( String& rURL ); }; diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index f1d56f7f6fc5..fc1eea6bf6de 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -44,10 +44,6 @@ #include #include "svl/urihelper.hxx" -#ifndef RTL_CONSTASCII_STRINGPARAM -#define RTL_CONSTASCII_STRINGPARAM( c ) c, sizeof(c)-1 -#endif - #if defined(UNX) const sal_Char HTMLOutFuncs::sNewLine = '\012'; #else @@ -939,25 +935,32 @@ SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm, return rStrm; } -ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD, +rtl::OString HTMLOutFuncs::CreateTableDataOptionsValNum( sal_Bool bValue, double fVal, sal_uLong nFormat, SvNumberFormatter& rFormatter, - rtl_TextEncoding eDestEnc, String* pNonConvertableChars ) + rtl_TextEncoding eDestEnc, String* pNonConvertableChars) { + rtl::OStringBuffer aStrTD; + if ( bValue ) { // printf / scanf ist zu ungenau String aValStr; rFormatter.GetInputLineString( fVal, 0, aValStr ); ByteString sTmp( aValStr, eDestEnc ); - ((((aStrTD += ' ') += OOO_STRING_SVTOOLS_HTML_O_SDval) += "=\"") += sTmp) += '\"'; + aStrTD.append(' '). + append(OOO_STRING_SVTOOLS_HTML_O_SDval). + append(RTL_CONSTASCII_STRINGPARAM("=\"")). + append(sTmp).append('\"'); } if ( bValue || nFormat ) { - ((aStrTD += ' ') += OOO_STRING_SVTOOLS_HTML_O_SDnum) += "=\""; - (aStrTD += ByteString::CreateFromInt32( - Application::GetSettings().GetLanguage() )) - += ';'; // Language fuer Format 0 + aStrTD.append(' '). + append(OOO_STRING_SVTOOLS_HTML_O_SDnum). + append(RTL_CONSTASCII_STRINGPARAM("=\"")). + append(static_cast( + Application::GetSettings().GetLanguage())). + append(';'); // Language fuer Format 0 if ( nFormat ) { ByteString aNumStr; @@ -971,11 +974,12 @@ ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD, } else nLang = LANGUAGE_SYSTEM; - ((aStrTD += ByteString::CreateFromInt32(nLang)) += ';') += aNumStr; + aStrTD.append(static_cast(nLang)).append(';'). + append(aNumStr); } - aStrTD += '\"'; + aStrTD.append('\"'); } - return aStrTD; + return aStrTD.makeStringAndClear(); } sal_Bool HTMLOutFuncs::PrivateURLToInternalImg( String& rURL )