summaryrefslogtreecommitdiff
path: root/xmloff/source
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 /xmloff/source
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 'xmloff/source')
-rw-r--r--xmloff/source/core/xmltoken.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx12
-rw-r--r--xmloff/source/text/txtfldi.cxx6
-rw-r--r--xmloff/source/token/tokens.txt2
4 files changed, 11 insertions, 11 deletions
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 30ea348588ce..e0189451803b 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3473,8 +3473,8 @@ namespace xmloff::token {
TOKEN("margin-gutter", XML_MARGIN_GUTTER),
TOKEN("local-url", XML_LOCAL_URL),
+ TOKEN("target-type", XML_TARGET_TYPE),
TOKEN("target-url", XML_TARGET_URL),
- TOKEN("use-target-url", XML_USE_TARGET_URL),
TOKEN("dir", XML_DIR ),
TOKEN("displaystyle", XML_DISPLAYSTYLE ),
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 67e9137cc615..a6a0936423d8 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2713,8 +2713,8 @@ void XMLTextFieldExport::ProcessBibliographyData(
sStr = GetExport().GetRelativeReference(sStr);
}
sal_uInt16 nPrefix = XML_NAMESPACE_TEXT;
- if (eElement == XML_LOCAL_URL || eElement == XML_TARGET_URL
- || eElement == XML_USE_TARGET_URL)
+ if (eElement == XML_LOCAL_URL || eElement == XML_TARGET_TYPE
+ || eElement == XML_TARGET_URL)
{
nPrefix = XML_NAMESPACE_LO_EXT;
}
@@ -3415,13 +3415,13 @@ enum XMLTokenEnum XMLTextFieldExport::MapBibliographyFieldName(std::u16string_vi
{
eName = XML_LOCAL_URL;
}
- else if (sName == u"TargetURL")
+ else if (sName == u"TargetType")
{
- eName = XML_TARGET_URL;
+ eName = XML_TARGET_TYPE;
}
- else if (sName == u"UseTargetURL")
+ else if (sName == u"TargetURL")
{
- eName = XML_USE_TARGET_URL;
+ eName = XML_TARGET_URL;
}
else
{
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index e2fad89cac9d..af89551343c8 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -3113,12 +3113,12 @@ const char* XMLBibliographyFieldImportContext::MapBibliographyFieldName(
case XML_LOCAL_URL:
pName = "LocalURL";
break;
+ case XML_TARGET_TYPE:
+ pName = "TargetType";
+ break;
case XML_TARGET_URL:
pName = "TargetURL";
break;
- case XML_USE_TARGET_URL:
- pName = "UseTargetURL";
- break;
default:
assert(false && "Unknown bibliography info data");
pName = nullptr;
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 8a5615a0a790..d1932e24e103 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -3220,8 +3220,8 @@ page-content-top
page-content-bottom
margin-gutter
local-url
+target-type
target-url
-use-target-url
dir
displaystyle
infinity