Limpieza de código y de mensajes de warning
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@489 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
75215a1af9
commit
0d4cc87c6c
@ -48,7 +48,6 @@ type
|
|||||||
TCtrlToRTF = class(TComponent)
|
TCtrlToRTF = class(TComponent)
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
FFileName:string;
|
|
||||||
RTF: TMemoryStream;
|
RTF: TMemoryStream;
|
||||||
FontTable: TStringList;
|
FontTable: TStringList;
|
||||||
procedure StreamWriteStr(var ms: TMemoryStream; s: string);
|
procedure StreamWriteStr(var ms: TMemoryStream; s: string);
|
||||||
@ -276,8 +275,10 @@ PtrRec = record
|
|||||||
Lo: Word;
|
Lo: Word;
|
||||||
Hi: Word;
|
Hi: Word;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
PHugeByteArray = ^THugeByteArray;
|
PHugeByteArray = ^THugeByteArray;
|
||||||
THugeByteArray = array[0..0] of Byte;
|
THugeByteArray = array[0..0] of Byte;
|
||||||
|
|
||||||
function GetBigPointer(lp: pointer; Offset: LongInt): Pointer;
|
function GetBigPointer(lp: pointer; Offset: LongInt): Pointer;
|
||||||
begin
|
begin
|
||||||
{$IFDEF WIN32}
|
{$IFDEF WIN32}
|
||||||
@ -287,19 +288,19 @@ Offset := Offset + PTRREC(lp).Lo;
|
|||||||
GetBigPointer := Ptr(PtrRec(lp).Hi + PtrRec(Offset).Hi * SelectorInc, PtrRec(Offset).Lo);
|
GetBigPointer := Ptr(PtrRec(lp).Hi + PtrRec(Offset).Hi * SelectorInc, PtrRec(Offset).Lo);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
hmf,hGlobal:THandle;
|
hmf: THandle;
|
||||||
i,j: integer;
|
|
||||||
FCanvas: TCanvas;
|
FCanvas: TCanvas;
|
||||||
lpBits: pointer;
|
lpBits: pointer;
|
||||||
dwSize,count:LongInt;
|
dwSize: LongInt;
|
||||||
Ch:char;
|
|
||||||
h, h1, w, w1: double;
|
h, h1, w, w1: double;
|
||||||
TempBuf:PChar;
|
|
||||||
Align: string;
|
Align: string;
|
||||||
pPPoint: PPoint;
|
pPPoint: PPoint;
|
||||||
pPSize: PSize;
|
pPSize: PSize;
|
||||||
begin
|
begin
|
||||||
|
dwSize := 0;
|
||||||
|
|
||||||
FCanvas := TCanvas.Create;
|
FCanvas := TCanvas.Create;
|
||||||
FCanvas.Handle := CreateMetafile(nil);
|
FCanvas.Handle := CreateMetafile(nil);
|
||||||
SetMapMode(FCanvas.Handle, mm_AnIsoTropic);
|
SetMapMode(FCanvas.Handle, mm_AnIsoTropic);
|
||||||
@ -370,7 +371,7 @@ end;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCtrlToRTF.LabelToRTF(pLabel: TLabel);
|
procedure TCtrlToRTF.LabelToRTF(pLabel: TLabel);
|
||||||
var i:Integer;
|
var
|
||||||
Align, FontColor, FontAttrib, FontSize, FontName: String;
|
Align, FontColor, FontAttrib, FontSize, FontName: String;
|
||||||
begin
|
begin
|
||||||
Align := GetRTFAlignment(pLabel.Alignment);
|
Align := GetRTFAlignment(pLabel.Alignment);
|
||||||
@ -382,7 +383,7 @@ StreamWriteStr(RTF,'\par \pard'+Align+'\plain'+FontName+FontSize+FontAttrib+Font
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCtrlToRTF.TextBufToRTF(TextBuf: pointer; size: word; Font: TFont; Alignment: TAlignment);
|
procedure TCtrlToRTF.TextBufToRTF(TextBuf: pointer; size: word; Font: TFont; Alignment: TAlignment);
|
||||||
var i:Integer;
|
var
|
||||||
Align, FontColor, FontAttrib, FontSize, FontName: String;
|
Align, FontColor, FontAttrib, FontSize, FontName: String;
|
||||||
begin
|
begin
|
||||||
Align := GetRTFAlignment(Alignment);
|
Align := GetRTFAlignment(Alignment);
|
||||||
@ -524,7 +525,7 @@ end;
|
|||||||
procedure TCtrlToRTF.AddFontToTable(Font: TFont);
|
procedure TCtrlToRTF.AddFontToTable(Font: TFont);
|
||||||
var DC: HDC;
|
var DC: HDC;
|
||||||
SaveFont: HFont;
|
SaveFont: HFont;
|
||||||
SysMetrics, Metrics: TTextMetric;
|
Metrics: TTextMetric;
|
||||||
Temp: byte;
|
Temp: byte;
|
||||||
I: Integer;
|
I: Integer;
|
||||||
charset, family: string;
|
charset, family: string;
|
||||||
|
|||||||
@ -22,9 +22,6 @@ procedure DesconectarTabla (ATarget: TDADataTable);
|
|||||||
procedure CopyDataTableDA5(ASource : TDADataTable; ATarget: TDADataTable;
|
procedure CopyDataTableDA5(ASource : TDADataTable; ATarget: TDADataTable;
|
||||||
const OnlySelectedRows : Boolean = False);
|
const OnlySelectedRows : Boolean = False);
|
||||||
|
|
||||||
procedure CopyDataTableDA3(ASource : TDADataTable; ATarget : TDADataTable;
|
|
||||||
const OnlySelectedRows : Boolean = False);
|
|
||||||
|
|
||||||
procedure CloneDataTable(const ASource : TDACDSDataTable;
|
procedure CloneDataTable(const ASource : TDACDSDataTable;
|
||||||
var ATarget : TDACDSDataTable;
|
var ATarget : TDACDSDataTable;
|
||||||
RemoteUpdate: Boolean = True); overload;
|
RemoteUpdate: Boolean = True); overload;
|
||||||
@ -344,89 +341,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure CopyDataTableDA3(ASource : TDADataTable; ATarget : TDADataTable;
|
|
||||||
const OnlySelectedRows : Boolean = False);
|
|
||||||
var
|
|
||||||
DABin: Binary;
|
|
||||||
DAAdapter : TDABINAdapter;
|
|
||||||
AFilter : String;
|
|
||||||
AFiltered : Boolean;
|
|
||||||
AObj : ISeleccionable;
|
|
||||||
i : Integer;
|
|
||||||
begin
|
|
||||||
AFilter := '';
|
|
||||||
AFiltered := False;
|
|
||||||
|
|
||||||
if OnlySelectedRows then
|
|
||||||
begin
|
|
||||||
if not Supports(ASource, ISeleccionable, aObj) then
|
|
||||||
raise Exception.Create('El origen de datos no soporta la interfaz ISeleccionable (CopyDataTable)');
|
|
||||||
|
|
||||||
if ASource.Filtered then
|
|
||||||
begin
|
|
||||||
AFiltered := True;
|
|
||||||
AFilter := ASource.Filter;
|
|
||||||
ASource.Filtered := False;
|
|
||||||
end;
|
|
||||||
|
|
||||||
ASource.Filter := '';
|
|
||||||
if ASource.Active then
|
|
||||||
ASource.Close;
|
|
||||||
|
|
||||||
//Si no hay elemento seleccionados filtramos para que ATarget se quede vacia
|
|
||||||
if (AObj.SelectedRecords.Count = 0) then
|
|
||||||
ASource.Filter := ASource.Filter + '(ID = ' + IntToStr(ID_NULO) + ')'
|
|
||||||
//En caso contrario filtramos por los elementos seleccionados
|
|
||||||
else
|
|
||||||
for i := 0 to AObj.SelectedRecords.Count - 1 do
|
|
||||||
begin
|
|
||||||
if (i > 0) then
|
|
||||||
ASource.Filter := ASource.Filter + ' or ';
|
|
||||||
ASource.Filter := ASource.Filter + '(ID = ' + IntToStr(AObj.SelectedRecords.Items[i]) + ')';
|
|
||||||
end;
|
|
||||||
|
|
||||||
ASource.Filtered := True;
|
|
||||||
end;
|
|
||||||
|
|
||||||
DABin := Binary.Create;
|
|
||||||
DAAdapter := TDABINAdapter.Create(nil);
|
|
||||||
|
|
||||||
ShowHourglassCursor;
|
|
||||||
ASource.DisableControls;
|
|
||||||
ATarget.DisableControls;
|
|
||||||
try
|
|
||||||
ATarget.LogicalName := ASource.LogicalName; // We need to specify new dataset LogicalName
|
|
||||||
ATarget.RemoteFetchEnabled := False; // "Desconectamos" la tabla destino del servidor
|
|
||||||
|
|
||||||
if not ASource.Active then
|
|
||||||
ASource.Open;
|
|
||||||
ASource.First;
|
|
||||||
|
|
||||||
DAAdapter.WriteDataset(DABin, ASource, [woRows]);
|
|
||||||
DAAdapter.ReadDataset(DABin, ATarget);
|
|
||||||
DAAdapter.Finalize;
|
|
||||||
|
|
||||||
|
|
||||||
ATarget.RemoteFetchEnabled := True; // "Conectamos" la tabla del servidor otra vez
|
|
||||||
|
|
||||||
// Dejar el filtro de la tabla origen como estaba
|
|
||||||
if OnlySelectedRows then
|
|
||||||
begin
|
|
||||||
ASource.Filtered := False;
|
|
||||||
ASource.Filter := AFilter;
|
|
||||||
if AFiltered then
|
|
||||||
ASource.Filtered := True;
|
|
||||||
end;
|
|
||||||
|
|
||||||
finally
|
|
||||||
FreeAndNil(DABin);
|
|
||||||
FreeAndNil(DAAdapter);
|
|
||||||
ASource.EnableControls;
|
|
||||||
ATarget.EnableControls;
|
|
||||||
HideHourglassCursor;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure DuplicarRegistro(ASource : TDADataTable; ATarget : TDADataTable; Const WithPKKey: Boolean = False; Const WithFKKey: Boolean = False);
|
procedure DuplicarRegistro(ASource : TDADataTable; ATarget : TDADataTable; Const WithPKKey: Boolean = False; Const WithFKKey: Boolean = False);
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
|
|||||||
@ -26,7 +26,7 @@ begin
|
|||||||
if StrIsDigit(Aux1) and StrIsDigit(Aux2) then
|
if StrIsDigit(Aux1) and StrIsDigit(Aux2) then
|
||||||
Result := VarCompare(StrToIntSafe(Aux1), StrToIntSafe(Aux2))
|
Result := VarCompare(StrToIntSafe(Aux1), StrToIntSafe(Aux2))
|
||||||
else
|
else
|
||||||
VarCompare(Aux1, Aux2)
|
Result := VarCompare(Aux1, Aux2)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user