diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-31 15:48:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-02 11:08:40 +0100 |
commit | 96272f26e93bc70820cb1472a38320a29db650c2 (patch) | |
tree | c008defa786cfeacc462200ac9c26fa2a30861fd | |
parent | 07960b6253c064b4d1649437fc2a200b824a536b (diff) |
ByteString::CreateFromInt32 -> rtl::OStringBuffer::append
-rw-r--r-- | sw/source/filter/html/htmldraw.cxx | 50 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfly.cxx | 204 | ||||
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 122 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnum.cxx | 31 | ||||
-rw-r--r-- | sw/source/filter/html/htmltabw.cxx | 90 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 33 |
6 files changed, 307 insertions, 223 deletions
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx index 1c073a2da8..403f1b253a 100644 --- a/sw/source/filter/html/htmldraw.cxx +++ b/sw/source/filter/html/htmldraw.cxx @@ -67,6 +67,7 @@ #include "swcss1.hxx" #include "swhtml.hxx" #include "wrthtml.hxx" +#include <rtl/strbuf.hxx> using namespace ::com::sun::star; @@ -698,8 +699,8 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, if( !pOutlinerParaObj ) return rWrt; - ByteString sOut( '<' ); - sOut += OOO_STRING_SVTOOLS_HTML_marquee; + rtl::OStringBuffer sOut; + sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_marquee); // Die Attribute des Objektd holen const SfxItemSet& rItemSet = pTextObj->GetMergedItemSet(); @@ -722,7 +723,10 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, } if( pStr ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_behavior) += '=') += pStr; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_behavior). + append('=').append(pStr); + } // DIRECTION pStr = 0; @@ -736,7 +740,10 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, } if( pStr ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_direction) += '=') += pStr; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_direction). + append('=').append(pStr); + } // LOOP sal_Int32 nCount = @@ -744,15 +751,15 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, .GetValue(); if( 0==nCount ) nCount = SDRTEXTANI_SLIDE==eAniKind ? 1 : -1; - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_loop) += '=') - += ByteString::CreateFromInt32( nCount ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_loop).append('='). + append(nCount); // SCROLLDELAY sal_uInt16 nDelay = ((const SdrTextAniDelayItem&)rItemSet.Get( SDRATTR_TEXT_ANIDELAY )) .GetValue(); - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_scrolldelay) += '=') - += ByteString::CreateFromInt32( nDelay ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrolldelay). + append('=').append(static_cast<sal_Int32>(nDelay)); // SCROLLAMOUNT sal_Int16 nAmount = @@ -769,8 +776,10 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, MapMode(MAP_TWIP) ).Width()); } if( nAmount ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_scrollamount) += '=') - += ByteString::CreateFromInt32( nAmount ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrollamount). + append('=').append(static_cast<sal_Int32>(nAmount)); + } Size aTwipSz( pTextObj->GetLogicRect().GetSize() ); if( pTextObj->IsAutoGrowWidth() ) @@ -799,12 +808,16 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, aPixelSz.Height() = 1; if( aPixelSz.Width() ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_width) += '=') - += ByteString::CreateFromInt32( aPixelSz.Width() ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). + append('=').append(static_cast<sal_Int32>(aPixelSz.Width())); + } if( aPixelSz.Height() ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_height) += '=') - += ByteString::CreateFromInt32( aPixelSz.Height() ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). + append('=').append(static_cast<sal_Int32>(aPixelSz.Height())); + } } // BGCOLOR @@ -815,14 +828,13 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, const Color& rFillColor = ((const XFillColorItem&)rItemSet.Get(XATTR_FILLCOLOR)).GetColorValue(); - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_bgcolor) += '='; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).append('='); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_Color( rWrt.Strm(), rFillColor, rHTMLWrt.eDestEnc ); - sOut.Erase(); } - if( sOut.Len() ) - rWrt.Strm() << sOut.GetBuffer(); + if (sOut.getLength()) + rWrt.Strm() << sOut.makeStringAndClear().getStr(); // und nun noch ALIGN, HSPACE und VSPACE ByteString aEndTags; diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index a6bd6c3894..d278127ed9 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -547,7 +547,7 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, ByteString &rEndTags, sal_uInt32 nFrmOpts ) { - ByteString sOut; + rtl::OStringBuffer sOut; const SfxPoolItem* pItem; const SfxItemSet& rItemSet = rFrmFmt.GetAttrSet(); @@ -557,18 +557,18 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, { const sal_Char *pStr = (nFrmOpts & HTML_FRMOPT_ID) ? OOO_STRING_SVTOOLS_HTML_O_id : OOO_STRING_SVTOOLS_HTML_O_name; - ((sOut += ' ') += pStr) += "=\""; - Strm() << sOut.GetBuffer(); + sOut.append(' ').append(pStr). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( Strm(), rFrmFmt.GetName(), eDestEnc, &aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } // Name if( nFrmOpts & HTML_FRMOPT_DIR ) { sal_uInt16 nDir = GetHTMLDirection( rItemSet ); - Strm() << sOut.GetBuffer(); - sOut.Erase(); + Strm() << sOut.makeStringAndClear().getStr(); OutDirection( nDir ); } @@ -576,10 +576,11 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, // ALT if( (nFrmOpts & HTML_FRMOPT_ALT) && rAlternateTxt.Len() ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_alt) += "=\""; - Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_alt). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( Strm(), rAlternateTxt, eDestEnc, &aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } // ALIGN @@ -621,7 +622,10 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, } } if( pStr ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align) += '=') += pStr; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append('='). + append(pStr); + } // HSPACE und VSPACE @@ -657,14 +661,14 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, if( aPixelSpc.Width() ) { - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_hspace) += '=') - += ByteString::CreateFromInt32( aPixelSpc.Width() ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace). + append('=').append(static_cast<sal_Int32>(aPixelSpc.Width())); } if( aPixelSpc.Height() ) { - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_vspace) += '=') - += ByteString::CreateFromInt32( aPixelSpc.Height() ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace). + append('=').append(static_cast<sal_Int32>(aPixelSpc.Height())); } } @@ -732,26 +736,28 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, if( (nFrmOpts & HTML_FRMOPT_WIDTH) && ((nPrcWidth && nPrcWidth!=255) || aPixelSz.Width()) ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_width) += '='; + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). + append('='); if( nPrcWidth ) - (sOut += ByteString::CreateFromInt32( nPrcWidth )) += '%'; + sOut.append(static_cast<sal_Int32>(nPrcWidth)).append('%'); else - sOut += ByteString::CreateFromInt32( aPixelSz.Width() ); + sOut.append(static_cast<sal_Int32>(aPixelSz.Width())); } if( (nFrmOpts & HTML_FRMOPT_HEIGHT) && ((nPrcHeight && nPrcHeight!=255) || aPixelSz.Height()) ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_height) += '='; + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). + append('='); if( nPrcHeight ) - (sOut += ByteString::CreateFromInt32( nPrcHeight )) += '%'; + sOut.append(static_cast<sal_Int32>(nPrcHeight)).append('%'); else - sOut += ByteString::CreateFromInt32( aPixelSz.Height() ); + sOut.append(static_cast<sal_Int32>(aPixelSz.Height())); } } - if( sOut.Len() ) - Strm() << sOut.GetBuffer(); + if (sOut.getLength()) + Strm() << sOut.makeStringAndClear().getStr(); // Umlauf fuer absatzgeb. Grafiken als <BR CLEAR=...> in den String // schreiben @@ -811,9 +817,10 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, if( pStr ) { - (((((((sOut = '<') += OOO_STRING_SVTOOLS_HTML_linebreak) += ' ') - += OOO_STRING_SVTOOLS_HTML_O_clear) += '=') += pStr) += '>') += rEndTags; - rEndTags = sOut; + sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_linebreak). + append(' ').append(OOO_STRING_SVTOOLS_HTML_O_clear). + append('=').append(pStr).append('>').append(rEndTags); + rEndTags = sOut.makeStringAndClear().getStr(); } } } @@ -987,7 +994,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, rHTMLWrt.OutNewLine( sal_True ); // Attribute die ausserhelb der Grafik geschreiben werden muessen sammeln - ByteString sOut; + rtl::OStringBuffer sOut; ByteString aEndTags; // implizite Sprungmarke -> <A NAME=...></A>...<IMG ...> @@ -1014,40 +1021,41 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, if( aMapURL.Len() || aName.Len() || aTarget.Len() || bEvents ) { - (sOut = '<') += OOO_STRING_SVTOOLS_HTML_anchor; + sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_anchor); // Ein HREF nur Ausgaben, wenn es einen Link oder Makros gibt if( aMapURL.Len() || bEvents ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_href) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_href). + append("=\""); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); rHTMLWrt.OutHyperlinkHRefValue( aMapURL ); - sOut = '\"'; + sOut.append('\"'); } if( aName.Len() ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_name) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), aName, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } if( aTarget.Len() ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_target) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_target). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), aTarget, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; - } - if( sOut.Len() ) - { - rWrt.Strm() << sOut.GetBuffer(); - sOut.Erase(); + sOut.append('\"'); } + if (sOut.getLength()) + rWrt.Strm() << sOut.makeStringAndClear().getStr(); + if( pMacItem ) { const SvxMacroTableDtor& rMacTable = pMacItem->GetMacroTable(); @@ -1060,8 +1068,10 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, } rWrt.Strm() << ">"; - (((sOut = "</") += OOO_STRING_SVTOOLS_HTML_anchor) += ">") += aEndTags; - aEndTags = sOut; + aEndTags = rtl::OStringBuffer().append("</"). + append(OOO_STRING_SVTOOLS_HTML_anchor). + append(RTL_CONSTASCII_STRINGPARAM(">")).append(aEndTags). + makeStringAndClear(); } } @@ -1125,24 +1135,28 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, if( pColBorderLine ) { - sOut = '<'; - (((sOut += OOO_STRING_SVTOOLS_HTML_font) += ' ') += OOO_STRING_SVTOOLS_HTML_O_color) += '='; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append('<'); + sOut.append(OOO_STRING_SVTOOLS_HTML_font).append(' '). + append(OOO_STRING_SVTOOLS_HTML_O_color).append('='); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_Color( rWrt.Strm(), pColBorderLine->GetColor(), rHTMLWrt.eDestEnc ) << '>'; - (((sOut = "</" ) += OOO_STRING_SVTOOLS_HTML_font) += '>') += aEndTags; - aEndTags = sOut; + aEndTags = rtl::OStringBuffer(). + append(RTL_CONSTASCII_STRINGPARAM("</")). + append(OOO_STRING_SVTOOLS_HTML_font). + append('>').append(aEndTags); } } - sOut = '<'; - (((sOut += OOO_STRING_SVTOOLS_HTML_image) += ' ') += OOO_STRING_SVTOOLS_HTML_O_src) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append('<'); + sOut.append(OOO_STRING_SVTOOLS_HTML_image).append(' '). + append(OOO_STRING_SVTOOLS_HTML_O_src). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), aGrfNm, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ) << '\"'; // Events - sOut.Erase(); if( SFX_ITEM_SET == rItemSet.GetItemState( RES_FRMMACRO, sal_True, &pItem )) { const SvxMacroTableDtor& rMacTable = @@ -1161,20 +1175,21 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, if( nFrmOpts & HTML_FRMOPT_BORDER ) { - (((sOut = ' ') += OOO_STRING_SVTOOLS_HTML_O_border) += '=') - += ByteString::CreateFromInt32( nBorderWidth ); - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_border). + append('=').append(static_cast<sal_Int32>(nBorderWidth)); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); } if( pURLItem && pURLItem->IsServerMap() ) { - (sOut = ' ') += OOO_STRING_SVTOOLS_HTML_O_ismap; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_ismap); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); } if( aIMapName.Len() ) { - ((sOut = ' ') += OOO_STRING_SVTOOLS_HTML_O_usemap) += "=\"#"; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_usemap). + append(RTL_CONSTASCII_STRINGPARAM("=\"#")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), aIMapName, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ) << '\"'; } @@ -1251,20 +1266,21 @@ Writer& OutHTML_BulletImage( Writer& rWrt, pLink = &rGrfName; } - ByteString sOut; + rtl::OStringBuffer sOut; if( pTag ) - (sOut += '<') += pTag; + sOut.append('<').append(pTag); if( pLink ) { - sOut += ' '; + sOut.append(' '); String s( *pLink ); if( !HTMLOutFuncs::PrivateURLToInternalImg(s) ) s = URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), s); - (sOut += OOO_STRING_SVTOOLS_HTML_O_src) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(OOO_STRING_SVTOOLS_HTML_O_src). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), s, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); // Groesse des Objekts Twips ohne Raender Size aPixelSz( 0, 0 ); @@ -1280,12 +1296,16 @@ Writer& OutHTML_BulletImage( Writer& rWrt, } if( aPixelSz.Width() ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_width) += '=') - += ByteString::CreateFromInt32( aPixelSz.Width() ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). + append('=').append(static_cast<sal_Int32>(aPixelSz.Width())); + } if( aPixelSz.Height() ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_height) += '=') - += ByteString::CreateFromInt32( aPixelSz.Height() ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). + append('=').append(static_cast<sal_Int32>(aPixelSz.Height())); + } if( pVertOrient ) { @@ -1304,13 +1324,16 @@ Writer& OutHTML_BulletImage( Writer& rWrt, case text::VertOrientation::NONE: break; } if( pStr ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align) += '=') += pStr; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). + append('=').append(pStr); + } } } - if( pTag ) - sOut += '>'; - rWrt.Strm() << sOut.GetBuffer(); + if (pTag) + sOut.append('>'); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); return rWrt; } @@ -1380,16 +1403,18 @@ static Writer & OutHTML_FrmFmtAsMulticol( Writer& rWrt, if( rHTMLWrt.bLFPossible ) rHTMLWrt.OutNewLine(); - ByteString sOut( '<' ); - sOut += OOO_STRING_SVTOOLS_HTML_multicol; + rtl::OStringBuffer sOut; + sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_multicol); const SwFmtCol& rFmtCol = rFrmFmt.GetCol(); // die Anzahl der Spalten als COLS ausgeben sal_uInt16 nCols = rFmtCol.GetNumCols(); if( nCols ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_cols) += '=') - += ByteString::CreateFromInt32( nCols ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols). + append('=').append(static_cast<sal_Int32>(nCols)); + } // die Gutter-Breite (Minimalwert) als GUTTER sal_uInt16 nGutter = rFmtCol.GetGutterWidth( sal_True ); @@ -1401,11 +1426,11 @@ static Writer & OutHTML_FrmFmtAsMulticol( Writer& rWrt, ->LogicToPixel( Size(nGutter,0), MapMode(MAP_TWIP) ).Width(); } - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_gutter) += '=') - += ByteString::CreateFromInt32( nGutter ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_gutter). + append('=').append(static_cast<sal_Int32>(nGutter)); } - rWrt.Strm() << sOut.GetBuffer(); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); // WIDTH sal_uLong nFrmFlags = bInCntnr ? HTML_FRMOPTS_MULTICOL_CNTNR @@ -1689,7 +1714,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, sal_uInt16 nSize = bHeader ? rULSpace.GetLower() : rULSpace.GetUpper(); rHTMLWrt.nHeaderFooterSpace = nSize; - ByteString aSpacer; + rtl::OString aSpacer; if( rHTMLWrt.IsHTMLMode(HTMLMODE_VERT_SPACER) && nSize > HTML_PARSPACE && Application::GetDefaultDevice() ) { @@ -1697,9 +1722,12 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, nSize = (sal_Int16)Application::GetDefaultDevice() ->LogicToPixel( Size(nSize,0), MapMode(MAP_TWIP) ).Width(); - ((((((((aSpacer = OOO_STRING_SVTOOLS_HTML_spacer) += ' ') - += OOO_STRING_SVTOOLS_HTML_O_type) += '=') += OOO_STRING_SVTOOLS_HTML_SPTYPE_vertical) += ' ') - += OOO_STRING_SVTOOLS_HTML_O_size) += '=') += ByteString::CreateFromInt32(nSize); + aSpacer = rtl::OStringBuffer(OOO_STRING_SVTOOLS_HTML_spacer). + append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type). + append('=').append(OOO_STRING_SVTOOLS_HTML_SPTYPE_vertical). + append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). + append('=').append(static_cast<sal_Int32>(nSize)). + makeStringAndClear(); } const SwFmtCntnt& rFlyCntnt = rFrmFmt.GetCntnt(); @@ -1707,10 +1735,10 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, const SwStartNode* pSttNd = rWrt.pDoc->GetNodes()[nStt]->GetStartNode(); OSL_ENSURE( pSttNd, "Wo ist der Start-Node" ); - if( !bHeader && aSpacer.Len() ) + if( !bHeader && aSpacer.getLength() ) { rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.GetBuffer() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.getStr() ); } { @@ -1728,10 +1756,10 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, rHTMLWrt.Out_SwDoc( rWrt.pCurPam ); } - if( bHeader && aSpacer.Len() ) + if( bHeader && aSpacer.getLength() ) { rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.GetBuffer() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.getStr() ); } rHTMLWrt.DecIndentLevel(); // den Inhalt von Multicol einruecken; diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index c4f55da8d2..7412b85408 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -73,6 +73,7 @@ #include "htmlfly.hxx" #include "htmlform.hxx" #include "frmfmt.hxx" +#include <rtl/strbuf.hxx> using namespace ::com::sun::star; using ::rtl::OUString; @@ -776,7 +777,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, OOO_STRING_SVTOOLS_HTML_IT_button }; Type eType = TYPE_NONE; OUString sValue; - ByteString sOptions; + rtl::OStringBuffer sOptions; sal_Bool bEmptyValue = sal_False; uno::Any aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("ClassId")) ); @@ -793,7 +794,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( aTmp.getValueType() == ::getCppuType((const sal_Int16*)0) && STATE_NOCHECK != *(sal_Int16*) aTmp.getValue() ) { - (sOptions += ' ') += OOO_STRING_SVTOOLS_HTML_O_checked; + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_checked); } aTmp = xPropSet->getPropertyValue( @@ -855,15 +856,17 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, // wieviele sind sichtbar ?? if( aSz.Height() ) - (((sOptions += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_size ) += '=' ) - += ByteString::CreateFromInt32( aSz.Height() ); + { + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). + append('=').append(static_cast<sal_Int32>(aSz.Height())); + } aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MultiSelection")) ); if( aTmp.getValueType() == ::getBooleanCppuType() && *(sal_Bool*)aTmp.getValue() ) { - (sOptions += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_multiple; + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_multiple); } } break; @@ -889,11 +892,17 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, eTag = TAG_TEXTAREA; if( aSz.Height() ) - (((sOptions += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_rows ) += '=' ) - += ByteString::CreateFromInt32( aSz.Height() ); + { + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rows). + append('='). + append(static_cast<sal_Int32>(aSz.Height())); + } if( aSz.Width() ) - (((sOptions += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_cols ) += '=' ) - += ByteString::CreateFromInt32( aSz.Width() ); + { + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols). + append('='). + append(static_cast<sal_Int32>(aSz.Width())); + } aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("HScroll")) ); @@ -908,7 +917,8 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, (aTmp.getValueType() == ::getBooleanCppuType() && *(sal_Bool*)aTmp.getValue()) ? OOO_STRING_SVTOOLS_HTML_WW_hard : OOO_STRING_SVTOOLS_HTML_WW_soft; - (((sOptions += ' ') += OOO_STRING_SVTOOLS_HTML_O_wrap) += '=') += pWrapStr; + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_wrap). + append('=').append(pWrapStr); } } else @@ -924,17 +934,20 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, } if( aSz.Width() ) - (((sOptions += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_size ) += '=' ) - += ByteString::CreateFromInt32( aSz.Width() ); + { + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). + append('=').append(static_cast<sal_Int32>(aSz.Width())); + } aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MaxTextLen")) ); if( aTmp.getValueType() == ::getCppuType((const sal_Int16*)0) && *(sal_Int16*) aTmp.getValue() != 0 ) { - (((sOptions += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_maxlength ) += '=' ) - += ByteString::CreateFromInt32( - *(sal_Int16*) aTmp.getValue() ); + sOptions.append(' '). + append(OOO_STRING_SVTOOLS_HTML_O_maxlength). + append('=').append(static_cast<sal_Int32>( + *(sal_Int16*) aTmp.getValue())); } OUString sDefaultText(RTL_CONSTASCII_USTRINGPARAM("DefaultText")); @@ -958,8 +971,10 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, eType = TYPE_FILE; if( aSz.Width() ) - (((sOptions += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_size ) += '=' ) - += ByteString::CreateFromInt32( aSz.Width() ); + { + sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). + append('=').append(static_cast<sal_Int32>(aSz.Width())); + } // VALUE vim form aus Sicherheitsgruenden nicht exportieren } @@ -979,39 +994,43 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( eTag == TAG_NONE ) return rWrt; - ByteString sOut( '<' ); - sOut += TagNames[eTag]; + rtl::OStringBuffer sOut; + sOut.append('<').append(TagNames[eTag]); if( eType != TYPE_NONE ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_type) += '=') += - TypeNames[eType]; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type). + append('=').append(TypeNames[eType]); + } aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Name")) ); if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && ((OUString*)aTmp.getValue())->getLength() ) { - (( sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_name ) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), *(OUString*)aTmp.getValue(), rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } aTmp = xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Enabled")) ); if( aTmp.getValueType() == ::getBooleanCppuType() && !*(sal_Bool*)aTmp.getValue() ) { - (( sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_disabled ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_disabled); } if( sValue.getLength() || bEmptyValue ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_value) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_value).append( + RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), sValue, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } - sOut += sOptions; + sOut.append(sOptions.makeStringAndClear()); if( TYPE_IMAGE == eType ) { @@ -1020,13 +1039,14 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( aTmp.getValueType() == ::getCppuType((const OUString*)0) && ((OUString*)aTmp.getValue())->getLength() ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_src) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_src). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), *(OUString*)aTmp.getValue()), rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } Size aTwipSz( rSdrObject.GetLogicRect().GetSize() ); @@ -1044,12 +1064,16 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, } if( aPixelSz.Width() ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_width) += '=') - += ByteString::CreateFromInt32( aPixelSz.Width() ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). + append('=').append(static_cast<sal_Int32>(aPixelSz.Width())); + } if( aPixelSz.Height() ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_height) += '=') - += ByteString::CreateFromInt32( aPixelSz.Height() ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). + append('=').append(static_cast<sal_Int32>(aPixelSz.Height())); + } } aTmp = xPropSet->getPropertyValue( @@ -1062,16 +1086,13 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( nTabIndex >= 32767 ) nTabIndex = 32767; - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_tabindex) += '=') - += ByteString::CreateFromInt32( nTabIndex ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_tabindex). + append('=').append(static_cast<sal_Int32>(nTabIndex)); } } - if( sOut.Len() ) - { - rWrt.Strm() << sOut.GetBuffer(); - sOut.Erase(); - } + if( sOut.getLength() ) + rWrt.Strm() << sOut.makeStringAndClear().getStr(); OSL_ENSURE( !bInCntnr, "Container wird fuer Controls nicht unterstuertzt" ); if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_DRAW ) && !bInCntnr ) @@ -1266,20 +1287,21 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, nSel++; rHTMLWrt.OutNewLine(); // jede Option bekommt eine eigene Zeile - (sOut = '<') += OOO_STRING_SVTOOLS_HTML_option; + sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_option); if( sVal.getLength() || bEmptyVal ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_value) += "=\""; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_value). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), sVal, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } if( bSelected ) - (sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_selected; + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_selected); - sOut += '>'; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append('>'); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rWrt.Strm(), pStrings[i], rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index dcda9c8fb2..4dbf5422a8 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -53,6 +53,7 @@ #include "wrthtml.hxx" #include <SwNodeNum.hxx> +#include <rtl/strbuf.hxx> using namespace ::com::sun::star; @@ -801,13 +802,14 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, rWrt.OutNewLine(); // <OL>/<UL> in eine neue Zeile rWrt.aBulletGrfs[i].Erase(); - ByteString sOut( '<' ); + rtl::OStringBuffer sOut; + sOut.append('<'); const SwNumFmt& rNumFmt = rInfo.GetNumRule()->Get( i ); sal_Int16 eType = rNumFmt.GetNumberingType(); if( SVX_NUM_CHAR_SPECIAL == eType ) { // Aufzaehlungs-Liste: <OL> - sOut += OOO_STRING_SVTOOLS_HTML_unorderlist; + sOut.append(OOO_STRING_SVTOOLS_HTML_unorderlist); // den Typ ueber das Bullet-Zeichen bestimmen const sal_Char *pStr = 0; @@ -825,14 +827,16 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, } if( pStr ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_type) += '=') += pStr; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type). + append('=').append(pStr); + } } else if( SVX_NUM_BITMAP == eType ) { // Aufzaehlungs-Liste: <OL> - sOut += OOO_STRING_SVTOOLS_HTML_unorderlist; - rWrt.Strm() << sOut.GetBuffer(); - sOut.Erase(); + sOut.append(OOO_STRING_SVTOOLS_HTML_unorderlist); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); OutHTML_BulletImage( rWrt, 0, @@ -844,7 +848,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, else { // Numerierungs-Liste: <UL> - sOut += OOO_STRING_SVTOOLS_HTML_orderlist; + sOut.append(OOO_STRING_SVTOOLS_HTML_orderlist); // den Typ ueber das Format bestimmen sal_Char cType = 0; @@ -856,7 +860,10 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, case SVX_NUM_ROMAN_LOWER: cType = 'i'; break; } if( cType ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_type) += '=') += cType; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type). + append('=').append(cType); + } sal_uInt16 nStartVal = rNumFmt.GetStart(); if( bStartValue && 1 == nStartVal && i == rInfo.GetDepth()-1 ) @@ -874,13 +881,13 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, } if( nStartVal != 1 ) { - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_start) += '=') - += ByteString::CreateFromInt32( nStartVal ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_start). + append('=').append(static_cast<sal_Int32>(nStartVal)); } } - if( sOut.Len() ) - rWrt.Strm() << sOut.GetBuffer(); + if (sOut.getLength()) + rWrt.Strm() << sOut.makeStringAndClear().getStr(); if( rWrt.bCfgOutStyles ) OutCSS1_NumBulListStyleOpt( rWrt, *rInfo.GetNumRule(), (sal_uInt8)i ); diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index eff53d457f..0e2925a3aa 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -645,52 +645,63 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( rWrt.bLFPossible ) rWrt.OutNewLine(); // <TABLE> in neue Zeile - ByteString sOut( '<' ); - sOut += OOO_STRING_SVTOOLS_HTML_table; + rtl::OStringBuffer sOut; + sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_table); sal_uInt16 nOldDirection = rWrt.nDirection; if( pFrmFmt ) rWrt.nDirection = rWrt.GetHTMLDirection( pFrmFmt->GetAttrSet() ); if( rWrt.bOutFlyFrame || nOldDirection != rWrt.nDirection ) { - rWrt.Strm() << sOut.GetBuffer(); - sOut.Erase(); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); rWrt.OutDirection( rWrt.nDirection ); } // COLS ausgeben: Nur bei Export ueber Layout, wenn es beim Import // vorhanden war. if( bColsOption ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_cols) += '=') - += ByteString::CreateFromInt32( aCols.Count() ); + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols). + append('=').append(static_cast<sal_Int32>(aCols.Count())); + } // ALIGN= ausgeben if( text::HoriOrientation::RIGHT == eAlign ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align ) += '=') += OOO_STRING_SVTOOLS_HTML_AL_right; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). + append('=').append(OOO_STRING_SVTOOLS_HTML_AL_right); + } else if( text::HoriOrientation::CENTER == eAlign ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align ) += '=') += OOO_STRING_SVTOOLS_HTML_AL_center; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). + append('=').append(OOO_STRING_SVTOOLS_HTML_AL_center); + } else if( text::HoriOrientation::LEFT == eAlign ) - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align ) += '=') += OOO_STRING_SVTOOLS_HTML_AL_left; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). + append('=').append(OOO_STRING_SVTOOLS_HTML_AL_left); + } // WIDTH ausgeben: Stammt aus Layout oder ist berechnet if( nTabWidth ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_width ) += '='; + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). + append('='); if( HasRelWidths() ) - (sOut += ByteString::CreateFromInt32( nTabWidth )) += '%'; + sOut.append(static_cast<sal_Int32>(nTabWidth)).append('%'); else if( Application::GetDefaultDevice() ) { - long nPixWidth = Application::GetDefaultDevice()->LogicToPixel( + sal_Int32 nPixWidth = Application::GetDefaultDevice()->LogicToPixel( Size(nTabWidth,0), MapMode(MAP_TWIP) ).Width(); if( !nPixWidth ) nPixWidth = 1; - sOut += ByteString::CreateFromInt32( nPixWidth ); + sOut.append(nPixWidth); } else { OSL_ENSURE( Application::GetDefaultDevice(), "kein Application-Window!?" ); - sOut += "100%"; + sOut.append(RTL_CONSTASCII_STRINGPARAM("100%")); } } @@ -706,14 +717,14 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( aPixelSpc.Width() ) { - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_hspace) += '=') - += ByteString::CreateFromInt32( aPixelSpc.Width() ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace). + append('=').append(static_cast<sal_Int32>(aPixelSpc.Width())); } if( aPixelSpc.Height() ) { - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_vspace) += '=') - += ByteString::CreateFromInt32( aPixelSpc.Height() ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace). + append('=').append(static_cast<sal_Int32>(aPixelSpc.Height())); } } @@ -724,12 +735,12 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, sal_Bool bHasAnyBorders = nFrameMask || bColsHaveBorder || bRowsHaveBorder; // CELLPADDING ausgeben: Stammt aus Layout oder ist berechnet - (((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_cellpadding ) += '=') - += ByteString::CreateFromInt32( rWrt.ToPixel( nCellPadding ) ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cellpadding). + append('=').append(static_cast<sal_Int32>(rWrt.ToPixel(nCellPadding))); // CELLSPACING ausgeben: Stammt aus Layout oder ist berechnet - (((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_cellspacing ) += '=') - += ByteString::CreateFromInt32( rWrt.ToPixel( nCellSpacing ) ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cellspacing). + append('=').append(static_cast<sal_Int32>(rWrt.ToPixel(nCellSpacing))); // FRAME/RULES ausgeben (nur sinnvoll, wenn border!=0) if( nBorder!=0 && (bCollectBorderWidth || bHasAnyBorders) ) @@ -746,7 +757,10 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, case 12: pFrame = OOO_STRING_SVTOOLS_HTML_TF_vsides ;break; }; if( pFrame ) - (((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_frame ) += '=') += pFrame; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_frame). + append('=').append(pFrame); + } const sal_Char *pRules = 0; if( aCols.Count() > 1 && aRows.Count() > 1 ) @@ -791,9 +805,12 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, } if( pRules ) - (((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_rules ) += '=') += pRules; + { + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rules). + append('=').append(pRules); + } } - rWrt.Strm() << sOut.GetBuffer(); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); // Hintergrund ausgeben if( pFrmFmt ) @@ -805,8 +822,8 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, rWrt.OutCSS1_TableFrmFmtOptions( *pFrmFmt ); } - sOut = '>'; - rWrt.Strm() << sOut.GetBuffer(); + sOut.append('>'); + rWrt.Strm() << sOut.makeStringAndClear().getStr(); rWrt.IncIndentLevel(); // Inhalte von Table einruecken @@ -843,8 +860,8 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, const SwWriteTableCol *pColumn = aCols[nCol]; - ByteString sOutStr( '<' ); - sOutStr += OOO_STRING_SVTOOLS_HTML_col; + rtl::OStringBuffer sOutStr; + sOutStr.append('<').append(OOO_STRING_SVTOOLS_HTML_col); sal_uInt32 nWidth; sal_Bool bRel; @@ -859,17 +876,14 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, nWidth = bRel ? GetRelWidth(nCol,1) : GetAbsWidth(nCol,1); } - ((sOutStr += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_width ) += '='; + sOutStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). + append('='); if( bRel ) - { - (sOutStr += ByteString::CreateFromInt32( nWidth ) ) += '*'; - } + sOutStr.append(static_cast<sal_Int32>(nWidth)).append('*'); else - { - sOutStr += ByteString::CreateFromInt32( rWrt.ToPixel( nWidth ) ); - } - sOutStr += '>'; - rWrt.Strm() << sOutStr.GetBuffer(); + sOutStr.append(static_cast<sal_Int32>(rWrt.ToPixel(nWidth))); + sOutStr.append('>'); + rWrt.Strm() << sOutStr.makeStringAndClear().getStr(); if( bColGroups && pColumn->bRightBorder && nCol<nCols-1 ) { diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 0e78fae867..1d5975a6f1 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -86,9 +86,9 @@ #include <htmlnum.hxx> #include <htmlfly.hxx> #include <swmodule.hxx> - #include <statstr.hrc> // ResId fuer Statusleiste #include <swerror.h> +#include <rtl/strbuf.hxx> #define MAX_INDENT_LEVEL 20 @@ -527,27 +527,28 @@ void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt, const sal_Char *pTag = pCol ? OOO_STRING_SVTOOLS_HTML_multicol : OOO_STRING_SVTOOLS_HTML_division; - ByteString sOut( '<' ); - sOut += pTag; + rtl::OStringBuffer sOut; + sOut.append('<').append(pTag); const String& rName = rSection.GetSectionName(); if( rName.Len() && !bContinued ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_id) += "=\""; - rHTMLWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_id). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rHTMLWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), rName, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); - sOut = '\"'; + sOut.append('\"'); } sal_uInt16 nDir = rHTMLWrt.GetHTMLDirection( rFmt.GetAttrSet() ); - rHTMLWrt.Strm() << sOut.GetBuffer(); - sOut.Erase(); + rHTMLWrt.Strm() << sOut.makeStringAndClear().getStr(); rHTMLWrt.OutDirection( nDir ); if( FILE_LINK_SECTION == rSection.GetType() ) { - ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_href) += "=\""; - rHTMLWrt.Strm() << sOut.GetBuffer(); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_href). + append(RTL_CONSTASCII_STRINGPARAM("=\"")); + rHTMLWrt.Strm() << sOut.makeStringAndClear().getStr(); const String& aFName = rSection.GetLinkFileName(); String aURL( aFName.GetToken(0,sfx2::cTokenSeperator) ); @@ -589,12 +590,12 @@ void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt, HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), aSection, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); } - sOut = '\"'; + sOut.append('\"'); } else if( pCol ) { - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_cols) += '=') - += ByteString::CreateFromInt32( pCol->GetNumCols() ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols). + append('=').append(static_cast<sal_Int32>(pCol->GetNumCols())); // minumum gutter width sal_uInt16 nGutter = pCol->GetGutterWidth( sal_True ); @@ -606,12 +607,12 @@ void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt, ->LogicToPixel( Size(nGutter,0), MapMode(MAP_TWIP) ).Width(); } - (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_gutter) += '=') - += ByteString::CreateFromInt32( nGutter ); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_gutter). + append('=').append(static_cast<sal_Int32>(nGutter)); } } - rHTMLWrt.Strm() << sOut.GetBuffer(); + rHTMLWrt.Strm() << sOut.makeStringAndClear().getStr(); if( rHTMLWrt.IsHTMLMode( rHTMLWrt.bCfgOutStyles ) ) rHTMLWrt.OutCSS1_SectionFmtOptions( rFmt ); |