You've already forked lazarus-ccr
Spready: Update to improved handling of encrypted files introduced in recent fpspreadsheet commits.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8914 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -8,12 +8,13 @@ object MainForm: TMainForm
|
|||||||
ClientHeight = 709
|
ClientHeight = 709
|
||||||
ClientWidth = 1120
|
ClientWidth = 1120
|
||||||
Menu = MainMenu
|
Menu = MainMenu
|
||||||
|
OnActivate = FormActivate
|
||||||
OnCloseQuery = FormCloseQuery
|
OnCloseQuery = FormCloseQuery
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDropFiles = FormDropFiles
|
OnDropFiles = FormDropFiles
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '2.3.0.0'
|
LCLVersion = '3.99.0.0'
|
||||||
object WorkbookTabControl: TsWorkbookTabControl
|
object WorkbookTabControl: TsWorkbookTabControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 629
|
Height = 629
|
||||||
|
@@ -8,10 +8,12 @@ uses
|
|||||||
Classes, SysUtils, FileUtil, mrumanager, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, mrumanager, Forms, Controls, Graphics, Dialogs,
|
||||||
ExtCtrls, ComCtrls, ActnList, Menus, StdActns, Buttons, Grids, StdCtrls,
|
ExtCtrls, ComCtrls, ActnList, Menus, StdActns, Buttons, Grids, StdCtrls,
|
||||||
types, fpstypes, fpspreadsheet, fpspreadsheetctrls, fpspreadsheetgrid,
|
types, fpstypes, fpspreadsheet, fpspreadsheetctrls, fpspreadsheetgrid,
|
||||||
fpsActions, fpsAllFormats, fpsSYLK, xlsBIFF34, xlsxml, xlsxooxml_crypto;
|
fpsActions, {%H-}fpsAllFormats, fpsSYLK, xlsBIFF34, xlsxml,
|
||||||
|
xlsxooxml_crypto, fpsOpenDocument_crypto;
|
||||||
// NOTE:
|
// NOTE:
|
||||||
// In order to use the decrypting xlsx reader put xlsxooxlm_cryto after
|
// In order to use the decrypting xlsx and ods readers put
|
||||||
// xlsxooxml or fpsAllforamts.
|
// xlsxooxlm_crypto and fpsOpenDocument_crypto after all other reader/writer
|
||||||
|
// units.
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@@ -520,6 +522,7 @@ type
|
|||||||
procedure AcZoomMoreExecute(Sender: TObject);
|
procedure AcZoomMoreExecute(Sender: TObject);
|
||||||
procedure EditCut1Execute(Sender: TObject);
|
procedure EditCut1Execute(Sender: TObject);
|
||||||
procedure ColorComboboxAddColors(Sender: TObject);
|
procedure ColorComboboxAddColors(Sender: TObject);
|
||||||
|
procedure FormActivate(Sender: TObject);
|
||||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
|
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
|
||||||
@@ -536,10 +539,10 @@ type
|
|||||||
procedure WorksheetGridMouseWheel(Sender: TObject; Shift: TShiftState;
|
procedure WorksheetGridMouseWheel(Sender: TObject; Shift: TShiftState;
|
||||||
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
|
||||||
FOpenFormats: TsSpreadFormatIDArray;
|
FOpenFormats: TsSpreadFormatIDArray;
|
||||||
FSaveFormats: TsSpreadFormatIDArray;
|
FSaveFormats: TsSpreadFormatIDArray;
|
||||||
FMRUMenuManager: TMRUMenuManager;
|
FMRUMenuManager: TMRUMenuManager;
|
||||||
|
FActivated: Boolean;
|
||||||
procedure LoadFile(const AFileName: String);
|
procedure LoadFile(const AFileName: String);
|
||||||
procedure MRUMenuManagerRecentFile(Sender: TObject; const AFileName: string);
|
procedure MRUMenuManagerRecentFile(Sender: TObject; const AFileName: string);
|
||||||
procedure SearchClose(Sender: TObject; var CloseAction: TCloseAction);
|
procedure SearchClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
@@ -552,8 +555,6 @@ type
|
|||||||
procedure ReadFromIni;
|
procedure ReadFromIni;
|
||||||
procedure WriteToIni;
|
procedure WriteToIni;
|
||||||
public
|
public
|
||||||
{ public declarations }
|
|
||||||
procedure BeforeRun;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@@ -1217,11 +1218,6 @@ begin
|
|||||||
AcWorksheetProtection.Checked := WorkbookSource.Worksheet.IsProtected;
|
AcWorksheetProtection.Checked := WorkbookSource.Worksheet.IsProtected;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.BeforeRun;
|
|
||||||
begin
|
|
||||||
ReadFromIni;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMainForm.ColorComboboxAddColors(Sender: TObject);
|
procedure TMainForm.ColorComboboxAddColors(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
with TsCellCombobox(Sender) do begin
|
with TsCellCombobox(Sender) do begin
|
||||||
@@ -1279,6 +1275,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.FormActivate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not FActivated then
|
||||||
|
begin
|
||||||
|
FActivated := true;
|
||||||
|
ReadFromIni;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.EditCut1Execute(Sender: TObject);
|
procedure TMainForm.EditCut1Execute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
//
|
//
|
||||||
@@ -1311,14 +1316,15 @@ begin
|
|||||||
OnRecentFile := @MRUMenuManagerRecentFile;
|
OnRecentFile := @MRUMenuManagerRecentFile;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
priorityFormatsR[0] := ord(sfOOXML);
|
// These are the formats used in the FileDialogs
|
||||||
|
priorityFormatsR[0] := sfidOOXML_crypto; //ord(sfOOXML);
|
||||||
priorityFormatsR[1] := ord(sfExcel8);
|
priorityFormatsR[1] := ord(sfExcel8);
|
||||||
priorityFormatsR[2] := ord(sfExcel5);
|
priorityFormatsR[2] := ord(sfExcel5);
|
||||||
priorityFormatsR[3] := sfidExcel4;
|
priorityFormatsR[3] := sfidExcel4;
|
||||||
priorityFormatsR[4] := sfidExcel3;
|
priorityFormatsR[4] := sfidExcel3;
|
||||||
priorityFormatsR[5] := ord(sfExcel2);
|
priorityFormatsR[5] := ord(sfExcel2);
|
||||||
priorityFormatsR[6] := ord(sfExcelXML);
|
priorityFormatsR[6] := ord(sfExcelXML);
|
||||||
priorityFormatsR[7] := ord(sfOpenDocument);
|
priorityFormatsR[7] := sfidOpenDocument_crypto; //ord(sfOpenDocument);
|
||||||
priorityFormatsR[8] := ord(sfCSV);
|
priorityFormatsR[8] := ord(sfCSV);
|
||||||
priorityFormatsR[9] := sfidSYLK;
|
priorityFormatsR[9] := sfidSYLK;
|
||||||
priorityFormatsR[10] := ord(sfHTML);
|
priorityFormatsR[10] := ord(sfHTML);
|
||||||
@@ -1336,9 +1342,14 @@ begin
|
|||||||
|
|
||||||
AcFileOpen.Dialog.Filter := GetFileFormatFilter('|', ';', faRead, priorityFormatsR, true, true);
|
AcFileOpen.Dialog.Filter := GetFileFormatFilter('|', ';', faRead, priorityFormatsR, true, true);
|
||||||
FOpenFormats := GetSpreadFormats(faRead, priorityFormatsR);
|
FOpenFormats := GetSpreadFormats(faRead, priorityFormatsR);
|
||||||
// Use decrypting XLSX format instead of normal XLSX format
|
(*
|
||||||
|
// Use decrypting XLSX and ODS formats instead of normal XLSX/ODS formats
|
||||||
for i:=0 to High(FOpenFormats) do
|
for i:=0 to High(FOpenFormats) do
|
||||||
if FOpenFormats[i] = ord(sfOOXML) then FOpenFormats[i] := sfidOOXML_Crypto;
|
case FOpenFormats[i] of
|
||||||
|
ord(sfOOXML): FOpenFormats[i] := sfidOOXML_Crypto;
|
||||||
|
ord(sfOpenDocument): FOpenFormats[i] := sfidOpenDocument_Crypto;
|
||||||
|
end;
|
||||||
|
*)
|
||||||
|
|
||||||
AcFileSaveAs.Dialog.Filter := GetFileFormatFilter('|', ';', faWrite, priorityFormatsW);
|
AcFileSaveAs.Dialog.Filter := GetFileFormatFilter('|', ';', faWrite, priorityFormatsW);
|
||||||
FSaveFormats := GetSpreadFormats(faWrite, priorityFormatsW);
|
FSaveFormats := GetSpreadFormats(faWrite, priorityFormatsW);
|
||||||
|
@@ -16,7 +16,6 @@ begin
|
|||||||
Application.Scaled:=True;
|
Application.Scaled:=True;
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TMainForm, MainForm);
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
MainForm.BeforeRun;
|
|
||||||
Application.CreateForm(TZoomForm, ZoomForm);
|
Application.CreateForm(TZoomForm, ZoomForm);
|
||||||
Application.Run;
|
Application.Run;
|
||||||
end.
|
end.
|
||||||
|
Reference in New Issue
Block a user