summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-18 11:49:10 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-18 21:39:14 +0200
commit158cd800d607898b1d2fe9bf4514900802ca1d90 (patch)
tree2cf7b77b4e322cb4250391e9428b34deea3e0076
parentdc7f9a1f79a94107d6113ee6569dbcbf15cf3071 (diff)
weld EPUBExportDialog and add parent
Change-Id: Iec4fa3afb1e90ec36f792ea65b8c57b11cff98b3 Reviewed-on: https://gerrit.libreoffice.org/53094 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sfx2/inc/guisaveas.hxx1
-rw-r--r--sfx2/source/doc/guisaveas.cxx39
-rw-r--r--writerperfect/source/writer/EPUBExportDialog.cxx153
-rw-r--r--writerperfect/source/writer/EPUBExportDialog.hxx57
-rw-r--r--writerperfect/source/writer/EPUBExportUIComponent.cxx13
-rw-r--r--writerperfect/source/writer/EPUBExportUIComponent.hxx7
-rw-r--r--writerperfect/uiconfig/ui/exportepub.ui20
7 files changed, 153 insertions, 137 deletions
diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index 94f3d591b8e9..da4af8900c66 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -80,6 +80,7 @@ public:
const OUString& aDefExtension,
bool rDefaultIsAlien );
+ static css::uno::Reference<css::awt::XWindow> GetModelXWindow(const css::uno::Reference<css::frame::XModel>& rModel);
static vcl::Window* GetModelWindow( const css::uno::Reference< css::frame::XModel >& xModel );
};
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 428d9d35128f..17e8edd623cb 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -63,6 +63,7 @@
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/mimeconfighelper.hxx>
#include <vcl/weld.hxx>
#include <vcl/window.hxx>
@@ -593,8 +594,13 @@ bool ModelData_Impl::ExecuteFilterDialog_Impl( const OUString& aFilterName )
aProps[nProperty].Value >>= aServiceName;
if( !aServiceName.isEmpty() )
{
+ uno::Sequence<uno::Any> aDialogArgs(comphelper::InitAnyPropertySequence(
+ {
+ {"ParentWindow", uno::Any(SfxStoringHelper::GetModelXWindow(m_xModel))},
+ }));
+
uno::Reference< ui::dialogs::XExecutableDialog > xFilterDialog(
- comphelper::getProcessServiceFactory()->createInstance( aServiceName ), uno::UNO_QUERY );
+ comphelper::getProcessServiceFactory()->createInstanceWithArguments(aServiceName, aDialogArgs), uno::UNO_QUERY );
uno::Reference< beans::XPropertyAccess > xFilterProperties( xFilterDialog, uno::UNO_QUERY );
if( xFilterDialog.is() && xFilterProperties.is() )
@@ -1809,9 +1815,8 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XMod
return aDlg.run() == RET_OK;
}
-vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >& xModel )
+uno::Reference<awt::XWindow> SfxStoringHelper::GetModelXWindow(const uno::Reference<frame::XModel>& xModel)
{
- VclPtr<vcl::Window> pWin;
try {
if ( xModel.is() )
{
@@ -1821,13 +1826,7 @@ vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XMod
uno::Reference< frame::XFrame > xFrame = xController->getFrame();
if ( xFrame.is() )
{
- uno::Reference< awt::XWindow > xWindow = xFrame->getContainerWindow();
- if ( xWindow.is() )
- {
- VCLXWindow* pVCLWindow = VCLXWindow::GetImplementation( xWindow );
- if ( pVCLWindow )
- pWin = pVCLWindow->GetWindow();
- }
+ return xFrame->getContainerWindow();
}
}
}
@@ -1836,6 +1835,26 @@ vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XMod
{
}
+ return uno::Reference<awt::XWindow>();
+}
+
+vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >& xModel )
+{
+ VclPtr<vcl::Window> pWin;
+
+ try {
+ uno::Reference<awt::XWindow> xWindow = GetModelXWindow(xModel);
+ if ( xWindow.is() )
+ {
+ VCLXWindow* pVCLWindow = VCLXWindow::GetImplementation( xWindow );
+ if ( pVCLWindow )
+ pWin = pVCLWindow->GetWindow();
+ }
+ }
+ catch ( const uno::Exception& )
+ {
+ }
+
return pWin;
}
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx b/writerperfect/source/writer/EPUBExportDialog.cxx
index c01bc32ec111..bf1f4a0e4cfd 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -70,25 +70,37 @@ sal_Int32 PositionToVersion(sal_Int32 nPosition)
namespace writerperfect
{
-EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, uno::Reference<uno::XComponentContext> xContext, css::uno::Reference<css::lang::XComponent> xDocument)
- : ModalDialog(pParent, "EpubDialog", "writerperfect/ui/exportepub.ui"),
- mxContext(std::move(xContext)),
- mrFilterData(rFilterData),
- mxSourceDocument(std::move(xDocument))
+EPUBExportDialog::EPUBExportDialog(weld::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, uno::Reference<uno::XComponentContext> xContext, css::uno::Reference<css::lang::XComponent> xDocument)
+ : GenericDialogController(pParent, "writerperfect/ui/exportepub.ui", "EpubDialog")
+ , m_xContext(std::move(xContext))
+ , m_rFilterData(rFilterData)
+ , m_xSourceDocument(std::move(xDocument))
+ , m_xVersion(m_xBuilder->weld_combo_box_text("versionlb"))
+ , m_xSplit(m_xBuilder->weld_combo_box_text("splitlb"))
+ , m_xLayout(m_xBuilder->weld_combo_box_text("layoutlb"))
+ , m_xCoverPath(m_xBuilder->weld_entry("coverpath"))
+ , m_xCoverButton(m_xBuilder->weld_button("coverbutton"))
+ , m_xMediaDir(m_xBuilder->weld_entry("mediadir"))
+ , m_xMediaButton(m_xBuilder->weld_button("mediabutton"))
+ , m_xOKButton(m_xBuilder->weld_button("ok"))
+ , m_xIdentifier(m_xBuilder->weld_entry("identifier"))
+ , m_xTitle(m_xBuilder->weld_entry("title"))
+ , m_xInitialCreator(m_xBuilder->weld_entry("author"))
+ , m_xLanguage(m_xBuilder->weld_entry("language"))
+ , m_xDate(m_xBuilder->weld_entry("date"))
+
{
- get(m_pVersion, "versionlb");
- assert(PositionToVersion(m_pVersion->GetSelectedEntryPos()) == EPUBExportFilter::GetDefaultVersion());
+ assert(PositionToVersion(m_xVersion->get_active()) == EPUBExportFilter::GetDefaultVersion());
auto it = rFilterData.find("EPUBVersion");
if (it != rFilterData.end())
{
sal_Int32 nVersion = 0;
if (it->second >>= nVersion)
- m_pVersion->SelectEntryPos(VersionToPosition(nVersion));
+ m_xVersion->set_active(VersionToPosition(nVersion));
}
- m_pVersion->SetSelectHdl(LINK(this, EPUBExportDialog, VersionSelectHdl));
+ m_xVersion->connect_changed(LINK(this, EPUBExportDialog, VersionSelectHdl));
- get(m_pSplit, "splitlb");
it = rFilterData.find("EPUBSplitMethod");
if (it != rFilterData.end())
{
@@ -96,13 +108,12 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsH
if (it->second >>= nSplitMethod)
// No conversion, 1:1 mapping between libepubgen::EPUBSplitMethod
// and entry positions.
- m_pSplit->SelectEntryPos(nSplitMethod);
+ m_xSplit->set_active(nSplitMethod);
}
else
- m_pSplit->SelectEntryPos(EPUBExportFilter::GetDefaultSplitMethod());
- m_pSplit->SetSelectHdl(LINK(this, EPUBExportDialog, SplitSelectHdl));
+ m_xSplit->set_active(EPUBExportFilter::GetDefaultSplitMethod());
+ m_xSplit->connect_changed(LINK(this, EPUBExportDialog, SplitSelectHdl));
- get(m_pLayout, "layoutlb");
it = rFilterData.find("EPUBLayoutMethod");
if (it != rFilterData.end())
{
@@ -110,137 +121,105 @@ EPUBExportDialog::EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsH
if (it->second >>= nLayoutMethod)
// No conversion, 1:1 mapping between libepubgen::EPUBLayoutMethod
// and entry positions.
- m_pLayout->SelectEntryPos(nLayoutMethod);
+ m_xLayout->set_active(nLayoutMethod);
}
else
- m_pLayout->SelectEntryPos(EPUBExportFilter::GetDefaultLayoutMethod());
- m_pLayout->SetSelectHdl(LINK(this, EPUBExportDialog, LayoutSelectHdl));
-
- get(m_pCoverPath, "coverpath");
-
- get(m_pCoverButton, "coverbutton");
- m_pCoverButton->SetClickHdl(LINK(this, EPUBExportDialog, CoverClickHdl));
-
- get(m_pMediaDir, "mediadir");
+ m_xLayout->set_active(EPUBExportFilter::GetDefaultLayoutMethod());
+ m_xLayout->connect_changed(LINK(this, EPUBExportDialog, LayoutSelectHdl));
- get(m_pMediaButton, "mediabutton");
- m_pMediaButton->SetClickHdl(LINK(this, EPUBExportDialog, MediaClickHdl));
+ m_xCoverButton->connect_clicked(LINK(this, EPUBExportDialog, CoverClickHdl));
- get(m_pIdentifier, "identifier");
+ m_xMediaButton->connect_clicked(LINK(this, EPUBExportDialog, MediaClickHdl));
- get(m_pTitle, "title");
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(mxSourceDocument, uno::UNO_QUERY);
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS(m_xSourceDocument, uno::UNO_QUERY);
uno::Reference<document::XDocumentProperties> xDP;
if (xDPS.is())
xDP = xDPS->getDocumentProperties();
if (xDP.is())
- m_pTitle->SetText(xDP->getTitle());
+ m_xTitle->set_text(xDP->getTitle());
- get(m_pInitialCreator, "author");
if (xDP.is())
- m_pInitialCreator->SetText(xDP->getAuthor());
+ m_xInitialCreator->set_text(xDP->getAuthor());
- get(m_pLanguage, "language");
if (xDP.is())
{
OUString aLanguage(LanguageTag::convertToBcp47(xDP->getLanguage(), false));
- m_pLanguage->SetText(aLanguage);
+ m_xLanguage->set_text(aLanguage);
}
- get(m_pDate, "date");
if (xDP.is())
{
OUStringBuffer aBuffer;
util::DateTime aDate(xDP->getModificationDate());
sax::Converter::convertDateTime(aBuffer, aDate, nullptr, true);
- m_pDate->SetText(aBuffer.makeStringAndClear());
+ m_xDate->set_text(aBuffer.makeStringAndClear());
}
- get(m_pOKButton, "ok");
- m_pOKButton->SetClickHdl(LINK(this, EPUBExportDialog, OKClickHdl));
+ m_xOKButton->connect_clicked(LINK(this, EPUBExportDialog, OKClickHdl));
}
-IMPL_LINK_NOARG(EPUBExportDialog, VersionSelectHdl, ListBox &, void)
+IMPL_LINK_NOARG(EPUBExportDialog, VersionSelectHdl, weld::ComboBoxText &, void)
{
- mrFilterData["EPUBVersion"] <<= PositionToVersion(m_pVersion->GetSelectedEntryPos());
+ m_rFilterData["EPUBVersion"] <<= PositionToVersion(m_xVersion->get_active());
}
-IMPL_LINK_NOARG(EPUBExportDialog, SplitSelectHdl, ListBox &, void)
+IMPL_LINK_NOARG(EPUBExportDialog, SplitSelectHdl, weld::ComboBoxText &, void)
{
// No conversion, 1:1 mapping between entry positions and
// libepubgen::EPUBSplitMethod.
- mrFilterData["EPUBSplitMethod"] <<= m_pSplit->GetSelectedEntryPos();
+ m_rFilterData["EPUBSplitMethod"] <<= static_cast<sal_Int32>(m_xSplit->get_active());
}
-IMPL_LINK_NOARG(EPUBExportDialog, LayoutSelectHdl, ListBox &, void)
+IMPL_LINK_NOARG(EPUBExportDialog, LayoutSelectHdl, weld::ComboBoxText &, void)
{
// No conversion, 1:1 mapping between entry positions and
// libepubgen::EPUBLayoutMethod.
- mrFilterData["EPUBLayoutMethod"] <<= m_pLayout->GetSelectedEntryPos();
- m_pSplit->Enable(m_pLayout->GetSelectedEntryPos() != libepubgen::EPUB_LAYOUT_METHOD_FIXED);
+ m_rFilterData["EPUBLayoutMethod"] <<= static_cast<sal_Int32>(m_xLayout->get_active());
+ m_xSplit->set_sensitive(m_xLayout->get_active() != libepubgen::EPUB_LAYOUT_METHOD_FIXED);
}
-IMPL_LINK_NOARG(EPUBExportDialog, CoverClickHdl, Button *, void)
+IMPL_LINK_NOARG(EPUBExportDialog, CoverClickHdl, weld::Button &, void)
{
- SvxOpenGraphicDialog aDlg("Import", GetFrameWeld());
+ SvxOpenGraphicDialog aDlg("Import", m_xDialog.get());
aDlg.EnableLink(false);
if (aDlg.Execute() == ERRCODE_NONE)
- m_pCoverPath->SetText(aDlg.GetPath());
+ m_xCoverPath->set_text(aDlg.GetPath());
}
-IMPL_LINK_NOARG(EPUBExportDialog, MediaClickHdl, Button *, void)
+IMPL_LINK_NOARG(EPUBExportDialog, MediaClickHdl, weld::Button &, void)
{
- uno::Reference<ui::dialogs::XFolderPicker2> xFolderPicker = ui::dialogs::FolderPicker::create(mxContext);
+ uno::Reference<ui::dialogs::XFolderPicker2> xFolderPicker = ui::dialogs::FolderPicker::create(m_xContext);
if (xFolderPicker->execute() != ui::dialogs::ExecutableDialogResults::OK)
return;
- m_pMediaDir->SetText(xFolderPicker->getDirectory());
+ m_xMediaDir->set_text(xFolderPicker->getDirectory());
}
-IMPL_LINK_NOARG(EPUBExportDialog, OKClickHdl, Button *, void)
+IMPL_LINK_NOARG(EPUBExportDialog, OKClickHdl, weld::Button &, void)
{
// General
- if (!m_pCoverPath->GetText().isEmpty())
- mrFilterData["RVNGCoverImage"] <<= m_pCoverPath->GetText();
- if (!m_pMediaDir->GetText().isEmpty())
- mrFilterData["RVNGMediaDir"] <<= m_pMediaDir->GetText();
+ if (!m_xCoverPath->get_text().isEmpty())
+ m_rFilterData["RVNGCoverImage"] <<= m_xCoverPath->get_text();
+ if (!m_xMediaDir->get_text().isEmpty())
+ m_rFilterData["RVNGMediaDir"] <<= m_xMediaDir->get_text();
// Metadata
- if (!m_pIdentifier->GetText().isEmpty())
- mrFilterData["RVNGIdentifier"] <<= m_pIdentifier->GetText();
- if (!m_pTitle->GetText().isEmpty())
- mrFilterData["RVNGTitle"] <<= m_pTitle->GetText();
- if (!m_pInitialCreator->GetText().isEmpty())
- mrFilterData["RVNGInitialCreator"] <<= m_pInitialCreator->GetText();
- if (!m_pLanguage->GetText().isEmpty())
- mrFilterData["RVNGLanguage"] <<= m_pLanguage->GetText();
- if (!m_pDate->GetText().isEmpty())
- mrFilterData["RVNGDate"] <<= m_pDate->GetText();
-
- EndDialog(RET_OK);
+ if (!m_xIdentifier->get_text().isEmpty())
+ m_rFilterData["RVNGIdentifier"] <<= m_xIdentifier->get_text();
+ if (!m_xTitle->get_text().isEmpty())
+ m_rFilterData["RVNGTitle"] <<= m_xTitle->get_text();
+ if (!m_xInitialCreator->get_text().isEmpty())
+ m_rFilterData["RVNGInitialCreator"] <<= m_xInitialCreator->get_text();
+ if (!m_xLanguage->get_text().isEmpty())
+ m_rFilterData["RVNGLanguage"] <<= m_xLanguage->get_text();
+ if (!m_xDate->get_text().isEmpty())
+ m_rFilterData["RVNGDate"] <<= m_xDate->get_text();
+
+ m_xDialog->response(RET_OK);
}
EPUBExportDialog::~EPUBExportDialog()
{
- disposeOnce();
-}
-
-void EPUBExportDialog::dispose()
-{
- m_pVersion.clear();
- m_pSplit.clear();
- m_pCoverPath.clear();
- m_pCoverButton.clear();
- m_pOKButton.clear();
- m_pIdentifier.clear();
- m_pTitle.clear();
- m_pInitialCreator.clear();
- m_pLanguage.clear();
- m_pDate.clear();
- m_pMediaDir.clear();
- m_pMediaButton.clear();
- m_pLayout.clear();
- ModalDialog::dispose();
}
} // namespace writerperfect
diff --git a/writerperfect/source/writer/EPUBExportDialog.hxx b/writerperfect/source/writer/EPUBExportDialog.hxx
index ab90c48ee04c..51326c1ae1f6 100644
--- a/writerperfect/source/writer/EPUBExportDialog.hxx
+++ b/writerperfect/source/writer/EPUBExportDialog.hxx
@@ -10,10 +10,7 @@
#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBEXPORTDIALOG_HXX
#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBEXPORTDIALOG_HXX
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
namespace comphelper
{
@@ -24,37 +21,37 @@ namespace writerperfect
{
/// EPUB export options dialog.
-class EPUBExportDialog : public ModalDialog
+class EPUBExportDialog : public weld::GenericDialogController
{
public:
- EPUBExportDialog(vcl::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, css::uno::Reference<css::uno::XComponentContext> xContext, css::uno::Reference<css::lang::XComponent> xDocument);
+ EPUBExportDialog(weld::Window *pParent, comphelper::SequenceAsHashMap &rFilterData, css::uno::Reference<css::uno::XComponentContext> xContext, css::uno::Reference<css::lang::XComponent> xDocument);
~EPUBExportDialog() override;
- void dispose() override;
private:
- DECL_LINK(VersionSelectHdl, ListBox &, void);
- DECL_LINK(SplitSelectHdl, ListBox &, void);
- DECL_LINK(LayoutSelectHdl, ListBox &, void);
- DECL_LINK(CoverClickHdl, Button *, void);
- DECL_LINK(MediaClickHdl, Button *, void);
- DECL_LINK(OKClickHdl, Button *, void);
-
- css::uno::Reference<css::uno::XComponentContext> mxContext;
- comphelper::SequenceAsHashMap &mrFilterData;
- css::uno::Reference<css::lang::XComponent> mxSourceDocument;
- VclPtr<ListBox> m_pVersion;
- VclPtr<ListBox> m_pSplit;
- VclPtr<ListBox> m_pLayout;
- VclPtr<Edit> m_pCoverPath;
- VclPtr<PushButton> m_pCoverButton;
- VclPtr<Edit> m_pMediaDir;
- VclPtr<PushButton> m_pMediaButton;
- VclPtr<PushButton> m_pOKButton;
- VclPtr<Edit> m_pIdentifier;
- VclPtr<Edit> m_pTitle;
- VclPtr<Edit> m_pInitialCreator;
- VclPtr<Edit> m_pLanguage;
- VclPtr<Edit> m_pDate;
+ DECL_LINK(VersionSelectHdl, weld::ComboBoxText &, void);
+ DECL_LINK(SplitSelectHdl, weld::ComboBoxText &, void);
+ DECL_LINK(LayoutSelectHdl, weld::ComboBoxText &, void);
+ DECL_LINK(CoverClickHdl, weld::Button &, void);
+ DECL_LINK(MediaClickHdl, weld::Button &, void);
+ DECL_LINK(OKClickHdl, weld::Button &, void);
+
+ css::uno::Reference<css::uno::XComponentContext> m_xContext;
+ comphelper::SequenceAsHashMap &m_rFilterData;
+ css::uno::Reference<css::lang::XComponent> m_xSourceDocument;
+
+ std::unique_ptr<weld::ComboBoxText> m_xVersion;
+ std::unique_ptr<weld::ComboBoxText> m_xSplit;
+ std::unique_ptr<weld::ComboBoxText> m_xLayout;
+ std::unique_ptr<weld::Entry> m_xCoverPath;
+ std::unique_ptr<weld::Button> m_xCoverButton;
+ std::unique_ptr<weld::Entry> m_xMediaDir;
+ std::unique_ptr<weld::Button> m_xMediaButton;
+ std::unique_ptr<weld::Button> m_xOKButton;
+ std::unique_ptr<weld::Entry> m_xIdentifier;
+ std::unique_ptr<weld::Entry> m_xTitle;
+ std::unique_ptr<weld::Entry> m_xInitialCreator;
+ std::unique_ptr<weld::Entry> m_xLanguage;
+ std::unique_ptr<weld::Entry> m_xDate;
};
} // namespace writerperfect
diff --git a/writerperfect/source/writer/EPUBExportUIComponent.cxx b/writerperfect/source/writer/EPUBExportUIComponent.cxx
index 4df8ea4a1946..abf533f7f19a 100644
--- a/writerperfect/source/writer/EPUBExportUIComponent.cxx
+++ b/writerperfect/source/writer/EPUBExportUIComponent.cxx
@@ -10,7 +10,7 @@
#include "EPUBExportUIComponent.hxx"
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-
+#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <vcl/vclptr.hxx>
@@ -72,12 +72,19 @@ void EPUBExportUIComponent::setTitle(const OUString &/*rTitle*/)
{
}
+void SAL_CALL EPUBExportUIComponent::initialize(const uno::Sequence<uno::Any>& rArguments)
+{
+ ::comphelper::NamedValueCollection aProperties(rArguments);
+ if (aProperties.has("ParentWindow"))
+ aProperties.get("ParentWindow") >>= mxDialogParent;
+}
+
sal_Int16 EPUBExportUIComponent::execute()
{
SolarMutexGuard aGuard;
- ScopedVclPtrInstance<EPUBExportDialog> pDialog(Application::GetDefDialogParent(), maFilterData, mxContext, mxSourceDocument);
- if (pDialog->Execute() == RET_OK)
+ EPUBExportDialog aDialog(Application::GetFrameWeld(mxDialogParent), maFilterData, mxContext, mxSourceDocument);
+ if (aDialog.run() == RET_OK)
return ui::dialogs::ExecutableDialogResults::OK;
return ui::dialogs::ExecutableDialogResults::CANCEL;
}
diff --git a/writerperfect/source/writer/EPUBExportUIComponent.hxx b/writerperfect/source/writer/EPUBExportUIComponent.hxx
index 865571dde97b..f2288a91ad76 100644
--- a/writerperfect/source/writer/EPUBExportUIComponent.hxx
+++ b/writerperfect/source/writer/EPUBExportUIComponent.hxx
@@ -10,8 +10,10 @@
#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBEXPORTUICOMPONENT_HXX
#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBEXPORTUICOMPONENT_HXX
+#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/document/XExporter.hpp>
@@ -26,6 +28,7 @@ namespace writerperfect
class EPUBExportUIComponent : public cppu::WeakImplHelper
<
css::beans::XPropertyAccess,
+ css::lang::XInitialization,
css::lang::XServiceInfo,
css::ui::dialogs::XExecutableDialog,
css::document::XExporter
@@ -50,6 +53,9 @@ public:
// XExporter
void SAL_CALL setSourceDocument(const css::uno::Reference<css::lang::XComponent> &xDocument) override;
+ // XInitialization
+ void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
private:
/// The full set of property values.
comphelper::SequenceAsHashMap maMediaDescriptor;
@@ -58,6 +64,7 @@ private:
/// UNO context.
css::uno::Reference<css::uno::XComponentContext> mxContext;
css::uno::Reference<css::lang::XComponent> mxSourceDocument;
+ css::uno::Reference<css::awt::XWindow> mxDialogParent;
};
} // namespace writerperfect
diff --git a/writerperfect/uiconfig/ui/exportepub.ui b/writerperfect/uiconfig/ui/exportepub.ui
index 114cd0376952..8b1ff34d7b00 100644
--- a/writerperfect/uiconfig/ui/exportepub.ui
+++ b/writerperfect/uiconfig/ui/exportepub.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
<interface domain="wpt">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="EpubDialog">
@@ -8,6 +8,8 @@
<property name="title" translatable="yes" context="exportepub|EpubDialog">EPUB Export</property>
<property name="resizable">False</property>
<property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
@@ -296,6 +298,7 @@
<object class="GtkEntry" id="coverpath">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="expand">True</property>
@@ -369,6 +372,7 @@
<object class="GtkEntry" id="mediadir">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="expand">True</property>
@@ -451,6 +455,7 @@
<object class="GtkEntry" id="identifier">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -491,6 +496,7 @@
<object class="GtkEntry" id="title">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -516,6 +522,7 @@
<object class="GtkEntry" id="author">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -541,6 +548,7 @@
<object class="GtkEntry" id="language">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -566,6 +574,7 @@
<object class="GtkEntry" id="date">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -602,11 +611,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
- </object>
- <object class="GtkAdjustment" id="adjustment1">
- <property name="upper">9999</property>
- <property name="value">1</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>