Created attachment 175630 [details] Screenshot of the original sheet in Calc When an autofilter uses color filtering and the sheet is copied, the new sheet has the same autofilter but it is unusable. This does not happen when an ODS file is autofiltered by color and the sheet is copied, for example in attachment 172482 [details] from bug 142578 this works fine. Steps to reproduce: 1. Open attachment 173243 [details] from bug 143104 2. Sheet – Move or copy sheet 3. Make a copy of Sheet1 in the same spreadsheet 4. Try to open the autofilter on the newly created sheet Actual results: Autofilter does not work on the second sheet. Expected results: The autofilter should work properly on the second sheet too. LibreOffice details: Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: b1488cd6f008049a9aaff7350deeb73cbbd535b6 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: hu-HU (en_US); UI: en-US Calc: threaded
Created attachment 175631 [details] Screenshot of the problem in the copy sheet
Reproduced in Version: 7.3.0.0.alpha0+ / LibreOffice Community Build ID: ea65215855462e5e48f7a3a78724c38b5fc0e4d1 CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
This fails in https://opengrok.libreoffice.org/xref/core/sc/source/filter/oox/autofilterbuffer.cxx?r=f528fff9#869-872 Interestingly, this does work with most XLSX files where the <autoFilter> element is in /xl/worksheets/sheet1.xml in the xlsx file. In this case, the autofilter is defined in xl/tables/table1.xml. The <table> Element there looks like this: <table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="__Anonymous_Sheet_DB__0" displayName="__Anonymous_Sheet_DB__0" ref="A1:C11" totalsRowShown="0"> Might be a problem that the __Anonymous_Sheet_DB__0 range is not properly imported here?
(In reply to Samuel Mehrbrodt (allotropia) from comment #3) > Might be a problem that the __Anonymous_Sheet_DB__0 range is not properly > imported here? Table (Database range in Calc terminology) is always wacky in relation to autofiltering: see bug 59312 or bug 117346.
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d9472a5284fde7bb96823655efcb6eb31f405493 tdf#145054 Copy named DBs too when copying sheet It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 59312 has been marked as a duplicate of this bug. ***
Follow up fixes: commit 26d7f3440a0c9dd179ad407d48ce747699d678dd Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Date: Thu Jan 27 09:05:35 2022 +0100 Fix copying named DB when it doesn't contain a '_' commit 690e4852809ea21b5fd909298c5fa2a053fa0458 Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Date: Mon Jan 31 09:02:33 2022 +0100 Fix copying range when it doesn't contain a number
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/48b9cbc742de3f6120986cb6cafc92eb5009da82 Fix incrementing number in dbrange names during copying, tdf#145054 follow-up It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/9c0a3206d8eec4076f72448585efd027399697ae Fix incrementing number in dbrange names during copying, tdf#145054 follow-up It will be available in 7.4.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-4-2": https://git.libreoffice.org/core/commit/253354e829777d0667c44d6da8e2ed71f894b89c Fix incrementing number in dbrange names during copying, tdf#145054 follow-up It will be available in 7.4.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.