mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
new uvs2 releases : uppsrc-2593 tutorial-38 examples-141 reference-113
git-svn-id: svn://ultimatepp.org/upp/trunk@298 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
38339f828a
commit
2a998c5051
6 changed files with 53 additions and 44 deletions
|
|
@ -111,42 +111,48 @@ int AString<B>::FindFirstOf(int len, const tchar *s, int from) const
|
|||
{
|
||||
ASSERT(from >= 0 && from <= GetLength());
|
||||
const tchar *ptr = B::Begin();
|
||||
const tchar *e = End();
|
||||
const tchar *se = s + (len * sizeof(tchar));
|
||||
if((s[0] & s[1]) != 0) {
|
||||
if(s[2] == 0) {
|
||||
tchar c1 = s[0];
|
||||
tchar c2 = s[1];
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++) {
|
||||
tchar ch = *bs;
|
||||
if(ch == c1 || ch == c2)
|
||||
return (int)(bs - ptr);
|
||||
}
|
||||
return -1;
|
||||
const tchar *e = B::End();
|
||||
const tchar *se = s + len;
|
||||
if(len == 1) {
|
||||
tchar c1 = s[0];
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++) {
|
||||
if(*bs == c1)
|
||||
return (int)(bs - ptr);
|
||||
}
|
||||
if(s[3] == 0) {
|
||||
tchar c1 = s[0];
|
||||
tchar c2 = s[1];
|
||||
tchar c3 = s[2];
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++) {
|
||||
tchar ch = *bs;
|
||||
if(ch == c1 || ch == c2 || ch == c3)
|
||||
return (int)(bs - ptr);
|
||||
}
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
if(len == 2) {
|
||||
tchar c1 = s[0];
|
||||
tchar c2 = s[1];
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++) {
|
||||
tchar ch = *bs;
|
||||
if(ch == c1 || ch == c2)
|
||||
return (int)(bs - ptr);
|
||||
}
|
||||
if(s[4] == 0) {
|
||||
tchar c1 = s[0];
|
||||
tchar c2 = s[1];
|
||||
tchar c3 = s[2];
|
||||
tchar c4 = s[3];
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++) {
|
||||
tchar ch = *bs;
|
||||
if(ch == c1 || ch == c2 || ch == c3 || ch == c4)
|
||||
return (int)(bs - ptr);
|
||||
}
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
if(len == 3) {
|
||||
tchar c1 = s[0];
|
||||
tchar c2 = s[1];
|
||||
tchar c3 = s[2];
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++) {
|
||||
tchar ch = *bs;
|
||||
if(ch == c1 || ch == c2 || ch == c3)
|
||||
return (int)(bs - ptr);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if(len == 4) {
|
||||
tchar c1 = s[0];
|
||||
tchar c2 = s[1];
|
||||
tchar c3 = s[2];
|
||||
tchar c4 = s[3];
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++) {
|
||||
tchar ch = *bs;
|
||||
if(ch == c1 || ch == c2 || ch == c3 || ch == c4)
|
||||
return (int)(bs - ptr);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
for(const tchar *bs = ptr + from; bs < e; bs++)
|
||||
for(const tchar *ss = s; ss < se; ss++)
|
||||
|
|
|
|||
|
|
@ -100,13 +100,13 @@ struct Heap {
|
|||
static Heap aux;
|
||||
|
||||
#ifdef HEAPDBG
|
||||
static void DbgFreeFill(void *ptr, int size);
|
||||
static void DbgFreeCheck(void *ptr, int size);
|
||||
static void DbgFreeFill(void *ptr, size_t size);
|
||||
static void DbgFreeCheck(void *ptr, size_t size);
|
||||
static void DbgFreeFillK(void *ptr, int k);
|
||||
static void *DbgFreeCheckK(void *p, int k);
|
||||
#else
|
||||
static void DbgFreeFill(void *ptr, int size) {}
|
||||
static void DbgFreeCheck(void *ptr, int size) {}
|
||||
static void DbgFreeFill(void *ptr, size_t size) {}
|
||||
static void DbgFreeCheck(void *ptr, size_t size) {}
|
||||
static void DbgFreeFillK(void *ptr, int k) {}
|
||||
static void *DbgFreeCheckK(void *p, int k) { return p; }
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -132,17 +132,17 @@ void HeapPanic(const char *text, void *pos, int size)
|
|||
|
||||
#ifdef HEAPDBG
|
||||
|
||||
void Heap::DbgFreeFill(void *p, int size)
|
||||
void Heap::DbgFreeFill(void *p, size_t size)
|
||||
{
|
||||
int count = size >> 2;
|
||||
size_t count = size >> 2;
|
||||
dword *ptr = (dword *)p;
|
||||
while(count--)
|
||||
*ptr++ = 0x65657246;
|
||||
}
|
||||
|
||||
void Heap::DbgFreeCheck(void *p, int size)
|
||||
void Heap::DbgFreeCheck(void *p, size_t size)
|
||||
{
|
||||
int count = size >> 2;
|
||||
size_t count = size >> 2;
|
||||
dword *ptr = (dword *)p;
|
||||
while(count--)
|
||||
if(*ptr++ != 0x65657246)
|
||||
|
|
|
|||
|
|
@ -264,6 +264,7 @@ private:
|
|||
Vector<int> posx;
|
||||
int linecy;
|
||||
int light;
|
||||
int mincy;
|
||||
|
||||
int GetIndex() const;
|
||||
int GetIndex(Point p);
|
||||
|
|
@ -297,8 +298,9 @@ public:
|
|||
operator int() const { return GetData(); }
|
||||
void operator=(const Value& v) { SetData(v); }
|
||||
|
||||
Switch& SetFont(Font f) { font = f; return *this; }
|
||||
Switch& SetFont(Font f) { font = f; Refresh(); return *this; }
|
||||
Font GetFont() const { return font; }
|
||||
Switch& MinCaseHeight(int cy) { mincy = cy; Refresh(); return *this; }
|
||||
|
||||
Switch();
|
||||
virtual ~Switch();
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ void Switch::Paint(Draw& w) {
|
|||
if(!IsTransparent())
|
||||
w.DrawRect(0, 0, sz.cx, sz.cy, SColorFace);
|
||||
int tcy = GetTextSize("W", font).cy;
|
||||
linecy = max(16, tcy + 2);
|
||||
linecy = max(mincy, max(16, tcy + 2));
|
||||
int y = 0;
|
||||
int x = 0;
|
||||
int ty = (linecy - tcy) / 2;
|
||||
|
|
@ -307,6 +307,7 @@ void Switch::CancelMode() {
|
|||
|
||||
Switch::Switch() {
|
||||
linecy = 16;
|
||||
mincy = 0;
|
||||
Transparent();
|
||||
NoInitFocus();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void GotoDlg::SyncList()
|
|||
if(IsDigit(*n))
|
||||
n.Clear();
|
||||
Index<String> nc;
|
||||
for(int ci = 0; ci < 2; ci++)
|
||||
for(int ci = 0; ci < (n.GetCount() ? 2 : 1); ci++)
|
||||
for(int i = 0; i < item.GetCount(); i++) {
|
||||
const CppItemInfo& f = item[i];
|
||||
int q = memcmp(n, f.name, n.GetLength());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue