Description: BASIC: When the numeric criterion as string value is applied, the leading zero is lost. Looking ahead: FilterFields(0).StringValue = "01", but after copying the structure from critera range, we get .StringValue = "1" (see example attached). <pseudocode> ' Update filter fields. oFields = oCriteriaRange _ .createFilterDescriptorByObject(oDBRange.ReferredCells).FilterFields ' #ERROR! after copying the structure oDescriptor.FilterFields = oFields 'the leading zero is lost When applying the advanced (standard) filter manually, everything works correctly. The REGEX function, of course, also works correctly. Steps to Reproduce: 1. Download the example. 2. Run the code. 3. It doesn't work correctly. Actual Results: The leading zero is lost Expected Results: If the numeric criterion as a string contains a leading zero, then the representation of the value should not change. Reproducible: Always User Profile Reset: No Additional Info: https://bugs.documentfoundation.org/show_bug.cgi?id=140613
Created attachment 170260 [details] Explains the error in detail Duplicates the post: https://bugs.documentfoundation.org/show_bug.cgi?id=140613
Repro using Version: 7.1.1.2 (x64) / LibreOffice Community Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676 CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: CL. Steps: 1. In attachment 170260 [details] (opened with macros enabled), go to Sheet2 2. Ctrl+Click the "ResetDatabaseRange" hyperlink in L1 3. Ctrl+Click the "RefreshDBRange" hyperlink in L2 => the "Database" DB range is updated, with non-matching rows filtered out. Expected: rows 7 to 19 hidden Actual: only row 19 is hidden The code that is discussed is lines 41-42 in the "Sub RefreshDBRange()" of the document macros . Code pointer: ScTable::CreateQueryParam in sc/source/core/data/table3.cxx, which uses pFormatter->IsNumberFormat to determine the type of query, irrespective of the cell format (explicitly textual). No idea if changing this could result in problems. Eike?
Mike, thank you for your participation and help
Not a bug: see tdf#143438 for missing documentation issue.