summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMaya Stephens <maya.stephens@collabora.com>2025-08-18 14:39:15 +0000
committerMichael Stahl <michael.stahl@collabora.com>2025-09-09 15:52:12 +0200
commit07fd215222539c396b042a2ef4fcb44412d1b64b (patch)
treed16af1c0b756fa40fdb2dec339ff10e57da6a49d /sc
parent0c6ffd3bbf410aed3e69f39556aac8bb15923c0d (diff)
Hide hyperlink dialog fields based on selection
Hides the name field in all cases except writer text or draw text, as these seem to be the only types of text that can store link names. Hides text field for non-text links, such as shapes or images. If a shell does not set the properties m_showText or m_showName, deafult values to true, to avoid regressions for unimplemented shells. Change-Id: I228dc7f9d65c5cb17717afb79feb515376cd4d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189885 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Stahl <michael.stahl@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190678 Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx1
-rw-r--r--sc/source/ui/view/cellsh.cxx1
-rw-r--r--sc/source/ui/view/editsh.cxx1
4 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 1cdb33ee05fe..1031db8dbbbb 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -61,6 +61,8 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
// Hyperlink
SvxHyperlinkItem aHLinkItem;
+ aHLinkItem.SetShowName(false);
+ aHLinkItem.SetShowText(false);
if ( rMarkList.GetMarkCount() == 1 ) // URL-Button marked ?
{
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 8ef747b95a25..c3bfca0aa71a 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -379,6 +379,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if ( rSet.GetItemState( SID_HYPERLINK_GETLINK ) != SfxItemState::UNKNOWN )
{
SvxHyperlinkItem aHLinkItem;
+ aHLinkItem.SetShowName(false);
SdrView* pView = mrViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if ( pOutView )
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 1318a71aab95..fa646cc67896 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -679,6 +679,7 @@ void ScCellShell::GetHLinkState( SfxItemSet& rSet )
// if the cell at the cursor contains only a link, return that link
SvxHyperlinkItem aHLinkItem;
+ aHLinkItem.SetShowName(false);
if ( !GetViewData().GetView()->HasBookmarkAtCursor( &aHLinkItem ) )
{
// tdf#80043 - put selected text into item
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 3762298a4c7d..024cb8cd1ac0 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -784,6 +784,7 @@ void ScEditShell::GetState( SfxItemSet& rSet )
case SID_HYPERLINK_GETLINK:
{
SvxHyperlinkItem aHLinkItem;
+ aHLinkItem.SetShowName(false);
bool bCellLinksOnly
= (ScModule::get()->GetAppOptions().GetLinksInsertedLikeMSExcel()
&& rViewData.GetSfxDocShell().GetMedium()->GetFilter()->IsMSOFormat())