summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-03 11:11:00 (UTC)
committer zecke <zecke>2002-11-03 11:11:00 (UTC)
commitd26f82ea57c70fd0e77eb192f7e133c5f76c2f0f (patch) (unidiff)
tree16240b40b1be5b581dc2fb7e1a0c18239c3dc4fd
parenteac6c5d3a22147d78866122c2f5b89d3fdf6bfc6 (diff)
downloadopie-d26f82ea57c70fd0e77eb192f7e133c5f76c2f0f.zip
opie-d26f82ea57c70fd0e77eb192f7e133c5f76c2f0f.tar.gz
opie-d26f82ea57c70fd0e77eb192f7e133c5f76c2f0f.tar.bz2
Gcc3 compiler fixes again
No default arguments in the implementation please
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Bkmks.cpp2
-rw-r--r--noncore/apps/opie-reader/CBuffer.cpp4
-rw-r--r--noncore/apps/opie-reader/CDrawBuffer.cpp2
-rw-r--r--noncore/apps/opie-reader/QTReader.cpp2
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp2
-rw-r--r--noncore/apps/opie-reader/infowin.cpp2
6 files changed, 7 insertions, 7 deletions
diff --git a/noncore/apps/opie-reader/Bkmks.cpp b/noncore/apps/opie-reader/Bkmks.cpp
index 0cb9ea9..30d2881 100644
--- a/noncore/apps/opie-reader/Bkmks.cpp
+++ b/noncore/apps/opie-reader/Bkmks.cpp
@@ -70,49 +70,49 @@ Bkmk& Bkmk::operator=(const Bkmk& rhs)
70} 70}
71 71
72bool Bkmk::operator==(const Bkmk& rhs) 72bool Bkmk::operator==(const Bkmk& rhs)
73{ 73{
74 return (m_position == rhs.m_position && ustrcmp(m_name,rhs.m_name) == 0); 74 return (m_position == rhs.m_position && ustrcmp(m_name,rhs.m_name) == 0);
75} 75}
76 76
77void Bkmk::setAnno(tchar* t) 77void Bkmk::setAnno(tchar* t)
78{ 78{
79 if (m_anno != NULL) 79 if (m_anno != NULL)
80 { 80 {
81 delete [] m_anno; 81 delete [] m_anno;
82 m_anno = NULL; 82 m_anno = NULL;
83 } 83 }
84 if (t != NULL) 84 if (t != NULL)
85 { 85 {
86 int len = ustrlen(t)+1; 86 int len = ustrlen(t)+1;
87 m_anno = new tchar[len]; 87 m_anno = new tchar[len];
88 for (int i = 0; i < len; i++) m_anno[i] = t[i]; 88 for (int i = 0; i < len; i++) m_anno[i] = t[i];
89 } 89 }
90 else 90 else
91 m_anno = NULL; 91 m_anno = NULL;
92} 92}
93 93
94BkmkFile::BkmkFile(const char *fnm, bool w = false) 94BkmkFile::BkmkFile(const char *fnm, bool w )
95 : 95 :
96 wt(w), isUpgraded(false) 96 wt(w), isUpgraded(false)
97{ 97{
98 if (w) 98 if (w)
99 { 99 {
100 f = fopen(fnm, "wb"); 100 f = fopen(fnm, "wb");
101 } 101 }
102 else 102 else
103 { 103 {
104 f = fopen(fnm, "rb"); 104 f = fopen(fnm, "rb");
105 } 105 }
106} 106}
107 107
108BkmkFile::~BkmkFile() 108BkmkFile::~BkmkFile()
109{ 109{
110 if (f != NULL) fclose(f); 110 if (f != NULL) fclose(f);
111} 111}
112 112
113void BkmkFile::write(tchar* nm, tchar* an, const unsigned int& pos) 113void BkmkFile::write(tchar* nm, tchar* an, const unsigned int& pos)
114{ 114{
115 if (f != NULL) 115 if (f != NULL)
116 { 116 {
117 unsigned short ln = ustrlen(nm); 117 unsigned short ln = ustrlen(nm);
118 fwrite(&ln,sizeof(ln),1,f); 118 fwrite(&ln,sizeof(ln),1,f);
diff --git a/noncore/apps/opie-reader/CBuffer.cpp b/noncore/apps/opie-reader/CBuffer.cpp
index 526b25f..0780a88 100644
--- a/noncore/apps/opie-reader/CBuffer.cpp
+++ b/noncore/apps/opie-reader/CBuffer.cpp
@@ -1,46 +1,46 @@
1#include "CBuffer.h" 1#include "CBuffer.h"
2 2
3CBufferBase& CBufferBase::assign(const void* sztmp, size_t ms) 3CBufferBase& CBufferBase::assign(const void* sztmp, size_t ms)
4{ 4{
5 if (ms*membersize > len) 5 if (ms*membersize > len)
6 { 6 {
7 delete [] buffer; 7 delete [] buffer;
8 buffer = new unsigned char[len = ms*membersize]; 8 buffer = new unsigned char[len = ms*membersize];
9 } 9 }
10 memcpy(buffer, sztmp, ms*membersize); 10 memcpy(buffer, sztmp, ms*membersize);
11 return *this; 11 return *this;
12} 12}
13 13
14CBufferBase::CBufferBase(size_t ms, size_t n = 16) : len(n), membersize(ms) 14CBufferBase::CBufferBase(size_t ms, size_t n) : len(n), membersize(ms)
15{ 15{
16 buffer = new unsigned char[len*membersize]; 16 buffer = new unsigned char[len*membersize];
17 memset(buffer, 0, len*membersize); 17 memset(buffer, 0, len*membersize);
18} 18}
19 19
20void* CBufferBase::operator[](int i) 20void* CBufferBase::operator[](int i)
21{ 21{
22 if ((i+1)*membersize > len) 22 if ((i+1)*membersize > len)
23 { 23 {
24 unsigned char* oldbuffer = buffer; 24 unsigned char* oldbuffer = buffer;
25 buffer = new unsigned char[(i+1)*membersize]; 25 buffer = new unsigned char[(i+1)*membersize];
26 memcpy(buffer, oldbuffer, len); 26 memcpy(buffer, oldbuffer, len);
27 memset(buffer+len, 0, (i+1)*membersize-len); 27 memset(buffer+len, 0, (i+1)*membersize-len);
28 len = (i+1)*membersize; 28 len = (i+1)*membersize;
29 delete [] oldbuffer; 29 delete [] oldbuffer;
30 } 30 }
31 return buffer+i*membersize; 31 return buffer+i*membersize;
32} 32}
33 33
34size_t CBufferBase::bstrlen(unsigned char* _buffer = NULL) 34size_t CBufferBase::bstrlen(unsigned char* _buffer)
35{ 35{
36 if (_buffer == NULL) _buffer = buffer; 36 if (_buffer == NULL) _buffer = buffer;
37 unsigned char* zero = new unsigned char[membersize]; 37 unsigned char* zero = new unsigned char[membersize];
38 memset(zero,0,membersize); 38 memset(zero,0,membersize);
39 unsigned char* element = _buffer; 39 unsigned char* element = _buffer;
40 while (memcmp(element, zero, membersize) != 0) 40 while (memcmp(element, zero, membersize) != 0)
41 { 41 {
42 element += membersize; 42 element += membersize;
43 } 43 }
44 delete [] zero; 44 delete [] zero;
45 return (element - _buffer)/membersize; 45 return (element - _buffer)/membersize;
46} 46}
diff --git a/noncore/apps/opie-reader/CDrawBuffer.cpp b/noncore/apps/opie-reader/CDrawBuffer.cpp
index 2ceb2d5..892456f 100644
--- a/noncore/apps/opie-reader/CDrawBuffer.cpp
+++ b/noncore/apps/opie-reader/CDrawBuffer.cpp
@@ -84,49 +84,49 @@ void CDrawBuffer::addch(tchar ch, CStyle _style/* = ucFontBase*/)
84 segs.first().start = 0; 84 segs.first().start = 0;
85 segs.first().style = _style; 85 segs.first().style = _style;
86 } 86 }
87 else if (_style != segs.last().style) 87 else if (_style != segs.last().style)
88 { 88 {
89 int thissize = fc->getsize(_style); 89 int thissize = fc->getsize(_style);
90 if (thissize > m_maxstyle) 90 if (thissize > m_maxstyle)
91 { 91 {
92 m_maxstyle = thissize; 92 m_maxstyle = thissize;
93 m_ascent = fc->ascent(_style); 93 m_ascent = fc->ascent(_style);
94 m_descent = fc->descent(_style); 94 m_descent = fc->descent(_style);
95 m_lineSpacing = fc->lineSpacing(_style); 95 m_lineSpacing = fc->lineSpacing(_style);
96 } 96 }
97 segs.push_back(textsegment(len, _style)); 97 segs.push_back(textsegment(len, _style));
98 } 98 }
99 (*this)[len++] = ch; 99 (*this)[len++] = ch;
100} 100}
101 101
102void CDrawBuffer::truncate(int n) 102void CDrawBuffer::truncate(int n)
103{ 103{
104 len = n; 104 len = n;
105 (*this)[n] = 0; 105 (*this)[n] = 0;
106} 106}
107 107
108int CDrawBuffer::width(int numchars = -1) 108int CDrawBuffer::width(int numchars)
109{ 109{
110 int currentx = 0, end = 0; 110 int currentx = 0, end = 0;
111 QString text = toQString(data()); 111 QString text = toQString(data());
112 CList<textsegment>::iterator textstart = segs.begin(); 112 CList<textsegment>::iterator textstart = segs.begin();
113 CList<textsegment>::iterator textend = textstart; 113 CList<textsegment>::iterator textend = textstart;
114 do 114 do
115 { 115 {
116 textend++; 116 textend++;
117 end = (textend != segs.end()) ? textend->start : length(); 117 end = (textend != segs.end()) ? textend->start : length();
118 if (numchars >= 0 && end > numchars) 118 if (numchars >= 0 && end > numchars)
119 { 119 {
120 end = numchars; 120 end = numchars;
121 } 121 }
122 CStyle currentstyle = textstart->style; 122 CStyle currentstyle = textstart->style;
123 QFont f(fc->name(), fc->getsize(currentstyle), (currentstyle.isBold()) ? QFont::Bold : QFont::Normal, (currentstyle.isItalic()) ); 123 QFont f(fc->name(), fc->getsize(currentstyle), (currentstyle.isBold()) ? QFont::Bold : QFont::Normal, (currentstyle.isItalic()) );
124 QString str = text.mid(textstart->start, end-textstart->start); 124 QString str = text.mid(textstart->start, end-textstart->start);
125 QFontMetrics fm(f); 125 QFontMetrics fm(f);
126 currentx += fm.width(str); 126 currentx += fm.width(str);
127 textstart = textend; 127 textstart = textend;
128 } 128 }
129 while (textend != segs.end() && end != numchars); 129 while (textend != segs.end() && end != numchars);
130 return currentx; 130 return currentx;
131} 131}
132 132
diff --git a/noncore/apps/opie-reader/QTReader.cpp b/noncore/apps/opie-reader/QTReader.cpp
index e7bfc28..7cf08e5 100644
--- a/noncore/apps/opie-reader/QTReader.cpp
+++ b/noncore/apps/opie-reader/QTReader.cpp
@@ -14,49 +14,49 @@
14#include "QTReaderApp.h" 14#include "QTReaderApp.h"
15#include "CDrawBuffer.h" 15#include "CDrawBuffer.h"
16#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
17#include <math.h> 17#include <math.h>
18#include <ctype.h> 18#include <ctype.h>
19#include <stdio.h> //for sprintf 19#include <stdio.h> //for sprintf
20#include <qpe/config.h> 20#include <qpe/config.h>
21#include <qpe/applnk.h> 21#include <qpe/applnk.h>
22#include <qfontdatabase.h> 22#include <qfontdatabase.h>
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
25 25
26#ifdef _UNICODE 26#ifdef _UNICODE
27const char *QTReader::fonts[] = { "unifont", "Courier", "Times", 0 }; 27const char *QTReader::fonts[] = { "unifont", "Courier", "Times", 0 };
28#else 28#else
29const char *QTReader::fonts[] = { "Helvetica", "Courier", "Times", 0 }; 29const char *QTReader::fonts[] = { "Helvetica", "Courier", "Times", 0 };
30#endif 30#endif
31//const int QTReader::fontsizes[] = { 8, 10, 12, 14, 18, 24, 30, 40, 50, 60, 70, 80, 90, 100, 0 }; 31//const int QTReader::fontsizes[] = { 8, 10, 12, 14, 18, 24, 30, 40, 50, 60, 70, 80, 90, 100, 0 };
32 32
33//const tchar *QTReader::fonts[] = { "unifont", "fixed", "micro", "smoothtimes", "Courier", "Times", 0 }; 33//const tchar *QTReader::fonts[] = { "unifont", "fixed", "micro", "smoothtimes", "Courier", "Times", 0 };
34//const int QTReader::fontsizes[] = {10,16,17,22,0}; 34//const int QTReader::fontsizes[] = {10,16,17,22,0};
35//const tchar *QTReader::fonts[] = { "verdana", "Courier", "Times", 0 }; 35//const tchar *QTReader::fonts[] = { "verdana", "Courier", "Times", 0 };
36//const int QTReader::fontsizes[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,0}; 36//const int QTReader::fontsizes[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,0};
37 37
38QTReader::QTReader( QWidget *parent=0, const char *name=0, WFlags f = 0) : 38QTReader::QTReader( QWidget *parent, const char *name, WFlags f) :
39 QWidget(parent, name, f), 39 QWidget(parent, name, f),
40 m_delay(100), 40 m_delay(100),
41 m_scrolldy1(0), 41 m_scrolldy1(0),
42 m_scrolldy2(0), 42 m_scrolldy2(0),
43 m_autoScroll(false), 43 m_autoScroll(false),
44 //textarray(NULL), 44 //textarray(NULL),
45 //locnarray(NULL), 45 //locnarray(NULL),
46 numlines(0), 46 numlines(0),
47 m_fontname("unifont"), 47 m_fontname("unifont"),
48 m_fm(NULL), 48 m_fm(NULL),
49 mouseUpOn(true), 49 mouseUpOn(true),
50 m_twotouch(true), 50 m_twotouch(true),
51 m_touchone(true) 51 m_touchone(true)
52{ 52{
53 m_overlap = 1; 53 m_overlap = 1;
54// init(); 54// init();
55} 55}
56/* 56/*
57QTReader::QTReader( const QString& filename, QWidget *parent=0, const tchar *name=0, WFlags f = 0) : 57QTReader::QTReader( const QString& filename, QWidget *parent=0, const tchar *name=0, WFlags f = 0) :
58 QWidget(parent, name, f), 58 QWidget(parent, name, f),
59 m_textfont(0), 59 m_textfont(0),
60 m_textsize(1), 60 m_textsize(1),
61 textarray(NULL), 61 textarray(NULL),
62 numlines(0), 62 numlines(0),
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index ef1f4f1..8726df7 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -1688,49 +1688,49 @@ void QTReaderApp::do_settarget(const QString& _txt)
1688 m_targetmsg = ""; 1688 m_targetmsg = "";
1689 QMessageBox::information(this, "OpieReader", "Format is\nappname/messagename"); 1689 QMessageBox::information(this, "OpieReader", "Format is\nappname/messagename");
1690 } 1690 }
1691 else 1691 else
1692 { 1692 {
1693 m_targetapp = _txt.left(ind); 1693 m_targetapp = _txt.left(ind);
1694 m_targetmsg = _txt.right(_txt.length()-ind-1); 1694 m_targetmsg = _txt.right(_txt.length()-ind-1);
1695 } 1695 }
1696} 1696}
1697 1697
1698void QTReaderApp::setfont() 1698void QTReaderApp::setfont()
1699{ 1699{
1700 for (int i = 1; i <= m_fontSelector->count(); i++) 1700 for (int i = 1; i <= m_fontSelector->count(); i++)
1701 { 1701 {
1702 if (m_fontSelector->text(i) == reader->m_fontname) 1702 if (m_fontSelector->text(i) == reader->m_fontname)
1703 { 1703 {
1704 m_fontSelector->setCurrentItem(i); 1704 m_fontSelector->setCurrentItem(i);
1705 break; 1705 break;
1706 } 1706 }
1707 } 1707 }
1708 m_fontBar->show(); 1708 m_fontBar->show();
1709 m_fontVisible = true; 1709 m_fontVisible = true;
1710} 1710}
1711 1711
1712void QTReaderApp::setfontHelper(const QString& lcn, int size = 0) 1712void QTReaderApp::setfontHelper(const QString& lcn, int size)
1713{ 1713{
1714 if (size == 0) size = reader->m_fontControl.currentsize(); 1714 if (size == 0) size = reader->m_fontControl.currentsize();
1715 QFont f(lcn, 10 /*, QFont::Bold*/); 1715 QFont f(lcn, 10 /*, QFont::Bold*/);
1716 bkmkselector->setFont( f ); 1716 bkmkselector->setFont( f );
1717 regEdit->setFont( f ); 1717 regEdit->setFont( f );
1718 searchEdit->setFont( f ); 1718 searchEdit->setFont( f );
1719 m_annoWin->setFont( f ); 1719 m_annoWin->setFont( f );
1720 reader->m_fontname = lcn; 1720 reader->m_fontname = lcn;
1721 if (!reader->ChangeFont(size)) 1721 if (!reader->ChangeFont(size))
1722 { 1722 {
1723 reader->ChangeFont(size); 1723 reader->ChangeFont(size);
1724 } 1724 }
1725 reader->refresh(); 1725 reader->refresh();
1726 m_fontBar->hide(); 1726 m_fontBar->hide();
1727 m_fontVisible = false; 1727 m_fontVisible = false;
1728 showEditTools(); 1728 showEditTools();
1729} 1729}
1730 1730
1731void QTReaderApp::do_setfont(const QString& lcn) 1731void QTReaderApp::do_setfont(const QString& lcn)
1732{ 1732{
1733 setfontHelper(lcn); 1733 setfontHelper(lcn);
1734} 1734}
1735 1735
1736void QTReaderApp::do_autogen(const QString& regText) 1736void QTReaderApp::do_autogen(const QString& regText)
diff --git a/noncore/apps/opie-reader/infowin.cpp b/noncore/apps/opie-reader/infowin.cpp
index 9637a62..7b8f280 100644
--- a/noncore/apps/opie-reader/infowin.cpp
+++ b/noncore/apps/opie-reader/infowin.cpp
@@ -1,29 +1,29 @@
1#include "infowin.h" 1#include "infowin.h"
2#include "version.h" 2#include "version.h"
3#include <stdio.h> 3#include <stdio.h>
4 4
5infowin::infowin( QWidget *parent=0, const char *name=0, WFlags f = 0) : 5infowin::infowin( QWidget *parent, const char *name, WFlags f) :
6 QWidget(parent, name, f) 6 QWidget(parent, name, f)
7{ 7{
8 grid = new QGridLayout(this, 6, 2); 8 grid = new QGridLayout(this, 6, 2);
9 QLabel* l; 9 QLabel* l;
10 l = new QLabel("Compressed file size", this); 10 l = new QLabel("Compressed file size", this);
11 grid->addWidget(l, 0, 0); 11 grid->addWidget(l, 0, 0);
12 fileSize = new QLabel("0", this); 12 fileSize = new QLabel("0", this);
13 fileSize->setAlignment( AlignVCenter | AlignRight ); 13 fileSize->setAlignment( AlignVCenter | AlignRight );
14 grid->addWidget(fileSize, 0, 1); 14 grid->addWidget(fileSize, 0, 1);
15 l = new QLabel("Original text size", this); 15 l = new QLabel("Original text size", this);
16 grid->addWidget(l, 1, 0); 16 grid->addWidget(l, 1, 0);
17 textSize = new QLabel("0", this); 17 textSize = new QLabel("0", this);
18 textSize->setAlignment( AlignVCenter | AlignRight ); 18 textSize->setAlignment( AlignVCenter | AlignRight );
19 grid->addWidget(textSize, 1, 1); 19 grid->addWidget(textSize, 1, 1);
20 l = new QLabel("Compression Ratio", this); 20 l = new QLabel("Compression Ratio", this);
21 grid->addWidget(l, 2, 0); 21 grid->addWidget(l, 2, 0);
22 ratio = new QLabel("0", this); 22 ratio = new QLabel("0", this);
23 grid->addWidget(ratio, 2, 1); 23 grid->addWidget(ratio, 2, 1);
24 ratio->setAlignment( AlignVCenter | AlignRight ); 24 ratio->setAlignment( AlignVCenter | AlignRight );
25 l = new QLabel("Current location", this); 25 l = new QLabel("Current location", this);
26 grid->addWidget(l, 3, 0); 26 grid->addWidget(l, 3, 0);
27 location = new QLabel("0", this); 27 location = new QLabel("0", this);
28 location->setAlignment( AlignVCenter | AlignRight ); 28 location->setAlignment( AlignVCenter | AlignRight );
29 grid->addWidget(location, 3, 1); 29 grid->addWidget(location, 3, 1);