[poppler]
poppler/qt: poppler-page.cc, 1.4, 1.5 test-poppler-qt.cpp, 1.2, 1.3
Kristian Hogsberg
krh at freedesktop.org
Wed May 4 12:11:13 PDT 2005
Update of /cvs/poppler/poppler/qt
In directory gabe:/tmp/cvs-serv17408/qt
Modified Files:
poppler-page.cc test-poppler-qt.cpp
Log Message:
2005-05-04 Kristian Høgsberg <krh at redhat.com>
Patches from Albert Astals Cid:
* qt/poppler-page.cc (getText): Use QString::fromUtf8() instead of
implicit latin1 cast constructor.
* qt/test-poppler-qt.cpp (main): Use a QLabel for showing text
instead of qDebug.
Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-page.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- poppler-page.cc 20 Apr 2005 22:48:53 -0000 1.4
+++ poppler-page.cc 4 May 2005 19:11:11 -0000 1.5
@@ -98,9 +98,8 @@
s = output_dev->getText(r.m_x1, y1, r.m_x2, y2);
}
- // TODO look if QString::fromUTF8 yields better results
- result = s->getCString();
-
+ result = QString::fromUtf8(s->getCString());
+
delete output_dev;
delete s;
return result;
Index: test-poppler-qt.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt/test-poppler-qt.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test-poppler-qt.cpp 20 Apr 2005 22:48:53 -0000 1.2
+++ test-poppler-qt.cpp 4 May 2005 19:11:11 -0000 1.3
@@ -76,8 +76,12 @@
else
{
Poppler::Page *page = doc->getPage(0);
- qDebug(page->getText(Poppler::Rectangle()));
+
+ QLabel *l = new QLabel(page->getText(Poppler::Rectangle()), 0);
+ l->show();
+ a.setMainWidget(l); // set main widget
delete page;
delete doc;
+ return a.exec();
}
}
More information about the poppler
mailing list