diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2021-03-11 14:44:49 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-03-25 15:00:31 +0100 |
commit | 4fd1333ba4bb4f2311e9098291154772bd310429 (patch) | |
tree | c5130c75d9f5c41854c32870ad6166586cff7b11 /svl | |
parent | 8940975262a98dc1087712e366f595289ac650b3 (diff) |
tdf#140968 tdf#140978 XLSX import: fix lost rounded filters
if the stored filter values are in the visible cell
format (e.g. rounded values) instead of the original
(editing) values.
Now AutoFilter popup window shows the items according
to the visible cell format (e.g. 1.0 instead of 1.01 or
0.99), but still grouping them based on the "editing
format" (e.g. not rounded values which visible during
editing), i.e. there could be repeated values in the
filtering conditions (e.g. two options "1.0" and "1.0"
for 1.01 and 0.99).
Note: Next step will be to group and filter based on the
actual cell format, like MSO does, to simplify filtering
of values rounded by the cell format (e.g. selecting
the single AutoFilter condition "1.0" to filter both
1.01 and 0.99).
Change-Id: I430da5e09794fc4ed8acf79b6485926f46b70277
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112343
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 0ccc14b7ff04..f1c45e04bec2 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1589,7 +1589,8 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double fNumber, sal_uInt32 nFIndex, void SvNumberFormatter::GetInputLineString(const double& fOutNumber, sal_uInt32 nFIndex, - OUString& sOutString) + OUString& sOutString, + bool bFiltering) { ::osl::MutexGuard aGuard( GetInstanceMutex() ); const Color* pColor; @@ -1630,7 +1631,8 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, } sal_uInt32 nKey = GetEditFormat( fOutNumber, nRealKey, eType, eLang, pFormat); - if ( nKey != nRealKey ) + // if bFiltering true keep the nRealKey format + if ( nKey != nRealKey && !bFiltering ) { pFormat = GetFormatEntry( nKey ); } |