sd/qa/unit/HtmlExportTest.cxx | 5 ++++ sd/source/filter/html/htmlex.cxx | 39 ++++++++++++++++++++++++++++++++------ sd/source/filter/html/htmlex.hxx | 4 +++ sfx2/source/bastyp/frmhtmlw.cxx | 2 - sw/source/filter/html/htmlatr.cxx | 4 +-- 5 files changed, 45 insertions(+), 9 deletions(-)
New commits: commit b00d84975ebbc254821e8fa64173cf7c7f2c6a01 Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Jun 6 16:00:16 2014 +0200 sd html: Provide some minimal reasonable defaults. Change-Id: I72b02f7d87cf6075d318c1cc0d7288e27bbe1b9c diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index b275206..8768186 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -372,6 +372,8 @@ HtmlExport::HtmlExport( mbSlideSound(true), mbHiddenSlides(true), mbUserAttr(false), + maTextColor(COL_BLACK), + maBackColor(COL_WHITE), mbDocColors(false), maHTMLExtension(SdResId(STR_HTMLEXP_DEFAULT_EXTENSION)), maIndexUrl("index"), commit 2f5415349138f21cc288758964ecb9e76bbacdee Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Jun 6 15:46:51 2014 +0200 sd html: Unit test for the metadata export. Change-Id: I1e38e28b57e816a0829d1a56f2ffcb32d8f93718 diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index 388417f..388dfef 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -42,6 +42,11 @@ public: assertXPath(htmlDoc, "/html/body/table/tr", 5); assertXPath(htmlDoc, "/html/body/ul", 1); assertXPath(htmlDoc, "/html/body/ul/li", 2); + + assertXPath(htmlDoc, "/html/head/meta[1]", "content", "text/html; charset=utf-8"); + assertXPath(htmlDoc, "/html/head/meta[2]", "name", "generator"); + assertXPath(htmlDoc, "/html/head/meta[3]", "name", "created"); + assertXPath(htmlDoc, "/html/head/meta[3]", "content", "20140409;170541987922038"); } CPPUNIT_TEST_SUITE(SdHTMLFilterTest); commit db9f42f0c044a6a6ca9e57bef57507ab05d4e79e Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Jun 6 15:46:16 2014 +0200 html export: Close the <meta> tags. Change-Id: Icca58dd1531f2442fe5878ed9524a3611c0601ea diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 1ef646d..93567e2 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -76,7 +76,7 @@ void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm, sOut.append("\" ").append(OOO_STRING_SVTOOLS_HTML_O_content).append("=\""); rStrm.WriteCharPtr( sOut.makeStringAndClear().getStr() ); - HTMLOutFuncs::Out_String( rStrm, rContent, eDestEnc, pNonConvertableChars ).WriteCharPtr( "\">" ); + HTMLOutFuncs::Out_String( rStrm, rContent, eDestEnc, pNonConvertableChars ).WriteCharPtr( "\"/>" ); } void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL, commit 1380f5d5425b0860ed7aa9d1a876fed76449ffbd Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Jun 6 15:29:28 2014 +0200 sd html: Implement export of metadata in the single document case. Change-Id: Icf99c9bcea187e2a3127b97050d6ddb072540b0d diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index cdb18b2..b275206 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "htmlex.hxx" +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/drawing/GraphicExportFilter.hpp> @@ -32,6 +32,11 @@ #include <unotools/ucbstreamhelper.hxx> #include <unotools/localfilehelper.hxx> #include <com/sun/star/frame/XStorable.hpp> +#include <sfx2/app.hxx> +#include <sfx2/dispatch.hxx> +#include <sfx2/docfile.hxx> +#include <sfx2/fcontnr.hxx> +#include <sfx2/frmhtmlw.hxx> #include <sfx2/progress.hxx> #include <vcl/wrkwin.hxx> #include <svl/aeitem.hxx> @@ -40,13 +45,11 @@ #include <svtools/imapcirc.hxx> #include <svtools/imappoly.hxx> #include <vcl/msgbox.hxx> -#include <sfx2/app.hxx> #include <editeng/outlobj.hxx> #include <editeng/editobj.hxx> #include <svx/svdopath.hxx> #include <svx/xoutbmp.hxx> #include <svtools/htmlout.hxx> -#include <sfx2/docfile.hxx> #include <vcl/cvtgrf.hxx> #include <svtools/colorcfg.hxx> #include <vcl/graphicfilter.hxx> @@ -57,8 +60,6 @@ #include <editeng/postitem.hxx> #include <editeng/crossedoutitem.hxx> #include <editeng/flditem.hxx> -#include <sfx2/dispatch.hxx> -#include <sfx2/fcontnr.hxx> #include <svl/style.hxx> #include <editeng/frmdiritem.hxx> #include <svx/svdoutl.hxx> @@ -648,7 +649,8 @@ void HtmlExport::ExportSingleDocument() InitProgress(mnSdPageCount); OUStringBuffer aStr(maHTMLHeader); - aStr.append(CreateMetaCharset()); + aStr.append(DocumentMetadata()); + aStr.append("\r\n"); aStr.append("</head>\r\n"); aStr.append(CreateBodyTag()); @@ -1084,6 +1086,29 @@ OUString HtmlExport::CreateMetaCharset() const return aStr; } +OUString HtmlExport::DocumentMetadata() const +{ + SvMemoryStream aStream; + + uno::Reference<document::XDocumentProperties> xDocProps; + if (mpDocSh) + { + uno::Reference<document::XDocumentPropertiesSupplier> xDPS( + mpDocSh->GetModel(), uno::UNO_QUERY_THROW); + xDocProps.set(xDPS->getDocumentProperties()); + } + + OUString aNonConvertableCharacters; + + SfxFrameHTMLWriter::Out_DocInfo(aStream, maDocFileName, xDocProps, + " ", RTL_TEXTENCODING_UTF8, + &aNonConvertableCharacters); + + OString aData(reinterpret_cast<const char*>(aStream.GetData()), aStream.GetSize()); + + return OStringToOUString(aData, RTL_TEXTENCODING_UTF8); +} + bool HtmlExport::CreateHtmlTextForPresPages() { bool bOk = true; diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx index cdf84cc..19709dc 100644 --- a/sd/source/filter/html/htmlex.hxx +++ b/sd/source/filter/html/htmlex.hxx @@ -202,8 +202,12 @@ class HtmlExport void InitProgress( sal_uInt16 nProgrCount ); void ResetProgress(); + /// Output only the charset metadata, title etc. will be handled separately. OUString CreateMetaCharset() const; + /// Output document metadata. + OUString DocumentMetadata() const; + void InitExportParameters( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rParams); void ExportHtml(); void ExportKiosk(); commit 0fe9defae696fafd0f4e33586375f5c3aedc104b Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Jun 6 08:55:16 2014 +0200 sw html: Translate some german comments. Change-Id: I4b8e83dc53e09ba18b5cd0e907ce2412d7f7dd98 diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 5d16458..c6eb10e 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2927,11 +2927,11 @@ Writer& OutHTML_INetFmt( Writer& rWrt, const SwFmtINetFmt& rINetFmt, bool bOn ) const SvxMacroTableDtor *pMacTable = rINetFmt.GetMacroTbl(); bool bEvents = pMacTable != 0 && !pMacTable->empty(); - // Gibt es ueberhaupt etwas auszugeben? + // Anything to output at all? if( aURL.isEmpty() && !bEvents && rINetFmt.GetName().isEmpty() ) return rWrt; - // Tag aus? Dann nur ein </A> ausgeben. + // bOn controls if we are writing the opening or closing tag if( !bOn ) { HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_anchor, false ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits