From ed595d75759b6750be174233d8f4f7be57edc8f5 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 13 Jul 2004 11:29:16 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=202.1?= =?UTF-8?q?=20086=20Files=20correlati=20=20=20=20=20:=20ve1.exe=20ba8.exe?= =?UTF-8?q?=20Ricompilazione=20Demo=20:=20[=20]=20Commento=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20:=20Il=20riconoscimento=20dell'ID=20dei=20?= =?UTF-8?q?Campi=20non=20funziona=20pi=C3=B9=20(#XX)=20causando=20quindi?= =?UTF-8?q?=20problemi=20anche=20sul=20MESSAGE=20=5FSTREXPR=20o=20=5FNUMEX?= =?UTF-8?q?PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codice : AO21022 git-svn-id: svn://10.65.10.50/trunk@12240 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/fraction.cpp | 17 ++++++++++------- include/real.cpp | 9 +++++++-- include/report.cpp | 9 +++++++-- include/variant.h | 1 + ve/ve1300.cpp | 2 ++ 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/include/fraction.cpp b/include/fraction.cpp index a39617319..daf1326b3 100755 --- a/include/fraction.cpp +++ b/include/fraction.cpp @@ -168,13 +168,16 @@ fraction::fraction(const fraction& b) fraction::fraction(const real& num, const real& den) { - if (den == UNO) - build_fraction(num.stringa()); - else - { - real n = num; n /= den; - build_fraction(n.stringa()); - } + if (den == ZERO) + build_fraction(""); + else + if (den == UNO) + build_fraction(num.stringa()); + else + { + real n = num; n /= den; + build_fraction(n.stringa()); + } } int fraction::sign() const diff --git a/include/real.cpp b/include/real.cpp index f621b9128..82e03b07d 100755 --- a/include/real.cpp +++ b/include/real.cpp @@ -1585,8 +1585,13 @@ const char* real::string(const char *picture) const // Certified 50% const char* real::format(const char *picture) const { - fatal_box("NOT IMPLEMENTED"); - return picture; + if (*picture == '\0') + return string (); + + TString& f = get_tmp_string(); + + dsprintf (f.get_buffer(), (char*)(const char*)picture, ptr()); + return (const char *) f; } // Certified 99% diff --git a/include/report.cpp b/include/report.cpp index fa81c4973..b85893bc1 100755 --- a/include/report.cpp +++ b/include/report.cpp @@ -474,6 +474,8 @@ bool TReport_section::load_fields() for (int i = 0; i < items(); i++) { TReport_field& f = field(i); + + report().set_curr_field(&f); f.load_field(); } } @@ -1729,8 +1731,11 @@ bool TReport::evaluate(const char* expr, TVariant& var, TFieldtypes force_type) var = name; if (var.is_string()) e.setvar(i, var.as_string()); - else - e.setvar(i, var.as_real()); + else + if (var.is_date()) + e.setvar(i, var.as_date().string()); + else + e.setvar(i, var.as_real()); } const TFieldtypes ft = force_type != _nullfld ? force_type : var.type(); diff --git a/include/variant.h b/include/variant.h index 4715f98f9..84802562e 100755 --- a/include/variant.h +++ b/include/variant.h @@ -29,6 +29,7 @@ protected: public: TFieldtypes type() const { return _type; } // Internal use only bool is_string() const { return _type == _alfafld; } + bool is_date() const { return _type == _datefld; } bool is_empty() const; bool is_null() const { return _type == _nullfld; } bool is_zero() const; diff --git a/ve/ve1300.cpp b/ve/ve1300.cpp index 6b2674439..2693323b2 100755 --- a/ve/ve1300.cpp +++ b/ve/ve1300.cpp @@ -48,6 +48,8 @@ TRiga_documento& TDoc_recordset::riga_doc(int n) const n = _mypos+1; if (n > _doc->rows()) n = _doc->new_row().get_int(RDOC_NRIGA); + if (n <= 0) + n = 1; return (*_doc)[n]; }