diff --git a/compilerplugins/clang/singlevalfields.could-be-bool.results b/compilerplugins/clang/singlevalfields.could-be-bool.results index a724683a6b2f..9b2fdf51b0f5 100644 --- a/compilerplugins/clang/singlevalfields.could-be-bool.results +++ b/compilerplugins/clang/singlevalfields.could-be-bool.results @@ -181,9 +181,6 @@ sd/qa/unit/tiledrendering/tiledrendering.cxx:895 sd/source/filter/html/htmlex.hxx:142 HtmlExport meScript PublishingScript -sd/source/filter/html/HtmlOptionsDialog.cxx:54 - (anonymous namespace)::SdHtmlOptionsDialog meDocType - DocumentType sd/source/ui/slideshow/slideshowimpl.hxx:304 sd::SlideshowImpl meAnimationMode AnimationMode diff --git a/compilerplugins/clang/singlevalfields.results b/compilerplugins/clang/singlevalfields.results index f625c11ff833..f64d36563bf9 100644 --- a/compilerplugins/clang/singlevalfields.results +++ b/compilerplugins/clang/singlevalfields.results @@ -754,9 +754,6 @@ sd/source/filter/html/htmlex.hxx:117 sd/source/ui/inc/CustomAnimationPane.hxx:144 sd::CustomAnimationPane maIdle sd idle treeview select -sd/source/ui/inc/pubdlg.hxx:157 - SdPublishingDlg aAssistentFunc - 6 sd/source/ui/inc/View.hxx:271 sd::View maDropErrorIdle sd View DropError diff --git a/compilerplugins/clang/writeonlyvars.cxx b/compilerplugins/clang/writeonlyvars.cxx index 068d4058e09d..3fb3f769b72d 100644 --- a/compilerplugins/clang/writeonlyvars.cxx +++ b/compilerplugins/clang/writeonlyvars.cxx @@ -415,8 +415,6 @@ void WriteOnlyVars::run() return; if (loplugin::isSamePathname(fn, SRCDIR "/sd/source/filter/xml/sdxmlwrp.cxx")) return; - if (loplugin::isSamePathname(fn, SRCDIR "/sd/source/filter/html/pubdlg.cxx")) - return; if (loplugin::isSamePathname(fn, SRCDIR "/sw/source/core/txtnode/thints.cxx")) return; if (loplugin::isSamePathname(fn, SRCDIR "/sw/source/core/doc/docbm.cxx")) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 434b65319776..777d1030d075 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -335,7 +335,6 @@ const ExtensionMap aCalcExtensionMap[] = const ExtensionMap aImpressExtensionMap[] = { { "fodp", "OpenDocument Presentation Flat XML" }, - { "html", "impress_html_Export" }, { "odg", "impress8_draw" }, { "odp", "impress8" }, { "otp", "impress8_template" }, @@ -355,7 +354,6 @@ const ExtensionMap aImpressExtensionMap[] = const ExtensionMap aDrawExtensionMap[] = { { "fodg", "draw_ODG_FlatXML" }, - { "html", "draw_html_Export" }, { "odg", "draw8" }, { "pdf", "draw_pdf_Export" }, { "svg", "draw_svg_Export" }, diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index bd3d3486234e..921189c4de25 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -764,7 +764,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_drawgraphics_f draw_emz_Export \ draw_eps_Export \ draw_gif_Export \ - draw_html_Export \ draw_jpg_Export \ draw_png_Export \ draw_svg_Export \ @@ -809,7 +808,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_impressgraphic impress_emf_Export \ impress_eps_Export \ impress_gif_Export \ - impress_html_Export \ impress_jpg_Export \ impress_png_Export \ impress_svg_Export \ diff --git a/filter/source/config/fragments/filters/draw_html_Export.xcu b/filter/source/config/fragments/filters/draw_html_Export.xcu deleted file mode 100644 index 179c7bb7edc0..000000000000 --- a/filter/source/config/fragments/filters/draw_html_Export.xcu +++ /dev/null @@ -1,30 +0,0 @@ - - - EXPORT ALIEN - com.sun.star.comp.draw.SdHtmlOptionsDialog - - - 0 - graphic_HTML - - com.sun.star.drawing.DrawingDocument - - HTML Document (Draw) - - diff --git a/filter/source/config/fragments/filters/impress_html_Export.xcu b/filter/source/config/fragments/filters/impress_html_Export.xcu deleted file mode 100644 index 65a5c5dadf78..000000000000 --- a/filter/source/config/fragments/filters/impress_html_Export.xcu +++ /dev/null @@ -1,30 +0,0 @@ - - - EXPORT ALIEN - com.sun.star.comp.draw.SdHtmlOptionsDialog - - - 0 - graphic_HTML - - com.sun.star.presentation.PresentationDocument - - HTML Document (Impress) - - diff --git a/icon-themes/colibre/sd/res/pubdes.png b/icon-themes/colibre/sd/res/pubdes.png deleted file mode 100644 index 82ded6f8b3af..000000000000 Binary files a/icon-themes/colibre/sd/res/pubdes.png and /dev/null differ diff --git a/icon-themes/colibre/sd/res/pubdes2.png b/icon-themes/colibre/sd/res/pubdes2.png deleted file mode 100644 index e797a25674b3..000000000000 Binary files a/icon-themes/colibre/sd/res/pubdes2.png and /dev/null differ diff --git a/icon-themes/colibre/sd/res/pubdes3.png b/icon-themes/colibre/sd/res/pubdes3.png deleted file mode 100644 index 4070e587bd4c..000000000000 Binary files a/icon-themes/colibre/sd/res/pubdes3.png and /dev/null differ diff --git a/icon-themes/colibre/sd/res/pubdes4.png b/icon-themes/colibre/sd/res/pubdes4.png deleted file mode 100644 index 9c0bbbfdc314..000000000000 Binary files a/icon-themes/colibre/sd/res/pubdes4.png and /dev/null differ diff --git a/icon-themes/colibre_dark/sd/res/pubdes.png b/icon-themes/colibre_dark/sd/res/pubdes.png deleted file mode 100644 index f414ab5a6e30..000000000000 Binary files a/icon-themes/colibre_dark/sd/res/pubdes.png and /dev/null differ diff --git a/icon-themes/colibre_dark/sd/res/pubdes2.png b/icon-themes/colibre_dark/sd/res/pubdes2.png deleted file mode 100644 index 8c25a49ddb08..000000000000 Binary files a/icon-themes/colibre_dark/sd/res/pubdes2.png and /dev/null differ diff --git a/icon-themes/colibre_dark/sd/res/pubdes3.png b/icon-themes/colibre_dark/sd/res/pubdes3.png deleted file mode 100644 index 096fea100332..000000000000 Binary files a/icon-themes/colibre_dark/sd/res/pubdes3.png and /dev/null differ diff --git a/icon-themes/colibre_dark/sd/res/pubdes4.png b/icon-themes/colibre_dark/sd/res/pubdes4.png deleted file mode 100644 index 7a10ff30c3ff..000000000000 Binary files a/icon-themes/colibre_dark/sd/res/pubdes4.png and /dev/null differ diff --git a/icon-themes/colibre_dark_svg/sd/res/pubdes.svg b/icon-themes/colibre_dark_svg/sd/res/pubdes.svg deleted file mode 100644 index 5409042ad4a1..000000000000 --- a/icon-themes/colibre_dark_svg/sd/res/pubdes.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/colibre_dark_svg/sd/res/pubdes2.svg b/icon-themes/colibre_dark_svg/sd/res/pubdes2.svg deleted file mode 100644 index fc7c230b3b8d..000000000000 --- a/icon-themes/colibre_dark_svg/sd/res/pubdes2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/colibre_dark_svg/sd/res/pubdes3.svg b/icon-themes/colibre_dark_svg/sd/res/pubdes3.svg deleted file mode 100644 index bd21496c11b5..000000000000 --- a/icon-themes/colibre_dark_svg/sd/res/pubdes3.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/colibre_dark_svg/sd/res/pubdes4.svg b/icon-themes/colibre_dark_svg/sd/res/pubdes4.svg deleted file mode 100644 index 049dbfda8354..000000000000 --- a/icon-themes/colibre_dark_svg/sd/res/pubdes4.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/colibre_svg/sd/res/pubdes.svg b/icon-themes/colibre_svg/sd/res/pubdes.svg deleted file mode 100644 index 691c3ee9f310..000000000000 --- a/icon-themes/colibre_svg/sd/res/pubdes.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/colibre_svg/sd/res/pubdes2.svg b/icon-themes/colibre_svg/sd/res/pubdes2.svg deleted file mode 100644 index 8f1c9861a264..000000000000 --- a/icon-themes/colibre_svg/sd/res/pubdes2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/colibre_svg/sd/res/pubdes3.svg b/icon-themes/colibre_svg/sd/res/pubdes3.svg deleted file mode 100644 index 169f09d240f4..000000000000 --- a/icon-themes/colibre_svg/sd/res/pubdes3.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/colibre_svg/sd/res/pubdes4.svg b/icon-themes/colibre_svg/sd/res/pubdes4.svg deleted file mode 100644 index 670d3d66761c..000000000000 --- a/icon-themes/colibre_svg/sd/res/pubdes4.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icon-themes/karasa_jaga/sd/res/pubdes.png b/icon-themes/karasa_jaga/sd/res/pubdes.png deleted file mode 100644 index 7a37ca7e11e9..000000000000 Binary files a/icon-themes/karasa_jaga/sd/res/pubdes.png and /dev/null differ diff --git a/icon-themes/karasa_jaga/sd/res/pubdes2.png b/icon-themes/karasa_jaga/sd/res/pubdes2.png deleted file mode 100644 index c585fa8edc17..000000000000 Binary files a/icon-themes/karasa_jaga/sd/res/pubdes2.png and /dev/null differ diff --git a/icon-themes/karasa_jaga/sd/res/pubdes3.png b/icon-themes/karasa_jaga/sd/res/pubdes3.png deleted file mode 100644 index 964568383c88..000000000000 Binary files a/icon-themes/karasa_jaga/sd/res/pubdes3.png and /dev/null differ diff --git a/icon-themes/karasa_jaga/sd/res/pubdes4.png b/icon-themes/karasa_jaga/sd/res/pubdes4.png deleted file mode 100644 index f56ff35ecd39..000000000000 Binary files a/icon-themes/karasa_jaga/sd/res/pubdes4.png and /dev/null differ diff --git a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu index 5dcce7b1e688..3dc6272ab7b2 100644 --- a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu +++ b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu @@ -26,7 +26,7 @@ - draw8;draw8_template;StarOffice XML (Draw);draw_StarOffice_XML_Draw_Template;OpenDocument Drawing Flat XML;draw_html_Export;draw_pdf_Export;draw_flash_Export;WordPerfect Graphics;DXF - AutoCAD Interchange;EMF - MS Windows Metafile;EPS - Encapsulated PostScript;MET - OS/2 Metafile;PCT - Mac Pict;SVM - StarView Metafile;WMF - MS Windows Metafile + draw8;draw8_template;StarOffice XML (Draw);draw_StarOffice_XML_Draw_Template;OpenDocument Drawing Flat XML;draw_pdf_Export;draw_flash_Export;WordPerfect Graphics;DXF - AutoCAD Interchange;EMF - MS Windows Metafile;EPS - Encapsulated PostScript;MET - OS/2 Metafile;PCT - Mac Pict;SVM - StarView Metafile;WMF - MS Windows Metafile diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 3d20e14f0ddd..e042b17edfb2 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -200,10 +200,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/filter/ppt/pptinanimations \ sd/source/filter/ppt/propread \ sd/source/filter/grf/sdgrffilter \ - sd/source/filter/html/HtmlOptionsDialog \ sd/source/filter/html/buttonset \ - sd/source/filter/html/htmlex \ - sd/source/filter/html/sdhtmlfilter \ sd/source/filter/pdf/sdpdffilter \ sd/source/filter/sdfilter \ sd/source/filter/sdpptwrp \ diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk index 247942273104..a59d2eed9041 100644 --- a/sd/Library_sdui.mk +++ b/sd/Library_sdui.mk @@ -67,7 +67,6 @@ $(eval $(call gb_Library_use_libraries,sdui,\ $(eval $(call gb_Library_add_exception_objects,sdui,\ sd/source/filter/html/htmlattr \ - sd/source/filter/html/pubdlg \ sd/source/ui/dlg/brkdlg \ sd/source/ui/dlg/copydlg \ sd/source/ui/dlg/custsdlg \ diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk index 766e5460c90a..9c3ec45adbfe 100644 --- a/sd/Module_sd.mk +++ b/sd/Module_sd.mk @@ -17,7 +17,6 @@ $(eval $(call gb_Module_add_targets,sd,\ Library_sdd \ Library_sdui \ Package_opengl \ - Package_web \ Package_xml \ UIConfig_sdraw \ UIConfig_simpress \ diff --git a/sd/Package_web.mk b/sd/Package_web.mk deleted file mode 100644 index 1c7c6b80a537..000000000000 --- a/sd/Package_web.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Package_Package,sd_web,$(SRCDIR)/sd/res)) - -$(eval $(call gb_Package_add_files,sd_web,$(LIBO_SHARE_FOLDER)/config/webcast,\ - webview/common.inc \ - webview/common.pl \ - webview/edit.asp \ - webview/editpic.asp \ - webview/editpic.pl \ - webview/edit.pl \ - webview/index.pl \ - webview/poll.asp \ - webview/poll.pl \ - webview/savepic.asp \ - webview/savepic.pl \ - webview/show.asp \ - webview/show.pl \ - webview/webcast.asp \ - webview/webcast.pl \ -)) - -$(eval $(call gb_Package_add_files,sd_web,$(LIBO_SHARE_FOLDER)/config/wizard/web/buttons,\ - buttons/elementary.zip \ - buttons/sukapura.zip \ - buttons/round-white.zip \ - buttons/simple.zip \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk index ab6b2875e7bc..5bd443ca374d 100644 --- a/sd/UIConfig_simpress.mk +++ b/sd/UIConfig_simpress.mk @@ -158,7 +158,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\ sd/uiconfig/simpress/ui/pmsummarypage \ sd/uiconfig/simpress/ui/presentationdialog \ sd/uiconfig/simpress/ui/prntopts \ - sd/uiconfig/simpress/ui/publishingdialog \ sd/uiconfig/simpress/ui/remotedialog \ sd/uiconfig/simpress/ui/rotatemenu \ sd/uiconfig/simpress/ui/scalemenu \ diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx index 8dbdf363f320..594602af2589 100644 --- a/sd/inc/sdabstdlg.hxx +++ b/sd/inc/sdabstdlg.hxx @@ -147,14 +147,6 @@ public: virtual const GDIMetaFile& GetGDIMetaFile() const = 0; }; -class AbstractSdPublishingDlg : public VclAbstractDialog -{ -protected: - virtual ~AbstractSdPublishingDlg() override = default; -public: - virtual void GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams ) = 0; -}; - class AbstractHeaderFooterDialog : public VclAbstractDialog { protected: @@ -187,7 +179,6 @@ public: virtual VclPtr CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0; virtual VclPtr CreatSdActionDialog(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) = 0; virtual VclPtr CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) = 0; - virtual VclPtr CreateSdPublishingDlg(weld::Window* pWindow, DocumentType eDocType) = 0; virtual VclPtr CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage*) = 0; diff --git a/sd/inc/sdhtmlfilter.hxx b/sd/inc/sdhtmlfilter.hxx deleted file mode 100644 index 84b9c5d48e0f..000000000000 --- a/sd/inc/sdhtmlfilter.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include "sdfilter.hxx" - -// SdHTMLFilter -class SdHTMLFilter final : public SdFilter -{ -public: - SdHTMLFilter(SfxMedium& rMedium, ::sd::DrawDocShell& rDocShell); - virtual ~SdHTMLFilter() override; - - virtual bool Export() override; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index 93c1a21339d1..be7884d51156 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -12,34 +12,14 @@ using namespace css; -class SdHTMLFilterTest : public UnoApiXmlTest, public HtmlTestTools +class SdXHTMLFilterTest : public UnoApiXmlTest, public HtmlTestTools { public: - SdHTMLFilterTest() + SdXHTMLFilterTest() : UnoApiXmlTest("/sd/qa/unit/data/") { } - void testHTMLExport() - { - loadFromURL(u"HtmlExportTestDocument.odp"); - save("impress_html_Export"); - htmlDocUniquePtr htmlDoc = parseHtml(maTempFile); - - assertXPath(htmlDoc, "/html", 1); - assertXPath(htmlDoc, "/html/body", 1); - assertXPath(htmlDoc, "/html/body/h1", 4); - assertXPath(htmlDoc, "/html/body/table", 1); - 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", "2014-04-09T17:05:41.987922038"); - } - void testTdf154989() { loadFromURL(u"tdf154989.odg"); @@ -63,13 +43,12 @@ public: pXmlDoc, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[4]/xhtml:div/xhtml:p", "below"); } - CPPUNIT_TEST_SUITE(SdHTMLFilterTest); - CPPUNIT_TEST(testHTMLExport); + CPPUNIT_TEST_SUITE(SdXHTMLFilterTest); CPPUNIT_TEST(testTdf154989); CPPUNIT_TEST_SUITE_END(); }; -CPPUNIT_TEST_SUITE_REGISTRATION(SdHTMLFilterTest); +CPPUNIT_TEST_SUITE_REGISTRATION(SdXHTMLFilterTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/qa/unit/data/dialogs-test.txt b/sd/qa/unit/data/dialogs-test.txt index b3585b8e925a..33004038c71f 100644 --- a/sd/qa/unit/data/dialogs-test.txt +++ b/sd/qa/unit/data/dialogs-test.txt @@ -36,7 +36,6 @@ modules/sdraw/ui/drawparadialog.ui modules/sdraw/ui/drawprtldialog.ui modules/sdraw/ui/vectorize.ui -modules/simpress/ui/publishingdialog.ui modules/simpress/ui/customslideshows.ui modules/simpress/ui/dlgfield.ui modules/simpress/ui/presentationdialog.ui diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx index 30cb95941b11..6cb34354b84c 100644 --- a/sd/qa/unit/dialogs-test.cxx +++ b/sd/qa/unit/dialogs-test.cxx @@ -209,29 +209,28 @@ const SfxItemSet& SdDialogsTest::getEmptyFillStyleSfxItemSet() void SdDialogsTest::registerKnownDialogsByID(mapType& rKnownDialogs) { // fill map of known dialogs - rKnownDialogs["modules/simpress/ui/publishingdialog.ui"] = 0; - rKnownDialogs["modules/sdraw/ui/breakdialog.ui"] = 1; - rKnownDialogs["modules/sdraw/ui/copydlg.ui"] = 2; - rKnownDialogs["modules/simpress/ui/customslideshows.ui"] = 3; - rKnownDialogs["modules/sdraw/ui/drawchardialog.ui"] = 4; - rKnownDialogs["modules/sdraw/ui/drawpagedialog.ui"] = 5; - rKnownDialogs["modules/simpress/ui/dlgfield.ui"] = 6; - rKnownDialogs["modules/sdraw/ui/dlgsnap.ui"] = 7; - rKnownDialogs["modules/sdraw/ui/insertlayer.ui"] = 8; - rKnownDialogs["modules/sdraw/ui/insertslidesdialog.ui"] = 9; - rKnownDialogs["modules/sdraw/ui/crossfadedialog.ui"] = 10; - rKnownDialogs["modules/sdraw/ui/bulletsandnumbering.ui"] = 11; - rKnownDialogs["modules/sdraw/ui/drawparadialog.ui"] = 12; - rKnownDialogs["modules/simpress/ui/presentationdialog.ui"] = 13; - rKnownDialogs["modules/simpress/ui/remotedialog.ui"] = 14; - rKnownDialogs["modules/sdraw/ui/drawprtldialog.ui"] = 15; - rKnownDialogs["modules/simpress/ui/slidedesigndialog.ui"] = 16; - rKnownDialogs["modules/simpress/ui/templatedialog.ui"] = 17; - rKnownDialogs["modules/simpress/ui/interactiondialog.ui"] = 18; - rKnownDialogs["modules/sdraw/ui/vectorize.ui"] = 19; - rKnownDialogs["modules/simpress/ui/photoalbum.ui"] = 20; - rKnownDialogs["modules/simpress/ui/masterlayoutdlg.ui"] = 21; - rKnownDialogs["modules/simpress/ui/headerfooterdialog.ui"] = 22; + rKnownDialogs["modules/sdraw/ui/breakdialog.ui"] = 0; + rKnownDialogs["modules/sdraw/ui/copydlg.ui"] = 1; + rKnownDialogs["modules/simpress/ui/customslideshows.ui"] = 2; + rKnownDialogs["modules/sdraw/ui/drawchardialog.ui"] = 3; + rKnownDialogs["modules/sdraw/ui/drawpagedialog.ui"] = 4; + rKnownDialogs["modules/simpress/ui/dlgfield.ui"] = 5; + rKnownDialogs["modules/sdraw/ui/dlgsnap.ui"] = 6; + rKnownDialogs["modules/sdraw/ui/insertlayer.ui"] = 7; + rKnownDialogs["modules/sdraw/ui/insertslidesdialog.ui"] = 8; + rKnownDialogs["modules/sdraw/ui/crossfadedialog.ui"] = 9; + rKnownDialogs["modules/sdraw/ui/bulletsandnumbering.ui"] = 10; + rKnownDialogs["modules/sdraw/ui/drawparadialog.ui"] = 11; + rKnownDialogs["modules/simpress/ui/presentationdialog.ui"] = 12; + rKnownDialogs["modules/simpress/ui/remotedialog.ui"] = 13; + rKnownDialogs["modules/sdraw/ui/drawprtldialog.ui"] = 14; + rKnownDialogs["modules/simpress/ui/slidedesigndialog.ui"] = 15; + rKnownDialogs["modules/simpress/ui/templatedialog.ui"] = 16; + rKnownDialogs["modules/simpress/ui/interactiondialog.ui"] = 17; + rKnownDialogs["modules/sdraw/ui/vectorize.ui"] = 18; + rKnownDialogs["modules/simpress/ui/photoalbum.ui"] = 19; + rKnownDialogs["modules/simpress/ui/masterlayoutdlg.ui"] = 20; + rKnownDialogs["modules/simpress/ui/headerfooterdialog.ui"] = 21; } VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) @@ -243,18 +242,6 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) switch (nID) { case 0: - { - // CreateSdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType) override; - // this dialog does not need much, not even a SdDrawDocument. OTOH - // it is more a 'wizard' in that it has prev/next buttons and implicitly - // multiple pages. To make use of that it is necessary that the implementation - // supports the 'Screenshot interface' - pRetval = getSdAbstractDialogFactory()->CreateSdPublishingDlg( - Application::GetDefDialogParent(), - DocumentType::Impress); - break; - } - case 1: { // CreateBreakDlg(weld::Window* pWindow, ::sd::DrawView* pDrView, ::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount) override; // this dialog requires pDrawView. It does not show much when @@ -269,7 +256,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) 0); break; } - case 2: + case 1: { // needs an SfxItemSet, use the one from the 1st object pRetval = getSdAbstractDialogFactory()->CreateCopyDlg( @@ -278,7 +265,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getDrawView()); break; } - case 3: + case 2: { // CreateSdCustomShowDlg(SdDrawDocument& rDrawDoc) = 0; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -288,7 +275,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getViewShell()->GetFrameWeld(), *pDrawDoc); break; } - case 4: + case 3: { // CreateSdTabCharDialog(const SfxItemSet* pAttr, SfxObjectShell* pDocShell) override; // needs an SfxItemSet, use an empty constructed one @@ -299,7 +286,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getDocShell()); break; } - case 5: + case 4: { // CreateSdTabPageDialog(const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage = true, bool bIsImpressDoc) override; // needs a special SfxItemSet with merged content from page and other stuff, crashes without that (2nd page) @@ -311,7 +298,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) true, /*bIsImpressDoc=*/false); break; } - case 6: + case 5: { // CreateSdModifyFieldDlg(weld::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet) override; pRetval = getSdAbstractDialogFactory()->CreateSdModifyFieldDlg( @@ -320,7 +307,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getEmptySfxItemSet()); break; } - case 7: + case 6: { // CreateSdSnapLineDlg(const SfxItemSet& rInAttrs, ::sd::View* pView) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -334,7 +321,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getDrawView()); break; } - case 8: + case 7: { // CreateSdInsertLayerDlg(const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -355,7 +342,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) SdResId(STR_INSERTLAYER) /* alternative: STR_MODIFYLAYER */); break; } - case 9: + case 8: { // CreateSdInsertPagesObjsDlg(const SdDrawDocument* pDoc, SfxMedium* pSfxMedium, const OUString& rFileName) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -367,7 +354,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) "foo"); break; } - case 10: + case 9: { // CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -383,7 +370,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) pSdrObj); break; } - case 11: + case 10: { // CreateSdOutlineBulletTabDlg(const SfxItemSet* pAttr, ::sd::View* pView = nullptr) override; pRetval = getSdAbstractDialogFactory()->CreateSdOutlineBulletTabDlg( @@ -392,7 +379,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getDrawView()); break; } - case 12: + case 11: { // CreateSdParagraphTabDlg(const SfxItemSet* pAttr) override; pRetval = getSdAbstractDialogFactory()->CreateSdParagraphTabDlg( @@ -400,7 +387,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) &getEmptySfxItemSet()); break; } - case 13: + case 12: { // CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs, const std::vector &rPageNames, SdCustomShowList* pCSList) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -430,14 +417,14 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) nullptr); break; } - case 14: + case 13: { // CreateRemoteDialog(vcl::Window* pWindow) override; // ad for RemoteDialog pRetval = getSdAbstractDialogFactory()->CreateRemoteDialog( Application::GetDefDialogParent()); break; } - case 15: + case 14: { // CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override; // use STR_PSEUDOSHEET_TITLE configuration, see futempl.cxx for more possible configurations @@ -455,7 +442,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) pStyleSheetPool); break; } - case 16: + case 15: { // CreateSdPresLayoutDlg(::sd::DrawDocShell* pDocShell, vcl::Window* pWindow, const SfxItemSet& rInAttrs) override; pRetval = getSdAbstractDialogFactory()->CreateSdPresLayoutDlg( @@ -464,7 +451,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getEmptySfxItemSet()); break; } - case 17: + case 16: { // CreateSdTabTemplateDlg(const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) override; // pretty similar to CreateSdPresLayoutTemplateDlg, see above @@ -483,7 +470,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getDrawView()); break; } - case 18: + case 17: { // CreatSdActionDialog(const SfxItemSet* pAttr, ::sd::View* pView) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -511,7 +498,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getDrawView()); break; } - case 19: + case 18: { // CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) override; // works well with empty Bitmap, but my be nicer with setting one @@ -522,7 +509,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) getDocShell()); break; } - case 20: + case 19: { // CreateSdPhotoAlbumDialog(weld::Window* pWindow, SdDrawDocument* pDoc) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -532,7 +519,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) pDrawDoc); break; } - case 21: + case 20: { // CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage*) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); @@ -545,7 +532,7 @@ VclPtr SdDialogsTest::createDialogByID(sal_uInt32 nID) pSdPage); break; } - case 22: + case 21: { // CreateHeaderFooterDialog(sd::ViewShell* pViewShell, weld::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage) override; // This is a hard case, for two reasons: diff --git a/sd/res/buttons/elementary.zip b/sd/res/buttons/elementary.zip deleted file mode 100644 index 3bb99b9c77b9..000000000000 Binary files a/sd/res/buttons/elementary.zip and /dev/null differ diff --git a/sd/res/buttons/round-white.zip b/sd/res/buttons/round-white.zip deleted file mode 100644 index 9c5f1b2aaa3e..000000000000 Binary files a/sd/res/buttons/round-white.zip and /dev/null differ diff --git a/sd/res/buttons/simple.zip b/sd/res/buttons/simple.zip deleted file mode 100644 index 60c0b095702a..000000000000 Binary files a/sd/res/buttons/simple.zip and /dev/null differ diff --git a/sd/res/buttons/sukapura.zip b/sd/res/buttons/sukapura.zip deleted file mode 100644 index 80cccc6bc122..000000000000 Binary files a/sd/res/buttons/sukapura.zip and /dev/null differ diff --git a/sd/source/filter/html/HtmlOptionsDialog.cxx b/sd/source/filter/html/HtmlOptionsDialog.cxx deleted file mode 100644 index 52d50472d9b1..000000000000 --- a/sd/source/filter/html/HtmlOptionsDialog.cxx +++ /dev/null @@ -1,203 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::document; -using namespace com::sun::star::beans; -using namespace com::sun::star::ui::dialogs; - -namespace { - -class SdHtmlOptionsDialog : public cppu::WeakImplHelper -< - XExporter, - XExecutableDialog, - XPropertyAccess, - XInitialization, - XServiceInfo -> -{ - Sequence< PropertyValue > maMediaDescriptor; - Sequence< PropertyValue > maFilterDataSequence; - DocumentType meDocType; - -public: - - SdHtmlOptionsDialog(); - - // XInterface - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - - // XInitialization - virtual void SAL_CALL initialize( const Sequence< Any > & aArguments ) override; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - // XPropertyAccess - virtual Sequence< PropertyValue > SAL_CALL getPropertyValues() override; - virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< css::beans::PropertyValue > & aProps ) override; - - // XExecuteDialog - virtual sal_Int16 SAL_CALL execute() override; - virtual void SAL_CALL setTitle( const OUString& aTitle ) override; - - // XExporter - virtual void SAL_CALL setSourceDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) override; - -}; - -} - -SdHtmlOptionsDialog::SdHtmlOptionsDialog() : - meDocType ( DocumentType::Draw ) -{ -} - -void SAL_CALL SdHtmlOptionsDialog::acquire() noexcept -{ - OWeakObject::acquire(); -} - -void SAL_CALL SdHtmlOptionsDialog::release() noexcept -{ - OWeakObject::release(); -} - -// XInitialization -void SAL_CALL SdHtmlOptionsDialog::initialize( const Sequence< Any > & ) -{ -} - -// XServiceInfo -OUString SAL_CALL SdHtmlOptionsDialog::getImplementationName() -{ - return "com.sun.star.comp.draw.SdHtmlOptionsDialog"; -} - -sal_Bool SAL_CALL SdHtmlOptionsDialog::supportsService( const OUString& rServiceName ) -{ - return cppu::supportsService(this, rServiceName); -} - -Sequence< OUString > SAL_CALL SdHtmlOptionsDialog::getSupportedServiceNames() -{ - return { "com.sun.star.ui.dialog.FilterOptionsDialog" }; -} - -// XPropertyAccess -Sequence< PropertyValue > SdHtmlOptionsDialog::getPropertyValues() -{ - auto pProp = std::find_if(std::cbegin(maMediaDescriptor), std::cend(maMediaDescriptor), - [](const PropertyValue& rProp) { return rProp.Name == "FilterData"; }); - auto i = static_cast(std::distance(std::cbegin(maMediaDescriptor), pProp)); - sal_Int32 nCount = maMediaDescriptor.getLength(); - if ( i == nCount ) - maMediaDescriptor.realloc( ++nCount ); - - // the "FilterData" Property is an Any that will contain our PropertySequence of Values - auto& el = maMediaDescriptor.getArray()[ i ]; - el.Name = "FilterData"; - el.Value <<= maFilterDataSequence; - return maMediaDescriptor; -} - -void SdHtmlOptionsDialog::setPropertyValues( const Sequence< PropertyValue > & aProps ) -{ - maMediaDescriptor = aProps; - - auto pProp = std::find_if(std::cbegin(maMediaDescriptor), std::cend(maMediaDescriptor), - [](const PropertyValue& rProp) { return rProp.Name == "FilterData"; }); - if (pProp != std::cend(maMediaDescriptor)) - pProp->Value >>= maFilterDataSequence; -} - -// XExecutableDialog -void SdHtmlOptionsDialog::setTitle( const OUString& ) -{ -} - -sal_Int16 SdHtmlOptionsDialog::execute() -{ - sal_Int16 nRet = ExecutableDialogResults::CANCEL; - - SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - ScopedVclPtr pDlg(pFact->CreateSdPublishingDlg(nullptr /*TODO*/, meDocType)); - if( pDlg->Execute() ) - { - pDlg->GetParameterSequence( maFilterDataSequence ); - nRet = ExecutableDialogResults::OK; - } - else - { - nRet = ExecutableDialogResults::CANCEL; - } - return nRet; -} - -// XEmporter -void SdHtmlOptionsDialog::setSourceDocument( const Reference< XComponent >& xDoc ) -{ - // try to set the corresponding metric unit - Reference< XServiceInfo > xServiceInfo(xDoc, UNO_QUERY); - if ( xServiceInfo.is() ) - { - if ( xServiceInfo->supportsService( "com.sun.star.presentation.PresentationDocument" ) ) - { - meDocType = DocumentType::Impress; - return; - } - else if ( xServiceInfo->supportsService( "com.sun.star.drawing.DrawingDocument" ) ) - { - meDocType = DocumentType::Draw; - return; - } - } - throw IllegalArgumentException(); -} - - -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* -com_sun_star_comp_draw_SdHtmlOptionsDialog_get_implementation(css::uno::XComponentContext*, - css::uno::Sequence const &) -{ - return cppu::acquire(new SdHtmlOptionsDialog()); -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx deleted file mode 100644 index c3f1625dad59..000000000000 --- a/sd/source/filter/html/htmlex.cxx +++ /dev/null @@ -1,3176 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "htmlex.hxx" -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "htmlpublishmode.hxx" -#include -#include -#include -#include -#include -#include -#include "buttonset.hxx" - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::frame; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::document; - -using namespace sdr::table; - -// get parameter from Itemset -#define RESTOHTML( res ) StringToHTMLString(SdResId(res)) - -const char * const pButtonNames[] = -{ - "first-inactive.png", - "first.png", - "left-inactive.png", - "left.png", - "right-inactive.png", - "right.png", - "last-inactive.png", - "last.png", - "home.png", - "text.png", - "expand.png", - "collapse.png", -}; - -#define BTN_FIRST_0 0 -#define BTN_FIRST_1 1 -#define BTN_PREV_0 2 -#define BTN_PREV_1 3 -#define BTN_NEXT_0 4 -#define BTN_NEXT_1 5 -#define BTN_LAST_0 6 -#define BTN_LAST_1 7 -#define BTN_INDEX 8 -#define BTN_TEXT 9 -#define BTN_MORE 10 -#define BTN_LESS 11 - -namespace { - -// Helper class for the simple creation of files local/remote -class EasyFile -{ -private: - std::unique_ptr pOStm; - bool bOpen; - -public: - - EasyFile(); - ~EasyFile(); - - ErrCode createStream( const OUString& rUrl, SvStream*& rpStr ); - void createFileName( const OUString& rUrl, OUString& rFileName ); - void close(); -}; - -} - -// Helper class for the embedding of text attributes into the html output -class HtmlState -{ -private: - bool mbColor; - bool mbWeight; - bool mbItalic; - bool mbUnderline; - bool mbStrike; - bool mbLink; - Color maColor; - Color maDefColor; - OUString maLink; - OUString maTarget; - -public: - explicit HtmlState( Color aDefColor ); - - OUString SetWeight( bool bWeight ); - OUString SetItalic( bool bItalic ); - OUString SetUnderline( bool bUnderline ); - OUString SetColor( Color aColor ); - OUString SetStrikeout( bool bStrike ); - OUString SetLink( const OUString& aLink, const OUString& aTarget ); - OUString Flush(); -}; - -// close all still open tags -OUString HtmlState::Flush() -{ - OUString aStr = SetWeight(false) - + SetItalic(false) - + SetUnderline(false) - + SetStrikeout(false) - + SetColor(maDefColor) - + SetLink("",""); - - return aStr; -} - -// c'tor with default color for the page -HtmlState::HtmlState( Color aDefColor ) - : mbColor(false), - mbWeight(false), - mbItalic(false), - mbUnderline(false), - mbStrike(false), - mbLink(false), - maDefColor(aDefColor) -{ -} - -// enables/disables bold print -OUString HtmlState::SetWeight( bool bWeight ) -{ - OUString aStr; - - if(bWeight && !mbWeight) - aStr = ""; - else if(!bWeight && mbWeight) - aStr = ""; - - mbWeight = bWeight; - return aStr; -} - -// enables/disables italic - -OUString HtmlState::SetItalic( bool bItalic ) -{ - OUString aStr; - - if(bItalic && !mbItalic) - aStr = ""; - else if(!bItalic && mbItalic) - aStr = ""; - - mbItalic = bItalic; - return aStr; -} - -// enables/disables underlines - -OUString HtmlState::SetUnderline( bool bUnderline ) -{ - OUString aStr; - - if(bUnderline && !mbUnderline) - aStr = ""; - else if(!bUnderline && mbUnderline) - aStr = ""; - - mbUnderline = bUnderline; - return aStr; -} - -// enables/disables strike through -OUString HtmlState::SetStrikeout( bool bStrike ) -{ - OUString aStr; - - if(bStrike && !mbStrike) - aStr = ""; - else if(!bStrike && mbStrike) - aStr = ""; - - mbStrike = bStrike; - return aStr; -} - -// Sets the specified text color -OUString HtmlState::SetColor( Color aColor ) -{ - OUString aStr; - - if(mbColor && aColor == maColor) - return aStr; - - if(mbColor) - { - aStr = ""; - mbColor = false; - } - - if(aColor != maDefColor) - { - maColor = aColor; - aStr += ""; - mbColor = true; - } - - return aStr; -} - -// enables/disables a hyperlink -OUString HtmlState::SetLink( const OUString& aLink, const OUString& aTarget ) -{ - OUString aStr; - - if(mbLink&&maLink == aLink&&maTarget==aTarget) - return aStr; - - if(mbLink) - { - aStr = ""; - mbLink = false; - } - - if (!aLink.isEmpty()) - { - aStr += ""; - mbLink = true; - maLink = aLink; - maTarget = aTarget; - } - - return aStr; -} -namespace -{ - -OUString getParagraphStyle( const SdrOutliner* pOutliner, sal_Int32 nPara ) -{ - SfxItemSet aParaSet( pOutliner->GetParaAttribs( nPara ) ); - - OUString sStyle; - - if( aParaSet.GetItem( EE_PARA_WRITINGDIR )->GetValue() == SvxFrameDirection::Horizontal_RL_TB ) - { - - sStyle = "direction: rtl;"; - } - else - { - // This is the default so don't write it out - // sStyle += "direction: ltr;"; - } - return sStyle; -} - -void lclAppendStyle(OUStringBuffer& aBuffer, std::u16string_view aTag, std::u16string_view aStyle) -{ - if (aStyle.empty()) - aBuffer.append(OUString::Concat("<") + aTag + ">"); - else - aBuffer.append(OUString::Concat("<") + aTag + " style=\"" + aStyle + "\">"); -} - -} // anonymous namespace - -constexpr OUStringLiteral gaHTMLHeader( - u"\r\n" - "\r\n\r\n" ); - -constexpr OUStringLiteral gaHTMLExtension = u"" STR_HTMLEXP_DEFAULT_EXTENSION; - -// constructor for the html export helper classes -HtmlExport::HtmlExport( - OUString aPath, - const Sequence< PropertyValue >& rParams, - SdDrawDocument* pExpDoc, - sd::DrawDocShell* pDocShell ) - : maPath(std::move( aPath )), - mpDoc(pExpDoc), - mpDocSh( pDocShell ), - meMode( PUBLISH_SINGLE_DOCUMENT ), - mbContentsPage(false), - mnButtonThema(-1), - mnWidthPixel( PUB_MEDRES_WIDTH ), - meFormat( FORMAT_JPG ), - mbNotes(false), - mnCompression( -1 ), - mbDownload( false ), - mbSlideSound(true), - mbHiddenSlides(true), - mbUserAttr(false), - maTextColor(COL_BLACK), - maBackColor(COL_WHITE), - mbDocColors(false), - maIndexUrl("index"), - meScript( SCRIPT_ASP ), - mpButtonSet( new ButtonSet() ) -{ - bool bChange = mpDoc->IsChanged(); - - maIndexUrl += gaHTMLExtension; - - InitExportParameters( rParams ); - - switch( meMode ) - { - case PUBLISH_HTML: - case PUBLISH_FRAMES: - ExportHtml(); - break; - case PUBLISH_WEBCAST: - ExportWebCast(); - break; - case PUBLISH_KIOSK: - ExportKiosk(); - break; - case PUBLISH_SINGLE_DOCUMENT: - ExportSingleDocument(); - break; - } - - mpDoc->SetChanged(bChange); -} - -HtmlExport::~HtmlExport() -{ -} - -// get common export parameters from item set -void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams ) -{ - mbImpress = mpDoc->GetDocumentType() == DocumentType::Impress; - - OUString aStr; - for( const PropertyValue& rParam : rParams ) - { - if ( rParam.Name == "PublishMode" ) - { - sal_Int32 temp = 0; - rParam.Value >>= temp; - meMode = static_cast(temp); - } - else if ( rParam.Name == "IndexURL" ) - { - rParam.Value >>= aStr; - maIndexUrl = aStr; - } - else if ( rParam.Name == "Format" ) - { - sal_Int32 temp = 0; - rParam.Value >>= temp; - meFormat = static_cast(temp); - } - else if ( rParam.Name == "Compression" ) - { - rParam.Value >>= aStr; - OUString aTmp( aStr ); - if(!aTmp.isEmpty()) - { - aTmp = aTmp.replaceFirst("%", ""); - mnCompression = static_cast(aTmp.toInt32()); - } - } - else if ( rParam.Name == "Width" ) - { - sal_Int32 temp = 0; - rParam.Value >>= temp; - mnWidthPixel = static_cast(temp); - } - else if ( rParam.Name == "UseButtonSet" ) - { - sal_Int32 temp = 0; - rParam.Value >>= temp; - mnButtonThema = static_cast(temp); - } - else if ( rParam.Name == "IsExportNotes" ) - { - if( mbImpress ) - { - bool temp = false; - rParam.Value >>= temp; - mbNotes = temp; - } - } - else if ( rParam.Name == "IsExportContentsPage" ) - { - bool temp = false; - rParam.Value >>= temp; - mbContentsPage = temp; - } - else if ( rParam.Name == "Author" ) - { - rParam.Value >>= aStr; - maAuthor = aStr; - } - else if ( rParam.Name == "EMail" ) - { - rParam.Value >>= aStr; - maEMail = aStr; - } - else if ( rParam.Name == "HomepageURL" ) - { - rParam.Value >>= aStr; - maHomePage = aStr; - } - else if ( rParam.Name == "UserText" ) - { - rParam.Value >>= aStr; - maInfo = aStr; - } - else if ( rParam.Name == "EnableDownload" ) - { - bool temp = false; - rParam.Value >>= temp; - mbDownload = temp; - } - else if ( rParam.Name == "SlideSound" ) - { - bool temp = true; - rParam.Value >>= temp; - mbSlideSound = temp; - } - else if ( rParam.Name == "HiddenSlides" ) - { - bool temp = true; - rParam.Value >>= temp; - mbHiddenSlides = temp; - } - else if ( rParam.Name == "BackColor" ) - { - Color temp; - rParam.Value >>= temp; - maBackColor = temp; - mbUserAttr = true; - } - else if ( rParam.Name == "TextColor" ) - { - Color temp; - rParam.Value >>= temp; - maTextColor = temp; - mbUserAttr = true; - } - else if ( rParam.Name == "LinkColor" ) - { - Color temp ; - rParam.Value >>= temp; - maLinkColor = temp; - mbUserAttr = true; - } - else if ( rParam.Name == "VLinkColor" ) - { - Color temp; - rParam.Value >>= temp; - maVLinkColor = temp; - mbUserAttr = true; - } - else if ( rParam.Name == "ALinkColor" ) - { - Color temp; - rParam.Value >>= temp; - maALinkColor = temp; - mbUserAttr = true; - } - else if ( rParam.Name == "IsUseDocumentColors" ) - { - bool temp = false; - rParam.Value >>= temp; - mbDocColors = temp; - } - else if ( rParam.Name == "KioskSlideDuration" ) - { - double temp = 0.0; - rParam.Value >>= temp; - mfSlideDuration = temp; - mbAutoSlide = true; - } - else if ( rParam.Name == "KioskEndless" ) - { - bool temp = false; - rParam.Value >>= temp; - mbEndless = temp; - } - else if ( rParam.Name == "WebCastCGIURL" ) - { - rParam.Value >>= aStr; - maCGIPath = aStr; - } - else if ( rParam.Name == "WebCastTargetURL" ) - { - rParam.Value >>= aStr; - maURLPath = aStr; - } - else if ( rParam.Name == "WebCastScriptLanguage" ) - { - rParam.Value >>= aStr; - if ( aStr == "asp" ) - { - meScript = SCRIPT_ASP; - } - else - { - meScript = SCRIPT_PERL; - } - } - else - { - OSL_FAIL("Unknown property for html export detected!"); - } - } - - if( meMode == PUBLISH_KIOSK ) - { - mbContentsPage = false; - mbNotes = false; - - } - - // calculate image sizes - SdPage* pPage = mpDoc->GetSdPage(0, PageKind::Standard); - Size aTmpSize( pPage->GetSize() ); - double dRatio=static_cast(aTmpSize.Width())/aTmpSize.Height(); - - mnHeightPixel = static_cast(mnWidthPixel/dRatio); - - // we come up with a destination... - - INetURLObject aINetURLObj( maPath ); - DBG_ASSERT( aINetURLObj.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); - - maExportPath = aINetURLObj.GetPartBeforeLastName(); // with trailing '/' - maIndex = aINetURLObj.GetLastName(); - - mnSdPageCount = mpDoc->GetSdPageCount( PageKind::Standard ); - for( sal_uInt16 nPage = 0; nPage < mnSdPageCount; nPage++ ) - { - pPage = mpDoc->GetSdPage( nPage, PageKind::Standard ); - - if( mbHiddenSlides || !pPage->IsExcluded() ) - { - maPages.push_back( pPage ); - maNotesPages.push_back( mpDoc->GetSdPage( nPage, PageKind::Notes ) ); - } - } - mnSdPageCount = maPages.size(); - - mbFrames = meMode == PUBLISH_FRAMES; - - maDocFileName = maIndex; -} - -void HtmlExport::ExportSingleDocument() -{ - SdrOutliner* pOutliner = mpDoc->GetInternalOutliner(); - - maPageNames.resize(mnSdPageCount); - - mnPagesWritten = 0; - InitProgress(mnSdPageCount); - - OUStringBuffer aStr(gaHTMLHeader - + DocumentMetadata() - + "\r\n" - "\r\n" - + CreateBodyTag()); - - for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; ++nSdPage) - { - SdPage* pPage = maPages[nSdPage]; - maPageNames[nSdPage] = pPage->GetName(); - - if( mbDocColors ) - { - SetDocColors( pPage ); - } - - // page title - OUString sTitleText(CreateTextForTitle(pOutliner, pPage, pPage->GetPageBackgroundColor())); - OUString sStyle; - - if (nSdPage != 0) // First page - no need for a page break here - sStyle += "page-break-before:always; "; - sStyle += getParagraphStyle(pOutliner, 0); - - lclAppendStyle(aStr, u"h1", sStyle); - - aStr.append(sTitleText + "\r\n"); - - // write outline text - aStr.append(CreateTextForPage( pOutliner, pPage, true, pPage->GetPageBackgroundColor() )); - - // notes - if(mbNotes) - { - SdPage* pNotesPage = maNotesPages[ nSdPage ]; - OUString aNotesStr( CreateTextForNotesPage( pOutliner, pNotesPage, maBackColor) ); - - if (!aNotesStr.isEmpty()) - { - aStr.append("
\r\n

" - + RESTOHTML(STR_HTMLEXP_NOTES) - + ":

\r\n" - + aNotesStr); - } - } - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - } - - // close page - aStr.append("\r\n"); - - WriteHtml(maDocFileName, false, aStr); - - pOutliner->Clear(); - ResetProgress(); -} - -// exports the (in the c'tor specified impress document) to html -void HtmlExport::ExportHtml() -{ - if(mbUserAttr) - { - if( maTextColor == COL_AUTO ) - { - if( !maBackColor.IsDark() ) - maTextColor = COL_BLACK; - } - } - else if( mbDocColors ) - { - // default colors for the color schema 'From Document' - SetDocColors(); - maFirstPageColor = maBackColor; - } - - // get name for downloadable presentation if needed - if( mbDownload ) - { - // fade out separator search and extension - sal_Int32 nSepPos = maDocFileName.indexOf('.'); - if (nSepPos != -1) - maDocFileName = maDocFileName.copy(0, nSepPos); - - maDocFileName += ".odp"; - } - - sal_uInt16 nProgrCount = mnSdPageCount; - nProgrCount += mbImpress?mnSdPageCount:0; - nProgrCount += mbContentsPage?1:0; - nProgrCount += (mbFrames && mbNotes)?mnSdPageCount:0; - nProgrCount += mbFrames ? 8 : 0; - InitProgress( nProgrCount ); - - mpDocSh->SetWaitCursor( true ); - - // Exceptions are cool... - - CreateFileNames(); - - // this is not a true while - while( true ) - { - if( checkForExistingFiles() ) - break; - - if( !CreateImagesForPresPages() ) - break; - - if( mbContentsPage && - !CreateImagesForPresPages( true ) ) - break; - - if( !CreateHtmlForPresPages() ) - break; - - if( mbImpress ) - if( !CreateHtmlTextForPresPages() ) - break; - - if( mbFrames ) - { - if( !CreateFrames() ) - break; - - if( !CreateOutlinePages() ) - break; - - if( !CreateNavBarFrames() ) - break; - - if( mbNotes && mbImpress ) - if( !CreateNotesPages() ) - break; - - } - - if( mbContentsPage ) - if( !CreateContentPage() ) - break; - - CreateBitmaps(); - - mpDocSh->SetWaitCursor( false ); - ResetProgress(); - - if( mbDownload ) - SavePresentation(); - - return; - } - - // if we get to this point the export was - // canceled by the user after an error - mpDocSh->SetWaitCursor( false ); - ResetProgress(); -} - -void HtmlExport::SetDocColors( SdPage* pPage ) -{ - if( pPage == nullptr ) - pPage = mpDoc->GetSdPage(0, PageKind::Standard); - - svtools::ColorConfig aConfig; - maVLinkColor = aConfig.GetColorValue(svtools::LINKSVISITED).nColor; - maALinkColor = aConfig.GetColorValue(svtools::LINKS).nColor; - maLinkColor = aConfig.GetColorValue(svtools::LINKS).nColor; - maTextColor = COL_BLACK; - - SfxStyleSheet* pSheet = nullptr; - - if( mpDoc->GetDocumentType() == DocumentType::Impress ) - { - // default text color from the outline template of the first page - pSheet = pPage->GetStyleSheetForPresObj(PresObjKind::Outline); - if(pSheet == nullptr) - pSheet = pPage->GetStyleSheetForPresObj(PresObjKind::Text); - if(pSheet == nullptr) - pSheet = pPage->GetStyleSheetForPresObj(PresObjKind::Title); - } - - if(pSheet == nullptr) - pSheet = mpDoc->GetDefaultStyleSheet(); - - if(pSheet) - { - SfxItemSet& rSet = pSheet->GetItemSet(); - if(rSet.GetItemState(EE_CHAR_COLOR) == SfxItemState::SET) - maTextColor = rSet.GetItem(EE_CHAR_COLOR)->GetValue(); - } - - // default background from the background of the master page of the first page - maBackColor = pPage->GetPageBackgroundColor(); - - if( maTextColor == COL_AUTO ) - { - if( !maBackColor.IsDark() ) - maTextColor = COL_BLACK; - } -} - -void HtmlExport::InitProgress( sal_uInt16 nProgrCount ) -{ - mpProgress.reset(new SfxProgress( mpDocSh, SdResId(STR_CREATE_PAGES), nProgrCount )); -} - -void HtmlExport::ResetProgress() -{ - mpProgress.reset(); -} - -void HtmlExport::ExportKiosk() -{ - mnPagesWritten = 0; - InitProgress( 2*mnSdPageCount ); - - CreateFileNames(); - if( !checkForExistingFiles() ) - { - if( CreateImagesForPresPages() ) - CreateHtmlForPresPages(); - } - - ResetProgress(); -} - -// Export Document with WebCast (TM) Technology -void HtmlExport::ExportWebCast() -{ - mnPagesWritten = 0; - InitProgress( mnSdPageCount + 9 ); - - mpDocSh->SetWaitCursor( true ); - - CreateFileNames(); - - if (maCGIPath.isEmpty()) - maCGIPath = "."; - - if (!maCGIPath.endsWith("/")) - maCGIPath += "/"; - - if( meScript == SCRIPT_ASP ) - { - maURLPath = "./"; - } - else - { - if (maURLPath.isEmpty()) - maURLPath = "."; - - if (!maURLPath.endsWith("/")) - maURLPath += "/"; - } - - // this is not a true while - while(true) - { - if( checkForExistingFiles() ) - break; - - if(!CreateImagesForPresPages()) - break; - - if( meScript == SCRIPT_ASP ) - { - if(!CreateASPScripts()) - break; - } - else - { - if(!CreatePERLScripts()) - break; - } - - if(!CreateImageFileList()) - break; - - if(!CreateImageNumberFile()) - break; - - break; - } - - mpDocSh->SetWaitCursor( false ); - ResetProgress(); -} - -// Save the presentation as a downloadable file in the dest directory -bool HtmlExport::SavePresentation() -{ - meEC.SetContext( STR_HTMLEXP_ERROR_CREATE_FILE, maDocFileName ); - - OUString aURL(maExportPath + maDocFileName); - - mpDocSh->EnableSetModified(); - - try - { - uno::Reference< frame::XStorable > xStorable( mpDoc->getUnoModel(), uno::UNO_QUERY ); - if( xStorable.is() ) - { - uno::Sequence< beans::PropertyValue > aProperties{ - comphelper::makePropertyValue("Overwrite", true), - comphelper::makePropertyValue("FilterName", OUString("impress8")) - }; - xStorable->storeToURL( aURL, aProperties ); - - mpDocSh->EnableSetModified( false ); - - return true; - } - } - catch( Exception& ) - { - } - - mpDocSh->EnableSetModified( false ); - - return false; -} - -// create image files -bool HtmlExport::CreateImagesForPresPages( bool bThumbnail) -{ - try - { - Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - - Reference< drawing::XGraphicExportFilter > xGraphicExporter = drawing::GraphicExportFilter::create( xContext ); - - Sequence< PropertyValue > aFilterData(((meFormat==FORMAT_JPG)&&(mnCompression != -1))? 3 : 2); - auto pFilterData = aFilterData.getArray(); - pFilterData[0].Name = "PixelWidth"; - pFilterData[0].Value <<= static_cast(bThumbnail ? PUB_THUMBNAIL_WIDTH : mnWidthPixel ); - pFilterData[1].Name = "PixelHeight"; - pFilterData[1].Value <<= static_cast(bThumbnail ? PUB_THUMBNAIL_HEIGHT : mnHeightPixel); - if((meFormat==FORMAT_JPG)&&(mnCompression != -1)) - { - pFilterData[2].Name = "Quality"; - pFilterData[2].Value <<= static_cast(mnCompression); - } - - OUString sFormat; - if( meFormat == FORMAT_PNG ) - sFormat = "PNG"; - else if( meFormat == FORMAT_GIF ) - sFormat = "GIF"; - else - sFormat = "JPG"; - - Sequence< PropertyValue > aDescriptor{ - comphelper::makePropertyValue("URL", Any()), - comphelper::makePropertyValue("FilterName", sFormat), - comphelper::makePropertyValue("FilterData", aFilterData) - }; - auto pDescriptor = aDescriptor.getArray(); - - for (sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++) - { - SdPage* pPage = maPages[ nSdPage ]; - - OUString aFull(maExportPath); - if (bThumbnail) - aFull += maThumbnailFiles[nSdPage]; - else - aFull += maImageFiles[nSdPage]; - - pDescriptor[0].Value <<= aFull; - - Reference< XComponent > xPage( pPage->getUnoPage(), UNO_QUERY ); - xGraphicExporter->setSourceDocument( xPage ); - xGraphicExporter->filter( aDescriptor ); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - } - } - catch( Exception& ) - { - return false; - } - - return true; -} - -// get SdrTextObject with layout text of this page -SdrTextObj* HtmlExport::GetLayoutTextObject(SdrPage const * pPage) -{ - const size_t nObjectCount = pPage->GetObjCount(); - SdrTextObj* pResult = nullptr; - - for (size_t nObject = 0; nObject < nObjectCount; ++nObject) - { - SdrObject* pObject = pPage->GetObj(nObject); - if (pObject->GetObjInventor() == SdrInventor::Default && - pObject->GetObjIdentifier() == SdrObjKind::OutlineText) - { - pResult = static_cast(pObject); - break; - } - } - return pResult; -} - -// create HTML text version of impress pages -OUString HtmlExport::CreateMetaCharset() -{ - OUString aStr; - const char *pCharSet = rtl_getBestMimeCharsetFromTextEncoding( RTL_TEXTENCODING_UTF8 ); - if ( pCharSet ) - { - aStr = " \r\n"; - } - return aStr; -} - -OUString HtmlExport::DocumentMetadata() const -{ - SvMemoryStream aStream; - - uno::Reference xDocProps; - if (mpDocSh) - { - uno::Reference xDPS( - mpDocSh->GetModel(), uno::UNO_QUERY_THROW); - xDocProps.set(xDPS->getDocumentProperties()); - } - - SfxFrameHTMLWriter::Out_DocInfo(aStream, maDocFileName, xDocProps, - " "); - - const sal_uInt64 nLen = aStream.GetSize(); - OSL_ENSURE(nLen < o3tl::make_unsigned(SAL_MAX_INT32), "Stream can't fit in OString"); - std::string_view aData(static_cast(aStream.GetData()), static_cast(nLen)); - - return OStringToOUString(aData, RTL_TEXTENCODING_UTF8); -} - -bool HtmlExport::CreateHtmlTextForPresPages() -{ - bool bOk = true; - - SdrOutliner* pOutliner = mpDoc->GetInternalOutliner(); - - for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount && bOk; nSdPage++) - { - SdPage* pPage = maPages[ nSdPage ]; - - if( mbDocColors ) - { - SetDocColors( pPage ); - } - - // HTML head - OUStringBuffer aStr(gaHTMLHeader - + CreateMetaCharset() - + " " - + StringToHTMLString(maPageNames[nSdPage]) - + "\r\n" - "\r\n" - + CreateBodyTag()); - - // navigation bar - aStr.append(CreateNavBar(nSdPage, true)); - - // page title - OUString sTitleText( CreateTextForTitle(pOutliner,pPage, pPage->GetPageBackgroundColor()) ); - lclAppendStyle(aStr, u"h1", getParagraphStyle(pOutliner, 0)); - aStr.append(sTitleText + "\r\n"); - - // write outline text - aStr.append(CreateTextForPage( pOutliner, pPage, true, pPage->GetPageBackgroundColor() )); - - // notes - if(mbNotes) - { - SdPage* pNotesPage = maNotesPages[ nSdPage ]; - OUString aNotesStr( CreateTextForNotesPage( pOutliner, pNotesPage, maBackColor) ); - - if (!aNotesStr.isEmpty()) - { - aStr.append("
\r\n

" - + RESTOHTML(STR_HTMLEXP_NOTES) - + ":

\r\n" - + aNotesStr); - } - } - - // close page - aStr.append("\r\n"); - - bOk = WriteHtml(maTextFiles[nSdPage], false, aStr); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - } - - pOutliner->Clear(); - - return bOk; -} - -/** exports the given html data into a non unicode file in the current export path with - the given filename */ -bool HtmlExport::WriteHtml( const OUString& rFileName, bool bAddExtension, std::u16string_view rHtmlData ) -{ - ErrCode nErr = ERRCODE_NONE; - - OUString aFileName( rFileName ); - if( bAddExtension ) - aFileName += gaHTMLExtension; - - meEC.SetContext( STR_HTMLEXP_ERROR_CREATE_FILE, rFileName ); - EasyFile aFile; - SvStream* pStr; - OUString aFull(maExportPath + aFileName); - nErr = aFile.createStream(aFull , pStr); - if(nErr == ERRCODE_NONE) - { - OString aStr(OUStringToOString(rHtmlData, RTL_TEXTENCODING_UTF8)); - pStr->WriteOString( aStr ); - aFile.close(); - } - - if( nErr != ERRCODE_NONE ) - ErrorHandler::HandleError(nErr); - - return nErr == ERRCODE_NONE; -} - -/** creates an outliner text for the title objects of a page - */ -OUString HtmlExport::CreateTextForTitle( SdrOutliner* pOutliner, SdPage* pPage, const Color& rBackgroundColor ) -{ - SdrTextObj* pTO = static_cast(pPage->GetPresObj(PresObjKind::Title)); - if(!pTO) - pTO = GetLayoutTextObject(pPage); - - if (pTO && !pTO->IsEmptyPresObj()) - { - OutlinerParaObject* pOPO = pTO->GetOutlinerParaObject(); - if(pOPO && pOutliner->GetParagraphCount() != 0) - { - pOutliner->Clear(); - pOutliner->SetText(*pOPO); - return ParagraphToHTMLString(pOutliner,0, rBackgroundColor); - } - } - - return OUString(); -} - -// creates an outliner text for a page -OUString HtmlExport::CreateTextForPage(SdrOutliner* pOutliner, SdPage const * pPage, - bool bHeadLine, const Color& rBackgroundColor) -{ - OUStringBuffer aStr; - - for (size_t i = 0; i GetObjCount(); ++i ) - { - SdrObject* pObject = pPage->GetObj(i); - PresObjKind eKind = pPage->GetPresObjKind(pObject); - - switch (eKind) - { - case PresObjKind::NONE: - { - if (pObject->GetObjIdentifier() == SdrObjKind::Group) - { - SdrObjGroup* pObjectGroup = static_cast(pObject); - WriteObjectGroup(aStr, pObjectGroup, pOutliner, rBackgroundColor, false); - } - else if (pObject->GetObjIdentifier() == SdrObjKind::Table) - { - SdrTableObj* pTableObject = static_cast(pObject); - WriteTable(aStr, pTableObject, pOutliner, rBackgroundColor); - } - else - { - if (pObject->GetOutlinerParaObject()) - { - WriteOutlinerParagraph(aStr, pOutliner, pObject->GetOutlinerParaObject(), rBackgroundColor, false); - } - } - } - break; - - case PresObjKind::Table: - { - SdrTableObj* pTableObject = static_cast(pObject); - WriteTable(aStr, pTableObject, pOutliner, rBackgroundColor); - } - break; - - case PresObjKind::Text: - case PresObjKind::Outline: - { - SdrTextObj* pTextObject = static_cast(pObject); - if (pTextObject->IsEmptyPresObj()) - continue; - WriteOutlinerParagraph(aStr, pOutliner, pTextObject->GetOutlinerParaObject(), rBackgroundColor, bHeadLine); - } - break; - - default: - break; - } - } - return aStr.makeStringAndClear(); -} - -void HtmlExport::WriteTable(OUStringBuffer& aStr, SdrTableObj const * pTableObject, SdrOutliner* pOutliner, const Color& rBackgroundColor) -{ - CellPos aStart, aEnd; - - aStart = SdrTableObj::getFirstCell(); - aEnd = pTableObject->getLastCell(); - - sal_Int32 nColCount = pTableObject->getColumnCount(); - aStr.append("\r\n"); - for (sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++) - { - aStr.append(" \r\n"); - for (sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++) - { - aStr.append(" \r\n"); - } - aStr.append(" \r\n"); - } - aStr.append("
\r\n"); - sal_Int32 nCellIndex = nRow * nColCount + nCol; - SdrText* pText = pTableObject->getText(nCellIndex); - - if (pText == nullptr) - continue; - WriteOutlinerParagraph(aStr, pOutliner, pText->GetOutlinerParaObject(), rBackgroundColor, false); - aStr.append("
\r\n"); -} - -void HtmlExport::WriteObjectGroup(OUStringBuffer& aStr, SdrObjGroup const * pObjectGroup, SdrOutliner* pOutliner, - const Color& rBackgroundColor, bool bHeadLine) -{ - SdrObjListIter aGroupIterator(pObjectGroup->GetSubList(), SdrIterMode::DeepNoGroups); - while (aGroupIterator.IsMore()) - { - SdrObject* pCurrentObject = aGroupIterator.Next(); - if (pCurrentObject->GetObjIdentifier() == SdrObjKind::Group) - { - SdrObjGroup* pCurrentGroupObject = static_cast(pCurrentObject); - WriteObjectGroup(aStr, pCurrentGroupObject, pOutliner, rBackgroundColor, bHeadLine); - } - else - { - OutlinerParaObject* pOutlinerParagraphObject = pCurrentObject->GetOutlinerParaObject(); - if (pOutlinerParagraphObject != nullptr) - { - WriteOutlinerParagraph(aStr, pOutliner, pOutlinerParagraphObject, rBackgroundColor, bHeadLine); - } - } - } -} - -void HtmlExport::WriteOutlinerParagraph(OUStringBuffer& aStr, SdrOutliner* pOutliner, - OutlinerParaObject const * pOutlinerParagraphObject, - const Color& rBackgroundColor, bool bHeadLine) -{ - if (pOutlinerParagraphObject == nullptr) - return; - - pOutliner->SetText(*pOutlinerParagraphObject); - - sal_Int32 nCount = pOutliner->GetParagraphCount(); - - - sal_Int16 nCurrentDepth = -1; - - for (sal_Int32 nIndex = 0; nIndex < nCount; nIndex++) - { - Paragraph* pParagraph = pOutliner->GetParagraph(nIndex); - if(pParagraph == nullptr) - continue; - - const sal_Int16 nDepth = static_cast(pOutliner->GetDepth(nIndex)); - OUString aParaText = ParagraphToHTMLString(pOutliner, nIndex, rBackgroundColor); - - if (aParaText.isEmpty()) - continue; - - if (nDepth < 0) - { - OUString aTag = bHeadLine ? OUString("h2") : OUString("p"); - lclAppendStyle(aStr, aTag, getParagraphStyle(pOutliner, nIndex)); - - aStr.append(aParaText); - aStr.append("\r\n"); - } - else - { - while(nCurrentDepth < nDepth) - { - aStr.append("
    \r\n"); - nCurrentDepth++; - } - while(nCurrentDepth > nDepth) - { - aStr.append("
\r\n"); - nCurrentDepth--; - } - lclAppendStyle(aStr, u"li", getParagraphStyle(pOutliner, nIndex)); - aStr.append(aParaText); - aStr.append("\r\n"); - } - } - while(nCurrentDepth >= 0) - { - aStr.append("\r\n"); - nCurrentDepth--; - } - pOutliner->Clear(); -} - -// creates an outliner text for a note page -OUString HtmlExport::CreateTextForNotesPage( SdrOutliner* pOutliner, - SdPage* pPage, - const Color& rBackgroundColor ) -{ - OUStringBuffer aStr; - - SdrTextObj* pTO = static_cast(pPage->GetPresObj(PresObjKind::Notes)); - - if (pTO && !pTO->IsEmptyPresObj()) - { - OutlinerParaObject* pOPO = pTO->GetOutlinerParaObject(); - if (pOPO) - { - pOutliner->Clear(); - pOutliner->SetText( *pOPO ); - - sal_Int32 nCount = pOutliner->GetParagraphCount(); - for (sal_Int32 nPara = 0; nPara < nCount; nPara++) - { - lclAppendStyle(aStr, u"p", getParagraphStyle(pOutliner, nPara)); - aStr.append(ParagraphToHTMLString(pOutliner, nPara, rBackgroundColor) - + "

\r\n"); - } - } - } - - return aStr.makeStringAndClear(); -} - -// converts a paragraph of the outliner to html -OUString HtmlExport::ParagraphToHTMLString( SdrOutliner const * pOutliner, sal_Int32 nPara, const Color& rBackgroundColor ) -{ - OUStringBuffer aStr; - - if(nullptr == pOutliner) - return OUString(); - - // TODO: MALTE!!! - EditEngine& rEditEngine = *const_cast(&pOutliner->GetEditEngine()); - bool bOldUpdateMode = rEditEngine.SetUpdateLayout(true); - - Paragraph* pPara = pOutliner->GetParagraph(nPara); - if(nullptr == pPara) - return OUString(); - - HtmlState aState( (mbUserAttr || mbDocColors) ? maTextColor : COL_BLACK ); - std::vector aPortionList; - rEditEngine.GetPortions( nPara, aPortionList ); - - sal_Int32 nPos1 = 0; - for( sal_Int32 nPos2 : aPortionList ) - { - ESelection aSelection( nPara, nPos1, nPara, nPos2); - - SfxItemSet aSet( rEditEngine.GetAttribs( aSelection ) ); - - aStr.append(TextAttribToHTMLString( &aSet, &aState, rBackgroundColor ) + - StringToHTMLString(rEditEngine.GetText( aSelection ))); - - nPos1 = nPos2; - } - aStr.append(aState.Flush()); - rEditEngine.SetUpdateLayout(bOldUpdateMode); - - return aStr.makeStringAndClear(); -} - -// Depending on the attributes of the specified set and the specified -// HtmlState, it creates the needed html tags in order to get the -// attributes -OUString HtmlExport::TextAttribToHTMLString( SfxItemSet const * pSet, HtmlState* pState, const Color& rBackgroundColor ) -{ - OUStringBuffer aStr; - - if(nullptr == pSet) - return OUString(); - - OUString aLink, aTarget; - if ( pSet->GetItemState( EE_FEATURE_FIELD ) == SfxItemState::SET ) - { - const SvxFieldItem* pItem = pSet->GetItem( EE_FEATURE_FIELD ); - if(pItem) - { - const SvxURLField* pURL = dynamic_cast( pItem->GetField() ); - if(pURL) - { - aLink = pURL->GetURL(); - aTarget = pURL->GetTargetFrame(); - } - } - } - - bool bTemp; - OUString aTemp; - - if ( pSet->GetItemState( EE_CHAR_WEIGHT ) == SfxItemState::SET ) - { - bTemp = pSet->Get( EE_CHAR_WEIGHT ).GetWeight() == WEIGHT_BOLD; - aTemp = pState->SetWeight( bTemp ); - if( bTemp ) - aStr.insert(0, aTemp); - else - aStr.append(aTemp); - } - - if ( pSet->GetItemState( EE_CHAR_UNDERLINE ) == SfxItemState::SET ) - { - bTemp = pSet->Get( EE_CHAR_UNDERLINE ).GetLineStyle() != LINESTYLE_NONE; - aTemp = pState->SetUnderline( bTemp ); - if( bTemp ) - aStr.insert(0, aTemp); - else - aStr.append(aTemp); - } - - if ( pSet->GetItemState( EE_CHAR_STRIKEOUT ) == SfxItemState::SET ) - { - bTemp = pSet->Get( EE_CHAR_STRIKEOUT ).GetStrikeout() != STRIKEOUT_NONE; - aTemp = pState->SetStrikeout( bTemp ); - if( bTemp ) - aStr.insert(0, aTemp); - else - aStr.append(aTemp); - } - - if ( pSet->GetItemState( EE_CHAR_ITALIC ) == SfxItemState::SET ) - { - bTemp = pSet->Get( EE_CHAR_ITALIC ).GetPosture() != ITALIC_NONE; - aTemp = pState->SetItalic( bTemp ); - if( bTemp ) - aStr.insert(0, aTemp); - else - aStr.append(aTemp); - } - - if(mbDocColors) - { - if ( pSet->GetItemState( EE_CHAR_COLOR ) == SfxItemState::SET ) - { - Color aTextColor = pSet->Get( EE_CHAR_COLOR ).GetValue(); - if( aTextColor == COL_AUTO ) - { - if( !rBackgroundColor.IsDark() ) - aTextColor = COL_BLACK; - } - aStr.append(pState->SetColor( aTextColor )); - } - } - - if (!aLink.isEmpty()) - aStr.insert(0, pState->SetLink(aLink, aTarget)); - else - aStr.append(pState->SetLink(aLink, aTarget)); - - return aStr.makeStringAndClear(); -} - -// create HTML wrapper for picture files -bool HtmlExport::CreateHtmlForPresPages() -{ - bool bOk = true; - - std::vector aClickableObjects; - - for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount && bOk; nSdPage++) - { - // find clickable objects (also on the master page) and put it in the - // list. This in reverse order character order since in html the first - // area is taken in the case they overlap. - SdPage* pPage = maPages[ nSdPage ]; - - if( mbDocColors ) - { - SetDocColors( pPage ); - } - - bool bMasterDone = false; - - while (!bMasterDone) - { - // sal_True = backwards - SdrObjListIter aIter(pPage, SdrIterMode::DeepWithGroups, true); - - SdrObject* pObject = aIter.Next(); - while (pObject) - { - SdAnimationInfo* pInfo = SdDrawDocument::GetAnimationInfo(pObject); - SvxIMapInfo* pIMapInfo = SvxIMapInfo::GetIMapInfo(pObject); - - if ((pInfo && - (pInfo->meClickAction == presentation::ClickAction_BOOKMARK || - pInfo->meClickAction == presentation::ClickAction_DOCUMENT || - pInfo->meClickAction == presentation::ClickAction_PREVPAGE || - pInfo->meClickAction == presentation::ClickAction_NEXTPAGE || - pInfo->meClickAction == presentation::ClickAction_FIRSTPAGE || - pInfo->meClickAction == presentation::ClickAction_LASTPAGE)) || - pIMapInfo) - { - aClickableObjects.push_back(pObject); - } - - pObject = aIter.Next(); - } - // now to the master page or finishing - if (!pPage->IsMasterPage()) - pPage = static_cast(&(pPage->TRG_GetMasterPage())); - else - bMasterDone = true; - } - - // HTML Head - OUStringBuffer aStr(gaHTMLHeader + - CreateMetaCharset() + - " " + StringToHTMLString(maPageNames[nSdPage]) + "\r\n"); - - // insert timing information - pPage = maPages[ nSdPage ]; - if( meMode == PUBLISH_KIOSK ) - { - double fSecs = 0; - bool bEndless = false; - if( !mbAutoSlide ) - { - if( pPage->GetPresChange() != PresChange::Manual ) - { - fSecs = pPage->GetTime(); - bEndless = mpDoc->getPresentationSettings().mbEndless; - } - } - else - { - fSecs = mfSlideDuration; - bEndless = mbEndless; - } - - if( fSecs != 0 ) - { - if( nSdPage < (mnSdPageCount-1) || bEndless ) - { - aStr.append("\r\n"); - } - } - } - - aStr.append("\r\n"); - - // HTML Body - aStr.append(CreateBodyTag()); - - if( mbSlideSound && pPage->IsSoundOn() ) - aStr.append(InsertSound(pPage->GetSoundFile())); - - // navigation bar - if(!mbFrames ) - aStr.append(CreateNavBar(nSdPage, false)); - // Image - aStr.append("
" - "\"\"");
\r\n"); - - // notes - if(mbNotes && !mbFrames) - { - SdrOutliner* pOutliner = mpDoc->GetInternalOutliner(); - SdPage* pNotesPage = maNotesPages[ nSdPage ]; - OUString aNotesStr( CreateTextForNotesPage( pOutliner, pNotesPage, maBackColor) ); - pOutliner->Clear(); - - if (!aNotesStr.isEmpty()) - { - aStr.append("

" - + RESTOHTML(STR_HTMLEXP_NOTES) - + ":


\r\n\r\n

" - + aNotesStr - + "\r\n

\r\n"); - } - } - - // create Imagemap if necessary - if (!aClickableObjects.empty()) - { - aStr.append("\r\n"); - - for (SdrObject* pObject : aClickableObjects) - { - SdAnimationInfo* pInfo = SdDrawDocument::GetAnimationInfo(pObject); - SvxIMapInfo* pIMapInfo = SvxIMapInfo::GetIMapInfo(pObject); - - ::tools::Rectangle aRect(pObject->GetCurrentBoundRect()); - Point aLogPos(aRect.TopLeft()); - bool bIsSquare = aRect.GetWidth() == aRect.GetHeight(); - - sal_uLong nPageWidth = pPage->GetSize().Width() - pPage->GetLeftBorder() - - pPage->GetRightBorder(); - - // BoundRect is relative to the physical page origin, not the - // origin of ordinates - aRect.Move(-pPage->GetLeftBorder(), -pPage->GetUpperBorder()); - - double fLogicToPixel = static_cast(mnWidthPixel) / nPageWidth; - aRect.SetLeft( static_cast(aRect.Left() * fLogicToPixel) ); - aRect.SetTop( static_cast(aRect.Top() * fLogicToPixel) ); - aRect.SetRight( static_cast(aRect.Right() * fLogicToPixel) ); - aRect.SetBottom( static_cast(aRect.Bottom() * fLogicToPixel) ); - tools::Long nRadius = aRect.GetWidth() / 2; - - /** - insert areas into Imagemap of the object, if the object has - such an Imagemap - */ - if (pIMapInfo) - { - const ImageMap& rIMap = pIMapInfo->GetImageMap(); - sal_uInt16 nAreaCount = rIMap.GetIMapObjectCount(); - for (sal_uInt16 nArea = 0; nArea < nAreaCount; nArea++) - { - IMapObject* pArea = rIMap.GetIMapObject(nArea); - IMapObjectType nType = pArea->GetType(); - OUString aURL( pArea->GetURL() ); - - // if necessary, convert page and object names into the - // corresponding names of the html file - bool bIsMasterPage; - sal_uInt16 nPgNum = mpDoc->GetPageByName( aURL, bIsMasterPage ); - - if (nPgNum == SDRPAGE_NOTFOUND) - { - // is the bookmark an object? - SdrObject* pObj = mpDoc->GetObj( aURL ); - if (pObj) - nPgNum = pObj->getSdrPageFromSdrObject()->GetPageNum(); - } - if (nPgNum != SDRPAGE_NOTFOUND) - { - nPgNum = (nPgNum - 1) / 2; // SdrPageNum --> SdPageNum - aURL = CreatePageURL(nPgNum); - } - - switch(nType) - { - case IMapObjectType::Rectangle: - { - ::tools::Rectangle aArea(static_cast(pArea)-> - GetRectangle(false)); - - // conversion into pixel coordinates - aArea.Move(aLogPos.X() - pPage->GetLeftBorder(), - aLogPos.Y() - pPage->GetUpperBorder()); - aArea.SetLeft( static_cast(aArea.Left() * fLogicToPixel) ); - aArea.SetTop( static_cast(aArea.Top() * fLogicToPixel) ); - aArea.SetRight( static_cast(aArea.Right() * fLogicToPixel) ); - aArea.SetBottom( static_cast(aArea.Bottom() * fLogicToPixel) ); - - aStr.append(CreateHTMLRectArea(aArea, aURL)); - } - break; - - case IMapObjectType::Circle: - { - Point aCenter(static_cast(pArea)-> - GetCenter(false)); - aCenter += Point(aLogPos.X() - pPage->GetLeftBorder(), - aLogPos.Y() - pPage->GetUpperBorder()); - aCenter.setX( static_cast(aCenter.X() * fLogicToPixel) ); - aCenter.setY( static_cast(aCenter.Y() * fLogicToPixel) ); - - sal_uLong nCircleRadius = static_cast(pArea)-> - GetRadius(false); - nCircleRadius = static_cast(nCircleRadius * fLogicToPixel); - aStr.append(CreateHTMLCircleArea(nCircleRadius, - aCenter.X(), aCenter.Y(), - aURL)); - } - break; - - case IMapObjectType::Polygon: - { - tools::Polygon aArea(static_cast(pArea)->GetPolygon(false)); - aStr.append(CreateHTMLPolygonArea(::basegfx::B2DPolyPolygon(aArea.getB2DPolygon()), - Size(aLogPos.X() - pPage->GetLeftBorder(), - aLogPos.Y() - pPage->GetUpperBorder()), - fLogicToPixel, aURL)); - } - break; - - default: - { - SAL_INFO("sd", "unknown IMapObjectType"); - } - break; - } - } - } - - /** - if there is a presentation::ClickAction, determine bookmark - and create area for the whole object - */ - if( pInfo ) - { - OUString aHRef; - presentation::ClickAction eClickAction = pInfo->meClickAction; - - switch( eClickAction ) - { - case presentation::ClickAction_BOOKMARK: - { - bool bIsMasterPage; - sal_uInt16 nPgNum = mpDoc->GetPageByName( pInfo->GetBookmark(), bIsMasterPage ); - - if( nPgNum == SDRPAGE_NOTFOUND ) - { - // is the bookmark an object? - SdrObject* pObj = mpDoc->GetObj(pInfo->GetBookmark()); - if (pObj) - nPgNum = pObj->getSdrPageFromSdrObject()->GetPageNum(); - } - - if( SDRPAGE_NOTFOUND != nPgNum ) - aHRef = CreatePageURL(( nPgNum - 1 ) / 2 ); - } - break; - - case presentation::ClickAction_DOCUMENT: - aHRef = pInfo->GetBookmark(); - break; - - case presentation::ClickAction_PREVPAGE: - { - sal_uLong nPage; - - if (nSdPage == 0) - nPage = 0; - else - nPage = nSdPage - 1; - - aHRef = CreatePageURL( static_cast(nPage)); - } - break; - - case presentation::ClickAction_NEXTPAGE: - { - sal_uLong nPage; - if (nSdPage == mnSdPageCount - 1) - nPage = mnSdPageCount - 1; - else - nPage = nSdPage + 1; - - aHRef = CreatePageURL( static_cast(nPage)); - } - break; - - case presentation::ClickAction_FIRSTPAGE: - aHRef = CreatePageURL(0); - break; - - case presentation::ClickAction_LASTPAGE: - aHRef = CreatePageURL(mnSdPageCount - 1); - break; - - default: - break; - } - - // and now the areas - if (!aHRef.isEmpty()) - { - // a circle? - if (pObject->GetObjInventor() == SdrInventor::Default && - pObject->GetObjIdentifier() == SdrObjKind::CircleOrEllipse && - bIsSquare ) - { - aStr.append(CreateHTMLCircleArea(aRect.GetWidth() / 2, - aRect.Left() + nRadius, - aRect.Top() + nRadius, - aHRef)); - } - // a polygon? - else if (pObject->GetObjInventor() == SdrInventor::Default && - (pObject->GetObjIdentifier() == SdrObjKind::PathLine || - pObject->GetObjIdentifier() == SdrObjKind::PolyLine || - pObject->GetObjIdentifier() == SdrObjKind::Polygon)) - { - aStr.append(CreateHTMLPolygonArea(static_cast(pObject)->GetPathPoly(), Size(-pPage->GetLeftBorder(), -pPage->GetUpperBorder()), fLogicToPixel, aHRef)); - } - // something completely different: use the BoundRect - else - { - aStr.append(CreateHTMLRectArea(aRect, aHRef)); - } - - } - } - } - - aStr.append("\r\n"); - } - aClickableObjects.clear(); - - aStr.append("\r\n"); - - bOk = WriteHtml(maHTMLFiles[nSdPage], false, aStr); - aStr.setLength(0); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - } - - return bOk; -} - -// create overview pages -bool HtmlExport::CreateContentPage() -{ - if( mbDocColors ) - SetDocColors(); - - // html head - OUStringBuffer aStr( - gaHTMLHeader - + CreateMetaCharset() - + " " - + StringToHTMLString(maPageNames[0]) - + "\r\n\r\n" - + CreateBodyTag()); - - // page head - aStr.append("
\r\n"); - - if(mbHeader) - { - aStr.append("

" + getDocumentTitle() + "


\r\n"); - } - - aStr.append("

"); - - // Solaris compiler bug workaround - if( mbFrames ) - aStr.append(CreateLink(maFramePage, - RESTOHTML(STR_HTMLEXP_CLICKSTART))); - else - aStr.append(CreateLink(StringToHTMLString(maHTMLFiles[0]), - RESTOHTML(STR_HTMLEXP_CLICKSTART))); - - aStr.append("

\r\n
\r\n" - "
\r\n"); - - // table of content - aStr.append("\r\n"); - - // document information - aStr.append("
\r\n" - "

" - + RESTOHTML(STR_HTMLEXP_CONTENTS) - + "

"); - - for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++) - { - OUString aPageName = maPageNames[nSdPage]; - aStr.append("
"); - if(mbFrames) - aStr.append(StringToHTMLString(aPageName)); - else - aStr.append(CreateLink(maHTMLFiles[nSdPage], aPageName)); - aStr.append("
\r\n"); - } - aStr.append("
\r\n"); - - if (!maAuthor.isEmpty()) - { - aStr.append("

" - + RESTOHTML(STR_HTMLEXP_AUTHOR) - + ": " - + StringToHTMLString(maAuthor) - + "

\r\n"); - } - - if (!maEMail.isEmpty()) - { - aStr.append("

" - + RESTOHTML(STR_HTMLEXP_EMAIL) - + ": " - + StringToHTMLString(maEMail) - + "

\r\n"); - } - - if (!maHomePage.isEmpty()) - { - aStr.append("

" - + RESTOHTML(STR_HTMLEXP_HOMEPAGE) - + ": " - + StringToHTMLString(maHomePage) - + "

\r\n"); - } - - if (!maInfo.isEmpty()) - { - aStr.append("

" - + RESTOHTML(STR_HTMLEXP_INFO) - + ":
\r\n" - + StringToHTMLString(maInfo) - + "

\r\n"); - } - - if(mbDownload) - { - aStr.append("

" - + RESTOHTML(STR_HTMLEXP_DOWNLOAD) - + "

\r\n"); - } - - for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++) - { - OUString aText( - "\"""); - - aStr.append(CreateLink(maHTMLFiles[nSdPage], aText) - + "\r\n"); - } - - aStr.append("
\r\n" - "\r\n"); - - bool bOk = WriteHtml(maIndex, false, aStr); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - return bOk; -} - -// create note pages (for frames) - -bool HtmlExport::CreateNotesPages() -{ - bool bOk = true; - - SdrOutliner* pOutliner = mpDoc->GetInternalOutliner(); - for( sal_uInt16 nSdPage = 0; bOk && nSdPage < mnSdPageCount; nSdPage++ ) - { - SdPage* pPage = maNotesPages[nSdPage]; - if( mbDocColors ) - SetDocColors( pPage ); - - // Html head - OUStringBuffer aStr(gaHTMLHeader - + CreateMetaCharset() - + " " - + StringToHTMLString(maPageNames[0]) - + "\r\n\r\n" - + CreateBodyTag()); - - if(pPage) - aStr.append(CreateTextForNotesPage( pOutliner, pPage, maBackColor )); - - aStr.append("\r\n"); - - OUString aFileName("note" + OUString::number(nSdPage)); - bOk = WriteHtml(aFileName, true, aStr); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - } - - pOutliner->Clear(); - - return bOk; -} - -// create outline pages (for frames) - -bool HtmlExport::CreateOutlinePages() -{ - bool bOk = true; - - if( mbDocColors ) - { - SetDocColors(); - } - - // page 0 will be the closed outline, page 1 the opened - for (sal_Int32 nPage = 0; nPage < (mbImpress?2:1) && bOk; ++nPage) - { - // Html head - OUStringBuffer aStr(gaHTMLHeader - + CreateMetaCharset() - + " " - + StringToHTMLString(maPageNames[0]) - + "\r\n\r\n" - + CreateBodyTag()); - - SdrOutliner* pOutliner = mpDoc->GetInternalOutliner(); - for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++) - { - SdPage* pPage = maPages[ nSdPage ]; - - aStr.append("
"); - OUString aLink("JavaScript:parent.NavigateAbs(" + - OUString::number(nSdPage) + ")"); - - OUString aTitle = CreateTextForTitle(pOutliner, pPage, maBackColor); - if (aTitle.isEmpty()) - aTitle = maPageNames[nSdPage]; - - lclAppendStyle(aStr, u"p", getParagraphStyle(pOutliner, 0)); - aStr.append(CreateLink(aLink, aTitle) - + "

"); - - if(nPage==1) - { - aStr.append(CreateTextForPage( pOutliner, pPage, false, maBackColor )); - } - aStr.append("
\r\n"); - } - pOutliner->Clear(); - - aStr.append("\r\n"); - - OUString aFileName("outline" + OUString::number(nPage)); - bOk = WriteHtml(aFileName, true, aStr); - aStr.setLength(0); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - } - - return bOk; -} - -// set file name -void HtmlExport::CreateFileNames() -{ - // create lists with new file names - maHTMLFiles.resize(mnSdPageCount); - maImageFiles.resize(mnSdPageCount); - maThumbnailFiles.resize(mnSdPageCount); - maPageNames.resize(mnSdPageCount); - maTextFiles.resize(mnSdPageCount); - - mbHeader = false; // headline on overview page? - - for (sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++) - { - OUString aHTMLFileName; - if(nSdPage == 0 && !mbContentsPage && !mbFrames ) - aHTMLFileName = maIndex; - else - { - aHTMLFileName = "img" + OUString::number(nSdPage) + gaHTMLExtension; - } - - maHTMLFiles[nSdPage] = aHTMLFileName; - - OUString aImageFileName = "img" + OUString::number(nSdPage); - if( meFormat==FORMAT_GIF ) - aImageFileName += ".gif"; - else if( meFormat==FORMAT_JPG ) - aImageFileName += ".jpg"; - else - aImageFileName += ".png"; - - maImageFiles[nSdPage] = aImageFileName; - - OUString aThumbnailFileName = "thumb" + OUString::number(nSdPage); - if( meFormat!=FORMAT_JPG ) - aThumbnailFileName += ".png"; - else - aThumbnailFileName += ".jpg"; - - maThumbnailFiles[nSdPage] = aThumbnailFileName; - - maTextFiles[nSdPage] = "text" + OUString::number(nSdPage) + gaHTMLExtension; - - SdPage* pSdPage = maPages[ nSdPage ]; - - // get slide title from page name - maPageNames[nSdPage] = pSdPage->GetName(); - } - - if(!mbContentsPage && mbFrames) - maFramePage = maIndex; - else - { - maFramePage = "siframes" + gaHTMLExtension; - } -} - -OUString const & HtmlExport::getDocumentTitle() -{ - // check for a title object in this page, if it's the first - // title it becomes this documents title for the content - // page - if( !mbHeader ) - { - if(mbImpress) - { - // if there is a non-empty title object, use their first passage - // as page title - SdPage* pSdPage = mpDoc->GetSdPage(0, PageKind::Standard); - SdrObject* pTitleObj = pSdPage->GetPresObj(PresObjKind::Title); - if (pTitleObj && !pTitleObj->IsEmptyPresObj()) - { - OutlinerParaObject* pParaObject = pTitleObj->GetOutlinerParaObject(); - if (pParaObject) - { - const EditTextObject& rEditTextObject = - pParaObject->GetTextObject(); - OUString aTest(rEditTextObject.GetText(0)); - if (!aTest.isEmpty()) - mDocTitle = aTest; - } - } - - mDocTitle = mDocTitle.replace(0xff, ' '); - } - - if (mDocTitle.isEmpty()) - { - mDocTitle = maDocFileName; - sal_Int32 nDot = mDocTitle.indexOf('.'); - if (nDot > 0) - mDocTitle = mDocTitle.copy(0, nDot); - } - mbHeader = true; - } - - return mDocTitle; -} - -constexpr OUStringLiteral JS_NavigateAbs = - u"function NavigateAbs( nPage )\r\n" - "{\r\n" - " frames[\"show\"].location.href = \"img\" + nPage + \".$EXT\";\r\n" - " //frames[\"notes\"].location.href = \"note\" + nPage + \".$EXT\";\r\n" - " nCurrentPage = nPage;\r\n" - " if(nCurrentPage==0)\r\n" - " {\r\n" - " frames[\"navbar1\"].location.href = \"navbar0.$EXT\";\r\n" - " }\r\n" - " else if(nCurrentPage==nPageCount-1)\r\n" - " {\r\n" - " frames[\"navbar1\"].location.href = \"navbar2.$EXT\";\r\n" - " }\r\n" - " else\r\n" - " {\r\n" - " frames[\"navbar1\"].location.href = \"navbar1.$EXT\";\r\n" - " }\r\n" - "}\r\n\r\n"; - -constexpr OUStringLiteral JS_NavigateRel = - u"function NavigateRel( nDelta )\r\n" - "{\r\n" - " var nPage = parseInt(nCurrentPage) + parseInt(nDelta);\r\n" - " if( (nPage >= 0) && (nPage < nPageCount) )\r\n" - " {\r\n" - " NavigateAbs( nPage );\r\n" - " }\r\n" - "}\r\n\r\n"; - -constexpr OUStringLiteral JS_ExpandOutline = - u"function ExpandOutline()\r\n" - "{\r\n" - " frames[\"navbar2\"].location.href = \"navbar4.$EXT\";\r\n" - " frames[\"outline\"].location.href = \"outline1.$EXT\";\r\n" - "}\r\n\r\n"; - -constexpr OUStringLiteral JS_CollapseOutline = - u"function CollapseOutline()\r\n" - "{\r\n" - " frames[\"navbar2\"].location.href = \"navbar3.$EXT\";\r\n" - " frames[\"outline\"].location.href = \"outline0.$EXT\";\r\n" - "}\r\n\r\n"; - -// create page with the frames - -bool HtmlExport::CreateFrames() -{ - OUString aTmp; - OUStringBuffer aStr( - "\r\n" - "\r\n\r\n" - - + CreateMetaCharset() - + " " - + StringToHTMLString(maPageNames[0]) - + "\r\n" - - "\r\n" - - "\r\n" - - "(mnWidthPixel + 16)) - + "\">\r\n"); - if(mbImpress) - { - aStr.append( - " \r\n" - " \r\n"); - } - aStr.append(" \r\n"); - if(mbImpress) - aStr.append(" \r\n"); - - if(mbNotes) - { - aStr.append(" (static_cast(mnWidthPixel) * 0.75) + 16) - + ",*\">\r\n"); - } - else - aStr.append(" \r\n"); - - aStr.append( - " \r\n" - - " \r\n"); - - if(mbNotes) - { - aStr.append(" \r\n"); - } - aStr.append(" \r\n" - - "\r\n" - + CreateBodyTag() - + RESTOHTML(STR_HTMLEXP_NOFRAMES) - + "\r\n\r\n\r\n"); - - bool bOk = WriteHtml(maFramePage, false, aStr); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - return bOk; -} - -// create button bar for standard -// we create the following html files -// navbar0.htm navigation bar graphic for the first page -// navbar1.htm navigation bar graphic for the second until second last page -// navbar2.htm navigation bar graphic for the last page -// navbar3.htm navigation outline closed -// navbar4.htm navigation outline open -bool HtmlExport::CreateNavBarFrames() -{ - bool bOk = true; - OUString aButton; - - if( mbDocColors ) - { - SetDocColors(); - maBackColor = maFirstPageColor; - } - - for( int nFile = 0; nFile < 3 && bOk; nFile++ ) - { - OUStringBuffer aStr( - gaHTMLHeader - + CreateMetaCharset() - + " " - + StringToHTMLString(maPageNames[0]) - + "\r\n\r\n" - + CreateBodyTag() - + "
\r\n"); - - // first page - aButton = SdResId(STR_HTMLEXP_FIRSTPAGE); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(nFile == 0 || mnSdPageCount == 1 ? BTN_FIRST_0 : BTN_FIRST_1), - aButton); - - if(nFile != 0 && mnSdPageCount > 1) - aButton = CreateLink(u"JavaScript:parent.NavigateAbs(0)", aButton); - - aStr.append(aButton - + "\r\n"); - - // to the previous page - aButton = SdResId(STR_PUBLISH_BACK); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(nFile == 0 || mnSdPageCount == 1? - BTN_PREV_0:BTN_PREV_1), - aButton); - - if(nFile != 0 && mnSdPageCount > 1) - aButton = CreateLink(u"JavaScript:parent.NavigateRel(-1)", aButton); - - aStr.append(aButton - + "\r\n"); - - // to the next page - aButton = SdResId(STR_PUBLISH_NEXT); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(nFile ==2 || mnSdPageCount == 1? - BTN_NEXT_0:BTN_NEXT_1), - aButton); - - if(nFile != 2 && mnSdPageCount > 1) - aButton = CreateLink(u"JavaScript:parent.NavigateRel(1)", aButton); - - aStr.append(aButton - + "\r\n"); - - // to the last page - aButton = SdResId(STR_HTMLEXP_LASTPAGE); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(nFile ==2 || mnSdPageCount == 1? - BTN_LAST_0:BTN_LAST_1), - aButton); - - if(nFile != 2 && mnSdPageCount > 1) - { - OUString aLink("JavaScript:parent.NavigateAbs(" + - OUString::number(mnSdPageCount-1) + ")"); - - aButton = CreateLink(aLink, aButton); - } - - aStr.append(aButton - + "\r\n"); - - // content - if (mbContentsPage) - { - aButton = SdResId(STR_PUBLISH_OUTLINE); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(BTN_INDEX), aButton); - - // to the overview - aStr.append(CreateLink(maIndex, aButton, u"_top") - + "\r\n"); - } - - // text mode - if(mbImpress) - { - aButton = SdResId(STR_HTMLEXP_SETTEXT); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(BTN_TEXT), aButton); - - OUString aText0("text0" + gaHTMLExtension); - aStr.append(CreateLink(aText0, aButton, u"_top") - + "\r\n"); - } - - // and finished... - aStr.append( - "
\r\n" - "\r\n"); - - OUString aFileName("navbar" + OUString::number(nFile)); - - bOk = WriteHtml(aFileName, true, aStr); - aStr.setLength(0); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - } - - // the navigation bar outliner closed... - if(bOk) - { - aButton = SdResId(STR_HTMLEXP_OUTLINE); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(BTN_MORE), aButton); - - bOk = WriteHtml( - "navbar3", true, - Concat2View( - gaHTMLHeader + CreateMetaCharset() + " " - + StringToHTMLString(maPageNames[0]) + "\r\n\r\n" + CreateBodyTag() - + CreateLink(u"JavaScript:parent.ExpandOutline()", aButton) - + "\r\n")); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - } - - // ... and the outliner open - if( bOk ) - { - aButton = SdResId(STR_HTMLEXP_NOOUTLINE); - if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName(BTN_LESS), aButton); - - bOk = WriteHtml( - "navbar4", true, - Concat2View( - gaHTMLHeader + CreateMetaCharset() + " " - + StringToHTMLString(maPageNames[0]) + "\r\n\r\n" + CreateBodyTag() - + CreateLink(u"JavaScript:parent.CollapseOutline()", aButton) - + "\r\n")); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - } - - return bOk; -} - -// create button bar for standard -OUString HtmlExport::CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const -{ - // prepare button bar - OUString aStrNavFirst(SdResId(STR_HTMLEXP_FIRSTPAGE)); - OUString aStrNavPrev(SdResId(STR_PUBLISH_BACK)); - OUString aStrNavNext(SdResId(STR_PUBLISH_NEXT)); - OUString aStrNavLast(SdResId(STR_HTMLEXP_LASTPAGE)); - OUString aStrNavContent(SdResId(STR_PUBLISH_OUTLINE)); - OUString aStrNavText; - if( bIsText ) - { - aStrNavText = SdResId(STR_HTMLEXP_SETGRAPHIC); - } - else - { - aStrNavText = SdResId(STR_HTMLEXP_SETTEXT); - } - - if(!bIsText && mnButtonThema != -1) - { - if(nSdPage<1 || mnSdPageCount == 1) - { - aStrNavFirst = CreateImage(GetButtonName(BTN_FIRST_0), aStrNavFirst); - aStrNavPrev = CreateImage(GetButtonName(BTN_PREV_0), aStrNavPrev); - } - else - { - aStrNavFirst = CreateImage(GetButtonName(BTN_FIRST_1), aStrNavFirst); - aStrNavPrev = CreateImage(GetButtonName(BTN_PREV_1), aStrNavPrev); - } - - if(nSdPage == mnSdPageCount-1 || mnSdPageCount == 1) - { - aStrNavNext = CreateImage(GetButtonName(BTN_NEXT_0), aStrNavNext); - aStrNavLast = CreateImage(GetButtonName(BTN_LAST_0), aStrNavLast); - } - else - { - aStrNavNext = CreateImage(GetButtonName(BTN_NEXT_1), aStrNavNext); - aStrNavLast = CreateImage(GetButtonName(BTN_LAST_1), aStrNavLast); - } - - aStrNavContent = CreateImage(GetButtonName(BTN_INDEX), aStrNavContent); - aStrNavText = CreateImage(GetButtonName(BTN_TEXT), aStrNavText); - } - - OUStringBuffer aStr("
\r\n"); //\r\n"); - - // first page - if(nSdPage > 0) - aStr.append(CreateLink( bIsText ? maTextFiles[0] : maHTMLFiles[0],aStrNavFirst)); - else - aStr.append(aStrNavFirst); - aStr.append(' '); - - // to Previous page - if(nSdPage > 0) - aStr.append(CreateLink( bIsText ? maTextFiles[nSdPage-1] - : maHTMLFiles[nSdPage-1], aStrNavPrev)); - else - aStr.append(aStrNavPrev); - aStr.append(' '); - - // to Next page - if(nSdPage < mnSdPageCount-1) - aStr.append(CreateLink( bIsText ? maTextFiles[nSdPage+1] - : maHTMLFiles[nSdPage+1], aStrNavNext)); - else - aStr.append(aStrNavNext); - aStr.append(' '); - - // to Last page - if(nSdPage < mnSdPageCount-1) - aStr.append(CreateLink( bIsText ? maTextFiles[mnSdPageCount-1] - : maHTMLFiles[mnSdPageCount-1], - aStrNavLast)); - else - aStr.append(aStrNavLast); - aStr.append(' '); - - // to Index page - if (mbContentsPage) - { - aStr.append(CreateLink(maIndex, aStrNavContent) + " "); - } - - // Text/Graphics - if(mbImpress) - { - aStr.append(CreateLink( bIsText ? (mbFrames ? maFramePage : maHTMLFiles[nSdPage]) - : maTextFiles[nSdPage], aStrNavText)); - - } - - aStr.append("
\r\n"); - - return aStr.makeStringAndClear(); -} - -// export navigation graphics from button set -void HtmlExport::CreateBitmaps() -{ - if(mnButtonThema == -1 || !mpButtonSet) - return; - - for( int nButton = 0; nButton != SAL_N_ELEMENTS(pButtonNames); nButton++ ) - { - if(!mbFrames && (nButton == BTN_MORE || nButton == BTN_LESS)) - continue; - - if(!mbImpress && (nButton == BTN_TEXT || nButton == BTN_MORE || nButton == BTN_LESS )) - continue; - - OUString aFull = maExportPath + GetButtonName(nButton); - mpButtonSet->exportButton( mnButtonThema, aFull, GetButtonName(nButton) ); - } -} - -// creates the tag, including the specified color attributes -OUString HtmlExport::CreateBodyTag() const -{ - OUStringBuffer aStr( "\r\n"); - - return aStr.makeStringAndClear(); -} - -// creates a hyperlink -OUString HtmlExport::CreateLink( std::u16string_view aLink, - std::u16string_view aText, - std::u16string_view aTarget ) -{ - OUStringBuffer aStr( OUString::Concat("") + aText + ""); - - return aStr.makeStringAndClear(); -} - -// creates an image tag -OUString HtmlExport::CreateImage( std::u16string_view aImage, std::u16string_view aAltText ) -{ - OUStringBuffer aStr( OUString::Concat("\"")'); - - return aStr.makeStringAndClear(); -} - -// create area for a circle; we expect pixel coordinates -OUString HtmlExport::ColorToHTMLString( Color aColor ) -{ - static const char hex[] = "0123456789ABCDEF"; - OUStringBuffer aStr( "#xxxxxx" ); - aStr[1] = hex[(aColor.GetRed() >> 4) & 0xf]; - aStr[2] = hex[aColor.GetRed() & 0xf]; - aStr[3] = hex[(aColor.GetGreen() >> 4) & 0xf]; - aStr[4] = hex[aColor.GetGreen() & 0xf]; - aStr[5] = hex[(aColor.GetBlue() >> 4) & 0xf]; - aStr[6] = hex[aColor.GetBlue() & 0xf]; - - return aStr.makeStringAndClear(); -} - -// create area for a circle; we expect pixel coordinates -OUString HtmlExport::CreateHTMLCircleArea( sal_uLong nRadius, - sal_uLong nCenterX, - sal_uLong nCenterY, - std::u16string_view rHRef ) -{ - OUString aStr( - "\"\"\n"); - - return aStr; -} - -// create area for a polygon; we expect pixel coordinates -OUString HtmlExport::CreateHTMLPolygonArea( const ::basegfx::B2DPolyPolygon& rPolyPolygon, - Size aShift, double fFactor, std::u16string_view rHRef ) -{ - OUStringBuffer aStr; - const sal_uInt32 nNoOfPolygons(rPolyPolygon.count()); - - for ( sal_uInt32 nXPoly = 0; nXPoly < nNoOfPolygons; nXPoly++ ) - { - const ::basegfx::B2DPolygon& aPolygon = rPolyPolygon.getB2DPolygon(nXPoly); - const sal_uInt32 nNoOfPoints(aPolygon.count()); - - aStr.append("\"\"(aPnt.X() * fFactor) ); - aPnt.setY( static_cast(aPnt.Y() * fFactor) ); - aStr.append( OUString::number(aPnt.X()) + "," + OUString::number(aPnt.Y()) ); - - if (nPoint < nNoOfPoints - 1) - aStr.append(','); - } - aStr.append(OUString::Concat("\" href=\"") + rHRef + "\">\n"); - } - - return aStr.makeStringAndClear(); -} - -// create area for a rectangle; we expect pixel coordinates -OUString HtmlExport::CreateHTMLRectArea( const ::tools::Rectangle& rRect, - std::u16string_view rHRef ) -{ - OUString aStr( - "\"\"\n"); - - return aStr; -} - -// escapes a string for html -OUString HtmlExport::StringToHTMLString( const OUString& rString ) -{ - SvMemoryStream aMemStm; - HTMLOutFuncs::Out_String( aMemStm, rString ); - aMemStm.WriteChar( char(0) ); - sal_Int32 nLength = strlen(static_cast(aMemStm.GetData())); - return OUString( static_cast(aMemStm.GetData()), nLength, RTL_TEXTENCODING_UTF8 ); -} - -// creates a URL for a specific page -OUString HtmlExport::CreatePageURL( sal_uInt16 nPgNum ) -{ - if(mbFrames) - { - return OUString("JavaScript:parent.NavigateAbs(" + - OUString::number(nPgNum) + ")"); - } - else - return maHTMLFiles[nPgNum]; -} - -bool HtmlExport::CopyScript( std::u16string_view rPath, const OUString& rSource, const OUString& rDest, bool bUnix /* = false */ ) -{ - INetURLObject aURL( SvtPathOptions().GetConfigPath() ); - OUStringBuffer aScriptBuf; - - aURL.Append( u"webcast" ); - aURL.Append( rSource ); - - meEC.SetContext( STR_HTMLEXP_ERROR_OPEN_FILE, rSource ); - - ErrCode nErr = ERRCODE_NONE; - std::unique_ptr pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ); - - if( pIStm ) - { - OStringBuffer aLine; - - while( pIStm->ReadLine( aLine ) ) - { - aScriptBuf.appendAscii( aLine.getStr(), aLine.getLength() ); - if( bUnix ) - { - aScriptBuf.append("\n"); - } - else - { - aScriptBuf.append("\r\n"); - } - } - - nErr = pIStm->GetError(); - pIStm.reset(); - } - - if( nErr != ERRCODE_NONE ) - { - ErrorHandler::HandleError( nErr ); - return static_cast(nErr); - } - - OUString aScript(aScriptBuf.makeStringAndClear()); - aScript = aScript.replaceAll("$$1", getDocumentTitle()); - aScript = aScript.replaceAll("$$2", RESTOHTML(STR_WEBVIEW_SAVE)); - aScript = aScript.replaceAll("$$3", maCGIPath); - aScript = aScript.replaceAll("$$4", OUString::number(mnWidthPixel)); - aScript = aScript.replaceAll("$$5", OUString::number(mnHeightPixel)); - - OUString aDest(rPath + rDest); - - meEC.SetContext( STR_HTMLEXP_ERROR_CREATE_FILE, rDest ); - // write script file - { - EasyFile aFile; - SvStream* pStr; - nErr = aFile.createStream(aDest, pStr); - if(nErr == ERRCODE_NONE) - { - OString aStr(OUStringToOString(aScript, RTL_TEXTENCODING_UTF8)); - pStr->WriteOString( aStr ); - aFile.close(); - } - } - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - if( nErr != ERRCODE_NONE ) - ErrorHandler::HandleError( nErr ); - - return nErr == ERRCODE_NONE; -} - -static const char * ASP_Scripts[] = { "common.inc", "webcast.asp", "show.asp", "savepic.asp", "poll.asp", "editpic.asp" }; - -/** creates and saves the ASP scripts for WebShow */ -bool HtmlExport::CreateASPScripts() -{ - for(const char * p : ASP_Scripts) - { - OUString aScript = OUString::createFromAscii(p); - - if(!CopyScript(maExportPath, aScript, aScript)) - return false; - } - - return CopyScript(maExportPath, "edit.asp", maIndex); -} - -static const char *PERL_Scripts[] = { "webcast.pl", "common.pl", "editpic.pl", "poll.pl", "savepic.pl", "show.pl" }; - -// creates and saves the PERL scripts for WebShow -bool HtmlExport::CreatePERLScripts() -{ - for(const char * p : PERL_Scripts) - { - OUString aScript = OUString::createFromAscii(p); - - if(!CopyScript(maExportPath, aScript, aScript, true)) - return false; - } - - if (!CopyScript(maExportPath, "edit.pl", maIndex, true)) - return false; - - if (!CopyScript(maExportPath, "index.pl", maIndexUrl, true)) - return false; - - return true; -} - -// creates a list with names of the saved images -bool HtmlExport::CreateImageFileList() -{ - OUStringBuffer aStr; - for( sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++) - { - aStr.append( - OUString::number(static_cast(nSdPage + 1)) - + ";" - + maURLPath - + maImageFiles[nSdPage] - + "\r\n"); - } - - bool bOk = WriteHtml("picture.txt", false, aStr); - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - return bOk; -} - -// creates a file with the actual page number -bool HtmlExport::CreateImageNumberFile() -{ - OUString aFileName("currpic.txt"); - OUString aFull(maExportPath + aFileName); - - meEC.SetContext( STR_HTMLEXP_ERROR_CREATE_FILE, aFileName ); - EasyFile aFile; - SvStream* pStr; - ErrCode nErr = aFile.createStream(aFull, pStr); - if(nErr == ERRCODE_NONE) - { - pStr->WriteOString( "1" ); - aFile.close(); - } - - if (mpProgress) - mpProgress->SetState(++mnPagesWritten); - - if( nErr != ERRCODE_NONE ) - ErrorHandler::HandleError( nErr ); - - return nErr == ERRCODE_NONE; -} - -OUString HtmlExport::InsertSound( const OUString& rSoundFile ) -{ - if (rSoundFile.isEmpty()) - return rSoundFile; - - INetURLObject aURL( rSoundFile ); - OUString aSoundFileName = aURL.getName(); - - DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); - - OUString aStr(""); - - CopyFile(rSoundFile, maExportPath + aSoundFileName); - - return aStr; -} - -bool HtmlExport::CopyFile( const OUString& rSourceFile, const OUString& rDestFile ) -{ - meEC.SetContext( STR_HTMLEXP_ERROR_COPY_FILE, rSourceFile, rDestFile ); - osl::FileBase::RC Error = osl::File::copy( rSourceFile, rDestFile ); - - if( Error != osl::FileBase::E_None ) - { - ErrorHandler::HandleError(ErrCode(Error)); - return false; - } - else - { - return true; - } -} - -bool HtmlExport::checkFileExists( Reference< css::ucb::XSimpleFileAccess3 > const & xFileAccess, std::u16string_view aFileName ) -{ - try - { - OUString url = maExportPath + aFileName; - return xFileAccess->exists( url ); - } - catch( css::uno::Exception& ) - { - TOOLS_WARN_EXCEPTION( "sd", "sd::HtmlExport::checkFileExists()" ); - } - - return false; -} - -bool HtmlExport::checkForExistingFiles() -{ - bool bFound = false; - - try - { - Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - uno::Reference xFA(ucb::SimpleFileAccess::create(xContext)); - - sal_uInt16 nSdPage; - for( nSdPage = 0; !bFound && (nSdPage < mnSdPageCount); nSdPage++) - { - if( checkFileExists( xFA, maImageFiles[nSdPage] ) || - checkFileExists( xFA, maHTMLFiles[nSdPage] ) || - checkFileExists( xFA, maThumbnailFiles[nSdPage] ) || - checkFileExists( xFA, maPageNames[nSdPage] ) || - checkFileExists( xFA, maTextFiles[nSdPage] ) ) - { - bFound = true; - } - } - - if( !bFound && mbDownload ) - bFound = checkFileExists( xFA, maDocFileName ); - - if( !bFound && mbFrames ) - bFound = checkFileExists( xFA, maFramePage ); - - if( bFound ) - { - OUString aSystemPath; - osl::FileBase::getSystemPathFromFileURL( maExportPath, aSystemPath ); - OUString aMsg(SdResId(STR_OVERWRITE_WARNING)); - aMsg = aMsg.replaceFirst( "%FILENAME", aSystemPath ); - - std::unique_ptr xWarn(Application::CreateMessageDialog(nullptr, - VclMessageType::Warning, VclButtonsType::YesNo, - aMsg)); - xWarn->set_default_response(RET_YES); - bFound = (RET_NO == xWarn->run()); - } - } - catch( Exception& ) - { - TOOLS_WARN_EXCEPTION( "sd", "sd::HtmlExport::checkForExistingFiles()" ); - bFound = false; - } - - return bFound; -} - -OUString HtmlExport::GetButtonName( int nButton ) -{ - return OUString::createFromAscii(pButtonNames[nButton]); -} - -EasyFile::EasyFile() : bOpen(false) -{ -} - -EasyFile::~EasyFile() -{ - if( bOpen ) - close(); -} - -ErrCode EasyFile::createStream( const OUString& rUrl, SvStream* &rpStr ) -{ - if(bOpen) - close(); - - OUString aFileName; - createFileName( rUrl, aFileName ); - - ErrCode nErr = ERRCODE_NONE; - pOStm = ::utl::UcbStreamHelper::CreateStream( aFileName, StreamMode::WRITE | StreamMode::TRUNC ); - if( pOStm ) - { - bOpen = true; - nErr = pOStm->GetError(); - } - else - { - nErr = ERRCODE_SFX_CANTCREATECONTENT; - } - - if( nErr != ERRCODE_NONE ) - { - bOpen = false; - pOStm.reset(); - } - - rpStr = pOStm.get(); - - return nErr; -} - -void EasyFile::createFileName( const OUString& rURL, OUString& rFileName ) -{ - if( bOpen ) - close(); - - INetURLObject aURL( rURL ); - - if( aURL.GetProtocol() == INetProtocol::NotValid ) - { - OUString aURLStr; - osl::FileBase::getFileURLFromSystemPath( rURL, aURLStr ); - aURL = INetURLObject( aURLStr ); - } - DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); - rFileName = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); -} - -void EasyFile::close() -{ - pOStm.reset(); - bOpen = false; -} - -// This class helps reporting errors during file i/o -HtmlErrorContext::HtmlErrorContext() - : ErrorContext(nullptr) -{ -} - -bool HtmlErrorContext::GetString( ErrCode, OUString& rCtxStr ) -{ - DBG_ASSERT(mpResId, "No error context set"); - if (!mpResId) - return false; - - rCtxStr = SdResId(mpResId); - - rCtxStr = rCtxStr.replaceAll( "$(URL1)", maURL1 ); - rCtxStr = rCtxStr.replaceAll( "$(URL2)", maURL2 ); - - return true; -} - -void HtmlErrorContext::SetContext(TranslateId pResId, const OUString& rURL) -{ - mpResId = pResId; - maURL1 = rURL; - maURL2.clear(); -} - -void HtmlErrorContext::SetContext(TranslateId pResId, const OUString& rURL1, const OUString& rURL2 ) -{ - mpResId = pResId; - maURL1 = rURL1; - maURL2 = rURL2; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx deleted file mode 100644 index 0464e9bf4d6f..000000000000 --- a/sd/source/filter/html/htmlex.hxx +++ /dev/null @@ -1,237 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "htmlpublishmode.hxx" - -#include -#include -#include - -namespace basegfx { class B2DPolyPolygon; } -namespace com::sun::star::beans { struct PropertyValue; } -namespace com::sun::star::ucb { class XSimpleFileAccess3; } -namespace sd { class DrawDocShell; } -namespace tools { class Rectangle; } - -#define PUB_LOWRES_WIDTH 640 -#define PUB_MEDRES_WIDTH 800 -#define PUB_HIGHRES_WIDTH 1024 -#define PUB_FHDRES_WIDTH 1920 - -#define PUB_THUMBNAIL_WIDTH 256 -#define PUB_THUMBNAIL_HEIGHT 192 - -class ErrCode; -class OutlinerParaObject; -class SfxItemSet; -class Size; -class SfxProgress; -class SdrOutliner; -class SdPage; -class HtmlState; -class SdrTextObj; -class SdrObjGroup; -namespace sdr::table { class SdrTableObj; } -class SdrPage; -class SdDrawDocument; -class ButtonSet; - -class HtmlErrorContext : public ErrorContext -{ -private: - TranslateId mpResId; - OUString maURL1; - OUString maURL2; - -public: - explicit HtmlErrorContext(); - - virtual bool GetString( ErrCode nErrId, OUString& rCtxStr ) override; - - void SetContext(TranslateId pResId, const OUString& rURL); - void SetContext(TranslateId pResId, const OUString& rURL1, const OUString& rURL2); -}; - -/// this class exports an Impress Document as a HTML Presentation. -class HtmlExport final -{ - std::vector< SdPage* > maPages; - std::vector< SdPage* > maNotesPages; - - OUString maPath; - - SdDrawDocument* mpDoc; - ::sd::DrawDocShell* mpDocSh; - - HtmlErrorContext meEC; - - HtmlPublishMode meMode; - std::unique_ptr mpProgress; - bool mbImpress; - sal_uInt16 mnSdPageCount; - sal_uInt16 mnPagesWritten; - bool mbContentsPage; - sal_Int16 mnButtonThema; - sal_uInt16 mnWidthPixel; - sal_uInt16 mnHeightPixel; - PublishingFormat meFormat; - bool mbHeader; - bool mbNotes; - bool mbFrames; - OUString maIndex; - OUString maEMail; - OUString maAuthor; - OUString maHomePage; - OUString maInfo; - sal_Int16 mnCompression; - OUString maDocFileName; - OUString maFramePage; - OUString mDocTitle; - bool mbDownload; - - bool mbAutoSlide; - double mfSlideDuration; - bool mbSlideSound; - bool mbHiddenSlides; - bool mbEndless; - - bool mbUserAttr; - Color maTextColor; ///< The following colors are used for the tag if mbUserAttr is true. - Color maBackColor; - Color maLinkColor; - Color maVLinkColor; - Color maALinkColor; - Color maFirstPageColor; - bool mbDocColors; - - std::vector maHTMLFiles; - std::vector maImageFiles; - std::vector maThumbnailFiles; - std::vector maPageNames; - std::vector maTextFiles; - - OUString maExportPath; ///< output directory or URL. - OUString maIndexUrl; - OUString maURLPath; - OUString maCGIPath; - PublishingScript meScript; - - std::unique_ptr< ButtonSet > mpButtonSet; - - static SdrTextObj* GetLayoutTextObject(SdrPage const * pPage); - - void SetDocColors( SdPage* pPage = nullptr ); - - bool CreateImagesForPresPages( bool bThumbnails = false ); - bool CreateHtmlTextForPresPages(); - bool CreateHtmlForPresPages(); - bool CreateContentPage(); - void CreateFileNames(); - void CreateBitmaps(); - bool CreateOutlinePages(); - bool CreateFrames(); - bool CreateNotesPages(); - bool CreateNavBarFrames(); - - bool CreateASPScripts(); - bool CreatePERLScripts(); - bool CreateImageFileList(); - bool CreateImageNumberFile(); - - bool checkForExistingFiles(); - bool checkFileExists( css::uno::Reference< css::ucb::XSimpleFileAccess3 > const & xFileAccess, std::u16string_view aFileName ); - - OUString const & getDocumentTitle(); - bool SavePresentation(); - - static OUString CreateLink( std::u16string_view aLink, std::u16string_view aText, - std::u16string_view aTarget = std::u16string_view()); - static OUString CreateImage( std::u16string_view aImage, std::u16string_view aAltText ); - OUString CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const; - OUString CreateBodyTag() const; - - OUString ParagraphToHTMLString( SdrOutliner const * pOutliner, sal_Int32 nPara, const Color& rBackgroundColor ); - OUString TextAttribToHTMLString( SfxItemSet const * pSet, HtmlState* pState, const Color& rBackgroundColor ); - - OUString CreateTextForTitle( SdrOutliner* pOutliner, SdPage* pPage, const Color& rBackgroundColor ); - OUString CreateTextForPage( SdrOutliner* pOutliner, SdPage const * pPage, bool bHeadLine, const Color& rBackgroundColor ); - OUString CreateTextForNotesPage( SdrOutliner* pOutliner, SdPage* pPage, const Color& rBackgroundColor ); - - static OUString CreateHTMLCircleArea( sal_uLong nRadius, sal_uLong nCenterX, - sal_uLong nCenterY, std::u16string_view rHRef ); - static OUString CreateHTMLPolygonArea( const ::basegfx::B2DPolyPolygon& rPolyPoly, Size aShift, double fFactor, std::u16string_view rHRef ); - static OUString CreateHTMLRectArea( const ::tools::Rectangle& rRect, - std::u16string_view rHRef ); - - OUString CreatePageURL( sal_uInt16 nPgNum ); - - OUString InsertSound( const OUString& rSoundFile ); - bool CopyFile( const OUString& rSourceFile, const OUString& rDestFile ); - bool CopyScript( std::u16string_view rPath, const OUString& rSource, const OUString& rDest, bool bUnix = false ); - - void InitProgress( sal_uInt16 nProgrCount ); - void ResetProgress(); - - /// Output only the charset metadata, title etc. will be handled separately. - static OUString CreateMetaCharset(); - - /// Output document metadata. - OUString DocumentMetadata() const; - - void InitExportParameters( const css::uno::Sequence< css::beans::PropertyValue >& rParams); - void ExportHtml(); - void ExportKiosk(); - void ExportWebCast(); - void ExportSingleDocument(); - - bool WriteHtml( const OUString& rFileName, bool bAddExtension, std::u16string_view rHtmlData ); - static OUString GetButtonName( int nButton ); - - void WriteOutlinerParagraph(OUStringBuffer& aStr, SdrOutliner* pOutliner, - OutlinerParaObject const * pOutlinerParagraphObject, - const Color& rBackgroundColor, bool bHeadLine); - - void WriteObjectGroup(OUStringBuffer& aStr, SdrObjGroup const * pObjectGroup, - SdrOutliner* pOutliner, const Color& rBackgroundColor, bool bHeadLine); - - void WriteTable(OUStringBuffer& aStr, sdr::table::SdrTableObj const * pTableObject, - SdrOutliner* pOutliner, const Color& rBackgroundColor); - - public: - HtmlExport(OUString aPath, - const css::uno::Sequence& rParams, - SdDrawDocument* pExpDoc, - sd::DrawDocShell* pDocShell); - - ~HtmlExport(); - - static OUString ColorToHTMLString( Color aColor ); - static OUString StringToHTMLString( const OUString& rString ); -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 9fbaec3840aa..9136de7c8f40 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -38,9 +38,7 @@ #include #include -#include #include "htmlattr.hxx" -#include "htmlex.hxx" #include "htmlpublishmode.hxx" #include #include "buttonset.hxx" @@ -58,17 +56,11 @@ const sal_uInt16 nMagic = sal_uInt16(0x1977); constexpr OUStringLiteral KEY_QUALITY = u"JPG-EXPORT-QUALITY"; // The Help-IDs of the pages -constexpr rtl::OUStringConstExpr aPageHelpIds[NOOFPAGES] = -{ - HID_SD_HTMLEXPORT_PAGE1, - HID_SD_HTMLEXPORT_PAGE2, - HID_SD_HTMLEXPORT_PAGE3, - HID_SD_HTMLEXPORT_PAGE4, - HID_SD_HTMLEXPORT_PAGE5, - HID_SD_HTMLEXPORT_PAGE6 -}; +constexpr rtl::OUStringConstExpr aPageHelpIds[NOOFPAGES] + = { HID_SD_HTMLEXPORT_PAGE1, HID_SD_HTMLEXPORT_PAGE2, HID_SD_HTMLEXPORT_PAGE3, + HID_SD_HTMLEXPORT_PAGE4, HID_SD_HTMLEXPORT_PAGE5, HID_SD_HTMLEXPORT_PAGE6 }; -static SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign); +static SvStream& operator>>(SvStream& rIn, SdPublishingDesign& rDesign); static SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDesign); @@ -82,48 +74,48 @@ public: // special WebCast options PublishingScript m_eScript; - OUString m_aCGI; - OUString m_aURL; + OUString m_aCGI; + OUString m_aURL; // special Kiosk options - bool m_bAutoSlide; - sal_uInt32 m_nSlideDuration; - bool m_bEndless; + bool m_bAutoSlide; + sal_uInt32 m_nSlideDuration; + bool m_bEndless; // special HTML options - bool m_bContentPage; - bool m_bNotes; + bool m_bContentPage; + bool m_bNotes; // misc options - sal_uInt16 m_nResolution; - OUString m_aCompression; + sal_uInt16 m_nResolution; + OUString m_aCompression; PublishingFormat m_eFormat; - bool m_bSlideSound; - bool m_bHiddenSlides; + bool m_bSlideSound; + bool m_bHiddenSlides; // title page information - OUString m_aAuthor; - OUString m_aEMail; - OUString m_aWWW; - OUString m_aMisc; - bool m_bDownload; - bool m_bCreated; // not used + OUString m_aAuthor; + OUString m_aEMail; + OUString m_aWWW; + OUString m_aMisc; + bool m_bDownload; + bool m_bCreated; // not used // buttons and colorscheme - sal_Int16 m_nButtonThema; - bool m_bUserAttr; - Color m_aBackColor; - Color m_aTextColor; - Color m_aLinkColor; - Color m_aVLinkColor; - Color m_aALinkColor; - bool m_bUseAttribs; - bool m_bUseColor; + sal_Int16 m_nButtonThema; + bool m_bUserAttr; + Color m_aBackColor; + Color m_aTextColor; + Color m_aLinkColor; + Color m_aVLinkColor; + Color m_aALinkColor; + bool m_bUseAttribs; + bool m_bUseColor; SdPublishingDesign(); - bool operator ==(const SdPublishingDesign & rDesign) const; - friend SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign); + bool operator==(const SdPublishingDesign& rDesign) const; + friend SvStream& operator>>(SvStream& rIn, SdPublishingDesign& rDesign); friend SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDesign); }; @@ -153,130 +145,92 @@ SdPublishingDesign::SdPublishingDesign() , m_bUseColor(true) { FilterConfigItem aFilterConfigItem(u"Office.Common/Filter/Graphic/Export/JPG"); - sal_Int32 nCompression = aFilterConfigItem.ReadInt32( KEY_QUALITY, 75 ); + sal_Int32 nCompression = aFilterConfigItem.ReadInt32(KEY_QUALITY, 75); m_aCompression = OUString::number(nCompression) + "%"; SvtUserOptions aUserOptions; - m_aAuthor = aUserOptions.GetFirstName(); + m_aAuthor = aUserOptions.GetFirstName(); if (!m_aAuthor.isEmpty() && !aUserOptions.GetLastName().isEmpty()) m_aAuthor += " "; - m_aAuthor += aUserOptions.GetLastName(); - m_aEMail = aUserOptions.GetEmail(); + m_aAuthor += aUserOptions.GetLastName(); + m_aEMail = aUserOptions.GetEmail(); } // Compares the values without paying attention to the name -bool SdPublishingDesign::operator ==(const SdPublishingDesign & rDesign) const +bool SdPublishingDesign::operator==(const SdPublishingDesign& rDesign) const { - return - ( - m_eMode == rDesign.m_eMode && - m_nResolution == rDesign.m_nResolution && - m_aCompression == rDesign.m_aCompression && - m_eFormat == rDesign.m_eFormat && - m_bHiddenSlides == rDesign.m_bHiddenSlides && - ( // compare html options - (m_eMode != PUBLISH_HTML && m_eMode != PUBLISH_FRAMES) || - ( - m_bContentPage == rDesign.m_bContentPage && - m_bNotes == rDesign.m_bNotes && - m_aAuthor == rDesign.m_aAuthor && - m_aEMail == rDesign.m_aEMail && - m_aWWW == rDesign.m_aWWW && - m_aMisc == rDesign.m_aMisc && - m_bDownload == rDesign.m_bDownload && - m_nButtonThema == rDesign.m_nButtonThema && - m_bUserAttr == rDesign.m_bUserAttr && - m_aBackColor == rDesign.m_aBackColor && - m_aTextColor == rDesign.m_aTextColor && - m_aLinkColor == rDesign.m_aLinkColor && - m_aVLinkColor == rDesign.m_aVLinkColor && - m_aALinkColor == rDesign.m_aALinkColor && - m_bUseAttribs == rDesign.m_bUseAttribs && - m_bSlideSound == rDesign.m_bSlideSound && - m_bUseColor == rDesign.m_bUseColor - ) - ) && - ( // compare kiosk options - (m_eMode != PUBLISH_KIOSK) || - ( - m_bAutoSlide == rDesign.m_bAutoSlide && - m_bSlideSound == rDesign.m_bSlideSound && - ( - !m_bAutoSlide || - ( - m_nSlideDuration == rDesign.m_nSlideDuration && - m_bEndless == rDesign.m_bEndless - ) - ) - ) - ) && - ( // compare WebCast options - (m_eMode != PUBLISH_WEBCAST) || - ( - m_eScript == rDesign.m_eScript && - ( - m_eScript != SCRIPT_PERL || - ( - m_aURL == rDesign.m_aURL && - m_aCGI == rDesign.m_aCGI - ) - ) - ) - ) - ); + return ( + m_eMode == rDesign.m_eMode && m_nResolution == rDesign.m_nResolution + && m_aCompression == rDesign.m_aCompression && m_eFormat == rDesign.m_eFormat + && m_bHiddenSlides == rDesign.m_bHiddenSlides + && ( // compare html options + (m_eMode != PUBLISH_HTML && m_eMode != PUBLISH_FRAMES) + || (m_bContentPage == rDesign.m_bContentPage && m_bNotes == rDesign.m_bNotes + && m_aAuthor == rDesign.m_aAuthor && m_aEMail == rDesign.m_aEMail + && m_aWWW == rDesign.m_aWWW && m_aMisc == rDesign.m_aMisc + && m_bDownload == rDesign.m_bDownload && m_nButtonThema == rDesign.m_nButtonThema + && m_bUserAttr == rDesign.m_bUserAttr && m_aBackColor == rDesign.m_aBackColor + && m_aTextColor == rDesign.m_aTextColor && m_aLinkColor == rDesign.m_aLinkColor + && m_aVLinkColor == rDesign.m_aVLinkColor + && m_aALinkColor == rDesign.m_aALinkColor + && m_bUseAttribs == rDesign.m_bUseAttribs + && m_bSlideSound == rDesign.m_bSlideSound && m_bUseColor == rDesign.m_bUseColor)) + && ( // compare kiosk options + (m_eMode != PUBLISH_KIOSK) + || (m_bAutoSlide == rDesign.m_bAutoSlide && m_bSlideSound == rDesign.m_bSlideSound + && (!m_bAutoSlide + || (m_nSlideDuration == rDesign.m_nSlideDuration + && m_bEndless == rDesign.m_bEndless)))) + && ( // compare WebCast options + (m_eMode != PUBLISH_WEBCAST) + || (m_eScript == rDesign.m_eScript + && (m_eScript != SCRIPT_PERL + || (m_aURL == rDesign.m_aURL && m_aCGI == rDesign.m_aCGI))))); } // Load the design from the stream -SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) +SvStream& operator>>(SvStream& rIn, SdPublishingDesign& rDesign) { SdIOCompat aIO(rIn, StreamMode::READ); sal_uInt16 nTemp16; tools::GenericTypeSerializer aSerializer(rIn); - rDesign.m_aDesignName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rIn.ReadUInt16( nTemp16 ); + rDesign.m_aDesignName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + rIn.ReadUInt16(nTemp16); rDesign.m_eMode = static_cast(nTemp16); - rIn.ReadCharAsBool( rDesign.m_bContentPage ); - rIn.ReadCharAsBool( rDesign.m_bNotes ); - rIn.ReadUInt16( rDesign.m_nResolution ); - rDesign.m_aCompression = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rIn.ReadUInt16( nTemp16 ); + rIn.ReadCharAsBool(rDesign.m_bContentPage); + rIn.ReadCharAsBool(rDesign.m_bNotes); + rIn.ReadUInt16(rDesign.m_nResolution); + rDesign.m_aCompression = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + rIn.ReadUInt16(nTemp16); rDesign.m_eFormat = static_cast(nTemp16); - rDesign.m_aAuthor = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rDesign.m_aEMail = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rDesign.m_aWWW = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rDesign.m_aMisc = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rIn.ReadCharAsBool( rDesign.m_bDownload ); - rIn.ReadCharAsBool( rDesign.m_bCreated ); // not used - rIn.ReadInt16( rDesign.m_nButtonThema ); - rIn.ReadCharAsBool( rDesign.m_bUserAttr ); + rDesign.m_aAuthor = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + rDesign.m_aEMail = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + rDesign.m_aWWW = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + rDesign.m_aMisc = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + rIn.ReadCharAsBool(rDesign.m_bDownload); + rIn.ReadCharAsBool(rDesign.m_bCreated); // not used + rIn.ReadInt16(rDesign.m_nButtonThema); + rIn.ReadCharAsBool(rDesign.m_bUserAttr); aSerializer.readColor(rDesign.m_aBackColor); aSerializer.readColor(rDesign.m_aTextColor); aSerializer.readColor(rDesign.m_aLinkColor); aSerializer.readColor(rDesign.m_aVLinkColor); aSerializer.readColor(rDesign.m_aALinkColor); - rIn.ReadCharAsBool( rDesign.m_bUseAttribs ); - rIn.ReadCharAsBool( rDesign.m_bUseColor ); + rIn.ReadCharAsBool(rDesign.m_bUseAttribs); + rIn.ReadCharAsBool(rDesign.m_bUseColor); - rIn.ReadUInt16( nTemp16 ); + rIn.ReadUInt16(nTemp16); rDesign.m_eScript = static_cast(nTemp16); - rDesign.m_aURL = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rDesign.m_aCGI = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); + rDesign.m_aURL = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); + rDesign.m_aCGI = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rIn.ReadCharAsBool( rDesign.m_bAutoSlide ); - rIn.ReadUInt32( rDesign.m_nSlideDuration ); - rIn.ReadCharAsBool( rDesign.m_bEndless ); - rIn.ReadCharAsBool( rDesign.m_bSlideSound ); - rIn.ReadCharAsBool( rDesign.m_bHiddenSlides ); + rIn.ReadCharAsBool(rDesign.m_bAutoSlide); + rIn.ReadUInt32(rDesign.m_nSlideDuration); + rIn.ReadCharAsBool(rDesign.m_bEndless); + rIn.ReadCharAsBool(rDesign.m_bSlideSound); + rIn.ReadCharAsBool(rDesign.m_bHiddenSlides); return rIn; } @@ -291,52 +245,46 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes // Name write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aDesignName, - RTL_TEXTENCODING_UTF8); + RTL_TEXTENCODING_UTF8); - rOut.WriteUInt16( rDesign.m_eMode ); - rOut.WriteBool( rDesign.m_bContentPage ); - rOut.WriteBool( rDesign.m_bNotes ); - rOut.WriteUInt16( rDesign.m_nResolution ); + rOut.WriteUInt16(rDesign.m_eMode); + rOut.WriteBool(rDesign.m_bContentPage); + rOut.WriteBool(rDesign.m_bNotes); + rOut.WriteUInt16(rDesign.m_nResolution); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCompression, - RTL_TEXTENCODING_UTF8); - rOut.WriteUInt16( rDesign.m_eFormat ); - write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aAuthor, - RTL_TEXTENCODING_UTF8); - write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aEMail, - RTL_TEXTENCODING_UTF8); - write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aWWW, - RTL_TEXTENCODING_UTF8); - write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aMisc, - RTL_TEXTENCODING_UTF8); - rOut.WriteBool( rDesign.m_bDownload ); - rOut.WriteBool( rDesign.m_bCreated ); // not used - rOut.WriteInt16( rDesign.m_nButtonThema ); - rOut.WriteBool( rDesign.m_bUserAttr ); + RTL_TEXTENCODING_UTF8); + rOut.WriteUInt16(rDesign.m_eFormat); + write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aAuthor, RTL_TEXTENCODING_UTF8); + write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aEMail, RTL_TEXTENCODING_UTF8); + write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aWWW, RTL_TEXTENCODING_UTF8); + write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aMisc, RTL_TEXTENCODING_UTF8); + rOut.WriteBool(rDesign.m_bDownload); + rOut.WriteBool(rDesign.m_bCreated); // not used + rOut.WriteInt16(rDesign.m_nButtonThema); + rOut.WriteBool(rDesign.m_bUserAttr); aSerializer.writeColor(rDesign.m_aBackColor); aSerializer.writeColor(rDesign.m_aTextColor); aSerializer.writeColor(rDesign.m_aLinkColor); aSerializer.writeColor(rDesign.m_aVLinkColor); aSerializer.writeColor(rDesign.m_aALinkColor); - rOut.WriteBool( rDesign.m_bUseAttribs ); - rOut.WriteBool( rDesign.m_bUseColor ); + rOut.WriteBool(rDesign.m_bUseAttribs); + rOut.WriteBool(rDesign.m_bUseColor); - rOut.WriteUInt16( rDesign.m_eScript ); - write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aURL, - RTL_TEXTENCODING_UTF8); - write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCGI, - RTL_TEXTENCODING_UTF8); + rOut.WriteUInt16(rDesign.m_eScript); + write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aURL, RTL_TEXTENCODING_UTF8); + write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCGI, RTL_TEXTENCODING_UTF8); - rOut.WriteBool( rDesign.m_bAutoSlide ); - rOut.WriteUInt32( rDesign.m_nSlideDuration ); - rOut.WriteBool( rDesign.m_bEndless ); - rOut.WriteBool( rDesign.m_bSlideSound ); - rOut.WriteBool( rDesign.m_bHiddenSlides ); + rOut.WriteBool(rDesign.m_bAutoSlide); + rOut.WriteUInt32(rDesign.m_nSlideDuration); + rOut.WriteBool(rDesign.m_bEndless); + rOut.WriteBool(rDesign.m_bSlideSound); + rOut.WriteBool(rDesign.m_bHiddenSlides); return rOut; } -namespace { - +namespace +{ // Dialog for the entry of the name of the design class SdDesignNameDlg : public weld::GenericDialogController { @@ -345,1174 +293,10 @@ private: std::unique_ptr m_xBtnOK; public: - SdDesignNameDlg(weld::Window* pWindow, const OUString& aName ); + SdDesignNameDlg(weld::Window* pWindow, const OUString& aName); OUString GetDesignName() const; DECL_LINK(ModifyHdl, weld::Entry&, void); }; - -} - -// SdPublishingDlg Methods - -SdPublishingDlg::SdPublishingDlg(weld::Window* pWindow, DocumentType eDocType) - : GenericDialogController(pWindow, "modules/simpress/ui/publishingdialog.ui", "PublishingDialog") - , m_xPage1_Designs(m_xBuilder->weld_tree_view("designsTreeview")) - , m_xPage2_Standard_FB(m_xBuilder->weld_image("standardFBImage")) - , m_xPage2_Frames_FB(m_xBuilder->weld_image("framesFBImage")) - , m_xPage2_Kiosk_FB(m_xBuilder->weld_image("kioskFBImage")) - , m_xPage2_WebCast_FB(m_xBuilder->weld_image("webCastFBImage")) - , m_xPage4_Misc(m_xBuilder->weld_text_view("miscTextview")) - , m_xButtonSet(new ButtonSet()) - , m_xLastPageButton(m_xBuilder->weld_button("lastPageButton")) - , m_xNextPageButton(m_xBuilder->weld_button("nextPageButton")) - , m_xFinishButton(m_xBuilder->weld_button("finishButton")) - , aAssistentFunc(NOOFPAGES) - , m_bButtonsDirty(true) - , m_bDesignListDirty(false) - , m_pDesign(nullptr) -{ - m_bImpress = eDocType == DocumentType::Impress; - - Size aSize(m_xPage2_Standard_FB->get_approximate_digit_width() * 12, - m_xPage2_Standard_FB->get_text_height() * 6); - m_xPage2_Standard_FB->set_size_request(aSize.Width(), aSize.Height()); - m_xPage2_Frames_FB->set_size_request(aSize.Width(), aSize.Height()); - m_xPage2_Kiosk_FB->set_size_request(aSize.Width(), aSize.Height()); - m_xPage2_WebCast_FB->set_size_request(aSize.Width(), aSize.Height()); - - m_xPage4_Misc->set_size_request(m_xPage4_Misc->get_approximate_digit_width() * 40, - m_xPage4_Misc->get_height_rows(8)); - - m_xPage1_Designs->set_size_request(m_xPage4_Misc->get_approximate_digit_width() * 40, - m_xPage4_Misc->get_height_rows(8)); - - //Lock down the preferred size based on the - //initial max-size configuration - aSize = m_xDialog->get_preferred_size(); - m_xDialog->set_size_request(aSize.Width(), aSize.Height()); - - CreatePages(); - Load(); - - // sets the output page - aAssistentFunc.GotoPage(1); - m_xLastPageButton->set_sensitive(false); - - // button assignment - m_xFinishButton->connect_clicked(LINK(this,SdPublishingDlg,FinishHdl)); - m_xLastPageButton->connect_clicked(LINK(this,SdPublishingDlg,LastPageHdl)); - m_xNextPageButton->connect_clicked(LINK(this,SdPublishingDlg,NextPageHdl)); - - m_xPage1_NewDesign->connect_toggled(LINK(this,SdPublishingDlg,DesignHdl)); - m_xPage1_OldDesign->connect_toggled(LINK(this,SdPublishingDlg,DesignHdl)); - m_xPage1_Designs->connect_changed(LINK(this,SdPublishingDlg,DesignSelectHdl)); - m_xPage1_DelDesign->connect_clicked(LINK(this,SdPublishingDlg,DesignDeleteHdl)); - - m_xPage2_Standard->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl)); - m_xPage2_Frames->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl)); - m_xPage2_SingleDocument->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl)); - m_xPage2_Kiosk->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl)); - m_xPage2_WebCast->connect_toggled(LINK(this,SdPublishingDlg,BaseHdl)); - - m_xPage2_Content->connect_toggled(LINK(this,SdPublishingDlg,ContentHdl)); - - m_xPage2_ASP->connect_toggled(LINK(this,SdPublishingDlg,WebServerHdl)); - m_xPage2_PERL->connect_toggled(LINK(this,SdPublishingDlg,WebServerHdl)); - m_xPage2_Index->set_text("index" STR_HTMLEXP_DEFAULT_EXTENSION); - m_xPage2_CGI->set_text("/cgi-bin/"); - - m_xPage3_Png->connect_toggled(LINK(this,SdPublishingDlg, GfxFormatHdl)); - m_xPage3_Gif->connect_toggled(LINK(this,SdPublishingDlg, GfxFormatHdl)); - m_xPage3_Jpg->connect_toggled(LINK(this,SdPublishingDlg, GfxFormatHdl)); - m_xPage3_Quality->set_sensitive(false); - - m_xPage3_Resolution_1->connect_toggled(LINK(this,SdPublishingDlg, ResolutionHdl )); - m_xPage3_Resolution_2->connect_toggled(LINK(this,SdPublishingDlg, ResolutionHdl )); - m_xPage3_Resolution_3->connect_toggled(LINK(this,SdPublishingDlg, ResolutionHdl )); - m_xPage3_Resolution_4->connect_toggled(LINK(this, SdPublishingDlg, ResolutionHdl)); - - m_xPage2_ChgDefault->connect_toggled(LINK(this,SdPublishingDlg, SlideChgHdl)); - m_xPage2_ChgAuto->connect_toggled(LINK(this,SdPublishingDlg, SlideChgHdl)); - - m_xPage5_Buttons->SetSelectHdl(LINK(this,SdPublishingDlg, ButtonsHdl )); - m_xPage5_Buttons->SetStyle( m_xPage5_Buttons->GetStyle() | WB_VSCROLL ); - - m_xPage6_Back->connect_clicked(LINK(this,SdPublishingDlg, ColorHdl )); - m_xPage6_Text->connect_clicked(LINK(this,SdPublishingDlg, ColorHdl )); - m_xPage6_Link->connect_clicked(LINK(this,SdPublishingDlg, ColorHdl )); - m_xPage6_VLink->connect_clicked(LINK(this,SdPublishingDlg, ColorHdl )); - m_xPage6_ALink->connect_clicked(LINK(this,SdPublishingDlg, ColorHdl )); - - m_xPage6_DocColors->set_active(true); - - m_xPage3_Quality->append_text( "25%" ); - m_xPage3_Quality->append_text( "50%" ); - m_xPage3_Quality->append_text( "75%" ); - m_xPage3_Quality->append_text( "100%" ); - - m_xPage5_Buttons->SetColCount(); - m_xPage5_Buttons->SetLineCount( 4 ); - m_xPage5_Buttons->SetExtraSpacing( 1 ); - - for( const auto& rDesign : m_aDesignList ) - m_xPage1_Designs->append_text(rDesign.m_aDesignName); - - SetDefaults(); - - m_xDialog->set_help_id(aPageHelpIds[0]); - - m_xNextPageButton->grab_focus(); -} - -SdPublishingDlg::~SdPublishingDlg() -{ -} - -// Generate dialog controls and embed them in the pages -void SdPublishingDlg::CreatePages() -{ - // Page 1 - m_xPage1 = m_xBuilder->weld_container("page1"); - m_xPage1_Title = m_xBuilder->weld_label("assignLabel"); - m_xPage1_NewDesign = m_xBuilder->weld_radio_button("newDesignRadiobutton"); - m_xPage1_OldDesign = m_xBuilder->weld_radio_button("oldDesignRadiobutton"); - m_xPage1_DelDesign = m_xBuilder->weld_button("delDesingButton"); - m_xPage1_Desc = m_xBuilder->weld_label("descLabel"); - aAssistentFunc.InsertControl(1, m_xPage1.get()); - aAssistentFunc.InsertControl(1, m_xPage1_Title.get()); - aAssistentFunc.InsertControl(1, m_xPage1_NewDesign.get()); - aAssistentFunc.InsertControl(1, m_xPage1_OldDesign.get()); - aAssistentFunc.InsertControl(1, m_xPage1_Designs.get()); - aAssistentFunc.InsertControl(1, m_xPage1_DelDesign.get()); - aAssistentFunc.InsertControl(1, m_xPage1_Desc.get()); - - // Page 2 - m_xPage2 = m_xBuilder->weld_container("page2"); - m_xPage2Frame2 = m_xBuilder->weld_container("page2.2"); - m_xPage2Frame3 = m_xBuilder->weld_container("page2.3"); - m_xPage2Frame4 = m_xBuilder->weld_container("page2.4"); - m_xPage2_Title = m_xBuilder->weld_label("publicationLabel"); - m_xPage2_Standard = m_xBuilder->weld_radio_button("standardRadiobutton"); - m_xPage2_Frames = m_xBuilder->weld_radio_button("framesRadiobutton"); - m_xPage2_SingleDocument = m_xBuilder->weld_radio_button("singleDocumentRadiobutton"); - m_xPage2_Kiosk = m_xBuilder->weld_radio_button("kioskRadiobutton"); - m_xPage2_WebCast = m_xBuilder->weld_radio_button("webCastRadiobutton"); - aAssistentFunc.InsertControl(2, m_xPage2.get()); - aAssistentFunc.InsertControl(2, m_xPage2Frame2.get()); - aAssistentFunc.InsertControl(2, m_xPage2Frame3.get()); - aAssistentFunc.InsertControl(2, m_xPage2Frame4.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Title.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Standard.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Frames.get()); - aAssistentFunc.InsertControl(2, m_xPage2_SingleDocument.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Kiosk.get()); - aAssistentFunc.InsertControl(2, m_xPage2_WebCast.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Standard_FB.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Frames_FB.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Kiosk_FB.get()); - aAssistentFunc.InsertControl(2, m_xPage2_WebCast_FB.get()); - - m_xPage2_Title_Html = m_xBuilder->weld_label( "htmlOptionsLabel"); - m_xPage2_Content = m_xBuilder->weld_check_button("contentCheckbutton"); - m_xPage2_Notes = m_xBuilder->weld_check_button("notesCheckbutton"); - aAssistentFunc.InsertControl(2, m_xPage2_Title_Html.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Content.get()); - if (m_bImpress) - aAssistentFunc.InsertControl(2, m_xPage2_Notes.get()); - - m_xPage2_Title_WebCast = m_xBuilder->weld_label("webCastLabel"); - m_xPage2_ASP = m_xBuilder->weld_radio_button("ASPRadiobutton"); - m_xPage2_PERL = m_xBuilder->weld_radio_button("perlRadiobutton"); - m_xPage2_URL_txt = m_xBuilder->weld_label("URLTxtLabel"); - m_xPage2_URL = m_xBuilder->weld_entry("URLEntry"); - m_xPage2_CGI_txt = m_xBuilder->weld_label("CGITxtLabel"); - m_xPage2_CGI = m_xBuilder->weld_entry("CGIEntry"); - m_xPage2_Index_txt = m_xBuilder->weld_label("indexTxtLabel"); - m_xPage2_Index = m_xBuilder->weld_entry("indexEntry"); - m_xPage2_Title_Kiosk = m_xBuilder->weld_label("kioskLabel"); - m_xPage2_ChgDefault = m_xBuilder->weld_radio_button("chgDefaultRadiobutton"); - m_xPage2_ChgAuto = m_xBuilder->weld_radio_button("chgAutoRadiobutton"); - m_xPage2_Duration_txt = m_xBuilder->weld_label("durationTxtLabel"); - m_xPage2_Duration = m_xBuilder->weld_formatted_spin_button("durationSpinbutton"); - m_xFormatter.reset(new weld::TimeFormatter(*m_xPage2_Duration)); - m_xFormatter->SetExtFormat(ExtTimeFieldFormat::LongDuration); - m_xPage2_Endless = m_xBuilder->weld_check_button("endlessCheckbutton"); - aAssistentFunc.InsertControl(2, m_xPage2_Title_WebCast.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Index_txt.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Index.get()); - aAssistentFunc.InsertControl(2, m_xPage2_ASP.get()); - aAssistentFunc.InsertControl(2, m_xPage2_PERL.get()); - aAssistentFunc.InsertControl(2, m_xPage2_URL_txt.get()); - aAssistentFunc.InsertControl(2, m_xPage2_URL.get()); - aAssistentFunc.InsertControl(2, m_xPage2_CGI_txt.get()); - aAssistentFunc.InsertControl(2, m_xPage2_CGI.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Title_Kiosk.get()); - aAssistentFunc.InsertControl(2, m_xPage2_ChgDefault.get()); - aAssistentFunc.InsertControl(2, m_xPage2_ChgAuto.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Duration_txt.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Duration.get()); - aAssistentFunc.InsertControl(2, m_xPage2_Endless.get()); - - // Page 3 - m_xPage3 = m_xBuilder->weld_container("page3"); - m_xPage3_Title1 = m_xBuilder->weld_label("saveImgAsLabel"); - m_xPage3_Png = m_xBuilder->weld_radio_button("pngRadiobutton"); - m_xPage3_Gif = m_xBuilder->weld_radio_button("gifRadiobutton"); - m_xPage3_Jpg = m_xBuilder->weld_radio_button("jpgRadiobutton"); - m_xPage3_Quality_txt = m_xBuilder->weld_label("qualityTxtLabel"); - m_xPage3_Quality= m_xBuilder->weld_combo_box("qualityCombobox"); - m_xPage3_Title2 = m_xBuilder->weld_label("monitorResolutionLabel"); - m_xPage3_Resolution_1 = m_xBuilder->weld_radio_button("resolution1Radiobutton"); - m_xPage3_Resolution_2 = m_xBuilder->weld_radio_button("resolution2Radiobutton"); - m_xPage3_Resolution_3 = m_xBuilder->weld_radio_button("resolution3Radiobutton"); - m_xPage3_Resolution_4 = m_xBuilder->weld_radio_button("resolution4Radiobutton"); - m_xPage3_Title3 = m_xBuilder->weld_label("effectsLabel"); - m_xPage3_SldSound = m_xBuilder->weld_check_button("sldSoundCheckbutton"); - m_xPage3_HiddenSlides = m_xBuilder->weld_check_button("hiddenSlidesCheckbutton"); - aAssistentFunc.InsertControl(3, m_xPage3.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Title1.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Png.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Gif.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Jpg.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Quality_txt.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Quality.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Title2.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Resolution_1.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Resolution_2.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Resolution_3.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Resolution_4.get()); - aAssistentFunc.InsertControl(3, m_xPage3_Title3.get()); - aAssistentFunc.InsertControl(3, m_xPage3_SldSound.get()); - aAssistentFunc.InsertControl(3, m_xPage3_HiddenSlides.get()); - - // Page 4 - m_xPage4 = m_xBuilder->weld_container("page4"); - m_xPage4_Title1 = m_xBuilder->weld_label("infTitlePageLabel"); - m_xPage4_Author_txt = m_xBuilder->weld_label("authorTxtLabel"); - m_xPage4_Author = m_xBuilder->weld_entry("authorEntry"); - m_xPage4_Email_txt = m_xBuilder->weld_label("emailTxtLabel"); - m_xPage4_Email = m_xBuilder->weld_entry("emailEntry"); - m_xPage4_WWW_txt = m_xBuilder->weld_label("wwwTxtLabel"); - m_xPage4_WWW = m_xBuilder->weld_entry("wwwEntry"); - m_xPage4_Title2 = m_xBuilder->weld_label("addInformLabel"); - m_xPage4_Download = m_xBuilder->weld_check_button("downloadCheckbutton"); - aAssistentFunc.InsertControl(4, m_xPage4.get()); - aAssistentFunc.InsertControl(4, m_xPage4_Title1.get()); - aAssistentFunc.InsertControl(4, m_xPage4_Author_txt.get()); - aAssistentFunc.InsertControl(4, m_xPage4_Author.get()); - aAssistentFunc.InsertControl(4, m_xPage4_Email_txt.get()); - aAssistentFunc.InsertControl(4, m_xPage4_Email.get()); - aAssistentFunc.InsertControl(4, m_xPage4_WWW_txt.get()); - aAssistentFunc.InsertControl(4, m_xPage4_WWW.get()); - aAssistentFunc.InsertControl(4, m_xPage4_Title2.get()); - aAssistentFunc.InsertControl(4, m_xPage4_Misc.get()); - if(m_bImpress) - aAssistentFunc.InsertControl(4, m_xPage4_Download.get()); - - // Page 5 - m_xPage5 = m_xBuilder->weld_container("page5"); - m_xPage5_Title = m_xBuilder->weld_label("buttonStyleLabel"); - m_xPage5_TextOnly = m_xBuilder->weld_check_button("textOnlyCheckbutton"); - m_xPage5_Buttons.reset(new ValueSet(m_xBuilder->weld_scrolled_window("buttonsDrawingareawin", true))); - m_xPage5_ButtonsWnd.reset(new weld::CustomWeld(*m_xBuilder, "buttonsDrawingarea", *m_xPage5_Buttons)); - aAssistentFunc.InsertControl(5, m_xPage5.get()); - aAssistentFunc.InsertControl(5, m_xPage5_Title.get()); - aAssistentFunc.InsertControl(5, m_xPage5_TextOnly.get()); - aAssistentFunc.InsertControl(5, m_xPage5_Buttons->GetDrawingArea()); - - // Page 6 - m_xPage6 = m_xBuilder->weld_container("page6"); - m_xPage6_Title = m_xBuilder->weld_label("selectColorLabel"); - m_xPage6_Default = m_xBuilder->weld_radio_button("defaultRadiobutton"); - m_xPage6_User = m_xBuilder->weld_radio_button("userRadiobutton"); - m_xPage6_Back = m_xBuilder->weld_button("backButton"); - m_xPage6_Text = m_xBuilder->weld_button("textButton"); - m_xPage6_Link = m_xBuilder->weld_button("linkButton"); - m_xPage6_VLink = m_xBuilder->weld_button("vLinkButton"); - m_xPage6_ALink = m_xBuilder->weld_button("aLinkButton"); - m_xPage6_DocColors = m_xBuilder->weld_radio_button("docColorsRadiobutton"); - m_xPage6_Preview.reset(new SdHtmlAttrPreview); - m_xPage6_PreviewWnd.reset(new weld::CustomWeld(*m_xBuilder, "previewDrawingarea", *m_xPage6_Preview)); - aAssistentFunc.InsertControl(6, m_xPage6.get()); - aAssistentFunc.InsertControl(6, m_xPage6_Title.get()); - aAssistentFunc.InsertControl(6, m_xPage6_DocColors.get()); - aAssistentFunc.InsertControl(6, m_xPage6_Default.get()); - aAssistentFunc.InsertControl(6, m_xPage6_User.get()); - aAssistentFunc.InsertControl(6, m_xPage6_Text.get()); - aAssistentFunc.InsertControl(6, m_xPage6_Link.get()); - aAssistentFunc.InsertControl(6, m_xPage6_ALink.get()); - aAssistentFunc.InsertControl(6, m_xPage6_VLink.get()); - aAssistentFunc.InsertControl(6, m_xPage6_Back.get()); - aAssistentFunc.InsertControl(6, m_xPage6_Preview->GetDrawingArea()); -} - -// Initialize dialog with default-values -void SdPublishingDlg::SetDefaults() -{ - SdPublishingDesign aDefault; - SetDesign(&aDefault); - - m_xPage1_NewDesign->set_active(true); - m_xPage1_OldDesign->set_active(false); - UpdatePage(); -} - -// Feed the SfxItemSet with the settings of the dialog -void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) -{ - std::vector< PropertyValue > aProps; - - PropertyValue aValue; - - // Page 2 - aValue.Name = "PublishMode"; - - HtmlPublishMode ePublishMode; - if (m_xPage2_Frames->get_active()) - ePublishMode = PUBLISH_FRAMES; - else if (m_xPage2_SingleDocument->get_active()) - ePublishMode = PUBLISH_SINGLE_DOCUMENT; - else if (m_xPage2_Kiosk->get_active()) - ePublishMode = PUBLISH_KIOSK; - else if (m_xPage2_WebCast->get_active()) - ePublishMode = PUBLISH_WEBCAST; - else - ePublishMode = PUBLISH_HTML; - - aValue.Value <<= static_cast(ePublishMode); - aProps.push_back( aValue ); - - aValue.Name = "IsExportContentsPage"; - aValue.Value <<= m_xPage2_Content->get_active(); - aProps.push_back( aValue ); - - if(m_bImpress) - { - aValue.Name = "IsExportNotes"; - aValue.Value <<= m_xPage2_Notes->get_active(); - aProps.push_back( aValue ); - } - - if( m_xPage2_WebCast->get_active() ) - { - aValue.Name = "WebCastScriptLanguage"; - if( m_xPage2_ASP->get_active() ) - aValue.Value <<= OUString( "asp" ); - else - aValue.Value <<= OUString( "perl" ); - aProps.push_back( aValue ); - - aValue.Name = "WebCastCGIURL"; - aValue.Value <<= m_xPage2_CGI->get_text(); - aProps.push_back( aValue ); - - aValue.Name = "WebCastTargetURL"; - aValue.Value <<= m_xPage2_URL->get_text(); - aProps.push_back( aValue ); - } - aValue.Name = "IndexURL"; - aValue.Value <<= m_xPage2_Index->get_text(); - aProps.push_back( aValue ); - - if( m_xPage2_Kiosk->get_active() && m_xPage2_ChgAuto->get_active() ) - { - aValue.Name = "KioskSlideDuration"; - aValue.Value <<= static_cast(m_xFormatter->GetTime().GetMSFromTime()) / 1000; - aProps.push_back( aValue ); - - aValue.Name = "KioskEndless"; - aValue.Value <<= m_xPage2_Endless->get_active(); - aProps.push_back( aValue ); - } - - // Page 3 - - aValue.Name = "Width"; - sal_Int32 nTmpWidth = PUB_LOWRES_WIDTH; - if( m_xPage3_Resolution_2->get_active() ) - nTmpWidth = PUB_MEDRES_WIDTH; - else if( m_xPage3_Resolution_3->get_active() ) - nTmpWidth = PUB_HIGHRES_WIDTH; - else if (m_xPage3_Resolution_4->get_active()) - nTmpWidth = PUB_FHDRES_WIDTH; - - aValue.Value <<= nTmpWidth; - aProps.push_back( aValue ); - - aValue.Name = "Compression"; - aValue.Value <<= m_xPage3_Quality->get_active_text(); - aProps.push_back( aValue ); - - aValue.Name = "Format"; - sal_Int32 nFormat; - if( m_xPage3_Png->get_active() ) - nFormat = static_cast(FORMAT_PNG); - else if( m_xPage3_Gif->get_active() ) - nFormat = static_cast(FORMAT_GIF); - else - nFormat = static_cast(FORMAT_JPG); - aValue.Value <<= nFormat; - aProps.push_back( aValue ); - - aValue.Name = "SlideSound"; - aValue.Value <<= m_xPage3_SldSound->get_active(); - aProps.push_back( aValue ); - - aValue.Name = "HiddenSlides"; - aValue.Value <<= m_xPage3_HiddenSlides->get_active(); - aProps.push_back( aValue ); - - // Page 4 - aValue.Name = "Author"; - aValue.Value <<= m_xPage4_Author->get_text(); - aProps.push_back( aValue ); - - aValue.Name = "EMail"; - aValue.Value <<= m_xPage4_Email->get_text(); - aProps.push_back( aValue ); - - // try to guess protocol for user's homepage - INetURLObject aHomeURL( m_xPage4_WWW->get_text(), - INetProtocol::Http, // default proto is HTTP - INetURLObject::EncodeMechanism::All ); - - aValue.Name = "HomepageURL"; - aValue.Value <<= aHomeURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); - aProps.push_back( aValue ); - - aValue.Name = "UserText"; - aValue.Value <<= m_xPage4_Misc->get_text(); - aProps.push_back( aValue ); - - if( m_bImpress ) - { - aValue.Name = "EnableDownload"; - aValue.Value <<= m_xPage4_Download->get_active(); - aProps.push_back( aValue ); - } - - // Page 5 - if( !m_xPage5_TextOnly->get_active() ) - { - aValue.Name = "UseButtonSet"; - aValue.Value <<= static_cast(m_xPage5_Buttons->GetSelectedItemId() - 1); - aProps.push_back( aValue ); - } - - // Page 6 - if( m_xPage6_User->get_active() ) - { - aValue.Name = "BackColor"; - aValue.Value <<= m_aBackColor; - aProps.push_back( aValue ); - - aValue.Name = "TextColor"; - aValue.Value <<= m_aTextColor; - aProps.push_back( aValue ); - - aValue.Name = "LinkColor"; - aValue.Value <<= m_aLinkColor; - aProps.push_back( aValue ); - - aValue.Name = "VLinkColor"; - aValue.Value <<= m_aVLinkColor; - aProps.push_back( aValue ); - - aValue.Name = "ALinkColor"; - aValue.Value <<= m_aALinkColor; - aProps.push_back( aValue ); - } - - if( m_xPage6_DocColors->get_active() ) - { - aValue.Name = "IsUseDocumentColors"; - aValue.Value <<= true; - aProps.push_back( aValue ); - } - - rParams = comphelper::containerToSequence(aProps); -} - -// Clickhandler for the radiobuttons of the design-selection -IMPL_LINK( SdPublishingDlg, DesignHdl, weld::Toggleable&, rButton, void ) -{ - if (!rButton.get_active()) - return; - - if (m_xPage1_NewDesign->get_active()) - { - m_xPage1_NewDesign->set_active(true); // because of DesignDeleteHdl - m_xPage1_OldDesign->set_active(false); - m_xPage1_Designs->set_sensitive(false); - m_xPage1_DelDesign->set_sensitive(false); - m_pDesign = nullptr; - - SdPublishingDesign aDefault; - SetDesign(&aDefault); - } - else - { - m_xPage1_NewDesign->set_active(false); - m_xPage1_Designs->set_sensitive(true); - m_xPage1_DelDesign->set_sensitive(true); - - if (m_xPage1_Designs->get_selected_index() == -1) - m_xPage1_Designs->select(0); - - const sal_Int32 nPos = m_xPage1_Designs->get_selected_index(); - m_pDesign = &m_aDesignList[nPos]; - DBG_ASSERT(m_pDesign, "No Design? That's not allowed (CL)"); - - if(m_pDesign) - SetDesign(m_pDesign); - } -} - -// Clickhandler for the choice of one design -IMPL_LINK_NOARG(SdPublishingDlg, DesignSelectHdl, weld::TreeView&, void) -{ - const sal_Int32 nPos = m_xPage1_Designs->get_selected_index(); - m_pDesign = &m_aDesignList[nPos]; - DBG_ASSERT(m_pDesign, "No Design? That's not allowed (CL)"); - - if(m_pDesign) - SetDesign(m_pDesign); - - UpdatePage(); -} - -// Clickhandler for the delete of one design -IMPL_LINK_NOARG(SdPublishingDlg, DesignDeleteHdl, weld::Button&, void) -{ - const sal_Int32 nPos = m_xPage1_Designs->get_selected_index(); - - std::vector::iterator iter = m_aDesignList.begin()+nPos; - - DBG_ASSERT(iter != m_aDesignList.end(), "No Design? That's not allowed (CL)"); - - m_xPage1_Designs->remove(nPos); - - if(m_pDesign == &(*iter)) - DesignHdl(*m_xPage1_NewDesign); - - m_aDesignList.erase(iter); - - m_bDesignListDirty = true; - - UpdatePage(); -} - -// Clickhandler for the other servertypes -IMPL_LINK(SdPublishingDlg, WebServerHdl, weld::Toggleable&, rButton, void) -{ - if (!rButton.get_active()) - return; - - bool bASP = m_xPage2_ASP->get_active(); - m_xPage2_ASP->set_sensitive( bASP ); - m_xPage2_PERL->set_sensitive( !bASP ); - UpdatePage(); -} - -// Clickhandler for the Radiobuttons of the graphicformat choice -IMPL_LINK(SdPublishingDlg, GfxFormatHdl, weld::Toggleable&, rButton, void) -{ - if (!rButton.get_active()) - return; - - m_xPage3_Png->set_sensitive(m_xPage3_Png->get_active()); - m_xPage3_Gif->set_sensitive(m_xPage3_Gif->get_active()); - m_xPage3_Jpg->set_sensitive(m_xPage3_Jpg->get_active()); - m_xPage3_Quality->set_sensitive(m_xPage3_Jpg->get_active()); -} - -// Clickhandler for the Radiobuttons Standard/Frames -IMPL_LINK(SdPublishingDlg, BaseHdl, weld::Toggleable&, rButton, void) -{ - if (!rButton.get_active()) - return; - - UpdatePage(); -} - -// Clickhandler for the Checkbox of the Title page -IMPL_LINK_NOARG(SdPublishingDlg, ContentHdl, weld::Toggleable&, void) -{ - if(m_xPage2_Content->get_active()) - { - if(!aAssistentFunc.IsEnabled(4)) - { - aAssistentFunc.EnablePage(4); - UpdatePage(); - } - } - else - { - if(aAssistentFunc.IsEnabled(4)) - { - aAssistentFunc.DisablePage(4); - UpdatePage(); - } - } -} - -// Clickhandler for the Resolution Radiobuttons -IMPL_LINK( SdPublishingDlg, ResolutionHdl, weld::Toggleable&, rButton, void ) -{ - if (!rButton.get_active()) - return; - m_xPage3_Resolution_1->set_sensitive(m_xPage3_Resolution_1->get_active()); - m_xPage3_Resolution_2->set_sensitive(m_xPage3_Resolution_2->get_active()); - m_xPage3_Resolution_3->set_sensitive(m_xPage3_Resolution_3->get_active()); - m_xPage3_Resolution_4->set_sensitive(m_xPage3_Resolution_4->get_active()); -} - -// Clickhandler for the ValueSet with the bitmap-buttons -IMPL_LINK_NOARG(SdPublishingDlg, ButtonsHdl, ValueSet*, void) -{ - // if one bitmap-button is chosen, then disable TextOnly - m_xPage5_TextOnly->set_active(false); -} - -// Fill the SfxItemSet with the settings of the dialog -IMPL_LINK( SdPublishingDlg, ColorHdl, weld::Button&, rButton, void) -{ - SvColorDialog aDlg; - - if (&rButton == m_xPage6_Back.get()) - { - aDlg.SetColor( m_aBackColor ); - if(aDlg.Execute(m_xDialog.get()) == RET_OK ) - m_aBackColor = aDlg.GetColor(); - } - else if (&rButton == m_xPage6_Text.get()) - { - aDlg.SetColor( m_aTextColor ); - if(aDlg.Execute(m_xDialog.get()) == RET_OK ) - m_aTextColor = aDlg.GetColor(); - } - else if (&rButton == m_xPage6_Link.get()) - { - aDlg.SetColor( m_aLinkColor ); - if(aDlg.Execute(m_xDialog.get()) == RET_OK ) - m_aLinkColor = aDlg.GetColor(); - } - else if (&rButton == m_xPage6_VLink.get()) - { - aDlg.SetColor( m_aVLinkColor ); - if(aDlg.Execute(m_xDialog.get()) == RET_OK ) - m_aVLinkColor = aDlg.GetColor(); - } - else if (&rButton == m_xPage6_ALink.get()) - { - aDlg.SetColor( m_aALinkColor ); - if(aDlg.Execute(m_xDialog.get()) == RET_OK ) - m_aALinkColor = aDlg.GetColor(); - } - - m_xPage6_User->set_active(true); - m_xPage6_Preview->SetColors( m_aBackColor, m_aTextColor, m_aLinkColor, - m_aVLinkColor, m_aALinkColor ); - m_xPage6_Preview->Invalidate(); -} - -IMPL_LINK(SdPublishingDlg, SlideChgHdl, weld::Toggleable&, rButton, void) -{ - if (!rButton.get_active()) - return; - UpdatePage(); -} - -// Clickhandler for the Ok Button -IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl, weld::Button&, void) -{ - //End - SdPublishingDesign aDesign; - GetDesign(&aDesign); - - bool bSave = false; - - if(m_xPage1_OldDesign->get_active() && m_pDesign) - { - // are there changes? - if(!(aDesign == *m_pDesign)) - bSave = true; - } - else - { - SdPublishingDesign aDefaultDesign; - if(!(aDefaultDesign == aDesign)) - bSave = true; - } - - if(bSave) - { - OUString aName; - if(m_pDesign) - aName = m_pDesign->m_aDesignName; - - bool bRetry; - do - { - bRetry = false; - - SdDesignNameDlg aDlg(m_xDialog.get(), aName); - - if (aDlg.run() == RET_OK) - { - aDesign.m_aDesignName = aDlg.GetDesignName(); - - auto iter = std::find_if(m_aDesignList.begin(), m_aDesignList.end(), - [&aDesign](const SdPublishingDesign& rDesign) { return rDesign.m_aDesignName == aDesign.m_aDesignName; }); - - if (iter != m_aDesignList.end()) - { - std::unique_ptr xErrorBox(Application::CreateMessageDialog(m_xDialog.get(), - VclMessageType::Error, VclButtonsType::YesNo, - SdResId(STR_PUBDLG_SAMENAME))); - bRetry = xErrorBox->run() == RET_NO; - - if(!bRetry) - m_aDesignList.erase(iter); - } - - if(!bRetry) - { - m_aDesignList.push_back(aDesign); - m_bDesignListDirty = true; - } - } - } - while(bRetry); - } - - if(m_bDesignListDirty) - Save(); - - m_xDialog->response(RET_OK); -} - -// Refresh the dialogs when changing from pages -void SdPublishingDlg::ChangePage() -{ - int nPage = aAssistentFunc.GetCurrentPage(); - m_xDialog->set_help_id(aPageHelpIds[nPage-1]); - - UpdatePage(); - - if (m_xNextPageButton->get_sensitive()) - m_xNextPageButton->grab_focus(); - else - m_xFinishButton->grab_focus(); -} - -void SdPublishingDlg::UpdatePage() -{ - m_xNextPageButton->set_sensitive(!aAssistentFunc.IsLastPage()); - m_xLastPageButton->set_sensitive(!aAssistentFunc.IsFirstPage()); - - int nPage = aAssistentFunc.GetCurrentPage(); - - switch( nPage ) - { - case 1: - if(m_xPage1_NewDesign->get_active()) - { - m_xPage1_Designs->set_sensitive(false); - m_xPage1_DelDesign->set_sensitive(false); - } - - if(m_aDesignList.empty()) - m_xPage1_OldDesign->set_sensitive(false); - break; - case 2: - m_xPage2_Frames_FB->set_visible(m_xPage2_Frames->get_active()); - m_xPage2_Standard_FB->set_visible(m_xPage2_Standard->get_active()); - m_xPage2_Kiosk_FB->set_visible(m_xPage2_Kiosk->get_active()); - m_xPage2_WebCast_FB->set_visible(m_xPage2_WebCast->get_active()); - - if( m_xPage2_WebCast->get_active() ) - { - m_xPage2Frame4->show(); - m_xPage2_Title_WebCast->show(); - m_xPage2_ASP->show(); - m_xPage2_PERL->show(); - m_xPage2_URL_txt->show(); - m_xPage2_URL->show(); - m_xPage2_CGI_txt->show(); - m_xPage2_CGI->show(); - m_xPage2_Index_txt->show(); - m_xPage2_Index->show(); - - bool bPerl = m_xPage2_PERL->get_active(); - m_xPage2_Index->set_sensitive(bPerl); - m_xPage2_Index_txt->set_sensitive(bPerl); - m_xPage2_URL_txt->set_sensitive(bPerl); - m_xPage2_URL->set_sensitive(bPerl); - m_xPage2_CGI_txt->set_sensitive(bPerl); - m_xPage2_CGI->set_sensitive(bPerl); - } - else - { - m_xPage2Frame4->hide(); - m_xPage2_Title_WebCast->hide(); - m_xPage2_ASP->hide(); - m_xPage2_PERL->hide(); - m_xPage2_URL_txt->hide(); - m_xPage2_URL->hide(); - m_xPage2_CGI_txt->hide(); - m_xPage2_CGI->hide(); - m_xPage2_Index->hide(); - m_xPage2_Index_txt->hide(); - } - - if( m_xPage2_Kiosk->get_active() ) - { - m_xPage2Frame3->show(); - m_xPage2_Title_Kiosk->show(); - m_xPage2_ChgDefault->show(); - m_xPage2_ChgAuto->show(); - m_xPage2_Duration_txt->show(); - m_xPage2_Duration->show(); - m_xPage2_Endless->show(); - bool bAuto = m_xPage2_ChgAuto->get_active(); - m_xPage2_Duration->set_sensitive(bAuto); - m_xPage2_Endless->set_sensitive(bAuto); - } - else - { - m_xPage2Frame3->hide(); - m_xPage2_Title_Kiosk->hide(); - m_xPage2_ChgDefault->hide(); - m_xPage2_ChgAuto->hide(); - m_xPage2_Duration->hide(); - m_xPage2_Duration_txt->hide(); - m_xPage2_Endless->hide(); - } - - if( m_xPage2_Standard->get_active() || m_xPage2_Frames->get_active() ) - { - m_xPage2Frame2->show(); - m_xPage2_Title_Html->show(); - m_xPage2_Content->show(); - if(m_bImpress) - m_xPage2_Notes->show(); - } - else - { - m_xPage2Frame2->hide(); - m_xPage2_Title_Html->hide(); - m_xPage2_Content->hide(); - if(m_bImpress) - m_xPage2_Notes->hide(); - } - break; - case 3: - if( m_xPage2_Kiosk->get_active() || m_xPage2_WebCast->get_active() ) - m_xNextPageButton->set_sensitive(false); - - if( m_xPage2_WebCast->get_active() ) - m_xPage3_SldSound->set_sensitive(false); - - m_xPage3_Quality->set_sensitive(m_xPage3_Jpg->get_active()); - - break; - case 5: - if( m_bButtonsDirty ) - LoadPreviewButtons(); - break; - } -} - -/** loads the html buttons from the button sets, creates a preview and fills the - itemset for page 5 - */ -void SdPublishingDlg::LoadPreviewButtons() -{ - if (!m_xButtonSet) - return; - - const int nButtonCount = 8; - static const char *pButtonNames[nButtonCount] = - { - "first.png", - "left.png", - "right.png", - "last.png", - "home.png", - "text.png", - "expand.png", - "collapse.png", - }; - - std::vector< OUString > aButtonNames; - for(const char * p : pButtonNames) - aButtonNames.push_back( OUString::createFromAscii( p ) ); - - int nSetCount = m_xButtonSet->getCount(); - - int nHeight = 32; - Image aImage; - for( int nSet = 0; nSet < nSetCount; ++nSet ) - { - if( m_xButtonSet->getPreview( nSet, aButtonNames, aImage ) ) - { - m_xPage5_Buttons->InsertItem( static_cast(nSet)+1, aImage ); - if( nHeight < aImage.GetSizePixel().Height() ) - nHeight = aImage.GetSizePixel().Height(); - } - } - - m_xPage5_Buttons->SetItemHeight( nHeight ); - m_bButtonsDirty = false; -} - -// Clickhandler for the Forward Button -IMPL_LINK_NOARG(SdPublishingDlg, NextPageHdl, weld::Button&, void) -{ - aAssistentFunc.NextPage(); - ChangePage(); -} - -// Sets the Controls in the dialog to the settings in the design -void SdPublishingDlg::SetDesign( SdPublishingDesign const * pDesign ) -{ - if(!pDesign) - return; - - m_xPage2_Standard->set_sensitive(pDesign->m_eMode == PUBLISH_HTML); - m_xPage2_Frames->set_sensitive(pDesign->m_eMode == PUBLISH_FRAMES); - m_xPage2_Kiosk->set_sensitive(pDesign->m_eMode == PUBLISH_KIOSK ); - m_xPage2_WebCast->set_sensitive(pDesign->m_eMode == PUBLISH_WEBCAST ); - - m_xPage2_Content->set_sensitive(pDesign->m_bContentPage); - if(pDesign->m_bContentPage) - aAssistentFunc.EnablePage(4); - else - aAssistentFunc.DisablePage(4); - - if(m_bImpress) - m_xPage2_Notes->set_sensitive(pDesign->m_bNotes); - - m_xPage2_ASP->set_sensitive(pDesign->m_eScript == SCRIPT_ASP); - m_xPage2_PERL->set_sensitive(pDesign->m_eScript == SCRIPT_PERL); - m_xPage2_CGI->set_text(pDesign->m_aCGI); - m_xPage2_URL->set_text(pDesign->m_aURL); - - m_xPage2_ChgDefault->set_sensitive( !pDesign->m_bAutoSlide ); - m_xPage2_ChgAuto->set_sensitive( pDesign->m_bAutoSlide ); - - tools::Time aTime( tools::Time::EMPTY ); - aTime.MakeTimeFromMS( pDesign->m_nSlideDuration * 1000 ); - m_xFormatter->SetTime(aTime); - - m_xPage2_Endless->set_sensitive( pDesign->m_bEndless ); - - m_xPage3_Png->set_sensitive(pDesign->m_eFormat == FORMAT_PNG); - m_xPage3_Gif->set_sensitive(pDesign->m_eFormat == FORMAT_GIF); - m_xPage3_Jpg->set_sensitive(pDesign->m_eFormat == FORMAT_JPG); - m_xPage3_Quality->set_sensitive(pDesign->m_eFormat == FORMAT_JPG); - - m_xPage3_Quality->set_entry_text(pDesign->m_aCompression); - m_xPage3_Resolution_1->set_sensitive(pDesign->m_nResolution == PUB_LOWRES_WIDTH); - m_xPage3_Resolution_2->set_sensitive(pDesign->m_nResolution == PUB_MEDRES_WIDTH); - m_xPage3_Resolution_3->set_sensitive(pDesign->m_nResolution == PUB_HIGHRES_WIDTH); - m_xPage3_Resolution_4->set_sensitive(pDesign->m_nResolution == PUB_FHDRES_WIDTH); - - m_xPage3_SldSound->set_sensitive( pDesign->m_bSlideSound ); - m_xPage3_HiddenSlides->set_sensitive( pDesign->m_bHiddenSlides ); - - m_xPage4_Author->set_text(pDesign->m_aAuthor); - m_xPage4_Email->set_text(pDesign->m_aEMail); - m_xPage4_WWW->set_text(pDesign->m_aWWW); - m_xPage4_Misc->set_text(pDesign->m_aMisc); - if(m_bImpress) - m_xPage4_Download->set_sensitive(pDesign->m_bDownload); - - m_xPage5_TextOnly->set_sensitive(pDesign->m_nButtonThema == -1); - if(pDesign->m_nButtonThema != -1) - { - if(m_bButtonsDirty) - LoadPreviewButtons(); - m_xPage5_Buttons->SelectItem(pDesign->m_nButtonThema + 1); - } - else - m_xPage5_Buttons->SetNoSelection(); - - m_xPage6_User->set_sensitive(pDesign->m_bUserAttr); - m_aBackColor = pDesign->m_aBackColor; - m_aTextColor = pDesign->m_aTextColor; - m_aLinkColor = pDesign->m_aLinkColor; - m_aVLinkColor = pDesign->m_aVLinkColor; - m_aALinkColor = pDesign->m_aALinkColor; - - m_xPage6_DocColors->set_sensitive(pDesign->m_bUseColor); - - m_xPage6_Preview->SetColors( m_aBackColor, m_aTextColor, m_aLinkColor, - m_aVLinkColor, m_aALinkColor ); - m_xPage6_Preview->Invalidate(); - - UpdatePage(); -} - -// Transfer the status of the Design Dialog Controls -void SdPublishingDlg::GetDesign( SdPublishingDesign* pDesign ) -{ - if(!pDesign) - return; - - pDesign->m_eMode = m_xPage2_Standard->get_active()?PUBLISH_HTML: - m_xPage2_Frames->get_active()?PUBLISH_FRAMES: - m_xPage2_Kiosk->get_active()?PUBLISH_KIOSK: - PUBLISH_WEBCAST; - - pDesign->m_bContentPage = m_xPage2_Content->get_active(); - if(m_bImpress) - pDesign->m_bNotes = m_xPage2_Notes->get_active(); - - if( m_xPage3_Gif->get_active() ) - pDesign->m_eFormat = FORMAT_GIF; - else if( m_xPage3_Jpg->get_active() ) - pDesign->m_eFormat = FORMAT_JPG; - else - pDesign->m_eFormat = FORMAT_PNG; - - pDesign->m_aCompression = m_xPage3_Quality->get_active_text(); - - if (m_xPage3_Resolution_1->get_active()) - pDesign->m_nResolution = PUB_LOWRES_WIDTH; - else if (m_xPage3_Resolution_2->get_active()) - pDesign->m_nResolution = PUB_MEDRES_WIDTH; - else if (m_xPage3_Resolution_3->get_active()) - pDesign->m_nResolution = PUB_HIGHRES_WIDTH; - else - pDesign->m_nResolution = PUB_FHDRES_WIDTH; - - pDesign->m_bSlideSound = m_xPage3_SldSound->get_active(); - pDesign->m_bHiddenSlides = m_xPage3_HiddenSlides->get_active(); - - pDesign->m_aAuthor = m_xPage4_Author->get_text(); - pDesign->m_aEMail = m_xPage4_Email->get_text(); - pDesign->m_aWWW = m_xPage4_WWW->get_text(); - pDesign->m_aMisc = m_xPage4_Misc->get_text(); - pDesign->m_bDownload = m_bImpress && m_xPage4_Download->get_active(); - - if(m_xPage5_TextOnly->get_active()) - pDesign->m_nButtonThema = -1; - else - pDesign->m_nButtonThema = m_xPage5_Buttons->GetSelectedItemId() - 1; - - pDesign->m_bUserAttr = m_xPage6_User->get_active(); - pDesign->m_aBackColor = m_aBackColor; - pDesign->m_aTextColor = m_aTextColor; - pDesign->m_aLinkColor = m_aLinkColor; - pDesign->m_aVLinkColor = m_aVLinkColor; - pDesign->m_aALinkColor = m_aALinkColor; - pDesign->m_bUseColor = m_xPage6_DocColors->get_active(); - - pDesign->m_eScript = m_xPage2_ASP->get_active()?SCRIPT_ASP:SCRIPT_PERL; - pDesign->m_aCGI = m_xPage2_CGI->get_text(); - pDesign->m_aURL = m_xPage2_URL->get_text(); - - pDesign->m_bAutoSlide = m_xPage2_ChgAuto->get_active(); - pDesign->m_nSlideDuration = static_cast(m_xFormatter->GetTime().GetMSFromTime()) / 1000; - pDesign->m_bEndless = m_xPage2_Endless->get_active(); -} - -// Clickhandler for the back Button -IMPL_LINK_NOARG(SdPublishingDlg, LastPageHdl, weld::Button&, void) -{ - aAssistentFunc.PreviousPage(); - ChangePage(); -} - -// Load Designs -void SdPublishingDlg::Load() -{ - m_bDesignListDirty = false; - - INetURLObject aURL( SvtPathOptions().GetUserConfigPath() ); - aURL.Append( u"designs.sod" ); - - // check if file exists, SfxMedium shows an errorbox else - { - std::unique_ptr pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ); - - bool bOk = pIStm && ( pIStm->GetError() == ERRCODE_NONE); - - if( !bOk ) - return; - } - - SfxMedium aMedium( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ | StreamMode::NOCREATE ); - - SvStream* pStream = aMedium.GetInStream(); - - if( !pStream ) - return; - - sal_uInt16 aCheck; - pStream->ReadUInt16( aCheck ); - - if(aCheck != nMagic) - return; - - SdIOCompat aIO(*pStream, StreamMode::READ); - - sal_uInt16 nDesigns(0); - pStream->ReadUInt16(nDesigns); - - // there has to at least be a sal_uInt16 header in each design - const size_t nMaxRecords = pStream->remainingSize() / sizeof(sal_uInt16); - if (nDesigns > nMaxRecords) - { - SAL_WARN("sd", "Parsing error: " << nMaxRecords << - " max possible entries, but " << nDesigns << " claimed, truncating"); - nDesigns = nMaxRecords; - } - - for( sal_uInt16 nIndex = 0; - pStream->GetError() == ERRCODE_NONE && nIndex < nDesigns; - nIndex++ ) - { - SdPublishingDesign aDesign; - *pStream >> aDesign; - - m_aDesignList.push_back(aDesign); - } -} - -// Save Designs -bool SdPublishingDlg::Save() -{ - INetURLObject aURL( SvtPathOptions().GetUserConfigPath() ); - aURL.Append( u"designs.sod" ); - SfxMedium aMedium( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE | StreamMode::TRUNC ); - - SvStream* pStream = aMedium.GetOutStream(); - - if( !pStream ) - return false; - - pStream->WriteUInt16( nMagic ); - - // Destroys the SdIOCompat before the Stream is being distributed - { - SdIOCompat aIO(*pStream, StreamMode::WRITE, 0); - - sal_uInt16 nDesigns = static_cast(m_aDesignList.size()); - pStream->WriteUInt16( nDesigns ); - - for( sal_uInt16 nIndex = 0; - pStream->GetError() == ERRCODE_NONE && nIndex < nDesigns; - nIndex++ ) - WriteSdPublishingDesign( *pStream, m_aDesignList[nIndex] ); - } - - aMedium.Close(); - aMedium.Commit(); - - return( aMedium.GetError() == ERRCODE_NONE ); } // SdDesignNameDlg Methods @@ -1521,15 +305,12 @@ SdDesignNameDlg::SdDesignNameDlg(weld::Window* pWindow, const OUString& rName) , m_xEdit(m_xBuilder->weld_entry("entry")) , m_xBtnOK(m_xBuilder->weld_button("ok")) { - m_xEdit->connect_changed(LINK(this, SdDesignNameDlg, ModifyHdl )); + m_xEdit->connect_changed(LINK(this, SdDesignNameDlg, ModifyHdl)); m_xEdit->set_text(rName); m_xBtnOK->set_sensitive(!rName.isEmpty()); } -OUString SdDesignNameDlg::GetDesignName() const -{ - return m_xEdit->get_text(); -} +OUString SdDesignNameDlg::GetDesignName() const { return m_xEdit->get_text(); } IMPL_LINK_NOARG(SdDesignNameDlg, ModifyHdl, weld::Entry&, void) { diff --git a/sd/source/filter/html/sdhtmlfilter.cxx b/sd/source/filter/html/sdhtmlfilter.cxx deleted file mode 100644 index a86b1ad29051..000000000000 --- a/sd/source/filter/html/sdhtmlfilter.cxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -#include -#include - -#include "htmlex.hxx" -#include - -SdHTMLFilter::SdHTMLFilter(SfxMedium& rMedium, ::sd::DrawDocShell& rDocShell) - : SdFilter(rMedium, rDocShell) -{ -} - -SdHTMLFilter::~SdHTMLFilter() {} - -bool SdHTMLFilter::Export() -{ - mrMedium.Close(); - mrMedium.Commit(); - - css::uno::Sequence aParams; - - if (const SfxUnoAnyItem* pItem = mrMedium.GetItemSet().GetItemIfSet(SID_FILTER_DATA, false)) - pItem->GetValue() >>= aParams; - - HtmlExport aExport(mrMedium.GetName(), aParams, &mrDocument, &mrDocShell); - - return true; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index 614e95929139..381217151132 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include "PhotoAlbumDialog.hxx" @@ -146,11 +145,6 @@ short AbstractSdVectorizeDlg_Impl::Execute() return m_xDlg->run(); } -short AbstractSdPublishingDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - short AbstractHeaderFooterDialog_Impl::Execute() { return m_xDlg->run(); @@ -568,22 +562,6 @@ OUString AbstractSdVectorizeDlg_Impl::GetScreenshotId() const return m_xDlg->get_help_id(); } -void AbstractSdPublishingDlg_Impl::GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams ) -{ - m_xDlg->GetParameterSequence( rParams ); -} - -BitmapEx AbstractSdPublishingDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractSdPublishingDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - //-------------- SdAbstractDialogFactory implementation-------------- VclPtr SdAbstractDialogFactory_Impl::CreateSvxBulletAndPositionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) @@ -694,11 +672,6 @@ VclPtr SdAbstractDialogFactory_Impl::CreateSdVectorizeD return VclPtr::Create(std::make_unique(pParent, rBmp, pDocShell)); } -VclPtr SdAbstractDialogFactory_Impl::CreateSdPublishingDlg(weld::Window* pParent, DocumentType eDocType) -{ - return VclPtr::Create(std::make_unique(pParent, eDocType)); -} - // Factories for TabPages CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsContentsTabPageCreatorFunc() { diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 23cac7e857db..8edfd2c70934 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -364,23 +363,6 @@ public: virtual OUString GetScreenshotId() const override; }; -class AbstractSdPublishingDlg_Impl :public AbstractSdPublishingDlg -{ -private: - std::unique_ptr m_xDlg; -public: - AbstractSdPublishingDlg_Impl(std::unique_ptr pDlg) - : m_xDlg(std::move(pDlg)) - { - } - virtual short Execute() override; - virtual void GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams ) override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - class AbstractHeaderFooterDialog_Impl :public AbstractHeaderFooterDialog { private: @@ -426,7 +408,6 @@ public: virtual VclPtr CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override; virtual VclPtr CreatSdActionDialog(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override; virtual VclPtr CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) override; - virtual VclPtr CreateSdPublishingDlg(weld::Window* pWindow, DocumentType eDocType) override; virtual VclPtr CreateSdPhotoAlbumDialog(weld::Window* pWindow, SdDrawDocument* pDoc) override; diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 6b9d8993ada9..57a9be9393d8 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -70,7 +70,6 @@ #include #include #include -#include #include #include #include @@ -602,11 +601,7 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium ) const OUString aTypeName( pMediumFilter->GetTypeName() ); std::unique_ptr xFilter; - if( aTypeName.indexOf( "graphic_HTML" ) >= 0 ) - { - xFilter = std::make_unique(rMedium, *this); - } - else if( aTypeName.indexOf( "MS_PowerPoint_97" ) >= 0 ) + if( aTypeName.indexOf( "MS_PowerPoint_97" ) >= 0 ) { xFilter = std::make_unique(rMedium, *this); static_cast(xFilter.get())->PreSaveBasic(); diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx deleted file mode 100644 index 1f0b7274c668..000000000000 --- a/sd/source/ui/inc/pubdlg.hxx +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include -#include -#include -#include -#include "assclass.hxx" - -#include -#include - -class ListBox; -class Edit; -class SdHtmlAttrPreview; -class SdPublishingDesign; -class ButtonSet; - -namespace com::sun::star::beans -{ -struct PropertyValue; -} -namespace com::sun::star::uno -{ -template class Sequence; -} - -// ********************************************************************* -// Html-Export Autopilot -// ********************************************************************* -// should turn this into a wizard -class SdPublishingDlg final : public weld::GenericDialogController -{ -private: - // page 1 controls - std::unique_ptr m_xPage1; - std::unique_ptr m_xPage1_Title; - std::unique_ptr m_xPage1_NewDesign; - std::unique_ptr m_xPage1_OldDesign; - std::unique_ptr m_xPage1_Designs; - std::unique_ptr m_xPage1_DelDesign; - std::unique_ptr m_xPage1_Desc; - - // page 2 controls - std::unique_ptr m_xPage2; - std::unique_ptr m_xPage2Frame2; - std::unique_ptr m_xPage2Frame3; - std::unique_ptr m_xPage2Frame4; - std::unique_ptr m_xPage2_Title; - std::unique_ptr m_xPage2_Standard; - std::unique_ptr m_xPage2_Frames; - std::unique_ptr m_xPage2_SingleDocument; - std::unique_ptr m_xPage2_Kiosk; - std::unique_ptr m_xPage2_WebCast; - std::unique_ptr m_xPage2_Standard_FB; - std::unique_ptr m_xPage2_Frames_FB; - std::unique_ptr m_xPage2_Kiosk_FB; - std::unique_ptr m_xPage2_WebCast_FB; - - std::unique_ptr m_xPage2_Title_Html; - std::unique_ptr m_xPage2_Content; - std::unique_ptr m_xPage2_Notes; - - std::unique_ptr m_xPage2_Title_WebCast; - std::unique_ptr m_xPage2_ASP; - std::unique_ptr m_xPage2_PERL; - std::unique_ptr m_xPage2_URL_txt; - std::unique_ptr m_xPage2_URL; - std::unique_ptr m_xPage2_CGI_txt; - std::unique_ptr m_xPage2_CGI; - std::unique_ptr m_xPage2_Index_txt; - std::unique_ptr m_xPage2_Index; - std::unique_ptr m_xPage2_Title_Kiosk; - std::unique_ptr m_xPage2_ChgDefault; - std::unique_ptr m_xPage2_ChgAuto; - std::unique_ptr m_xPage2_Duration_txt; - std::unique_ptr m_xPage2_Duration; - std::unique_ptr m_xFormatter; - std::unique_ptr m_xPage2_Endless; - - // page 3 controls - std::unique_ptr m_xPage3; - std::unique_ptr m_xPage3_Title1; - std::unique_ptr m_xPage3_Png; - std::unique_ptr m_xPage3_Gif; - std::unique_ptr m_xPage3_Jpg; - std::unique_ptr m_xPage3_Quality_txt; - std::unique_ptr m_xPage3_Quality; - std::unique_ptr m_xPage3_Title2; - std::unique_ptr m_xPage3_Resolution_1; - std::unique_ptr m_xPage3_Resolution_2; - std::unique_ptr m_xPage3_Resolution_3; - std::unique_ptr m_xPage3_Resolution_4; - std::unique_ptr m_xPage3_Title3; - std::unique_ptr m_xPage3_SldSound; - std::unique_ptr m_xPage3_HiddenSlides; - - // page 4 controls - std::unique_ptr m_xPage4; - std::unique_ptr m_xPage4_Title1; - std::unique_ptr m_xPage4_Author_txt; - std::unique_ptr m_xPage4_Author; - std::unique_ptr m_xPage4_Email_txt; - std::unique_ptr m_xPage4_Email; - std::unique_ptr m_xPage4_WWW_txt; - std::unique_ptr m_xPage4_WWW; - std::unique_ptr m_xPage4_Title2; - std::unique_ptr m_xPage4_Misc; - std::unique_ptr m_xPage4_Download; - - // page 5 controls - std::unique_ptr m_xPage5; - std::unique_ptr m_xPage5_Title; - std::unique_ptr m_xPage5_TextOnly; - std::unique_ptr m_xPage5_Buttons; - std::unique_ptr m_xPage5_ButtonsWnd; - - // page 6 controls - std::unique_ptr m_xPage6; - std::unique_ptr m_xPage6_Title; - std::unique_ptr m_xPage6_Default; - std::unique_ptr m_xPage6_User; - std::unique_ptr m_xPage6_Back; - std::unique_ptr m_xPage6_Text; - std::unique_ptr m_xPage6_Link; - std::unique_ptr m_xPage6_VLink; - std::unique_ptr m_xPage6_ALink; - std::unique_ptr m_xPage6_DocColors; - std::unique_ptr m_xPage6_Preview; - std::unique_ptr m_xPage6_PreviewWnd; - - std::unique_ptr m_xButtonSet; - - // standard controls - std::unique_ptr m_xLastPageButton; - std::unique_ptr m_xNextPageButton; - std::unique_ptr m_xFinishButton; - - Assistent aAssistentFunc; - - bool m_bImpress; - bool m_bButtonsDirty; - - void SetDefaults(); - void CreatePages(); - - Color m_aBackColor, m_aTextColor, m_aLinkColor; - Color m_aVLinkColor, m_aALinkColor; - - void ChangePage(); - void UpdatePage(); - - std::vector m_aDesignList; - bool m_bDesignListDirty; - SdPublishingDesign* m_pDesign; - void Load(); - bool Save(); - - void GetDesign(SdPublishingDesign* pDesign); - void SetDesign(SdPublishingDesign const* pDesign); - - void LoadPreviewButtons(); - - DECL_LINK(FinishHdl, weld::Button&, void); - DECL_LINK(NextPageHdl, weld::Button&, void); - DECL_LINK(LastPageHdl, weld::Button&, void); - - DECL_LINK(DesignHdl, weld::Toggleable&, void); - DECL_LINK(DesignSelectHdl, weld::TreeView&, void); - DECL_LINK(DesignDeleteHdl, weld::Button&, void); - DECL_LINK(BaseHdl, weld::Toggleable&, void); - DECL_LINK(ContentHdl, weld::Toggleable&, void); - DECL_LINK(GfxFormatHdl, weld::Toggleable&, void); - DECL_LINK(ResolutionHdl, weld::Toggleable&, void); - DECL_LINK(ButtonsHdl, ValueSet*, void); - DECL_LINK(ColorHdl, weld::Button&, void); - DECL_LINK(WebServerHdl, weld::Toggleable&, void); - DECL_LINK(SlideChgHdl, weld::Toggleable&, void); - -public: - SdPublishingDlg(weld::Window* pWindow, DocumentType eDocType); - virtual ~SdPublishingDlg() override; - - void GetParameterSequence(css::uno::Sequence& rParams); -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/uiconfig/simpress/ui/publishingdialog.ui b/sd/uiconfig/simpress/ui/publishingdialog.ui deleted file mode 100644 index 7166d6e8a3a8..000000000000 --- a/sd/uiconfig/simpress/ui/publishingdialog.ui +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - - 86400000 - 1000 - 60000 - - - - - - - - - - - False - 6 - HTML Export - dialog - - - False - vertical - 12 - - - False - - - _Help - True - True - True - True - - - False - True - 0 - - - - - _Cancel - True - True - True - True - - - False - True - 1 - - - - - < Back - True - True - True - - - False - True - 2 - - - - - _Create - True - True - True - True - - - Creates new documents according to your selections and saves the documents. - - - - - False - True - 4 - - - - - Ne_xt > - True - True - True - True - True - True - - - False - True - 4 - - - - - False - True - end - 6 - - - - - True - False - True - True - 0 - none - - - True - False - True - True - vertical - 6 - 12 - 6 - - - New _design - True - True - False - True - True - True - - - Creates a new design in the next pages of the Wizard. - - - - - False - True - 0 - - - - - Existing design - True - True - False - True - True - newDesignRadiobutton - - - Loads an existing design from the design list to use as a starting point for the steps to follow on the next pages of the Wizard. - - - - - False - True - 1 - - - - - True - False - True - True - 12 - 6 - - - True - True - True - True - in - - - True - True - True - True - liststore2 - False - False - 0 - False - - - - - - - - - 0 - - - - - - - Displays all existing designs. - - - - - - - False - True - 0 - - - - - False - True - 2 - - - - - True - False - 12 - - - True - False - start - Select an existing design or create a new one - True - designsTreeview - - - False - True - 0 - - - - - Delete Selected Design - True - True - True - end - center - True - - - Deletes the selected design from the design list. - - - - - False - True - 1 - - - - - False - True - 3 - - - - - - - True - False - Assign Design - 0.5 - - - - - - - - Determines the settings for publishing Draw or Impress documents in HTML format. - - - - - True - True - 0 - - - - - - 295 - False - True - True - 24 - - - False - True - True - 0 - none - - - True - False - True - True - vertical - 6 - 12 - 6 - - - _Active Server Pages (ASP) - True - True - False - True - True - True - - - When you select the ASP option, the WebCast export creates ASP pages. Note that the HTML presentation can only be offered by a web server supporting ASP. - - - - - False - True - 0 - - - - - Perl - True - True - False - True - True - ASPRadiobutton - - - Used by WebCast export to create HTML pages and Perl scripts. - - - - - False - True - 1 - - - - - True - False - vertical - 24 - - - True - False - start - start - _URL for listeners: - True - indexEntry - 0.5 - - - False - True - 0 - - - - - True - True - True - True - - - Specifies the URL (absolute or relative) to be entered by the viewer in order to see the presentation. - - - - - False - True - 1 - - - - - True - False - start - URL for _presentation: - True - URLEntry - - - False - True - 2 - - - - - True - True - True - True - - - Specifies the URL (absolute or relative), where the created HTML presentation on the web server has been saved. - - - - - False - True - 3 - - - - - True - False - start - URL for _Perl scripts: - True - CGIEntry - - - False - True - 4 - - - - - True - True - True - True - - - Specifies the URL (absolute or relative) for the generated Perl scripts. - - - - - False - True - 5 - - - - - False - True - 2 - - - - - - - True - False - Webcast - 0.5 - - - - - - - - 3 - 0 - - - - - False - True - True - 0 - none - - - True - False - vertical - 6 - True - True - 12 - 6 - - - _As stated in document - True - True - False - True - True - True - - - The slide transition depends on the timing that you set for each slide in the presentation. If you set a manual page transition, the HTML presentation introduces a new page by pressing any key from your keyboard. - - - - - False - True - 0 - - - - - _Automatic - True - True - False - True - True - chgDefaultRadiobutton - - - The page transition takes place automatically after the specified period of time elapses and does not depend on the presentation's contents - - - - - False - True - 1 - - - - - True - False - vertical - 6 - 24 - - - True - False - 12 - - - True - False - _Slide view time: - True - durationSpinbutton - 0.5 - - - False - True - 0 - - - - - True - True - True - adjustment1 - True - - - Defines the amount of time for each slide display. - - - - - False - True - 1 - - - - - False - True - 0 - - - - - _Endless - True - True - False - True - True - True - - - Automatically restarts the HTML presentation after the last slide has been displayed. - - - - - False - True - 1 - - - - - False - True - 2 - - - - - - - True - False - Advance Slides - - - - - - - - 2 - 0 - - - - - True - False - True - True - 0 - none - - - True - False - True - True - vertical - 6 - 12 - 6 - - - Create title page - True - True - False - True - True - True - - - Creates a title page for your document. - - - - - False - True - 0 - - - - - Show notes - True - True - False - True - True - True - - - Specifies that your notes are also displayed. - - - - - False - True - 1 - - - - - - - True - False - Options - - - - - - - - 1 - 0 - - - - - True - False - True - True - 0 - none - - - - True - False - 6 - True - True - 12 - 6 - - - True - False - 6 - - - True - False - sd/res/pubdes.png - - - False - True - 1 - - - - - False - sd/res/pubdes2.png - - - False - True - 2 - - - - - False - sd/res/pubdes3.png - - - False - True - 3 - - - - - False - sd/res/pubdes4.png - - - False - True - 4 - - - - - 0 - 5 - - - - - _WebCast - True - True - False - True - True - standardRadiobutton - - - In a WebCast export, automatic scripts will be generated with Perl or ASP support. - - - - - 0 - 4 - - - - - _Automatic - True - True - False - True - True - standardRadiobutton - - - Creates a default HTML presentation as a kiosk export, in which the slides are automatically advanced after a specified amount of time. - - - - - 0 - 3 - - - - - _Single-document HTML - True - True - False - True - True - standardRadiobutton - - - 0 - 2 - - - - - Standard HTML with _frames - True - True - False - True - True - standardRadiobutton - - - Creates standard HTML pages with frames. The exported page will be placed in the main frame, and the frame to the left will display a table of contents in the form of hyperlinks. - - - - - 0 - 1 - - - - - Standard H_TML format - True - True - False - True - True - True - - - Creates standard HTML pages from export pages. - - - - - 0 - 0 - - - - - - - True - False - Publication Type - - - - - - - - 0 - 0 - - - - - True - True - 1 - - - - - False - True - True - vertical - 12 - - - True - False - True - 24 - True - - - True - False - True - 0 - none - - - True - False - True - vertical - 6 - 12 - 6 - 6 - 6 - - - _PNG - True - True - False - True - True - True - - - The files are exported as PNG files. PNG files are compressed without loss of data, and can contain more than 256 colors. - - - - - False - True - 0 - - - - - _GIF - True - True - False - True - True - pngRadiobutton - - - The files are exported as GIF files. GIF files are compressed without loss of data, and have a maximum of 256 colors. - - - - - False - True - 1 - - - - - _JPG - True - True - False - True - True - pngRadiobutton - - - The files are exported as JPEG files. JPEG files are compressed, with adjustable compression and can contain more than 256 colors. - - - - - False - True - 2 - - - - - True - False - 10 - 12 - - - True - False - start - _Quality: - True - qualityCombobox - - - False - True - 0 - - - - - True - False - True - True - - - True - True - True - - - - - Specifies the compression factor of the JPEG graphic. A 100% value offers the best quality for a large data range. The 25% factor indicates small files with inferior image quality. - - - - - False - True - 1 - - - - - False - True - 3 - - - - - - - True - False - Save Images As - - - - - - - - False - True - 0 - - - - - True - False - True - 0 - none - - - True - False - True - vertical - 6 - 12 - 6 - - - Low (_640 × 480 pixels) - True - True - False - True - True - True - - - Select the low resolution to keep the file size small, even for presentations with many slides. - - - - - False - True - 0 - - - - - Medium (_800 × 600 pixels) - True - True - False - True - True - resolution1Radiobutton - - - Select the medium resolution for a medium-sized presentation. - - - - - False - True - 1 - - - - - High (_1024 × 768 pixels) - True - True - False - True - True - resolution1Radiobutton - - - Select a high resolution for a high quality slide display. - - - - - False - True - 2 - - - - - Full HD (1_920 × 1080 pixels) - True - True - False - True - True - resolution1Radiobutton - - - Select a full HD resolution for a very high-quality slide display. - - - - - False - True - 3 - - - - - - - True - False - Monitor Resolution - - - - - - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - 0 - none - - - True - False - vertical - 6 - 12 - 6 - - - _Export sounds when slide advances - True - True - False - True - True - True - - - Specifies that the sound files that are defined as an effect for slide transitions are exported. - - - - - False - True - 0 - - - - - Export _hidden slides - True - True - False - True - True - - - False - True - 1 - - - - - - - True - False - Effects - - - - - - - - False - True - 1 - - - - - True - True - 2 - - - - - False - True - True - 0 - none - - - - True - False - True - True - 6 - 12 - 12 - 6 - - - True - False - start - _Author: - True - authorEntry - - - 0 - 0 - - - - - True - True - True - True - True - - - Specifies the name of the publication's author. - - - - - 1 - 0 - - - - - True - False - start - E-_mail address: - True - emailEntry - - - 0 - 1 - - - - - True - False - start - Your hom_epage: - True - wwwEntry - - - 0 - 2 - - - - - True - False - start - start - Additional _information: - True - miscTextview - - - 0 - 3 - - - - - True - True - True - True - True - - - Specifies the email address. - - - - - 1 - 1 - - - - - True - True - True - True - True - - - Specifies your homepage. A hyperlink will be inserted in the publication. - - - - - 1 - 2 - - - - - Link to a copy of the _original presentation - True - True - False - True - True - - - Inserts a hyperlink to download a copy of the presentation file. - - - - - 0 - 4 - 2 - - - - - True - True - True - True - in - - - True - True - True - True - - - Specifies additional text to appear on the title page. - - - - - - - 1 - 3 - - - - - - - True - False - Information for the Title Page - - - - - - - - True - True - 3 - - - - - False - True - True - 0 - none - - - True - False - True - True - vertical - 6 - 12 - 6 - - - _Text only - True - True - False - True - True - True - - - Inserts only text hyperlinks instead of buttons. - - - - - False - True - 0 - - - - - True - True - True - never - never - in - - - True - False - - - True - True - GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK - True - True - - - - - - - False - True - 1 - - - - - - - True - False - Select Button Style - 0.5 - - - - - - - - True - True - 4 - - - - - False - True - True - 0 - none - - - True - False - True - True - vertical - 6 - 12 - 6 - - - _Apply color scheme from document - True - True - False - True - True - True - - - False - True - 0 - - - - - Use _browser colors - True - True - False - True - True - docColorsRadiobutton - - - False - True - 1 - - - - - _Use custom color scheme - True - True - False - True - True - docColorsRadiobutton - - - False - True - 2 - - - - - True - False - True - True - 12 - 12 - - - - True - False - 6 - - - _Visited Link - True - True - True - True - - - 0 - 3 - - - - - Active Li_nk - True - True - True - True - - - 0 - 2 - - - - - Hyper_link - True - True - True - True - - - 0 - 1 - - - - - Text - True - True - True - - - 0 - 0 - - - - - False - True - 0 - - - - - True - False - True - never - never - in - - - True - False - True - True - - - True - False - True - True - - - - - - - False - True - 1 - - - - - Bac_kground - True - True - True - start - True - - - False - True - 2 - - - - - False - True - 3 - - - - - - - True - False - Select Color Scheme - - - - - - - - True - True - 5 - - - - - - help - cancel - lastPageButton - finishButton - nextPageButton - - - - - - - both - - - - - - - - - - - both - - - - - - - - diff --git a/sd/util/sd.component b/sd/util/sd.component index 65e92cd69c6c..24f54893bbd6 100644 --- a/sd/util/sd.component +++ b/sd/util/sd.component @@ -53,10 +53,6 @@ constructor="org_openoffice_comp_Draw_framework_PanelFactory_get_implementation"> - - - diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 3e472746fe67..955317ebc0ca 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -697,7 +697,6 @@ draw_constructor_list = [ "com_sun_star_comp_Draw_PresenterHelper_get_implementation", "com_sun_star_comp_Draw_PresenterPreviewCache_get_implementation", "com_sun_star_comp_Draw_SlideRenderer_get_implementation", - "com_sun_star_comp_draw_SdHtmlOptionsDialog_get_implementation", "com_sun_star_comp_sd_InsertSlideController_get_implementation", "com_sun_star_comp_sd_SlideLayoutController_get_implementation", "com_sun_star_comp_sd_DisplayModeController_get_implementation", diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index a3c2de65e206..2e000ae95311 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -9543,13 +9543,11 @@ sd/source/filter/eppt/pptx-stylesheet.cxx sd/source/filter/eppt/pptx-text.cxx sd/source/filter/eppt/text.hxx sd/source/filter/grf/sdgrffilter.cxx -sd/source/filter/html/HtmlOptionsDialog.cxx sd/source/filter/html/buttonset.cxx sd/source/filter/html/htmlattr.cxx sd/source/filter/html/htmlattr.hxx sd/source/filter/html/htmlex.cxx sd/source/filter/html/htmlex.hxx -sd/source/filter/html/pubdlg.cxx sd/source/filter/ppt/ppt97animations.cxx sd/source/filter/ppt/ppt97animations.hxx sd/source/filter/ppt/pptanimations.hxx diff --git a/vcl/workben/cgmfuzzer.cxx b/vcl/workben/cgmfuzzer.cxx index 7aba911c5fe0..812fd0dbe3c3 100644 --- a/vcl/workben/cgmfuzzer.cxx +++ b/vcl/workben/cgmfuzzer.cxx @@ -61,7 +61,6 @@ void * sd_PresentationDocument_get_implementation( void *, void * ); void * com_sun_star_comp_Draw_PresenterHelper_get_implementation( void *, void * ); void * com_sun_star_comp_Draw_PresenterPreviewCache_get_implementation( void *, void * ); void * com_sun_star_comp_Draw_SlideRenderer_get_implementation( void *, void * ); -void * com_sun_star_comp_draw_SdHtmlOptionsDialog_get_implementation( void *, void * ); void * com_sun_star_comp_sd_InsertSlideController_get_implementation( void *, void * ); void * com_sun_star_comp_sd_SlideLayoutController_get_implementation( void *, void * ); void * com_sun_star_comp_sd_DisplayModeController_get_implementation( void *, void * ); @@ -132,7 +131,6 @@ lo_get_constructor_map(void) { "com_sun_star_comp_Draw_PresenterHelper_get_implementation", com_sun_star_comp_Draw_PresenterHelper_get_implementation }, { "com_sun_star_comp_Draw_PresenterPreviewCache_get_implementation", com_sun_star_comp_Draw_PresenterPreviewCache_get_implementation }, { "com_sun_star_comp_Draw_SlideRenderer_get_implementation", com_sun_star_comp_Draw_SlideRenderer_get_implementation }, - { "com_sun_star_comp_draw_SdHtmlOptionsDialog_get_implementation", com_sun_star_comp_draw_SdHtmlOptionsDialog_get_implementation }, { "com_sun_star_comp_sd_InsertSlideController_get_implementation", com_sun_star_comp_sd_InsertSlideController_get_implementation }, { "com_sun_star_comp_sd_SlideLayoutController_get_implementation", com_sun_star_comp_sd_SlideLayoutController_get_implementation }, { "com_sun_star_comp_sd_DisplayModeController_get_implementation", com_sun_star_comp_sd_DisplayModeController_get_implementation },