From 74c107ba4831e588b219f1c28161f2707f30d0c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 1 Sep 2002 17:11:38 +0000 Subject: [PATCH] fixes to newly added i18n code in XRC - don't use it if wxXRC_USE_LOCALE isn't used git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xrc/xmlres.h | 6 +++--- contrib/src/xrc/xh_chckl.cpp | 5 ++++- contrib/src/xrc/xh_choic.cpp | 5 ++++- contrib/src/xrc/xh_combo.cpp | 5 ++++- contrib/src/xrc/xh_listb.cpp | 5 ++++- contrib/src/xrc/xh_radbx.cpp | 5 ++++- include/wx/xrc/xmlres.h | 6 +++--- src/xrc/xh_chckl.cpp | 5 ++++- src/xrc/xh_choic.cpp | 5 ++++- src/xrc/xh_combo.cpp | 5 ++++- src/xrc/xh_listb.cpp | 5 ++++- src/xrc/xh_radbx.cpp | 5 ++++- 12 files changed, 46 insertions(+), 16 deletions(-) diff --git a/contrib/include/wx/xrc/xmlres.h b/contrib/include/wx/xrc/xmlres.h index 4e539a17c5..0962b297aa 100644 --- a/contrib/include/wx/xrc/xmlres.h +++ b/contrib/include/wx/xrc/xmlres.h @@ -215,6 +215,9 @@ public: // Sets the global resources object and returns a pointer to the previous one (may be NULL). static wxXmlResource *Set(wxXmlResource *res); + // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING. + int GetFlags() { return m_flags; } + protected: // Scans the resources list for unloaded files and loads them. Also reloads // files that have been modified since last loading. @@ -229,9 +232,6 @@ protected: // Creates a resource from information in the given node. wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL); - // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING. - int GetFlags() { return m_flags; } - private: long m_version; diff --git a/contrib/src/xrc/xh_chckl.cpp b/contrib/src/xrc/xh_chckl.cpp index 24e191e830..408c02570d 100644 --- a/contrib/src/xrc/xh_chckl.cpp +++ b/contrib/src/xrc/xh_chckl.cpp @@ -91,7 +91,10 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } } diff --git a/contrib/src/xrc/xh_choic.cpp b/contrib/src/xrc/xh_choic.cpp index 2f91e382a8..f2dd0bdb43 100644 --- a/contrib/src/xrc/xh_choic.cpp +++ b/contrib/src/xrc/xh_choic.cpp @@ -77,7 +77,10 @@ wxObject *wxChoiceXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } diff --git a/contrib/src/xrc/xh_combo.cpp b/contrib/src/xrc/xh_combo.cpp index 3d708c3a49..2a17231c4f 100644 --- a/contrib/src/xrc/xh_combo.cpp +++ b/contrib/src/xrc/xh_combo.cpp @@ -83,7 +83,10 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } diff --git a/contrib/src/xrc/xh_listb.cpp b/contrib/src/xrc/xh_listb.cpp index 50790fbb34..c3c9004d3f 100644 --- a/contrib/src/xrc/xh_listb.cpp +++ b/contrib/src/xrc/xh_listb.cpp @@ -83,7 +83,10 @@ wxObject *wxListBoxXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } diff --git a/contrib/src/xrc/xh_radbx.cpp b/contrib/src/xrc/xh_radbx.cpp index 6ba0e86182..f2f229cd9c 100644 --- a/contrib/src/xrc/xh_radbx.cpp +++ b/contrib/src/xrc/xh_radbx.cpp @@ -84,7 +84,10 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index 4e539a17c5..0962b297aa 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -215,6 +215,9 @@ public: // Sets the global resources object and returns a pointer to the previous one (may be NULL). static wxXmlResource *Set(wxXmlResource *res); + // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING. + int GetFlags() { return m_flags; } + protected: // Scans the resources list for unloaded files and loads them. Also reloads // files that have been modified since last loading. @@ -229,9 +232,6 @@ protected: // Creates a resource from information in the given node. wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL); - // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING. - int GetFlags() { return m_flags; } - private: long m_version; diff --git a/src/xrc/xh_chckl.cpp b/src/xrc/xh_chckl.cpp index 24e191e830..408c02570d 100644 --- a/src/xrc/xh_chckl.cpp +++ b/src/xrc/xh_chckl.cpp @@ -91,7 +91,10 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } } diff --git a/src/xrc/xh_choic.cpp b/src/xrc/xh_choic.cpp index 2f91e382a8..f2dd0bdb43 100644 --- a/src/xrc/xh_choic.cpp +++ b/src/xrc/xh_choic.cpp @@ -77,7 +77,10 @@ wxObject *wxChoiceXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } diff --git a/src/xrc/xh_combo.cpp b/src/xrc/xh_combo.cpp index 3d708c3a49..2a17231c4f 100644 --- a/src/xrc/xh_combo.cpp +++ b/src/xrc/xh_combo.cpp @@ -83,7 +83,10 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } diff --git a/src/xrc/xh_listb.cpp b/src/xrc/xh_listb.cpp index 50790fbb34..c3c9004d3f 100644 --- a/src/xrc/xh_listb.cpp +++ b/src/xrc/xh_listb.cpp @@ -83,7 +83,10 @@ wxObject *wxListBoxXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } diff --git a/src/xrc/xh_radbx.cpp b/src/xrc/xh_radbx.cpp index 6ba0e86182..f2f229cd9c 100644 --- a/src/xrc/xh_radbx.cpp +++ b/src/xrc/xh_radbx.cpp @@ -84,7 +84,10 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add(wxGetTranslation(GetNodeContent(m_node))); + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); return NULL; } -- 2.45.2