summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2013-10-16 19:09:41 +0200
committerThomas Arnhold <thomas@arnhold.org>2013-10-16 20:34:40 +0200
commit4b1ebf998b344535d20a6205b915c21996fc06d7 (patch)
tree82e7642dfbf09956c000f840de6edea7fd7893ba
parentffff47459274d6187bb0ea6533f5acc0e7b7ed92 (diff)
fdo#63271: Close hyperlink dialog after hyperlink is inserted
Also label it with "Ok" which reflects the new behavior better. Change-Id: If8adde315c2d822e3210a0dcae7055519e5e558d
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx11
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx10
-rw-r--r--cui/source/dialogs/hlmarkwn.hrc2
-rw-r--r--cui/source/dialogs/hlmarkwn.src4
-rw-r--r--cui/source/inc/cuihyperdlg.hxx2
-rw-r--r--cui/source/inc/hlmarkwn.hxx4
6 files changed, 17 insertions, 16 deletions
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index e0bb226d95ee..0be013f253b0 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -137,7 +137,7 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
GetOKButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_APPLYBUT) );
GetCancelButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_CLOSEBUT) );
- GetOKButton().SetClickHdl ( LINK ( this, SvxHpLinkDlg, ClickApplyHdl_Impl ) );
+ GetOKButton().SetClickHdl ( LINK ( this, SvxHpLinkDlg, ClickOkHdl_Impl ) );
GetCancelButton().SetClickHdl( LINK ( this, SvxHpLinkDlg, ClickCloseHdl_Impl ) );
}
@@ -219,11 +219,11 @@ void SvxHpLinkDlg::Move()
/*************************************************************************
|*
-|* Click on Apply-button
+|* Click on Ok-button
|*
|************************************************************************/
-IMPL_LINK_NOARG(SvxHpLinkDlg, ClickApplyHdl_Impl)
+IMPL_LINK_NOARG(SvxHpLinkDlg, ClickOkHdl_Impl)
{
SfxItemSet aItemSet( SFX_APP()->GetPool(), SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK );
@@ -238,14 +238,15 @@ IMPL_LINK_NOARG(SvxHpLinkDlg, ClickApplyHdl_Impl)
SvxHyperlinkItem *aItem = (SvxHyperlinkItem *)
aItemSet.GetItem (SID_HYPERLINK_SETLINK);
- OUString aStrEmpty;
- if ( aItem->GetURL() != aStrEmpty )
+ if ( !aItem->GetURL().isEmpty() )
GetDispatcher()->Execute( SID_HYPERLINK_SETLINK, SFX_CALLMODE_ASYNCHRON |
SFX_CALLMODE_RECORD, aItem, 0L);
( (SvxHyperlinkTabPageBase*)GetTabPage ( GetCurPageId() ) )->DoApply();
}
+ Close();
+
return( 0L );
}
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index e957e3940626..7bd2c7649fa3 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -121,7 +121,7 @@ void SvxHlmarkTreeLBox::Paint( const Rectangle& rRect )
SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd( SvxHyperlinkTabPageBase *pParent )
: ModalDialog( (Window*)pParent, CUI_RES ( RID_SVXFLOAT_HYPERLINK_MARKWND ) ),
- maBtApply( this, CUI_RES (BT_APPLY) ),
+ maBtOk( this, CUI_RES (BT_OK) ),
maBtClose( this, CUI_RES (BT_CLOSE) ),
maLbTree ( this, CUI_RES (TLB_MARK) ),
mbUserMoved ( sal_False ),
@@ -130,9 +130,9 @@ SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd( SvxHyperlinkTabPageBase *pParent )
{
FreeResource();
- maBtApply.SetClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl ) );
+ maBtOk.SetClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickOkHdl_Impl ) );
maBtClose.SetClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickCloseHdl_Impl ) );
- maLbTree.SetDoubleClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl ) );
+ maLbTree.SetDoubleClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickOkHdl_Impl ) );
// add lines to the Tree-ListBox
maLbTree.SetStyle( maLbTree.GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
@@ -532,11 +532,11 @@ bool SvxHlinkDlgMarkWnd::SelectEntry(OUString aStrMark)
/*************************************************************************
|*
-|* Click on Apply-Button / Doubleclick on item in tree
+|* Click on Ok-Button / Doubleclick on item in tree
|*
|************************************************************************/
-IMPL_LINK_NOARG(SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl)
+IMPL_LINK_NOARG(SvxHlinkDlgMarkWnd, ClickOkHdl_Impl)
{
SvTreeListEntry* pEntry = maLbTree.GetCurEntry();
diff --git a/cui/source/dialogs/hlmarkwn.hrc b/cui/source/dialogs/hlmarkwn.hrc
index 2c4b6ac22cf7..f9379814b2b1 100644
--- a/cui/source/dialogs/hlmarkwn.hrc
+++ b/cui/source/dialogs/hlmarkwn.hrc
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#define BT_APPLY 1
+#define BT_OK 1
#define BT_CLOSE 2
#define TLB_MARK 3
#define STR_MARK_TREE 5000
diff --git a/cui/source/dialogs/hlmarkwn.src b/cui/source/dialogs/hlmarkwn.src
index 10fc781c7c47..c035163467dd 100644
--- a/cui/source/dialogs/hlmarkwn.src
+++ b/cui/source/dialogs/hlmarkwn.src
@@ -33,14 +33,14 @@ ModalDialog RID_SVXFLOAT_HYPERLINK_MARKWND
SVLook = TRUE ;
Size = MAP_APPFONT ( 109 , 185 ) ;
Text [ en-US ] = "Target in Document" ;
- PushButton BT_APPLY
+ PushButton BT_OK
{
HelpId = HID_HYPERLINK_MARKWND_APPLY;
Pos = MAP_APPFONT ( 3 , 168 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
- Text [ en-US ] = "Apply" ;
+ Text [ en-US ] = "Ok" ;
};
PushButton BT_CLOSE
{
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index 9e976dfed2bd..a372e5d23de2 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -69,7 +69,7 @@ private:
sal_Bool mbReadOnly : 1;
sal_Bool mbIsHTMLDoc : 1;
- DECL_LINK (ClickApplyHdl_Impl, void * );
+ DECL_LINK (ClickOkHdl_Impl, void * );
DECL_LINK (ClickCloseHdl_Impl, void * );
protected:
diff --git a/cui/source/inc/hlmarkwn.hxx b/cui/source/inc/hlmarkwn.hxx
index edb1013e6a8f..f2ee1b0d2ee1 100644
--- a/cui/source/inc/hlmarkwn.hxx
+++ b/cui/source/inc/hlmarkwn.hxx
@@ -58,7 +58,7 @@ class SvxHlinkDlgMarkWnd : public ModalDialog //FloatingWindow
private:
friend class SvxHlmarkTreeLBox;
- PushButton maBtApply;
+ PushButton maBtOk;
PushButton maBtClose;
SvxHlmarkTreeLBox maLbTree;
@@ -80,7 +80,7 @@ protected:
virtual void Move ();
- DECL_LINK (ClickApplyHdl_Impl, void * );
+ DECL_LINK (ClickOkHdl_Impl, void * );
DECL_LINK (ClickCloseHdl_Impl, void * );
public: