diff --git a/fe/felib.cpp b/fe/felib.cpp index 0266837a6..9f20546db 100644 --- a/fe/felib.cpp +++ b/fe/felib.cpp @@ -707,6 +707,7 @@ TObject* TCofi_cache::find_ragsoc(bool piva, char tipocf, const TString& code) TISAM_recordset occas(query); if (occas.move_first()) return new TString80(occas.get(OCC_RAGSOC).as_string()); + return NULL; } @@ -734,25 +735,37 @@ TObject* TCofi_cache::key2obj(const char* key) const TString& TCofi_cache::cofi2ragsoc(char tipocf, const TString& cofi) { - const TString* ragsoc = &EMPTY_STRING; + const TString* ragsoc = NULL; if (cofi.full()) { TString80 key; key.format("CF|%c|%s", tipocf, (const char*)cofi); ragsoc = (const TString*)objptr(key); } + if (ragsoc == NULL) + { + TString& str = get_tmp_string(); + str << TR("C.F. sconosciuto ") << cofi; + ragsoc = &str; + } return *ragsoc; } const TString& TCofi_cache::paiv2ragsoc(char tipocf, const TString& paiv) { - const TString* ragsoc = &EMPTY_STRING; + const TString* ragsoc = NULL; if (paiv.full()) { TString80 key; key.format("PI|%c|%s", tipocf, (const char*)paiv); ragsoc = (const TString*)objptr(key); } + if (ragsoc == NULL) + { + TString& str = get_tmp_string(); + str << TR("P.I. sconosciuta ") << paiv; + ragsoc = &str; + } return *ragsoc; }