From 02c6968506bad48992de7ac4a00dc7fb67d7c1f4 Mon Sep 17 00:00:00 2001 From: simonb Date: Sat, 4 Aug 2007 18:50:20 +0000 Subject: port encoding of [begin] label fix from trunk --- src/MenuCreator.cc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index b425d41..3c2843f 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -449,16 +449,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; } @@ -472,14 +474,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(); @@ -497,10 +501,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