mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:19:32 +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';
|
lisSavedWithProjectSession = 'Saved with project session';
|
||||||
lisSavedWithIDESettings = 'Saved with IDE settings';
|
lisSavedWithIDESettings = 'Saved with IDE settings';
|
||||||
lisMoveTo = 'Move to: ';
|
lisMoveTo = 'Move to: ';
|
||||||
|
lisFailedToSaveFile = 'Failed to save file,';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@ -3042,7 +3042,7 @@ begin
|
|||||||
SaveDialog.Title:=lisSaveSpace;
|
SaveDialog.Title:=lisSaveSpace;
|
||||||
SaveDialog.FileName:=SrcEdit.PageName+'.html';
|
SaveDialog.FileName:=SrcEdit.PageName+'.html';
|
||||||
SaveDialog.Filter := ' (*.html;*.htm)|*.html;*.htm';
|
SaveDialog.Filter := ' (*.html;*.htm)|*.html;*.htm';
|
||||||
SaveDialog.Options := [ofOverwritePrompt, ofPathMustExist, ofNoReadOnlyReturn];
|
SaveDialog.Options := [ofOverwritePrompt, ofPathMustExist{, ofNoReadOnlyReturn}]; // Does not work for desktop
|
||||||
// show save dialog
|
// show save dialog
|
||||||
if (not SaveDialog.Execute) or (ExtractFileName(SaveDialog.Filename)='')
|
if (not SaveDialog.Execute) or (ExtractFileName(SaveDialog.Filename)='')
|
||||||
then begin
|
then begin
|
||||||
@ -3053,7 +3053,11 @@ begin
|
|||||||
SaveDialog.Free;
|
SaveDialog.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SrcEdit.ExportAsHtml(Filename);
|
try
|
||||||
|
SrcEdit.ExportAsHtml(Filename);
|
||||||
|
except
|
||||||
|
MessageDlg(lisFailedToSaveFile, mtError, [mbOK], 0);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.mnuCloseClicked(Sender: TObject);
|
procedure TMainIDE.mnuCloseClicked(Sender: TObject);
|
||||||
|
@ -3773,13 +3773,16 @@ var
|
|||||||
Html: TSynExporterHTML;
|
Html: TSynExporterHTML;
|
||||||
begin
|
begin
|
||||||
Html := TSynExporterHTML.Create(nil);
|
Html := TSynExporterHTML.Create(nil);
|
||||||
Html.Clear;
|
try
|
||||||
Html.ExportAsText := True;
|
Html.Clear;
|
||||||
Html.Highlighter := FEditor.Highlighter;
|
Html.ExportAsText := True;
|
||||||
Html.Title := PageName;
|
Html.Highlighter := FEditor.Highlighter;
|
||||||
Html.ExportAll(FEditor.Lines);
|
Html.Title := PageName;
|
||||||
Html.SaveToFile(AFileName);
|
Html.ExportAll(FEditor.Lines);
|
||||||
Html.Free;
|
Html.SaveToFile(AFileName);
|
||||||
|
finally
|
||||||
|
Html.Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceEditor.FindHelpForSourceAtCursor;
|
procedure TSourceEditor.FindHelpForSourceAtCursor;
|
||||||
|
Loading…
Reference in New Issue
Block a user