sc/source/ui/view/editsh.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit a0096182d3b027d5e71aaef4e4d1595683605210
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Fri Jan 5 14:44:21 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jan 8 15:59:53 2024 +0100

    LOK: disallow entering multiple hyperlinks in spreadsheet cells
    
    This is for UX consistency. Previously it was allowed to enter
    multiple hyperlinks in spreadsheet cells when the spreadsheet
    was in OpenDocument format. Only in case of XLS/XLSX it was
    not possible. But we got a feedback that it is desirable to have
    a similar user experience for all spreadsheet file formats in
    Online. In LibreOffice nothing changes, it works according to the
    setting in Options - LibreOffice Calc - Compatibility - Hyperlinks.
    
    Change-Id: I7eece4307289711e9c925c05085497afaafe600e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161667
    Reviewed-by: Attila Szűcs <attila.sz...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161688
    Tested-by: Jenkins

diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 9ed398fb9876..c392f111e203 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <comphelper/string.hxx>
+#include <comphelper/lok.hxx>
 #include <scitems.hxx>
 #include <editeng/eeitem.hxx>
 #include <i18nutil/unicode.hxx>
@@ -572,8 +573,9 @@ void ScEditShell::Execute( SfxRequest& rReq )
                     SvxLinkInsertMode eMode = pHyper->GetInsertMode();
 
                     bool bCellLinksOnly
-                        = 
SC_MOD()->GetAppOptions().GetLinksInsertedLikeMSExcel()
-                          && 
rViewData.GetSfxDocShell()->GetMedium()->GetFilter()->IsMSOFormat();
+                        = 
(SC_MOD()->GetAppOptions().GetLinksInsertedLikeMSExcel()
+                          && 
rViewData.GetSfxDocShell()->GetMedium()->GetFilter()->IsMSOFormat())
+                          || comphelper::LibreOfficeKit::isActive();
 
                     bool bDone = false;
                     if ( (eMode == HLINK_DEFAULT || eMode == HLINK_FIELD) && 
!bCellLinksOnly )
@@ -786,8 +788,9 @@ void ScEditShell::GetState( SfxItemSet& rSet )
                 {
                     SvxHyperlinkItem aHLinkItem;
                     bool bCellLinksOnly
-                        = 
SC_MOD()->GetAppOptions().GetLinksInsertedLikeMSExcel()
-                          && 
rViewData.GetSfxDocShell()->GetMedium()->GetFilter()->IsMSOFormat();
+                        = 
(SC_MOD()->GetAppOptions().GetLinksInsertedLikeMSExcel()
+                          && 
rViewData.GetSfxDocShell()->GetMedium()->GetFilter()->IsMSOFormat())
+                          || comphelper::LibreOfficeKit::isActive();
                     std::unique_ptr<const SvxFieldData> 
aSvxFieldDataPtr(GetURLField());
                     const SvxURLField* pURLField(static_cast<const 
SvxURLField*>(aSvxFieldDataPtr.get()));
                     if (!bCellLinksOnly)

Reply via email to