diff --git a/Yavsc/Helpers/TeXHelpers.cs b/Yavsc/Helpers/TeXHelpers.cs index 70633c2c..e3c77559 100644 --- a/Yavsc/Helpers/TeXHelpers.cs +++ b/Yavsc/Helpers/TeXHelpers.cs @@ -11,7 +11,7 @@ using Yavsc.ViewModels.Gen; namespace Yavsc.Helpers { - public class TeXString + public class TeXString : HtmlString { public class Replacement @@ -54,28 +54,24 @@ namespace Yavsc.Helpers new Replacement("†","\\dag"), new Replacement("–","\\textendash") }; - string data; - public TeXString(string str) + + public TeXString(string str) : base(TR(str)) { - data = str; + + + } + private static string TR(string source) + { + string result=source; foreach (var r in SpecialCharsRendering) { - data = r.Execute(data); + result = r.Execute(result); } + return result; } - override public string ToString() - { - return data; - } - public HtmlString ToHtmlString() - { - return new HtmlString(ToString()); - } - - - } + public static class TeXHelpers { public static string NewLinesWith(this string target, string separator) diff --git a/Yavsc/Views/Shared/Components/Estimate/Estimate_tex.cshtml b/Yavsc/Views/Shared/Components/Estimate/Estimate_tex.cshtml index 297f516f..4db29109 100644 --- a/Yavsc/Views/Shared/Components/Estimate/Estimate_tex.cshtml +++ b/Yavsc/Views/Shared/Components/Estimate/Estimate_tex.cshtml @@ -68,7 +68,7 @@ \def\FactureNum {@Model.Id.ToString()} % Numéro de facture \def\FactureAcquittee {@ViewBag.Acquitted?"oui":"non"} % Facture acquittée : oui/non \def\FactureLieu {@proaddrm} % Lieu de l'édition de la facture -\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) @TeXHelpers.ToTeX(Model.Title)} % Objet du document +\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) : @TeXHelpers.ToTeX(Model.Title)} % Objet du document % Description de la facture \def\FactureDescr { @TeXHelpers.ToTeX(Model.Description) @@ -192,7 +192,7 @@ \begin{flushright} @(new HtmlString(isestimate?"Devis validé":"Facture validée")) le @TeXHelpers.ToTeX(Model.ProviderValidationDate.ToString("dddd dd MMMM yyyy", - CultureInfo.CreateSpecificCulture("fr-FR"))).ToHtmlString() + CultureInfo.CreateSpecificCulture("fr-FR"))) \end{flushright} @if (prosign.Exists) {