From 449a5fde7642f40883d82df21992fdb1edb4ff09 Mon Sep 17 00:00:00 2001 From: kojima Date: Sun, 2 Apr 2000 00:04:06 +0000 Subject: [PATCH] fixed misc bugs --- WINGs/WUtil.h | 2 +- WINGs/wbrowser.c | 2 +- WINGs/wlist.c | 12 +++++++----- WPrefs.app/Configurations.c | 3 ++- WPrefs.app/Menu.c | 17 +++++++++++++++++ WPrefs.app/WPrefs.h | 2 +- WPrefs.app/Workspace.c | 3 ++- WPrefs.app/po/Makefile.in | 2 +- WPrefs.app/xmodifier.c | 2 ++ 9 files changed, 34 insertions(+), 11 deletions(-) diff --git a/WINGs/WUtil.h b/WINGs/WUtil.h index 19b25c66..e841bae2 100644 --- a/WINGs/WUtil.h +++ b/WINGs/WUtil.h @@ -366,7 +366,7 @@ WMBag *WMCreateTreeBagWithDestructor(void (*destructor)(void*)); /* this is slow */ /* erase will remove the element from the bag, * but will keep the index of the other elements unchanged */ -#define WMEraseFromBag(bag, index) bag->func.deleteFromBag(bag, index) +#define WMEraseFromBag(bag, index) bag->func.eraseFromBag(bag, index) /* delete and remove will remove the elements and cause the elements * after them to decrement their indexes by 1 */ diff --git a/WINGs/wbrowser.c b/WINGs/wbrowser.c index 9c56684b..3fc6f601 100644 --- a/WINGs/wbrowser.c +++ b/WINGs/wbrowser.c @@ -457,7 +457,7 @@ WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, if (column < 0 || column >= bPtr->columnCount) return NULL; - + item = WMInsertListItem(bPtr->columns[column], row, text); item->isBranch = isBranch; diff --git a/WINGs/wlist.c b/WINGs/wlist.c index f46f49f3..b59e740d 100644 --- a/WINGs/wlist.c +++ b/WINGs/wlist.c @@ -170,6 +170,8 @@ WMInsertListItem(WMList *lPtr, int row, char *text) && row >= 0) lPtr->selectedItem++; + row = WMIN(row, WMGetBagItemCount(lPtr->items)); + if (row < 0) WMPutInBag(lPtr->items, item); else @@ -203,7 +205,7 @@ WMRemoveListItem(WMList *lPtr, int row) } else if (lPtr->selectedItem > row) { lPtr->selectedItem--; } - + if (row <= lPtr->topItem+lPtr->fullFitLines+lPtr->flags.dontFitAll) lPtr->topItem--; if (lPtr->topItem < 0) @@ -455,9 +457,7 @@ paintItem(List *lPtr, int index) int width, height, x, y; WMListItem *itemPtr; - itemPtr = WMGetFromBag(lPtr->items, index); - width = lPtr->view->size.width - 2 - 19; height = lPtr->itemHeight; @@ -486,8 +486,8 @@ paintItem(List *lPtr, int index) &rect); } else { if (itemPtr->selected) - XFillRectangle(scr->display, view->window, WMColorGC(scr->white), x, y, - width, height); + XFillRectangle(scr->display, view->window, WMColorGC(scr->white), + x, y, width, height); else XClearArea(scr->display, view->window, x, y, width, height, False); @@ -620,6 +620,8 @@ WMSelectListItem(WMList *lPtr, int row) else notify = 1; + assert(lPtr->selectedItem < WMGetBagItemCount(lPtr->items)); + if (!lPtr->flags.allowMultipleSelection) { /* unselect previous selected item */ if (lPtr->selectedItem >= 0) { diff --git a/WPrefs.app/Configurations.c b/WPrefs.app/Configurations.c index d3c67700..56483585 100644 --- a/WPrefs.app/Configurations.c +++ b/WPrefs.app/Configurations.c @@ -336,8 +336,9 @@ createPanel(Panel *p) WMSetButtonImage(panel->oldsB, icon); WMReleasePixmap(icon); } + free(path); } - + WMGroupButtons(panel->newsB, panel->oldsB); WMMapSubwidgets(panel->titlF); diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index 1cd79314..4c0d68d6 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -573,6 +573,21 @@ performCommand(WMWidget *w, void *data) break; } + + { + int i, j; + WMList *list; + + list = WMGetBrowserListInColumn(panel->browser, 0); + for (i = 0; i < WMGetListNumberOfRows(list); i++) { + WMListItem *item =WMGetListItem(list, i); + if (!item) + printf("%i empty\n", i); + else + puts(item->text); + } + + } if (row>=0) row++; WMInsertBrowserItem(panel->browser, column, row, title, isMenu(menuItem)); if (row<0) @@ -580,6 +595,8 @@ performCommand(WMWidget *w, void *data) else PLInsertArrayElement(menu, menuItem, row+1); free(title); + + panel->unsaved = 1; if (removed) { diff --git a/WPrefs.app/WPrefs.h b/WPrefs.app/WPrefs.h index 314f288a..939a0731 100644 --- a/WPrefs.app/WPrefs.h +++ b/WPrefs.app/WPrefs.h @@ -43,7 +43,7 @@ /****/ #define WVERSION "0.42" -#define WMVERSION "0.61.x" +#define WMVERSION "0.62.x" extern char *NOptionValueChanged; diff --git a/WPrefs.app/Workspace.c b/WPrefs.app/Workspace.c index 44620fe6..88c95de0 100644 --- a/WPrefs.app/Workspace.c +++ b/WPrefs.app/Workspace.c @@ -320,6 +320,7 @@ createPanel(Panel *p) WMSetButtonAltImage(panel->clipB, icon1); WMReleasePixmap(icon1); } + free(path); } WMSetBalloonTextForView(_("Disable/enable the Clip (that thing with\n" "a paper clip icon)."), @@ -332,7 +333,7 @@ createPanel(Panel *p) WMRealizeWidget(panel->frame); WMMapSubwidgets(panel->frame); - + showData(panel); } diff --git a/WPrefs.app/po/Makefile.in b/WPrefs.app/po/Makefile.in index ce4567f8..a167fc3f 100644 --- a/WPrefs.app/po/Makefile.in +++ b/WPrefs.app/po/Makefile.in @@ -120,7 +120,7 @@ DIST_COMMON = README Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: diff --git a/WPrefs.app/xmodifier.c b/WPrefs.app/xmodifier.c index dc95bfc9..040e715e 100644 --- a/WPrefs.app/xmodifier.c +++ b/WPrefs.app/xmodifier.c @@ -228,6 +228,8 @@ x_reset_modifier_mapping (Display *display) AltIndex = alt_bit; ModeIndex = mode_bit; + if (x_modifier_keymap != NULL) + XFreeModifiermap(x_modifier_keymap); }