summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/BuffDoc.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/BuffDoc.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/BuffDoc.cpp55
1 files changed, 53 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/BuffDoc.cpp b/noncore/apps/opie-reader/BuffDoc.cpp
index 1f0a524..355d14d 100644
--- a/noncore/apps/opie-reader/BuffDoc.cpp
+++ b/noncore/apps/opie-reader/BuffDoc.cpp
@@ -5,3 +5,2 @@
5 5
6#include "usenef.h"
7#include "BuffDoc.h" 6#include "BuffDoc.h"
@@ -23,2 +22,3 @@
23#include "iSilo.h" 22#include "iSilo.h"
23#include "Reb.h"
24#endif 24#endif
@@ -62,2 +62,14 @@ void BuffDoc::locate(unsigned int n)
62 62
63void BuffDoc::resetPos()
64{
65 // //qDebug("BuffDoc:locating:%u",n);
66 lastword.empty();
67 lastsizes[0] = laststartline = exp->locate();
68#ifdef NEWLINEBREAK
69 lastispara = false;
70#else
71 lastispara = false;
72#endif
73}
74
63static bool isletter(unsigned short c) 75static bool isletter(unsigned short c)
@@ -637,2 +649,9 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
637 //qDebug("Trying ppms"); 649 //qDebug("Trying ppms");
650 exp = new CReb;
651 ret = exp->openfile(src);
652 }
653 if (ret != 0)
654 {
655 delete exp;
656 //qDebug("Trying ppms");
638 exp = new ppm_expander; 657 exp = new ppm_expander;
@@ -657,3 +676,13 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
657#else 676#else
658 QString codecpath(QTReaderUtil::getPluginPath()); 677#ifdef USEQPE
678#ifdef OPIE
679 QString codecpath(getenv("OPIEDIR"));
680#else
681 QString codecpath(getenv("QTDIR"));
682#endif
683 codecpath += "/plugins/reader/codecs";
684#else
685 QString codecpath(getenv("READERDIR"));
686 codecpath += "/codecs";
687#endif
659 QDir d(codecpath, "*.so"); 688 QDir d(codecpath, "*.so");
@@ -708 +737,23 @@ QString BuffDoc::about()
708} 737}
738
739int BuffDoc::getsentence(CBuffer& buff)
740{
741 tchar ch;
742 int i = 0;
743 bool intext = false;
744 while ((ch = getch()) != 10 && ch != UEOF)
745 {
746 buff[i++] = ch;
747 if (ch == '"' || ch == '\'' || ch == 0x2018 || ch == 0x2019 ||
748 ch == 0x201a || ch == 0x201b || ch == 0x201c || ch == 0x201d)
749 {
750 intext = !intext;
751 }
752 if (!intext && (ch == '.' || ch == '!' || ch == '?')) break;
753 }
754
755 buff[i] = '\0';
756 if (i == 0 && ch == UEOF) i = -1;
757 laststartline = exp->locate();
758 return i;
759}