Main Windows: allow the "Save" action to also work for XSD files.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5274 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa 2016-10-20 11:54:13 +00:00
parent 69bca65173
commit e5fdfc382c
2 changed files with 5 additions and 3 deletions

View File

@ -12,7 +12,7 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
OnDropFiles = FormDropFiles
OnShow = FormShow
Position = poDesktopCenter
LCLVersion = '1.4.1.0'
LCLVersion = '1.6.1.0'
object SB: TStatusBar
Left = 0
Height = 20

View File

@ -668,13 +668,15 @@ end;
procedure TfWstTypeLibraryEdit.actSaveXSDExecute(Sender : TObject);
var
oldFilter : string;
oldFilter, locFileName : string;
begin
oldFilter := SD.Filter;
SD.Filter := 'XSD files ( *.xsd )|*.xsd';
try
if SD.Execute() then begin
SaveToFile(ChangeFileExt(SD.FileName,'.xsd'));
locFileName := ChangeFileExt(SD.FileName,'.xsd');
SaveToFile(locFileName);
FCurrentFileName := locFileName;
end;
finally
SD.Filter := oldFilter;