mirror of https://github.com/apache/poi.git
[githib-110] rename text segment class. This closes #110
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832352 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c398d2010e
commit
1caafe0431
|
@ -1468,7 +1468,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
|
||||||
* @param searched
|
* @param searched
|
||||||
* @param startPos
|
* @param startPos
|
||||||
*/
|
*/
|
||||||
public TextSegement searchText(String searched, PositionInParagraph startPos) {
|
public TextSegment searchText(String searched, PositionInParagraph startPos) {
|
||||||
int startRun = startPos.getRun(),
|
int startRun = startPos.getRun(),
|
||||||
startText = startPos.getText(),
|
startText = startPos.getText(),
|
||||||
startChar = startPos.getChar();
|
startChar = startPos.getChar();
|
||||||
|
@ -1504,7 +1504,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
|
||||||
if (candCharPos + 1 < searched.length()) {
|
if (candCharPos + 1 < searched.length()) {
|
||||||
candCharPos++;
|
candCharPos++;
|
||||||
} else if (newList) {
|
} else if (newList) {
|
||||||
TextSegement segement = new TextSegement();
|
TextSegment segement = new TextSegment();
|
||||||
segement.setBeginRun(beginRunPos);
|
segement.setBeginRun(beginRunPos);
|
||||||
segement.setBeginText(beginTextPos);
|
segement.setBeginText(beginTextPos);
|
||||||
segement.setBeginChar(beginCharPos);
|
segement.setBeginChar(beginCharPos);
|
||||||
|
@ -1539,7 +1539,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
|
||||||
*
|
*
|
||||||
* @param segment
|
* @param segment
|
||||||
*/
|
*/
|
||||||
public String getText(TextSegement segment) {
|
public String getText(TextSegment segment) {
|
||||||
int runBegin = segment.getBeginRun();
|
int runBegin = segment.getBeginRun();
|
||||||
int textBegin = segment.getBeginText();
|
int textBegin = segment.getBeginText();
|
||||||
int charBegin = segment.getBeginChar();
|
int charBegin = segment.getBeginChar();
|
||||||
|
|
|
@ -559,7 +559,7 @@ public final class TestXWPFParagraph {
|
||||||
|
|
||||||
XWPFParagraph p = ps.get(0);
|
XWPFParagraph p = ps.get(0);
|
||||||
|
|
||||||
TextSegement segment = p.searchText("sample word document", new PositionInParagraph());
|
TextSegment segment = p.searchText("sample word document", new PositionInParagraph());
|
||||||
assertNotNull(segment);
|
assertNotNull(segment);
|
||||||
|
|
||||||
assertEquals("sample word document", p.getText(segment));
|
assertEquals("sample word document", p.getText(segment));
|
||||||
|
|
Loading…
Reference in New Issue