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)
|
||||
private
|
||||
{ Private declarations }
|
||||
FFileName:string;
|
||||
RTF: TMemoryStream;
|
||||
FontTable: TStringList;
|
||||
procedure StreamWriteStr(var ms: TMemoryStream; s: string);
|
||||
@ -276,8 +275,10 @@ PtrRec = record
|
||||
Lo: Word;
|
||||
Hi: Word;
|
||||
end;
|
||||
|
||||
PHugeByteArray = ^THugeByteArray;
|
||||
THugeByteArray = array[0..0] of Byte;
|
||||
|
||||
function GetBigPointer(lp: pointer; Offset: LongInt): Pointer;
|
||||
begin
|
||||
{$IFDEF WIN32}
|
||||
@ -287,19 +288,19 @@ Offset := Offset + PTRREC(lp).Lo;
|
||||
GetBigPointer := Ptr(PtrRec(lp).Hi + PtrRec(Offset).Hi * SelectorInc, PtrRec(Offset).Lo);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
var
|
||||
hmf,hGlobal:THandle;
|
||||
i,j: integer;
|
||||
hmf: THandle;
|
||||
FCanvas: TCanvas;
|
||||
lpBits: pointer;
|
||||
dwSize,count:LongInt;
|
||||
Ch:char;
|
||||
dwSize: LongInt;
|
||||
h, h1, w, w1: double;
|
||||
TempBuf:PChar;
|
||||
Align: string;
|
||||
pPPoint: PPoint;
|
||||
pPSize: PSize;
|
||||
begin
|
||||
dwSize := 0;
|
||||
|
||||
FCanvas := TCanvas.Create;
|
||||
FCanvas.Handle := CreateMetafile(nil);
|
||||
SetMapMode(FCanvas.Handle, mm_AnIsoTropic);
|
||||
@ -370,7 +371,7 @@ end;
|
||||
end;
|
||||
|
||||
procedure TCtrlToRTF.LabelToRTF(pLabel: TLabel);
|
||||
var i:Integer;
|
||||
var
|
||||
Align, FontColor, FontAttrib, FontSize, FontName: String;
|
||||
begin
|
||||
Align := GetRTFAlignment(pLabel.Alignment);
|
||||
@ -382,7 +383,7 @@ StreamWriteStr(RTF,'\par \pard'+Align+'\plain'+FontName+FontSize+FontAttrib+Font
|
||||
end;
|
||||
|
||||
procedure TCtrlToRTF.TextBufToRTF(TextBuf: pointer; size: word; Font: TFont; Alignment: TAlignment);
|
||||
var i:Integer;
|
||||
var
|
||||
Align, FontColor, FontAttrib, FontSize, FontName: String;
|
||||
begin
|
||||
Align := GetRTFAlignment(Alignment);
|
||||
@ -524,7 +525,7 @@ end;
|
||||
procedure TCtrlToRTF.AddFontToTable(Font: TFont);
|
||||
var DC: HDC;
|
||||
SaveFont: HFont;
|
||||
SysMetrics, Metrics: TTextMetric;
|
||||
Metrics: TTextMetric;
|
||||
Temp: byte;
|
||||
I: Integer;
|
||||
charset, family: string;
|
||||
|
||||
@ -22,9 +22,6 @@ procedure DesconectarTabla (ATarget: TDADataTable);
|
||||
procedure CopyDataTableDA5(ASource : TDADataTable; ATarget: TDADataTable;
|
||||
const OnlySelectedRows : Boolean = False);
|
||||
|
||||
procedure CopyDataTableDA3(ASource : TDADataTable; ATarget : TDADataTable;
|
||||
const OnlySelectedRows : Boolean = False);
|
||||
|
||||
procedure CloneDataTable(const ASource : TDACDSDataTable;
|
||||
var ATarget : TDACDSDataTable;
|
||||
RemoteUpdate: Boolean = True); overload;
|
||||
@ -344,89 +341,6 @@ begin
|
||||
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);
|
||||
var
|
||||
i, j: Integer;
|
||||
|
||||
@ -26,7 +26,7 @@ begin
|
||||
if StrIsDigit(Aux1) and StrIsDigit(Aux2) then
|
||||
Result := VarCompare(StrToIntSafe(Aux1), StrToIntSafe(Aux2))
|
||||
else
|
||||
VarCompare(Aux1, Aux2)
|
||||
Result := VarCompare(Aux1, Aux2)
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user