aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/MenuCreator.cc24
1 files 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
449 if (!parser.isLoaded()) 449 if (!parser.isLoaded())
450 return 0; 450 return 0;
451 451
452 startFile();
452 string label; 453 string label;
453 if (require_begin && !getStart(parser, label, m_stringconvertor)) 454 if (require_begin && !getStart(parser, label, m_stringconvertor)) {
455 endFile();
454 return 0; 456 return 0;
457 }
455 458
456 FbTk::Menu *menu = createMenu(label, screen_number); 459 FbTk::Menu *menu = createMenu(label, screen_number);
457 if (menu != 0) { 460 if (menu != 0)
458 startFile();
459 parseMenu(parser, *menu, m_stringconvertor); 461 parseMenu(parser, *menu, m_stringconvertor);
460 endFile(); 462
461 } 463 endFile();
462 464
463 return menu; 465 return menu;
464} 466}
@@ -472,14 +474,16 @@ bool MenuCreator::createFromFile(const string &filename,
472 if (!parser.isLoaded()) 474 if (!parser.isLoaded())
473 return false; 475 return false;
474 476
477 startFile();
475 string label; 478 string label;
476 if (require_begin && !getStart(parser, label, m_stringconvertor)) 479 if (require_begin && !getStart(parser, label, m_stringconvertor)) {
480 endFile();
477 return false; 481 return false;
482 }
478 483
479 // save menu filename, so we can check if it changes 484 // save menu filename, so we can check if it changes
480 Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); 485 Fluxbox::instance()->saveMenuFilename(real_filename.c_str());
481 486
482 startFile();
483 parseMenu(parser, inject_into, m_stringconvertor); 487 parseMenu(parser, inject_into, m_stringconvertor);
484 endFile(); 488 endFile();
485 489
@@ -497,10 +501,12 @@ bool MenuCreator::createWindowMenuFromFile(const string &filename,
497 501
498 string label; 502 string label;
499 503
500 if (require_begin && !getStart(parser, label, m_stringconvertor)) 504 startFile();
505 if (require_begin && !getStart(parser, label, m_stringconvertor)) {
506 endFile();
501 return false; 507 return false;
508 }
502 509
503 startFile();
504 parseWindowMenu(parser, inject_into, m_stringconvertor); 510 parseWindowMenu(parser, inject_into, m_stringconvertor);
505 endFile(); 511 endFile();
506 512