diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-10-06 21:54:36 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-10-07 11:53:33 +0200 |
commit | 53037545be634d7e45d158e9184c13d2f6e2e7a5 (patch) | |
tree | 726868eea7a6bad059e4e2422b5928e242882a44 | |
parent | 7b3a5765d06dc0ebd000da16f5545329b50e99d3 (diff) |
html export: export attributes with literals
This improves validity of generated html files.
Change-Id: I3fbf92e861d9a3931870e25beaaf9f91a469f40c
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 27 | ||||
-rw-r--r-- | sw/source/filter/html/htmldraw.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfly.cxx | 42 | ||||
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 32 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnum.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/htmltabw.cxx | 55 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 4 |
7 files changed, 96 insertions, 88 deletions
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index eb56c845b488..41dd65880956 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -803,7 +803,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt, if( USHRT_MAX != nNumStart ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_value). - append('=').append(static_cast<sal_Int32>(nNumStart)); + append("=\"").append(static_cast<sal_Int32>(nNumStart)).append("\""); } sOut.append('>'); rWrt.Strm() << sOut.getStr(); @@ -2137,18 +2137,19 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode ) } sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width) - .append('='); + .append("=\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); - rWrt.OutULong( rHTMLWrt.ToPixel(nPageWidth-nLeft-nRight,false) ); + rWrt.OutULong( rHTMLWrt.ToPixel(nPageWidth-nLeft-nRight,false) ) << "\""; sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align) - .append('='); + .append("=\""); if( !nLeft ) sOut.append(OOO_STRING_SVTOOLS_HTML_AL_left); else if( !nRight ) sOut.append(OOO_STRING_SVTOOLS_HTML_AL_right); else sOut.append(OOO_STRING_SVTOOLS_HTML_AL_center); + sOut.append("\""); } } rWrt.Strm() << sOut.makeStringAndClear().getStr(); @@ -2160,15 +2161,15 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode ) { sal_uInt16 nWidth = pBorderLine->GetScaledWidth(); sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size) - .append('='); + .append("=\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); - rWrt.OutULong( rHTMLWrt.ToPixel(nWidth,false) ); + rWrt.OutULong( rHTMLWrt.ToPixel(nWidth,false) ) << "\""; const Color& rBorderColor = pBorderLine->GetColor(); if( !rBorderColor.IsRGBEqual( Color(COL_GRAY) ) ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_color) - .append('='); + .append("="); rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_Color( rWrt.Strm(), rBorderColor, rHTMLWrt.eDestEnc ); @@ -2633,7 +2634,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode ) pStr = OOO_STRING_SVTOOLS_HTML_AL_right; OStringBuffer sOut(OOO_STRING_SVTOOLS_HTML_linebreak); - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_clear).append('=').append(pStr); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_clear).append("=").append(pStr).append("\""); HTMLOutFuncs::Out_AsciiTag( rHTMLWrt.Strm(), sOut.getStr() ); rHTMLWrt.bClearLeft = sal_False; @@ -2710,7 +2711,7 @@ static Writer& OutHTML_SvxColor( Writer& rWrt, const SfxPoolItem& rHt ) OStringBuffer sOut; sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_font).append(' ') - .append(OOO_STRING_SVTOOLS_HTML_O_color).append('='); + .append(OOO_STRING_SVTOOLS_HTML_O_color).append("="); rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_Color( rWrt.Strm(), aColor, rHTMLWrt.eDestEnc ) << '>'; } @@ -2778,8 +2779,8 @@ static Writer& OutHTML_SvxFontHeight( Writer& rWrt, const SfxPoolItem& rHt ) sal_uInt32 nHeight = ((const SvxFontHeightItem&)rHt).GetHeight(); sal_uInt16 nSize = rHTMLWrt.GetHTMLFontSize( nHeight ); - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size).append('='). - append(static_cast<sal_Int32>(nSize)); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size).append("=\""). + append(static_cast<sal_Int32>(nSize)).append("\""); rWrt.Strm() << sOut.getStr(); if( rHTMLWrt.bCfgOutStyles && rHTMLWrt.bTxtAttr && @@ -3218,8 +3219,8 @@ static Writer& OutHTML_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ) if( pStr ) { OStringBuffer sOut; - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append('=') - .append(pStr); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append("=\"") + .append(pStr).append("\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); } diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx index 2f021aca0724..31f7df847f43 100644 --- a/sw/source/filter/html/htmldraw.cxx +++ b/sw/source/filter/html/htmldraw.cxx @@ -708,7 +708,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, if( pStr ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_behavior). - append('=').append(pStr); + append("=\"").append(pStr).append("\""); } // DIRECTION @@ -725,7 +725,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, if( pStr ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_direction). - append('=').append(pStr); + append("=\"").append(pStr).append("\""); } // LOOP @@ -734,15 +734,15 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, .GetValue(); if( 0==nCount ) nCount = SDRTEXTANI_SLIDE==eAniKind ? 1 : -1; - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_loop).append('='). - append(nCount); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_loop).append("=\""). + append(nCount).append("\""); // SCROLLDELAY sal_uInt16 nDelay = ((const SdrTextAniDelayItem&)rItemSet.Get( SDRATTR_TEXT_ANIDELAY )) .GetValue(); sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrolldelay). - append('=').append(static_cast<sal_Int32>(nDelay)); + append("=\"").append(static_cast<sal_Int32>(nDelay)).append("\""); // SCROLLAMOUNT sal_Int16 nAmount = @@ -761,7 +761,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, if( nAmount ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrollamount). - append('=').append(static_cast<sal_Int32>(nAmount)); + append("=\"").append(static_cast<sal_Int32>(nAmount)).append("\""); } Size aTwipSz( pTextObj->GetLogicRect().GetSize() ); @@ -793,13 +793,13 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, if( aPixelSz.Width() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). - append('=').append(static_cast<sal_Int32>(aPixelSz.Width())); + append("=\"").append(static_cast<sal_Int32>(aPixelSz.Width())).append("\""); } if( aPixelSz.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). - append('=').append(static_cast<sal_Int32>(aPixelSz.Height())); + append("=\"").append(static_cast<sal_Int32>(aPixelSz.Height())).append("\""); } } @@ -811,7 +811,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, const Color& rFillColor = ((const XFillColorItem&)rItemSet.Get(XATTR_FILLCOLOR)).GetColorValue(); - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).append('='); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).append("="); rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_Color( rWrt.Strm(), rFillColor, rHTMLWrt.eDestEnc ); } diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index b41acc041435..1b5871dabd0a 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -608,8 +608,8 @@ OString SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, } if( pStr ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append('='). - append(pStr); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append("=\""). + append(pStr).append("\""); } @@ -647,13 +647,13 @@ OString SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, if( aPixelSpc.Width() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace). - append('=').append(static_cast<sal_Int32>(aPixelSpc.Width())); + append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Width())).append("\""); } if( aPixelSpc.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace). - append('=').append(static_cast<sal_Int32>(aPixelSpc.Height())); + append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Height())).append("\""); } } @@ -722,22 +722,24 @@ OString SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, ((nPrcWidth && nPrcWidth!=255) || aPixelSz.Width()) ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). - append('='); + append("=\""); if( nPrcWidth ) sOut.append(static_cast<sal_Int32>(nPrcWidth)).append('%'); else sOut.append(static_cast<sal_Int32>(aPixelSz.Width())); + sOut.append("\""); } if( (nFrmOpts & HTML_FRMOPT_HEIGHT) && ((nPrcHeight && nPrcHeight!=255) || aPixelSz.Height()) ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). - append('='); + append("=\""); if( nPrcHeight ) sOut.append(static_cast<sal_Int32>(nPrcHeight)).append('%'); else sOut.append(static_cast<sal_Int32>(aPixelSz.Height())); + sOut.append("\""); } } @@ -804,7 +806,7 @@ OString SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, { sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_linebreak). append(' ').append(OOO_STRING_SVTOOLS_HTML_O_clear). - append('=').append(pStr).append('>').append(rEndTags); + append("=\"").append(pStr).append("\">").append(rEndTags); sRetEndTags = sOut.makeStringAndClear(); } } @@ -1115,7 +1117,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, { sOut.append('<'); sOut.append(OOO_STRING_SVTOOLS_HTML_font).append(' '). - append(OOO_STRING_SVTOOLS_HTML_O_color).append('='); + append(OOO_STRING_SVTOOLS_HTML_O_color).append("="); rWrt.Strm() << sOut.makeStringAndClear().getStr(); HTMLOutFuncs::Out_Color( rWrt.Strm(), pColBorderLine->GetColor(), rHTMLWrt.eDestEnc ) << '>'; @@ -1161,7 +1163,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt, if( nFrmOpts & HTML_FRMOPT_BORDER ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_border). - append('=').append(static_cast<sal_Int32>(nBorderWidth)); + append("=\"").append(static_cast<sal_Int32>(nBorderWidth)).append("\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); } @@ -1243,13 +1245,13 @@ Writer& OutHTML_BulletImage( Writer& rWrt, if( aPixelSz.Width() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). - append('=').append(static_cast<sal_Int32>(aPixelSz.Width())); + append("=\"").append(static_cast<sal_Int32>(aPixelSz.Width())).append("\""); } if( aPixelSz.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). - append('=').append(static_cast<sal_Int32>(aPixelSz.Height())); + append("=\"").append(static_cast<sal_Int32>(aPixelSz.Height())).append("\""); } if( pVertOrient ) @@ -1271,7 +1273,7 @@ Writer& OutHTML_BulletImage( Writer& rWrt, if( pStr ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). - append('=').append(pStr); + append("=\"").append(pStr).append("\""); } } @@ -1357,7 +1359,7 @@ static Writer & OutHTML_FrmFmtAsMulticol( Writer& rWrt, if( nCols ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols). - append('=').append(static_cast<sal_Int32>(nCols)); + append("=\"").append(static_cast<sal_Int32>(nCols)).append("\""); } // die Gutter-Breite (Minimalwert) als GUTTER @@ -1371,7 +1373,7 @@ static Writer & OutHTML_FrmFmtAsMulticol( Writer& rWrt, MapMode(MAP_TWIP) ).Width(); } sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_gutter). - append('=').append(static_cast<sal_Int32>(nGutter)); + append("=\"").append(static_cast<sal_Int32>(nGutter)).append("\""); } rWrt.Strm() << sOut.makeStringAndClear().getStr(); @@ -1424,8 +1426,8 @@ static Writer& OutHTML_FrmFmtAsSpacer( Writer& rWrt, const SwFrmFmt& rFrmFmt ) OStringBuffer sOut; sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_spacer).append(' ') - .append(OOO_STRING_SVTOOLS_HTML_O_type).append('=') - .append(OOO_STRING_SVTOOLS_HTML_SPTYPE_block); + .append(OOO_STRING_SVTOOLS_HTML_O_type).append("=\"") + .append(OOO_STRING_SVTOOLS_HTML_SPTYPE_block).append("\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); // ALIGN, WIDTH, HEIGHT @@ -1582,8 +1584,8 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, rHTMLWrt.OutNewLine(); OStringBuffer sOut; sOut.append(OOO_STRING_SVTOOLS_HTML_division).append(' ') - .append(OOO_STRING_SVTOOLS_HTML_O_title).append('=') - .append( bHeader ? "header" : "footer" ); + .append(OOO_STRING_SVTOOLS_HTML_O_title).append("=\"") + .append( bHeader ? "header" : "footer" ).append("\""); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sOut.makeStringAndClear().getStr() ); rHTMLWrt.IncIndentLevel(); // den Inhalt von Multicol einruecken; @@ -1605,9 +1607,9 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt, aSpacer = 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_SPTYPE_vertical).append("\""). append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). - append('=').append(static_cast<sal_Int32>(nSize)). + append("=\"").append(static_cast<sal_Int32>(nSize)).append("\""). makeStringAndClear(); } diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index c2095140533c..6917b8b805aa 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -610,8 +610,8 @@ void SwHTMLWriter::OutHiddenControls( OutNewLine( sal_True ); OStringBuffer sOut; sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_input).append(' ') - .append(OOO_STRING_SVTOOLS_HTML_O_type).append('=') - .append(OOO_STRING_SVTOOLS_HTML_IT_hidden); + .append(OOO_STRING_SVTOOLS_HTML_O_type).append("=\"") + .append(OOO_STRING_SVTOOLS_HTML_IT_hidden).append("\""); aTmp = xPropSet->getPropertyValue( OUString("Name") ); @@ -830,7 +830,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( aSz.Height() ) { sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). - append('=').append(static_cast<sal_Int32>(aSz.Height())); + append("=\"").append(static_cast<sal_Int32>(aSz.Height())).append("\""); } aTmp = xPropSet->getPropertyValue( @@ -866,14 +866,14 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( aSz.Height() ) { sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rows). - append('='). - append(static_cast<sal_Int32>(aSz.Height())); + append("=\""). + append(static_cast<sal_Int32>(aSz.Height())).append("\""); } if( aSz.Width() ) { sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols). - append('='). - append(static_cast<sal_Int32>(aSz.Width())); + append("=\""). + append(static_cast<sal_Int32>(aSz.Width())).append("\""); } aTmp = xPropSet->getPropertyValue( @@ -890,7 +890,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, *(sal_Bool*)aTmp.getValue()) ? OOO_STRING_SVTOOLS_HTML_WW_hard : OOO_STRING_SVTOOLS_HTML_WW_soft; sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_wrap). - append('=').append(pWrapStr); + append("=\"").append(pWrapStr).append("\""); } } else @@ -908,7 +908,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( aSz.Width() ) { sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). - append('=').append(static_cast<sal_Int32>(aSz.Width())); + append("=\"").append(static_cast<sal_Int32>(aSz.Width())).append("\""); } aTmp = xPropSet->getPropertyValue( @@ -918,8 +918,8 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, { sOptions.append(' '). append(OOO_STRING_SVTOOLS_HTML_O_maxlength). - append('=').append(static_cast<sal_Int32>( - *(sal_Int16*) aTmp.getValue())); + append("=\"").append(static_cast<sal_Int32>( + *(sal_Int16*) aTmp.getValue())).append("\""); } OUString sDefaultText("DefaultText"); @@ -945,7 +945,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( aSz.Width() ) { sOptions.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). - append('=').append(static_cast<sal_Int32>(aSz.Width())); + append("=\"").append(static_cast<sal_Int32>(aSz.Width())).append("\""); } // VALUE vim form aus Sicherheitsgruenden nicht exportieren @@ -971,7 +971,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( eType != TYPE_NONE ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type). - append('=').append(TypeNames[eType]); + append("=\"").append(TypeNames[eType]).append("\""); } aTmp = xPropSet->getPropertyValue("Name"); @@ -1038,13 +1038,13 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( aPixelSz.Width() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). - append('=').append(static_cast<sal_Int32>(aPixelSz.Width())); + append("=\"").append(static_cast<sal_Int32>(aPixelSz.Width())).append("\""); } if( aPixelSz.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). - append('=').append(static_cast<sal_Int32>(aPixelSz.Height())); + append("=\"").append(static_cast<sal_Int32>(aPixelSz.Height())).append("\""); } } @@ -1059,7 +1059,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, nTabIndex = 32767; sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_tabindex). - append('=').append(static_cast<sal_Int32>(nTabIndex)); + append("=\"").append(static_cast<sal_Int32>(nTabIndex)).append("\""); } } diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index 0fff1bfecb60..110e8b0fa389 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -817,7 +817,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, if( pStr ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type). - append('=').append(pStr); + append("=\"").append(pStr).append("\""); } } else if( SVX_NUM_BITMAP == eType ) @@ -848,7 +848,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, if( cType ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type). - append('=').append(cType); + append("=\"").append(cType).append("\""); } sal_uInt16 nStartVal = rNumFmt.GetStart(); @@ -868,7 +868,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt, if( nStartVal != 1 ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_start). - append('=').append(static_cast<sal_Int32>(nStartVal)); + append("=\"").append(static_cast<sal_Int32>(nStartVal)).append("\""); } } diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index 6ebe035cf14f..ca1481ab27f6 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -321,12 +321,12 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, if( nRowSpan>1 ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rowspan). - append('=').append(static_cast<sal_Int32>(nRowSpan)); + append("=\"").append(static_cast<sal_Int32>(nRowSpan)).append("\""); } if( nColSpan > 1 ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_colspan). - append('=').append(static_cast<sal_Int32>(nColSpan)); + append("=\"").append(static_cast<sal_Int32>(nColSpan)).append("\""); } #ifndef PURE_HTML long nWidth = 0; @@ -376,7 +376,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, if( bOutWidth ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). - append('='); + append("=\""); if( nPrcWidth != USHRT_MAX ) { sOut.append(static_cast<sal_Int32>(nPrcWidth)).append('%'); @@ -385,14 +385,15 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, { sOut.append(static_cast<sal_Int32>(aPixelSz.Width())); } + sOut.append("\""); if( !bLayoutExport && nColSpan==1 ) pCol->SetOutWidth( false ); } if( nHeight ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). - append('=').append(static_cast<sal_Int32>(aPixelSz.Height())); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height) + .append("=\"").append(static_cast<sal_Int32>(aPixelSz.Height())).append("\""); } #endif @@ -407,10 +408,11 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, sal_Int16 eVertOri = pCell->GetVertOri(); if( text::VertOrientation::TOP==eVertOri || text::VertOrientation::BOTTOM==eVertOri ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_valign). - append('=').append(text::VertOrientation::TOP==eVertOri ? + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_valign) + .append("=\"").append(text::VertOrientation::TOP==eVertOri ? OOO_STRING_SVTOOLS_HTML_VA_top : - OOO_STRING_SVTOOLS_HTML_VA_bottom); + OOO_STRING_SVTOOLS_HTML_VA_bottom) + .append("\""); } } @@ -549,7 +551,8 @@ void SwHTMLWrtTable::OutTableCells( SwHTMLWriter& rWrt, { OStringBuffer sOut; sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_valign) - .append('=').append(text::VertOrientation::TOP==eRowVertOri ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom); + .append("=\"").append(text::VertOrientation::TOP==eRowVertOri ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom) + .append("\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); } @@ -648,31 +651,31 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( bColsOption ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols). - append('=').append(static_cast<sal_Int32>(aCols.size())); + append("=\"").append(static_cast<sal_Int32>(aCols.size())).append("\""); } // ALIGN= ausgeben if( text::HoriOrientation::RIGHT == eAlign ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). - append('=').append(OOO_STRING_SVTOOLS_HTML_AL_right); + append("=\"").append(OOO_STRING_SVTOOLS_HTML_AL_right).append("\""); } else if( text::HoriOrientation::CENTER == eAlign ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). - append('=').append(OOO_STRING_SVTOOLS_HTML_AL_center); + append("=\"").append(OOO_STRING_SVTOOLS_HTML_AL_center).append("\""); } else if( text::HoriOrientation::LEFT == eAlign ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align). - append('=').append(OOO_STRING_SVTOOLS_HTML_AL_left); + append("=\"").append(OOO_STRING_SVTOOLS_HTML_AL_left).append("\""); } // WIDTH ausgeben: Stammt aus Layout oder ist berechnet if( nTabWidth ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). - append('='); + append("=\""); if( HasRelWidths() ) sOut.append(static_cast<sal_Int32>(nTabWidth)).append('%'); else if( Application::GetDefaultDevice() ) @@ -687,8 +690,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, else { OSL_ENSURE( Application::GetDefaultDevice(), "kein Application-Window!?" ); - sOut.append(RTL_CONSTASCII_STRINGPARAM("100%")); + sOut.append("100%"); } + sOut.append("\""); } if( (nHSpace || nVSpace) && Application::GetDefaultDevice()) @@ -704,23 +708,23 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( aPixelSpc.Width() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace). - append('=').append(static_cast<sal_Int32>(aPixelSpc.Width())); + append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Width())).append("\""); } if( aPixelSpc.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace). - append('=').append(static_cast<sal_Int32>(aPixelSpc.Height())); + append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Height())).append("\""); } } // CELLPADDING ausgeben: Stammt aus Layout oder ist berechnet sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cellpadding). - append('=').append(static_cast<sal_Int32>(rWrt.ToPixel(nCellPadding,false))); + append("=\"").append(static_cast<sal_Int32>(rWrt.ToPixel(nCellPadding,false))).append("\""); // CELLSPACING ausgeben: Stammt aus Layout oder ist berechnet sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cellspacing). - append('=').append(static_cast<sal_Int32>(rWrt.ToPixel(nCellSpacing,false))); + append("=\"").append(static_cast<sal_Int32>(rWrt.ToPixel(nCellSpacing,false))).append("\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); @@ -743,8 +747,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, { rWrt.OutNewLine(); // <CAPTION> in neue Zeile OStringBuffer sOutStr(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_caption)); - sOutStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append('=') - .append(bTopCaption ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom); + sOutStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append("=\"") + .append(bTopCaption ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom) + .append("\""); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sOutStr.getStr(), sal_True ); HTMLOutFuncs::Out_String( rWrt.Strm(), *pCaption, rWrt.eDestEnc, &rWrt.aNonConvertableCharacters ); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_caption, sal_False ); @@ -788,12 +793,12 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, } sOutStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). - append('='); + append("=\""); if( bRel ) sOutStr.append(static_cast<sal_Int32>(nWidth)).append('*'); else sOutStr.append(static_cast<sal_Int32>(rWrt.ToPixel(nWidth,false))); - sOutStr.append('>'); + sOutStr.append("\">"); rWrt.Strm() << sOutStr.makeStringAndClear().getStr(); if( bColGroups && pColumn->bRightBorder && nCol<nCols-1 ) @@ -1109,8 +1114,8 @@ Writer& OutHTML_SwTblNode( Writer& rWrt, SwTableNode & rNode, else { OStringBuffer sOut(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_division)); - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append('=') - .append(OOO_STRING_SVTOOLS_HTML_AL_right); + sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).append("=\"") + .append(OOO_STRING_SVTOOLS_HTML_AL_right).append("\""); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sOut.getStr(), sal_True ); } diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 2403e86177f8..cf13747803a9 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -600,7 +600,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt, MapMode(MAP_TWIP) ).Width(); } sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_gutter). - append('=').append(static_cast<sal_Int32>(nGutter)); + append("=\"").append(static_cast<sal_Int32>(nGutter)).append("\""); } } @@ -842,7 +842,7 @@ static void OutBodyColor( const sal_Char *pTag, const SwFmt *pFmt, if( pColorItem ) { OStringBuffer sOut; - sOut.append(' ').append(pTag).append('='); + sOut.append(' ').append(pTag).append("="); rHWrt.Strm() << sOut.makeStringAndClear().getStr(); Color aColor( pColorItem->GetValue() ); if( COL_AUTO == aColor.GetColor() ) |