From 380b76f0794337419ebbabb55e02c2ca830e62f0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 22 Feb 2015 14:21:51 +0100 Subject: [PATCH] CComponentsText: avoid unintentional overwriting of current property values If parameters were not explicitly defined, default values of parameters overwrite current property values. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d2ae57e5b61ced783e509138727e9fe894b768b3 Author: Thilo Graf Date: 2015-02-22 (Sun, 22 Feb 2015) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 5e361fe64..0251666e0 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -184,8 +184,10 @@ void CComponentsText::setText(const std::string& stext, const int mode, Font* fo { ct_old_text = ct_text; ct_text = stext; - ct_text_mode = mode; - ct_font = font_text; + if (mode != ~CTextBox::AUTO_WIDTH) + ct_text_mode = mode; + if (font_text) + ct_font = font_text; if (color_text != 0) setTextColor(color_text);