Skip to content

Commit bbcef5d

Browse files
Implemented JAM-Software#471: Add emVisibleDueToExpansion and emSelected to TVTExportMode
1 parent 4adfbf1 commit bbcef5d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Source/VirtualTrees.pas

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,9 @@ EVirtualTreeError = class(Exception);
584584
TVTExportMode = (
585585
emAll, // export all records (regardless checked state)
586586
emChecked, // export checked records only
587-
emUnchecked // export unchecked records only
587+
emUnchecked, // export unchecked records only
588+
emVisibleDueToExpansion, //Do not export nodes that are not visible because their parent is not expanded
589+
emSelected // export selected nodes only
588590
);
589591

590592
// Kinds of operations
@@ -36711,15 +36713,20 @@ function TCustomVirtualStringTree.ContentToHTML(Source: TVSTTextSourceType; Capt
3671136713

3671236714
//----------------------------------------------------------------------------------------------------------------------
3671336715

36714-
function TCustomVirtualStringTree.CanExportNode(Node: PVirtualNode ): Boolean;
36716+
function TCustomVirtualStringTree.CanExportNode(Node: PVirtualNode): Boolean;
3671536717

3671636718
begin
36717-
Result := True;
3671836719
case FOptions.ExportMode of
3671936720
emChecked:
3672036721
Result := Node.CheckState = csCheckedNormal;
3672136722
emUnchecked:
3672236723
Result := Node.CheckState = csUncheckedNormal;
36724+
emVisibleDueToExpansion: //Do not export nodes that are not visible because their parent is not expanded
36725+
Result := not Assigned(Node.Parent) or Self.Expanded[Node.Parent];
36726+
emSelected: // export selected nodes only
36727+
Result := Selected[Node];
36728+
else
36729+
Result := True;
3672336730
end;
3672436731
end;
3672536732

0 commit comments

Comments
 (0)