diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-05-10 16:55:53 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-05-11 07:36:33 +0200 |
commit | 69b376d21dfe43482f67ece137421a7487f0cbae (patch) | |
tree | 9dbf0df372cf648b8dd6ac705da291d835e3372c /sc/source/core | |
parent | a80eefb7413245f81692c443b06f7d3a6a92f28c (diff) |
tdf#76258 Various fixes for color filter
Change-Id: Ifb4114597efcb7a957d2e42867d1bdc8abfe7730
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115340
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/column3.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/data/table3.cxx | 20 |
2 files changed, 12 insertions, 16 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 5fd4a5965586..eef630c6f297 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2432,12 +2432,12 @@ class FilterEntriesHandler const SvxBrushItem* pBrush = rColumn.GetDoc().GetAttr(aPos, ATTR_BACKGROUND); Color backgroundColor = pBrush->GetColor(); + mrFilterEntries.addTextColor(textColor); + mrFilterEntries.addBackgroundColor(backgroundColor); if (rCell.hasString()) { mrFilterEntries.push_back(ScTypedStrData(aStr)); - mrFilterEntries.addTextColor(textColor); - mrFilterEntries.addBackgroundColor(backgroundColor); return; } @@ -2460,8 +2460,6 @@ class FilterEntriesHandler if (!aErr.isEmpty()) { mrFilterEntries.push_back(ScTypedStrData(aErr)); - mrFilterEntries.addTextColor(textColor); - mrFilterEntries.addBackgroundColor(backgroundColor); return; } } @@ -2499,8 +2497,6 @@ class FilterEntriesHandler to avoid duplicates in the filter lists with setting the mbIsFormatted */ bool bFormFiltVal = mrColumn.HasFiltering() && nFormat; mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, ScTypedStrData::Value, bDate, bFormFiltVal)); - mrFilterEntries.addTextColor(textColor); - mrFilterEntries.addBackgroundColor(backgroundColor); } public: diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index dcc76104280b..54c0850931ee 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2817,31 +2817,31 @@ bool ScTable::ValidQuery( { for (const auto& rItem : rItems) { - if (aEval.isQueryByValue(rItem, nCol, nRow, aCell)) + if (rItem.meType == ScQueryEntry::ByTextColor) { - std::pair<bool,bool> aThisRes = - aEval.compareByValue(aCell, nCol, nRow, rEntry, rItem, pContext); + std::pair<bool, bool> aThisRes + = aEval.compareByTextColor(nCol, nRow, nTab, rItem); aRes.first |= aThisRes.first; aRes.second |= aThisRes.second; } - else if (aEval.isQueryByString(rEntry, rItem, nCol, nRow, aCell)) + else if (rItem.meType == ScQueryEntry::ByBackgroundColor) { std::pair<bool,bool> aThisRes = - aEval.compareByString(aCell, nRow, rEntry, rItem, pContext); + aEval.compareByBackgroundColor(nCol, nRow, nTab, rItem); aRes.first |= aThisRes.first; aRes.second |= aThisRes.second; } - if (rItem.meType == ScQueryEntry::ByTextColor) + else if (aEval.isQueryByValue(rItem, nCol, nRow, aCell)) { - std::pair<bool, bool> aThisRes - = aEval.compareByTextColor(nCol, nRow, nTab, rItem); + std::pair<bool,bool> aThisRes = + aEval.compareByValue(aCell, nCol, nRow, rEntry, rItem, pContext); aRes.first |= aThisRes.first; aRes.second |= aThisRes.second; } - if (rItem.meType == ScQueryEntry::ByBackgroundColor) + else if (aEval.isQueryByString(rEntry, rItem, nCol, nRow, aCell)) { std::pair<bool,bool> aThisRes = - aEval.compareByBackgroundColor(nCol, nRow, nTab, rItem); + aEval.compareByString(aCell, nRow, rEntry, rItem, pContext); aRes.first |= aThisRes.first; aRes.second |= aThisRes.second; } |