Author: damjan
Date: Wed Feb 24 01:48:05 2016
New Revision: 1732006

URL: http://svn.apache.org/viewvc?rev=1732006&view=rev
Log:
Merge r1409440 from branches/gbuild:
imported patch correctindents

BUILDS


Modified:
    openoffice/branches/gbuild-reintegration/   (props changed)
    
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx

Propchange: openoffice/branches/gbuild-reintegration/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 24 01:48:05 2016
@@ -1,4 +1,4 @@
-/incubator/ooo/branches/gbuild:1409313-1409425,1409428,1409432-1409436,1409438,1409470
+/incubator/ooo/branches/gbuild:1409313-1409425,1409428,1409432-1409436,1409438,1409440,1409470
 /openoffice/branches/AOO400:1503684
 /openoffice/branches/AOO410:1572480,1573601,1583349,1583635,1583666
 /openoffice/branches/alg_writerframes:1556289-1579189

Modified: 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx?rev=1732006&r1=1732005&r2=1732006&view=diff
==============================================================================
--- 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
 (original)
+++ 
openoffice/branches/gbuild-reintegration/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
 Wed Feb 24 01:48:05 2016
@@ -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);


Reply via email to