Report: Print removed center parameter

git-svn-id: svn://ultimatepp.org/upp/trunk@5936 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-03-30 17:27:27 +00:00
parent a6d2838c5f
commit cab6be00e3
2 changed files with 4 additions and 8 deletions

View file

@ -144,7 +144,7 @@ public:
}; };
String Pdf(Report& report, bool pdfa = false); String Pdf(Report& report, bool pdfa = false);
void Print(Report& r, PrinterJob& pd, bool center = true); void Print(Report& r, PrinterJob& pd);
bool DefaultPrint(Report& r, int i, const char *_name = t_("Report")); bool DefaultPrint(Report& r, int i, const char *_name = t_("Report"));
bool Print(Report& r, int i, const char *name = t_("Report")); bool Print(Report& r, int i, const char *name = t_("Report"));
bool Perform(Report& r, const char *name = t_("Report")); bool Perform(Report& r, const char *name = t_("Report"));

View file

@ -4,18 +4,14 @@ NAMESPACE_UPP
#define LLOG(x) // LOG(x) #define LLOG(x) // LOG(x)
void Print(Report& r, PrinterJob& pd, bool center) void Print(Report& r, PrinterJob& pd)
{ {
Draw& w = pd; Draw& w = pd;
Size sz = w.GetPageSize(); Size sz = w.GetPageSize();
Point mg = r.GetMargins(); Point mg = r.GetMargins();
Size pgsz = r.GetPage(0).GetSize(); Size pgsz = r.GetPage(0).GetSize();
int x = 0; int x = Nvl(mg.x, (sz.cx - pgsz.cx) / 2);
int y = 0; int y = Nvl(mg.y, (sz.cy - pgsz.cy) / 2);
if(center) {
x = Nvl(mg.x, (sz.cx - pgsz.cx) / 2);
y = Nvl(mg.y, (sz.cy - pgsz.cy) / 2);
}
for(int i = 0; i < pd.GetPageCount(); i++) { for(int i = 0; i < pd.GetPageCount(); i++) {
Drawing iw = r.GetPage(pd[i]); Drawing iw = r.GetPage(pd[i]);
Size sz = iw.GetSize(); Size sz = iw.GetSize();