[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] eliot/game xml_reader.cpp
From: |
Olivier Teulière |
Subject: |
[Eliot-dev] eliot/game xml_reader.cpp |
Date: |
Sat, 06 Mar 2010 16:53:38 +0000 |
CVSROOT: /cvsroot/eliot
Module name: eliot
Changes by: Olivier Teulière <ipkiss> 10/03/06 16:53:38
Modified files:
game : xml_reader.cpp
Log message:
Fixed loading of games, for languages with multichar letters like
Catalan
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/game/xml_reader.cpp?cvsroot=eliot&r1=1.1&r2=1.2
Patches:
Index: xml_reader.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/xml_reader.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- xml_reader.cpp 29 Nov 2009 16:01:32 -0000 1.1
+++ xml_reader.cpp 6 Mar 2010 16:53:37 -0000 1.2
@@ -112,10 +112,10 @@
string type = attr["type"];
if (type == "valid")
{
+ wstring word = iGame.getDic().convertFromInput(fromUtf8(attr["word"]));
Round round;
int res = iGame.checkPlayedWord(fromUtf8(attr["coord"]),
- fromUtf8(attr["word"]),
- round, checkRack);
+ word, round, checkRack);
if (res != 0)
{
throw LoadGameException("Invalid move marked as valid: " +
@@ -269,12 +269,13 @@
else if (tag == "PlayerRack")
{
// Build a rack for the correct player
+ const wstring &rackStr = m_dic.convertFromInput(fromUtf8(m_data));
PlayedRack pldrack;
- if (!m_dic.validateLetters(fromUtf8(m_data), L"-+"))
+ if (!m_dic.validateLetters(rackStr, L"-+"))
{
throw LoadGameException("Rack invalid for the current dictionary:
" + m_data);
}
- pldrack.setManual(fromUtf8(m_data));
+ pldrack.setManual(rackStr);
#if 0
cerr << "loaded rack: " << convertToMb(pldrack.toString()) << endl;
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Eliot-dev] eliot/game xml_reader.cpp,
Olivier Teulière <=