RMレポート、保存をクリックします.なぜ毎回名前を付けて保存するダイアログボックスが表示されますか?

3608 ワード

function TRMDesignerForm.FileSave: Boolean;

var

  lSaved: Boolean;

  lFileName: string;

begin

  Result := False;

  if DesignerRestrictions * [rmdrDontSaveReport] <> [] then Exit;



  if not FCodeMemo.ReadOnly then

    Report.Script.Assign(FCodeMemo.CreateStringList);



  UseDefaultSave := True;

  if (not (csDesigning in Report.ComponentState)) and (RMDesignerComp <> nil) and

    Assigned(RMDesignerComp.OnSaveReport) then //  

  begin

    lFileName := CurDocName; lSaved := True;

    RMDesignerComp.OnSaveReport(Report, lFileName, False, lSaved);

    if lSaved then

    begin

      Modified := False;

      CurDocName := lFileName;

      Result := True;

    end;

  end;



  if (not Result) and UseDefaultSave then

  begin

    if AnsiCompareText(FCurDocName, RMLoadStr(SUntitled)) <> 0 then // ,   

    begin

      Report.SaveToFile(FCurDocName);

      Modified := False;

      SetOpenFileMenuItems(FCurDocName);

      Result := True;

    end

    else

      Result := FileSaveAs;  // ,   
end; if Result then begin ClearUndoBuffer; ClearRedoBuffer; end; end;