summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-05-21 14:02:36 +0200
committerEike Rathke <erack@redhat.com>2012-05-22 16:50:34 +0200
commit8980ce1b3a9a43aeb6ee1a412697157976cddbe8 (patch)
tree8e2fbd26bf6ff41d78257a0ff01f5a82edcfdbdd
parentef4e83c698fa065de3242564d8c4e7aab5e86dd7 (diff)
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@redhat.com>
-rw-r--r--editeng/source/items/frmitems.cxx43
1 files changed, 40 insertions, 3 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 48beef63ded8..69a83e205228 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;