[Libreoffice-commits] .: 2 commits - writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 13:13:09 PST 2012


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit ec83990d247433feaba2e89b61430732d377b363
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Nov 29 20:56:12 2012 +0100

    DomainMapper_Impl::finishParagraph: also handle insert of multi-para frames
    
    Change-Id: Id2e761ab1c9fc9c5fd0837d1801af95674d0f99a

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c5b04ad..9381f73 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1012,7 +1012,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
                 else if(*rAppendContext.pLastParagraphProperties == *pParaContext )
                 {
                     //handles (7)
-                    rAppendContext.pLastParagraphProperties->SetEndingRange(xTextAppend->getEnd());
+                    rAppendContext.pLastParagraphProperties->SetEndingRange(rAppendContext.xInsertPosition.is() ? rAppendContext.xInsertPosition : xTextAppend->getEnd());
                     bKeepLastParagraphProperties = true;
                 }
                 else
@@ -1058,6 +1058,8 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
                 {
                     xTextRange = xTextAppend->finishParagraphInsert( aProperties, rAppendContext.xInsertPosition );
                     rAppendContext.xCursor->gotoNextParagraph(false);
+                    if (rAppendContext.pLastParagraphProperties.get())
+                        rAppendContext.pLastParagraphProperties->SetEndingRange(xTextRange->getEnd());
                 }
                 else
                     xTextRange = xTextAppend->finishParagraph( aProperties );
commit 3e2ab7dad94070f91b4f002e17e862e85cce513a
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Nov 29 20:09:47 2012 +0100

    DomainMapper_Impl::finishParagraph: fix frame conversion vs insert pos
    
    Change-Id: I3aefc2185412b1dc370dd723cc57ed59e60a36be

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index a204c69..c5b04ad 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -676,10 +676,11 @@ void lcl_MoveBorderPropertiesToFrame(uno::Sequence<beans::PropertyValue>& rFrame
 void lcl_AddRangeAndStyle(
     ParagraphPropertiesPtr& pToBeSavedProperties,
     uno::Reference< text::XTextAppend > xTextAppend,
-    PropertyMapPtr pPropertyMap)
+    PropertyMapPtr pPropertyMap,
+    TextAppendContext& rAppendContext)
 {
     uno::Reference<text::XParagraphCursor> xParaCursor(
-        xTextAppend->createTextCursorByRange( xTextAppend->getEnd()), uno::UNO_QUERY_THROW );
+        xTextAppend->createTextCursorByRange( rAppendContext.xInsertPosition.is() ? rAppendContext.xInsertPosition : xTextAppend->getEnd()), uno::UNO_QUERY_THROW );
     pToBeSavedProperties->SetEndingRange(xParaCursor->getStart());
     xParaCursor->gotoStartOfParagraph( false );
 
@@ -1023,7 +1024,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
                     if ( !bIsDropCap && pParaContext->IsFrameMode() )
                     {
                         pToBeSavedProperties.reset( new ParagraphProperties(*pParaContext) );
-                        lcl_AddRangeAndStyle(pToBeSavedProperties, xTextAppend, pPropertyMap);
+                        lcl_AddRangeAndStyle(pToBeSavedProperties, xTextAppend, pPropertyMap, rAppendContext);
                     }
                 }
 
@@ -1035,7 +1036,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
                 if( !bIsDropCap && pParaContext->IsFrameMode() )
                 {
                     pToBeSavedProperties.reset( new ParagraphProperties(*pParaContext) );
-                    lcl_AddRangeAndStyle(pToBeSavedProperties, xTextAppend, pPropertyMap);
+                    lcl_AddRangeAndStyle(pToBeSavedProperties, xTextAppend, pPropertyMap, rAppendContext);
                 }
             }
             uno::Sequence< beans::PropertyValue > aProperties;


More information about the Libreoffice-commits mailing list