Kaydet (Commit) 77c55e96 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Any::getValue always returns non-null

What this code looks like it wants to do is check whether rValue is either a
Sequence<sal_Int8> or else a Reference to XBitmap or XGraphic.  It was
introduced with 1ffd7e1a "INTEGRATION: CWS
impresstables2" which mentions "fixed merge error" multiple times in the commit
message.

Change-Id: I81467074efb433e0b52eb82e2c81d4b5890e67e9
üst 1bcfa621
...@@ -1414,21 +1414,18 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte ...@@ -1414,21 +1414,18 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
{ {
case OWN_ATTR_VALUE_FILLBITMAP: case OWN_ATTR_VALUE_FILLBITMAP:
{ {
if( rValue.getValue() ) if( rValue.getValueType() == cppu::UnoType<uno::Sequence< sal_Int8 >>::get() )
{ {
if( rValue.getValueType() == cppu::UnoType<uno::Sequence< sal_Int8 >>::get() ) uno::Sequence<sal_Int8> const * pSeq( static_cast<uno::Sequence<sal_Int8> const *>(rValue.getValue()) );
{ SvMemoryStream aMemStm;
uno::Sequence<sal_Int8> const * pSeq( static_cast<uno::Sequence<sal_Int8> const *>(rValue.getValue()) ); Graphic aGraphic;
SvMemoryStream aMemStm;
Graphic aGraphic;
aMemStm.SetBuffer( const_cast<css::uno::Sequence<sal_Int8> *>(pSeq)->getArray(), pSeq->getLength(), pSeq->getLength() ); aMemStm.SetBuffer( const_cast<css::uno::Sequence<sal_Int8> *>(pSeq)->getArray(), pSeq->getLength(), pSeq->getLength() );
if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE ) if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE )
{ {
static_cast<SdrGrafObj*>(mpObj.get())->SetGraphic(aGraphic); static_cast<SdrGrafObj*>(mpObj.get())->SetGraphic(aGraphic);
bOk = true; bOk = true;
}
} }
} }
else if( (rValue.getValueType() == cppu::UnoType<awt::XBitmap>::get()) || (rValue.getValueType() == cppu::UnoType<graphic::XGraphic>::get())) else if( (rValue.getValueType() == cppu::UnoType<awt::XBitmap>::get()) || (rValue.getValueType() == cppu::UnoType<graphic::XGraphic>::get()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment