summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-06-07 16:24:42 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-06-07 16:24:42 +0200
commit77c55e962140d0c822f05a5d972c450e807ab220 (patch)
treee8f5e4b65d3ddc34048004f6fb2a17018ad5426c /svx
parent1bcfa6212553b1d130036f0d1e5bc0dc0692b706 (diff)
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 1ffd7e1accbee482d4bb6698d4ad145d8a6a780d "INTEGRATION: CWS impresstables2" which mentions "fixed merge error" multiple times in the commit message. Change-Id: I81467074efb433e0b52eb82e2c81d4b5890e67e9
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoshap2.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 1bf2fa472fbc..e1543e5dd031 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1414,21 +1414,18 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
{
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;
- Graphic aGraphic;
+ uno::Sequence<sal_Int8> const * pSeq( static_cast<uno::Sequence<sal_Int8> const *>(rValue.getValue()) );
+ 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 )
- {
- static_cast<SdrGrafObj*>(mpObj.get())->SetGraphic(aGraphic);
- bOk = true;
- }
+ if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE )
+ {
+ static_cast<SdrGrafObj*>(mpObj.get())->SetGraphic(aGraphic);
+ bOk = true;
}
}
else if( (rValue.getValueType() == cppu::UnoType<awt::XBitmap>::get()) || (rValue.getValueType() == cppu::UnoType<graphic::XGraphic>::get()))