diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-05-21 14:02:36 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-05-21 18:20:38 +0200 |
commit | 18ab7f52ebf78f41f824b2245a8a180d97081716 (patch) | |
tree | 5d991aebb34a3cacbf98758d079d5d87bbafea0d /editeng | |
parent | lo-commit-stat: use utf8 to be able to query a dash in the bug title (diff) | |
download | core-18ab7f52ebf78f41f824b2245a8a180d97081716.tar.gz core-18ab7f52ebf78f41f824b2245a8a180d97081716.zip |
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
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/frmitems.cxx | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index f98058e93747..8651534e1b0a 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -2064,7 +2064,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) catch (const uno::Exception&) {} aNew >>= aSeq; - if ( aSeq.getLength() == 4 ) + if (aSeq.getLength() >= 4 && aSeq.getLength() <= 6) { sal_Int32 nVal = 0; if ( aSeq[0] >>= nVal ) @@ -2075,6 +2075,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; @@ -2854,7 +2868,8 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) try { aNew = xConverter->convertTo( rVal, ::getCppuType((const uno::Sequence < uno::Any >*)0) ); } catch (const 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 ) @@ -2865,6 +2880,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; @@ -2874,12 +2903,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; |