mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 22:09:28 +02:00
IDE: Export to html, do not enforce check for writeable. Issue #0022588
git-svn-id: trunk@38198 -
This commit is contained in:
parent
df7a7d6acc
commit
c0c7de3fea
@ -5564,6 +5564,7 @@ resourcestring
|
||||
lisSavedWithProjectSession = 'Saved with project session';
|
||||
lisSavedWithIDESettings = 'Saved with IDE settings';
|
||||
lisMoveTo = 'Move to: ';
|
||||
lisFailedToSaveFile = 'Failed to save file,';
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -3042,7 +3042,7 @@ begin
|
||||
SaveDialog.Title:=lisSaveSpace;
|
||||
SaveDialog.FileName:=SrcEdit.PageName+'.html';
|
||||
SaveDialog.Filter := ' (*.html;*.htm)|*.html;*.htm';
|
||||
SaveDialog.Options := [ofOverwritePrompt, ofPathMustExist, ofNoReadOnlyReturn];
|
||||
SaveDialog.Options := [ofOverwritePrompt, ofPathMustExist{, ofNoReadOnlyReturn}]; // Does not work for desktop
|
||||
// show save dialog
|
||||
if (not SaveDialog.Execute) or (ExtractFileName(SaveDialog.Filename)='')
|
||||
then begin
|
||||
@ -3053,7 +3053,11 @@ begin
|
||||
SaveDialog.Free;
|
||||
end;
|
||||
|
||||
SrcEdit.ExportAsHtml(Filename);
|
||||
try
|
||||
SrcEdit.ExportAsHtml(Filename);
|
||||
except
|
||||
MessageDlg(lisFailedToSaveFile, mtError, [mbOK], 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuCloseClicked(Sender: TObject);
|
||||
|
@ -3773,13 +3773,16 @@ var
|
||||
Html: TSynExporterHTML;
|
||||
begin
|
||||
Html := TSynExporterHTML.Create(nil);
|
||||
Html.Clear;
|
||||
Html.ExportAsText := True;
|
||||
Html.Highlighter := FEditor.Highlighter;
|
||||
Html.Title := PageName;
|
||||
Html.ExportAll(FEditor.Lines);
|
||||
Html.SaveToFile(AFileName);
|
||||
Html.Free;
|
||||
try
|
||||
Html.Clear;
|
||||
Html.ExportAsText := True;
|
||||
Html.Highlighter := FEditor.Highlighter;
|
||||
Html.Title := PageName;
|
||||
Html.ExportAll(FEditor.Lines);
|
||||
Html.SaveToFile(AFileName);
|
||||
finally
|
||||
Html.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSourceEditor.FindHelpForSourceAtCursor;
|
||||
|
Loading…
Reference in New Issue
Block a user