wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src tstring.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src tstring.cpp
Date: Sat, 23 Apr 2005 17:06:47 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/04/23 21:06:47

Modified files:
        src            : tstring.cpp 

Log message:
        Tidy up a bit tstring. In particular, erase the cache when operating 
+=, otherwise it could contain outdated values.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/tstring.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: wesnoth/src/tstring.cpp
diff -u wesnoth/src/tstring.cpp:1.7 wesnoth/src/tstring.cpp:1.8
--- wesnoth/src/tstring.cpp:1.7 Mon Apr 18 19:25:04 2005
+++ wesnoth/src/tstring.cpp     Sat Apr 23 21:06:47 2005
@@ -1,4 +1,4 @@
-/* $Id: tstring.cpp,v 1.7 2005/04/18 19:25:04 gruikya Exp $ */
+/* $Id: tstring.cpp,v 1.8 2005/04/23 21:06:47 silene Exp $ */
 /*
    Copyright (C) 2004 by Philippe Plantier <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -174,7 +174,8 @@
 
 t_string::t_string(const t_string& string) :
        translatable_(string.translatable_),
-       value_(string.value_)
+       value_(string.value_),
+       translated_value_(string.translated_value_)
 {
 }
 
@@ -192,8 +193,8 @@
        unsigned int id;
 
        if(idi == textdomain_to_id.end()) {
-               textdomain_to_id[textdomain] = id_to_textdomain.size();
                id = id_to_textdomain.size();
+               textdomain_to_id[textdomain] = id;
                id_to_textdomain.push_back(textdomain);
        } else {
                id = idi->second;
@@ -327,7 +328,6 @@
                        }
                }
        } else {
-               res.translatable_ = false;
                res.value_ = value_ + string.value_;
        }
 
@@ -346,7 +346,6 @@
                        res.value_ += string;
                }
        } else {
-               res.translatable_ = false;
                res.value_ = value_ + string;
        }
 
@@ -365,7 +364,6 @@
                        res.value_ += string;
                }
        } else {
-               res.translatable_ = false;
                res.value_ = value_ + string;
        }
 
@@ -379,7 +377,9 @@
                        if (!value_.empty()) {
                                value_ = UNTRANSLATABLE_PART + value_;
                        }
-               }
+                       translatable_ = true;
+               } else
+                       translated_value_ = "";
                if(string.translatable_) {
                        value_ += string.value_;
                } else {
@@ -388,9 +388,7 @@
                                value_ += string.value_;
                        }
                }
-               translatable_ = true;
        } else {
-               translatable_ = false;
                value_ += string.value_;
        }
 
@@ -403,7 +401,8 @@
                if (!string.empty()) {
                        value_ += UNTRANSLATABLE_PART;
                        value_ += string;
-               }
+               } else
+                       translated_value_ = "";
        } else {
                value_ += string;
        }
@@ -417,7 +416,8 @@
                if (string[0] != 0) {
                        value_ += UNTRANSLATABLE_PART;
                        value_ += string;
-               }
+               } else
+                       translated_value_ = "";
        } else {
                value_ += string;
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]