// adjustForInsert() or it would get updated multiple times if the range
// has a parent)
// without this, OpenOffice.org (v. 2.2.x) does not see all the text in
// the document
FileInformationBlock fib = _doc.getFileInformationBlock();
// // Do for each affected part
// if (_start < cpS.getMainDocumentEnd()) {
// fib.setCcpText(fib.getCcpText() + adjustment);
// }
//
// if (_start < cpS.getCommentsEnd()) {
// fib.setCcpAtn(fib.getCcpAtn() + adjustment);
// }
// if (_start < cpS.getEndNoteEnd()) {
// fib.setCcpEdn(fib.getCcpEdn() + adjustment);
// }
// if (_start < cpS.getFootnoteEnd()) {
// fib.setCcpFtn(fib.getCcpFtn() + adjustment);
// }
// if (_start < cpS.getHeaderStoryEnd()) {
// fib.setCcpHdd(fib.getCcpHdd() + adjustment);
// }
// if (_start < cpS.getHeaderTextboxEnd()) {
// fib.setCcpHdrTxtBx(fib.getCcpHdrTxtBx() + adjustment);
// }
// if (_start < cpS.getMainTextboxEnd()) {
// fib.setCcpTxtBx(fib.getCcpTxtBx() + adjustment);
// }
// much simple implementation base on SubdocumentType --sergey
int currentEnd = 0;
for ( SubdocumentType type : SubdocumentType.ORDERED )
{
int currentLength = fib.getSubdocumentTextStreamLength( type );
currentEnd += currentLength;
// do we need to shift this part?
if ( _start > currentEnd )
continue;
fib.setSubdocumentTextStreamLength( type, currentLength
+ adjustment );
break;
}
}