From f2ee1360350098c8d8de9abe66d9728598708c19 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 2 Feb 2012 18:14:22 +0200 Subject: [PATCH] Addition to SANKORE-408. --- src/domain/UBGraphicsTextItemDelegate.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index 55eed451..ea031cf1 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -305,7 +305,7 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta) bool bEndofTheSameBlock; int iBlockLen; int iPointSize; - int inewPointSize; + int iNextPointSize; int iCursorPos = startPos; // we search continuous blocks of the text with the same PointSize and allpy new settings for them. @@ -327,17 +327,18 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta) iBlockLen++; cursor.setPosition (iCursorPos+iBlockLen+1, QTextCursor::KeepAnchor); - inewPointSize = cursor.charFormat().font().pointSize(); + iNextPointSize = cursor.charFormat().font().pointSize(); cursor.setPosition (iCursorPos+iBlockLen, QTextCursor::KeepAnchor); - if ((iPointSize != inewPointSize)||(iCursorPos+iBlockLen >= endPos)) + if ((iPointSize != iNextPointSize)||(iCursorPos+iBlockLen >= endPos)) bEndofTheSameBlock = true; }while(!bEndofTheSameBlock); //setting new parameners - curFont.setPointSize(iPointSize + delta); + int iNewPointSize = iPointSize + delta; + curFont.setPointSize( (iNewPointSize > 0)?iNewPointSize:1); textFormat.setFont(curFont); cursor.mergeCharFormat(textFormat);