[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - writerfilter/source
Michael Stahl
mstahl at redhat.com
Thu Feb 21 00:27:10 PST 2013
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 ------
1 file changed, 6 deletions(-)
New commits:
commit 310b5976bb827a0ffb274f70878852e4474a0559
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Feb 20 16:32:59 2013 +0100
fdo#60789: writerfilter: do not insert a character at field start
The character inserted in DomainMapper_Impl::PushFieldContext() causes
problems in this bugdoc because there is a commentRangeStart immediately
before a text field and the call to delete it via setString("") disposes
the SwXTextRange that is stored in m_aAnnotationPosition.m_xStart,
which results in an exception when trying to insert the comment.
At least all the fields in the bugdoc import fine with this change.
Change-Id: I6c08d72fafb0529e8612f1e35b2c8b871edb5a52
(cherry picked from commit 6145c6efa4f346287ed9693c9d00038d829d5a35)
Reviewed-on: https://gerrit.libreoffice.org/2295
Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 695a0f3..88b4e42 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2033,10 +2033,7 @@ void DomainMapper_Impl::PushFieldContext()
uno::Reference< text::XTextRange > xStart;
if (xTextAppend.is())
{
- //insert a dummy char to make sure the start range doesn't move together with the to-be-appended text
- xTextAppend->appendTextPortion(OUString( '-' ), uno::Sequence< beans::PropertyValue >() );
uno::Reference< text::XTextCursor > xCrsr = xTextAppend->createTextCursorByRange( xTextAppend->getEnd() );
- xCrsr->goLeft( 1, false );
xStart = xCrsr->getStart();
}
m_aFieldStack.push( FieldContextPtr( new FieldContext( xStart ) ) );
@@ -3310,9 +3307,6 @@ void DomainMapper_Impl::PopFieldContext()
try
{
uno::Reference< text::XTextCursor > xCrsr = xTextAppend->createTextCursorByRange(pContext->GetStartRange());
- //remove the dummy character
- xCrsr->goRight( 1, true );
- xCrsr->setString( OUString() );
uno::Reference< text::XTextContent > xToInsert( pContext->GetTOC(), uno::UNO_QUERY );
if( xToInsert.is() )
{
More information about the Libreoffice-commits
mailing list