Skip to content

Commit

Permalink
Merged PR 532: V3.2.4 Beta 4
Browse files Browse the repository at this point in the history
Related work items: #995
  • Loading branch information
MikeWilliams-UK committed Aug 17, 2022
1 parent b603972 commit 5d95d5a
Show file tree
Hide file tree
Showing 32 changed files with 70 additions and 63 deletions.
8 changes: 7 additions & 1 deletion src/Chem4Word.V3/Chem4WordOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ public void Load()
}
else
{
// ToDo: Take this out after beta is completed
RegistryHelper.StoreMessage(module, fileContents);

var options = JsonConvert.DeserializeObject<Chem4WordOptions>(fileContents);
SetValuesFromCopy(options);

Expand Down Expand Up @@ -292,7 +295,7 @@ private string ReadOptionsFile(string filename)
Errors.Add(exception.StackTrace);
}

return result;
return result.Trim();
}

private void PersistOptions(string filename)
Expand All @@ -301,10 +304,13 @@ private void PersistOptions(string filename)

try
{
// ToDo: Take this out after beta is completed
RegistryHelper.StoreMessage(module, $"Saving Chem4Word Options to {filename}");
Debug.WriteLine($"Saving Chem4Word Options to {filename}");

var contents = JsonConvert.SerializeObject(this, Formatting.Indented);
// ToDo: Take this out after beta is completed
RegistryHelper.StoreMessage(module, contents);

using (var outStream = new FileStream(filename,
FileMode.Create,
Expand Down
4 changes: 2 additions & 2 deletions src/Chem4Word.V3/Chem4WordV3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@ private void OnContentControlAfterAdd(Word.ContentControl NewContentControl, boo
var message = $"ContentControl {ccId} added; Looking for structure {ccTag}";
Telemetry.Write(module, "Information", message);

var document = NewContentControl.Application.ActiveDocument;
var document = Globals.Chem4WordV3.Application.ActiveDocument;
var application = Application;
var cxml = CustomXmlPartHelper.GetCustomXmlPart(ccTag, application.ActiveDocument);
if (cxml != null)
Expand All @@ -2752,7 +2752,7 @@ private void OnContentControlAfterAdd(Word.ContentControl NewContentControl, boo
}
else
{
if (document.Application.Documents.Count > 1)
if (Globals.Chem4WordV3.Application.Documents.Count > 1)
{
var app1 = Application;
cxml = CustomXmlPartHelper.FindCustomXmlPart(ccTag, app1.ActiveDocument);
Expand Down
7 changes: 4 additions & 3 deletions src/Chem4Word.V3/Data/Chem4Word-Versions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<Version>
<Number>3.2.4 Beta 4</Number>
<IsBeta>true</IsBeta>
<Released>01-Apr-2022</Released>
<Released>17-Aug-2022</Released>
<Changes>
<Change>System Info is not correct for Windows 11</Change>
<Change>Additional text encountered after finished reading JSON</Change>
<Change>Null Pointer Exception in LoadNamesFromLibrary()</Change>
<Change>Fix Null Pointer Exception in LoadNamesFromLibrary()</Change>
<Change>Add Retrosynthetic arrow https://github.com/Chem4Word/Version3-2/issues/26</Change>
<Change>Fix Null Poitner Exception in Formula helper</Change>
<Change>Fix Null Pointer Exception in FormulaHelper()</Change>
<Change>Fix Null Pointer Exception in ChemistryHelper()</Change>
<Change>If you like our product, please consider buying us a coffee at https://www.buymeacoffee.com/chem4word</Change>
<Change>Please download Chem4Word-Setup.exe via https://www.chem4word.co.uk/download/ if you encounter any difficulties updating</Change>
</Changes>
Expand Down
2 changes: 1 addition & 1 deletion src/Chem4Word.V3/Data/This-Version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<Version>
<Number>3.2.4 Beta 4</Number>
<IsBeta>true</IsBeta>
<Released>01-Apr-2022</Released>
<Released>17-Aug-2022</Released>
</Version>
2 changes: 1 addition & 1 deletion src/Chem4Word.V3/Helpers/ChemistryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static Word.ContentControl Insert2DChemistry(Word.Document doc, string cm
// Calling routine should check that Globals.Chem4WordV3.ChemistryAllowed = true

Word.ContentControl cc = null;
var app = doc.Application;
var app = Globals.Chem4WordV3.Application;

var wordSettings = new WordSettings(app);

Expand Down
10 changes: 5 additions & 5 deletions src/Chem4Word.V3/Helpers/Upgrader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public static void DoUpgrade(Word.Document doc)
{
string module = $"{_product}.{_class}.{MethodBase.GetCurrentMethod().Name}()";

int sel = doc.Application.Selection.Range.Start;
int sel = Globals.Chem4WordV3.Application.Selection.Range.Start;
Globals.Chem4WordV3.DisableContentControlEvents();

try
Expand Down Expand Up @@ -212,7 +212,7 @@ public static void DoUpgrade(Word.Document doc)
start = cc.Range.Start;
cc.Delete();

doc.Application.Selection.SetRange(start - 1, start - 1);
Globals.Chem4WordV3.Application.Selection.SetRange(start - 1, start - 1);
var model = new Model();
var molecule = new Molecule();
molecule.Names.Add(new TextualProperty { Id = "m1.n1", Value = cci.Text, FullType = CMLConstants.ValueChem4WordSynonym });
Expand All @@ -233,7 +233,7 @@ public static void DoUpgrade(Word.Document doc)
start = cc.Range.Start;
cc.Delete();

doc.Application.Selection.SetRange(start - 1, start - 1);
Globals.Chem4WordV3.Application.Selection.SetRange(start - 1, start - 1);
isFormula = false;
text = ChemistryHelper.GetInlineText(target.Model, cci.Type, ref isFormula, out _);
Word.ContentControl ccr = doc.ContentControls.Add(Word.WdContentControlType.wdContentControlRichText, ref _missing);
Expand Down Expand Up @@ -261,7 +261,7 @@ public static void DoUpgrade(Word.Document doc)
}

Globals.Chem4WordV3.EnableContentControlEvents();
doc.Application.Selection.SetRange(sel, sel);
Globals.Chem4WordV3.Application.Selection.SetRange(sel, sel);
if (upgradedCCs + upgradedXml > 0)
{
if (Globals.Chem4WordV3.Telemetry != null)
Expand Down Expand Up @@ -329,7 +329,7 @@ private static List<UpgradeTarget> CollectData(Word.Document doc)

List<UpgradeTarget> targets = new List<UpgradeTarget>();

Word.Selection sel = doc.Application.Selection;
Word.Selection sel = Globals.Chem4WordV3.Application.Selection;

// Step 1 find location of all content controls
// Step 2 extract Cml
Expand Down
2 changes: 1 addition & 1 deletion src/Chem4Word.V3/Library/LibraryViewControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void OnItemButtonClick(object sender, RoutedEventArgs e)
switch (source.Button)
{
case "Library|InsertCopy":
TaskPaneHelper.InsertChemistry(true, activeDocument.Application, clicked.Cml, true);
TaskPaneHelper.InsertChemistry(true, Globals.Chem4WordV3.Application, clicked.Cml, true);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Chem4Word.V3/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Chemistry/Chem4Word.ACME/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Chemistry/Chem4Word.Libraries/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Chemistry/Chem4Word.Model2/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Common/Chem4Word.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Common/Chem4Word.Telemetry/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Installer/Chem4WordSetup/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Installer/Chem4WordUpdater/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/Installer/WiX.CustomAction/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
2 changes: 1 addition & 1 deletion src/Installer/WiXInstaller/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!-- For automatic upgrade to work only first three parts of version number are used -->
<Product Id="*" Name="Chemistry Add-In for Microsoft Word 2022 Beta 4" Manufacturer="Chem4Word" Version="3.2.4.8126" UpgradeCode="865226e7-d29d-49aa-a390-dda49979b102" Language="1033">
<Product Id="*" Name="Chemistry Add-In for Microsoft Word 2022 Beta 4" Manufacturer="Chem4Word" Version="3.2.4.8264" UpgradeCode="865226e7-d29d-49aa-a390-dda49979b102" Language="1033">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of Chem4Word is already installed." />
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" CompressionLevel="high" />
Expand Down
4 changes: 2 additions & 2 deletions src/PlugIns/Contracts/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/PlugIns/Renderers/OoXmlV4/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/TestHarness/WPF.ShapeTester/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]
4 changes: 2 additions & 2 deletions src/UnitTests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.4.8126")]
[assembly: AssemblyFileVersion("3.2.4.8126")]
[assembly: AssemblyVersion("3.2.4.8264")]
[assembly: AssemblyFileVersion("3.2.4.8264")]

0 comments on commit 5d95d5a

Please sign in to comment.