← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2895: poy's patch for fixing [L#966333]

 

------------------------------------------------------------
revno: 2895
committer: iceman50 <bdcdevel@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Sat 2012-04-07 14:49:12 -0500
message:
  poy's patch for fixing [L#966333]
modified:
  dwt/src/widgets/RichTextBox.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/src/widgets/RichTextBox.cpp'
--- dwt/src/widgets/RichTextBox.cpp	2012-04-07 16:26:13 +0000
+++ dwt/src/widgets/RichTextBox.cpp	2012-04-07 19:49:12 +0000
@@ -98,10 +98,16 @@
 		format.rcPage = format.rc;
 
 		// find the first fully visible line (sometimes they're partially cut).
-		for(auto line = getFirstVisibleLine(); ; ++line) {
+		bool found = false;
+		for(long line = getFirstVisibleLine(), n = getLineCount(); line < n; ++line) {
 			format.chrg.cpMin = lineIndex(line);
-			if(posFromChar(format.chrg.cpMin).y >= 0)
+			if(posFromChar(format.chrg.cpMin).y >= 0) {
+				found = true;
 				break;
+			}
+		}
+		if(!found) {
+			format.chrg.cpMin = 0;
 		}
 		format.chrg.cpMax = -1;