IDE: Export to html, do not enforce check for writeable. Issue #0022588

git-svn-id: trunk@38198 -
This commit is contained in:
martin 2012-08-07 21:40:54 +00:00
parent df7a7d6acc
commit c0c7de3fea
3 changed files with 17 additions and 9 deletions

View File

@ -5564,6 +5564,7 @@ resourcestring
lisSavedWithProjectSession = 'Saved with project session';
lisSavedWithIDESettings = 'Saved with IDE settings';
lisMoveTo = 'Move to: ';
lisFailedToSaveFile = 'Failed to save file,';
implementation

View File

@ -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);

View File

@ -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;