summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-01-28 19:59:35 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-02-02 18:16:43 +0100
commit7685c0746cf0db6f51c6a7a488f4a960f8eab3c9 (patch)
tree9e68984782579ae58f685354b7f816a60f4807e9 /sw/inc
parenta2e533767bed88f293d2129aca9dfd9c4c60226b (diff)
tdf#121842 sw: add hyperlinks to toxmarks in ToC/User-Defined Index
The toxmark is identified by the type of index, the name of the index type (only for user-defined; there is only one ToC type), the text (either text:string-value or text content of the toxmark), and a counter to distinguish marks with the same text. Both text and type name can contain arbitrary characters so use U+0019 control character as separator. Links look like: #1%19text%19Utypename|toxmark Change-Id: I5aeec727e2cd3a02d676cf3ea4c302bf7c77d319 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110091 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/ToxTextGenerator.hxx5
-rw-r--r--sw/inc/swtypes.hxx2
2 files changed, 6 insertions, 1 deletions
diff --git a/sw/inc/ToxTextGenerator.hxx b/sw/inc/ToxTextGenerator.hxx
index 675835573266..d3a7e9177db0 100644
--- a/sw/inc/ToxTextGenerator.hxx
+++ b/sw/inc/ToxTextGenerator.hxx
@@ -27,6 +27,7 @@
#include <memory>
#include <vector>
+#include <unordered_map>
class SfxItemSet;
class SwAttrPool;
@@ -67,7 +68,9 @@ public:
* process @p numberOfEntriesToProcess entries.
*/
void
- GenerateText(SwDoc *doc, const std::vector<std::unique_ptr<SwTOXSortTabBase>>& entries,
+ GenerateText(SwDoc *doc,
+ std::unordered_map<OUString, int> & rMarkURLs,
+ const std::vector<std::unique_ptr<SwTOXSortTabBase>>& entries,
sal_uInt16 indexOfEntryToProcess, sal_uInt16 numberOfEntriesToProcess,
SwRootFrame const* pLayout);
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 24e9c248b167..c45ce1a5a216 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -129,6 +129,8 @@ SW_DLLPUBLIC Size GetGraphicSizeTwip( const Graphic&, vcl::RenderContext* pOutDe
const sal_Unicode cMarkSeparator = '|';
// Sequences names for jumps are <name of sequence>!<no>
const char cSequenceMarkSeparator = '!';
+/// separator for toxmarks: #<no>%19<text>%19<type><typename>|toxmark
+sal_Unicode const toxMarkSeparator = '\u0019';
#define DB_DELIM u'\x00ff' // Database <-> table separator.