From 0ae1f4f53266c42ceceff053b17fcdb022d45f96 Mon Sep 17 00:00:00 2001 From: simonb Date: Sat, 4 Aug 2007 18:49:55 +0000 Subject: fix encoding of [begin] label --- ChangeLog | 3 +++ src/MenuCreator.cc | 24 +++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81a4c50..8f56d08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 1.0.0: *07/08/05: + * Fix menu heading encoding (Simon) + sf.net bug #1712583: NLS:Non-latin characters displayed incorrectly in menu title + MenuCreator.cc * Fix error passing --with-locale path in ./configure (Simon) sf.net bug #1708859 configure.in diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index ef97b63..8507388 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -451,16 +451,18 @@ FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_numbe if (!parser.isLoaded()) return 0; + startFile(); string label; - if (require_begin && !getStart(parser, label, m_stringconvertor)) + if (require_begin && !getStart(parser, label, m_stringconvertor)) { + endFile(); return 0; + } FbTk::Menu *menu = createMenu(label, screen_number); - if (menu != 0) { - startFile(); + if (menu != 0) parseMenu(parser, *menu, m_stringconvertor); - endFile(); - } + + endFile(); return menu; } @@ -474,14 +476,16 @@ bool MenuCreator::createFromFile(const string &filename, if (!parser.isLoaded()) return false; + startFile(); string label; - if (require_begin && !getStart(parser, label, m_stringconvertor)) + if (require_begin && !getStart(parser, label, m_stringconvertor)) { + endFile(); return false; + } // save menu filename, so we can check if it changes Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); - startFile(); parseMenu(parser, inject_into, m_stringconvertor); endFile(); @@ -499,10 +503,12 @@ bool MenuCreator::createWindowMenuFromFile(const string &filename, string label; - if (require_begin && !getStart(parser, label, m_stringconvertor)) + startFile(); + if (require_begin && !getStart(parser, label, m_stringconvertor)) { + endFile(); return false; + } - startFile(); parseWindowMenu(parser, inject_into, m_stringconvertor); endFile(); -- cgit v0.11.2