From 00e709cec414598f4b6e3abe96fafee4e95bba06 Mon Sep 17 00:00:00 2001 From: kojima Date: Thu, 14 Oct 2004 01:00:43 +0000 Subject: [PATCH] fixed bug --- TODO | 1 - WPrefs.app/FontSimple.c | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index 1a80d0da..ad4501ea 100644 --- a/TODO +++ b/TODO @@ -13,7 +13,6 @@ To do before next release: - figure out a better gnustep path for wprefs.app installation - pick a good font fallback - figure a better fullscreen level -- add default pixelsize if font doesn't define any size. - clean up netwm hints on exit - check whether window states are being saved/restored properly via netwm on restart/crash-restart (grep for XXX/TODO) diff --git a/WPrefs.app/FontSimple.c b/WPrefs.app/FontSimple.c index 00e131fd..f2a99511 100644 --- a/WPrefs.app/FontSimple.c +++ b/WPrefs.app/FontSimple.c @@ -553,15 +553,18 @@ showData(_Panel *panel) for (i= 0; i < WMGetPopUpButtonNumberOfItems(panel->optionP); i++) { - char *ofont; + char *ofont, *font; item= WMGetPopUpButtonMenuItem(panel->optionP, i); ofont= WMGetMenuItemRepresentedObject(item); if (ofont) wfree(ofont); - - WMSetMenuItemRepresentedObject(item, GetStringForKey(fontOptions[i].option)); + + font= GetStringForKey(fontOptions[i].option); + if (font) + font= wstrdup(font); + WMSetMenuItemRepresentedObject(item, font); } WMSetPopUpButtonSelectedItem(panel->optionP, 0); @@ -581,7 +584,7 @@ storeData(_Panel *panel) item= WMGetPopUpButtonMenuItem(panel->optionP, i); font= WMGetMenuItemRepresentedObject(item); - if (font) + if (font && *font) { SetStringForKey(font, fontOptions[i].option); }