Diffstat (limited to 'noncore/apps/tinykate/libkate/document') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katehighlight.cpp | 6 |
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 | |||
@@ -1307,62 +1307,64 @@ int HlManager::wildcardFind(const QString &fileName) { | |||
1307 | QRegExp regExp(w.mid(p1,p2 - p1),true,true); | 1307 | QRegExp regExp(w.mid(p1,p2 - p1),true,true); |
1308 | if (regExp.match(fileName) == 0) return hlList.at(); | 1308 | if (regExp.match(fileName) == 0) return hlList.at(); |
1309 | } | 1309 | } |
1310 | p1 = p2 + 1; | 1310 | p1 = p2 + 1; |
1311 | } | 1311 | } |
1312 | } | 1312 | } |
1313 | return -1; | 1313 | return -1; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | 1316 | ||
1317 | int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) { | 1317 | int 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 | ||
1326 | defaultStyleList.setAutoDelete(true); | 1326 | defaultStyleList.setAutoDelete(true); |
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; |
1340 | a[z].bold = defaultStyle->bold; | 1340 | a[z].bold = defaultStyle->bold; |
1341 | a[z].italic = defaultStyle->italic; | 1341 | a[z].italic = defaultStyle->italic; |
1342 | } else { | 1342 | } else { |
1343 | // custom style | 1343 | // custom style |
1344 | a[z].col = itemData->col; | 1344 | a[z].col = itemData->col; |
1345 | a[z].selCol = itemData->selCol; | 1345 | a[z].selCol = itemData->selCol; |
1346 | a[z].bold = itemData->bold; | 1346 | a[z].bold = itemData->bold; |
1347 | a[z].italic = itemData->italic; | 1347 | a[z].italic = itemData->italic; |
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 | ||
1360 | int HlManager::defaultStyles() { | 1362 | int HlManager::defaultStyles() { |
1361 | return 10; | 1363 | return 10; |
1362 | } | 1364 | } |
1363 | 1365 | ||
1364 | QString HlManager::defaultStyleName(int n) | 1366 | QString HlManager::defaultStyleName(int n) |
1365 | { | 1367 | { |
1366 | static QStringList names; | 1368 | static QStringList names; |
1367 | 1369 | ||
1368 | if (names.isEmpty()) | 1370 | if (names.isEmpty()) |