define int for "iterators" in the for declaration

remotes/origin/textfind-and-transparency
Albert Astals Cid 15 years ago
parent cc8fd5280a
commit 2e1d140d69
  1. 23
      core/textpage.cpp

@ -1269,7 +1269,6 @@ void TextPagePrivate::makeAndSortLines(const TextList &wordsTmp,
// Step 2 // Step 2
TextList::Iterator it = words.begin(), itEnd = words.end(); TextList::Iterator it = words.begin(), itEnd = words.end();
int i = 0;
int newLeft,newRight,newTop,newBottom; int newLeft,newRight,newTop,newBottom;
const int pageWidth = m_page->m_page->width(); const int pageWidth = m_page->m_page->width();
const int pageHeight = m_page->m_page->height(); const int pageHeight = m_page->m_page->height();
@ -1280,7 +1279,7 @@ void TextPagePrivate::makeAndSortLines(const TextList &wordsTmp,
const QRect elementArea = (*it)->area.roundedGeometry(pageWidth,pageHeight); const QRect elementArea = (*it)->area.roundedGeometry(pageWidth,pageHeight);
bool found = false; bool found = false;
for( i = 0 ; i < lines.length() ; i++) for( int i = 0 ; i < lines.length() ; i++)
{ {
/* the line area which will be expanded /* the line area which will be expanded
line_rects is only necessary to preserve the topmin and bottommax of all line_rects is only necessary to preserve the topmin and bottommax of all
@ -1330,7 +1329,7 @@ void TextPagePrivate::makeAndSortLines(const TextList &wordsTmp,
} }
// Step 3 // Step 3
for(i = 0 ; i < lines.length() ; i++) for(int i = 0 ; i < lines.length() ; i++)
{ {
TextList &list = lines[i]; TextList &list = lines[i];
qSort(list.begin(),list.end(),compareTinyTextEntityX); qSort(list.begin(),list.end(),compareTinyTextEntityX);
@ -1392,11 +1391,10 @@ void TextPagePrivate::calculateStatisticalInformation(const SortedTextList &line
QList< QList<QRect> > space_rects; QList< QList<QRect> > space_rects;
QList<QRect> max_hor_space_rects; QList<QRect> max_hor_space_rects;
int i;
int pageWidth = m_page->m_page->width(), pageHeight = m_page->m_page->height(); int pageWidth = m_page->m_page->width(), pageHeight = m_page->m_page->height();
// Space in every line // Space in every line
for(i = 0 ; i < lines.length() ; i++) for(int i = 0 ; i < lines.length() ; i++)
{ {
TextList list = lines.at(i); TextList list = lines.at(i);
QList<QRect> line_space_rects; QList<QRect> line_space_rects;
@ -1810,12 +1808,11 @@ void TextPagePrivate::addNecessarySpace()
*/ */
RegionTextList tree = m_XY_cut_tree; RegionTextList tree = m_XY_cut_tree;
int i,j,k;
const int pageWidth = m_page->m_page->width(); const int pageWidth = m_page->m_page->width();
const int pageHeight = m_page->m_page->height(); const int pageHeight = m_page->m_page->height();
// Only change the texts under RegionTexts, not the area // Only change the texts under RegionTexts, not the area
for(j = 0 ; j < tree.length() ; j++) for(int j = 0 ; j < tree.length() ; j++)
{ {
RegionText &tmpRegion = tree[j]; RegionText &tmpRegion = tree[j];
TextList tmpList = tmpRegion.text(); TextList tmpList = tmpRegion.text();
@ -1826,10 +1823,10 @@ void TextPagePrivate::addNecessarySpace()
makeAndSortLines(tmpList,lines,line_rects); makeAndSortLines(tmpList,lines,line_rects);
// Step 02 // Step 02
for(i = 0 ; i < lines.length() ; i++) for(int i = 0 ; i < lines.length() ; i++)
{ {
TextList &list = lines[i]; TextList &list = lines[i];
for( k = 0 ; k < list.length() ; k++ ) for(int k = 0 ; k < list.length() ; k++ )
{ {
const QRect area1 = list.at(k)->area.roundedGeometry(pageWidth,pageHeight); const QRect area1 = list.at(k)->area.roundedGeometry(pageWidth,pageHeight);
if( k+1 >= list.length() ) break; if( k+1 >= list.length() ) break;
@ -1861,10 +1858,10 @@ void TextPagePrivate::addNecessarySpace()
qDeleteAll(tmpList); qDeleteAll(tmpList);
tmpList.clear(); tmpList.clear();
for( i = 0 ; i < lines.length() ; i++) for(int i = 0 ; i < lines.length() ; i++)
{ {
TextList list = lines.at(i); TextList list = lines.at(i);
for( k = 0 ; k < list.length() ; k++) for(int k = 0 ; k < list.length() ; k++)
{ {
TinyTextEntity *ent = list.at(k); TinyTextEntity *ent = list.at(k);
tmpList.append(ent); tmpList.append(ent);
@ -1876,10 +1873,10 @@ void TextPagePrivate::addNecessarySpace()
// Step 03 // Step 03
TextList tmp; TextList tmp;
for(i = 0 ; i < tree.length() ; i++) for(int i = 0 ; i < tree.length() ; i++)
{ {
TextList list = tree.at(i).text(); TextList list = tree.at(i).text();
for(j = 0 ; j < list.length() ; j++) for(int j = 0 ; j < list.length() ; j++)
{ {
TinyTextEntity *ent = list.at(j); TinyTextEntity *ent = list.at(j);
tmp.append(new TinyTextEntity(ent->text(),ent->area)); tmp.append(new TinyTextEntity(ent->text(),ent->area));

Loading…
Cancel
Save