Patch level : 2.1 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Aggiunte per reports


git-svn-id: svn://10.65.10.50/trunk@12164 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2004-06-08 10:05:24 +00:00
parent 76e33cb1e3
commit 99fbfa77a3
4 changed files with 66 additions and 27 deletions

View File

@ -46,7 +46,8 @@ COLOR blend_colors(COLOR col1, COLOR col2, double perc)
const byte g = byte(g1 * perc + g2*(1.0-perc));
const byte b = byte(b1 * perc + b2*(1.0-perc));
return RGB2COLOR(r, g, b);
// return RGB2COLOR(r, g, b);
return MAKE_COLOR(r, g, b); // Faster
}
unsigned int color_distance(COLOR col1, COLOR col2)

View File

@ -1731,25 +1731,16 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
if (_cursor == NULL)
_cursor = new TCursor(_relation, "", key);
TRectype rec_start(_relation->curr());
TRectype rec_stop(_relation->curr());
pop();
if (tok.starts_with("FR"))
parse_region(rec_start);
else
push();
pop();
if (tok.starts_with("TO"))
parse_region(rec_stop);
else
push();
if (!rec_start.empty() || !rec_stop.empty())
_cursor->setregion(rec_start, rec_stop, 0x2);
TRectype rec_start(_relation->curr().num());
TRectype rec_stop(rec_start);
while (true)
{
pop();
if (tok.starts_with("FR"))
parse_region(rec_start); else
if (tok.starts_with("TO"))
parse_region(rec_stop); else
if (tok.starts_with("JO"))
parse_join(); else
if (tok.starts_with("SO"))
@ -1759,6 +1750,9 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
}
push();
if (!rec_start.empty() || !rec_stop.empty())
_cursor->setregion(rec_start, rec_stop, 0x2);
if (_relation->items() == 0) // Non ci sono anche tabelle collegate
{
FOR_EACH_ARRAY_ITEM(_column, i, obj)

View File

@ -448,7 +448,7 @@ public:
int cpi() const { return _font.cpi(); }
int lpi() const { return _lpi; }
void set_lpi(int lpi) { _lpi= lpi; }
void set_lpi(int lpi) { _lpi = lpi; }
bool set_recordset(const TString& sql);
bool set_recordset(TRecordset* sql);
@ -460,8 +460,8 @@ public:
void set_prescript(const char* src);
const TString& postscript() const;
void set_postscript(const char* src);
bool execute_prescript();
bool execute_postscript();
virtual bool execute_prescript();
virtual bool execute_postscript();
const TString_array& params() const { return _params; }
void set_params(const TString_array& p) { _params = p; }

View File

@ -965,7 +965,7 @@ bool TBook::export_text(const TFilename& fname) const
row = y * lpi() / res.y;
col = x * cpi() / res.x;
wid = dx * cpi() / res.x;
hei = dy * cpi() / res.y;
hei = dy * lpi() / res.y;
} else
if (str == "<line/>")
{
@ -973,9 +973,44 @@ bool TBook::export_text(const TFilename& fname) const
{
if (page.objptr(row) == NULL)
page.add("", row);
TString& line = page.row(row++);
const TString stringona(wid, '-');
line.overwrite(stringona, col);
TString& line = page.row(row);
for (int i = 0; i < wid; i++)
{
const int j = i+col;
if (j >= line.len())
line.overwrite("-", j);
else
{
if (line[j] == '|')
line[j] = '+';
else
{
if (line[j] == ' ')
line[j] = '-';
}
}
}
} else
if (hei > 0 && wid == 0)
{
for (int i = row; i < row+hei; i++)
{
if (page.objptr(i) == NULL)
page.add("", i);
TString& line = page.row(i);
if (line.len() <= col)
line.overwrite("|", col);
else
{
if (line[col] == '-')
line[col] = '+';
else
{
if (line[col] == ' ')
line[col] = '|';
}
}
}
}
}
if (str.starts_with("<page "))
@ -995,20 +1030,29 @@ bool TBook::export_text(const TFilename& fname) const
} else
if (str == "<text>")
{
TString stringona;
while (!ifs.eof())
{
ifs.getline(buffer, str.size());
if (str == "</text>")
break;
if (page.objptr(row) == NULL)
page.add("", row);
TString& line = page.row(row++);
stringona << str << '\n';
}
stringona.rtrim();
TParagraph_string para(stringona, wid);
for (int i = 0; i < hei && i < para.items(); i++)
{
const int j = row+i;
if (page.objptr(j) == NULL)
page.add("", j);
str = para.get();
TString& line = page.row(j);
switch (_horizontal_alignment)
{
case 'C': line.overwrite(str, col+(wid-str.len())/2); break;
case 'R': line.overwrite(str, col+wid-str.len()); break;
default : line.overwrite(str, col); break;
}
}
}
} else
if (str.starts_with("<text_align "))