@@ -190,6 +190,8 @@ TActiveTextAttrNames = record
190190 // / <summary>Checks if the active text object contains any elements.
191191 // / </summary>
192192 function IsEmpty : Boolean;
193+ // / <summary>Checks if the active text object has text content.</summary>
194+ function HasContent : Boolean;
193195 // / <summary>Checks if the active text object contains only plain text.
194196 // / </summary>
195197 // / <remarks>Plain text is considered to be active text with no action
@@ -504,6 +506,9 @@ TActiveText = class(TInterfacedObject,
504506 // / <summary>Checks if the element list is empty.</summary>
505507 // / <remarks>Method of IActiveText.</remarks>
506508 function IsEmpty : Boolean;
509+ // / <summary>Checks if the active text object has text content.</summary>
510+ // / <remarks>Method of IActiveText.</remarks>
511+ function HasContent : Boolean;
507512 // / <summary>Checks if the active text object contains only plain text.
508513 // / </summary>
509514 // / <remarks>
@@ -869,6 +874,18 @@ function TActiveText.GetEnumerator: TEnumerator<IActiveTextElem>;
869874 Result := fElems.GetEnumerator;
870875end ;
871876
877+ function TActiveText.HasContent : Boolean;
878+ var
879+ Elem: IActiveTextElem;
880+ TextElem: IActiveTextTextElem;
881+ begin
882+ Result := False;
883+ for Elem in fElems do
884+ if Supports(Elem, IActiveTextTextElem, TextElem)
885+ and (TextElem.Text <> ' ' ) then
886+ Exit(True);
887+ end ;
888+
872889function TActiveText.IsEmpty : Boolean;
873890begin
874891 Result := fElems.Count = 0 ;
0 commit comments