Anschreiben korrigiert und optimiert

pull/1/head
Sascha Woitschetzki 2021-06-14 11:50:17 +07:00 committed by Sascha Woitschetzki
parent a9b4e447de
commit 018f32c1b5
3 changed files with 31 additions and 15 deletions

@ -0,0 +1,21 @@
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand*\new@tpo@label[2]{}
\@nameuse{bbl@beforestart}
\catcode `"\active
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}

@ -84,6 +84,13 @@ namespace Gremlin.Operations
return texFile; return texFile;
} }
private static string GetAnschreibenZeile(LineItemVM lineItemVM)
{
return lineItemVM.CustomDescription.CoverletterText == null || lineItemVM.CustomDescription.CoverletterText == ""
? $"\\item {lineItemVM.CustomDescription.Heading} (\\#{lineItemVM.Position})"
: $"\\item {lineItemVM.CustomDescription.CoverletterText} (\\#{lineItemVM.Position})";
}
private static StringBuilder ErstelleAnschreibenListe(QuoteVM quoteVM) private static StringBuilder ErstelleAnschreibenListe(QuoteVM quoteVM)
{ {
bool subitem = false; bool subitem = false;
@ -101,29 +108,17 @@ namespace Gremlin.Operations
_ = anschreibenListe.AppendLine(@"\end{itemize}"); _ = anschreibenListe.AppendLine(@"\end{itemize}");
subitem = false; subitem = false;
} }
_ = lineItemVM.CustomDescription.CoverletterText == null
? anschreibenListe.AppendLine($"\\item {lineItemVM.CustomDescription.Heading} (\\#{lineItemVM.Position})")
: anschreibenListe.AppendLine($"\\item {lineItemVM.CustomDescription.CoverletterText} (\\#{lineItemVM.Position})");
} }
else else
{ {
if (subitem) if (!subitem)
{
//weiteres Subitem
_ = lineItemVM.CustomDescription.CoverletterText == null
? anschreibenListe.AppendLine($"\\item {lineItemVM.CustomDescription.Heading} (\\#{lineItemVM.Position})")
: anschreibenListe.AppendLine($"\\item {lineItemVM.CustomDescription.CoverletterText} (\\#{lineItemVM.Position})");
}
else
{ {
//neues Subitem //neues Subitem
subitem = true; subitem = true;
_ = anschreibenListe.AppendLine("\\begin{itemize}"); _ = anschreibenListe.AppendLine("\\begin{itemize}");
_ = lineItemVM.CustomDescription.CoverletterText == null
? anschreibenListe.AppendLine($"\\item {lineItemVM.CustomDescription.Heading} (\\#{lineItemVM.Position})")
: anschreibenListe.AppendLine($"\\item {lineItemVM.CustomDescription.CoverletterText} (\\#{lineItemVM.Position})");
} }
} }
anschreibenListe.AppendLine(GetAnschreibenZeile(lineItemVM));
} }
if (subitem) if (subitem)