Skip to content

Commit 47f3918

Browse files
committed
ecere/samples/guiAndGfx: Initial commit of Ecere Writer, first component of the Ecere Office Productivity Suite.
1 parent 39035ee commit 47f3918

File tree

10 files changed

+2565
-14
lines changed

10 files changed

+2565
-14
lines changed

extras/XMLParser.ec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ static WordStatus GetKeyWordEx(char ** input, char * keyWord, int maxSize, bool
1919
char ch;
2020
int c = 0;
2121
bool quoted = false, start = true, wasQuoted = false;
22+
char quoteChar = 0;
2223

2324
for(; (ch = *string); string++)
2425
{
@@ -33,8 +34,12 @@ static WordStatus GetKeyWordEx(char ** input, char * keyWord, int maxSize, bool
3334
{
3435
if(!quoted && ((ch == ',' || (treatEqual && ch == '=')) || ch == '>') )
3536
break;
36-
else if(ch == '\"' /*|| ch == '\''*/)
37+
// TOCHECK: Why weren't single quotes accepted here? How was this working?
38+
else if((ch == '\"' || (/*acceptSingleQuote && */ch == '\'')) && (!quoteChar || quoteChar == ch))
39+
// else if(ch == '\"' /*|| ch == '\''*/)
3740
{
41+
if(!wasQuoted)
42+
quoteChar = ch;
3843
quoted ^= true;
3944
wasQuoted = true;
4045
start = false;

extras/html/HTMLView.ec

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class ObjectThread : Thread
120120

121121
strcpy(path, entry.src);
122122
//strcpy(referer, browserWindow.location ? browserWindow.location : "");
123-
strcpy(referer, entry.referer); //browserWindow.location ? browserWindow.location : "");
123+
strcpy(referer, entry.referer ? entry.referer : ""); //browserWindow.location ? browserWindow.location : "");
124124

125125
//((GuiApplication)__thisModule).Unlock();
126126

@@ -1002,27 +1002,24 @@ class HTMLView : Window
10021002
NotifyPageOpened(master);
10031003
}
10041004

1005-
void OpenFile(File f, char * firstReferer)
1005+
void OpenFile(File f, const char * firstReferer)
10061006
{
1007-
char referer[MAX_LOCATION] = "";
10081007
bool opened = false;
10091008

10101009
clickedLink = null;
10111010
overLink = null;
10121011
overBlock = null;
10131012

1014-
if(firstReferer)
1015-
strcpy(referer, firstReferer);
1016-
10171013
delete html;
10181014
html = HTMLFile {};
10191015

10201016
SetScrollArea(0,0,0);
10211017
Update(null);
10221018

10231019
opened = true;
1024-
this.location = null;
1025-
fileName = this.location;
1020+
delete location;
1021+
location = CopyString(firstReferer);
1022+
fileName = location;
10261023

10271024
if(opened)
10281025
{

extras/html/htmlParser.ec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ String ParseURL(String input)
173173

174174
static int GetKeyWord(char ** input, char * keyWord, int maxSize)
175175
{
176-
return GetKeyWordEx(input, keyWord, maxSize, true, false);
176+
return GetKeyWordEx(input, keyWord, maxSize, true, true); //false);
177177
}
178178

179179
/*static char * GetString(char * string, char * what, int count)
@@ -535,7 +535,7 @@ class HTMLFile
535535
}
536536
subBlock.size = fontSizes[c];
537537
}
538-
else if(size && size < NUM_FONT_SIZES)
538+
else if(size && size <= NUM_FONT_SIZES)
539539
{
540540
subBlock.size = fontSizes[size-1];
541541
}

extras/html/lines.ec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ void RenderLine(HTMLView browser, Surface surface, int x, int y, int w, int h, B
345345
{
346346
int bw = block.pWidth ? (w * block.pWidth / 100) : block.w;
347347
int bh = block.pHeight ? (h * block.pHeight / 100) : block.h;
348-
349-
int dx, dy;
348+
int dx = 0, dy = 0;
350349

351350
ColorAlpha fg = surface.GetForeground();
352351
surface.SetForeground(white);
@@ -499,7 +498,7 @@ bool PickLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Blo
499498
{
500499
int bw = block.pWidth ? (w * block.pWidth / 100) : block.w;
501500
int bh = block.pHeight ? (h * block.pHeight / 100) : block.h;
502-
int dx, dy;
501+
int dx = 0, dy = 0;
503502

504503
switch(block.halign)
505504
{

0 commit comments

Comments
 (0)