r16068 by craig - #9552: Apply StoryText::nrOfParagraph

scribus-commit scribus-commit at lists.scribus.net
Sun Dec 5 22:01:42 CET 2010


Author: craig
Date: Sun Dec  5 21:01:41 2010
New Revision: 16068

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16068
Log:
#9552: Apply StoryText::nrOfParagraph

Modified:
    branches/Version135/Scribus/scribus/text/storytext.cpp
    branches/Version135/Scribus/scribus/text/storytext.h

Modified: branches/Version135/Scribus/scribus/text/storytext.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16068&path=/branches/Version135/Scribus/scribus/text/storytext.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/text/storytext.cpp (original)
+++ branches/Version135/Scribus/scribus/text/storytext.cpp Sun Dec  5 21:01:41 2010
@@ -850,13 +850,14 @@
 }
 
 
-int StoryText::nrOfParagraph(uint index) const
-{
-	int result = 0;
+uint StoryText::nrOfParagraph(int pos) const
+{
+	uint result = 0;
 	StoryText* that = const_cast<StoryText *>(this);
 	bool lastWasPARSEP = true;
-	index = qMin(index, (uint) that->length());
-	for (uint i=0; i < index; ++i) {
+	pos = qMin(pos, that->length());
+	for (int i=0; i < pos; ++i) 
+	{
 		lastWasPARSEP = that->d->at(i)->ch == SpecialChars::PARSEP;
 		if (lastWasPARSEP)
 			++result;
@@ -869,7 +870,8 @@
 	uint result = 0;
 	StoryText* that = const_cast<StoryText *>(this);
 	bool lastWasPARSEP = true;
-	for (int i=0; i < length(); ++i) {
+	for (int i=0; i < length(); ++i) 
+	{
 		lastWasPARSEP = that->d->at(i)->ch == SpecialChars::PARSEP;
 		if (lastWasPARSEP)
 			++result;
@@ -883,7 +885,8 @@
 		return 0;
 
 	StoryText* that = const_cast<StoryText *>(this);
-	for (int i=0; i < length(); ++i) {
+	for (int i=0; i < length(); ++i) 
+	{
 		if (that->d->at(i)->ch == SpecialChars::PARSEP && ! --index)
 			return i + 1;
 	}
@@ -894,7 +897,8 @@
 {
 	++index;
 	StoryText* that = const_cast<StoryText *>(this);
-	for (int i=0; i < length(); ++i) {
+	for (int i=0; i < length(); ++i) 
+	{
 		if (that->d->at(i)->ch == SpecialChars::PARSEP && ! --index)
 			return i;
 	}

Modified: branches/Version135/Scribus/scribus/text/storytext.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16068&path=/branches/Version135/Scribus/scribus/text/storytext.h
==============================================================================
--- branches/Version135/Scribus/scribus/text/storytext.h (original)
+++ branches/Version135/Scribus/scribus/text/storytext.h Sun Dec  5 21:01:41 2010
@@ -146,7 +146,7 @@
  	uint nrOfParagraphs() const;
  	int startOfParagraph(uint index) const;
  	int endOfParagraph(uint index) const;
-	int nrOfParagraph(uint index) const;
+	uint nrOfParagraph(int pos) const;
 
  	uint nrOfRuns() const;
  	int startOfRun(uint index) const;




More information about the scribus-commit mailing list