summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-10 21:30:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-11 09:56:41 +0200
commit36a688255ff2ebddafa3a8d7011167f437967b6a (patch)
tree09a61632d5cfd6756f054594c9afe72938a7e6d9 /sd/source/ui
parent6c6982e7892f9dfde8fd2e79b32e61bd90cbd9b0 (diff)
weld SdInsertPasteDlg
Change-Id: I999e7ff88afd7dd82b368ede83d004e309e7dd3e Reviewed-on: https://gerrit.libreoffice.org/54102 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/dlg/ins_paste.cxx21
-rw-r--r--sd/source/ui/inc/ins_paste.hxx13
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx7
3 files changed, 15 insertions, 26 deletions
diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx
index 2689f4211bb3..a0b6f305d404 100644
--- a/sd/source/ui/dlg/ins_paste.cxx
+++ b/sd/source/ui/dlg/ins_paste.cxx
@@ -19,30 +19,21 @@
#include <ins_paste.hxx>
-SdInsertPasteDlg::SdInsertPasteDlg(vcl::Window* pWindow)
- : ModalDialog( pWindow, "InsertSlidesDialog",
- "modules/simpress/ui/insertslides.ui")
+SdInsertPasteDlg::SdInsertPasteDlg(weld::Window* pWindow)
+ : GenericDialogController(pWindow, "modules/simpress/ui/insertslides.ui", "InsertSlidesDialog")
+ , m_xRbBefore(m_xBuilder->weld_radio_button("before"))
+ , m_xRbAfter(m_xBuilder->weld_radio_button("after"))
{
- get(m_pRbBefore, "before");
- get(m_pRbAfter, "after");
- m_pRbAfter->Check();
+ m_xRbAfter->set_active(true);
}
SdInsertPasteDlg::~SdInsertPasteDlg()
{
- disposeOnce();
-}
-
-void SdInsertPasteDlg::dispose()
-{
- m_pRbBefore.clear();
- m_pRbAfter.clear();
- ModalDialog::dispose();
}
bool SdInsertPasteDlg::IsInsertBefore() const
{
- return m_pRbBefore->IsChecked();
+ return m_xRbBefore->get_active();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/ins_paste.hxx b/sd/source/ui/inc/ins_paste.hxx
index 2ea57eee2e05..70a946271ed8 100644
--- a/sd/source/ui/inc/ins_paste.hxx
+++ b/sd/source/ui/inc/ins_paste.hxx
@@ -22,21 +22,18 @@
#include <sddllapi.h>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/dialog.hxx>
+#include <vcl/weld.hxx>
// SdInsertPasteDlg
-class SD_DLLPUBLIC SdInsertPasteDlg : public ModalDialog
+class SD_DLLPUBLIC SdInsertPasteDlg : public weld::GenericDialogController
{
private:
- VclPtr<RadioButton> m_pRbBefore;
- VclPtr<RadioButton> m_pRbAfter;
+ std::unique_ptr<weld::RadioButton> m_xRbBefore;
+ std::unique_ptr<weld::RadioButton> m_xRbAfter;
public:
- SdInsertPasteDlg( vcl::Window* pWindow );
+ SdInsertPasteDlg(weld::Window* pWindow);
virtual ~SdInsertPasteDlg() override;
- virtual void dispose() override;
bool IsInsertBefore() const;
};
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index fb12640c8b1e..7ac3ed0e4eda 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -281,11 +281,12 @@ sal_Int32 Clipboard::GetInsertionPosition ()
else if (mrController.GetFocusManager().IsFocusShowing())
{
// Use the focus to determine the insertion position.
- ScopedVclPtrInstance< SdInsertPasteDlg > aDialog(nullptr);
- if (aDialog->Execute() == RET_OK)
+ vcl::Window* pWin = mrSlideSorter.GetContentWindow();
+ SdInsertPasteDlg aDialog(pWin ? pWin->GetFrameWeld() : nullptr);
+ if (aDialog.run() == RET_OK)
{
nInsertPosition = mrController.GetFocusManager().GetFocusedPageIndex();
- if ( ! aDialog->IsInsertBefore())
+ if (!aDialog.IsInsertBefore())
nInsertPosition ++;
}
}