icon-themes/breeze/links.txt | 2 icon-themes/breeze_dark/links.txt | 2 icon-themes/colibre/links.txt | 2 icon-themes/colibre_dark/links.txt | 2 icon-themes/elementary/links.txt | 2 icon-themes/karasa_jaga/links.txt | 2 icon-themes/sifr/links.txt | 2 icon-themes/sifr_dark/links.txt | 2 icon-themes/sukapura/links.txt | 2 officecfg/registry/schema/org/openoffice/Office/Writer.xcs | 7 + sw/inc/bitmaps.hlst | 3 sw/inc/strings.hrc | 6 sw/source/uibase/inc/swcont.hxx | 3 sw/source/uibase/utlui/content.cxx | 79 ++++++++----- sw/source/uibase/utlui/navicfg.cxx | 12 + sw/uiconfig/swriter/ui/navigatorcontextmenu.ui | 8 + 16 files changed, 98 insertions(+), 38 deletions(-)
New commits: commit b5e838334b57fee1e38febd95f944698059dfe4a Author: Dhiraj Holden <dhiraj.hol...@gmail.com> AuthorDate: Sun Apr 10 21:17:17 2022 -0400 Commit: Heiko Tietze <heiko.tie...@documentfoundation.org> CommitDate: Thu Apr 28 10:48:38 2022 +0200 tdf#144788 Split up footnotes and endnotes in Navigator This patch splits the footnotes and endnotes section in Navigator. Before, there was one section for both footnotes and endnotes and now there are two sections, one for footnotes and one for endnotes. Change-Id: Ic0f3af92efa1c0487ee3c407a819bf34138ef4ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132796 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> diff --git a/icon-themes/breeze/links.txt b/icon-themes/breeze/links.txt index a933510edcb6..c37e8422f389 100644 --- a/icon-themes/breeze/links.txt +++ b/icon-themes/breeze/links.txt @@ -2670,6 +2670,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png sd/res/sf01.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/sc20244.png sw/res/sc20234.png sw/res/re01.png cmd/lc_unsetcellsreadonly.png diff --git a/icon-themes/breeze_dark/links.txt b/icon-themes/breeze_dark/links.txt index a933510edcb6..c37e8422f389 100644 --- a/icon-themes/breeze_dark/links.txt +++ b/icon-themes/breeze_dark/links.txt @@ -2670,6 +2670,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png sd/res/sf01.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/sc20244.png sw/res/sc20234.png sw/res/re01.png cmd/lc_unsetcellsreadonly.png diff --git a/icon-themes/colibre/links.txt b/icon-themes/colibre/links.txt index be6ad8d4010d..74ad1112d9f7 100644 --- a/icon-themes/colibre/links.txt +++ b/icon-themes/colibre/links.txt @@ -2459,6 +2459,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png cmd/sc_insertdraw.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/re01.png cmd/lc_unsetcellsreadonly.png sw/res/re02.png cmd/lc_unsetcellsreadonly.png sw/res/re03.png cmd/sc_protect.png diff --git a/icon-themes/colibre_dark/links.txt b/icon-themes/colibre_dark/links.txt index be6ad8d4010d..74ad1112d9f7 100644 --- a/icon-themes/colibre_dark/links.txt +++ b/icon-themes/colibre_dark/links.txt @@ -2459,6 +2459,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png cmd/sc_insertdraw.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/re01.png cmd/lc_unsetcellsreadonly.png sw/res/re02.png cmd/lc_unsetcellsreadonly.png sw/res/re03.png cmd/sc_protect.png diff --git a/icon-themes/elementary/links.txt b/icon-themes/elementary/links.txt index fb8c4acc6e41..da4436c53178 100644 --- a/icon-themes/elementary/links.txt +++ b/icon-themes/elementary/links.txt @@ -2284,6 +2284,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png cmd/sc_insertdraw.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/one_left.png dbaccess/res/one_left.png sw/res/one_right.png dbaccess/res/one_right.png diff --git a/icon-themes/karasa_jaga/links.txt b/icon-themes/karasa_jaga/links.txt index 7dd58f1ad67e..e55b9ec29bbc 100644 --- a/icon-themes/karasa_jaga/links.txt +++ b/icon-themes/karasa_jaga/links.txt @@ -2042,6 +2042,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png cmd/sc_insertdraw.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/one_left.png dbaccess/res/one_left.png sw/res/one_right.png dbaccess/res/one_right.png sw/res/page_break.png cmd/lc_insertpagebreak.png diff --git a/icon-themes/sifr/links.txt b/icon-themes/sifr/links.txt index 8ccc0e851cd4..0e165149c4a6 100644 --- a/icon-themes/sifr/links.txt +++ b/icon-themes/sifr/links.txt @@ -2584,6 +2584,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png cmd/sc_insertdraw.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/one_left.png cmd/sc_prevrecord.png sw/res/one_right.png cmd/sc_nextrecord.png sw/res/page_break.png cmd/lc_insertpagebreak.png diff --git a/icon-themes/sifr_dark/links.txt b/icon-themes/sifr_dark/links.txt index 8ccc0e851cd4..0e165149c4a6 100644 --- a/icon-themes/sifr_dark/links.txt +++ b/icon-themes/sifr_dark/links.txt @@ -2584,6 +2584,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png cmd/sc_insertdraw.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/one_left.png cmd/sc_prevrecord.png sw/res/one_right.png cmd/sc_nextrecord.png sw/res/page_break.png cmd/lc_insertpagebreak.png diff --git a/icon-themes/sukapura/links.txt b/icon-themes/sukapura/links.txt index 9a173df7eea0..014ab097278d 100644 --- a/icon-themes/sukapura/links.txt +++ b/icon-themes/sukapura/links.txt @@ -2498,6 +2498,8 @@ sw/res/nc20008.png cmd/sc_insertreferencefield.png sw/res/nc20009.png cmd/sc_insertindexesentry.png sw/res/nc20010.png cmd/sc_shownote.png sw/res/nc20011.png cmd/sc_insertdraw.png +sw/res/nc20012.png cmd/sc_insertfootnote.png +sw/res/nc20013.png cmd/sc_insertendnote.png sw/res/sc20171.png cmd/sc_downsearch.png sw/res/sc20172.png cmd/sc_prevrecord.png sw/res/sc20173.png cmd/sc_nextrecord.png diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 89c63d849cf7..c3301435b7f1 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -5415,6 +5415,13 @@ </info> <value>true</value> </prop> + <prop oor:name="EndnoteTracking" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Specifies if Endnote tracking is active.</desc> + <label>Endnote tracking on/off</label> + </info> + <value>true</value> + </prop> <prop oor:name="NavigateOnSelect" oor:type="xs:boolean" oor:nillable="false"> <info> <desc>Specifies if navigate on entry select is active.</desc> diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst index 91de45e5d4fb..015e0d7424c3 100644 --- a/sw/inc/bitmaps.hlst +++ b/sw/inc/bitmaps.hlst @@ -90,7 +90,8 @@ inline constexpr OUStringLiteral RID_BMP_NAVI_INDEX = u"sw/res/nc20009.png"; inline constexpr OUStringLiteral RID_BMP_NAVI_POSTIT = u"sw/res/nc20010.png"; inline constexpr OUStringLiteral RID_BMP_NAVI_DRAWOBJECT = u"sw/res/nc20011.png"; inline constexpr OUStringLiteral RID_BMP_NAVI_TEXTFIELD = u"sw/res/nc20005.png"; -inline constexpr OUStringLiteral RID_BMP_NAVI_FOOTNOTE = u"sw/res/nc20000.png"; +inline constexpr OUStringLiteral RID_BMP_NAVI_FOOTNOTE = u"sw/res/nc20012.png"; +inline constexpr OUStringLiteral RID_BMP_NAVI_ENDNOTE = u"sw/res/nc20013.png"; inline constexpr OUStringLiteral RID_BMP_DROP_REGION = u"sw/res/sc20235.png"; inline constexpr OUStringLiteral RID_BMP_DROP_LINK = u"sw/res/sc20238.png"; inline constexpr OUStringLiteral RID_BMP_DROP_COPY = u"sw/res/sc20239.png"; diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index b518a9bd7b0c..1c5dbf0c5bfe 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -371,7 +371,8 @@ #define STR_CONTENT_TYPE_INDEX NC_("STR_CONTENT_TYPE_INDEX", "Indexes") #define STR_CONTENT_TYPE_DRAWOBJECT NC_("STR_CONTENT_TYPE_DRAWOBJECT", "Drawing objects") #define STR_CONTENT_TYPE_TEXTFIELD NC_("STR_CONTENT_TYPE_TEXTFIELD", "Fields") -#define STR_CONTENT_TYPE_FOOTNOTE NC_("STR_CONTENT_TYPE_FOOTNOTE", "Footnotes and Endnotes") +#define STR_CONTENT_TYPE_FOOTNOTE NC_("STR_CONTENT_TYPE_FOOTNOTE", "Footnotes") +#define STR_CONTENT_TYPE_ENDNOTE NC_("STR_CONTENT_TYPE_ENDNOTE", "Endnotes") #define STR_CONTENT_TYPE_POSTIT NC_("STR_CONTENT_TYPE_POSTIT", "Comments") #define STR_IDXEXAMPLE_IDXTXT_HEADING1 NC_("STR_IDXEXAMPLE_IDXTXT_HEADING1", "Chapter 1") #define STR_IDXEXAMPLE_IDXTXT_ENTRY1 NC_("STR_IDXEXAMPLE_IDXTXT_ENTRY1", "This is the content from the first chapter. This is a user directory entry.") @@ -401,7 +402,8 @@ #define STR_CONTENT_TYPE_SINGLE_POSTIT NC_("STR_CONTENT_TYPE_SINGLE_POSTIT", "Comment") #define STR_CONTENT_TYPE_SINGLE_DRAWOBJECT NC_("STR_CONTENT_TYPE_SINGLE_DRAWOBJECT", "Draw object") #define STR_CONTENT_TYPE_SINGLE_TEXTFIELD NC_("STR_CONTENT_TYPE_SINGLE_TEXTFIELD", "Field") -#define STR_CONTENT_TYPE_SINGLE_FOOTNOTE NC_("STR_CONTENT_TYPE_SINGLE_FOOTNOTE", "Footnote or Endnote") +#define STR_CONTENT_TYPE_SINGLE_FOOTNOTE NC_("STR_CONTENT_TYPE_SINGLE_FOOTNOTE", "Footnote") +#define STR_CONTENT_TYPE_SINGLE_ENDNOTE NC_("STR_CONTENT_TYPE_SINGLE_ENDNOTE", "Endnote") #define STR_CONTENT_FOOTNOTE NC_("STR_CONTENT_FOOTNOTE", "Footnote") #define STR_CONTENT_ENDNOTE NC_("STR_CONTENT_ENDNOTE", "Endnote") #define STR_FOOTNOTE_ENDNOTE_SEPARATOR_TIP NC_("STR_FOOTNOTE_ENDNOTE_SEPARATOR_TIP", "Footnotes are listed above this line and Endnotes are listed below") diff --git a/sw/source/uibase/inc/swcont.hxx b/sw/source/uibase/inc/swcont.hxx index 751c4549a484..a965b0fadbc6 100644 --- a/sw/source/uibase/inc/swcont.hxx +++ b/sw/source/uibase/inc/swcont.hxx @@ -42,7 +42,8 @@ enum class ContentTypeId DRAWOBJECT = 11, TEXTFIELD = 12, FOOTNOTE = 13, - LAST = FOOTNOTE, + ENDNOTE = 14, + LAST = ENDNOTE, UNKNOWN = -1 }; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 44c02ffe2447..e9d4468d1df7 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -240,7 +240,8 @@ const TranslateId STR_CONTENT_TYPE_ARY[] = STR_CONTENT_TYPE_POSTIT, STR_CONTENT_TYPE_DRAWOBJECT, STR_CONTENT_TYPE_TEXTFIELD, - STR_CONTENT_TYPE_FOOTNOTE + STR_CONTENT_TYPE_FOOTNOTE, + STR_CONTENT_TYPE_ENDNOTE }; const TranslateId STR_CONTENT_TYPE_SINGLE_ARY[] = @@ -258,7 +259,8 @@ const TranslateId STR_CONTENT_TYPE_SINGLE_ARY[] = STR_CONTENT_TYPE_SINGLE_POSTIT, STR_CONTENT_TYPE_SINGLE_DRAWOBJECT, STR_CONTENT_TYPE_SINGLE_TEXTFIELD, - STR_CONTENT_TYPE_SINGLE_FOOTNOTE + STR_CONTENT_TYPE_SINGLE_FOOTNOTE, + STR_CONTENT_TYPE_SINGLE_ENDNOTE }; namespace @@ -341,6 +343,7 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 m_bDelete = true; break; case ContentTypeId::FOOTNOTE: + case ContentTypeId::ENDNOTE: m_bEdit = true; m_bDelete = false; break; @@ -696,32 +699,33 @@ void SwContentType::FillMemberList(bool* pbContentChanged) } } break; + // We will separate footnotes and endnotes here. case ContentTypeId::FOOTNOTE: + case ContentTypeId::ENDNOTE: { const SwFootnoteIdxs& rFootnoteIdxs = m_pWrtShell->GetDoc()->GetFootnoteIdxs(); if (rFootnoteIdxs.size() == 0) break; - size_t nFootnoteCount = 0; - for (const SwTextFootnote* pTextFootnote : rFootnoteIdxs) - if (!pTextFootnote->GetFootnote().IsEndNote()) - ++nFootnoteCount; - // insert a separator bar between footnote and endnote entries - auto pSeparatorBar(make_unique<SwTextFootnoteContent>(this, - "-------------------------------", nullptr, nFootnoteCount + 1)); - pSeparatorBar->SetInvisible(); - m_pMember->insert(std::move(pSeparatorBar)); // insert footnotes and endnotes tools::Long nPos = 0; for (const SwTextFootnote* pTextFootnote : rFootnoteIdxs) { - const SwFormatFootnote& rFormatFootnote = pTextFootnote->GetFootnote(); - const OUString& sText = rFormatFootnote.GetViewNumStr(*m_pWrtShell->GetDoc(), - m_pWrtShell->GetLayout(), true) + " " + lcl_GetFootnoteText(*pTextFootnote); - auto pCnt(make_unique<SwTextFootnoteContent>(this, sText, pTextFootnote, - rFormatFootnote.IsEndNote() ? nPos + nFootnoteCount + 2 : ++nPos)); - if (!pTextFootnote->GetTextNode().getLayoutFrame(m_pWrtShell->GetLayout())) - pCnt->SetInvisible(); - m_pMember->insert(std::move(pCnt)); + if ((!pTextFootnote->GetFootnote().IsEndNote() + && m_nContentType == ContentTypeId::FOOTNOTE) + || (pTextFootnote->GetFootnote().IsEndNote() + && m_nContentType == ContentTypeId::ENDNOTE)) + { + const SwFormatFootnote& rFormatFootnote = pTextFootnote->GetFootnote(); + const OUString& sText + = rFormatFootnote.GetViewNumStr(*m_pWrtShell->GetDoc(), + m_pWrtShell->GetLayout(), true) + + " " + lcl_GetFootnoteText(*pTextFootnote); + auto pCnt(make_unique<SwTextFootnoteContent>( + this, sText, pTextFootnote, ++nPos)); + if (!pTextFootnote->GetTextNode().getLayoutFrame(m_pWrtShell->GetLayout())) + pCnt->SetInvisible(); + m_pMember->insert(std::move(pCnt)); + } } } break; @@ -1555,6 +1559,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) bool bRemoveDrawingObjectTracking = true; bool bRemoveFieldTracking = true; bool bRemoveFootnoteTracking = true; + bool bRemoveEndnoteTracking = true; bool bRemoveSortEntry = true; @@ -1568,7 +1573,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) m_xTreeView->get_id(*xEntry))->GetParent(); const ContentTypeId nContentType = pType->GetType(); - if (nContentType != ContentTypeId::FOOTNOTE && nContentType != ContentTypeId::POSTIT) + if (nContentType != ContentTypeId::FOOTNOTE && nContentType != ContentTypeId::ENDNOTE + && nContentType != ContentTypeId::POSTIT) { bRemoveSortEntry = false; xPop->set_active("sort", pType->GetSortType()); @@ -1629,6 +1635,10 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) aIdent = "footnotetracking"; bRemoveFootnoteTracking = false; break; + case ContentTypeId::ENDNOTE: + aIdent = "endnotetracking"; + bRemoveEndnoteTracking = false; + break; default: break; } if (!aIdent.isEmpty()) @@ -1658,7 +1668,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) ContentTypeId::INDEX == nContentType || ContentTypeId::DRAWOBJECT == nContentType); - if (ContentTypeId::FOOTNOTE == nContentType) + if (ContentTypeId::FOOTNOTE == nContentType || ContentTypeId::ENDNOTE == nContentType) { void* pUserData = weld::fromId<void*>(m_xTreeView->get_id(*xEntry)); const SwTextFootnote* pFootnote = @@ -1872,7 +1882,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) xPop->remove("fieldtracking"); if (bRemoveFootnoteTracking) xPop->remove("footnotetracking"); - + if (bRemoveEndnoteTracking) + xPop->remove("endnotetracking"); if (bRemoveSortEntry) xPop->remove("sort"); @@ -2246,6 +2257,9 @@ namespace case ContentTypeId::FOOTNOTE: sResId = RID_BMP_NAVI_FOOTNOTE; break; + case ContentTypeId::ENDNOTE: + sResId = RID_BMP_NAVI_ENDNOTE; + break; case ContentTypeId::UNKNOWN: SAL_WARN("sw.ui", "ContentTypeId::UNKNOWN has no bitmap preview"); break; @@ -3408,6 +3422,7 @@ static void lcl_SelectByContentTypeAndAddress(SwContentTree* pThis, weld::TreeVi switch( nType ) { case ContentTypeId::FOOTNOTE: + case ContentTypeId::ENDNOTE: { assert(dynamic_cast<SwTextFootnoteContent*>(static_cast<SwTypeNumber*>(pUserData))); SwTextFootnoteContent* pCnt = static_cast<SwTextFootnoteContent*>(pUserData); @@ -3670,12 +3685,17 @@ void SwContentTree::UpdateTracking() } // footnotes and endnotes if (SwContentAtPos aContentAtPos(IsAttrAtPos::Ftn); - m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) && - !(m_bIsRoot && m_nRootType != ContentTypeId::FOOTNOTE)) + m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), aContentAtPos) + && !(m_bIsRoot + && (m_nRootType != ContentTypeId::FOOTNOTE + && m_nRootType != ContentTypeId::ENDNOTE))) { if (mTrackContentType[ContentTypeId::FOOTNOTE]) lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, ContentTypeId::FOOTNOTE, aContentAtPos.pFndTextAttr); + if (mTrackContentType[ContentTypeId::ENDNOTE]) + lcl_SelectByContentTypeAndAddress(this, *m_xTreeView, ContentTypeId::ENDNOTE, + aContentAtPos.pFndTextAttr); return; } // bookmarks - track first bookmark at cursor @@ -4259,12 +4279,12 @@ IMPL_LINK(SwContentTree, QueryTooltipHdl, const weld::TreeIter&, rEntry, OUStrin } break; case ContentTypeId::FOOTNOTE: + case ContentTypeId::ENDNOTE: { assert(dynamic_cast<SwTextFootnoteContent*>(static_cast<SwTypeNumber*>(pUserData))); const SwTextFootnote* pFootnote = static_cast<const SwTextFootnoteContent*>(pUserData)->GetTextFootnote(); - if (!pFootnote) - return SwResId(STR_FOOTNOTE_ENDNOTE_SEPARATOR_TIP); + sEntry = pFootnote->GetFootnote().IsEndNote() ? SwResId(STR_CONTENT_ENDNOTE) : SwResId(STR_CONTENT_FOOTNOTE); } @@ -4281,8 +4301,6 @@ IMPL_LINK(SwContentTree, QueryTooltipHdl, const weld::TreeIter&, rEntry, OUStrin else { size_t nMemberCount = static_cast<SwContentType*>(pUserData)->GetMemberCount(); - if (nMemberCount && nType == ContentTypeId::FOOTNOTE) - --nMemberCount; // account for horizontal footnote endnote separator entry sEntry = OUString::number(nMemberCount) + " " + (nMemberCount == 1 ? static_cast<SwContentType*>(pUserData)->GetSingleName() @@ -4326,7 +4344,8 @@ void SwContentTree::ExecuteContextMenuAction(const OString& rSelectedPopupEntry) {"commenttracking", ContentTypeId::POSTIT}, {"drawingobjecttracking", ContentTypeId::DRAWOBJECT}, {"fieldtracking", ContentTypeId::TEXTFIELD}, - {"footnotetracking", ContentTypeId::FOOTNOTE} + {"footnotetracking", ContentTypeId::FOOTNOTE}, + {"endnotetracking", ContentTypeId::ENDNOTE} }; if (mPopupEntryToContentTypeId.count(rSelectedPopupEntry)) @@ -4943,6 +4962,7 @@ void SwContentTree::EditEntry(const weld::TreeIter& rEntry, EditEntryMode nMode) nSlot = FN_NAME_SHAPE; break; case ContentTypeId::FOOTNOTE: + case ContentTypeId::ENDNOTE: if (EditEntryMode::EDIT == nMode) nSlot = FN_FORMAT_FOOTNOTE_DLG; break; @@ -5108,6 +5128,7 @@ void SwContentTree::GotoContent(const SwContent* pCnt) } break; case ContentTypeId::FOOTNOTE: + case ContentTypeId::ENDNOTE: { const SwTextFootnote* pFootnote = static_cast<const SwTextFootnoteContent*>(pCnt)->GetTextFootnote(); diff --git a/sw/source/uibase/utlui/navicfg.cxx b/sw/source/uibase/utlui/navicfg.cxx index 2639c1ed52c6..0170a8f68a97 100644 --- a/sw/source/uibase/utlui/navicfg.cxx +++ b/sw/source/uibase/utlui/navicfg.cxx @@ -44,7 +44,8 @@ namespace { {"CommentTracking", ContentTypeId::POSTIT}, {"DrawingObjectTracking", ContentTypeId::DRAWOBJECT}, {"FieldTracking", ContentTypeId::TEXTFIELD}, - {"FootnoteTracking", ContentTypeId::FOOTNOTE} + {"FootnoteTracking", ContentTypeId::FOOTNOTE}, + {"EndnoteTracking", ContentTypeId::ENDNOTE} }; } @@ -72,6 +73,7 @@ Sequence<OUString> SwNavigationConfig::GetPropertyNames() OUString("DrawingObjectTracking"), OUString("FieldTracking"), OUString("FootnoteTracking"), + OUString("EndnoteTracking"), OUString("NavigateOnSelect")}; } @@ -137,13 +139,13 @@ void SwNavigationConfig::Load() case 6: m_bIsGlobalActive = *o3tl::doAccess<bool>(pValues[nProp]); break; case 7: pValues[nProp] >>= m_nOutlineTracking; break; case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: - case 17: case 18: case 19: case 20: + case 17: case 18: case 19: case 20: case 21: { mContentTypeTrack[mPropNameToContentTypeId[aNames[nProp]]] = *o3tl::doAccess<bool>(pValues[nProp]); break; } - case 21: m_bIsNavigateOnSelect = *o3tl::doAccess<bool>(pValues[nProp]); break; + case 22: m_bIsNavigateOnSelect = *o3tl::doAccess<bool>(pValues[nProp]); break; } } } @@ -172,12 +174,12 @@ void SwNavigationConfig::ImplCommit() case 6: pValues[nProp] <<= m_bIsGlobalActive; break; case 7: pValues[nProp] <<= m_nOutlineTracking; break; case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: - case 17: case 18: case 19: case 20: + case 17: case 18: case 19: case 20: case 21: { pValues[nProp] <<= mContentTypeTrack[mPropNameToContentTypeId[aNames[nProp]]]; break; } - case 21: pValues[nProp] <<= m_bIsNavigateOnSelect; break; + case 22: pValues[nProp] <<= m_bIsNavigateOnSelect; break; } } PutProperties(aNames, aValues); diff --git a/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui b/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui index d7619e643fd0..7a2c972df971 100644 --- a/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui +++ b/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui @@ -323,6 +323,14 @@ <property name="use-underline">True</property> </object> </child> + <child> + <object class="GtkCheckMenuItem" id="endnotetracking"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="navigatorcontextmenu|STR_ENDNOTE_TRACKING">Endnote Tracking</property> + <property name="use-underline">True</property> + </object> + </child> <child> <object class="GtkCheckMenuItem" id="sort"> <property name="visible">True</property>