From c6a64c444e70c22c02c6c9524118116faac68806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0t=C4=9Bch?= Date: Fri, 3 Apr 2020 21:17:26 +0200 Subject: [PATCH] Fix of a formula parsing bug Fix of a bug when trying to calculate M of formulas starting with ( threw an "Unbalanced brackets" exception. Release files were generated. --- Molar mass calculator/ElementGroup.cs | 2 +- .../Molar mass calculator.csproj | 32 +++++++++++++++++- .../Molar mass calculator.csproj.user | 13 +++++++ .../Molar mass calculator_TemporaryKey.pfx | Bin 0 -> 1660 bytes 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 Molar mass calculator/Molar mass calculator.csproj.user create mode 100644 Molar mass calculator/Molar mass calculator_TemporaryKey.pfx diff --git a/Molar mass calculator/ElementGroup.cs b/Molar mass calculator/ElementGroup.cs index c6434f2..2519567 100644 --- a/Molar mass calculator/ElementGroup.cs +++ b/Molar mass calculator/ElementGroup.cs @@ -30,7 +30,7 @@ public ElementGroup(string content, int count, bool containsElementGroup) //Split content variable (for example "(Co(CN)6)") into array of shorter strings ({"Co",1},{"CN",6}) //If we got element group in brackets as content, we will skip the opening bracket, so we don't just return the whole group again - if (content[0] == '(') + if (content[0] == '(' && content[content.Length - 1] == ')') { //Removing the brackets content = content.Substring(1, content.Length - 2); diff --git a/Molar mass calculator/Molar mass calculator.csproj b/Molar mass calculator/Molar mass calculator.csproj index 6bb3a65..eb02337 100644 --- a/Molar mass calculator/Molar mass calculator.csproj +++ b/Molar mass calculator/Molar mass calculator.csproj @@ -1,4 +1,4 @@ - + @@ -12,6 +12,24 @@ 512 true true + true + C:\Users\honza\OneDrive\Online Programování\C#\ + true + Web + true + Foreground + 7 + Days + false + false + true + https://github.com/HonzaSTECH/Simple-Molar-Mass-Calculator/releases/tag/v1.0/ + true + publish.htm + 0 + 1.0.0.%2a + false + true AnyCPU @@ -136,5 +154,17 @@ + + + False + Microsoft .NET Framework 4.7.2 %28x86 a x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/Molar mass calculator/Molar mass calculator.csproj.user b/Molar mass calculator/Molar mass calculator.csproj.user new file mode 100644 index 0000000..0218737 --- /dev/null +++ b/Molar mass calculator/Molar mass calculator.csproj.user @@ -0,0 +1,13 @@ + + + + + + + + + + cs-CZ + false + + \ No newline at end of file diff --git a/Molar mass calculator/Molar mass calculator_TemporaryKey.pfx b/Molar mass calculator/Molar mass calculator_TemporaryKey.pfx new file mode 100644 index 0000000000000000000000000000000000000000..e1a3ae963e4a0f2ac6cfea9ddebb802a4dda79d6 GIT binary patch literal 1660 zcmZXTdpy&77{`D6ZEZG}BGr=1(7bY~wnFaGkU1=J^uoxJk}w(zwUix~!zq_sj$2F8 zGMRhivUb8LNi}mfr4({YkvN3&>%2PkIJU~Tu;DfTDZy_e*zlVWz7AO~Qu}QK zBQgJC=y5rO)C*5j&M=@D4uU8Vf(@o*?QTz){0uHA@JfB`X-4VmqgIpWz6cWwtl}s3ceBTyEbENp;#ak;@Qh5;7?_eNtCKwdm`I$N1V7A12S= zB@txVtHL3sc5`T8XQ$-=vdPHw6j$73_C=<54DDKyVXiGBj%6|J)##Cr_3q#E^lB)( zU6!6Q>WrOY%e4BjdHBK?>eI`5qo);UZQ*?t9F68;Rbl08HD!Jj0@l^JOxr%YBkCa{?qk|!3z&pC9J+I|GllVwO zXcTGPuYddjQFMisUB&IUr{b4CD$8$p-4jozQB(X)6BWX>Opd*2dEzVpHMjT>%LkH6 zn|zBb)ISE)`rmP{tsF|UbBw#hedBQGf#35Tbk44vvGtog=%hw_`u>PghW1wB;r6MQ zj#1&SShF-cynFECZC*BMA&EWM?k`FagoPF8&&t1RO7p6Ry}$urCtw8FK$$fZ=|jvG zF!;s{Al*(#@s$}ub$v)@1sxl}81fegUP!bq5{7`W_sPSEPO22Z5%33&0}LP-2!-q< z5C-4?7s!7lbifbFNKhOJgg`79${D~hC_eR17Y=axM|T#=e1Q`H1KLFI@4rVOq2+Xf zkOK$6 zDU+OzpF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