View Issue Details

IDProjectCategoryView StatusLast Update
0009552ScribusStory Editor / Text Framespublic2011-01-04 10:58
Reportercezaryece Assigned Tocbradney  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Version1.3.8 
Target Version1.4.0svnFixed in Version1.4.0svn 
Summary0009552: StoryText::nrOfParagraph take uint parameter and return int type
DescriptionNow we have definition:

int StoryText::nrOfParagraph(uint index)

but this method should take position in text (int) and should return paragraph index (uint), so... it should be

uint StoryText::nrOfParagraph(int pos)

I attach patch (1.3.9svn) for changing it, as I am using this new definition in some other patches I plan to issue. And please commit it fast.
TagsNo tags attached.
Patch

Activities

cezaryece

2010-12-03 08:45

updater  

nrOfParagraph.patch (1,279 bytes)   
Index: Scribus/scribus/text/storytext.cpp
===================================================================
--- Scribus/scribus/text/storytext.cpp	(wersja 16036)
+++ Scribus/scribus/text/storytext.cpp	(kopia robocza)
@@ -850,13 +850,13 @@
 }


-int StoryText::nrOfParagraph(uint index) const
+uint StoryText::nrOfParagraph(int pos) const
 {
-	int result = 0;
+	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;
Index: Scribus/scribus/text/storytext.h
===================================================================
--- Scribus/scribus/text/storytext.h	(wersja 15812)
+++ Scribus/scribus/text/storytext.h	(kopia robocza)
@@ -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;
nrOfParagraph.patch (1,279 bytes)   

plinnell

2010-12-03 12:25

viewer   ~0024970

please review and commit

plinnell

2010-12-03 12:26

viewer   ~0024971

Reminder sent to: avox, cbradney, fschmid

FYI, please review

fschmid

2010-12-03 18:54

administrator   ~0024974

Seems ok for me.

cbradney

2010-12-05 21:03

administrator   ~0024987

Committed, thanks.

Issue History

Date Modified Username Field Change
2010-12-03 08:45 cezaryece New Issue
2010-12-03 08:45 cezaryece File Added: nrOfParagraph.patch
2010-12-03 12:25 plinnell Note Added: 0024970
2010-12-03 12:25 plinnell Status new => assigned
2010-12-03 12:25 plinnell Target Version => 1.4.0svn
2010-12-03 12:26 plinnell Note Added: 0024971
2010-12-03 18:54 fschmid Note Added: 0024974
2010-12-04 04:22 christoph_s Assigned To => cbradney
2010-12-05 21:03 cbradney Note Added: 0024987
2010-12-05 21:03 cbradney Status assigned => resolved
2010-12-05 21:03 cbradney Fixed in Version => 1.4.0svn
2010-12-05 21:03 cbradney Resolution open => fixed
2011-01-04 10:58 plinnell Status resolved => closed
2015-09-17 20:08 Kunda Category Story Editor / Text Frames => Story Ed/Txt Frames
2015-09-17 20:12 Kunda Category Story Ed/Txt Frames => Story Editor / Text Frames