diff --git a/uppsrc/CodeEditor/CodeEditor.lay b/uppsrc/CodeEditor/CodeEditor.lay index 09f1643a1..d622d0b14 100644 --- a/uppsrc/CodeEditor/CodeEditor.lay +++ b/uppsrc/CodeEditor/CodeEditor.lay @@ -24,11 +24,11 @@ LAYOUT(BlockReplaceLayout, 408, 136) ITEM(WithDropChoice, find, HSizePosZ(56, 8).TopPosZ(4, 19)) ITEM(Label, replace_txt, SetLabel(t_("Replace")).LeftPosZ(8, 46).TopPosZ(48, 19)) ITEM(WithDropChoice, replace, HSizePosZ(56, 8).TopPosZ(48, 19)) - ITEM(Option, wholeword, SetLabel(t_("&Whole word")).LeftPosZ(8, 100).BottomPosZ(40, 20)) - ITEM(Option, wildcards, SetLabel(t_("Wild&cards")).LeftPosZ(96, 88).BottomPosZ(40, 20)) - ITEM(Option, ignorecase, SetLabel(t_("&Ignore case")).LeftPosZ(172, 92).BottomPosZ(40, 20)) - ITEM(Option, samecase, SetLabel(t_("Mimic case")).LeftPosZ(260, 108).BottomPosZ(40, 20)) - ITEM(Option, regexp, SetLabel(t_("RegEx")).LeftPosZ(344, 108).BottomPosZ(40, 20)) + ITEM(Option, wholeword, SetLabel(t_("&Whole word")).LeftPosZ(8, 84).BottomPosZ(40, 20)) + ITEM(Option, wildcards, SetLabel(t_("Wild&cards")).LeftPosZ(96, 72).BottomPosZ(40, 20)) + ITEM(Option, ignorecase, SetLabel(t_("&Ignore case")).LeftPosZ(172, 84).BottomPosZ(40, 20)) + ITEM(Option, samecase, SetLabel(t_("Mimic case")).LeftPosZ(260, 80).BottomPosZ(40, 20)) + ITEM(Option, regexp, SetLabel(t_("RegEx")).LeftPosZ(344, 64).BottomPosZ(40, 20)) ITEM(Button, next, SetLabel(t_("Replace")).RightPosZ(80, 76).BottomPosZ(8, 24)) ITEM(Button, close, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(8, 24)) ITEM(Switch, mode, SetLabel(t_("Replace\nRemove lines without pattern\nRemove line with pattern")).LeftPosZ(8, 396).TopPosZ(28, 16)) diff --git a/uppsrc/Core/Value.cpp b/uppsrc/Core/Value.cpp index 608f540c6..a720da129 100644 --- a/uppsrc/Core/Value.cpp +++ b/uppsrc/Core/Value.cpp @@ -121,8 +121,8 @@ int Value::Compare(const Value& v) const } if(st != VOIDV) { int q = PolyCompare(v); - if(q) return q; // Perhaps optimize this - return v.PolyCompare(*this); + if(q) return q; + return -v.PolyCompare(*this); } return 0; } diff --git a/uppsrc/Core/Value.h b/uppsrc/Core/Value.h index ce9d8e2ad..253cf6bcf 100644 --- a/uppsrc/Core/Value.h +++ b/uppsrc/Core/Value.h @@ -64,6 +64,7 @@ public: String ToString() const { return typeid(T).name(); } int Compare(const T&) const { NEVER(); return 0; } int PolyCompare(const Value&) const { NEVER(); return 0; } + operator ValueTypeRef(); }; diff --git a/uppsrc/Core/ValueUtil.cpp b/uppsrc/Core/ValueUtil.cpp index 2addcf5cc..7e9797b67 100644 --- a/uppsrc/Core/ValueUtil.cpp +++ b/uppsrc/Core/ValueUtil.cpp @@ -660,7 +660,7 @@ int StdValueCompare(const Value& a, const Value& b, int language) return cmp