summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2005-03-29 13:14:30 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2005-03-29 13:14:30 +0000
commit917b0dd03eb30bcd1241767023be9ea90668795f (patch)
tree67f886d844808e47a9ce87d1fdd7dbd2ad6575d3 /xmloff
parent481e8501052aa97795d87cc25a4ea90fab1bbafe (diff)
INTEGRATION: CWS effectmigration01 (1.48.8); FILE MERGED
2005/03/18 10:31:29 cl 1.48.8.1: #i45271# use XTextCursor for paragraph references
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/txtparai.cxx38
1 files changed, 15 insertions, 23 deletions
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 0b01d816fd08..151a1ba734e7 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtparai.cxx,v $
*
- * $Revision: 1.49 $
+ * $Revision: 1.50 $
*
- * last change: $Author: vg $ $Date: 2005-03-23 12:42:31 $
+ * last change: $Author: rt $ $Date: 2005-03-29 14:14:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1704,6 +1704,19 @@ XMLParaContext::~XMLParaContext()
GetImport().GetTextImport());
Reference < XTextRange > xEnd(xTxtImport->GetCursorAsRange()->getStart());
+ // if we have an id set for this paragraph, get a cursor for this
+ // paragraph and register it with the given identifier
+ if( sId.getLength() )
+ {
+ Reference < XTextCursor > xIdCursor( xTxtImport->GetText()->createTextCursorByRange( xStart ) );
+ if( xIdCursor.is() )
+ {
+ xIdCursor->gotoRange( xEnd, sal_True );
+ Reference< XInterface > xRef( xIdCursor, UNO_QUERY );
+ GetImport().getInterfaceToIdentifierMapper().registerReference( sId, xRef );
+ }
+ }
+
// insert a paragraph break
xTxtImport->InsertControlCharacter( ControlCharacter::APPEND_PARAGRAPH );
@@ -1897,27 +1910,6 @@ XMLParaContext::~XMLParaContext()
}
}
delete pHints;
-
- // if we have an id set for this paragraph, get the latest added
- // paragraph and register it with this identifier
- if( sId.getLength() )
- {
- Reference< XEnumerationAccess > xParaEnumAccess( xTxtImport->GetText(), UNO_QUERY );
- if( xParaEnumAccess.is() )
- {
- Reference< XEnumeration > xEnumeration( xParaEnumAccess->createEnumeration(), UNO_QUERY );
- if( xEnumeration.is() )
- {
- Reference< XInterface > xRef;
-
- while( xEnumeration->hasMoreElements() )
- xEnumeration->nextElement() >>= xRef;
-
- if( xRef.is() )
- GetImport().getInterfaceToIdentifierMapper().registerReference( sId, xRef );
- }
- }
- }
}
SvXMLImportContext *XMLParaContext::CreateChildContext(