From 4129b9ebe51caeaaf4a81b58a924e1c1405b2627 Mon Sep 17 00:00:00 2001 From: Andris Kurmis Date: Tue, 4 Sep 2018 18:00:33 +0300 Subject: [PATCH] maybe fixes #37 --- src/VBASync/Model/VbaFolder.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/VBASync/Model/VbaFolder.cs b/src/VBASync/Model/VbaFolder.cs index dd36441..80cd2cf 100644 --- a/src/VBASync/Model/VbaFolder.cs +++ b/src/VBASync/Model/VbaFolder.cs @@ -78,8 +78,7 @@ public IList>> GetCodeModules() public void ReplaceFormControls(string name, VbaFolder source) { - _so.FileCopy(FindFrxPath(source.FindModulePath(name, ModuleType.Form)), - FindFrxPath(FindModulePath(name, ModuleType.Form)), true); + _so.FileCopy(source.FindFrxPath(name), FindFrxPath(name), true); } public void ReplaceTextModule(string name, ModuleType type, VbaFolder source, string fallbackText) @@ -130,7 +129,7 @@ protected string FindFrxPath(string name) } protected string FindModulePath(string name, ModuleType type) - => ModuleFilePaths.Find(s => string.Equals(_so.PathGetFileName(s), name + ModuleProcessing.ExtensionFromType(type), + => ModuleFilePaths.Find(s => string.Equals(_so.PathGetFileName(s), _so.PathGetFileName(name + ModuleProcessing.ExtensionFromType(type)), StringComparison.OrdinalIgnoreCase)); protected virtual List GetModuleFilePaths() => GetModuleFilePaths(false);