[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sc/inc sc/source

Katarina Behrens (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 21 10:14:48 UTC 2019


 sc/inc/strings.hrc                 |    1 +
 sc/source/ui/miscdlgs/linkarea.cxx |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit b3c11020b7e54a258b2d4ebe20c6b5256f9401cf
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Thu May 9 20:46:45 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Jun 21 12:13:48 2019 +0200

    Make it more obvious that there are no named ranges
    
    and thus the selected doc can't be used as the source of external
    data for this sheet. In other words, help the user figure out
    why is OK button disabled
    
    Change-Id: Ie1b999c9c3640397e9f6f6ee321d3a5a5d63fa3b
    Reviewed-on: https://gerrit.libreoffice.org/72075
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Reviewed-on: https://gerrit.libreoffice.org/74432
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index ed0fc8df5663..1b52acabdd12 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -334,6 +334,7 @@
 #define STR_ANCHOR_TO_CELL                          NC_("STR_ANCHOR_TO_CELL", "To cell")
 #define STR_ANCHOR_TO_CELL_RESIZE                   NC_("STR_ANCHOR_TO_CELL_RESIZE", "To cell (resize with cell)")
 #define STR_ANCHOR_TO_PAGE                          NC_("STR_ANCHOR_TO_PAGE", "To page")
+#define STR_NO_NAMED_RANGES_AVAILABLE               NC_("STR_NO_NAMED_RANGES_AVAILABLE", "No named ranges available in the selected document")
 
 #endif
 
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 002bf482fd7e..6d413ad91146 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -35,6 +35,8 @@
 #include <rangeutl.hxx>
 #include <docsh.hxx>
 #include <tablink.hxx>
+#include <scresid.hxx>
+#include <strings.hrc>
 
 ScLinkedAreaDlg::ScLinkedAreaDlg(weld::Window* pParent)
     : GenericDialogController(pParent, "modules/scalc/ui/externaldata.ui", "ExternalDataDialog")
@@ -257,8 +259,13 @@ void ScLinkedAreaDlg::UpdateSourceRanges()
 
     m_xLbRanges->thaw();
 
-    if (m_xLbRanges->n_children() == 1)
+    if (m_xLbRanges->n_children() >= 1)
         m_xLbRanges->select(0);
+    else
+    {
+        m_xLbRanges->append_text(ScResId(STR_NO_NAMED_RANGES_AVAILABLE));
+        m_xLbRanges->set_sensitive(false);
+    }
 }
 
 void ScLinkedAreaDlg::UpdateEnable()


More information about the Libreoffice-commits mailing list