* demo/viewer/main.cc: Add more includes.
* demo/viewer/viewer.cc: Add debug output.
---
scribo/ChangeLog | 8 ++++++++
scribo/demo/viewer/main.cc | 5 ++++-
scribo/demo/viewer/viewer.cc | 8 +++++++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 9e63c2a..358201c 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,11 @@
+2011-03-11 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Small fixes in viewer.
+
+ * demo/viewer/main.cc: Add more includes.
+
+ * demo/viewer/viewer.cc: Add debug output.
+
2011-03-04 Guillaume Lazzara <z(a)lrde.epita.fr>
* scribo/io/xml/internal/extended_page_xml_visitor.hh: Save
diff --git a/scribo/demo/viewer/main.cc b/scribo/demo/viewer/main.cc
index 6d1cb18..069d5e9 100644
--- a/scribo/demo/viewer/main.cc
+++ b/scribo/demo/viewer/main.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -23,6 +24,8 @@
#include <mln/math/pi.hh>
#include <mln/io/magick/load.hh>
#include <scribo/make/debug_filename.hh>
+#include <mln/debug/filename.hh>
+#include <mln/literal/white.hh>
int main(int argc, char** argv)
{
diff --git a/scribo/demo/viewer/viewer.cc b/scribo/demo/viewer/viewer.cc
index f34b3e7..173cb3b 100644
--- a/scribo/demo/viewer/viewer.cc
+++ b/scribo/demo/viewer/viewer.cc
@@ -372,7 +372,10 @@ Viewer::add_text(QDomNode line)
coords = coords.nextSibling();
if (coords.isNull())
+ {
+ qDebug() << "Warning : textline without coordinates...";
return;
+ }
QDomNode point = coords.firstChild();
@@ -393,7 +396,7 @@ Viewer::add_text(QDomNode line)
point = point.nextSibling();
}
- QString text = line.toElement().attribute("text", "none");
+ QString text = line.toElement().attribute("text", "");
QFont font("Times");
font.setPixelSize(a_height + d_height);
QGraphicsTextItem* text_item = scene_->addText(text, font);
@@ -417,7 +420,10 @@ Viewer::add_region(QDomNode father, QString attr_id)
coords = coords.nextSibling();
if (coords.isNull())
+ {
+ qDebug() << "Warning : add_region - region without coordinates";
return;
+ }
QDomNode point = coords.firstChild();
QVector<QPoint> points;
--
1.5.6.5