summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/cuihyperdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/dialogs/cuihyperdlg.cxx')
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx56
1 files changed, 35 insertions, 21 deletions
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 5bf73b9415d8..ede512f2a248 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -113,7 +113,6 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
pEntry->SetQuickHelpText( CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCNTP_HELP ) );
// set OK/Cancel - button
- GetOKButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_APPLYBUT) );
GetCancelButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_CLOSEBUT) );
// create itemset for tabpages
@@ -151,7 +150,8 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
pBindings->Update( SID_READONLY_MODE );
- GetOKButton().SetClickHdl ( LINK ( this, SvxHpLinkDlg, ClickApplyHdl_Impl ) );
+ GetOKButton().SetClickHdl ( LINK ( this, SvxHpLinkDlg, ClickOkHdl_Impl ) );
+ GetApplyButton().SetClickHdl ( LINK ( this, SvxHpLinkDlg, ClickApplyHdl_Impl ) );
GetCancelButton().SetClickHdl( LINK ( this, SvxHpLinkDlg, ClickCloseHdl_Impl ) );
}
@@ -178,6 +178,29 @@ bool SvxHpLinkDlg::Close()
return true;
}
+void SvxHpLinkDlg::Apply()
+{
+ SfxItemSet aItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
+ SID_HYPERLINK_SETLINK );
+
+ SvxHyperlinkTabPageBase* pCurrentPage = (SvxHyperlinkTabPageBase*)
+ GetTabPage ( GetCurPageId() );
+
+ if ( pCurrentPage->AskApply() )
+ {
+ pCurrentPage->FillItemSet( &aItemSet );
+
+ SvxHyperlinkItem *aItem = (SvxHyperlinkItem *)
+ aItemSet.GetItem (SID_HYPERLINK_SETLINK);
+ OUString aStrEmpty;
+ if ( aItem->GetURL() != aStrEmpty )
+ GetDispatcher()->Execute( SID_HYPERLINK_SETLINK, SFX_CALLMODE_ASYNCHRON |
+ SFX_CALLMODE_RECORD, aItem, 0L);
+
+ ( (SvxHyperlinkTabPageBase*)GetTabPage ( GetCurPageId() ) )->DoApply();
+ }
+}
+
/*************************************************************************
|*
|* When extrawindow is visible and its never moved by user, then move that
@@ -231,6 +254,15 @@ void SvxHpLinkDlg::Move()
Window::Move();
}
+/// Click on OK button
+IMPL_LINK_NOARG(SvxHpLinkDlg, ClickOkHdl_Impl)
+{
+ Apply();
+ Close();
+
+ return ( 0L );
+}
+
/*************************************************************************
|*
|* Click on Apply-button
@@ -239,25 +271,7 @@ void SvxHpLinkDlg::Move()
IMPL_LINK_NOARG(SvxHpLinkDlg, ClickApplyHdl_Impl)
{
- SfxItemSet aItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
- SID_HYPERLINK_SETLINK );
-
- SvxHyperlinkTabPageBase* pCurrentPage = (SvxHyperlinkTabPageBase*)
- GetTabPage ( GetCurPageId() );
-
- if ( pCurrentPage->AskApply() )
- {
- pCurrentPage->FillItemSet( &aItemSet );
-
- SvxHyperlinkItem *aItem = (SvxHyperlinkItem *)
- aItemSet.GetItem (SID_HYPERLINK_SETLINK);
- OUString aStrEmpty;
- if ( aItem->GetURL() != aStrEmpty )
- GetDispatcher()->Execute( SID_HYPERLINK_SETLINK, SFX_CALLMODE_ASYNCHRON |
- SFX_CALLMODE_RECORD, aItem, 0L);
-
- ( (SvxHyperlinkTabPageBase*)GetTabPage ( GetCurPageId() ) )->DoApply();
- }
+ Apply();
return( 0L );
}