[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bokular/selection=5Fand=5Fhighlighting=5D_core=3A_Th?=
From:       Mohammad Mahfuzur Rahman Mamun <mamun.nightcrawler () gmail ! com>
Date:       2011-07-11 12:21:47
Message-ID: 20110711122147.E5928A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit b28824332486b88c660e73b8155082c95564aad8 by Mohammad Mahfuzur Rahman \
Mamun. Committed on 11/07/2011 at 14:21.
Pushed by mamun into branch 'selection_and_highlighting'.

This version is not crashing in my pc ... just checked with first 5 pages of \
http://www.icir.org/floyd/papers/early.twocolumn.pdf

M  +13   -9    core/textpage.cpp     

http://commits.kde.org/okular/b28824332486b88c660e73b8155082c95564aad8

diff --git a/core/textpage.cpp b/core/textpage.cpp
index 4fed897..8a4a4b5 100644
--- a/core/textpage.cpp
+++ b/core/textpage.cpp
@@ -413,6 +413,8 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
     else start_end = NormalizedRect(startC.x, endC.y, endC.x, startC.y);
 
     if(!boundingRect.intersects(start_end)) return ret;
+
+
     //case 1(b) ......................................
     else{
         if(startC.x * scaleX < minX) startC.x = minX/scaleX;
@@ -501,7 +503,9 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
 
     //QString str(' ');
     // Assume that, texts are keep in TextList in the right order
-    for( ;start <= end ; ++start){
+//    cout << "Trying to trace crash " << endl;
+//    cout << " end - start " << end - start << endl;
+    for( ;start != end ; ++start){
         ret->appendShape( (*start)->transformedArea( matrix ), side );
 
 //        if((*start)->text() == str){
@@ -512,6 +516,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
 //                    << " Left: " << rect.left() << " Right: " << rect.right() << \
endl;  //            }
         }
+//    cout << "Never Reached " << endl;
 
 #endif
 
@@ -1687,8 +1692,6 @@ void TextPage::XYCutForBoundingBoxes(int tcx,int tcy){
             tmp.append(ent);
         }
 
-        cout << endl << endl;
-
     }
 
 //    cout << "length: " << tmp.length() << endl;
@@ -1702,13 +1705,14 @@ void TextPage::XYCutForBoundingBoxes(int tcx,int tcy){
 
     d->copy(tmp);
 
-//    cout << "length: " << d->m_words.length() << endl;
+    cout << "tree length: " << tree.length() << endl;
+    cout << "length: " << d->m_words.length() << endl;
 
-//    for( i = 0 ; i < d->m_words.length() ; i++){
-//        TinyTextEntity *ent = d->m_words.at(i);
-//        cout << ent->text().toAscii().data();
-//    }
-//    cout << endl;
+    for( i = 0 ; i < d->m_words.length() ; i++){
+        TinyTextEntity *ent = d->m_words.at(i);
+        cout << ent->text().toAscii().data();
+    }
+    cout << endl;
 
 
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic