Skip to content

Commit

Permalink
Отмена 7dc55c8, правильный фикс #138
Browse files Browse the repository at this point in the history
  • Loading branch information
zamtmn committed Sep 14, 2024
1 parent 7dc55c8 commit 0dc5324
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
12 changes: 6 additions & 6 deletions cad_source/zcad/entities/uzcenitiesvariablesextender.pas
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ procedure TVariablesExtender.onEntityClone(pSourceEntity,pDestEntity:pointer);
var
pDestVariablesExtender,pbdunit:TVariablesExtender;
begin
pDestVariablesExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtension<TVariablesExtender>;
pDestVariablesExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtensionOf<TVariablesExtender>;
if pDestVariablesExtender=nil then
pDestVariablesExtender:=AddVariablesToEntity(pDestEntity);
entityunit.CopyTo(@pDestVariablesExtender.entityunit);
if pMainFuncEntity<>nil then begin
pbdunit:=pMainFuncEntity^.EntExtensions.GetExtension<TVariablesExtender>;
pbdunit:=pMainFuncEntity^.EntExtensions.GetExtensionOf<TVariablesExtender>;
if pbdunit<>nil then
pbdunit.addDelegate(pDestEntity,pDestVariablesExtender);
end;
Expand All @@ -278,7 +278,7 @@ procedure TVariablesExtender.onEntityBuildVarGeometry(pEntity:pointer;const draw
pblockdef:=PGDBObjBlockdefArray(drawing.GetBlockDefArraySimple).getDataMutable(PGDBObjDevice(pEntity)^.index);
pbdunit:=nil;
if assigned(pblockdef^.EntExtensions)then
pbdunit:=pblockdef^.EntExtensions.GetExtension<TVariablesExtender>;
pbdunit:=pblockdef^.EntExtensions.GetExtensionOf<TVariablesExtender>;
if pbdunit<>nil then
pbdunit.entityunit.CopyTo(@self.entityunit);
//PTEntityUnit(pblockdef^.ou.Instance)^.copyto(PTEntityUnit(ou.Instance));
Expand Down Expand Up @@ -330,10 +330,10 @@ procedure TVariablesExtender.ReorganizeEnts(OldEnts2NewEntsMap:TMapPointerToPoin
if pMainFuncEntity<>nil then begin
if OldEnts2NewEntsMap.TryGetValue(pMainFuncEntity,CopiedMainfunction)then
if CopiedMainfunction<>nil then begin
pbdunit:=pMainFuncEntity^.EntExtensions.GetExtension<TVariablesExtender>;
pbdunit:=pMainFuncEntity^.EntExtensions.GetExtensionOf<TVariablesExtender>;
if pbdunit<>nil then
pbdunit.removeDelegate(pThisEntity,self);
pbdunit:=CopiedMainfunction^.EntExtensions.GetExtension<TVariablesExtender>;
pbdunit:=CopiedMainfunction^.EntExtensions.GetExtensionOf<TVariablesExtender>;
if pbdunit<>nil then
pbdunit.addDelegate(pThisEntity,self);
end;
Expand Down Expand Up @@ -362,7 +362,7 @@ procedure TVariablesExtender.PostLoad(var context:TIODXFLoadContext);
if pThisEntity.PExtAttrib<>nil then
if pThisEntity.PExtAttrib^.MainFunctionHandle<>0 then begin
if context.h2p.TryGetValue(pThisEntity.PExtAttrib^.MainFunctionHandle,pmf)then begin
pbdunit:=pmf^.EntExtensions.GetExtension<TVariablesExtender>;
pbdunit:=pmf^.EntExtensions.GetExtensionOf<TVariablesExtender>;
if pbdunit<>nil then
pbdunit.addDelegate(pThisEntity,self);
end;
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/entities/uzcextdrlayercontrol.pas
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ procedure TLayerControlExtender.onEntityClone(pSourceEntity,pDestEntity:pointer)
var
pDestLayerControlExtender:TLayerControlExtender;
begin
pDestLayerControlExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtension<TLayerControlExtender>;
pDestLayerControlExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtensionOf<TLayerControlExtender>;
if pDestLayerControlExtender=nil then
pDestLayerControlExtender:=AddLayerControlExtenderToEntity(pDestEntity);
pDestLayerControlExtender.Assign(self);
Expand Down
4 changes: 2 additions & 2 deletions cad_source/zcad/entities/uzcextdrreport.pas
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ procedure TReportExtender.onEntityClone(pSourceEntity,pDestEntity:pointer);
var
ReportExtender:TReportExtender;
begin
ReportExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtension<TReportExtender>;
ReportExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtensionOf<TReportExtender>;
if ReportExtender=nil then
ReportExtender:=AddReportExtenderToEntity(pDestEntity);
ReportExtender.Assign(PGDBObjEntity(pSourceEntity)^.EntExtensions.GetExtension<TReportExtender>);
ReportExtender.Assign(PGDBObjEntity(pSourceEntity)^.EntExtensions.GetExtensionOf<TReportExtender>);
end;

procedure TReportExtender.onEntityBuildVarGeometry(pEntity:pointer;const drawing:TDrawingDef);
Expand Down
4 changes: 2 additions & 2 deletions cad_source/zcad/entities/uzcextdrschconnector.pas
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ procedure TSCHConnectorExtender.onEntityClone(pSourceEntity,pDestEntity:pointer)
var
NetConnectorExtender:TSCHConnectorExtender;
begin
NetConnectorExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtension<TSCHConnectorExtender>;
NetConnectorExtender:=PGDBObjEntity(pDestEntity)^.EntExtensions.GetExtensionOf<TSCHConnectorExtender>;
if NetConnectorExtender=nil then
NetConnectorExtender:=AddConnectorExtenderToEntity(pDestEntity);
NetConnectorExtender.Assign(PGDBObjEntity(pSourceEntity)^.EntExtensions.GetExtension<TSCHConnectorExtender>);
NetConnectorExtender.Assign(PGDBObjEntity(pSourceEntity)^.EntExtensions.GetExtensionOf<TSCHConnectorExtender>);
end;
procedure TSCHConnectorExtender.onEntityBuildVarGeometry(pEntity:pointer;const drawing:TDrawingDef);
begin
Expand Down
10 changes: 2 additions & 8 deletions cad_source/zcad/gui/odjectinspector/uzcoimultiobjects.pas
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,7 @@ procedure TMSEditor.CreateMultiPropertys;
for j:=0 to pv^.GetExtensionsCount-1 do begin
Extender:=pv^.GetExtension(j);
ObjIDWithExtender.ObjID:=pv^.GetObjType;
if Extender=nil then
ObjIDWithExtender.ExtenderClass:=nil
else
ObjIDWithExtender.ExtenderClass:=typeof(Extender);
ObjIDWithExtender.ExtenderClass:=typeof(Extender);
if MultiPropertiesManager.MultiPropertyVector[i].MPObjectsData.tryGetValue(ObjIDWithExtender,MultiPropertyDataForObjects)then begin
if @MultiPropertyDataForObjects.EntBeforeIterateProc<>nil then begin
ChangedData:=CreateChangedData(Extender,MultiPropertyDataForObjects.GSData);
Expand Down Expand Up @@ -582,10 +579,7 @@ procedure TMSEditor.CreateMultiPropertys;
for j:=0 to pv^.GetExtensionsCount-1 do begin
Extender:=pv^.GetExtension(j);
ObjIDWithExtender.ObjID:=pv^.GetObjType;
if Extender=nil then
ObjIDWithExtender.ExtenderClass:=nil
else
ObjIDWithExtender.ExtenderClass:=typeof(Extender);
ObjIDWithExtender.ExtenderClass:=typeof(Extender);
if MultiPropertiesManager.MultiPropertyVector[i].MPObjectsData.tryGetValue(ObjIDWithExtender,MultiPropertyDataForObjects)then begin
if @MultiPropertyDataForObjects.EntIterateProc<>nil then begin
ChangedData:=CreateChangedData(Extender,MultiPropertyDataForObjects.GSData);
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zengine/core/entities/uzeentsubordinated.pas
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ procedure GDBObjExtendable.RemoveExtension(ExtType:TMetaEntityExtender);
function GDBObjExtendable.GetExtension<GEntityExtenderType>:GEntityExtenderType;
begin
if assigned(EntExtensions) then
result:=EntExtensions.GetExtension<GEntityExtenderType>
result:=EntExtensions.GetExtensionOf<GEntityExtenderType>
else
result:=nil;
end;
Expand Down

0 comments on commit 0dc5324

Please sign in to comment.