summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorGabor Kelemen <kelemeng@ubuntu.com>2021-12-17 17:28:38 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-12-21 23:28:59 +0100
commit6fef768289f4dfa441a109282d253154a20a6123 (patch)
tree55e115eb626201d875a244ccf4211cf514a1659c /cui
parentbddf28af4a6fccb715fd29ad38fa100d2ac011a4 (diff)
tdf#109390 Warn about empty New Document only on Apply, not OK
Creating new document type hyperlink shows a warning about empty file name only when pressing Apply, and closes silently on OK Change-Id: I00e7b20a12df8e35e154e3cf532067cbad72c614 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127010 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx10
-rw-r--r--cui/source/dialogs/hldocntp.cxx4
-rw-r--r--cui/source/dialogs/hltpbase.cxx2
-rw-r--r--cui/source/inc/cuihyperdlg.hxx3
-rw-r--r--cui/source/inc/hldocntp.hxx2
-rw-r--r--cui/source/inc/hltpbase.hxx2
6 files changed, 13 insertions, 10 deletions
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index e695ea331d34..3eef90cdf696 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -182,14 +182,16 @@ void SvxHpLinkDlg::Close()
pViewFrame->ToggleChildWindow(SID_HYPERLINK_DIALOG);
}
-void SvxHpLinkDlg::Apply()
+void SvxHpLinkDlg::Apply( bool bWarn )
{
SfxItemSetFixed<SID_HYPERLINK_GETLINK, SID_HYPERLINK_SETLINK> aItemSet( SfxGetpApp()->GetPool() );
SvxHyperlinkTabPageBase* pCurrentPage = static_cast<SvxHyperlinkTabPageBase*>(
GetTabPage( GetCurPageId() ) );
- if ( pCurrentPage->AskApply() )
+ // tdf#109390: only show warning that the dialog was not filled properly
+ // if the user pressed Apply
+ if ( pCurrentPage->AskApply( bWarn ) )
{
pCurrentPage->FillItemSet( &aItemSet );
@@ -205,7 +207,7 @@ void SvxHpLinkDlg::Apply()
/// Click on OK button
IMPL_LINK_NOARG(SvxHpLinkDlg, ClickOkHdl_Impl, weld::Button&, void)
{
- Apply();
+ Apply( false );
m_xDialog->response(RET_OK);
}
@@ -216,7 +218,7 @@ IMPL_LINK_NOARG(SvxHpLinkDlg, ClickOkHdl_Impl, weld::Button&, void)
|************************************************************************/
IMPL_LINK_NOARG(SvxHpLinkDlg, ClickApplyHdl_Impl, weld::Button&, void)
{
- Apply();
+ Apply( true );
}
/*************************************************************************
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 8cf22584aa9a..980a10d8c225 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -241,11 +241,11 @@ void SvxHyperlinkNewDocTp::SetInitFocus()
|* Ask page whether an insert is possible
|*
\************************************************************************/
-bool SvxHyperlinkNewDocTp::AskApply()
+bool SvxHyperlinkNewDocTp::AskApply( bool bShowWarning )
{
INetURLObject aINetURLObject;
bool bRet = ImplGetURLObject(m_xCbbPath->get_active_text(), m_xCbbPath->GetBaseURL(), aINetURLObject);
- if ( !bRet )
+ if ( !bRet && bShowWarning )
{
std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(mpDialog->getDialog(),
VclMessageType::Warning, VclButtonsType::Ok,
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 820d34a3eb6b..abd707422aa3 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -293,7 +293,7 @@ void SvxHyperlinkTabPageBase::DoApply ()
}
// Ask page whether an insert is possible
-bool SvxHyperlinkTabPageBase::AskApply ()
+bool SvxHyperlinkTabPageBase::AskApply ( bool /* bShowWarning */ )
{
// default-implementation
return true;
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index b43361edfea1..fc94a2c973ef 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -106,7 +106,8 @@ private:
void Activate() override;
virtual void Close() override;
- void Apply();
+ void Apply( bool bWarn );
+ bool AskApply (bool bShowWarning);
public:
SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld::Window* pParent);
diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx
index 95a11dd9f1fc..7e153d6912c3 100644
--- a/cui/source/inc/hldocntp.hxx
+++ b/cui/source/inc/hldocntp.hxx
@@ -52,7 +52,7 @@ public:
static std::unique_ptr<IconChoicePage> Create(weld::Container* pWindow, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet);
- virtual bool AskApply () override;
+ virtual bool AskApply ( bool bShowWarning ) override;
virtual void DoApply () override;
virtual void SetInitFocus() override;
diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx
index 2ad0007c83cb..0bfb7dfcf526 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -105,7 +105,7 @@ public:
mxDocumentFrame = rxDocumentFrame;
}
- virtual bool AskApply ();
+ virtual bool AskApply ( bool bShowWarning );
virtual void DoApply ();
virtual void SetInitFocus();
virtual void SetMarkStr ( const OUString& aStrMark );