From c93ec50c0d986fbdabc1019e0086d87278131178 Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Thu, 14 Oct 2021 17:59:01 +0200 Subject: [PATCH] Patch level : 12.0 1086 Files correlati : ci1300ab.rep ci1300bb.rep ci1300a.rep ci1300a.msk ci1300b.rep ci1.exe Commento : Aggiunti report per beneficiario alla stampa ore per risorsa/attrezzatura aggiunto logo del beneficiario sintassi da mettere nel prescript del campo immagine : LOGO_BENEF #THIS ! L'Id dell'immagine deve essere LOGO+ --- src/include/reprint.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/include/reprint.cpp b/src/include/reprint.cpp index fc5b786f3..7009ad854 100755 --- a/src/include/reprint.cpp +++ b/src/include/reprint.cpp @@ -1166,30 +1166,32 @@ void TBook::draw_image(const TReport_rct& rect, const char* filename, const char { TReport_rct new_rect(rect); - if (resize && *resize) + if (resize && *resize && filename && *filename) { TImage* img = _images.image(filename); - switch (resize[0]) + if (img != nullptr) { - case 'N': - new_rect.set_width(img->width()); - new_rect.set_height(img->height()); - break; - case 'X': + switch (resize[0]) { - long ratio = long((double(img->height()) / double(img->width())) * 100000.0); + case 'N': + new_rect.set_width(img->width()); + new_rect.set_height(img->height()); + break; + case 'X': + { + long ratio = long((double(img->height()) / double(img->width())) * 100000.0); short old_ysize = rect.height(); long new_ysize = rect.width() * ratio / 100000L; TReport_size s(rect.width(), (new_ysize * lpi()) / cpi()); - TReport_pnt o(rect.left(), rect.top() + ((old_ysize - new_ysize) * cpi())/ (2 * lpi())); + TReport_pnt o(rect.left(), rect.top() + ((old_ysize - new_ysize) * cpi()) / (2 * lpi())); new_rect.set(o, s); } break; - case 'Y': + case 'Y': { - long ratio = long((double(img->width()) / double(img->height())) * 100000.0); + long ratio = long((double(img->width()) / double(img->height())) * 100000.0); short old_xsize = rect.width(); long new_xsize = rect.height() * ratio / 100000L; TReport_size s((new_xsize * cpi()) / lpi(), rect.height()); @@ -1198,8 +1200,9 @@ void TBook::draw_image(const TReport_rct& rect, const char* filename, const char new_rect.set(o, s); } break; - default: - break; + default: + break; + } } } define_frame(new_rect);