summaryrefslogtreecommitdiff
path: root/sc/source/ui/xmlsource
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-11-13 17:07:18 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-11-28 13:28:30 -0500
commit40eb44c1cdce10bd4bdc7e1a8da08591a5178b75 (patch)
tree828fe7a34f3698df8fd4865c20d77e814eedd7da /sc/source/ui/xmlsource
parent582931ec18c90ab4e60396256505d97578de6d84 (diff)
Enable the 'Import' button only when linked data exists.
It makes no sense to allow import if there is no link specified. Change-Id: I3ff4bfa7fd78c79a2c4ee74c7a1a34d2b7a2d1c4
Diffstat (limited to 'sc/source/ui/xmlsource')
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index dd1ab74753b9..08cf7cc17349 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -104,8 +104,10 @@ ScXMLSourceDlg::ScXMLSourceDlg(
aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl);
maRefEdit.SetModifyHdl(aLink);
+ maBtnOk.Disable();
+
SetNonLinkable();
- maBtnSelectSource.GrabFocus();
+ maBtnSelectSource.GrabFocus(); // Initial focus is on the select source button.
}
ScXMLSourceDlg::~ScXMLSourceDlg()
@@ -559,6 +561,10 @@ void ScXMLSourceDlg::RefEditModified()
else
maCellLinks.erase(pEntry);
}
+
+ // Enable the import button only when at least one link exists.
+ bool bHasLink = !maCellLinks.empty() || !maRangeLinks.empty();
+ maBtnOk.Enable(bHasLink);
}
IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl)