From f56d66acc5de7d2406b2053531e9491f28e2d39e Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Wed, 12 Apr 2023 09:06:35 +0200 Subject: [PATCH] Patch level : 12.01 nopatch Files correlati : Commento : L'esportazione in excel esportava solo i campi che avevano una intestazione --- src/include/printer.cpp | 9 ++++++++- src/include/printer.h | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/include/printer.cpp b/src/include/printer.cpp index 82f748523..64576ee48 100755 --- a/src/include/printer.cpp +++ b/src/include/printer.cpp @@ -2386,7 +2386,7 @@ void TTabulator::split(int s0, int e0, int s1, int e1) add(min(s0,s1), max(e0,e1)); } -bool TTabulator::find_column(int column, int width, int &idx, int& col) const +bool TTabulator::find_column(int column, int width, int &idx, int& col, bool force) const { int start = column; int end = column + width - 1; @@ -2405,6 +2405,13 @@ bool TTabulator::find_column(int column, int width, int &idx, int& col) const col = ti.column(); } } + if (force && idx < 0) + { + ((TTabulator *) this)->add_field(column, width); + idx = items(); + col = column; + + } return idx >= 0; } diff --git a/src/include/printer.h b/src/include/printer.h index 7629ab561..fa235082c 100755 --- a/src/include/printer.h +++ b/src/include/printer.h @@ -780,9 +780,10 @@ protected: void split(int s0, int e0, int s1, int e1); public: + int items() const { return _tab.items(); } void add_field(int column, int width); void sort(); - bool find_column(int column, int width, int &idx, int& col) const; + bool find_column(int column, int width, int &idx, int& col, bool force = false) const; bool empty() const; };