From 279970d5316af587ed25180c8a4d3eb97278e9e4 Mon Sep 17 00:00:00 2001 From: joncruz Date: Sun, 7 May 2006 01:10:26 +0000 Subject: [PATCH] Fixed problem with std::map use making last verb inaccessible. --- ChangeLog | 5 +++++ src/verbs-test.h | 2 +- src/verbs.cpp | 8 +++++++- src/verbs.h | 26 ++++++++++++++++---------- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88a76e677..b55477ca0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-01 Jon A. Cruz + + * src/verbs.h, src/verbs.cpp, src/verbs-test.h: + Fixed problem with std::map use making last verb inaccessible. + 2006-05-05 Carl Hetherington * src/draw-context.cpp, src/line-snapper.h, src/snap.cpp, diff --git a/src/verbs-test.h b/src/verbs-test.h index 24c7c73a6..4fe6ea888 100644 --- a/src/verbs-test.h +++ b/src/verbs-test.h @@ -60,7 +60,7 @@ public: } else { - TS_WARN( std::string("Unable to getbyid() for ") + descr + std::string(" ID: '") + std::string(verb->get_id()) + std::string("'") ); + TS_FAIL( std::string("Unable to getbyid() for ") + descr + std::string(" ID: '") + std::string(verb->get_id()) + std::string("'") ); } } else diff --git a/src/verbs.cpp b/src/verbs.cpp index 66792ae41..a5b76d7cf 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -45,6 +45,7 @@ #include "dialogs/iconpreview.h" #include "dialogs/extensions.h" #include "dialogs/swatches.h" +//#include "dialogs/layers-panel.h" #include "dialogs/input.h" #ifdef WITH_INKBOARD @@ -1624,6 +1625,9 @@ DialogVerb::perform(SPAction *action, void *data, void *pdata) case SP_VERB_DIALOG_EXTENSIONEDITOR: dt->_dlg_mgr->showDialog("ExtensionEditor"); break; +// case SP_VERB_DIALOG_LAYERS: +// show_panel( Inkscape::UI::Dialogs::LayersPanel::getInstance(), "dialogs.layers", SP_VERB_DIALOG_LAYERS ); +// break; default: break; } @@ -2310,6 +2314,8 @@ Verb *Verb::_base_verbs[] = { N_("Configure extended input devices, such as a graphics tablet"), NULL), new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."), N_("Query information about extensions"), NULL), +// new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("_Layers..."), +// N_("View Layers"), NULL), /* Help */ new HelpVerb(SP_VERB_HELP_KEYS, "HelpKeys", N_("_Keys and Mouse"), @@ -2355,7 +2361,7 @@ Verb *Verb::_base_verbs[] = { N_("Fit the canvas to the current selection or the drawing if there is no selection"), NULL), /* Footer */ - new Verb(SP_VERB_LAST, NULL, NULL, NULL, NULL) + new Verb(SP_VERB_LAST, " '\"invalid id", NULL, NULL, NULL) }; diff --git a/src/verbs.h b/src/verbs.h index f77085d7a..15ea2f2e8 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -196,17 +196,18 @@ enum { SP_VERB_DIALOG_CLONETILER, SP_VERB_DIALOG_ITEM, #ifdef WITH_INKBOARD - SP_VERB_DIALOG_WHITEBOARD_CONNECT, - SP_VERB_DIALOG_WHITEBOARD_SHAREWITHUSER, - SP_VERB_DIALOG_WHITEBOARD_SHAREWITHCHAT, - SP_VERB_DIALOG_WHITEBOARD_DUMPXMLTRACKER, - SP_VERB_DIALOG_WHITEBOARD_OPENSESSIONFILE, - SP_VERB_DIALOG_WHITEBOARD_SESSIONPLAYBACK, - SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SESSION, - SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SERVER, + SP_VERB_DIALOG_WHITEBOARD_CONNECT, + SP_VERB_DIALOG_WHITEBOARD_SHAREWITHUSER, + SP_VERB_DIALOG_WHITEBOARD_SHAREWITHCHAT, + SP_VERB_DIALOG_WHITEBOARD_DUMPXMLTRACKER, + SP_VERB_DIALOG_WHITEBOARD_OPENSESSIONFILE, + SP_VERB_DIALOG_WHITEBOARD_SESSIONPLAYBACK, + SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SESSION, + SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SERVER, #endif SP_VERB_DIALOG_INPUT, SP_VERB_DIALOG_EXTENSIONEDITOR, + //SP_VERB_DIALOG_LAYERS, /* Help */ SP_VERB_HELP_KEYS, SP_VERB_HELP_ABOUT_EXTENSIONS, @@ -256,8 +257,13 @@ private: to find the different verbs in the hash map. */ struct ltstr { bool operator()(const char* s1, const char* s2) const { - if (s1 == NULL || s2 == NULL) return true; - return strcmp(s1, s2) < 0; + if ( (s1 == NULL) && (s2 != NULL) ) { + return true; + } else if (s1 == NULL || s2 == NULL) { + return false; + } else { + return strcmp(s1, s2) < 0; + } } }; /** \brief An easy to use definition of the table of verbs by ID. */ -- 2.39.5