diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2021-07-02 09:51:53 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-07-13 17:32:11 +0200 |
commit | 1115d4d5ac63394ca0f3f1b75dc81916cdbeebe9 (patch) | |
tree | 7327e93e22ed855146624f3cfa0fc9c219558b70 /sc/source/ui/view | |
parent | a483a44ca00f43a64ae51d62b8fbb4129a413f6d (diff) |
tdf#143101 sc UI: fix highlight of standard filter with logical OR
The autofilter dropdown button didn't indicate that
a standard filter in effect, when the criteria
connected by a logical OR.
Change-Id: I8f802ee3d0d03d654278693f0dcd06d7c3b67ba9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118274
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index f1e53ed61cb8..b17e34c8586c 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1922,25 +1922,23 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo // pQueryParam can only include MAXQUERY entries - bool bSimpleQuery = true; - bool bColumnFound = false; - if (!pQueryParam->bInplace) - bSimpleQuery = false; - SCSIZE nCount = pQueryParam->GetEntryCount(); - for (nQuery = 0; nQuery < nCount && bSimpleQuery; ++nQuery) - if (pQueryParam->GetEntry(nQuery).bDoQuery) + bool bArrowState = false; + if (pQueryParam->bInplace) + { + SCSIZE nCount = pQueryParam->GetEntryCount(); + for (nQuery = 0; nQuery < nCount; ++nQuery) { // Do no restrict to EQUAL here // (Column head should become blue also when ">1") - - if (pQueryParam->GetEntry(nQuery).nField == nCol) - bColumnFound = true; - if (nQuery > 0) - if (pQueryParam->GetEntry(nQuery).eConnect != SC_AND) - bSimpleQuery = false; + const ScQueryEntry& rEntry = pQueryParam->GetEntry(nQuery); + if (rEntry.bDoQuery && rEntry.nField == nCol) + { + bArrowState = true; + break; + } } + } - bool bArrowState = bSimpleQuery && bColumnFound; tools::Long nSizeX; tools::Long nSizeY; SCCOL nStartCol= nCol; |