summaryrefslogtreecommitdiff
path: root/writerperfect/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-14 14:06:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-15 13:05:35 +0200
commit5f170e69728b8741ce3c0af1d140023577cc470b (patch)
tree5bdde1373c80fa784bbaeef9ed3a4e952197741a /writerperfect/inc
parentd15c240434d61422e718a08db7d184d86f2b5f15 (diff)
weld WPFTEncodingDialog
and pass in parent window for dialog Change-Id: Ibe9f576a74dfbbee3e568c8d3454440700cb0405 Reviewed-on: https://gerrit.libreoffice.org/54328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'writerperfect/inc')
-rw-r--r--writerperfect/inc/ImportFilter.hxx12
-rw-r--r--writerperfect/inc/WPFTEncodingDialog.hxx21
2 files changed, 17 insertions, 16 deletions
diff --git a/writerperfect/inc/ImportFilter.hxx b/writerperfect/inc/ImportFilter.hxx
index 53029ef32176..1b2bca9dd995 100644
--- a/writerperfect/inc/ImportFilter.hxx
+++ b/writerperfect/inc/ImportFilter.hxx
@@ -31,6 +31,8 @@
#include <cppuhelper/implbase.hxx>
#include <unotools/mediadescriptor.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
#include "DocumentHandler.hxx"
#include "WPXSvInputStream.hxx"
@@ -73,6 +75,9 @@ public:
return false;
}
+ css::uno::Reference<css::awt::XWindow> xDialogParent;
+ aDescriptor["ParentWindow"] >>= xDialogParent;
+
// An XML import service: what we push sax messages to..
css::uno::Reference<css::xml::sax::XDocumentHandler> xInternalHandler(
mxContext->getServiceManager()->createInstanceWithContext(
@@ -95,7 +100,8 @@ public:
doRegisterHandlers(exporter);
- return doImportDocument(input, exporter, aDescriptor);
+ return doImportDocument(Application::GetFrameWeld(xDialogParent), input, exporter,
+ aDescriptor);
}
virtual void SAL_CALL cancel() override {}
@@ -168,8 +174,8 @@ public:
private:
virtual bool doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName) = 0;
- virtual bool doImportDocument(librevenge::RVNGInputStream& rInput, Generator& rGenerator,
- utl::MediaDescriptor& rDescriptor)
+ virtual bool doImportDocument(weld::Window* pParent, librevenge::RVNGInputStream& rInput,
+ Generator& rGenerator, utl::MediaDescriptor& rDescriptor)
= 0;
virtual void doRegisterHandlers(Generator&){};
diff --git a/writerperfect/inc/WPFTEncodingDialog.hxx b/writerperfect/inc/WPFTEncodingDialog.hxx
index c6c501ff1af7..8b173e34026d 100644
--- a/writerperfect/inc/WPFTEncodingDialog.hxx
+++ b/writerperfect/inc/WPFTEncodingDialog.hxx
@@ -14,18 +14,16 @@
#include <sal/types.h>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
#include "writerperfectdllapi.h"
namespace writerperfect
{
-class WRITERPERFECT_DLLPUBLIC WPFTEncodingDialog : public ModalDialog
+class WRITERPERFECT_DLLPUBLIC WPFTEncodingDialog : public weld::GenericDialogController
{
public:
- WPFTEncodingDialog(const OUString& title, const OUString& defEncoding);
+ WPFTEncodingDialog(weld::Window* pParent, const OUString& title, const OUString& defEncoding);
virtual ~WPFTEncodingDialog() override;
@@ -33,17 +31,14 @@ public:
bool hasUserCalledCancel() const { return m_userHasCancelled; }
private:
- VclPtr<ListBox> m_pLbCharset;
- VclPtr<OKButton> m_pBtnOk;
- VclPtr<CancelButton> m_pBtnCancel;
-
bool m_userHasCancelled;
-private:
- DECL_LINK(DoubleClickHdl, ListBox&, void);
- DECL_LINK(CancelHdl, Button*, void);
+ std::unique_ptr<weld::ComboBoxText> m_xLbCharset;
+ std::unique_ptr<weld::Button> m_xBtnOk;
+ std::unique_ptr<weld::Button> m_xBtnCancel;
- void dispose() override;
+private:
+ DECL_LINK(CancelHdl, weld::Button&, void);
WPFTEncodingDialog(WPFTEncodingDialog const&) = delete;
WPFTEncodingDialog& operator=(WPFTEncodingDialog const&) = delete;