[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/inc sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 17 13:32:19 UTC 2019
sw/inc/strings.hrc | 7 +++++++
sw/source/uibase/utlui/unotools.cxx | 27 +++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
New commits:
commit 4d08e9783127931238a7d6bfba3ad1fa051b8aa2
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Dec 16 12:45:43 2019 +0000
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Tue Dec 17 14:31:25 2019 +0100
Resolves: tdf#129355 mark toc index marks translatable
Change-Id: I039c5fb47ff65b0b1646f28b096ca1ae66e4bc72
Reviewed-on: https://gerrit.libreoffice.org/85215
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 4ebde6f969f0c774586fda46890075ea39d1f942)
Reviewed-on: https://gerrit.libreoffice.org/85287
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index cc421939d2e2..8c771426ef00 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -369,6 +369,13 @@
#define STR_IDXEXAMPLE_IDXTXT_ENTRY12 NC_("STR_IDXEXAMPLE_IDXTXT_ENTRY12", "This is the content from chapter 1.2. This keyword is a main entry.")
#define STR_IDXEXAMPLE_IDXTXT_TABLE1 NC_("STR_IDXEXAMPLE_IDXTXT_TABLE1", "Table 1: This is table 1")
#define STR_IDXEXAMPLE_IDXTXT_IMAGE1 NC_("STR_IDXEXAMPLE_IDXTXT_IMAGE1", "Image 1: This is image 1")
+#define STR_IDXEXAMPLE_IDXMARK_CHAPTER NC_("STR_IDXEXAMPLE_IDXMARK_CHAPTER", "Chapter")
+#define STR_IDXEXAMPLE_IDXMARK_KEYWORD NC_("STR_IDXEXAMPLE_IDXMARK_KEYWORD", "Keyword")
+#define STR_IDXEXAMPLE_IDXMARK_USER_DIR_ENTRY NC_("STR_IDXEXAMPLE_IDXMARK_USER_DIR_ENTRY", "User Directory Entry")
+#define STR_IDXEXAMPLE_IDXMARK_ENTRY NC_("STR_IDXEXAMPLE_IDXMARK_ENTRY", "Entry")
+#define STR_IDXEXAMPLE_IDXMARK_THIS NC_("STR_IDXEXAMPLE_IDXMARK_THIS", "this")
+#define STR_IDXEXAMPLE_IDXMARK_PRIMARY_KEY NC_("STR_IDXEXAMPLE_IDXMARK_PRIMARY_KEY", "Primary key")
+#define STR_IDXEXAMPLE_IDXMARK_SECONDARY_KEY NC_("STR_IDXEXAMPLE_IDXMARK_SECONDARY_KEY", "Secondary key")
#define STR_CONTENT_TYPE_SINGLE_OUTLINE NC_("STR_CONTENT_TYPE_SINGLE_OUTLINE", "Heading")
#define STR_CONTENT_TYPE_SINGLE_TABLE NC_("STR_CONTENT_TYPE_SINGLE_TABLE", "Table")
#define STR_CONTENT_TYPE_SINGLE_FRAME NC_("STR_CONTENT_TYPE_SINGLE_FRAME", "Text frame")
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index 24c7069b95c3..8fa6df88650b 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -344,6 +344,33 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void )
}
}
while(pSh->Right(sal_uInt16(1), sal_uInt16(1), true));
+
+ TOXTypes eTypes[] = { TOX_INDEX, TOX_USER, TOX_CONTENT };
+ for (auto eType : eTypes)
+ {
+ const SwTOXType* pTOXType = pDoc->GetTOXType(eType, 0);
+ SwTOXMarks aMarks;
+ SwTOXMark::InsertTOXMarks(aMarks, *pTOXType);
+ for (auto pMark : aMarks)
+ {
+ if (pMark->GetAlternativeText() == "Chapter")
+ pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_CHAPTER));
+ else if (pMark->GetAlternativeText() == "Keyword")
+ pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_KEYWORD));
+ else if (pMark->GetAlternativeText() == "this")
+ pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_THIS));
+ else if (pMark->GetAlternativeText() == "User Directory Entry")
+ pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_USER_DIR_ENTRY));
+ else if (pMark->GetAlternativeText() == "Entry")
+ pMark->SetAlternativeText(SwResId(STR_IDXEXAMPLE_IDXMARK_ENTRY));
+
+ if (pMark->GetPrimaryKey() == "Primary key")
+ pMark->SetPrimaryKey(SwResId(STR_IDXEXAMPLE_IDXMARK_PRIMARY_KEY));
+
+ if (pMark->GetSecondaryKey() == "Secondary key")
+ pMark->SetSecondaryKey(SwResId(STR_IDXEXAMPLE_IDXMARK_SECONDARY_KEY));
+ }
+ }
}
uno::Reference< beans::XPropertySet > xCursorProp(m_xCursor, uno::UNO_QUERY);
More information about the Libreoffice-commits
mailing list