diff options
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/FbWindow.cc | 8 | ||||
-rw-r--r-- | src/FbTk/FbWindow.hh | 2 | ||||
-rw-r--r-- | src/FbTk/MenuItem.hh | 16 | ||||
-rw-r--r-- | src/FbTk/StringUtil.cc | 36 | ||||
-rw-r--r-- | src/FbTk/TypeAhead.hh | 2 |
5 files changed, 22 insertions, 42 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index fb1c7af..1930d4e 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -491,7 +491,7 @@ struct TextPropPtr { | |||
491 | }; | 491 | }; |
492 | } | 492 | } |
493 | 493 | ||
494 | long FbWindow::cardinalProperty(Atom prop,bool*exists) const { | 494 | long FbWindow::cardinalProperty(Atom prop, bool* exists) const { |
495 | Atom type; | 495 | Atom type; |
496 | int format; | 496 | int format; |
497 | unsigned long nitems, bytes_after; | 497 | unsigned long nitems, bytes_after; |
@@ -549,10 +549,8 @@ FbTk::FbString FbWindow::textProperty(Atom prop,bool*exists) const { | |||
549 | ret = FbStringUtil::LocaleStrToFb(stringlist[0]); | 549 | ret = FbStringUtil::LocaleStrToFb(stringlist[0]); |
550 | } | 550 | } |
551 | 551 | ||
552 | // they all use stringlist | 552 | XFreeStringList(stringlist); |
553 | if (stringlist) { | 553 | |
554 | XFreeStringList(stringlist); | ||
555 | } | ||
556 | if (exists) *exists=true; | 554 | if (exists) *exists=true; |
557 | return ret; | 555 | return ret; |
558 | } | 556 | } |
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index 3e1c05b..4b6b02f 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh | |||
@@ -170,7 +170,7 @@ public: | |||
170 | 170 | ||
171 | void deleteProperty(Atom property); | 171 | void deleteProperty(Atom property); |
172 | 172 | ||
173 | long cardinalProperty(Atom property,bool*exists=NULL) const; | 173 | long cardinalProperty(Atom property, bool*exists=NULL) const; |
174 | FbTk::FbString textProperty(Atom property,bool*exists=NULL) const; | 174 | FbTk::FbString textProperty(Atom property,bool*exists=NULL) const; |
175 | 175 | ||
176 | void addToSaveSet(); | 176 | void addToSaveSet(); |
diff --git a/src/FbTk/MenuItem.hh b/src/FbTk/MenuItem.hh index 2149559..320d065 100644 --- a/src/FbTk/MenuItem.hh +++ b/src/FbTk/MenuItem.hh | |||
@@ -47,8 +47,10 @@ public: | |||
47 | m_enabled(true), | 47 | m_enabled(true), |
48 | m_selected(false), | 48 | m_selected(false), |
49 | m_close_on_click(true), | 49 | m_close_on_click(true), |
50 | m_toggle_item(false) | 50 | m_toggle_item(false), |
51 | m_index(0) | ||
51 | { } | 52 | { } |
53 | |||
52 | explicit MenuItem(const BiDiString &label) | 54 | explicit MenuItem(const BiDiString &label) |
53 | : m_label(label), | 55 | : m_label(label), |
54 | m_menu(0), | 56 | m_menu(0), |
@@ -56,7 +58,8 @@ public: | |||
56 | m_enabled(true), | 58 | m_enabled(true), |
57 | m_selected(false), | 59 | m_selected(false), |
58 | m_close_on_click(true), | 60 | m_close_on_click(true), |
59 | m_toggle_item(false) | 61 | m_toggle_item(false), |
62 | m_index(0) | ||
60 | { } | 63 | { } |
61 | 64 | ||
62 | MenuItem(const BiDiString &label, Menu &host_menu) | 65 | MenuItem(const BiDiString &label, Menu &host_menu) |
@@ -66,7 +69,8 @@ public: | |||
66 | m_enabled(true), | 69 | m_enabled(true), |
67 | m_selected(false), | 70 | m_selected(false), |
68 | m_close_on_click(true), | 71 | m_close_on_click(true), |
69 | m_toggle_item(false) | 72 | m_toggle_item(false), |
73 | m_index(0) | ||
70 | { } | 74 | { } |
71 | /// create a menu item with a specific command to be executed on click | 75 | /// create a menu item with a specific command to be executed on click |
72 | MenuItem(const BiDiString &label, RefCount<Command<void> > &cmd, Menu *menu = 0) | 76 | MenuItem(const BiDiString &label, RefCount<Command<void> > &cmd, Menu *menu = 0) |
@@ -77,7 +81,8 @@ public: | |||
77 | m_enabled(true), | 81 | m_enabled(true), |
78 | m_selected(false), | 82 | m_selected(false), |
79 | m_close_on_click(true), | 83 | m_close_on_click(true), |
80 | m_toggle_item(false) | 84 | m_toggle_item(false), |
85 | m_index(0) | ||
81 | { } | 86 | { } |
82 | 87 | ||
83 | MenuItem(const BiDiString &label, Menu *submenu, Menu *host_menu = 0) | 88 | MenuItem(const BiDiString &label, Menu *submenu, Menu *host_menu = 0) |
@@ -87,7 +92,8 @@ public: | |||
87 | m_enabled(true), | 92 | m_enabled(true), |
88 | m_selected(false), | 93 | m_selected(false), |
89 | m_close_on_click(true), | 94 | m_close_on_click(true), |
90 | m_toggle_item(false) | 95 | m_toggle_item(false), |
96 | m_index(0) | ||
91 | { } | 97 | { } |
92 | virtual ~MenuItem() { } | 98 | virtual ~MenuItem() { } |
93 | 99 | ||
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc index d6f2c8f..63da383 100644 --- a/src/FbTk/StringUtil.cc +++ b/src/FbTk/StringUtil.cc | |||
@@ -21,37 +21,11 @@ | |||
21 | 21 | ||
22 | #include "StringUtil.hh" | 22 | #include "StringUtil.hh" |
23 | 23 | ||
24 | #ifdef HAVE_CSTDIO | 24 | #include <cstdio> |
25 | #include <cstdio> | 25 | #include <cctype> |
26 | #else | 26 | #include <cassert> |
27 | #include <stdio.h> | 27 | #include <cstring> |
28 | #endif | 28 | #include <cerrno> |
29 | #ifdef HAVE_CSTDLIB | ||
30 | #include <cstdlib> | ||
31 | #else | ||
32 | #include <stdlib.h> | ||
33 | #endif | ||
34 | #ifdef HAVE_CCTYPE | ||
35 | #include <cctype> | ||
36 | #else | ||
37 | #include <ctype.h> | ||
38 | #endif | ||
39 | #ifdef HAVE_CASSERT | ||
40 | #include <cassert> | ||
41 | #else | ||
42 | #include <assert.h> | ||
43 | #endif | ||
44 | #ifdef HAVE_CSTRING | ||
45 | #include <cstring> | ||
46 | #else | ||
47 | #include <string.h> | ||
48 | #endif | ||
49 | |||
50 | #ifdef HAVE_CERRNO | ||
51 | #include <cerrno> | ||
52 | #else | ||
53 | #include <errno.h> | ||
54 | #endif | ||
55 | 29 | ||
56 | #ifndef _WIN32 | 30 | #ifndef _WIN32 |
57 | #include <unistd.h> | 31 | #include <unistd.h> |
diff --git a/src/FbTk/TypeAhead.hh b/src/FbTk/TypeAhead.hh index 289587a..119e3af 100644 --- a/src/FbTk/TypeAhead.hh +++ b/src/FbTk/TypeAhead.hh | |||
@@ -72,6 +72,8 @@ public: | |||
72 | typedef std::vector < SearchResult > SearchResults; | 72 | typedef std::vector < SearchResult > SearchResults; |
73 | typedef typename Items::const_iterator ItemscIt; | 73 | typedef typename Items::const_iterator ItemscIt; |
74 | 74 | ||
75 | TypeAhead() : m_ref(0) { } | ||
76 | |||
75 | void init(Items const &items) { m_ref = &items; } | 77 | void init(Items const &items) { m_ref = &items; } |
76 | 78 | ||
77 | size_t stringSize() const { return m_searchstr.size(); } | 79 | size_t stringSize() const { return m_searchstr.size(); } |