[longomatch] Fix pango markup escape
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix pango markup escape
- Date: Mon, 5 Aug 2013 20:07:52 +0000 (UTC)
commit 51f06536e5145f83d4d861246380e0957e5625b0
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Aug 5 01:05:53 2013 +0200
Fix pango markup escape
LongoMatch.GUI/Gui/Component/ButtonsWidget.cs | 2 +-
LongoMatch.GUI/Gui/Component/Stats/GameViewer.cs | 8 ++++----
.../Gui/Component/Stats/PangoTextMeasurer.cs | 2 +-
LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs | 10 ++++++----
.../Gui/TreeView/SubCategoriesTreeView.cs | 2 +-
5 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/ButtonsWidget.cs b/LongoMatch.GUI/Gui/Component/ButtonsWidget.cs
index c3905d4..a84bc9d 100644
--- a/LongoMatch.GUI/Gui/Component/ButtonsWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/ButtonsWidget.cs
@@ -87,7 +87,7 @@ namespace LongoMatch.Gui.Component
uint col_left = (uint) i%table1.NColumns;
uint col_right = (uint) col_left+1 ;
- l.Markup = cat.Name;
+ l.Markup = GLib.Markup.EscapeText (cat.Name);
l.Justify = Justification.Center;
l.Ellipsize = Pango.EllipsizeMode.Middle;
l.CanFocus = false;
diff --git a/LongoMatch.GUI/Gui/Component/Stats/GameViewer.cs
b/LongoMatch.GUI/Gui/Component/Stats/GameViewer.cs
index 0954626..d1c3023 100644
--- a/LongoMatch.GUI/Gui/Component/Stats/GameViewer.cs
+++ b/LongoMatch.GUI/Gui/Component/Stats/GameViewer.cs
@@ -112,14 +112,14 @@ namespace LongoMatch.Gui.Component
foreach (CategoryStats cstat in stats.CategoriesStats) {
int width, height;
- layout.SetText (cstat.Name);
+ layout.SetMarkup (GLib.Markup.EscapeText (cstat.Name));
layout.GetPixelSize (out width, out height);
if (width > normal) {
normal = width;
}
foreach (SubCategoryStat sstat in cstat.SubcategoriesStats) {
foreach (PercentualStat spstat in sstat.OptionStats) {
- layout.SetText (String.Format ("{0}: {1}", cstat.Name,
cstat.Name));
+ layout.SetMarkup (GLib.Markup.EscapeText (String.Format
("{0}: {1}", cstat.Name, sstat.Name)));
layout.GetPixelSize (out width, out height);
if (width > full) {
full = width;
@@ -164,7 +164,7 @@ namespace LongoMatch.Gui.Component
HeightRequest = 25;
} else {
if (subcat != null) {
- name_tpl = subcat.Name + ": {0}";
+ name_tpl = GLib.Markup.EscapeText (subcat.Name) + ": {0}";
}
HeightRequest = 18;
}
@@ -225,7 +225,7 @@ namespace LongoMatch.Gui.Component
/* Category name */
layout.Width = Pango.Units.FromPixels(textSize);
layout.Alignment = Pango.Alignment.Center;
- layout.SetMarkup(String.Format(name_tpl, stat.Name));
+ layout.SetMarkup(String.Format(name_tpl, GLib.Markup.EscapeText (stat.Name)));
GdkWindow.DrawLayout(Style.TextGC(StateType.Normal), center - textSize / 2,
0, layout);
/* Home count */
diff --git a/LongoMatch.GUI/Gui/Component/Stats/PangoTextMeasurer.cs
b/LongoMatch.GUI/Gui/Component/Stats/PangoTextMeasurer.cs
index 52d9870..a085a23 100644
--- a/LongoMatch.GUI/Gui/Component/Stats/PangoTextMeasurer.cs
+++ b/LongoMatch.GUI/Gui/Component/Stats/PangoTextMeasurer.cs
@@ -39,7 +39,7 @@ namespace LongoMatch.Gui.Component.Stats
desc.Family = fontFamily;
desc.Size = (int) fontSize;
desc.Weight = PangoWeightFromDouble (fontWeight);
- layout.SetText (text);
+ layout.SetMarkup (GLib.Markup.EscapeText (text));
layout.GetPixelSize (out width, out height);
size.Width = (double) width;
size.Height = (double) height;
diff --git a/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs b/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs
index dcf4f2a..57cf849 100644
--- a/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs
+++ b/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs
@@ -241,9 +241,9 @@ namespace LongoMatch.Gui.Component
* We need to check if we are editing and only change it for the path that's
currently beeing edited */
if(editing && Selection.IterIsSelected(iter)) {
if(o is Player)
- c.Markup = (o as Player).Name;
+ c.Markup = GLib.Markup.EscapeText ((o as Player).Name);
else
- c.Markup = (o as TimeNode).Name;
+ c.Markup = GLib.Markup.EscapeText ((o as TimeNode).Name);
return;
}
@@ -261,11 +261,13 @@ namespace LongoMatch.Gui.Component
} else if(o is Player) {
c.Background = "white";
c.CellBackground = "white";
- c.Markup = String.Format("{0} ({1})", (o as Player).ToString(),
modelFilter.IterNChildren(iter));
+ c.Markup = String.Format("{0} ({1})", GLib.Markup.EscapeText ((o as
Player).ToString()),
+ modelFilter.IterNChildren(iter));
} else if(o is Category) {
c.Background = "white";
c.CellBackground = "white";
- c.Markup = String.Format("{0} ({1})", (o as TimeNode).Name,
modelFilter.IterNChildren(iter));
+ c.Markup = String.Format("{0} ({1})", GLib.Markup.EscapeText ((o as
TimeNode).Name),
+ modelFilter.IterNChildren(iter));
}
}
diff --git a/LongoMatch.GUI/Gui/TreeView/SubCategoriesTreeView.cs
b/LongoMatch.GUI/Gui/TreeView/SubCategoriesTreeView.cs
index 4bc7a73..e66ca42 100644
--- a/LongoMatch.GUI/Gui/TreeView/SubCategoriesTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/SubCategoriesTreeView.cs
@@ -76,7 +76,7 @@ namespace LongoMatch.Gui
private void RenderSubcat(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel
model, Gtk.TreeIter iter)
{
var subcat = (ISubCategory)model.GetValue(iter, 0);
- (cell as Gtk.CellRendererText).Markup = subcat.ToMarkupString();
+ (cell as Gtk.CellRendererText).Markup = GLib.Markup.EscapeText
(subcat.ToMarkupString());
}
private void SetMenu() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]