From fd155f90d4aca6290f55eedb68fc2681cf2f08b4 Mon Sep 17 00:00:00 2001 From: xavier Date: Sun, 26 Feb 2012 18:34:24 +0000 Subject: [PATCH] Title block template rendering: minor optimization. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1533 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/titleblocktemplate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/titleblocktemplate.cpp b/sources/titleblocktemplate.cpp index a13bd3835..7ab32dce8 100644 --- a/sources/titleblocktemplate.cpp +++ b/sources/titleblocktemplate.cpp @@ -1156,7 +1156,7 @@ void TitleBlockTemplate::render(QPainter &painter, const DiagramContext &diagram // draw the titleblock border painter.drawRect(QRect(0, 0, titleblock_width, titleblock_height)); - // run through each inidividual cell + // run through each individual cell for (int j = 0 ; j < rows_heights_.count() ; ++ j) { for (int i = 0 ; i < columns_width_.count() ; ++ i) { if (cells_[i][j] -> spanner_cell || cells_[i][j] -> cell_type == TitleBlockCell::EmptyCell) continue; @@ -1243,6 +1243,7 @@ QString TitleBlockTemplate::finalTextForCell(const TitleBlockCell &cell, const D @param cell_rect Rectangle delimiting the cell area */ void TitleBlockTemplate::renderTextCell(QPainter &painter, const QString &text, const TitleBlockCell &cell, const QRectF &cell_rect) const { + if (text.isEmpty()) return; QFont text_font = TitleBlockTemplate::fontForCell(cell); painter.setFont(text_font);