summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw
diff options
context:
space:
mode:
authorVojtěch Doležal <dolezvo1@cvut.cz>2023-04-06 00:25:34 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-05-05 08:32:09 +0200
commitd543eb2d8e45999a3d8fa6134f0d98f08acb8037 (patch)
treed5a1c6d1e2b2d5cd7084746f6428d03d9c35a802 /sw/source/uibase/docvw
parent671d1c6cd14b28b5960ad56086299bd69533dfd8 (diff)
Reworked bibliography mark link target to have user-selectable type
Without this change, havign no link is not possible, if the bibliography entry has URL. This commit adds a select box for user to choose between target types (Entry URL, specific Target URL, None, bibliography table row) The main features are that it also makes it more obvious to the user and makes it possible to easily extend target types in the future. As for compatibility, files from before 7b99871635 are fully compatible without any hurdles, as missing property maps to the old behaviour. Bibliography marks saved after 7b99871635 will also revert to the old behaviour, however no actual data (such as target URLs) will be lost. Change-Id: Iad61dd8b4df337fa202f45d117313ee47ec20c05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150708 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r--sw/source/uibase/docvw/edtwin2.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index a98d38cf1e79..1c9563782050 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -575,16 +575,13 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
const auto pAuthorityField = static_cast<const SwAuthorityField*>(pField);
sText = pAuthorityField->GetAuthority(rSh.GetLayout());
- if (!pAuthorityField->UseTargetURL() && pAuthorityField->HasURL())
+ if (auto t = pAuthorityField->GetTargetType();
+ t == SwAuthorityField::TargetType::UseDisplayURL
+ || t == SwAuthorityField::TargetType::UseTargetURL)
{
const OUString& rURL = pAuthorityField->GetAbsoluteURL();
sText += "\n" + SfxHelp::GetURLHelpText(rURL);
}
- else if (pAuthorityField->UseTargetURL() && pAuthorityField->HasTargetURL())
- {
- const OUString& rURL = pAuthorityField->GetAbsoluteTargetURL();
- sText += "\n" + SfxHelp::GetURLHelpText(rURL);
- }
break;
}