applicat.cpp Cambiata una TString80 in TFilename

form.cpp       Corretto il settabbgio del background alla printer
printer.cpp    Corretto il gettaggio del background dalla printer

ATTENZIONE: Queste due correzioni implicano aggiornamenti al programma
che ha dichiarato come unico background nel form SECTION GRAPHICS FIRST
e non ODD come tutti.


git-svn-id: svn://10.65.10.50/trunk@5501 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-10-31 13:43:39 +00:00
parent 6f04baa411
commit e35d75f96e
3 changed files with 19 additions and 9 deletions

View File

@ -614,7 +614,7 @@ bool TApplication::set_firm(long newfirm)
if (newfirm < 1)
{
TMask mask("bagn002");
TString80 pp(__ptprf); pp.cut(pp.len()-1);
TFilename pp(__ptprf); pp.cut(pp.len()-1);
mask.set(F_PATHPREF, pp);
mask.show(-2, extended_firm());

View File

@ -2170,10 +2170,10 @@ bool TGraphic_section::update()
int index;
switch(page_type())
{
case even_page: index = 1; break;
case odd_page : index = 2; break;
case last_page: index = 3; break;
default : index = 0; break;
case even_page : index = 1; break;
case first_page: index = 2; break;
case last_page : index = 3; break;
default : index = 0; break;
}
printer().setbackground(_back, index);
return ok;

View File

@ -575,11 +575,21 @@ void TPrinter::setbackground(const char* b, int index)
TString_array& TPrinter::getbgdesc(word page) const
{
if (_backgrounds.items() == 0)
((TPrinter*)this)->_backgrounds.add(new TString_array(formlen()));
int index = (page > 0) ? ((page-1) % _backgrounds.items()) : 0;
int index = 0;
if (page == 0 && _backgrounds.objptr(3))
index = 3;
if (page == 1 && _backgrounds.objptr(2))
index = 2;
if (index == 0 && (page & 0x1) == 0 && _backgrounds.objptr(1))
index = 1;
TString_array* bg = (TString_array*)_backgrounds.objptr(index);
CHECK(bg, "Null printer background");
if (bg == NULL)
{
bg = new TString_array(formlen());
((TPrinter*)this)->_backgrounds.add(bg, index); // keep const
}
return *bg;
}