[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Mar 2 07:08:42 UTC 2018
sw/qa/extras/htmlexport/data/reqif-p.xhtml | 1 +
sw/qa/extras/htmlexport/htmlexport.cxx | 4 ++++
sw/source/filter/html/htmltabw.cxx | 11 ++++++-----
3 files changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 12c3ab8c341ff6482ce380ca4010bb7b97e35bf7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Mar 1 17:50:52 2018 +0100
sw HTML export: XHTML ns alias for table markup
This was forgotten from the previous mass-conversion of adding namespace
aliases to written elements.
Change-Id: Id9b7e961c941ec3b3614e3694963c3f9ef9e46eb
Reviewed-on: https://gerrit.libreoffice.org/50595
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/qa/extras/htmlexport/data/reqif-p.xhtml b/sw/qa/extras/htmlexport/data/reqif-p.xhtml
index 36f5aa11768b..2f069d78e0eb 100644
--- a/sw/qa/extras/htmlexport/data/reqif-p.xhtml
+++ b/sw/qa/extras/htmlexport/data/reqif-p.xhtml
@@ -1 +1,2 @@
<reqif-xhtml:p>aaa<reqif-xhtml:br/>bbb</reqif-xhtml:p>
+<reqif-xhtml:table><reqif-xhtml:tr><reqif-xhtml:td>in table</reqif-xhtml:tr></reqif-xhtml:tr></reqif-xhtml:table>
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index e1b7313195e3..f329c3d4a79f 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -337,6 +337,10 @@ DECLARE_HTMLEXPORT_TEST(testReqIfParagraph, "reqif-p.xhtml")
CPPUNIT_ASSERT(pStream);
OString aExpected("<reqif-xhtml:p>aaa<reqif-xhtml:br/>\nbbb</reqif-xhtml:p>" SAL_NEWLINE_STRING);
+
+ // This was '<table' instead.
+ aExpected += "<reqif-xhtml:table";
+
OString aActual(read_uInt8s_ToOString(*pStream, aExpected.getLength()));
// This was a HTML header, like '<!DOCTYPE html ...'.
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 0f644f0f4855..f856af17eac4 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -300,7 +300,8 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
rWrt.OutNewLine(); // <TH>/<TD> in new line
OStringBuffer sOut;
sOut.append('<');
- sOut.append(bHead ? OOO_STRING_SVTOOLS_HTML_tableheader : OOO_STRING_SVTOOLS_HTML_tabledata);
+ OString aTag(bHead ? OOO_STRING_SVTOOLS_HTML_tableheader : OOO_STRING_SVTOOLS_HTML_tabledata);
+ sOut.append(rWrt.GetNamespace() + aTag);
// output ROW- and COLSPAN
if( nRowSpan>1 )
@@ -483,7 +484,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
if( rWrt.m_bLFPossible )
rWrt.OutNewLine();
- OString aTag = bHead ? OOO_STRING_SVTOOLS_HTML_tableheader : OOO_STRING_SVTOOLS_HTML_tabledata;
+ 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;
}
@@ -514,7 +515,7 @@ void SwHTMLWrtTable::OutTableCells( SwHTMLWriter& rWrt,
}
rWrt.OutNewLine(); // <TR> in new line
- rWrt.Strm().WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_tablerow );
+ rWrt.Strm().WriteChar( '<' ).WriteOString( rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow );
if( pBrushItem )
{
rWrt.OutBackground( pBrushItem, false );
@@ -598,7 +599,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
if( rWrt.m_bLFPossible )
rWrt.OutNewLine(); // <TABLE> in new line
OStringBuffer sOut;
- sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_table);
+ sOut.append('<').append(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_table);
const SvxFrameDirection nOldDirection = rWrt.m_nDirection;
if( pFrameFormat )
@@ -732,7 +733,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
const SwWriteTableCol *pColumn = m_aCols[nCol];
OStringBuffer sOutStr;
- sOutStr.append('<').append(OOO_STRING_SVTOOLS_HTML_col);
+ sOutStr.append('<').append(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_col);
sal_uInt32 nWidth;
bool bRel;
More information about the Libreoffice-commits
mailing list