aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-11-28 19:22:40 (GMT)
committerfluxgen <fluxgen>2002-11-28 19:22:40 (GMT)
commit5cef8b6505b69c4c69446fec29666c42f57cf5e5 (patch)
treebb093f18aef99cf0c5c30b7ca597efb9fce78cd4 /src
parenta4668b0772d6797a42ceec9901ee18379f27a56d (diff)
downloadfluxbox_pavel-5cef8b6505b69c4c69446fec29666c42f57cf5e5.zip
fluxbox_pavel-5cef8b6505b69c4c69446fec29666c42f57cf5e5.tar.bz2
return false if we cant parse nor allocate color string
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/Color.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/FbTk/Color.cc b/src/FbTk/Color.cc
index 2e69f1c..6e13c65 100644
--- a/src/FbTk/Color.cc
+++ b/src/FbTk/Color.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Color.cc,v 1.1 2002/11/26 16:01:27 fluxgen Exp $ 22// $Id: Color.cc,v 1.2 2002/11/28 19:22:40 fluxgen Exp $
23 23
24#include "Color.hh" 24#include "Color.hh"
25 25
@@ -39,6 +39,7 @@ unsigned char maxValue(unsigned short colval) {
39}; 39};
40 40
41namespace FbTk { 41namespace FbTk {
42
42Color::Color(): 43Color::Color():
43m_allocated(false), 44m_allocated(false),
44m_screen(0) { 45m_screen(0) {
@@ -78,10 +79,13 @@ bool Color::setFromString(const char *color_string, int screen) {
78 79
79 XColor color; 80 XColor color;
80 81
81 if (! XParseColor(disp, colm, color_string, &color)) 82 if (! XParseColor(disp, colm, color_string, &color)) {
82 cerr<<"FbTk::Color: Parse color error: \""<<color_string<<"\""<<endl; 83 cerr<<"FbTk::Color: Parse color error: \""<<color_string<<"\""<<endl;
83 else if (! XAllocColor(disp, colm, &color)) 84 return false;
85 } else if (! XAllocColor(disp, colm, &color)) {
84 cerr<<"FbTk::Color: Allocation error: \""<<color_string<<"\""<<endl; 86 cerr<<"FbTk::Color: Allocation error: \""<<color_string<<"\""<<endl;
87 return false;
88 }
85 89
86 90
87 91