summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-03-29 03:41:05 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-04-04 09:07:44 +0000
commite099c5bdaa458105148059228ec11c98b9d13029 (patch)
tree2aecedc6780a6f95552095bca50ab64c98967139 /sfx2
parentd69c03a3520205db549b2c84e7825967c8ea3ac5 (diff)
Make InputDialog class global to reuse it's code and tdf#97425
tdf#97425 -> Use InputDialog to edit Java Class Parameter Change-Id: I41ac9ffbc660c4bbb9d4fd3335e95d64ccdd2842 Reviewed-on: https://gerrit.libreoffice.org/23580 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/backingwindow.cxx2
-rw-r--r--sfx2/source/dialog/inputdlg.cxx17
-rw-r--r--sfx2/source/doc/templatedlg.cxx12
-rw-r--r--sfx2/source/inc/inputdlg.hxx42
4 files changed, 22 insertions, 51 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index f2c448e9feb2..bb3ec7735b01 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -18,7 +18,7 @@
*/
#include "backingwindow.hxx"
-#include "inputdlg.hxx"
+#include <sfx2/inputdlg.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
diff --git a/sfx2/source/dialog/inputdlg.cxx b/sfx2/source/dialog/inputdlg.cxx
index 8aa717d4a56e..427f2862ed5b 100644
--- a/sfx2/source/dialog/inputdlg.cxx
+++ b/sfx2/source/dialog/inputdlg.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "inputdlg.hxx"
+#include <sfx2/inputdlg.hxx>
#include <sfx2/sfxresid.hxx>
#include <vcl/button.hxx>
@@ -21,6 +21,7 @@ InputDialog::InputDialog(const OUString &rLabelText, vcl::Window *pParent)
get(m_pLabel, "label");
get(m_pOK, "ok");
get(m_pCancel, "cancel");
+ get(m_pHelp, "help");
m_pLabel->SetText(rLabelText);
m_pOK->SetClickHdl(LINK(this,InputDialog,ClickHdl));
m_pCancel->SetClickHdl(LINK(this,InputDialog,ClickHdl));
@@ -37,14 +38,26 @@ void InputDialog::dispose()
m_pLabel.clear();
m_pOK.clear();
m_pCancel.clear();
+ m_pHelp.clear();
ModalDialog::dispose();
}
-OUString InputDialog::getEntryText() const
+void InputDialog::HideHelpBtn()
+{
+ m_pHelp->Hide();
+}
+
+OUString InputDialog::GetEntryText() const
{
return m_pEntry->GetText();
}
+void InputDialog::SetEntryText( OUString const & sStr)
+{
+ m_pEntry->SetText(sStr);
+ m_pEntry->SetCursorAtLast();
+}
+
IMPL_LINK_TYPED(InputDialog,ClickHdl, Button*, pButton, void)
{
EndDialog(pButton == m_pOK ? RET_OK : RET_CANCEL);
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index e008e95f7ab4..c959c029d9eb 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -9,7 +9,7 @@
#include <sfx2/templatedlg.hxx>
-#include "inputdlg.hxx"
+#include <sfx2/inputdlg.hxx>
#include "templatesearchview.hxx"
#include "templatesearchviewitem.hxx"
@@ -1266,7 +1266,7 @@ void SfxTemplateManagerDlg::OnFolderNew()
if (ret)
{
- OUString aName = dlg->getEntryText();
+ OUString aName = dlg->GetEntryText();
mpCurView->createRegion(aName);
}
@@ -1331,7 +1331,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
if (aDlg->Execute())
{
- OUString aName = aDlg->getEntryText();
+ OUString aName = aDlg->GetEntryText();
if (!aName.isEmpty())
{
@@ -1471,7 +1471,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)
if (ret)
{
- OUString aName = dlg->getEntryText();
+ OUString aName = dlg->GetEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
@@ -1519,7 +1519,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)
if (ret)
{
- OUString aName = dlg->getEntryText();
+ OUString aName = dlg->GetEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
@@ -1573,7 +1573,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
if (ret)
{
- OUString aName = dlg->getEntryText();
+ OUString aName = dlg->GetEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
diff --git a/sfx2/source/inc/inputdlg.hxx b/sfx2/source/inc/inputdlg.hxx
deleted file mode 100644
index fb199a842fd2..000000000000
--- a/sfx2/source/inc/inputdlg.hxx
+++ /dev/null
@@ -1,42 +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/.
- */
-
-#ifndef INCLUDED_SFX2_SOURCE_INC_INPUTDLG_HXX
-#define INCLUDED_SFX2_SOURCE_INC_INPUTDLG_HXX
-
-#include <vcl/dialog.hxx>
-
-class Edit;
-class FixedText;
-class PushButton;
-class Button;
-
-class InputDialog : public ModalDialog
-{
-public:
- InputDialog (const OUString &labelText, vcl::Window *pParent = nullptr);
- OUString getEntryText () const;
- virtual ~InputDialog();
- virtual void dispose() override;
-
-private:
-
- DECL_LINK_TYPED(ClickHdl, Button*, void);
-
-private:
-
- VclPtr<Edit> m_pEntry;
- VclPtr<FixedText> m_pLabel;
- VclPtr<PushButton> m_pOK;
- VclPtr<PushButton> m_pCancel;
-};
-
-#endif // INCLUDED_SFX2_SOURCE_INC_INPUTDLG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */