Patch level : 4.0

Files correlati     : diction.exe
Ricompilazione Demo : [ ]
Commento            :
Corretta lettura sequenze di escape all'interno dei testi dei file XML


git-svn-id: svn://10.65.10.50/trunk@14324 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2006-09-15 15:18:04 +00:00
parent 0662da438d
commit a1ce9f49c7
3 changed files with 66 additions and 39 deletions

@ -33,30 +33,39 @@ wxString txt2xml(const wxString& str)
wxString xml2txt(const wxString& str)
{
wxString tmp;
for (int i = 0; str[i]; i++)
int i = str.Find('&');
if (i >= 0)
{
if (str[i] == '&' && str[i+1] == '#')
wxString tmp = str.Left(i);
for (; str[i]; i++)
{
i += 2;
const int semicolon = FindChar(str, ';', i);
if (semicolon > i)
bool bProcessed = false;
if (str[i] == '&')
{
int n;
sscanf(str.Mid(i, semicolon-i), "%X", &n);
tmp << char(n & 0xFF);
i = semicolon;
const int semicolon = FindChar(str, ';', i);
if (semicolon > i)
{
const wxString sub = str.Mid(i+1, semicolon-i-1);
int n;
if (sub[0] == '#')
bProcessed = sscanf(sub, "#%X", &n) == 1;
else
bProcessed = sscanf(sub, "%d", &n) == 1;
if (bProcessed)
{
tmp << char(n & 0xFF);
i = semicolon;
}
}
}
else
tmp << str[i] << str[i+1];
if (!bProcessed)
tmp << str[i];
}
else
tmp << str[i];
return tmp;
}
return tmp;
return str;
}
//////////////////////////////////////////////////////////
// TDictionary
///////////////////////////////////////////////////////////
@ -74,6 +83,7 @@ WX_DECLARE_STRING_HASH_MAP( TEntry, TStringHashTable );
class TDictionary : public TStringHashTable
{
TBaseServerApp* m_app;
wxSortedArrayString m_sorted;
bool m_bDirty;
@ -99,6 +109,8 @@ public:
void UpdateEntry(size_t i, const wxString& strValue);
void SetApp(TBaseServerApp* app) { m_app = app; }
TDictionary();
~TDictionary();
};
@ -290,12 +302,17 @@ wxString TDictionary::Translate(const wxString& ita)
}
}
else
AddEntry(ita, "???", "", 0);
{
AddEntry(ita, "???", wxEmptyString, 0);
if (m_app != NULL)
m_app->WriteLog("*** Unknown sentence");
}
return ita;
}
TDictionary::TDictionary() : TStringHashTable(10000), m_bDirty(false)
TDictionary::TDictionary()
: TStringHashTable(10000), m_app(NULL), m_bDirty(false)
{
}
@ -339,6 +356,8 @@ public:
virtual bool Initialization();
virtual bool Deinitialization();
TDictionaryServer();
};
bool TDictionaryServer::SoapProcessMethod(const TXmlItem& xmlMethod, TXmlItem& xmlAnswer)
@ -799,6 +818,11 @@ bool TDictionaryServer::Deinitialization()
return true;
}
TDictionaryServer::TDictionaryServer()
{
m_DevotoOli.SetApp(this);
}
// Istanziare l'applicazione principale
IMPLEMENT_APP(TDictionaryServer)

@ -24,7 +24,7 @@
</entry>
<entry>
<ita>% Fiscale</ita>
<eng>% Fical</eng>
<eng>% Fiscal</eng>
<src>ce1400c.msk,ce1400d.msk</src>
</entry>
<entry>
@ -316,12 +316,12 @@
</entry>
<entry>
<ita>' non e' valido</ita>
<eng>' not valid</eng>
<eng>' is not valid</eng>
<src>ca3.exe,ce4.exe,ci0.exe,ci1.exe,db1.exe,dt0.exe,ef0.exe,mg1.exe</src>
</entry>
<entry>
<ita>' non esiste</ita>
<eng>' it does not exist</eng>
<eng>' does not exist</eng>
<src>ca3.exe,ce4.exe,ci0.exe,ci1.exe,db1.exe,dt0.exe,ef0.exe,mg1.exe</src>
</entry>
<entry>
@ -10510,12 +10510,12 @@
</entry>
<entry>
<ita>Browse</ita>
<eng>Bfilee</eng>
<eng>Browse</eng>
<src>ba2600d.msk,ba2600e.msk,ba2600g.msk,ba2600r.msk,ba2600y.msk</src>
</entry>
<entry>
<ita>Bucket</ita>
<eng>???</eng>
<eng>Bucket</eng>
<max>7</max>
<src>mr2200b.msk,mr2200c.msk</src>
</entry>
@ -10967,12 +10967,12 @@
</entry>
<entry>
<ita>C Differenza cambio</ita>
<eng>C Difference change</eng>
<eng>C Exchange Difference</eng>
<src>cg0.exe</src>
</entry>
<entry>
<ita>C Fornitori</ita>
<eng>C Supplying</eng>
<eng>C Supplyiers</eng>
<src>cg0.exe</src>
</entry>
<entry>
@ -13323,12 +13323,12 @@
</entry>
<entry>
<ita>Cliente&#2F;Fornitore occasionale</ita>
<eng>Cliente&#2F;Occasional supplier</eng>
<eng>Occasional Customer&#2F;supplier</eng>
<src>cg0200a.msk</src>
</entry>
<entry>
<ita>Cliente&#2F;Fornitore privato</ita>
<eng>Cliente&#2F;Private supplier</eng>
<eng>Private Customer&#2F;Supplier</eng>
<src>cg0200a.msk</src>
</entry>
<entry>
@ -25666,7 +25666,7 @@
</entry>
<entry>
<ita>File</ita>
<eng>file</eng>
<eng>File</eng>
<max>5</max>
<src>ba1100f.msk,ba1100g.msk,ba1600b.msk,ba2100r.msk,ba7100a.msk,bagn001a.msk,bagn006.msk,bagn009.msk</src>
</entry>
@ -35980,23 +35980,23 @@
</entry>
<entry>
<ita>Modifica</ita>
<eng>Modification</eng>
<eng>Edit</eng>
<max>9</max>
<src>mr2100a.msk,770.exe,774.exe,775.exe,ab0.exe,ba1.exe,ba3.exe,ba4.exe</src>
</entry>
<entry>
<ita>Modifica Archivio</ita>
<eng>Modify the Archives</eng>
<eng>Edit Archive</eng>
<src>ba1100a.msk</src>
</entry>
<entry>
<ita>Modifica documento\ncollegato</ita>
<eng>Modify attached document</eng>
<eng>Edit attached document</eng>
<src>ci0300a.msk</src>
</entry>
<entry>
<ita>Modifica interattiva del documento collegato</ita>
<eng>Interactive modification of the connected document</eng>
<eng>Interactive editing of the connected document</eng>
<src>ci0300a.msk</src>
</entry>
<entry>
@ -36006,7 +36006,7 @@
</entry>
<entry>
<ita>Modifica record</ita>
<eng>Modification record</eng>
<eng>Edit record</eng>
<src>ba1.exe</src>
</entry>
<entry>
@ -36016,12 +36016,12 @@
</entry>
<entry>
<ita>Modifica valori</ita>
<eng>Modification values</eng>
<eng>Update values</eng>
<src>mgarea.men,vearea.men</src>
</entry>
<entry>
<ita>Modificare il movimento %ld</ita>
<eng>To modify the movement %ld</eng>
<eng>Edit movement %ld</eng>
<src>cg2.exe</src>
</entry>
<entry>
@ -36031,12 +36031,12 @@
</entry>
<entry>
<ita>Modifiche manuali</ita>
<eng>???</eng>
<eng>Manual editing</eng>
<src>mr2200b.msk</src>
</entry>
<entry>
<ita>Modifiche non registrate: salvare</ita>
<eng>Modifications off-the-books: to save</eng>
<eng>Changes not saved: save</eng>
<src>cg5.exe</src>
</entry>
<entry>

@ -241,7 +241,10 @@ wxString TXmlItem::GetWord(wxInputStream& inf) const
inf.Ungetch(char(c));
break;
}
str += wxChar(c);
if (c == '&')
str += EscapeSequence(c, inf);
else
str += wxChar(c);
}
}
return str;
@ -253,7 +256,7 @@ int TXmlItem::ReadTag(wxInputStream& inf)
if (str.IsEmpty())
return -1;
if (str[ 0u] != '<') // No tag = sequence of words
if (str[0u] != '<') // No tag = sequence of words
{
bool bFirstChar = true;
while (!inf.Eof())