summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/strings.hrc7
-rw-r--r--sw/source/uibase/utlui/unotools.cxx27
2 files changed, 34 insertions, 0 deletions
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);