Fix bug 428022 - Category color indicators should be printed. r=philipp
authorPhilippe Martinak <philippe.martinak@i-carre.net>
Sat, 21 Jan 2012 21:02:10 +0100
changeset 10477 2970fc9537afee3137027060090c9e19b59c5914
parent 10476 a54fa7dae43fc85aa0823f9fd069dc82387e7708
child 10478 d6deaa2e233766dc7cd588df23aa01b52ddef5db
push idunknown
push userunknown
push dateunknown
reviewersphilipp
bugs428022
Fix bug 428022 - Category color indicators should be printed. r=philipp
calendar/import-export/calMonthGridPrinter.js
calendar/import-export/calWeekPrinter.js
--- a/calendar/import-export/calMonthGridPrinter.js
+++ b/calendar/import-export/calMonthGridPrinter.js
@@ -326,17 +326,17 @@ calMonthPrinter.prototype = {
 
                 let time = (!sDate.isDate ? cal.getDateFormatter().formatTime(sDate) : "");
                 let calColor = item.calendar.getProperty('color') || "#A8C2E1";
                 let pb2 = Components.classes["@mozilla.org/preferences-service;1"]
                                     .getService(Components.interfaces.nsIPrefBranch2);
                 let catColor;
                 for each (let cat in item.getCategories({})) {
                     try {
-                        catColor = pb2.getCharPref("calendar.category.color." + formatStringForCSSRule(cat));
+                        catColor = pb2.getCharPref("calendar.category.color." + cal.formatStringForCSSRule(cat));
                         break; // take first matching
                     } catch (ex) {}
                 }
 
                 let style = 'font-size: 11px; text-align: left;';
                 style += ' background-color: ' + calColor + ';';
                 style += ' color: ' + cal.getContrastingTextColor(calColor) + ';';
                 if (catColor) {
--- a/calendar/import-export/calWeekPrinter.js
+++ b/calendar/import-export/calWeekPrinter.js
@@ -263,17 +263,17 @@ calWeekPrinter.prototype = {
             // Get calendar and category colours and apply them to the item's
             // table cell.
             let calColor = item.calendar.getProperty('color') || "#A8C2E1";
             let pb2 = Components.classes["@mozilla.org/preferences-service;1"]
                                 .getService(Components.interfaces.nsIPrefBranch2);
             let catColor;
             for each (let cat in item.getCategories({})) {
                 try {
-                    catColor = pb2.getCharPref("calendar.category.color." + formatStringForCSSRule(cat));
+                    catColor = pb2.getCharPref("calendar.category.color." + cal.formatStringForCSSRule(cat));
                     break; // take first matching
                 } catch (ex) {}
             }
 
             let style = 'font-size: 11px; background-color: ' + calColor + ';';
             style += ' color: ' + cal.getContrastingTextColor(calColor) + ';';
             if (catColor) {
                 style += ' border: solid ' + catColor + ' 2px;';