openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ar...@apache.org
Subject svn commit: r1409440 - /incubator/ooo/branches/gbuild/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
Date Wed, 14 Nov 2012 21:42:49 GMT
Author: arist
Date: Wed Nov 14 21:42:48 2012
New Revision: 1409440

URL: http://svn.apache.org/viewvc?rev=1409440&view=rev
Log:
writerfilter10_14_5208b08c61dd.patch
# HG changeset patch
# User Henning Brinkmann <hbrinkm@openoffice.org>
# Date 1297181027 -3600
# Node ID 5208b08c61ddff6dad27dbc1486f462a70812249
# Parent  746438bb8917e717843f2c96ac1a6020fe57df8e
imported patch correctindents


Modified:
    incubator/ooo/branches/gbuild/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx

Modified: incubator/ooo/branches/gbuild/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/gbuild/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx?rev=1409440&r1=1409439&r2=1409440&view=diff
==============================================================================
--- incubator/ooo/branches/gbuild/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx (original)
+++ incubator/ooo/branches/gbuild/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx Wed
Nov 14 21:42:48 2012
@@ -599,6 +599,59 @@ void lcl_MoveBorderPropertiesToFrame(Pro
    }
 }
 
+void lcl_CorrectIndents(PropertySequence & aPropSeq)
+{
+    try
+    {
+        ::rtl::OUString str(RTL_CONSTASCII_USTRINGPARAM(__FUNCTION__));
+
+        uno::Any aAny;
+
+        sal_Int32 nLeftMargin = 0;
+        aAny = aPropSeq.get(PROP_PARA_LEFT_MARGIN);
+        if (aAny.hasValue())
+            aAny >>= nLeftMargin;
+
+        aAny = aPropSeq.get(PROP_LEFT_BORDER_DISTANCE);
+
+        if (aAny.hasValue())
+        {
+            sal_Int32 nLeftBorderDistance = 0;
+            aAny >>= nLeftBorderDistance;
+
+            nLeftMargin -= nLeftBorderDistance;
+
+            aPropSeq.set(PROP_PARA_LEFT_MARGIN, nLeftMargin);
+        }
+
+        sal_Int32 nRightMargin = 0;
+        aAny = aPropSeq.get(PROP_PARA_RIGHT_MARGIN);
+        if (aAny.hasValue())
+            aAny >>= nRightMargin;
+
+        aAny = aPropSeq.get(PROP_RIGHT_BORDER_DISTANCE);
+        
+        if (aAny.hasValue())
+        {
+            sal_Int32 nRightBorderDistance = 0;
+            aAny >>= nRightBorderDistance;
+
+            nRightMargin -= nRightBorderDistance;
+
+            aPropSeq.set(PROP_PARA_RIGHT_MARGIN, nRightMargin);
+        }
+    }
+    catch (const uno::Exception& rEx)
+    {
+        (void) rEx;
+    }
+    catch (const dmapper::Exception & rEx)
+    {
+        (void) rEx;
+    }
+
+}
+
 /*-- 04.01.2008 10:59:19---------------------------------------------------
 
   -----------------------------------------------------------------------*/
@@ -893,6 +946,7 @@ void DomainMapper_Impl::finishParagraph(
                             lcl_MoveBorderPropertiesToFrame(aPropSequence,
                                                             rAppendContext.pLastParagraphProperties->GetStartingRange(),
                                                             rAppendContext.pLastParagraphProperties->GetEndingRange());
+                            lcl_CorrectIndents(aPropSequence);                          
 
                         }
                         //frame conversion has to be executed after table conversion
                         RegisterFrameConversion(rAppendContext.pLastParagraphProperties->GetStartingRange(),
@@ -939,6 +993,8 @@ void DomainMapper_Impl::finishParagraph(
                     pPropSeq->set(PROP_DROP_CAP_FORMAT, aAny);
                 }
 
+                lcl_CorrectIndents(*pPropSeq);
+
                 uno::Reference< text::XTextRange > xTextRange =
                     xTextAppend->finishParagraph( pPropSeq->getSequence() );
                 getTableManager( ).handle(xTextRange);



Mime
View raw message