git-svn-id: svn://ultimatepp.org/upp/trunk@8633 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-07-04 07:34:26 +00:00
parent 28f9736949
commit 0059bf828d
5 changed files with 5236 additions and 115 deletions

View file

@ -66,9 +66,9 @@ GUI_APP_MAIN
// e.SetQTF(LoadFile("U:\\xxx\\PainterBug.qtf"));
// e.ClipZoom(4, 1);
// Ctrl::ShowRepaint(50);
RichEdit::PosInfo f;
LoadFromFile(f, ConfigFile("pos"));
e.SetPosInfo(f);
// RichEdit::PosInfo f;
// LoadFromFile(f, ConfigFile("pos"));
// e.SetPosInfo(f);
// e.Pick(ParseQTF(AsQTF(CreateImageObject(CtrlImg::exclamation)) + " hahahaha"));
MyApp w;
// w.ToolWindow();
@ -82,18 +82,41 @@ GUI_APP_MAIN
#else
w.Add(e.SizePos());
#endif
{
static const char styles[] =
"[ $$0,0#00000000000000000000000000000000:Default]"
;
DLOG("===================");
DDUMP(e.GetLength());
WString text = e.Get().GetPlainText();
DDUMP(text.GetLength());
e.Select(0, e.GetLength());
e.Cut();
DDUMP(e.GetLength());
e.PasteText(ParseQTF(String().Cat() << "[%CS-CZ " << styles << "[s0; \1" << text.ToString() << "\1"));
DDUMP(e.GetLength());
e.Select(0, e.GetLength());
RichEdit h;
e.ApplyFormatInfo(h.GetFormatInfo());
DDUMP(e.GetLength());
e.Select(0, 0);
}
w.Run();
/*
String strQTF = e.GetQTF(CHARSET_ISO8859_1);
e.SetQTF(strQTF);
w.Run();
*/
String x = e.GetQTF();
/* String x = e.GetQTF();
SaveFile(FileName(), x);
f = e.GetPosInfo();
StoreToFile(f, ConfigFile("pos"));
SaveFile(GetHomeDirFile("test.rtf"), EncodeRTF(e.Get()));
*/
// SaveFile(GetHomeDirFile("test.rtf"), EncodeRTF(e.Get()));
LOG("Exit");
}

View file

@ -23,7 +23,7 @@ void Test(const char *path)
Parser p;
// p.Do(in, base, 0, 0, GetFileTitle(path), callback(AddError), Vector<String>(), Vector<String>(), Index<String>());
p.Do(in, base, 0, 0, GetFileTitle(path), callback(AddError),
p.Do(in, base, 0, FILE_C, GetFileTitle(path), callback(AddError),
Vector<String>(), Vector<String>(), hh);
if(errs.GetCount())
@ -49,7 +49,7 @@ void Test(const char *path)
p.dobody = true;
in.Seek(0);
p.Do(in, base, 0, 0, GetFileTitle(path), callback(AddError),
p.Do(in, base, 0, FILE_C, GetFileTitle(path), callback(AddError),
Vector<String>(), Vector<String>(), hh);
out << "<locals> {\n";

View file

@ -1,79 +1,7 @@
class TreeNodeInfo : Moveable<TreeNodeInfo> {
enum { SMALLCHARS = 40 };
void Foo::Foo() {
int8 kind;
byte len;
word impressions;
dword sortaccel;
public:
struct Extended {
String name;
String aname;
String urlname;
String aurlname;
String title;
String atitle;
String altname;
String aaltname;
String nodeid;
int doubled_id;
int parent_id;
int master_id;
int impressions;
bool master, noprotection, nosamecustomer, nooccupancyhigh, noncommercial, erotica;
void Foo::Bar();
Extended();
};
union {
Extended *extended;
char text[SMALLCHARS];
};
private:
enum { EMPTY = -100 };
Extended& Ext();
void Free();
void Init();
void Copy(const TreeNodeInfo& src);
friend struct TreeInfo;
public:
// int GetId() const { return id; }
String GetName() const { return kind ? String(text, len) : extended->name; }
String GetUrlName() const { return kind ? GetName() : extended->urlname; }
String GetNameA() const { return kind ? GetName() : extended->aname; }
String GetUrlNameA() const { return kind ? String() : extended->aurlname; }
String GetAltName() const { return kind ? String() : extended->altname; }
String GetAltNameA() const { return kind ? String() : extended->aaltname; }
String GetTitle() const { return kind ? String() : extended->title; }
String GetTitleA() const { return kind ? String() : extended->atitle; }
int GetDoubledId() const { return kind ? (int)Null : extended->doubled_id; }
int GetParentId() const { return kind == EMPTY ? Null : kind ? kind : extended->parent_id; }
int GetMasterId() const { return kind == EMPTY ? Null : kind ? kind : extended->master_id; }
int GetImpressions() const { return kind ? impressions : extended->impressions; }
String GetNodeId() const { return kind ? String() : extended->nodeid; }
bool IsMaster() const { return kind ? false : extended->master; }
bool NoProtection() const { return kind ? false : extended->noprotection; }
bool NoSameCustomer() const { return kind ? false : extended->nosamecustomer; }
bool NoOccupancyHigh() const { return kind ? false : extended->nooccupancyhigh; }
bool NonCommercial() const { return kind ? false : extended->noncommercial; }
bool Erotica() const { return kind ? false : extended->erotica; }
bool IsExtended() const { return kind == 0; }
int Less(dword sortaccel, const char *aname, int alen, const char *name, int len) const;
int Less(const TreeNodeInfo& b) const;
void Serialize(Stream& s);
TreeNodeInfo& operator=(const TreeNodeInfo& src);
TreeNodeInfo(const TreeNodeInfo& src);
TreeNodeInfo();
~TreeNodeInfo();
};
void Foo::Bar2() {
label:
int x = 10;

View file

@ -1,29 +1,4 @@
typedef struct {
int x;
struct Foo {
int a;
} y;
struct {
int bar;
};
struct {
int foo;
} quack;
} name;
namespace std {
struct string {};
};
// void Foo(string a);
using namespace std;
struct Bar {
struct string {};
std::string Foo(string a);
};
void Foo(string a);
extern "C++" // templates cannot be declared to have 'C' linkage
template <typename T, size_t N>
char (*RtlpNumberOf( T (&)[N] ))[N];

File diff suppressed because it is too large Load diff