summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMohit Marathe <mohitmarathe@proton.me>2024-10-19 13:25:38 +0530
committerSarper Akdemir <sarper.akdemir@allotropia.de>2024-10-21 13:30:59 +0200
commit9fca60fb13a7ac30bf763e630c5fdaed2e98b119 (patch)
treec271fa964cf46902793c90b61f09e31067b3159a /sw
parent7785b72d49051c052c829499d13cba4414df9540 (diff)
tdf#163551 fix filter comments by author bug
This patch fixes the bug in which you have to reset the date filter for filter by author to work i.e. when switching the filter from one author to another Change-Id: Ib5d3bebf587c0e940d4984dd78f9d4a94f5cbb06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175189 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/sidebar/CommentsPanel.cxx8
-rw-r--r--sw/source/uibase/sidebar/CommentsPanel.hxx2
2 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/uibase/sidebar/CommentsPanel.cxx b/sw/source/uibase/sidebar/CommentsPanel.cxx
index 0b8fdb6d52c0..33f656409caf 100644
--- a/sw/source/uibase/sidebar/CommentsPanel.cxx
+++ b/sw/source/uibase/sidebar/CommentsPanel.cxx
@@ -682,7 +682,7 @@ IMPL_LINK_NOARG(CommentsPanel, FilterByAuthor, weld::ComboBox&, void)
{
for (auto & [ nId, pComment ] : mpCommentsMap)
{
- if (!mbResetDate && mxFilterDate->get_date() != pComment->GetDate())
+ if (mbDateSelected && mxFilterDate->get_date() != pComment->GetDate())
continue;
pComment->get_widget()->set_visible(true);
}
@@ -693,7 +693,7 @@ IMPL_LINK_NOARG(CommentsPanel, FilterByAuthor, weld::ComboBox&, void)
{
if (sAuthor == pComment->GetAuthor())
{
- if (!mbResetDate && mxFilterDate->get_date() != pComment->GetDate())
+ if (mbDateSelected && mxFilterDate->get_date() != pComment->GetDate())
continue;
pComment->get_widget()->set_visible(true);
}
@@ -707,6 +707,7 @@ IMPL_LINK_NOARG(CommentsPanel, FilterByAuthor, weld::ComboBox&, void)
IMPL_LINK_NOARG(CommentsPanel, FilterByDate, SvtCalendarBox&, void)
{
+ mbDateSelected = true;
Date aDate(mxFilterDate->get_date());
for (auto & [ nId, pComment ] : mpCommentsMap)
{
@@ -724,9 +725,8 @@ IMPL_LINK_NOARG(CommentsPanel, FilterByDate, SvtCalendarBox&, void)
IMPL_LINK_NOARG(CommentsPanel, ResetDate, weld::Button&, void)
{
- mbResetDate = true;
+ mbDateSelected = false;
FilterByAuthor(*mxFilterAuthor);
- mbResetDate = false;
}
IMPL_LINK_NOARG(CommentsPanel, ShowTimeHdl, weld::Toggleable&, void)
diff --git a/sw/source/uibase/sidebar/CommentsPanel.hxx b/sw/source/uibase/sidebar/CommentsPanel.hxx
index 48f63b9dc01a..832633b08a7e 100644
--- a/sw/source/uibase/sidebar/CommentsPanel.hxx
+++ b/sw/source/uibase/sidebar/CommentsPanel.hxx
@@ -169,7 +169,7 @@ private:
std::unique_ptr<weld::Box> mxThreadsContainer;
sal_uInt16 mnThreads = 0;
- bool mbResetDate = false;
+ bool mbDateSelected = false;
// utility functions
sw::annotation::SwAnnotationWin* getRootCommentWin(const SwFormatField* pField);