diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-06-06 15:29:28 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-06-06 18:25:26 +0200 |
commit | 1380f5d5425b0860ed7aa9d1a876fed76449ffbd (patch) | |
tree | a61ae20702fec8baf6a9a8c4796c00b2098820dc /sd | |
parent | 0fe9defae696fafd0f4e33586375f5c3aedc104b (diff) |
sd html: Implement export of metadata in the single document case.
Change-Id: Icf99c9bcea187e2a3127b97050d6ddb072540b0d
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 37 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.hxx | 4 |
2 files changed, 35 insertions, 6 deletions
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index cdb18b26ed2e..b2752069db88 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 cdf84ccc32bb..19709dc9a955 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(); |