-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy UserForm resource file (.frx) along with UserForm source (.frm) on export #3129
Conversation
{ | ||
if (line.Contains("OleObjectBlob")) | ||
{ | ||
var resourceFileName = line.Trim().Split(new Char[] { '"' }).ElementAt(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not line.Split("\"")[1].Trim()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get an error when I try that: Cannot convert from 'string' to 'char'
This is awesome, not losing the forms is a great first step in the right direction! ..and now I see what you were trying to do with that |
After more testing, I don't think this closes all the issues I referenced. I'm looking into it now. |
@shadowofsilicon ok, I'll hold off on merging then. |
var destPath = Directory.GetParent(path).FullName; | ||
if (File.Exists(Path.Combine(tempFilePath, tempFile)) && !destPath.Equals(tempFilePath)) | ||
{ | ||
File.Copy(Path.Combine(tempFilePath, tempName), Path.Combine(destPath, resourceFileName), overwrite:true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the file be moved instead? It's a temp file anyway, we don't want to leave useless files around... why copy it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I noticed that too this morning.
…import of document class
…silicon/Rubberduck into UserForm_FRX_Export_Fix
Still WIP or good to go? |
Good to go |
Looking at a lot of the open issues with source control, it appeared that the underlying issue was that the UserForm resource file was simply not ending up in the same directory as the UserForm source file.
VBE does the work of the export, and we already read the contents of that source file... so, we just gotta get the resource file name and copy that file to the destination. This fix does just that.
With my testing, I believe that this closes: #2437, closes #2706, closes #2939, closes #2983, closes #2994, and closes #3019.
It might also be the solution to: #2315, #3126, but I don't know as other functionality is broken.