More small fixes

Use [] + & instead of at() + replace
Fix memory leak
remotes/origin/textfind-and-transparency
Albert Astals Cid 15 years ago
parent 792eca9fb5
commit cc8fd5280a
  1. 11
      core/textpage.cpp

@ -1817,8 +1817,8 @@ void TextPagePrivate::addNecessarySpace()
// 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(j = 0 ; j < tree.length() ; j++)
{ {
RegionText tmp = tree.at(j); RegionText &tmpRegion = tree[j];
TextList tmpList = tmp.text(); TextList tmpList = tmpRegion.text();
SortedTextList lines; SortedTextList lines;
LineRect line_rects; LineRect line_rects;
@ -1858,8 +1858,8 @@ void TextPagePrivate::addNecessarySpace()
} }
} }
while(tmpList.length()) qDeleteAll(tmpList);
tmpList.pop_back(); tmpList.clear();
for( i = 0 ; i < lines.length() ; i++) for( i = 0 ; i < lines.length() ; i++)
{ {
@ -1871,8 +1871,7 @@ void TextPagePrivate::addNecessarySpace()
} }
} }
tmp.setText(tmpList); tmpRegion.setText(tmpList);
tree.replace(j,tmp);
} }
// Step 03 // Step 03

Loading…
Cancel
Save