diff options
author | os <os@openoffice.org> | 2010-02-10 13:23:01 +0100 |
---|---|---|
committer | os <os@openoffice.org> | 2010-02-10 13:23:01 +0100 |
commit | ef09592d5ae968b7337863bb1a3538944ed1a960 (patch) | |
tree | 85a9e07cf3bf04493b0fb007fa885efc0aa2b75b /xmloff/source/text | |
parent | 830a87f87567a467d6e32fa06f9585e6d9dd813d (diff) |
#i107225# combined characters: prevent unwanted merge of consecutive fields
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 7817fa7c4c19..cf8f6ee13e82 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -110,7 +110,7 @@ using namespace ::com::sun::star::lang; using namespace ::xmloff::token; using ::com::sun::star::util::DateTime; using namespace ::com::sun::star::ucb; - +using namespace ::com::sun::star; using ::comphelper::UStringLess; static __FAR_DATA SvXMLTokenMapEntry aTextElemTokenMap[] = @@ -1355,8 +1355,29 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( Reference<XTextContent> xTextContent(xTmp, UNO_QUERY); if (xText.is() && xRange.is()) { - xText->insertTextContent( xRange, xTextContent, + // #i107225# the combined characters need to be inserted first + // the selected text has to be removed afterwards + xText->insertTextContent( xRange->getStart(), xTextContent, sal_True ); + + if( xRange->getString().getLength() ) + { + try + { + uno::Reference< text::XTextCursor > xCrsr = xRange->getText()->createTextCursorByRange( xRange->getStart() ); + xCrsr->goLeft( 1, true ); + uno::Reference< beans::XPropertySet> xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW ); + //the hard properties of the removed text need to be applied to the combined characters field + pStyle->FillPropertySet( xCrsrProperties ); + xCrsr->collapseToEnd(); + xCrsr->gotoRange( xRange->getEnd(), true ); + xCrsr->setString( ::rtl::OUString() ); + } + catch( const uno::Exception& rEx ) + { + (void)rEx; + } + } } } } |