summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/BuffDoc.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/BuffDoc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/BuffDoc.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/apps/opie-reader/BuffDoc.cpp b/noncore/apps/opie-reader/BuffDoc.cpp
index 4fbab93..68391b8 100644
--- a/noncore/apps/opie-reader/BuffDoc.cpp
+++ b/noncore/apps/opie-reader/BuffDoc.cpp
@@ -11,59 +11,59 @@
linkType BuffDoc::hyperlink(unsigned int n, QString& wrd)
{
linkType bRet = eNone;
if (exp != NULL)
{
bRet = exp->hyperlink(n, wrd);
if (bRet == eLink)
{
lastword.empty();
lastsizes[0] = laststartline = n;
#ifdef NEWLINEBREAK
lastispara = true;
#else
lastispara = false;
#endif
lastsizes[0] = laststartline = exp->locate();
}
}
return bRet;
}
void BuffDoc::locate(unsigned int n)
{
- // //qDebug("BuffDoc:locating:%u",n);
+ // //odebug << "BuffDoc:locating:" << n << "" << oendl;
lastword.empty();
lastsizes[0] = laststartline = n;
#ifdef NEWLINEBREAK
lastispara = true;
#else
lastispara = false;
#endif
// tchar linebuf[1024];
if (exp != NULL) exp->locate(n);
- // //qDebug("BuffDoc:Located");
+ // //odebug << "BuffDoc:Located" << oendl;
}
#ifdef NEWLINEBREAK
bool BuffDoc::getline(CDrawBuffer* buff, int wth, unsigned char _border)
{
bool moreleft = true;
bool margindone = false;
int w = wth-2*_border;
tchar ch = 32;
CStyle cs;
buff->empty();
if (exp == NULL)
{
buff->empty();
buff->setEof();
return false;
}
int len = 0;
if (lastword.length() > 0)
{
*buff = lastword;
cs = lastword.laststyle();
w -= buff->leftMargin() + buff->rightMargin();
margindone = true;
@@ -167,49 +167,49 @@ bool BuffDoc::getline(CDrawBuffer* buff, int wth, unsigned char _border)
}
#else
bool BuffDoc::getline(CDrawBuffer* buff, int wth, unsigned char _border)
{
bool margindone = false;
int w = wth-2*_border;
tchar ch = 32;
CStyle cs;
buff->empty();
if (exp == NULL)
{
// (*buff)[0] = '\0';
buff->empty();
return false;
}
int len = 0, lastcheck = 0;
if (lastword.length() > 0)
{
*buff = lastword;
cs = lastword.laststyle();
w -= buff->leftMargin() + buff->rightMargin();
margindone = true;
}
else buff->empty();
-// //qDebug("Buff:%s Lastword:%s", (const char*)toQString(buff->data()), (const char*)toQString(lastword.data()));
+// //odebug << "Buff:" << toQString(buff->data()) << " Lastword:" << toQString(lastword.data()) << "" << oendl;
lastcheck = len = buff->length();
unsigned int slen = buff->width(len);
if (slen > w)
{
for ( ; len > 1; len--)
{
if (buff->width(len) < w) break;
}
// lastword = buff->data() + len - 1;
laststartline = lastsizes[len-1];
for (int i = 0; i < buff->length(); i++) lastsizes[i] = lastsizes[i+len-1];
// (*buff)[len-1] = '-';
if (len > 2)
{
lastword.setright(*buff, len - 1);
buff->truncate(len-1);
buff->addch('-', cs);
(*buff)[len] = '\0';
}
else
{
lastword.empty();
(*buff)[len] = '\0';
@@ -301,50 +301,50 @@ bool BuffDoc::getline(CDrawBuffer* buff, int wth, int cw, unsigned char _border)
int w = wth-2*_border;
buff->empty();
if (exp == NULL)
{
return false;
}
tchar ch;
CStyle cs;
int i = 1;
while (i*cw < w-buff->offset(w,0))
{
getch(ch, cs);
if (ch == '\12' || ch == UEOF) break;
buff->addch(ch,cs);
i++;
}
buff->truncate(i);
laststartline = exp->locate();
buff->resize();
return (ch != UEOF);
}
int BuffDoc::openfile(QWidget* _parent, const char *src)
{
- // //qDebug("BuffDoc:Openfile:%s", src);
- // //qDebug("Trying aportis %x",exp);
+ // //odebug << "BuffDoc:Openfile:" << src << "" << oendl;
+ // //odebug << "Trying aportis " << exp << "" << oendl;
if (exp != NULL) delete exp;
lastword.empty();
lastsizes[0] = laststartline = 0;
#ifdef NEWLINEBREAK
lastispara = true;
#else
lastispara = false;
#endif
/*
exp = new Text;
int ret = exp->openfile(src);
*/
exp = new Aportis;
int ret = exp->openfile(src);
if (ret == -1)
{
delete exp;
exp = NULL;
return ret;
}
if (ret == -2)
{
@@ -357,56 +357,56 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
{
delete exp;
exp = new CArriere;
ret = exp->openfile(src);
}
if (ret != 0)
{
delete exp;
exp = new CNEF;
ret = exp->openfile(src);
}
#endif
if (ret != 0)
{
delete exp;
exp = new CPlucker;
ret = exp->openfile(src);
}
if (ret != 0)
{
delete exp;
- //qDebug("Trying ppms");
+ //odebug << "Trying ppms" << oendl;
exp = new ppm_expander;
ret = exp->openfile(src);
}
if (ret != 0)
{
delete exp;
exp = new Text;
-// //qDebug("Trying text");
+// //odebug << "Trying text" << oendl;
ret = exp->openfile(src);
}
if (ret != 0)
{
delete exp;
QMessageBox::information(_parent, PROGNAME, "Unknown file compression type","Try another file");
return ret;
}
- // //qDebug("Doing final open:%x:%x",exp,filt);
+ // //odebug << "Doing final open:" << exp << ":" << filt << "" << oendl;
lastword.empty();
lastsizes[0] = laststartline = 0;
#ifdef NEWLINEBREAK
lastispara = true;
#else
lastispara = false;
#endif
exp->locate(0);
filt->setsource(exp);
- // //qDebug("BuffDoc:file opened");
+ // //odebug << "BuffDoc:file opened" << oendl;
return 0;
}