[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 13 14:08:43 PST 2012


 sc/source/ui/xmlsource/xmlsourcedlg.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit abc7bcaa11457aff57bfc45d765e297492a028b3
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Nov 13 17:07:18 2012 -0500

    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

diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index dd1ab74..08cf7cc 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)


More information about the Libreoffice-commits mailing list