summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-08 09:49:36 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-09 13:47:52 +0100
commit48bca65f1cf381cba7cb7a4c3916155a1bca0955 (patch)
treedf461652450b3e095e37a3290cbe54ab20cedfae /sc/source
parentc468b6910bf77e332647725da70e3cb248a9de0e (diff)
inherit welded dialogs from a common ancestor
Change-Id: Ifa6c871a134cf89bfba71b1049a115cf7c953c42 Reviewed-on: https://gerrit.libreoffice.org/50936 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 'sc/source')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx2
-rw-r--r--sc/source/ui/inc/strindlg.hxx6
-rw-r--r--sc/source/ui/inc/warnbox.hxx8
-rw-r--r--sc/source/ui/miscdlgs/strindlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/warnbox.cxx6
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx6
-rw-r--r--sc/source/ui/view/viewfun3.cxx2
8 files changed, 15 insertions, 21 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 6a7d258c6c71..d0d95a28277f 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1293,7 +1293,7 @@ bool ScDocShell::ExecuteChangeProtectionDialog( bool bJustQueryIfProtected )
aDlg.SetEditHelpId( HID_CHG_PROTECT );
if ( !bProtected )
aDlg.ShowExtras(SfxShowExtras::CONFIRM);
- if (aDlg.run() == RET_OK)
+ if (aDlg.execute() == RET_OK)
aPassword = aDlg.GetPassword();
if (!aPassword.isEmpty())
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 11c3e29103ad..d6372e89ab0c 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1478,7 +1478,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
{
vcl::Window* pWin = ScDocShell::GetActiveDialogParent();
ScReplaceWarnBox aBox(pWin ? pWin->GetFrameWeld() : nullptr);
- if (aBox.run() != RET_YES)
+ if (aBox.execute() != RET_YES)
{
return false;
}
diff --git a/sc/source/ui/inc/strindlg.hxx b/sc/source/ui/inc/strindlg.hxx
index 22dd85049f47..8d14f5ec5187 100644
--- a/sc/source/ui/inc/strindlg.hxx
+++ b/sc/source/ui/inc/strindlg.hxx
@@ -22,11 +22,9 @@
#include <vcl/weld.hxx>
-class ScStringInputDlg
+class ScStringInputDlg : public weld::GenericDialogController
{
private:
- std::unique_ptr<weld::Builder> m_xBuilder;
- std::unique_ptr<weld::Dialog> m_xDialog;
std::unique_ptr<weld::Label> m_xLabel;
std::unique_ptr<weld::Entry> m_xEdInput;
@@ -37,8 +35,6 @@ public:
const OUString& rDefault,
const OString& sHelpId, const OString& sEditHelpId);
- short run() { return m_xDialog->run(); }
-
OUString GetInputString() const
{
return m_xEdInput->get_text();
diff --git a/sc/source/ui/inc/warnbox.hxx b/sc/source/ui/inc/warnbox.hxx
index d4a17d69b94f..54bdd269ebeb 100644
--- a/sc/source/ui/inc/warnbox.hxx
+++ b/sc/source/ui/inc/warnbox.hxx
@@ -24,21 +24,19 @@
/** Warning box for "Replace cell contents?".
With warning image and "Do not show again" checkbox. */
-class ScReplaceWarnBox
+class ScReplaceWarnBox : public weld::MessageDialogController
{
- std::unique_ptr<weld::Builder> m_xBuilder;
- std::unique_ptr<weld::MessageDialog> m_xDialog;
std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
std::unique_ptr<weld::Container> m_xOrigParent;
std::unique_ptr<weld::Container> m_xContentArea;
public:
ScReplaceWarnBox(weld::Window* pParent);
- ~ScReplaceWarnBox();
+ virtual ~ScReplaceWarnBox() override;
/** Opens dialog if IsDialogEnabled() returns true.
@descr If after executing the dialog the checkbox "Do not show again" is set,
the method DisableDialog() will be called. */
- short run();
+ short execute();
};
#endif
diff --git a/sc/source/ui/miscdlgs/strindlg.cxx b/sc/source/ui/miscdlgs/strindlg.cxx
index da9da0387e9a..d9100992db6b 100644
--- a/sc/source/ui/miscdlgs/strindlg.cxx
+++ b/sc/source/ui/miscdlgs/strindlg.cxx
@@ -28,8 +28,8 @@ ScStringInputDlg::ScStringInputDlg(weld::Window* pParent,
const OUString& rEditTitle,
const OUString& rDefault,
const OString& rHelpId, const OString& rEditHelpId)
- : m_xBuilder(Application::CreateBuilder(pParent, "modules/scalc/ui/inputstringdialog.ui"))
- , m_xDialog(m_xBuilder->weld_dialog("InputStringDialog"))
+ : GenericDialogController(pParent, "modules/scalc/ui/inputstringdialog.ui",
+ "InputStringDialog")
, m_xLabel(m_xBuilder->weld_label("description_label"))
, m_xEdInput(m_xBuilder->weld_entry("name_entry"))
{
diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index dbe87229c6f9..bc0302c4bcbd 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -26,8 +26,8 @@
#include <helpids.h>
ScReplaceWarnBox::ScReplaceWarnBox(weld::Window* pParent)
- : m_xBuilder(Application::CreateBuilder(pParent, "modules/scalc/ui/checkwarningdialog.ui"))
- , m_xDialog(m_xBuilder->weld_message_dialog("CheckWarningDialog"))
+ : MessageDialogController(pParent, "modules/scalc/ui/checkwarningdialog.ui",
+ "CheckWarningDialog")
// By default, the check box is ON, and the user needs to un-check it to
// disable all future warnings.
, m_xWarningOnBox(m_xBuilder->weld_check_button("ask"))
@@ -49,7 +49,7 @@ ScReplaceWarnBox::~ScReplaceWarnBox()
m_xOrigParent->add(m_xWarningOnBox.get());
}
-short ScReplaceWarnBox::run()
+short ScReplaceWarnBox::execute()
{
short nRet = RET_YES;
if( SC_MOD()->GetInputOptions().GetReplaceCellsWarn() )
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index dde0b99b3484..4c9fae9e1a11 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -1067,7 +1067,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand());
aDlg.SetEditHelpId(HID_PASSWD_DOC);
- if (aDlg.run() == RET_OK)
+ if (aDlg.execute() == RET_OK)
aPassword = aDlg.GetPassword();
else
bCancel = true;
@@ -1091,7 +1091,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
aDlg.ShowExtras(SfxShowExtras::CONFIRM);
aDlg.SetConfirmHelpId(HID_PASSWD_DOC_CONFIRM);
- if (aDlg.run() == RET_OK)
+ if (aDlg.execute() == RET_OK)
{
OUString aPassword = aDlg.GetPassword();
Protect( TABLEID_DOC, aPassword );
@@ -1137,7 +1137,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand());
aDlg.SetEditHelpId(HID_PASSWD_TABLE);
- if (aDlg.run() == RET_OK)
+ if (aDlg.execute() == RET_OK)
{
OUString aPassword = aDlg.GetPassword();
Unprotect(nTab, aPassword);
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index ae15097d2720..3afb0f466a32 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -841,7 +841,7 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument
if (!bIsEmpty)
{
ScReplaceWarnBox aBox(pParentWnd);
- if (aBox.run() != RET_YES)
+ if (aBox.execute() != RET_YES)
{
// changing the configuration is within the ScReplaceWarnBox
return false;