From 7267e70d32ec8f33e45058d7b286d8fe8bb2e7f9 Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 1 Mar 2013 02:35:31 +0000 Subject: [PATCH] LazReport, make editor sample to find it's data under Mac git-svn-id: trunk@40451 - --- .../samples/editor/maincalleditor.pas | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/components/lazreport/samples/editor/maincalleditor.pas b/components/lazreport/samples/editor/maincalleditor.pas index 7fe11e0f6a..7e15e10891 100644 --- a/components/lazreport/samples/editor/maincalleditor.pas +++ b/components/lazreport/samples/editor/maincalleditor.pas @@ -399,27 +399,34 @@ const var i: integer; r: TfrReport; + dataPath: string; begin UpdateAppTranslation; + dataPath := ExtractFilePath(ParamStr(0)); + {$ifdef Darwin} + dataPath := IncludeTrailingPathDelimiter(ExpandFileName(dataPath + '../../..')); + {$endif} + LookCountries.Close; - LookCountries.FilePath := 'db/'; + LookCountries.FilePath := datapath + 'db/'; LookCountries.TableName := 'countries.dbf'; LookCountries.open; LookCompanies.Close; - LookCompanies.FilePath := 'db/'; + LookCompanies.FilePath := datapath + 'db/'; LookCompanies.TableName := 'companies.dbf'; LookCompanies.Open; Detail.close; - Detail.FilePath := 'db/'; + Detail.FilePath := datapath + 'db/'; Detail.TableName := 'disco.dbf'; Detail.open; Master.Close; - Master.TableName := 'db/countries.dbf'; + Master.FilePath := datapath + 'db/'; + Master.TableName := 'countries.dbf'; comboIndex.Clear; comboIndex.Items.Add(cerNone); @@ -428,8 +435,8 @@ begin FCountryIndex := ComboIndex.Items.IndexOf('BYCOUNTRY'); SetIndex(''); - if FileExistsUTF8(ExtractFilePath(ParamStrUTF8(0))+'salida.lrf') then - OpenReport(ExtractFilePath(ParamStrUTF8(0))+'salida.lrf'); + if FileExistsUTF8(datapath + 'salida.lrf') then + OpenReport(datapath + 'salida.lrf'); for i:=Low(rptArr) to High(rptArr) do begin r := TfrReport.Create(self); @@ -438,7 +445,7 @@ begin end; Composite.DoublePass:=true; - frSelectHyphenDictionary('hyph_es_ANY.dic'); + frSelectHyphenDictionary(dataPath + 'hyph_es_ANY.dic'); end; procedure TfrmMain.TheReportBeginDoc;