[Libreoffice-commits] .: Branch 'libreoffice-3-5' - editeng/source

Eike Rathke erack at kemper.freedesktop.org
Tue May 22 07:51:47 PDT 2012


 editeng/source/items/frmitems.cxx |   43 +++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)

New commits:
commit 8980ce1b3a9a43aeb6ee1a412697157976cddbe8
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon May 21 14:02:36 2012 +0200

    fdo#40874: make recorded border macros run:
    
    When the new BorderLine2 struct with its added members was introduced,
    the PutValues methods that are called by the macro recorder with
    seqeunces of Anys were not adapted, so running recorded macro for
    ".uno:BorderInner" ".uno:BorderOuter" ".uno:SetBorderStyle" fails.
    (regression from b624e6e6cf2ecfc6e6e983af45212fce5e731006,
    7db30f7aa037f52eb07cbb4fd2796bd869204af8)
    
    Change-Id: Icd8a11d7f5c8d79c57020f213a1554540b6c666d
    (cherry picked from commit 18ab7f52ebf78f41f824b2245a8a180d97081716)
    
    Signed-off-by: Eike Rathke <erack at redhat.com>

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 48beef6..69a83e2 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2008,7 +2008,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             catch (uno::Exception&) {}
 
             aNew >>= aSeq;
-            if ( aSeq.getLength() == 4 )
+            if (aSeq.getLength() >= 4 && aSeq.getLength() <= 6)
             {
                 sal_Int32 nVal = 0;
                 if ( aSeq[0] >>= nVal )
@@ -2019,6 +2019,20 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                     aBorderLine.OuterLineWidth = (sal_Int16) nVal;
                 if ( aSeq[3] >>= nVal )
                     aBorderLine.LineDistance = (sal_Int16) nVal;
+                if (aSeq.getLength() >= 5) // fdo#40874 added fields
+                {
+                    if (aSeq[4] >>= nVal)
+                    {
+                        aBorderLine.LineStyle = nVal;
+                    }
+                    if (aSeq.getLength() >= 6)
+                    {
+                        if (aSeq[5] >>= nVal)
+                        {
+                            aBorderLine.LineWidth = nVal;
+                        }
+                    }
+                }
             }
             else
                 return sal_False;
@@ -2805,7 +2819,8 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 try { aNew = xConverter->convertTo( rVal, ::getCppuType((const uno::Sequence < uno::Any >*)0) ); }
                 catch (uno::Exception&) {}
 
-                if( (aNew >>= aSeq) && aSeq.getLength() == 4 )
+                if ((aNew >>= aSeq) &&
+                    aSeq.getLength() >= 4  && aSeq.getLength() <= 6)
                 {
                     sal_Int32 nVal = 0;
                     if ( aSeq[0] >>= nVal )
@@ -2816,6 +2831,20 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                         aBorderLine.OuterLineWidth = (sal_Int16) nVal;
                     if ( aSeq[3] >>= nVal )
                         aBorderLine.LineDistance = (sal_Int16) nVal;
+                    if (aSeq.getLength() >= 5) // fdo#40874 added fields
+                    {
+                        if (aSeq[4] >>= nVal)
+                        {
+                            aBorderLine.LineStyle = nVal;
+                        }
+                        if (aSeq.getLength() >= 6)
+                        {
+                            if (aSeq[5] >>= nVal)
+                            {
+                                aBorderLine.LineWidth = nVal;
+                            }
+                        }
+                    }
                 }
                 else
                     return sal_False;
@@ -2825,12 +2854,20 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 // serialization for basic macro recording
                 ::com::sun::star::uno::Sequence < sal_Int16 > aSeq;
                 rVal >>= aSeq;
-                if ( aSeq.getLength() == 4 )
+                if (aSeq.getLength() >= 4 && aSeq.getLength() <= 6)
                 {
                     aBorderLine.Color = aSeq[0];
                     aBorderLine.InnerLineWidth = aSeq[1];
                     aBorderLine.OuterLineWidth = aSeq[2];
                     aBorderLine.LineDistance = aSeq[3];
+                    if (aSeq.getLength() >= 5) // fdo#40874 added fields
+                    {
+                        aBorderLine.LineStyle = aSeq[4];
+                        if (aSeq.getLength() >= 6)
+                        {
+                            aBorderLine.LineWidth = aSeq[5];
+                        }
+                    }
                 }
                 else
                     return sal_False;


More information about the Libreoffice-commits mailing list