Commit a9fd4400 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Add some const &

parent 3f69b491
......@@ -236,12 +236,12 @@ public:
return m_area;
}
inline void setArea(const QRect area)
inline void setArea(const QRect &area)
{
m_area = area;
}
inline void setText(const TextList text)
inline void setText(const TextList &text)
{
m_region_text = text;
}
......@@ -992,7 +992,7 @@ QString TextPage::text(const RegularAreaRect *area, TextAreaInclusionBehaviour b
return ret;
}
bool compareTinyTextEntityX(TinyTextEntity* first, TinyTextEntity* second)
static bool compareTinyTextEntityX(TinyTextEntity* first, TinyTextEntity* second)
{
QRect firstArea = first->area.roundedGeometry(1000,1000);
QRect secondArea = second->area.roundedGeometry(1000,1000);
......@@ -1000,7 +1000,7 @@ bool compareTinyTextEntityX(TinyTextEntity* first, TinyTextEntity* second)
return firstArea.left() < secondArea.left();
}
bool compareTinyTextEntityY(TinyTextEntity* first, TinyTextEntity* second)
static bool compareTinyTextEntityY(TinyTextEntity* first, TinyTextEntity* second)
{
QRect firstArea = first->area.roundedGeometry(1000,1000);
QRect secondArea = second->area.roundedGeometry(1000,1000);
......@@ -1008,16 +1008,6 @@ bool compareTinyTextEntityY(TinyTextEntity* first, TinyTextEntity* second)
return firstArea.top() < secondArea.top();
}
bool compareRegionTextY(const RegionText& first, const RegionText& second)
{
return first.area().top() < second.area().top();
}
bool compareRegionTextX(const RegionText& first, const RegionText& second)
{
return first.area().left() < second.area().left();
}
/**
* Copies a TextList to m_words with the same pointer
*/
......@@ -1277,7 +1267,7 @@ void TextPagePrivate::makeWordFromCharacters()
/**
* Create Lines from the words and sort them
*/
void TextPagePrivate::makeAndSortLines(TextList &wordsTmp,
void TextPagePrivate::makeAndSortLines(const TextList &wordsTmp,
SortedTextList &lines, LineRect &line_rects)
{
/**
......@@ -1380,8 +1370,8 @@ void TextPagePrivate::makeAndSortLines(TextList &wordsTmp,
/**
* Calculate Statistical information from the lines we made previously
*/
void TextPagePrivate::calculateStatisticalInformation(SortedTextList &lines, LineRect line_rects,int &word_spacing,
int &line_spacing,int &col_spacing)
void TextPagePrivate::calculateStatisticalInformation(const SortedTextList &lines, const LineRect &line_rects, int &word_spacing,
int &line_spacing, int &col_spacing)
{
/**
* For the region, defined by line_rects and lines
......
......@@ -79,13 +79,13 @@ class TextPagePrivate
/**
* Create lines from TextList and sort them according to their position
*/
void makeAndSortLines(TextList &words,SortedTextList &lines,LineRect &line_rects);
void makeAndSortLines(const TextList &words, SortedTextList &lines, LineRect &line_rects);
/**
* Caluclate statistical info like, word spacing, column spacing, line spacing from the Lines
* we made
*/
void calculateStatisticalInformation(SortedTextList &lines, LineRect line_rects,int& word_spacing,
void calculateStatisticalInformation(const SortedTextList &lines, const LineRect &line_rects, int& word_spacing,
int& line_spacing, int& column_spacing);
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment