summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-06-15 07:24:20 +0200
committerobo <obo@openoffice.org>2010-06-15 07:24:20 +0200
commit6093b32cbee907c6cc959b64f4e6f0bf0de8fc89 (patch)
tree94551d8e3db4b36950c7efd45d21ed4177a69c45 /xmloff
parentc016baa4c425bb48cb626ae27e2fb6ed3dd023de (diff)
parente5ca3aca239fb7a95044e69f29294664ac60c8ec (diff)
CWS-TOOLING: integrate CWS os140
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/txtimp.cxx26
1 files changed, 23 insertions, 3 deletions
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index bc01112d9b03..87710d310d76 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;
+ }
+ }
}
}
}