diff options
Diffstat (limited to 'xmloff/source/text/txtimp.cxx')
-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; + } + } } } } |