Rename copy* functions to something I like more

remotes/origin/textfind-and-transparency
Albert Astals Cid 15 years ago
parent c78a7069b1
commit be8f9bd9cb
  1. 16
      core/textpage.cpp
  2. 4
      core/textpage_p.h

@ -999,7 +999,7 @@ static bool compareTinyTextEntityY(TinyTextEntity* first, TinyTextEntity* second
/** /**
* Copies a TextList to m_words with the same pointer * Copies a TextList to m_words with the same pointer
*/ */
void TextPagePrivate::copyTo(TextList &list) void TextPagePrivate::copyFromList(const TextList &list)
{ {
TextList::Iterator it = m_words.begin(), itEnd = m_words.end(); TextList::Iterator it = m_words.begin(), itEnd = m_words.end();
for( ; it != itEnd ; it++) for( ; it != itEnd ; it++)
@ -1017,7 +1017,7 @@ void TextPagePrivate::copyTo(TextList &list)
/** /**
* Copies from m_words to list with distinct pointers * Copies from m_words to list with distinct pointers
*/ */
void TextPagePrivate::copyFrom(TextList &list) void TextPagePrivate::copyToList(TextList &list) const
{ {
TextList::Iterator it = list.begin(), itEnd = list.end(); TextList::Iterator it = list.begin(), itEnd = list.end();
for( ; it != itEnd ; it++) for( ; it != itEnd ; it++)
@ -1147,7 +1147,7 @@ void TextPagePrivate::makeWordFromCharacters()
TextList tmpList; TextList tmpList;
TextList newList; TextList newList;
copyFrom(tmpList); copyToList(tmpList);
TextList::Iterator it = tmpList.begin(), itEnd = tmpList.end(), tmpIt; TextList::Iterator it = tmpList.begin(), itEnd = tmpList.end(), tmpIt;
int newLeft,newRight,newTop,newBottom; int newLeft,newRight,newTop,newBottom;
@ -1247,7 +1247,7 @@ void TextPagePrivate::makeWordFromCharacters()
if(it == itEnd) break; if(it == itEnd) break;
} }
copyTo(newList); copyFromList(newList);
qDeleteAll(tmpList); qDeleteAll(tmpList);
qDeleteAll(newList); qDeleteAll(newList);
} }
@ -1536,7 +1536,7 @@ void TextPagePrivate::XYCutForBoundingBoxes(int tcx, int tcy)
RegionTextList tree; RegionTextList tree;
QRect contentRect(m_page->m_page->boundingBox().geometry(pageWidth,pageHeight)); QRect contentRect(m_page->m_page->boundingBox().geometry(pageWidth,pageHeight));
TextList words; TextList words;
copyFrom(words); copyToList(words);
RegionText root(words,contentRect); RegionText root(words,contentRect);
// start the tree with the root, it is our only region at the start // start the tree with the root, it is our only region at the start
@ -1809,7 +1809,7 @@ void TextPagePrivate::XYCutForBoundingBoxes(int tcx, int tcy)
} }
} }
//copying elements of tmp to m_words //copying elements of tmp to m_words
copyTo(tmp); copyFromList(tmp);
// we are not removing tmp because, the elements of tmp are in m_XY_cut_tree, we will finally free from m_XY_cut_tree // we are not removing tmp because, the elements of tmp are in m_XY_cut_tree, we will finally free from m_XY_cut_tree
m_XY_cut_tree = tree; m_XY_cut_tree = tree;
@ -1906,7 +1906,7 @@ void TextPagePrivate::addNecessarySpace()
tmp.append(new TinyTextEntity(ent->text(),ent->area)); tmp.append(new TinyTextEntity(ent->text(),ent->area));
} }
} }
copyTo(tmp); copyFromList(tmp);
} }
/** /**
@ -1955,7 +1955,7 @@ void TextPagePrivate::breakWordIntoCharacters()
tmp.append(list); tmp.append(list);
} }
} }
copyTo(tmp); copyFromList(tmp);
} }

@ -59,12 +59,12 @@ class TextPagePrivate
/** /**
* Copy a TextList to m_words * Copy a TextList to m_words
*/ */
void copyTo(TextList &list); void copyFromList(const TextList &list);
/** /**
* Copy m_words to a TextList * Copy m_words to a TextList
*/ */
void copyFrom(TextList &list); void copyToList(TextList &list) const;
/** /**
* Remove odd spaces which are much bigger than normal spaces from m_words * Remove odd spaces which are much bigger than normal spaces from m_words

Loading…
Cancel
Save