IParagraph.GetRect() Throws ArgumentOutOfRangeException for Paragraphs Clipped by vertOverflow="clip"

Summary

IParagraph.GetRect() throws System.ArgumentOutOfRangeException (an internal List indexing error) for any paragraph that is entirely clipped away by its text frame, i.e. when the shape’s <a:bodyPr> has vertOverflow="clip" and the paragraph lies fully outside the visible box.

Clipping should only affect painting, not layout: GetRect() is expected to return the paragraph’s layout rectangle (or an empty rectangle), never to throw an undocumented exception. With vertOverflow="overflow" or vertOverflow="ellipsis" the same document measures all paragraphs without error, regardless of the vertical anchor.

Reproduction

The attached ClippedOverflow.pptx is a minimal file. It contains a single 200×40 pt rectangle whose text frame has:

  • <a:bodyPr vertOverflow="clip" ... anchor="ctr"><a:noAutofit /></a:bodyPr>
  • Six one-line paragraphs (Line 1Line 6)

Only one line fits inside the 40 pt box; the remaining paragraphs are clipped.

To reproduce, run (requires .NET 10 SDK; downloads Aspose.Slides.NET 26.7.0 via #:package):

cd AsposeBugReport4
dotnet run Reproduce.cs

The script loads the presentation — without modifying it in any way — and calls GetRect() on each of the six paragraphs.

Expected result

GetRect() returns a rectangle for every paragraph (or an empty rectangle for fully clipped ones).

Actual result

GetRect() succeeds only for the first paragraph and throws for every fully clipped one (paragraphs 1–5):

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Aspose.Slides.Paragraph.GetRect()

Environment

  • Aspose.Slides.NET 26.7.0
  • .NET 10.0, Windows 11

Attachments

AsposeBugReport4.zip (24.4 KB)

File Description
ClippedOverflow.pptx Minimal reproduction PPTX
Reproduce.cs File-based C# app that calls GetRect() on each paragraph (dotnet run Reproduce.cs)

@jbutemplafy,
Thank you for contacting free support. I need some time to investigate the case. I will get back to you as soon as possible.

@jbutemplafy,
I have reproduced the problem where IParagraph.GetRect() throws an ArgumentOutOfRangeException. We apologize for any inconvenience caused.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-45473

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like