summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/BuffDoc.cpp
authorllornkcor <llornkcor>2002-09-14 02:39:44 (UTC)
committer llornkcor <llornkcor>2002-09-14 02:39:44 (UTC)
commit2f55be65436cb05a8580f4a436f94bce9de48da7 (patch) (side-by-side diff)
tree5edbb3683681bd14f263a6b7fe259dbcffa51f22 /noncore/apps/opie-reader/BuffDoc.cpp
parent2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975 (diff)
downloadopie-2f55be65436cb05a8580f4a436f94bce9de48da7.zip
opie-2f55be65436cb05a8580f4a436f94bce9de48da7.tar.gz
opie-2f55be65436cb05a8580f4a436f94bce9de48da7.tar.bz2
opie specific resource change and messagbox caption to opiereader
Diffstat (limited to 'noncore/apps/opie-reader/BuffDoc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/BuffDoc.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/noncore/apps/opie-reader/BuffDoc.cpp b/noncore/apps/opie-reader/BuffDoc.cpp
index e37b136..d4541ea 100644
--- a/noncore/apps/opie-reader/BuffDoc.cpp
+++ b/noncore/apps/opie-reader/BuffDoc.cpp
@@ -10,14 +10,14 @@ bool BuffDoc::hyperlink(unsigned int n)
bool bRet = false;
lastword.empty();
lastsizes[0] = laststartline = n;
lastispara = false;
if (exp != NULL)
{
- bRet = exp->hyperlink(n);
- lastsizes[0] = laststartline = exp->locate();
+ bRet = exp->hyperlink(n);
+ lastsizes[0] = laststartline = exp->locate();
}
return bRet;
}
void BuffDoc::locate(unsigned int n)
{
@@ -34,15 +34,15 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
{
tchar ch = 32;
CStyle cs;
buff->empty();
if (exp == NULL)
{
-// (*buff)[0] = '\0';
- buff->empty();
- return false;
+// (*buff)[0] = '\0';
+ buff->empty();
+ return false;
}
int len = 0, lastcheck = 0;
if (lastword.length() > 0)
{
*buff = lastword;
cs = lastword.laststyle();
@@ -51,15 +51,15 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
// qDebug("Buff:%s Lastword:%s", (const char*)toQString(buff->data()), (const char*)toQString(lastword.data()));
lastcheck = len = buff->length();
unsigned int slen = buff->width(len);
if (slen > w)
{
for ( ; len > 0; len--)
- {
- if (buff->width(len) < w) break;
- }
+ {
+ if (buff->width(len) < w) break;
+ }
// lastword = buff->data() + len - 1;
laststartline = lastsizes[len-1];
lastword.setright(*buff, len - 1);
for (int i = 0; i < buff->length(); i++) lastsizes[i] = lastsizes[i+len-1];
// (*buff)[len-1] = '-';
buff->truncate(len-1);
@@ -85,26 +85,26 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
{
lastcheck = len;
allsizes[len] = exp->locate();
getch(ch, cs);
while (ch != ' ' && ch != '\012' && ch != UEOF && len < 128)
{
- len++;
- buff->addch(ch,cs);
- allsizes[len] = exp->locate();
- getch(ch, cs);
+ len++;
+ buff->addch(ch,cs);
+ allsizes[len] = exp->locate();
+ getch(ch, cs);
}
(*buff)[len] = 0;
slen = buff->width(len);
len++;
buff->addch(' ', cs);
allsizes[len] = exp->locate();
if (slen < w && ch != ' ')
{
- lastcheck = len;
- break;
+ lastcheck = len;
+ break;
}
lastispara = (ch == '\012');
}
(*buff)[len] = '\0';
// lastword = buff->data()+lastcheck;
lastword.setright(*buff, lastcheck);
@@ -127,23 +127,23 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
bool BuffDoc::getline(CDrawBuffer* buff, int w, int cw)
{
buff->empty();
if (exp == NULL)
{
- return false;
+ return false;
}
tchar ch;
CStyle cs;
int i = 0;
while (i*cw < w)
{
- getch(ch, cs);
- if (ch == '\12' || ch == UEOF) break;
- buff->addch(ch,cs);
- i++;
+ getch(ch, cs);
+ if (ch == '\12' || ch == UEOF) break;
+ buff->addch(ch,cs);
+ i++;
}
buff->truncate(i);
laststartline = exp->locate();
return (ch != UEOF);
}
@@ -161,59 +161,59 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
*/
exp = new Aportis;
int ret = exp->openfile(src);
if (ret == -1)
{
- delete exp;
- exp = NULL;
- return ret;
+ delete exp;
+ exp = NULL;
+ return ret;
}
if (ret == -2)
{
- delete exp;
- exp = new ztxt;
- ret = exp->openfile(src);
+ delete exp;
+ exp = new ztxt;
+ ret = exp->openfile(src);
}
if (ret != 0)
{
- delete exp;
- exp = new CPlucker;
- ret = exp->openfile(src);
+ delete exp;
+ exp = new CPlucker;
+ ret = exp->openfile(src);
}
#ifndef SMALL
if (ret != 0)
{
- delete exp;
- qDebug("Trying ppms");
- exp = new ppm_expander;
- ret = exp->openfile(src);
+ delete exp;
+ qDebug("Trying ppms");
+ exp = new ppm_expander;
+ ret = exp->openfile(src);
}
-
+
if (ret != 0)
{
- delete exp;
- exp = new Text;
-// qDebug("Trying text");
- ret = exp->openfile(src);
+ delete exp;
+ exp = new Text;
+// qDebug("Trying text");
+ ret = exp->openfile(src);
}
#else
if (ret != 0)
{
- delete exp;
- exp = new Text;
- ret = exp->openfile(src);
+ delete exp;
+ exp = new Text;
+ ret = exp->openfile(src);
}
#endif
if (ret != 0)
{
- delete exp;
- QMessageBox::information(_parent, "QTReader", "Unknown file compression type","Try another file");
- return ret;
+ delete exp;
+ QMessageBox::information(_parent, "OpieReader", "Unknown file compression type","Try another file");
+ return ret;
}
// qDebug("Doing final open:%x:%x",exp,filt);
lastword.empty();
lastsizes[0] = laststartline = 0;
lastispara = false;