diff options
author | obo <obo@openoffice.org> | 2010-06-15 07:24:20 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-06-15 07:24:20 +0200 |
commit | 798e415c982fa6e449493ff7679896897c7f597d (patch) | |
tree | c4620b47b0160b4bc345978c39ba050fa30969e2 /xmloff | |
parent | 907aa92c4b44b195551d5f2d3631ab6599d3f002 (diff) | |
parent | a562519b732041d6b366e373dc0b56b72271cc1a (diff) |
CWS-TOOLING: integrate CWS os140
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 4fbf91d2b0..e4a47d14fa 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -119,7 +119,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; @@ -1823,8 +1823,28 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( Reference<XTextContent> xTextContent(xTmp, UNO_QUERY); if (m_pImpl->m_xText.is() && xRange.is()) { - m_pImpl->m_xText->insertTextContent( - xRange, xTextContent, sal_True); + // #i107225# the combined characters need to be inserted first + // the selected text has to be removed afterwards + m_pImpl->m_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; + } + } } } } |