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

            Bug ID: 57727
           Summary: XWPFParagraph.searchText may return invalid result
                    when searched string is in more runs
           Product: POI
           Version: 3.12-dev
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: [email protected]
          Reporter: [email protected]

Run 0
TextPositon 0:

"some text"

Run 0
TextPosition 1:

"SEARCH"

Run 1
TextPosition 0:
"ED"

calling sarchText("SEARCHED", new PositionInParagraph()) returns TextSegment
with beginTextPosition == 0. because in every new run it reinitializes to 0
(XWPFParagraph.searchText source code):


        for (int runPos=startRun; runPos<rArray.length; runPos++) {
            int beginTextPos = 0,beginCharPos = 0, textPos = 0,  charPos = 0;   

Similarly for beginCharPos, both should be initialized with beginRunPos above
the cycle.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to