summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate
authorerik <erik>2007-01-29 21:53:48 (UTC)
committer erik <erik>2007-01-29 21:53:48 (UTC)
commit02ef45be75a3024df11365956e1cce6392d9103c (patch) (unidiff)
tree42fd5c909d67a473f57a607e01d32e01b3dd2511 /noncore/apps/tinykate
parentb2c306a99b8dc82c981390f02db859149fac8cf0 (diff)
downloadopie-02ef45be75a3024df11365956e1cce6392d9103c.zip
opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.gz
opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.bz2
Each file in this commit has an issue where the initial value of a variable
is assumed to be something but no initial value is given. This commit changes that by either assigning an initial value or removing the assumption on an initial value (usually the former).
Diffstat (limited to 'noncore/apps/tinykate') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katehighlight.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.cpp b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
index 89024f7..ee6030f 100644
--- a/noncore/apps/tinykate/libkate/document/katehighlight.cpp
+++ b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
@@ -1313,13 +1313,13 @@ int HlManager::wildcardFind(const QString &fileName) {
1313 return -1; 1313 return -1;
1314} 1314}
1315 1315
1316 1316
1317int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) { 1317int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) {
1318 ItemStyleList defaultStyleList; 1318 ItemStyleList defaultStyleList;
1319 ItemStyle *defaultStyle; 1319 ItemStyle *defaultStyle = 0;
1320 ItemDataList itemDataList; 1320 ItemDataList itemDataList;
1321 ItemData *itemData; 1321 ItemData *itemData;
1322 int nAttribs, z; 1322 int nAttribs, z;
1323 1323
1324 odebug << "HlManager::makeAttribs" << oendl; 1324 odebug << "HlManager::makeAttribs" << oendl;
1325 1325
@@ -1327,13 +1327,13 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) {
1327 getDefaults(defaultStyleList); 1327 getDefaults(defaultStyleList);
1328 1328
1329// itemDataList.setAutoDelete(true); 1329// itemDataList.setAutoDelete(true);
1330 highlight->getItemDataList(itemDataList); 1330 highlight->getItemDataList(itemDataList);
1331 nAttribs = itemDataList.count(); 1331 nAttribs = itemDataList.count();
1332 for (z = 0; z < nAttribs; z++) { 1332 for (z = 0; z < nAttribs; z++) {
1333 odebug << "HlManager::makeAttribs: createing one attribute definition" << oendl; 1333 odebug << "HlManager::makeAttribs: creating an attribute definition" << oendl;
1334 itemData = itemDataList.at(z); 1334 itemData = itemDataList.at(z);
1335 if (itemData->defStyle) { 1335 if (itemData->defStyle) {
1336 // default style 1336 // default style
1337 defaultStyle = defaultStyleList.at(itemData->defStyleNum); 1337 defaultStyle = defaultStyleList.at(itemData->defStyleNum);
1338 a[z].col = defaultStyle->col; 1338 a[z].col = defaultStyle->col;
1339 a[z].selCol = defaultStyle->selCol; 1339 a[z].selCol = defaultStyle->selCol;
@@ -1348,15 +1348,17 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) {
1348 } 1348 }
1349 } 1349 }
1350 1350
1351 for (; z < maxAttribs; z++) { 1351 for (; z < maxAttribs; z++) {
1352 a[z].col = black; 1352 a[z].col = black;
1353 a[z].selCol = black; 1353 a[z].selCol = black;
1354 if (defaultStyle) {
1354 a[z].bold = defaultStyle->bold; 1355 a[z].bold = defaultStyle->bold;
1355 a[z].italic = defaultStyle->italic; 1356 a[z].italic = defaultStyle->italic;
1356 } 1357 }
1358 }
1357 return nAttribs; 1359 return nAttribs;
1358} 1360}
1359 1361
1360int HlManager::defaultStyles() { 1362int HlManager::defaultStyles() {
1361 return 10; 1363 return 10;
1362} 1364}