Kaydet (Commit) c903c377 authored tarafından Noel Power's avatar Noel Power

fix fdo#63659 restore handling of ZOOM MID, MID_VALUESET & MID_TYPE sub parmas

Change-Id: I01eff3bb8b194e1437a263e527cb8e6d2defa4de
üst 96488510
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <sfx2/zoomitem.hxx> #include <sfx2/zoomitem.hxx>
#include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
#include "sfx.hrc"
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
TYPEINIT1_FACTORY(SvxZoomItem,SfxUInt16Item, new SvxZoomItem); TYPEINIT1_FACTORY(SvxZoomItem,SfxUInt16Item, new SvxZoomItem);
...@@ -107,11 +107,11 @@ int SvxZoomItem::operator==( const SfxPoolItem& rAttr ) const ...@@ -107,11 +107,11 @@ int SvxZoomItem::operator==( const SfxPoolItem& rAttr ) const
bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
{ {
// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS; nMemberId &= ~CONVERT_TWIPS;
switch( nMemberId )
assert(nMemberId == 0); {
case 0:
{
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq( ZOOM_PARAMS ); ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq( ZOOM_PARAMS );
aSeq[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUE )); aSeq[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUE ));
aSeq[0].Value <<= sal_Int32( GetValue() ); aSeq[0].Value <<= sal_Int32( GetValue() );
...@@ -120,6 +120,15 @@ bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberI ...@@ -120,6 +120,15 @@ bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberI
aSeq[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_TYPE )); aSeq[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_TYPE ));
aSeq[2].Value <<= sal_Int16( eType ); aSeq[2].Value <<= sal_Int16( eType );
rVal <<= aSeq; rVal <<= aSeq;
}
case MID_VALUE: rVal <<= (sal_Int32) GetValue(); break;
case MID_VALUESET: rVal <<= (sal_Int16) nValueSet; break;
case MID_TYPE: rVal <<= (sal_Int16) eType; break;
default:
OSL_FAIL("sfx2::SvxZoomItem::QueryValue(), Wrong MemberId!");
return false;
}
return true; return true;
} }
...@@ -127,8 +136,10 @@ bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberI ...@@ -127,8 +136,10 @@ bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberI
bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
{ {
nMemberId &= ~CONVERT_TWIPS; nMemberId &= ~CONVERT_TWIPS;
assert(nMemberId == 0); switch( nMemberId )
{
case 0:
{
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq; ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq;
if (( rVal >>= aSeq ) && ( aSeq.getLength() == ZOOM_PARAMS )) if (( rVal >>= aSeq ) && ( aSeq.getLength() == ZOOM_PARAMS ))
{ {
...@@ -164,8 +175,41 @@ bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMem ...@@ -164,8 +175,41 @@ bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMem
return true; return true;
} }
} }
return false;
}
case MID_VALUE:
{
sal_Int32 nVal = 0;
if ( rVal >>= nVal )
{
SetValue( (sal_uInt16)nVal );
return true;
}
else
return false;
}
case MID_VALUESET:
case MID_TYPE:
{
sal_Int16 nVal = sal_Int16();
if ( rVal >>= nVal )
{
if ( nMemberId == MID_VALUESET )
nValueSet = (sal_Int16) nVal;
else if ( nMemberId == MID_TYPE )
eType = SvxZoomType( (sal_Int16) nVal );
return true;
}
else
return false;
}
default:
OSL_FAIL("sfx2::SvxZoomItem::PutValue(), Wrong MemberId!");
return false; return false;
}
return true;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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