cui/inc/strings.hrc                |    1 -
 cui/source/dialogs/cuihyperdlg.cxx |   23 +++++++++--------------
 cui/source/dialogs/hldocntp.cxx    |   19 -------------------
 cui/source/dialogs/hltpbase.cxx    |    7 -------
 cui/source/inc/cuihyperdlg.hxx     |    2 +-
 cui/source/inc/hldocntp.hxx        |    1 -
 cui/source/inc/hltpbase.hxx        |    1 -
 7 files changed, 10 insertions(+), 44 deletions(-)

New commits:
commit c6620b4e538d21c1dfa321dde31b568eb8b8bd32
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Fri Jan 14 21:01:34 2022 +0100
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Tue Jan 18 23:21:06 2022 +0100

    tdf#146612 Drop confirmation question when applying new doc hyperlink
    
    To be consistent with other tabs of the dialog where Apply does
    not show a similar question
    
    Change-Id: Id3bced8ec861b7166974da5ad223513dbfec25c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128424
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <[email protected]>
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index e2c56b8a0d45..eb7d701db964 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -76,7 +76,6 @@
 #define RID_CUISTR_HYPDLG_MACROACT1                 
NC_("RID_SVXSTR_HYPDLG_MACROACT1", "Mouse over object")
 #define RID_CUISTR_HYPDLG_MACROACT2                 
NC_("RID_SVXSTR_HYPDLG_MACROACT2", "Trigger hyperlink")
 #define RID_CUISTR_HYPDLG_MACROACT3                 
NC_("RID_SVXSTR_HYPDLG_MACROACT3", "Mouse leaves object")
-#define RID_CUISTR_HYPDLG_NOVALIDFILENAME           
NC_("RID_SVXSTR_HYPDLG_NOVALIDFILENAME", "Please type in a valid file name.")
 #define RID_CUISTR_HYPERDLG_FORM_BUTTON             
NC_("RID_SVXSTR_HYPERDLG_FORM_BUTTON", "Button")
 #define RID_CUISTR_HYPERDLG_FROM_TEXT               
NC_("RID_SVXSTR_HYPERDLG_FROM_TEXT", "Text")
 #define RID_CUISTR_HYPERDLG_QUERYOVERWRITE          
NC_("RID_SVXSTR_HYPERDLG_QUERYOVERWRITE", "The file already exists. Overwrite?")
diff --git a/cui/source/dialogs/cuihyperdlg.cxx 
b/cui/source/dialogs/cuihyperdlg.cxx
index 3eef90cdf696..20c1b1e26f85 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -182,32 +182,27 @@ void SvxHpLinkDlg::Close()
         pViewFrame->ToggleChildWindow(SID_HYPERLINK_DIALOG);
 }
 
-void SvxHpLinkDlg::Apply( bool bWarn )
+void SvxHpLinkDlg::Apply()
 {
     SfxItemSetFixed<SID_HYPERLINK_GETLINK, SID_HYPERLINK_SETLINK> aItemSet( 
SfxGetpApp()->GetPool() );
 
     SvxHyperlinkTabPageBase* pCurrentPage = 
static_cast<SvxHyperlinkTabPageBase*>(
                                                 GetTabPage( GetCurPageId() ) );
 
-    // tdf#109390: only show warning that the dialog was not filled properly
-    // if the user pressed Apply
-    if ( pCurrentPage->AskApply( bWarn ) )
-    {
-        pCurrentPage->FillItemSet( &aItemSet );
+    pCurrentPage->FillItemSet( &aItemSet );
 
-        const SvxHyperlinkItem *aItem = 
aItemSet.GetItem(SID_HYPERLINK_SETLINK);
-        if ( !aItem->GetURL().isEmpty() )
-            GetDispatcher()->ExecuteList(SID_HYPERLINK_SETLINK,
-                    SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { aItem });
+    const SvxHyperlinkItem *aItem = aItemSet.GetItem(SID_HYPERLINK_SETLINK);
+    if ( !aItem->GetURL().isEmpty() )
+        GetDispatcher()->ExecuteList(SID_HYPERLINK_SETLINK,
+                SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { aItem });
 
-        static_cast<SvxHyperlinkTabPageBase*>( GetTabPage( GetCurPageId() ) 
)->DoApply();
-    }
+    static_cast<SvxHyperlinkTabPageBase*>( GetTabPage( GetCurPageId() ) 
)->DoApply();
 }
 
 /// Click on OK button
 IMPL_LINK_NOARG(SvxHpLinkDlg, ClickOkHdl_Impl, weld::Button&, void)
 {
-    Apply( false );
+    Apply();
     m_xDialog->response(RET_OK);
 }
 
@@ -218,7 +213,7 @@ IMPL_LINK_NOARG(SvxHpLinkDlg, ClickOkHdl_Impl, 
weld::Button&, void)
 |************************************************************************/
 IMPL_LINK_NOARG(SvxHpLinkDlg, ClickApplyHdl_Impl, weld::Button&, void)
 {
-    Apply( true );
+    Apply();
 }
 
 /*************************************************************************
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 93921c0bd302..c8233360ce7a 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -234,25 +234,6 @@ void SvxHyperlinkNewDocTp::SetInitFocus()
     m_xCbbPath->grab_focus();
 }
 
-/*************************************************************************
-|*
-|* Ask page whether an insert is possible
-|*
-\************************************************************************/
-bool SvxHyperlinkNewDocTp::AskApply( bool bShowWarning )
-{
-    INetURLObject aINetURLObject;
-    bool bRet = ImplGetURLObject(m_xCbbPath->get_active_text(), 
m_xCbbPath->GetBaseURL(), aINetURLObject);
-    if ( !bRet && bShowWarning )
-    {
-        std::unique_ptr<weld::MessageDialog> 
xWarn(Application::CreateMessageDialog(mpDialog->getDialog(),
-                                                   VclMessageType::Warning, 
VclButtonsType::Ok,
-                                                   
CuiResId(RID_CUISTR_HYPDLG_NOVALIDFILENAME)));
-        xWarn->run();
-    }
-    return bRet;
-}
-
 namespace
 {
     struct ExecuteInfo
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index abd707422aa3..fb64eecdfd97 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -292,13 +292,6 @@ void SvxHyperlinkTabPageBase::DoApply ()
     // default-implementation : do nothing
 }
 
-// Ask page whether an insert is possible
-bool SvxHyperlinkTabPageBase::AskApply ( bool /* bShowWarning */ )
-{
-    // default-implementation
-    return true;
-}
-
 // This method would be called from bookmark-window to set new mark-string
 void SvxHyperlinkTabPageBase::SetMarkStr ( const OUString& /*aStrMark*/ )
 {
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index 2e2b1801a8ef..b43361edfea1 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -106,7 +106,7 @@ private:
 
     void Activate() override;
     virtual void Close() override;
-    void Apply( bool bWarn );
+    void Apply();
 
 public:
     SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld::Window* 
pParent);
diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx
index 7e153d6912c3..227840f68481 100644
--- a/cui/source/inc/hldocntp.hxx
+++ b/cui/source/inc/hldocntp.hxx
@@ -52,7 +52,6 @@ public:
 
     static std::unique_ptr<IconChoicePage> Create(weld::Container* pWindow, 
SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet);
 
-    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 0bfb7dfcf526..e3c399bd48b5 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -105,7 +105,6 @@ public:
         mxDocumentFrame = rxDocumentFrame;
     }
 
-    virtual bool AskApply ( bool bShowWarning );
     virtual void DoApply ();
     virtual void SetInitFocus();
     virtual void SetMarkStr ( const OUString& aStrMark );

Reply via email to