summaryrefslogtreecommitdiff
path: root/noncore/apps
Side-by-side diff
Diffstat (limited to 'noncore/apps') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/listedit.cpp2
-rw-r--r--noncore/apps/opie-console/TEScreen.cpp4
-rw-r--r--noncore/apps/opie-sheet/Excel.cpp2
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.cpp4
4 files changed, 6 insertions, 6 deletions
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp
index e40377b..b297d69 100644
--- a/noncore/apps/checkbook/listedit.cpp
+++ b/noncore/apps/checkbook/listedit.cpp
@@ -215,49 +215,49 @@ void ListEdit::fixTypes(int iColumn)
uint iChk=iNext+1;
while( iChk<lst.count() ) {
QString *chk=lst.at(iChk);
if( !chk->startsWith(*current) ) break;
if( *chk==repl ) {
bDup=true;
break;
}
iChk++;
}
if( !bDup ) {
*lst.at(iNext)=repl;
break;
}
}
}
}
lst.sort();
// copy back clean up col map
for(int i=0; i<_typeTable->childCount(); i++) {
colMap[i]->getItem()->setText(iColumn, colMap[i]->getValue());
delete colMap[i];
}
- delete colMap;
+ delete [] colMap;
}
void ListEdit::fixTypes()
{
int i;
ColumnDef *pDef;
for(pDef=this->first(), i=0; pDef; pDef=this->next(), i++) {
if( pDef->hasFlag(ColumnDef::typeUnique) )
fixTypes(i);
}
_typeTable->sort();
}
// --- storeInList ------------------------------------------------------------
void ListEdit::storeInList(QStringList &lst)
{
// delete old content
lst.clear();
// add new one
fixTypes();
QListViewItem *itm=_typeTable->firstChild();
while( itm ) {
diff --git a/noncore/apps/opie-console/TEScreen.cpp b/noncore/apps/opie-console/TEScreen.cpp
index 2675d31..8e91532 100644
--- a/noncore/apps/opie-console/TEScreen.cpp
+++ b/noncore/apps/opie-console/TEScreen.cpp
@@ -1094,50 +1094,50 @@ QString TEScreen::getSelText(const BOOL preserve_line_breaks)
m[d++] = ' ';
}
}
else
{
m[d++] = ((preserve_line_breaks ||
((eol % columns) == 0)) ?
'\n' : ' ');
}
}
s = (eol / columns + 1) * columns;
}
}
QChar* qc = new QChar[d];
for (int i = 0; i < d; i++)
{
qc[i] = m[i];
}
QString res(qc, d);
- delete m;
- delete qc;
+ delete [] m;
+ delete [] qc;
return res;
}
QString TEScreen::getHistory() {
sel_begin = 0;
sel_BR = sel_begin;
sel_TL = sel_begin;
setSelExtentXY(columns-1,lines-1);
QString tmp=getSelText(true);
while (tmp.at(tmp.length()-2).unicode()==10 && tmp.at(tmp.length()-1).unicode()==10)
tmp.truncate(tmp.length()-1);
return tmp;
}
/* above ... end of line processing for selection -- psilva
cases:
1) (eol+1)%columns == 0 --> the whole line is filled.
If the last char is a space, insert (preserve) space. otherwise
leave the text alone, so that words that are broken by linewrap
are preserved.
FIXME:
* this suppresses \n for command output that is
diff --git a/noncore/apps/opie-sheet/Excel.cpp b/noncore/apps/opie-sheet/Excel.cpp
index 338bc30..51fe707 100644
--- a/noncore/apps/opie-sheet/Excel.cpp
+++ b/noncore/apps/opie-sheet/Excel.cpp
@@ -317,49 +317,49 @@ QString ExcelBook::ReadUnicodeChar(int pos, int length)
QString* ExcelBook::GetString(int num)
{
if(num>=0 && num<(int)SharedStrings.count())
{
return SharedStrings[num];
};
return new QString("");
};
int ExcelBook::SeekBOF(void)
{
int opcode,version,streamtype,length,ret=0;
char *data;
while(!feof(File))
{
opcode=Get2Bytes();
if(opcode==XL_BOF)
{
length=Get2Bytes();
data=Read(Position,length);
version=Integer2Byte(data[0], data[1]);
streamtype=Integer2Byte(data[2], data[3]);
printf("SEEKBOF:opcode=XLBOF, %d ,version %d\r\n",Position,version);
- delete data; data=NULL;
+ delete [] data; data=NULL;
if (version==BIFF8) ret=8;
else if(version==BIFF7) ret=7;
printf("SEEKBOF:versionBIFF%d\r\n",ret);
if(streamtype==WBKGLOBAL) return ret *2;
else if(streamtype==WRKSHEET) return ret *1;
return 1;
};
};
return 0;
};
ExcelBREC* ExcelBook::GetBREC(void)
{
ExcelBREC* rec;
rec= new ExcelBREC;
if(FileEOF()) return NULL;
rec->data=NULL;
rec->code=Get2Bytes();
rec->length=Get2Bytes();
rec->position=Position;
SeekSkip(rec->length);
return rec;
};
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.cpp b/noncore/apps/tinykate/libkate/document/katedocument.cpp
index 6dc4fd2..a70f3aa 100644
--- a/noncore/apps/tinykate/libkate/document/katedocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katedocument.cpp
@@ -2198,49 +2198,49 @@ bool KateDocument::doSearch(SConfig &sc, const QString &searchFor) {
TextLine::Ptr textLine;
int pos, newPos;
if (searchFor.isEmpty()) return false;
bufLen = 0;
t = 0L;
line = sc.cursor.y;
col = sc.cursor.x;
if (!(sc.flags & KateView::sfBackward)) {
//forward search
if (sc.flags & KateView::sfSelected) {
if (line < selectStart) {
line = selectStart;
col = 0;
}
searchEnd = selectEnd;
} else searchEnd = lastLine();
while (line <= searchEnd) {
textLine = getTextLine(line);
tlen = textLine->length();
if (tlen > bufLen) {
- delete t;
+ delete [] t;
bufLen = (tlen + 255) & (~255);
t = new QChar[bufLen];
}
memcpy(t, textLine->getText(), tlen*sizeof(QChar));
if (sc.flags & KateView::sfSelected) {
pos = 0;
do {
pos = textLine->findSelected(pos);
newPos = textLine->findUnselected(pos);
memset(&t[pos], 0, (newPos - pos)*sizeof(QChar));
pos = newPos;
} while (pos < tlen);
}
QString text(t, tlen);
if (sc.flags & KateView::sfWholeWords) {
// Until the end of the line...
while (col < tlen) {
// ...find the next match.
col = sc.search(text, col);
if (col != -1) {
// Is the match delimited correctly?
if (((col == 0) || (!m_highlight->isInWord(t[col]))) &&
((col + sc.matchedLength == tlen) || (!m_highlight->isInWord(t[col + sc.matchedLength])))) {
@@ -2259,49 +2259,49 @@ bool KateDocument::doSearch(SConfig &sc, const QString &searchFor) {
}
else {
// Non-whole-word search.
col = sc.search(text, col);
if (col != -1)
goto found;
}
col = 0;
line++;
}
} else {
// backward search
if (sc.flags & KateView::sfSelected) {
if (line > selectEnd) {
line = selectEnd;
col = -1;
}
searchEnd = selectStart;
} else searchEnd = 0;
while (line >= searchEnd) {
textLine = getTextLine(line);
tlen = textLine->length();
if (tlen > bufLen) {
- delete t;
+ delete [] t;
bufLen = (tlen + 255) & (~255);
t = new QChar[bufLen];
}
memcpy(t, textLine->getText(), tlen*sizeof(QChar));
if (sc.flags & KateView::sfSelected) {
pos = 0;
do {
pos = textLine->findSelected(pos);
newPos = textLine->findUnselected(pos);
memset(&t[pos], 0, (newPos - pos)*sizeof(QChar));
pos = newPos;
} while (pos < tlen);
}
if (col < 0 || col > tlen) col = tlen;
QString text(t, tlen);
if (sc.flags & KateView::sfWholeWords) {
// Until the beginning of the line...
while (col >= 0) {
// ...find the next match.
col = sc.search(text, col);
if (col != -1) {
// Is the match delimited correctly?