From e18f053865025e03e4da0ba43cd95a39e69861be Mon Sep 17 00:00:00 2001 From: Simon Martens Date: Wed, 21 Jun 2023 16:32:08 +0200 Subject: [PATCH] Stuff --- HaWeb/.vscode/settings.json | 3 + HaWeb/HaWeb.sln | 25 + HamannPrinter/.vscode/launch.json | 24 - HamannPrinter/.vscode/settings.json | 3 + HamannPrinter/.vscode/tasks.json | 5 +- HamannPrinter/Hamann2Word.cs | 14 +- HamannPrinter/HamannPrinter.csproj | 4 +- HamannPrinter/HamannPrinter.sln | 25 + HamannPrinter/Helper.cs | 1 + HamannPrinter/MainWindow.xaml | 4 +- HamannPrinter/MainWindow.xaml.cs | 22 +- HamannPrinter/Parser.cs | 22 +- HamannPrinter/inp/Editionsrichtlinien.docx | Bin 0 -> 19046 bytes HamannPrinter/inp/HAMANN.xml | 220127 ++++++++++++++++++ 14 files changed, 220223 insertions(+), 56 deletions(-) create mode 100644 HaWeb/.vscode/settings.json create mode 100644 HaWeb/HaWeb.sln create mode 100644 HamannPrinter/.vscode/settings.json create mode 100644 HamannPrinter/HamannPrinter.sln create mode 100644 HamannPrinter/inp/Editionsrichtlinien.docx create mode 100644 HamannPrinter/inp/HAMANN.xml diff --git a/HaWeb/.vscode/settings.json b/HaWeb/.vscode/settings.json new file mode 100644 index 0000000..99a4264 --- /dev/null +++ b/HaWeb/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dotnet.defaultSolution": "HaWeb.sln" +} \ No newline at end of file diff --git a/HaWeb/HaWeb.sln b/HaWeb/HaWeb.sln new file mode 100644 index 0000000..882acbe --- /dev/null +++ b/HaWeb/HaWeb.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.001.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HaWeb", "HaWeb.csproj", "{3FDCF678-C8B9-410D-8229-BEB69195D27C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3FDCF678-C8B9-410D-8229-BEB69195D27C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3FDCF678-C8B9-410D-8229-BEB69195D27C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3FDCF678-C8B9-410D-8229-BEB69195D27C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3FDCF678-C8B9-410D-8229-BEB69195D27C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7ED50D02-358C-467B-AB41-CF0F0D6D1627} + EndGlobalSection +EndGlobal diff --git a/HamannPrinter/.vscode/launch.json b/HamannPrinter/.vscode/launch.json index 1565685..e69de29 100644 --- a/HamannPrinter/.vscode/launch.json +++ b/HamannPrinter/.vscode/launch.json @@ -1,24 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/HamannPrinter.dll", - "args": [], - "cwd": "${workspaceFolder}", - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] -} \ No newline at end of file diff --git a/HamannPrinter/.vscode/settings.json b/HamannPrinter/.vscode/settings.json new file mode 100644 index 0000000..749ac2f --- /dev/null +++ b/HamannPrinter/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dotnet.defaultSolution": "HamannPrinter.sln" +} \ No newline at end of file diff --git a/HamannPrinter/.vscode/tasks.json b/HamannPrinter/.vscode/tasks.json index 98e7816..a26416d 100644 --- a/HamannPrinter/.vscode/tasks.json +++ b/HamannPrinter/.vscode/tasks.json @@ -32,9 +32,8 @@ "args": [ "watch", "run", - "${workspaceFolder}/HamannPrinter.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" + "--project", + "${workspaceFolder}/HamannPrinter.csproj" ], "problemMatcher": "$msCompile" } diff --git a/HamannPrinter/Hamann2Word.cs b/HamannPrinter/Hamann2Word.cs index 987342c..5ff556a 100644 --- a/HamannPrinter/Hamann2Word.cs +++ b/HamannPrinter/Hamann2Word.cs @@ -450,14 +450,14 @@ namespace HamannPrinter } else { - if (comment.Entry.Length > 0) + if (comment.Element.Length > 0) { counter++; if (counter < 1) { var xLemma = StringToXElement(comment.Lemma + " "); ParseComment(xLemma, para, counter); - var xComment = StringToXElement(comment.Entry); + var xComment = StringToXElement(comment.Element); ParseComment(xComment, para, counter); } else @@ -469,7 +469,7 @@ namespace HamannPrinter } else { - Logger.Out("der Comment:\n" + comment.Entry + "\n für \n" + xelem + "\n ist leer"); + Logger.Out("der Comment:\n" + comment.Element + "\n für \n" + xelem + "\n ist leer"); } } } @@ -1414,7 +1414,7 @@ namespace HamannPrinter Paragraph lemmaDescription = lemmaPara.InsertAfterSelf(new Paragraph()); ApplyParaStyle(lemmaDescription, "doppeleinzug"); lemmaDescription.ParagraphProperties.AppendChild(new SpacingBetweenLines() { After = SmallDistance }); - ParseComment(XElement.Parse(metaComm.Entry), lemmaDescription); + ParseComment(XElement.Parse(metaComm.Element), lemmaDescription); if (commReferences.ContainsKey(metaComm.Index)) { var commReference = commReferences[metaComm.Index]; @@ -1436,7 +1436,7 @@ namespace HamannPrinter { foreach (var comm in metaComm.Kommentare) { - if (!String.IsNullOrWhiteSpace(comm.Value.Entry)) { + if (!String.IsNullOrWhiteSpace(comm.Value.Element)) { var subLemmaPara = GetLastPara(commDoc).InsertAfterSelf(new Paragraph()); ApplyParaStyle(subLemmaPara, "doppeleinzug"); ParseComment(XElement.Parse(comm.Value.Lemma), subLemmaPara); @@ -1444,7 +1444,7 @@ namespace HamannPrinter var subEintragPara = subLemmaPara.InsertAfterSelf(new Paragraph()); ApplyParaStyle(subEintragPara, "doppeleinzug"); subEintragPara.ParagraphProperties.AppendChild(new SpacingBetweenLines() { After = SmallDistance }); - ParseComment(XElement.Parse(RemoveWhiteSpaceLinebreak(comm.Value.Entry)), subEintragPara); + ParseComment(XElement.Parse(RemoveWhiteSpaceLinebreak(comm.Value.Element)), subEintragPara); if (commReferences.ContainsKey(metaComm.Index) && commReferences[metaComm.Index].ContainsKey(comm.Key)) { subEintragPara.ParagraphProperties.AppendChild(new SpacingBetweenLines() { After = SmallDistance }); @@ -1680,7 +1680,7 @@ namespace HamannPrinter volume = Int32.Parse(Letters.Metas[marg.Letter].ZH.Volume); var place = new Place(volume, marg.Letter, ConvertNumber(marg.Page), Int32.Parse(marg.Line), marg.Page); XElement comm = XElement.Parse(marg.Element); - foreach (var link in comm.Elements().Where(x => x.Name.LocalName == "link")) + foreach (var link in comm.Elements().Where(x => x.Name.LocalName == "link" && (x.HasAttributes && (x.Attribute("ref") != null || x.Attribute("subref") != null)))) { string refer = link.Attribute("ref").Value; string subref = "0"; diff --git a/HamannPrinter/HamannPrinter.csproj b/HamannPrinter/HamannPrinter.csproj index 35980fb..7bf8cc5 100644 --- a/HamannPrinter/HamannPrinter.csproj +++ b/HamannPrinter/HamannPrinter.csproj @@ -2,13 +2,13 @@ WinExe - netcoreapp3.0 + net6.0-windows true true - + diff --git a/HamannPrinter/HamannPrinter.sln b/HamannPrinter/HamannPrinter.sln new file mode 100644 index 0000000..96a404b --- /dev/null +++ b/HamannPrinter/HamannPrinter.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.001.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HamannPrinter", "HamannPrinter.csproj", "{F6C929A3-B041-4F42-AF25-00D1E49B55ED}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {807CF64C-09D5-4447-9592-EE27ACC24590} + EndGlobalSection +EndGlobal diff --git a/HamannPrinter/Helper.cs b/HamannPrinter/Helper.cs index ae6864f..de70b86 100644 --- a/HamannPrinter/Helper.cs +++ b/HamannPrinter/Helper.cs @@ -277,6 +277,7 @@ namespace HamannPrinter static public Comment GetComment(XElement xelem) { //ref und subref id beziehen + if (!xelem.HasAttributes || xelem.Attribute("ref") == null) return null; string refer = xelem.Attribute("ref").Value; string subref = xelem?.Attribute("subref")?.Value; Comment comm; diff --git a/HamannPrinter/MainWindow.xaml b/HamannPrinter/MainWindow.xaml index 4c0006f..4339d3c 100644 --- a/HamannPrinter/MainWindow.xaml +++ b/HamannPrinter/MainWindow.xaml @@ -22,8 +22,8 @@