summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-11-07 22:27:35 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-11-28 13:28:28 -0500
commit450bca12a14b090feb8e288da0ea2c5e2555b9ce (patch)
treed9f28ffcf71d6798b3428a4556a39cabe78f054e /sc
parent19d0fcd04ee36e66d64b0f3e3faf751f0c6cdc63 (diff)
Handler methods for OK and Cancel.
Change-Id: I8637543dc10ade3e75205031581eeaadd1b7ca4d
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/inc/xmlsourcedlg.hxx3
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx22
2 files changed, 23 insertions, 2 deletions
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index b75f32331882..058058a7da1e 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -92,6 +92,9 @@ private:
bool IsChildrenDirty(SvTreeListEntry* pEntry) const;
+ void OkPressed();
+ void CancelPressed();
+
DECL_LINK(GetFocusHdl, Control*);
DECL_LINK(LoseFocusHdl, Control*);
DECL_LINK(BtnPressedHdl, Button*);
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 69fb08d2efc8..2fd452de8d39 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -37,9 +37,9 @@ ScXMLSourceDlg::ScXMLSourceDlg(
maFtSourceFile(this, ScResId(FT_SOURCE_FILE)),
maFtMapXmlDoc(this, ScResId(FL_MAP_XML_TO_DOCUMENT)),
maFtMappedCellTitle(this, ScResId(FT_MAPPED_CELL_TITLE)),
+ maLbTree(this, ScResId(LB_SOURCE_TREE)),
maRefEdit(this, this, ScResId(ED_MAPPED_CELL)),
maRefBtn(this, ScResId(BTN_MAPPED_CELL), &maRefEdit, this),
- maLbTree(this, ScResId(LB_SOURCE_TREE)),
maBtnOk(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)),
maImgFileOpen(ScResId(IMG_FILE_OPEN)),
@@ -54,7 +54,10 @@ ScXMLSourceDlg::ScXMLSourceDlg(
maBtnSelectSource.SetModeImage(maImgFileOpen);
FreeResource();
- maBtnSelectSource.SetClickHdl(LINK(this, ScXMLSourceDlg, BtnPressedHdl));
+ Link aBtnHdl = LINK(this, ScXMLSourceDlg, BtnPressedHdl);
+ maBtnSelectSource.SetClickHdl(aBtnHdl);
+ maBtnOk.SetClickHdl(aBtnHdl);
+ maBtnCancel.SetClickHdl(aBtnHdl);
Link aLink = LINK(this, ScXMLSourceDlg, GetFocusHdl);
maRefEdit.SetGetFocusHdl(aLink);
@@ -388,6 +391,17 @@ bool ScXMLSourceDlg::IsChildrenDirty(SvTreeListEntry* pEntry) const
return false;
}
+void ScXMLSourceDlg::OkPressed()
+{
+ // Store the xml link data to document.
+ Close();
+}
+
+void ScXMLSourceDlg::CancelPressed()
+{
+ Close();
+}
+
IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl)
{
HandleGetFocus(pCtrl);
@@ -404,6 +418,10 @@ IMPL_LINK(ScXMLSourceDlg, BtnPressedHdl, Button*, pBtn)
{
if (pBtn == &maBtnSelectSource)
SelectSourceFile();
+ else if (pBtn == &maBtnOk)
+ OkPressed();
+ else if (pBtn == &maBtnCancel)
+ CancelPressed();
return 0;
}