From 43ea59bf47b2000258a08e7e571f230918511128 Mon Sep 17 00:00:00 2001 From: bonazzi Date: Fri, 21 Jul 2017 20:27:58 +0000 Subject: [PATCH] Patch level : 12.0 Files correlati : NO patch Modifica per la ricompilazione git-svn-id: svn://10.65.10.50/branches/R_10_00@23984 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/pe/pe1400.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/pe/pe1400.cpp b/src/pe/pe1400.cpp index d52e2294d..b0d4335bf 100644 --- a/src/pe/pe1400.cpp +++ b/src/pe/pe1400.cpp @@ -123,7 +123,7 @@ public: virtual TRelation* get_relation() const { return _rel; } virtual bool get_next_key(TToken_string& key); virtual bool has_filtered_cursor() const { return true; } - virtual TCursor& get_filtered_cursor() const; + virtual TCursor * get_filtered_cursor() const; virtual void init_insert_mode(TMask& m); virtual void init_modify_mode(TMask& m); @@ -1289,9 +1289,9 @@ TPreventivo_emsk::TPreventivo_emsk() : TPreventivo_msk("pe1400b"), _tree(NULL), } short idcdc = 0, idcms = 0, idfase = 0, idconto = 0; - ca_create_fields_ext(*this, 0, 2, yca, F_CDC0+1, idcdc, idcms, idfase, idconto, - DOC_CODCOSTO, DOC_CODCMS, NULL); // Niente fasi qui! + ca_create_fields_ext(*this, 0, 2, yca, F_CDC0+1, idcdc, idcms, idfase, idconto, + DOC_CODCOSTO, DOC_CODCMS, NULL); // Niente fasi qui! set_sheet_color(F_DISTINTE, COLOR_YELLOW); set_sheet_color(F_ARTICOLI, COLOR_GREEN); set_sheet_color(F_MISURE, COLOR_GRAY); @@ -1345,11 +1345,11 @@ bool TPreventivo_app::user_destroy() return true; } -TCursor& TPreventivo_app::get_filtered_cursor() const +TCursor * TPreventivo_app::get_filtered_cursor() const { TEdit_field& f = _qmsk->efield(F_NDOC); - TCursor& cur = *f.browse()->cursor(); - if (cur.items() == 0) // A volte deve scantarsi ... + TCursor * cur = f.browse()->cursor(); + if (cur->items() == 0) // A volte deve scantarsi ... f.check(); // ... forzo ricalcolo elementi return cur; } @@ -1369,14 +1369,18 @@ bool TPreventivo_app::get_next_key(TToken_string& key) if (m.query_mode() || revlen == 0) { - TCursor& cur = get_filtered_cursor(); - const TRecnotype i = cur.items(); - if (i > 0) - { - cur = i-1; - ndoc = cur.curr().get_long(DOC_NDOC); - m.split_ndoc(ndoc, nprev, nrev); - } + TCursor * cur = get_filtered_cursor(); + + if (cur != NULL) + { + const TRecnotype i = cur->items(); + if (i > 0) + { + *cur = i-1; + ndoc = cur->curr().get_long(DOC_NDOC); + m.split_ndoc(ndoc, nprev, nrev); + } + } nprev++; nrev = 1; m.join_ndoc(nprev, nrev, ndoc);