include/svtools/htmlout.hxx | 2 - svtools/source/svhtml/htmlout.cxx | 4 +- sw/source/filter/html/css1atr.cxx | 10 ++--- sw/source/filter/html/htmlatr.cxx | 56 +++++++++++++++---------------- sw/source/filter/html/htmldrawwriter.cxx | 2 - sw/source/filter/html/htmlfldw.cxx | 2 - sw/source/filter/html/htmlflywriter.cxx | 50 +++++++++++++-------------- sw/source/filter/html/htmlforw.cxx | 8 ++-- sw/source/filter/html/htmlftn.cxx | 16 ++++---- sw/source/filter/html/htmlnumwriter.cxx | 8 ++-- sw/source/filter/html/htmlplug.cxx | 16 ++++---- sw/source/filter/html/htmltabw.cxx | 54 ++++++++++++++--------------- sw/source/filter/html/wrthtml.cxx | 26 +++++++++----- sw/source/filter/html/wrthtml.hxx | 3 + 14 files changed, 134 insertions(+), 123 deletions(-)
New commits: commit b4f3af91d344d5f8c18e060615360e2a6633b63f Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Feb 27 15:30:25 2018 +0100 sw HTML export: handle XHTML ns alias even with HTMLOutFuncs::Out_AsciiTag() This is meant to be mechanical, full conversion to HtmlWriter has to be done step by step in follow-up commits. Change-Id: Ieab096f8c9936f0ecad029fbdfb51da7412ad83e Reviewed-on: https://gerrit.libreoffice.org/50449 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx index 8fadcb90280e..9aaf719021f2 100644 --- a/include/svtools/htmlout.hxx +++ b/include/svtools/htmlout.hxx @@ -57,7 +57,7 @@ struct HTMLOutFuncs rtl_TextEncoding eDestEnc, OUString *pNonConvertableChars ); - SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* pStr, + SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const OString& rStr, bool bOn = true); SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_uInt32 cChar, HTMLOutContext& rContext, diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index c2975d06faea..8ee63d19b757 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -513,7 +513,7 @@ OString HTMLOutFuncs::ConvertStringToHTML( const OUString& rSrc, return aDest.makeStringAndClear(); } -SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr, +SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const OString& rStr, bool bOn ) { if(bOn) @@ -521,7 +521,7 @@ SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr, else rStream.WriteCharPtr("</"); - rStream.WriteCharPtr(pStr).WriteChar('>'); + rStream.WriteOString(rStr).WriteChar('>'); return rStream; } diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 4232fdfdedd4..3ef2ed278510 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -226,7 +226,7 @@ void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp, { m_bFirstCSS1Rule = false; OutNewLine(); - sOut.append("<" OOO_STRING_SVTOOLS_HTML_style " " + sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_style " " OOO_STRING_SVTOOLS_HTML_O_type "=\"text/css\">"); // Optional CSS2 code for dot leaders (dotted line between the Table of Contents titles and page numbers): // (More information: http://www.w3.org/Style/Examples/007/leaders.en.html) @@ -288,7 +288,7 @@ void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp, } else { - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); return; } break; @@ -590,7 +590,7 @@ void SwHTMLWriter::OutStyleSheet( const SwPageDesc& rPageDesc ) DecIndentLevel(); OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_style, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_style, false ); } else { @@ -2822,7 +2822,7 @@ static Writer& OutCSS1_SwFormatDrop( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); } return rWrt; @@ -3384,7 +3384,7 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); return rWrt; } } diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index ed2d017e6914..a87351d6d570 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -136,7 +136,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl ) { if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_deflist ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist ); IncIndentLevel(); m_bLFPossible = true; } @@ -148,7 +148,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl ) DecIndentLevel(); if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_deflist, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist, false ); m_bLFPossible = true; } } @@ -160,7 +160,7 @@ void SwHTMLWriter::ChangeParaToken( HtmlTokenId nNew ) { if( nNew != m_nLastParaToken && HtmlTokenId::PREFORMTXT_ON == m_nLastParaToken ) { - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_preformtxt, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_preformtxt, false ); m_bLFPossible = true; } m_nLastParaToken = nNew; @@ -762,7 +762,8 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, if( rHWrt.m_nDefListLvl > 0 && !bForceDL ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), bDT ? OOO_STRING_SVTOOLS_HTML_dt : OOO_STRING_SVTOOLS_HTML_dd ); + OString aTag = bDT ? OOO_STRING_SVTOOLS_HTML_dt : OOO_STRING_SVTOOLS_HTML_dd; + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + aTag ); } if( pAdjItem && @@ -794,7 +795,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, if( !rHWrt.m_bCfgOutStyles && rInfo.bParaPossible && !bPara && (bHasParSpace || pAdjItem) ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rInfo.aToken.getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + rInfo.aToken ); aToken = OOO_STRING_SVTOOLS_HTML_parabreak; bPara = true; rHWrt.m_bNoAlign = false; @@ -850,7 +851,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, rHWrt.m_bTextAttr = false; rHWrt.m_bOutOpts = true; - OString sOut = "<" + aToken; + OString sOut = "<" + rHWrt.GetNamespace() + aToken; if( eLang != LANGUAGE_DONTKNOW && eLang != rHWrt.m_eLang ) { @@ -990,9 +991,9 @@ void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& rInfo ) // - no styles are written and // - a lower spacing exists if( rInfo.bParaPossible && rInfo.bOutPara ) - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_parabreak, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_parabreak, false ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rInfo.aToken.getStr(), false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + rInfo.aToken, false ); rHWrt.m_bLFPossible = rInfo.aToken != OOO_STRING_SVTOOLS_HTML_dt && rInfo.aToken != OOO_STRING_SVTOOLS_HTML_dd && @@ -1003,7 +1004,7 @@ void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& rInfo ) rHWrt.DecIndentLevel(); if( rHWrt.m_bLFPossible ) rHWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); rHWrt.m_bLFPossible = true; } @@ -2626,7 +2627,7 @@ static Writer& OutHTML_SvxColor( Writer& rWrt, const SfxPoolItem& rHt ) HTMLOutFuncs::Out_Color( rWrt.Strm(), aColor ).WriteChar( '>' ); } else - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_font, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font, false ); return rWrt; } @@ -2640,7 +2641,7 @@ static Writer& OutHTML_SwPosture( Writer& rWrt, const SfxPoolItem& rHt ) const FontItalic nPosture = static_cast<const SvxPostureItem&>(rHt).GetPosture(); if( ITALIC_NORMAL == nPosture ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_italic, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_italic, rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2669,7 +2670,7 @@ static Writer& OutHTML_SvxFont( Writer& rWrt, const SfxPoolItem& rHt ) .WriteCharPtr( "\">" ); } else - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_font, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font, false ); return rWrt; } @@ -2699,7 +2700,7 @@ static Writer& OutHTML_SvxFontHeight( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_font, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_font, false ); } return rWrt; @@ -2724,7 +2725,7 @@ static Writer& OutHTML_SvxLanguage( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); } return rWrt; @@ -2738,7 +2739,7 @@ static Writer& OutHTML_SwWeight( Writer& rWrt, const SfxPoolItem& rHt ) const FontWeight nBold = static_cast<const SvxWeightItem&>(rHt).GetWeight(); if( WEIGHT_BOLD == nBold ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_bold, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_bold, rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2759,7 +2760,7 @@ static Writer& OutHTML_SwCrossedOut( Writer& rWrt, const SfxPoolItem& rHt ) const FontStrikeout nStrike = static_cast<const SvxCrossedOutItem&>(rHt).GetStrikeout(); if( STRIKEOUT_NONE != nStrike ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_strike, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_strike, rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2778,18 +2779,18 @@ static Writer& OutHTML_SvxEscapement( Writer& rWrt, const SfxPoolItem& rHt ) const SvxEscapement eEscape = static_cast<SvxEscapement>(static_cast<const SvxEscapementItem&>(rHt).GetEnumValue()); - const sal_Char *pStr = nullptr; + OString aTag; switch( eEscape ) { - case SvxEscapement::Superscript: pStr = OOO_STRING_SVTOOLS_HTML_superscript; break; - case SvxEscapement::Subscript: pStr = OOO_STRING_SVTOOLS_HTML_subscript; break; + case SvxEscapement::Superscript: aTag = OOO_STRING_SVTOOLS_HTML_superscript; break; + case SvxEscapement::Subscript: aTag = OOO_STRING_SVTOOLS_HTML_subscript; break; default: ; } - if( pStr ) + if( !aTag.isEmpty() ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), pStr, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2809,7 +2810,7 @@ static Writer& OutHTML_SwUnderline( Writer& rWrt, const SfxPoolItem& rHt ) const FontLineStyle eUnder = static_cast<const SvxUnderlineItem&>(rHt).GetLineStyle(); if( LINESTYLE_NONE != eUnder ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_underline, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_underline, rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2845,7 +2846,7 @@ static Writer& OutHTML_SwBlink( Writer& rWrt, const SfxPoolItem& rHt ) if( static_cast<const SvxBlinkItem&>(rHt).GetValue() ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_blink, rHTMLWrt.m_bTagOn ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_blink, rHTMLWrt.m_bTagOn ); } else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr ) { @@ -2871,7 +2872,7 @@ Writer& OutHTML_INetFormat( Writer& rWrt, const SwFormatINetFormat& rINetFormat, // bOn controls if we are writing the opening or closing tag if( !bOn ) { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); return rWrt; } @@ -3086,10 +3087,9 @@ static Writer& OutHTML_SwTextCharFormat( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), - !pFormatInfo->aToken.isEmpty() ? pFormatInfo->aToken.getStr() - : OOO_STRING_SVTOOLS_HTML_span, - false ); + OString aTag = !pFormatInfo->aToken.isEmpty() ? pFormatInfo->aToken.getStr() + : OOO_STRING_SVTOOLS_HTML_span; + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, false); } return rWrt; diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index 3ab1b86de4b6..efebccefa116 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -289,7 +289,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, HTMLOutFuncs::Out_String( rWrt.Strm(), aText, rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_marquee, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_marquee, false ); if( !aEndTags.isEmpty() ) rWrt.Strm().WriteCharPtr( aEndTags.getStr() ); diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index e1abdba1735d..94f072248064 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -426,7 +426,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, // Off-Tag ausgeben if( pTypeStr ) - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_sdfield, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_sdfield, false ); return rWrt; } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 4c0decd45437..6f6aaaef3fc9 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -425,7 +425,7 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, const SwFrameFormat& rFra { HtmlContainerFlags nCntnrMode = nMode.nContainer; HtmlOut nOutMode = nMode.nOut; - const sal_Char *pCntnrStr = nullptr; + OString aContainerStr; if( HtmlContainerFlags::NONE != nCntnrMode ) { @@ -433,10 +433,10 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, const SwFrameFormat& rFra OutNewLine(); OStringBuffer sOut; - pCntnrStr = (HtmlContainerFlags::Div == nCntnrMode) + aContainerStr = (HtmlContainerFlags::Div == nCntnrMode) ? OOO_STRING_SVTOOLS_HTML_division : OOO_STRING_SVTOOLS_HTML_span; - sOut.append('<').append(pCntnrStr).append(' ') + sOut.append('<').append(GetNamespace() + aContainerStr).append(' ') .append(OOO_STRING_SVTOOLS_HTML_O_class).append("=\"") .append("sd-abs-pos").append('\"'); Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); @@ -463,40 +463,40 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, const SwFrameFormat& rFra switch( nOutMode ) { case HtmlOut::TableNode: // OK - OSL_ENSURE( !pCntnrStr, "Table: Container is not supposed to be here" ); + OSL_ENSURE( aContainerStr.isEmpty(), "Table: Container is not supposed to be here" ); OutHTML_FrameFormatTableNode( *this, rFrameFormat ); break; case HtmlOut::GraphicNode: // OK - OutHTML_FrameFormatGrfNode( *this, rFrameFormat, pCntnrStr != nullptr ); + OutHTML_FrameFormatGrfNode( *this, rFrameFormat, !aContainerStr.isEmpty() ); break; case HtmlOut::OleNode: // OK - OutHTML_FrameFormatOLENode( *this, rFrameFormat, pCntnrStr != nullptr ); + OutHTML_FrameFormatOLENode( *this, rFrameFormat, !aContainerStr.isEmpty() ); break; case HtmlOut::OleGraphic: // OK - OutHTML_FrameFormatOLENodeGrf( *this, rFrameFormat, pCntnrStr != nullptr ); + OutHTML_FrameFormatOLENodeGrf( *this, rFrameFormat, !aContainerStr.isEmpty() ); break; case HtmlOut::Div: case HtmlOut::Span: - OSL_ENSURE( !pCntnrStr, "Div: Container is not supposed to be here" ); + OSL_ENSURE( aContainerStr.isEmpty(), "Div: Container is not supposed to be here" ); OutHTML_FrameFormatAsDivOrSpan( *this, rFrameFormat, HtmlOut::Span==nOutMode ); break; case HtmlOut::MultiCol: // OK - OutHTML_FrameFormatAsMulticol( *this, rFrameFormat, pCntnrStr != nullptr ); + OutHTML_FrameFormatAsMulticol( *this, rFrameFormat, !aContainerStr.isEmpty() ); break; case HtmlOut::Spacer: // OK - OSL_ENSURE( !pCntnrStr, "Spacer: Container is not supposed to be here" ); + OSL_ENSURE( aContainerStr.isEmpty(), "Spacer: Container is not supposed to be here" ); OutHTML_FrameFormatAsSpacer( *this, rFrameFormat ); break; case HtmlOut::Control: // OK OutHTML_DrawFrameFormatAsControl( *this, static_cast<const SwDrawFrameFormat &>(rFrameFormat), dynamic_cast<const SdrUnoObj&>(*pSdrObject), - pCntnrStr != nullptr ); + !aContainerStr.isEmpty() ); break; case HtmlOut::AMarquee: OutHTML_FrameFormatAsMarquee( *this, rFrameFormat, *pSdrObject ); break; case HtmlOut::Marquee: - OSL_ENSURE( !pCntnrStr, "Marquee: Container is not supposed to be here" ); + OSL_ENSURE( aContainerStr.isEmpty(), "Marquee: Container is not supposed to be here" ); OutHTML_DrawFrameFormatAsMarquee( *this, static_cast<const SwDrawFrameFormat &>(rFrameFormat), *pSdrObject ); break; @@ -510,11 +510,11 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, const SwFrameFormat& rFra DecIndentLevel(); if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); m_bLFPossible = true; } else if( HtmlContainerFlags::Span == nCntnrMode ) - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_span, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false ); } OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, @@ -1555,7 +1555,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, rHTMLWrt.OutNewLine(); OStringBuffer sOut; - sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_multicol); + sOut.append('<').append(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol); const SwFormatCol& rFormatCol = rFrameFormat.GetCol(); @@ -1615,7 +1615,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_multicol, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol, false ); rHTMLWrt.m_bLFPossible = true; return rWrt; @@ -1650,24 +1650,24 @@ static Writer& OutHTML_FrameFormatAsDivOrSpan( Writer& rWrt, { SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); - const sal_Char *pStr = nullptr; + OString aTag; if( !bSpan ) { rHTMLWrt.ChangeParaToken( HtmlTokenId::NONE ); // Close the current <DL>! rHTMLWrt.OutAndSetDefList( 0 ); - pStr = OOO_STRING_SVTOOLS_HTML_division; + aTag = OOO_STRING_SVTOOLS_HTML_division; } else - pStr = OOO_STRING_SVTOOLS_HTML_span; + aTag = OOO_STRING_SVTOOLS_HTML_span; // output as DIV if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); OStringBuffer sOut; - sOut.append('<').append(pStr); + sOut.append('<').append(rHTMLWrt.GetNamespace() + aTag); rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_DIV; @@ -1702,7 +1702,7 @@ static Writer& OutHTML_FrameFormatAsDivOrSpan( Writer& rWrt, rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), pStr, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, false ); if( !aEndTags.isEmpty() ) rWrt.Strm().WriteCharPtr( aEndTags.getStr() ); @@ -1863,7 +1863,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, sOut.append(OOO_STRING_SVTOOLS_HTML_division).append(' ') .append(OOO_STRING_SVTOOLS_HTML_O_title).append("=\"") .append( bHeader ? "header" : "footer" ).append("\""); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sOut.makeStringAndClear().getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + sOut.makeStringAndClear().getStr() ); rHTMLWrt.IncIndentLevel(); // indent the content of Multicol; @@ -1898,7 +1898,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, if( !bHeader && !aSpacer.isEmpty() ) { rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aSpacer.getStr() ); } { @@ -1919,12 +1919,12 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, if( bHeader && !aSpacer.isEmpty() ) { rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), aSpacer.getStr() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + aSpacer.getStr() ); } rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); rHTMLWrt.m_nHeaderFooterSpace = 0; diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index d7011c4b19d7..cb49ab3ebd3a 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -434,7 +434,7 @@ void SwHTMLWriter::OutForm( bool bOn, DecIndentLevel(); // indent content of form if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_form, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_form, false ); m_bLFPossible = true; return; @@ -1218,12 +1218,12 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, HTMLOutFuncs::Out_String( rWrt.Strm(), pStrings[i], rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); } - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_option, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_option, false ); rHTMLWrt.DecIndentLevel(); rHTMLWrt.OutNewLine();// the </SELECT> gets its own line } - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_select, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_select, false ); } else if( TAG_TEXTAREA == eTag ) { @@ -1250,7 +1250,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); } } - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_textarea, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_textarea, false ); } else if( TYPE_CHECKBOX == eType || TYPE_RADIO == eType ) { diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index b45adf42588f..56ba83a50100 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -277,8 +277,8 @@ Writer& OutHTML_SwFormatFootnote( Writer& rWrt, const SfxPoolItem& rHt ) rHTMLWrt.m_pFootEndNotes->insert( rHTMLWrt.m_pFootEndNotes->begin() + nPos, pTextFootnote ); OStringBuffer sOut; - sOut.append("<" OOO_STRING_SVTOOLS_HTML_anchor " " - OOO_STRING_SVTOOLS_HTML_O_class "=\""); + OString aTag = rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor; + sOut.append("<" + aTag + " " OOO_STRING_SVTOOLS_HTML_O_class "=\""); rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); HTMLOutFuncs::Out_String( rWrt.Strm(), sClass, rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); sOut.append("\" " OOO_STRING_SVTOOLS_HTML_O_name "=\""); @@ -293,12 +293,12 @@ Writer& OutHTML_SwFormatFootnote( Writer& rWrt, const SfxPoolItem& rHt ) sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_sdfixed); sOut.append(">"); rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_superscript ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript ); HTMLOutFuncs::Out_String( rWrt.Strm(), rFormatFootnote.GetViewNumStr(*rWrt.pDoc), rHTMLWrt.m_eDestEnc, &rHTMLWrt.m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_superscript, false ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); return rWrt; } @@ -360,7 +360,7 @@ void SwHTMLWriter::OutFootEndNotes() DecIndentLevel(); // indent content of <DIV> if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); m_bLFPossible = true; OSL_ENSURE( !m_pFormatFootnote, @@ -445,7 +445,7 @@ void SwHTMLWriter::OutFootEndNoteSym( const SwFormatFootnote& rFormatFootnote, } OStringBuffer sOut; - sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_anchor).append(' ') + sOut.append('<').append(GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor).append(' ') .append(OOO_STRING_SVTOOLS_HTML_O_class).append("=\""); Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); HTMLOutFuncs::Out_String( Strm(), sClass, m_eDestEnc, &m_aNonConvertableCharacters ); @@ -460,7 +460,7 @@ void SwHTMLWriter::OutFootEndNoteSym( const SwFormatFootnote& rFormatFootnote, Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); HTMLOutFuncs::Out_String( Strm(), rNum, m_eDestEnc, &m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); } static int lcl_html_fillEndNoteInfo( const SwEndNoteInfo& rInfo, diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx index e230f40f4c2e..6c195203a3d5 100644 --- a/sw/source/filter/html/htmlnumwriter.cxx +++ b/sw/source/filter/html/htmlnumwriter.cxx @@ -305,12 +305,12 @@ Writer& OutHTML_NumBulListEnd( SwHTMLWriter& rWrt, // a list is started or ended: sal_Int16 eType = rInfo.GetNumRule()->Get( i-1 ).GetNumberingType(); - const sal_Char *pStr; + OString aTag; if( SVX_NUM_CHAR_SPECIAL == eType || SVX_NUM_BITMAP == eType) - pStr = OOO_STRING_SVTOOLS_HTML_unorderlist; + aTag = OOO_STRING_SVTOOLS_HTML_unorderlist; else - pStr = OOO_STRING_SVTOOLS_HTML_orderlist; - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), pStr, false ); + aTag = OOO_STRING_SVTOOLS_HTML_orderlist; + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + aTag, false ); rWrt.m_bLFPossible = true; } diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index e16846b9d882..54861e8aef25 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1016,7 +1016,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor if( aGlobName == SvGlobalName( SO3_PLUGIN_CLASSID ) ) { // first the plug-in specifics - sOut.append(OOO_STRING_SVTOOLS_HTML_embed); + sOut.append(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_embed); OUString aStr; OUString aURL; @@ -1065,7 +1065,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor { // or the applet specifics - sOut.append(OOO_STRING_SVTOOLS_HTML_applet); + sOut.append(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_applet); // CODEBASE OUString aCd; @@ -1119,7 +1119,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor { // or the Floating-Frame specifics - sOut.append(OOO_STRING_SVTOOLS_HTML_iframe); + sOut.append(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_iframe); rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); SfxFrameHTMLWriter::Out_FrameDescriptor( rWrt.Strm(), rWrt.GetBaseURL(), @@ -1184,7 +1184,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor const OUString& rValue = rCommand.GetArgument(); rHTMLWrt.OutNewLine(); OStringBuffer sBuf; - sBuf.append('<').append(OOO_STRING_SVTOOLS_HTML_param) + sBuf.append('<').append(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_param) .append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name) .append("=\""); rWrt.Strm().WriteCharPtr( sBuf.makeStringAndClear().getStr() ); @@ -1198,7 +1198,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor rHTMLWrt.DecIndentLevel(); // indent the applet content if( aCommands.size() ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_applet, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_applet, false ); } else if( aGlobName == SvGlobalName( SO3_PLUGIN_CLASSID ) ) { @@ -1231,7 +1231,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor // and for Floating-Frames just output another </IFRAME> rHTMLWrt.Strm().WriteChar( '>' ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_iframe, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_iframe, false ); } if( !aEndTags.isEmpty() ) @@ -1288,9 +1288,9 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame SAL_WARN_IF(aStream.GetSize()>=static_cast<sal_uInt64>(SAL_MAX_INT32), "sw.html", "Stream can't fit in OString"); OString aData(static_cast<const char*>(aStream.GetData()), static_cast<sal_Int32>(aStream.GetSize())); // Wrap output in a <span> tag to avoid 'HTML parser error: Unexpected end tag: p' - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_span); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span); rWrt.Strm().WriteCharPtr(aData.getStr()); - HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_span, false); + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span, false); } catch ( uno::Exception& ) { diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index 3bfe273c32b2..0f644f0f4855 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -483,9 +483,8 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, if( rWrt.m_bLFPossible ) rWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), bHead ? OOO_STRING_SVTOOLS_HTML_tableheader - : OOO_STRING_SVTOOLS_HTML_tabledata, - false ); + OString aTag = bHead ? OOO_STRING_SVTOOLS_HTML_tableheader : OOO_STRING_SVTOOLS_HTML_tabledata; + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag, false); rWrt.m_bLFPossible = true; } @@ -547,7 +546,7 @@ void SwHTMLWrtTable::OutTableCells( SwHTMLWriter& rWrt, rWrt.DecIndentLevel(); // indent content of <TR>...</TR> rWrt.OutNewLine(); // </TR> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_tablerow, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow, false ); } void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, @@ -706,9 +705,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, 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() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + sOutStr.getStr() ); HTMLOutFuncs::Out_String( rWrt.Strm(), *pCaption, rWrt.m_eDestEnc, &rWrt.m_aNonConvertableCharacters ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_caption, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_caption, false ); } const SwWriteTableCols::size_type nCols = m_aCols.size(); @@ -721,7 +720,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( bColGroups ) { rWrt.OutNewLine(); // <COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup ); rWrt.IncIndentLevel(); // indent content of <COLGRP> } @@ -761,10 +760,10 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, { rWrt.DecIndentLevel(); // indent content of <COLGRP> rWrt.OutNewLine(); // </COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup, + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup, false ); rWrt.OutNewLine(); // <COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup ); rWrt.IncIndentLevel(); // indent content of <COLGRP> } } @@ -773,7 +772,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, rWrt.DecIndentLevel(); // indent content of <COLGRP> rWrt.OutNewLine(); // </COLGRP> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup, + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_colgroup, false ); } } @@ -797,8 +796,8 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( bTSections ) { rWrt.OutNewLine(); // <THEAD>/<TDATA> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), - bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody ); + OString aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag); rWrt.IncIndentLevel(); // indent content of <THEAD>/<TDATA> } @@ -814,8 +813,8 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, for( auto nCnt = (pRow2->nBottomBorder / DEF_LINE_WIDTH_1) - 1; nCnt; --nCnt ) { rWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_tablerow ); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_tablerow, + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow, false ); } } @@ -825,15 +824,15 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, { rWrt.DecIndentLevel(); // indent content of <THEAD>/<TDATA> rWrt.OutNewLine(); // </THEAD>/</TDATA> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), - bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody, false ); + OString aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag, false); rWrt.OutNewLine(); // <THEAD>/<TDATA> in new line if( bTHead && nRow==m_nHeadEndRow ) bTHead = false; - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), - bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody ); + aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag); rWrt.IncIndentLevel(); // indent content of <THEAD>/<TDATA> } } @@ -843,14 +842,14 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, rWrt.DecIndentLevel(); // indent content of <THEAD>/<TDATA> rWrt.OutNewLine(); // </THEAD>/</TDATA> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), - bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody, false ); + OString aTag = bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody; + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rWrt.GetNamespace() + aTag, false); } rWrt.DecIndentLevel(); // indent content of <TABLE> rWrt.OutNewLine(); // </TABLE> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_table, false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_table, false ); rWrt.m_nDirection = nOldDirection; } @@ -1000,7 +999,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, { if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_dd ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_dd ); } // eFlyHoriOri and eTabHoriOri now only contain the values of @@ -1057,13 +1056,13 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); // <CENTER> in new line if( text::HoriOrientation::CENTER==eDivHoriOri ) - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_center ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_center ); else { OStringBuffer sOut(OOO_STRING_SVTOOLS_HTML_division); 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() ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rHTMLWrt.GetNamespace() + sOut.getStr() ); } rHTMLWrt.IncIndentLevel(); // indent content of <CENTER> rHTMLWrt.m_bLFPossible = true; @@ -1107,9 +1106,10 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, { rHTMLWrt.DecIndentLevel(); // indent content of <CENTER> rHTMLWrt.OutNewLine(); // </CENTER> in new line - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), - text::HoriOrientation::CENTER==eDivHoriOri ? OOO_STRING_SVTOOLS_HTML_center - : OOO_STRING_SVTOOLS_HTML_division, false ); + OString aTag = text::HoriOrientation::CENTER == eDivHoriOri + ? OOO_STRING_SVTOOLS_HTML_center + : OOO_STRING_SVTOOLS_HTML_division; + HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), rHTMLWrt.GetNamespace() + aTag, false); rHTMLWrt.m_bLFPossible = true; } diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 3831cee4fbc2..3c673e1845ea 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -437,9 +437,9 @@ ErrCode SwHTMLWriter::WriteStream() OutNewLine(); if (!mbSkipHeaderFooter) { - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_body, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_body, false ); OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_html, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_html, false ); } // delete the table with floating frames @@ -666,7 +666,7 @@ static void lcl_html_OutSectionEndTag( SwHTMLWriter& rHTMLWrt ) rHTMLWrt.DecIndentLevel(); if( rHTMLWrt.m_bLFPossible ) rHTMLWrt.OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( rHTMLWrt.Strm(), OOO_STRING_SVTOOLS_HTML_division, false ); + HTMLOutFuncs::Out_AsciiTag( rHTMLWrt.Strm(), rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division, false ); rHTMLWrt.m_bLFPossible = true; } @@ -946,14 +946,14 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs ) sOut.append(OOO_STRING_SVTOOLS_HTML_doctype " " OOO_STRING_SVTOOLS_XHTML_doctype11); else sOut.append(OOO_STRING_SVTOOLS_HTML_doctype " " OOO_STRING_SVTOOLS_HTML_doctype40); - HTMLOutFuncs::Out_AsciiTag( Strm(), sOut.makeStringAndClear().getStr() ); + HTMLOutFuncs::Out_AsciiTag( Strm(), sOut.makeStringAndClear().getStr() ); // No GetNamespace() here. // build prelude OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_html ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_html ); OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_head ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_head ); IncIndentLevel(); // indent content of <HEAD> @@ -1022,11 +1022,11 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs ) DecIndentLevel(); // indent content of <HEAD> OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_head, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_head, false ); // the body won't be indented, because then everything would be indented! OutNewLine(); - sOut.append("<" OOO_STRING_SVTOOLS_HTML_body); + sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_body); Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); // language @@ -1075,7 +1075,7 @@ void SwHTMLWriter::OutAnchor( const OUString& rName ) sOut.append("<" OOO_STRING_SVTOOLS_HTML_anchor " " OOO_STRING_SVTOOLS_HTML_O_name "=\""); Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); HTMLOutFuncs::Out_String( Strm(), rName, m_eDestEnc, &m_aNonConvertableCharacters ).WriteCharPtr( "\">" ); - HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_anchor, false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor, false ); } void SwHTMLWriter::OutBookmarks() @@ -1422,6 +1422,14 @@ sal_Int32 SwHTMLWriter::indexOfDotLeaders( sal_uInt16 nPoolId, const OUString& r return -1; } +OString SwHTMLWriter::GetNamespace() const +{ + if (maNamespace.isEmpty()) + return OString(); + + return maNamespace + ":"; +} + // Structure caches the current data of the writer to output a // other part of the document, like e.g. header/footer HTMLSaveData::HTMLSaveData(SwHTMLWriter& rWriter, sal_uLong nStt, diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 488f7eed5a5b..55bf6fb81bfd 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -567,6 +567,9 @@ public: FieldUnit GetCSS1Unit() const { return m_eCSS1Unit; } sal_Int32 indexOfDotLeaders( sal_uInt16 nPoolId, const OUString& rText ); + + /// Determines the prefix string needed to respect the requested namespace alias. + OString GetNamespace() const; }; inline bool SwHTMLWriter::IsCSS1Source( sal_uInt16 n ) const _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits