From 91283853b27fd793b3bcaff58af0991288bba437 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 21:09:42 +0000 Subject: fix [#28786] Large enum lists display columns in inverted order (right to left) also cleared annoying intel c++ warnings. --- CMakeLists.txt | 4 ++++ source/blender/editors/interface/interface_regions.c | 9 ++++++++- source/blender/makesrna/intern/rna_ID.c | 2 +- source/blender/makesrna/intern/rna_internal.h | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69d6bd5ae90..d1070baad9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1293,6 +1293,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare) + # disable numbered, false positives + set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556") + set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556") + endif() # MSVC2010 fails to links C++ libs right diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c898ba983c7..d29e5975afb 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2308,7 +2308,6 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut uiStyle *style= UI_GetStyle(); uiPopupBlockHandle *handle; uiPopupMenu *pup; - pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy"); pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); @@ -2323,6 +2322,14 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut pup->popup= 1; pup->block->flag |= UI_BLOCK_NO_FLIP; } + else { + /* if this is an rna button then we can assume its an enum + * flipping enums is generally not good since the order can be + * important [#28786] */ + if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) { + pup->block->flag |= UI_BLOCK_NO_FLIP; + } + } if(str) { /* menu is created from a string */ diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 3f8a310285e..ddd0fcc1007 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -314,7 +314,7 @@ static int rna_IDPArray_length(PointerRNA *ptr) return prop->len; } -int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, PointerRNA *assign_ptr) +int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr) { ID *id= ptr->id.data; Material *mat_id= assign_ptr->id.data; diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index aab74056ad9..4cd4a2f11f9 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -383,7 +383,7 @@ struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index); -int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, struct PointerRNA *assign_ptr); +int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr); #endif /* RNA_INTERNAL_H */ -- cgit v1.2.3