Patch level : 2.2
Files correlati : ba8 ve1 Ricompilazione Demo : [ ] Commento : Corretto comando STRLEN nel linguaggio ALEX Aggiunto supoorto per fissare i cpi nei report in modo da poter usare anche font "bastardi" come il Monofonto git-svn-id: svn://10.65.10.50/trunk@13660 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5014e83f00
commit
8fdd8b925c
@ -968,12 +968,12 @@ void TAVM::execute(const TAVM_op& op)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case avm_store: do_store(_stack.pop().as_string()); break;
|
case avm_store: do_store(_stack.pop().as_string()); break;
|
||||||
case avm_strlen: _stack.push(_stack.peek().as_string().len()); break;
|
case avm_strlen: _stack.push(_stack.pop().as_string().len()); break;
|
||||||
case avm_strmid:
|
case avm_strmid:
|
||||||
{
|
{
|
||||||
const int len = _stack.pop().as_int();
|
const int len = _stack.pop().as_int();
|
||||||
const int frm = _stack.pop().as_int();
|
const int frm = _stack.pop().as_int();
|
||||||
const TString& str = _stack.peek().as_string();
|
const TString& str = _stack.pop().as_string();
|
||||||
_stack.push(str.mid(frm, len)); break;
|
_stack.push(str.mid(frm, len)); break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1859,7 +1859,8 @@ const TReport_font& TReport::print_font() const
|
|||||||
|
|
||||||
int TReport::cpi() const
|
int TReport::cpi() const
|
||||||
{
|
{
|
||||||
return _font.cpi();
|
const int udcpi = user_defined_cpi();
|
||||||
|
return udcpi > 0 ? udcpi : _font.cpi();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TReport::lpi() const
|
int TReport::lpi() const
|
||||||
@ -1869,12 +1870,12 @@ int TReport::lpi() const
|
|||||||
|
|
||||||
int TReport::print_cpi() const
|
int TReport::print_cpi() const
|
||||||
{
|
{
|
||||||
return print_font().cpi();
|
return (_use_printer_font || user_defined_cpi() <= 0) ? print_font().cpi() : cpi();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TReport::print_lpi() const
|
int TReport::print_lpi() const
|
||||||
{
|
{
|
||||||
return _use_printer_font ? printer().get_lines_per_inch() : _lpi;
|
return _use_printer_font ? printer().get_lines_per_inch() : lpi();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport::load_printer_font()
|
void TReport::load_printer_font()
|
||||||
@ -2072,6 +2073,7 @@ bool TReport::load(const char* fname)
|
|||||||
bool ok = xml.Load(_path);
|
bool ok = xml.Load(_path);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
|
_cpi = xml.GetIntAttr("cpi", 0); // 0 cpi = use font size
|
||||||
_lpi = xml.GetIntAttr("lpi", 6);
|
_lpi = xml.GetIntAttr("lpi", 6);
|
||||||
_font.load(xml);
|
_font.load(xml);
|
||||||
_use_printer_font = xml.GetBoolAttr("use_printer_font");
|
_use_printer_font = xml.GetBoolAttr("use_printer_font");
|
||||||
@ -2134,6 +2136,8 @@ bool TReport::save(const char* fname) const
|
|||||||
xml.SetAttr("name", name);
|
xml.SetAttr("name", name);
|
||||||
xml.SetAttr("class", _class);
|
xml.SetAttr("class", _class);
|
||||||
xml.SetAttr("command", _command_line);
|
xml.SetAttr("command", _command_line);
|
||||||
|
if (_cpi > 0)
|
||||||
|
xml.SetAttr("cpi", _cpi);
|
||||||
xml.SetAttr("lpi", _lpi);
|
xml.SetAttr("lpi", _lpi);
|
||||||
if (!_description.blank())
|
if (!_description.blank())
|
||||||
xml.AddChild("description") << _description;
|
xml.AddChild("description") << _description;
|
||||||
@ -2954,7 +2958,7 @@ void TReport::include_libraries(bool reload)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TReport::TReport()
|
TReport::TReport()
|
||||||
: _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL),
|
: _cpi(0), _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL),
|
||||||
_use_printer_font(false), _orientation(0)
|
_use_printer_font(false), _orientation(0)
|
||||||
{
|
{
|
||||||
_expressions.set_report(this);
|
_expressions.set_report(this);
|
||||||
|
@ -453,7 +453,7 @@ class TReport : public TAlex_virtual_machine
|
|||||||
TFilename _path;
|
TFilename _path;
|
||||||
TString _description;
|
TString _description;
|
||||||
TReport_font _font, _print_font; // Font
|
TReport_font _font, _print_font; // Font
|
||||||
int _lpi; // Lines per inch
|
int _cpi, _lpi; // Characters and Lines per inch
|
||||||
TToken_string _include; // ex: calib
|
TToken_string _include; // ex: calib
|
||||||
TString8 _class; // ex: ca3300a
|
TString8 _class; // ex: ca3300a
|
||||||
TString _command_line; // ex: ca3 -2
|
TString _command_line; // ex: ca3 -2
|
||||||
@ -517,8 +517,10 @@ public:
|
|||||||
void unmap_font();
|
void unmap_font();
|
||||||
void load_printer_font();
|
void load_printer_font();
|
||||||
|
|
||||||
|
int user_defined_cpi() const { return _cpi; }
|
||||||
int cpi() const;
|
int cpi() const;
|
||||||
int lpi() const;
|
int lpi() const;
|
||||||
|
void set_cpi(int cpi) { _cpi = cpi; }
|
||||||
void set_lpi(int lpi) { _lpi = lpi; }
|
void set_lpi(int lpi) { _lpi = lpi; }
|
||||||
|
|
||||||
int print_cpi() const;
|
int print_cpi() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user