minor fix

This commit is contained in:
fluxgen 2004-02-10 19:03:42 +00:00
parent a560e67df5
commit 6d1ed67e54
2 changed files with 10 additions and 9 deletions

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: ThemeItems.hh,v 1.4 2004/01/02 21:59:52 fluxgen Exp $ // $Id: ThemeItems.hh,v 1.5 2004/02/10 19:03:04 fluxgen Exp $
/// @file implements common theme items /// @file implements common theme items
@ -132,8 +132,9 @@ void ThemeItem<FbTk::Texture>::load() {
m_value.pixmap() = 0; m_value.pixmap() = 0;
return; return;
} }
std::auto_ptr<PixmapWithMask> pm(Image::load(pixmap_name,
m_tm.screenNum())); std::auto_ptr<FbTk::PixmapWithMask> pm(FbTk::Image::load(pixmap_name,
m_tm.screenNum()));
if (pm.get() == 0) { if (pm.get() == 0) {
if (FbTk::ThemeManager::instance().verbose()) { if (FbTk::ThemeManager::instance().verbose()) {
cerr<<"Resource("<<name()+".pixmap" cerr<<"Resource("<<name()+".pixmap"
@ -212,6 +213,6 @@ void ThemeItem<FbTk::Color>::setFromString(const char *str) {
template <> template <>
void ThemeItem<FbTk::Color>::load() { } void ThemeItem<FbTk::Color>::load() { }
}; } // end namespace FbTk
#endif // THEMEITEMS_HH #endif // THEMEITEMS_HH

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: XmbFontImp.cc,v 1.6 2003/04/26 18:57:51 fluxgen Exp $ // $Id: XmbFontImp.cc,v 1.7 2004/02/10 19:03:42 fluxgen Exp $
#include "XmbFontImp.hh" #include "XmbFontImp.hh"
@ -104,7 +104,7 @@ const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) {
while((v = va_arg(va, char *)) != 0) { while((v = va_arg(va, char *)) != 0) {
p = FbTk::StringUtil::strcasestr(pattern, v); p = FbTk::StringUtil::strcasestr(pattern, v);
if (p) { if (p) {
std::strncpy(buf, p+1, bufsiz-2); strncpy(buf, p+1, bufsiz-2);
p2 = strchr(buf, '-'); p2 = strchr(buf, '-');
if (p2) *p2=0; if (p2) *p2=0;
va_end(va); va_end(va);
@ -112,7 +112,7 @@ const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) {
} }
} }
va_end(va); va_end(va);
std::strncpy(buf, "*", bufsiz); strncpy(buf, "*", bufsiz);
return 0; return 0;
} }
@ -153,9 +153,9 @@ XFontSet createFontSet(const char *fontname) {
getFontSize(fontname, &pixel_size); getFontSize(fontname, &pixel_size);
if (! strcmp(weight, "*")) if (! strcmp(weight, "*"))
std::strncpy(weight, "medium", FONT_ELEMENT_SIZE); strncpy(weight, "medium", FONT_ELEMENT_SIZE);
if (! strcmp(slant, "*")) if (! strcmp(slant, "*"))
std::strncpy(slant, "r", FONT_ELEMENT_SIZE); strncpy(slant, "r", FONT_ELEMENT_SIZE);
if (pixel_size < 3) if (pixel_size < 3)
pixel_size = 3; pixel_size = 3;
else if (pixel_size > 97) else if (pixel_size > 97)