From af4e9f02a835f7e2a317faa7e02af62b765fbe95 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 29 Aug 2008 10:35:54 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : lv0 Ricompilazione Demo : [ ] Commento : Corretto collegamento (gestione/nuovo) delle tabelle di modulo git-svn-id: svn://10.65.10.50/trunk@17135 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/isam.cpp | 21 ++++++++++++++------- include/modtbapp.cpp | 5 +++-- include/relation.cpp | 9 +++++---- include/tabmod.cpp | 1 + 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/include/isam.cpp b/include/isam.cpp index 5b2beaebd..618908f2e 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -4013,15 +4014,21 @@ bool TRectype::get_relapp(TString& app) const if (*_tab) { TString4 cod(_tab); - if (num() == LF_TABCOM) - cod.insert("%"); - else - if (num() == LF_TABGEN) - cod.insert("#"); + switch (num()) + { + case LF_TABCOM: cod.insert("%"); break; + case LF_TABGEN: cod.insert("^"); break; + case LF_TABMOD: + { + TModule_table mod(_tab); + return mod.get_relapp(app); + } + break; + default : break; + } return ::get_tabapp(cod, app); } - else - return ::get_relapp(num(), app); + return ::get_relapp(num(), app); } bool TRectype::edit(int logicnum, const char* alternate_key_fields, const char* hint) const diff --git a/include/modtbapp.cpp b/include/modtbapp.cpp index 6b02b6441..d5c496008 100755 --- a/include/modtbapp.cpp +++ b/include/modtbapp.cpp @@ -48,8 +48,9 @@ bool TTable_module_application::user_create() { if (argc() < 3) return false; - - TString4 tabname = argv(2); + + TString4 tabname; + tabname.strncpy(argv(2), 4); tabname.upper(); if (tabname[0] != '&') tabname.insert("&"); // Forza la tabella di modulo diff --git a/include/relation.cpp b/include/relation.cpp index 166ba6864..7c2c83948 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -1360,19 +1360,20 @@ void TCursor::filter( case LF_TABGEN: case LF_TABCOM: case LF_TAB: + if (!real::is_natural(file().name())) // E' veramente una tabella o è un file normale? { - const TTable& f = (const TTable&)file(); - // kf = kto = f.name(); - const TString4 k = f.name(); + // kf = kto = file().name(); + const TString4 k = file().name(); kf.overwrite(k, 0); kto.overwrite(k, 0); }; break; case LF_TABMOD: + if (!real::is_natural(file().name())) // E' veramente una tabella di modulo o è un file normale? { const TModule_table& t = (TModule_table&)file(); TString16 k; - k.format("%2s%6ld%3s", (const char*)t.module(), t.customer(), (const char*)t.name()); + k.format("%2s%6ld%3s", t.module(), t.customer(), t.name()); kf.overwrite(k, 0); kto.overwrite(k, 0); } diff --git a/include/tabmod.cpp b/include/tabmod.cpp index 364742020..2ef7d72a9 100755 --- a/include/tabmod.cpp +++ b/include/tabmod.cpp @@ -257,6 +257,7 @@ bool TModule_table::get_relapp(TString& app) const app = ini.get(var); if (app.empty()) app << _module << "0 -0"; + app << " &" << _tabname; } return app.not_empty(); }