From b4f3d813365f3b8b61e2cf0be4069f8ba8d23daa Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Mon, 27 Jul 2015 20:39:05 +0200 Subject: [PATCH 1/4] Implement DanielsStyle. --- gimp/dk.xcf | Bin 0 -> 3864 bytes zaaReloaded2/Formatter/DanielsStyle.cs | 71 +++++++++++++++++++++++++ zaaReloaded2/Icons/dk.png | Bin 0 -> 1274 bytes zaaReloaded2/Ribbon.cs | 17 ++++++ zaaReloaded2/Ribbon.xml | 2 + zaaReloaded2/zaaReloaded2.csproj | 4 ++ 6 files changed, 94 insertions(+) create mode 100644 gimp/dk.xcf create mode 100755 zaaReloaded2/Formatter/DanielsStyle.cs create mode 100644 zaaReloaded2/Icons/dk.png diff --git a/gimp/dk.xcf b/gimp/dk.xcf new file mode 100644 index 0000000000000000000000000000000000000000..439dd504bdcbb87f5543137c2e3e9b6533f6eb19 GIT binary patch literal 3864 zcmeHK-D@0G6u+|{Np@orzv7EU#}qLER}w1XlMhi;T3+d%+yPeb&eX$Rc3un*Q zz2}~}_jk@s3Py2Jt!49S-Y|86p@u~HHjtv==MK=&>}erL7Dwp1+YmJMCdIr4;N8M>(+DQndVjko%=6cpl#dt+m4@J(ObA4-Y zVv9yiH+k5aWgD7lXce{YAO1WrlnKz3ubL)in3`3n0&(g@PG|f%t)gdgMmd0)YT9KO zugBRxK;(F}VjKCong!Z*t~U)!&-5U2sE0#rR;p!+rJSzj>XueCvfLjgA29uIV9vyw z{{=j$aKzsWh2Fj6#N%gn+v4Y`zbw3EkrqjBSa_a{Nza28^Arjr;(FHg0F*8(|x#NkhC#AOqbSY9nG}m*1f&_RQ$Rh86$KdNquLYMPTi%+BHGcpheuQO4 zSo0$wp14F+#6`Q~avCs!d==T|p27_>SHysXJ)$j%ll!0ef4M~k&}_fH_SweP_mI2` zyz~Zb?|gSw%0__KU98)oW7bu(6!^1@hv*M?A5rTick;1wGTd@1E?#Ot(eGdbXLg?L@D@yg8y zsfT!tXv8Z9AJKlh_8+^O)uwyT!d`8fZTsK0>3&1rZ`0|?8@1`w3%qQM-hJbQQ)Xc5 z*;21kuZvF8>AJ3`ctE}<6YS5azBDA7%dXpXTI`IY=%4V0EGgV|*Nb}{N6?uNZrei( zcfxk+K$CFCxg;jqr>VApR=36W>Ki*<*e(Ohoh^S=OmKA>V5)&ewF%F z?ircSNYFc6cZm@+mHth;lpzy_u5Ktcs7$B#bs@C19kUwVC(6ju^2ez@KI_U%Ve zf(@47)CNoNeQI&heBd`JTW8+-xE;I-sKWR;DNm^^26dfP*kH{(i`OQ_no0k}g{Z2N zQa;ZrI~M9+OL-6Vdqe#jDaWaghx)rx9;W_Gpm$!9a(#di2eBU`wg)ca5j)^-{86wm z@|!^wH@`UXRSWq!zuNYF^w0drLOjd5dm1a7gZim$=kn);L||bhVyGeUKZ@a5ExS-C vm#WrHebKP9KlXajdaoTOjQ$+XQ^85-#iK274mF@L{v#un-~l}u^7X#}B#iKI literal 0 HcmV?d00001 diff --git a/zaaReloaded2/Formatter/DanielsStyle.cs b/zaaReloaded2/Formatter/DanielsStyle.cs new file mode 100755 index 0000000..a2ab215 --- /dev/null +++ b/zaaReloaded2/Formatter/DanielsStyle.cs @@ -0,0 +1,71 @@ +/* DanielsStyle.cs + * part of zaaReloaded2 + * + * Copyright 2015 Daniel Kraus + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Office.Interop.Word; + +namespace zaaReloaded2.Formatter +{ + /// + /// Makes design changes and edits especially for Daniel Kraus. + /// + static class DanielsStyle + { + public static void Apply(Document document, Selection selection) + { + FixWords(document); + FormatDiagnoses(selection); + } + + static void FormatDiagnoses(Selection selection) + { + Range r = selection.Range; + r.ListFormat.RemoveNumbers(); + r.Bold = 0; + r.Italic = 0; + r.Underline = WdUnderline.wdUnderlineNone; + r.Font.Size = 10; + Paragraphs p = r.Paragraphs; + p.Alignment = WdParagraphAlignment.wdAlignParagraphLeft; + p.FirstLineIndent = -45; + p.LeftIndent = 45; + p.LineSpacingRule = WdLineSpacing.wdLineSpaceSingle; + p.SpaceAfter = 0; + p.SpaceBefore = 0; + + if (p[p.Count].Range.Text.StartsWith("Aktuell")) + { + p[p.Count].Range.Bold = 1; + } + } + + static void FixWords(Document document) + { + Find find = document.Range().Find; + find.Execute2007(FindText: "Dr.D.Kraus", ReplaceWith: "Dr. D. Kraus", Replace: WdReplace.wdReplaceAll); + find.Execute2007(FindText: "Z. n.", ReplaceWith: "Z.n.", Replace: WdReplace.wdReplaceAll); + find.Execute2007(FindText: "Zust. n.", ReplaceWith: "Z.n.", Replace: WdReplace.wdReplaceAll); + find.Execute2007(FindText: "Zust.n.", ReplaceWith: "Z.n.", Replace: WdReplace.wdReplaceAll); + find.Execute2007(FindText: "Assistent der Klinik", ReplaceWith: "Internist/Nephrologe", Replace: WdReplace.wdReplaceAll); + find.Execute2007(FindText: "Professor Dr.", ReplaceWith: "Prof. Dr.", Replace: WdReplace.wdReplaceAll); + find.Execute2007(FindText: "mmHg", ReplaceWith: "mm Hg", Replace: WdReplace.wdReplaceAll); + } + } +} diff --git a/zaaReloaded2/Icons/dk.png b/zaaReloaded2/Icons/dk.png new file mode 100644 index 0000000000000000000000000000000000000000..b4f9c39498713463e7d34f6e34b6f15010bfc8b4 GIT binary patch literal 1274 zcmVCwkh!<7b0PlQq(!{sI`I~70F}Rm%;y|zY3eNdbWSIB7uQJaFCEE zBp5)|an`nfYcCg`7f#IoFt6fpIEV^R5t^9*0J!?i)n@IzWc=Qi-u#532X!!7{eJZ{v-mN8S7w!Cu9Nz8|NY67_7e{L1^;;fWU`F5uWV)I zMdiY1^A&d%4u`R8!4)idw`BTn190z`d;X=hrSRhF;#Rw+J+CmgkXwATn2!(wk|YsH zkmw%|LgrtySNo8%1y0CL@E=@%AS)>-5$q;tnXvqk46xmb1uFmo5oqf6l#=%Kh;3w5 z|EYe?G4F`AD~fyt*VJh`UVE}OlkI}$H=DDl02LMs#2mT~T>9+N?=M3yBm26*)M+Zd zSaUHO06_nVe)jIr-R0e0(ssTrr?<6N%68_QcLp^dXq>h=TPUS8R2C}v^xQmZUfWCX z(XWpZTrgrASqq25Se`HEKe_p&w5+gVD7oR zu3$|^jh%dp95-5x{@l#mjOnkZD=j@1IRcb?7F3s23x{qDm5TTx0stTo3Phf|pRRj+ zo{;pYlvi0)DdJ|l0!Ftki>r%UeS>{3?hoHzvCrE>x8A!|aOIsVu|C-F*s$PR@ofSC zbba5oux}djGI*%9p*2VQhBm9TuvC~S%;YRlOIz**cj&qQ`G%%OlN}fN(LSp2!$!xz kZv(5zX2So)=)eK|2_p9>>7otM{r~^~07*qoM6N<$g0e4B9smFU literal 0 HcmV?d00001 diff --git a/zaaReloaded2/Ribbon.cs b/zaaReloaded2/Ribbon.cs index 4192060..a9a1791 100755 --- a/zaaReloaded2/Ribbon.cs +++ b/zaaReloaded2/Ribbon.cs @@ -90,6 +90,11 @@ namespace zaaReloaded2 ViewModels.AboutViewModel vm = new ViewModels.AboutViewModel(); vm.InjectInto().ShowDialog(); break; + case "zrlDaniel": + Formatter.DanielsStyle.Apply( + Globals.ThisAddIn.Application.ActiveDocument, + Globals.ThisAddIn.Application.Selection); + break; default: throw new InvalidOperationException("No operation defined for " + control.Id); } @@ -118,6 +123,18 @@ namespace zaaReloaded2 return Image.FromStream(sri.Stream); } + public bool Daniel_GetVisible(Office.IRibbonControl control) + { + switch (Environment.UserName.ToUpper()) + { + case "DANIEL": + case "KRAUS_D1": + return true; + default: + return false; + } + } + #endregion #region Helpers diff --git a/zaaReloaded2/Ribbon.xml b/zaaReloaded2/Ribbon.xml index cd12b15..14f7544 100755 --- a/zaaReloaded2/Ribbon.xml +++ b/zaaReloaded2/Ribbon.xml @@ -25,6 +25,8 @@