Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Topic++ Save as template... not working
Topic++ Save as template... not working [message #60278] |
Sat, 04 November 2023 23:58 |
Tom1
Messages: 1217 Registered: March 2007
|
Senior Contributor |
|
|
Hi,
I was just starting with Topic++. I discovered that (at least on Windows) "Save as template..." does not work. I digged into the code and it turned out that SaveFile in the end fails as the _.tpp -subdirectory does not exist yet and cannot be created automatically. I added the directory manually and then the template was written successfully.
void TopicEditor::SaveAsTemplate()
{
TopicDlg<WithSaveTemplateLayout<TopWindow> > d("Save as template");
d.lang <<= lastlang;
Vector<String> ud = GetUppDirs();
String p = GetCurrentTopicPath();
for(int i = 0; i < ud.GetCount(); i++) {
d.nest.Add(ud[i]);
if(p.StartsWith(ud[i]))
d.nest.SetIndex(i);
}
if(d.nest.GetIndex() < 0)
d.nest.GoBegin();
if(d.Execute() != IDOK || IsNull(~d.nest))
return;
SaveFile(AppendFileName(AppendFileName(~d.nest, "_.tpp"), d.GetName()),
WriteTopic((String)~title, editor.Get())); // <<<--- Around here...
}
Maybe there should be some code added for creating the necessary directory if it does not exist yet.
Best regards,
Tom
|
|
|
Goto Forum:
Current Time: Wed Jun 05 06:04:28 CEST 2024
Total time taken to generate the page: 0.02324 seconds
|