r18296 by fschmid - Fixed Bug #11296: XTG Import crashes Scribus. Note: i just fixed the crash, didn't touch the importing functionality

scribus-commit scribus-commit at lists.scribus.net
Thu May 30 08:12:18 UTC 2013


Author: fschmid
Date: Thu May 30 08:12:18 2013
New Revision: 18296

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18296
Log:
Fixed Bug #11296: XTG Import crashes Scribus. Note: i just fixed the crash, didn't touch the importing functionality

Modified:
    trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp

Modified: trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18296&path=/trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp Thu May 30 08:12:18 2013
@@ -1253,12 +1253,18 @@
 
 QChar XtgScanner::lookAhead()
 {
-	return input_Buffer.at ( top );
+	QChar ch = QChar(0);
+	if (top < input_Buffer.length())
+		ch = input_Buffer.at(top);
+	return ch;
 }
 
 QChar XtgScanner::nextSymbol()
 {
-	return input_Buffer.at ( top++ );
+	QChar ch = QChar(0);
+	if (top < input_Buffer.length())
+		ch = input_Buffer.at(top++);
+	return ch;
 }
 
 void XtgScanner::flushText()
@@ -1365,6 +1371,8 @@
 			}
 			currentCharStyle = writer->getCurrentCharStyle();
 		}
+		if (top == input_Buffer.length())
+			break;
 	}
 	writer->appendText(textToAppend);
 	qDebug()<<"Unsupported : "<<unSupported;




More information about the scribus-commit mailing list