diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-13 17:07:18 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-28 13:28:30 -0500 |
commit | 40eb44c1cdce10bd4bdc7e1a8da08591a5178b75 (patch) | |
tree | 828fe7a34f3698df8fd4865c20d77e814eedd7da | |
parent | 582931ec18c90ab4e60396256505d97578de6d84 (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
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 8 |
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) |