summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx56
-rw-r--r--cui/source/dialogs/iconcdlg.cxx23
-rw-r--r--cui/source/dialogs/iconcdlg.src26
-rw-r--r--cui/source/inc/cuihyperdlg.hxx2
-rw-r--r--cui/source/inc/cuires.hrc3
-rw-r--r--cui/source/inc/iconcdlg.hxx4
6 files changed, 62 insertions, 52 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 );
}
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index eed1d13cd671..4b1e48062e32 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -190,9 +190,10 @@ IconChoiceDialog::IconChoiceDialog ( Window* pParent, const OString& rID,
bItemsReset ( false )
{
get(m_pOKBtn, "ok");
+ get(m_pApplyBtn, "apply");
get(m_pCancelBtn, "cancel");
get(m_pHelpBtn, "help");
- get(m_pResetBtn, "back");
+ get(m_pResetBtn, "reset");
get(m_pIconCtrl, "icon_control");
get(m_pTabContainer, "tab");
@@ -213,11 +214,13 @@ IconChoiceDialog::IconChoiceDialog ( Window* pParent, const OString& rID,
// Buttons
m_pOKBtn->SetClickHdl ( LINK( this, IconChoiceDialog, OkHdl ) );
m_pOKBtn->SetHelpId( HID_ICCDIALOG_OK_BTN );
+ m_pApplyBtn->SetClickHdl ( LINK( this, IconChoiceDialog, ApplyHdl ) );
+ //m_pApplyBtn->SetHelpId( HID_ICCDIALOG_APPLY_BTN );
m_pCancelBtn->SetHelpId( HID_ICCDIALOG_CANCEL_BTN );
m_pResetBtn->SetClickHdl( LINK( this, IconChoiceDialog, ResetHdl ) );
- m_pResetBtn->SetText( CUI_RESSTR(RID_SVXSTR_ICONCHOICEDLG_RESETBUT) );
m_pResetBtn->SetHelpId( HID_ICCDIALOG_RESET_BTN );
m_pOKBtn->Show();
+ m_pApplyBtn->Show();
m_pCancelBtn->Show();
m_pHelpBtn->Show();
m_pResetBtn->Show();
@@ -392,6 +395,22 @@ IMPL_LINK_NOARG(IconChoiceDialog, OkHdl)
}
+IMPL_LINK_NOARG(IconChoiceDialog, ApplyHdl)
+{
+ bInOK = true;
+
+ if ( OK_Impl() )
+ {
+ if ( bModal )
+ EndDialog( Ok() );
+ else
+ {
+ Ok();
+ Close();
+ }
+ }
+ return 0;
+}
IMPL_LINK_NOARG(IconChoiceDialog, ResetHdl)
{
diff --git a/cui/source/dialogs/iconcdlg.src b/cui/source/dialogs/iconcdlg.src
deleted file mode 100644
index 4bcb78627515..000000000000
--- a/cui/source/dialogs/iconcdlg.src
+++ /dev/null
@@ -1,26 +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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include <cuires.hrc>
-
-String RID_SVXSTR_ICONCHOICEDLG_RESETBUT
-{
- Text [ en-US ] = "~Back" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index f32bc7147959..244c195ce817 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -68,12 +68,14 @@ private:
bool mbReadOnly : 1;
bool mbIsHTMLDoc : 1;
+ DECL_LINK (ClickOkHdl_Impl, void * );
DECL_LINK (ClickApplyHdl_Impl, void * );
DECL_LINK (ClickCloseHdl_Impl, void * );
protected:
virtual bool Close() SAL_OVERRIDE;
virtual void Move() SAL_OVERRIDE;
+ void Apply();
public:
SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings );
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index 18bd65134e36..d307d6839e7d 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -181,9 +181,6 @@
#define RID_SVXSTR_HYPERDLG_FROM_TEXT (RID_SVX_START + 814)
#define RID_SVXSTR_MNUCFG_ALREADY_INCLUDED (RID_SVX_START + 816)
-// icon choice
-#define RID_SVXSTR_ICONCHOICEDLG_RESETBUT (RID_SVX_START + 580)
-
// multi path dialog
#define RID_MULTIPATH_DBL_ERR (RID_SVX_START + 207)
#define RID_SVXSTR_ARCHIVE_TITLE (RID_SVX_START + 484)
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index ceb2f1933022..8248a720c5ff 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -134,6 +134,7 @@ private :
// Buttons
OKButton *m_pOKBtn;
+ PushButton *m_pApplyBtn;
CancelButton *m_pCancelBtn;
HelpButton *m_pHelpBtn;
PushButton *m_pResetBtn;
@@ -151,6 +152,7 @@ private :
DECL_LINK ( ChosePageHdl_Impl, void * );
DECL_LINK(OkHdl, void *);
+ DECL_LINK(ApplyHdl, void *);
DECL_LINK(ResetHdl, void *);
DECL_LINK(CancelHdl, void *);
@@ -201,6 +203,8 @@ public :
const OKButton& GetOKButton() const { return *m_pOKBtn; }
OKButton& GetOKButton() { return *m_pOKBtn; }
+ const PushButton& GetApplyButton() const { return *m_pApplyBtn; }
+ PushButton& GetApplyButton() { return *m_pApplyBtn; }
const CancelButton& GetCancelButton() const { return *m_pCancelBtn; }
CancelButton& GetCancelButton() { return *m_pCancelBtn; }
const HelpButton& GetHelpButton() const { return *m_pHelpBtn; }