Commit dca4ee55 authored by Mohammad Mahfuzur Rahman Mamun's avatar Mohammad Mahfuzur Rahman Mamun
Browse files

Another Code Refactoring done

parent 88ec0951
......@@ -210,42 +210,48 @@ class OKULAR_EXPORT NormalizedRect
/**
* Returns true if the point pt is located to the bottom of the rectangle
*/
bool isBottom(NormalizedPoint pt) const{
bool isBottom(NormalizedPoint pt) const
{
return bottom < pt.y;
}
/**
* Returns true if the point pt is located on the top of the rectangle
*/
bool isTop(NormalizedPoint pt) const{
bool isTop(NormalizedPoint pt) const
{
return top > pt.y;
}
/**
* Returns true if the point pt is located under the top of the rectangle
*/
bool isBottomOrLevel(NormalizedPoint pt) const{
bool isBottomOrLevel(NormalizedPoint pt) const
{
return top < pt.y;
}
/**
* Returns true if the point pt is located above the bottom of the rectangle
*/
bool isTopOrLevel(NormalizedPoint pt) const{
bool isTopOrLevel(NormalizedPoint pt) const
{
return bottom > pt.y;
}
/**
* Returns true if the point pt is located to the right of the left arm of rectangle
*/
bool isLeft(NormalizedPoint pt) const{
bool isLeft(NormalizedPoint pt) const
{
return left < pt.x;
}
/**
* Returns true if the point pt is located to the left of the right arm of rectangle
*/
bool isRight(NormalizedPoint pt) const{
bool isRight(NormalizedPoint pt) const
{
return right > pt.x;
}
......
......@@ -453,7 +453,7 @@ void Page::setTextPage( TextPage * textPage )
{
d->m_text->d->m_page = d;
/**
* Correct text order for text selection
* Correct text order for before text selection
*/
d->m_text->correctTextOrder();
}
......
This diff is collapsed.
......@@ -28,15 +28,15 @@ typedef QList< TinyTextEntity* > TextList;
typedef bool ( *TextComparisonFunction )( const QStringRef & from, const QStringRef & to,
int *fromLength, int *toLength );
//mamun.nightcrawler@gmail.com
/**
We will make a line of TextList and also store the bounding rectangle of line
**/
* Make a line of TextList and store the bounding rectangle of line
*/
typedef QList<TextList> SortedTextList;
typedef QList<QRect> LineRect;
/** list of RegionText -- keeps a bunch of TextList with their bounding rectangles **/
/**
* A list of RegionText. It keeps a bunch of TextList with their bounding rectangles
*/
typedef QList<RegionText> RegionTextList;
class TextPagePrivate
......@@ -55,10 +55,6 @@ class TextPagePrivate
TextComparisonFunction comparer,
const TextList::ConstIterator &start,
const TextList::ConstIterator &end );
/**
* Prints a line from m_lines
*/
void printTextList(int i, TextList list);
/**
* Copy a TextList to m_words
......@@ -70,11 +66,6 @@ class TextPagePrivate
*/
void copyFrom(TextList &list);
/**
* Print the textpage contents with area (text and bounding rect)
*/
void printTextPageContent();
/**
* Remove odd spaces which are much bigger than normal spaces from m_words
*/
......@@ -103,7 +94,6 @@ class TextPagePrivate
*/
void XYCutForBoundingBoxes(int tcx,int tcy);
/**
* Add additional spaces between words, if necessary, which can make the words valuable
* while copying after selection
......@@ -115,8 +105,6 @@ class TextPagePrivate
*/
void breakWordIntoCharacters();
// variables those can be accessed directly from TextPage
QMap<int, RegionText> m_word_chars_map;
RegionTextList m_XY_cut_tree;
......
......@@ -309,32 +309,26 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
for( int x = highlightRect.left(); x <= highlightRect.right(); ++x )
{
val = data[ x + offset ];
//for odt or epub
if(has_alpha){
if(has_alpha)
{
newR = qRed(val);
newG = qGreen(val);
newB = qBlue(val);
if(newR == newG && newG == newB && newR == 0){
if(newR == newG && newG == newB && newR == 0)
newR = newG = newB = 255;
}
newR = (newR * rh)/255;
newG = (newG * gh)/255;
newB = (newB * bh)/255;
// cout << newR << "," << newG << "," << newB << endl;
newR = (newR * rh) / 255;
newG = (newG * gh) / 255;
newB = (newB * bh) / 255;
}
//pdf, djvu and other formats
else{
else
{
newR = (qRed(val) * rh) / 255;
newG = (qGreen(val) * gh) / 255;
newB = (qBlue(val) * bh) / 255;
}
data[ x + offset ] = qRgba( newR, newG, newB, 255 );
}
offset += backImage.width();
......
......@@ -2143,7 +2143,6 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
//if there is text selected in the page
if(page->textSelection())
{
QAction *textToClipboard = menu.addAction( KIcon( "edit-copy" ), i18n( "Copy Text" ) );
QAction *speakText = 0;
if ( Okular::Settings::useKTTSD() )
......
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