You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2022/09/14 01:57:38 UTC

[Bug 66260] New: XWPF should have a getNumberOfTextRuns() method

https://bz.apache.org/bugzilla/show_bug.cgi?id=66260

            Bug ID: 66260
           Summary: XWPF should have a getNumberOfTextRuns() method
           Product: POI
           Version: 5.2.2-FINAL
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: fanningpj@yahoo.com
  Target Milestone: ---

XWPFRun.getText(int n) returns the TextRun data for position n but there is no
public API way to find how how many TextRuns are represented by the XWPFRun
instance.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 66260] XWPF should have a getNumberOfTextRuns() method

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66260

--- Comment #2 from Axel Richter <ax...@web.de> ---
Sorry. That SO comment was misleading. There really may be multiple `w:t`
elements in one `w:r`. See example in 

ECMA-376-1:2016
Office Open XML File Formats — Fundamentals
and Markup Language Reference
October 2016

page 333:

... However, if a text wrapping break character (a
typical line break) were inserted after the word is, as follows:

<w:r>
 <w:t>This is</w:t>
 <w:br/>
 <w:t xml:space="preserve"> a simple sentence.</w:t>
</w:r>

But I've never seen Word itself doing as such. It always uses multiple runs
then:

<w:r>
 <w:t>This is</w:t>
</w:r>
<w:r>
 <w:br/>
 <w:t xml:space="preserve"> a simple sentence.</w:t>
</w:r>

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 66260] XWPF should have a getNumberOfTextRuns() method

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66260

--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
The XWPF APIs have largely grown by community contribution, without some of the
overall review that the Excel format code has had. If someone has time to do a
full review and suggest tweaks that'd be amazing!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 66260] XWPF should have a getNumberOfTextRuns() method

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66260

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
According to
https://stackoverflow.com/questions/73691624/how-to-remove-line-breaks-with-apache-poi/73692616#comment130179141_73692616,
we only seem to need getText(0) - that it isn't needed to call getText(1), etc.

I don't really use the XWPF APIs but I find them confusing. Seems that we
should have a getText() that does the same as getText(0) and deprecate the
latter - likewise, for the setText method.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 66260] XWPF should have a getNumberOfTextRuns() method

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66260

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 66260] XWPF should have a getNumberOfTextRuns() method

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66260

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org