Files
ElyOffice/patches/libreoffice/0053-lok-calc-autofilter-header-without-asking.patch
T
雷电芽衣 72bec20a60 R9.3, R9.4: AutoFilter without the header query (GitHub #4); paste on Windows
Patch 0053: under LOK, Calc takes the first row as header instead of
asking asynchronously; the worker closed the query and crashed.
Patch 0049 includes doc.hxx (gcc on Linux did not build it).
arboard read a missing HTML clipboard format as an error on Windows;
the clipboard checks the format first, and paste errors show the
whole chain. ElyTable tests compare CSV and selection text the
platform's way (P3-09).
2026-10-20 02:23:17 -04:00

37 lines
1.5 KiB
Diff

LOK: AutoFilter takes the first row as header without asking
When Calc cannot tell a header from the data (a whole column of text,
an empty column), turning on AutoFilter asks whether the first row is
a header. Under LOK the client closes the box as soon as it opens,
inside the callback that announces it; the box's async handler then
applies the filter on a half-built dialog, and the next tile paint
crashes the process (GitHub ElyOffice #4). LOK asks no question here:
the first row heads the range, which is the box's default answer and
what Excel does.
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -18,6 +18,7 @@
*/
#include <scitems.hxx>
+#include <comphelper/lok.hxx>
#include <sfx2/bindings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@@ -340,7 +341,13 @@
if ( !rDoc.IsBlockEmpty( aParam.nCol1, aParam.nRow1,
aParam.nCol2, aParam.nRow2, nTab ) )
{
- if (!bHeader)
+ if (!bHeader && comphelper::LibreOfficeKit::isActive())
+ {
+ // LOK asks nothing: the first row heads, the box's default.
+ pDBData->SetHeader( true );
+ ApplyAutoFilter(*pDocSh, rViewData, pDBData, nRow, nTab, aParam);
+ }
+ else if (!bHeader)
{
std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(rViewData.GetDialogParent(),
VclMessageType::Question,