Skip to content

Commit fa64c21

Browse files
Remove warnis and hint, Tested Delphi 13 compatibilty
1 parent b6a5834 commit fa64c21

5 files changed

Lines changed: 19 additions & 10 deletions

File tree

Src/uOpenOfficeEvents.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ interface
2424
type TBeforeSetValue = procedure (sender : TObject) of object;
2525
type TAfterGetValue = procedure (sender : TObject) of object;
2626
type TBeforeGetValue = procedure (sender : TObject) of object;
27+
2728
implementation
2829

2930
end.

Src/uOpenOfficeHelper.pas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ THelperOpenOffice_calc = class helper for TOpenOffice_calc
9595
implementation
9696

9797
uses
98-
System.Win.ComObj, System.Classes, Soap.EncdDecd;
98+
System.Win.ComObj, System.Classes, Soap.EncdDecd,
99+
System.NetEncoding;
99100

100101
function THelperOpenOffice_calc.addChart(aSettingsChart: TSettingsChart): TOpenOffice_calc;
101102
var
@@ -399,6 +400,7 @@ function THelperOpenOffice_calc.seTBorder(borderPosition: TBoderSheet; opColor:
399400
function THelperOpenOffice_calc.setCellWidth(const aWidth: integer): TOpenOffice_calc;
400401
begin
401402
Cell.getColumns.getByIndex(0).Width := aWidth;
403+
Result := Self;
402404
end;
403405

404406
function THelperOpenOffice_calc.setColor(aFontColor, aBackgroud: TOpenColor)
@@ -428,7 +430,7 @@ function THelperOpenOffice_calc.SheetToBase64(aPathFile:string): string;
428430
stream := TMemoryStream.Create;
429431
try
430432
stream.LoadFromFile(aPathFile);
431-
Result := EncodeBase64(stream.Memory, stream.Size);
433+
Result := String(EncodeBase64(stream.Memory, stream.Size));
432434
finally
433435
stream.Free;
434436
end;

Src/uOpenOffice_calc.pas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ function TOpenOffice_calc.RemoveSheet(const aSheetName: string):TOpenOffice_calc
162162
FobjDocument.Sheets.removeByName(aSheetName)
163163
else
164164
raise Exception.CreateFmt('A aba "%s" não existe no documento', [aSheetName]);
165+
166+
Result := Self;
165167
end;
166168

167169
function TOpenOffice_calc.RemoveSheet(aSheetIndex: Integer):TOpenOffice_calc;
@@ -175,6 +177,8 @@ function TOpenOffice_calc.RemoveSheet(aSheetIndex: Integer):TOpenOffice_calc;
175177
end
176178
else
177179
raise Exception.CreateFmt('Índice de aba inválido: %d', [aSheetIndex]);
180+
181+
Result := Self;
178182
end;
179183

180184
procedure TOpenOffice_calc.ValidateSheetName;
@@ -438,6 +442,7 @@ function TOpenOffice_calc.SheetToDataSet(const TabSheetName: String; TabSheetInd
438442
end;
439443

440444
Result.CreateDataSet;
445+
Result.Open;
441446
Result.DisableControls;
442447
Result.LogChanges := false;
443448
lCountRow := CountRow;
@@ -496,6 +501,7 @@ function TFieldsSheet.getIndex(aNameField: String): integer;
496501
rep,aux, firstIdx,
497502
secondIdx : integer;
498503
begin
504+
i := 0;
499505
Result := 0;
500506
rep := 26;
501507
aux := 0;

Src/uOpenOffice_writer.pas

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function TOpenOffice_writer.CreateTable(ATable: TTableWriter): TOpenOffice_write
173173
oTextTable: Variant;
174174
FoCursor: Variant;
175175
key, line, linesCol, numRows, numCols: Integer;
176-
lColl, lOutVal: string;
176+
lOutVal: string;
177177
lPair: TPair<TTableRowFields, TTableLinesValues>;
178178
lLines: TList<TLineFieldValue>;
179179
begin
@@ -220,7 +220,7 @@ function TOpenOffice_writer.CreateTable(ATable: TTableWriter): TOpenOffice_write
220220

221221
function TOpenOffice_writer.ClearSelection: TOpenOffice_writer;
222222
begin
223-
if not EnsureDocument then Exit;
223+
if not EnsureDocument then Exit(Self);
224224
try
225225
FoCursor := FobjDocument.getCurrentController.getViewCursor;
226226
if not (VarIsEmpty(FoCursor) or VarIsNull(FoCursor)) then
@@ -242,6 +242,8 @@ function TOpenOffice_writer.CreateTable(ATable: TFdMemTable): TOpenOffice_writer
242242
lTable: TTableWriter;
243243
lLog: Boolean;
244244
begin
245+
lLog := False;
246+
lRecNo := 0;
245247
ATable.DisableControls;
246248
lTable := TTableWriter.New;
247249
try
@@ -283,8 +285,9 @@ function TOpenOffice_writer.CreateTable(ATable: TClientDataset): TOpenOffice_wri
283285
lRecNo: Integer;
284286
lTable: TTableWriter;
285287
lLog: Boolean;
286-
lLines: TLineFieldValue;
287288
begin
289+
lRecNo := 0;
290+
lLog := False;
288291
ATable.DisableControls;
289292
lTable := TTableWriter.New;
290293
try
@@ -378,7 +381,7 @@ function TOpenOffice_writer.gotoStartOfSentence: TOpenOffice_writer;
378381

379382
function TOpenOffice_writer.setValue(const aText: string): TOpenOffice_writer;
380383
begin
381-
if not EnsureDocument or not EnsureTextCursor then Exit;
384+
if not EnsureDocument or not EnsureTextCursor then Exit(Self);
382385

383386
if Assigned(onBeforeSetValue) then
384387
onBeforeSetValue(self);
@@ -428,8 +431,6 @@ function TOpenOffice_writer.SelectTextRange(AStartPos, AEndPos: Integer): TOpenO
428431

429432
function TOpenOffice_writer.SelectBetweenText(AStartText, AEndText: string): TOpenOffice_writer;
430433
var
431-
oText: Variant;
432-
oCursor: Variant;
433434
lFullText: string;
434435
lStartPos, lEndPos: Integer;
435436
begin
@@ -503,7 +504,6 @@ function TOpenOffice_writer.startDoc: TOpenOffice_writer;
503504
function TOpenOffice_writer.SelectAllText: TOpenOffice_writer;
504505
var
505506
loController, loViewCursor: Variant;
506-
largs: array[0..0] of Variant;
507507
begin
508508
try
509509
loController := FobjDocument.getCurrentController;

samples/ConsoleApplication/prj/Console.dproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
33
<ProjectGuid>{A84F5597-3682-4168-91C0-875FF60EC095}</ProjectGuid>
4-
<ProjectVersion>20.1</ProjectVersion>
4+
<ProjectVersion>20.3</ProjectVersion>
55
<FrameworkType>None</FrameworkType>
66
<Base>True</Base>
77
<Config Condition="'$(Config)'==''">Debug</Config>

0 commit comments

Comments
 (0)