20 #include <osl/diagnose.h>
23 #include <com/sun/star/beans/PropertyValue.hpp>
28 #define ZOOMSLIDER_PARAM_CURRENTZOOM "Columns"
29 #define ZOOMSLIDER_PARAM_SNAPPINGPOINTS "SnappingPoints"
30 #define ZOOMSLIDER_PARAM_MINZOOM "MinValue"
31 #define ZOOMSLIDER_PARAM_MAXZOOM "MaxValue"
32 #define ZOOMSLIDER_PARAMS 4
36 :
SfxUInt16Item( _nWhich, nCurrentZoom ), mnMinZoom( nMinZoom ), mnMaxZoom( nMaxZoom )
47 assert(SfxPoolItem::operator==(rAttr));
64 aSeq[0].Value <<= sal_Int32(
GetValue() );
75 case MID_ZOOMSLIDER_CURRENTZOOM :
77 rVal <<= static_cast<sal_Int32>(
GetValue());
80 case MID_ZOOMSLIDER_SNAPPINGPOINTS:
85 case MID_ZOOMSLIDER_MINZOOM:
90 case MID_ZOOMSLIDER_MAXZOOM:
96 OSL_FAIL(
"svx::SvxZoomSliderItem::QueryValue(), Wrong MemberId!");
110 css::uno::Sequence< css::beans::PropertyValue >
aSeq;
113 sal_Int32 nCurrentZoom( 0 );
114 css::uno::Sequence < sal_Int32 > aValues;
116 bool bAllConverted(
true );
117 sal_Int16 nConvertedCount( 0 );
118 sal_Int32 nMinZoom( 0 ), nMaxZoom( 0 );
120 for (
const auto& rProp : std::as_const(aSeq) )
124 bAllConverted &= ( rProp.Value >>= nCurrentZoom );
129 bAllConverted &= ( rProp.Value >>= aValues );
134 bAllConverted &= ( rProp.Value >>= nMinZoom );
139 bAllConverted &= ( rProp.Value >>= nMaxZoom );
146 SetValue( static_cast<sal_uInt16>(nCurrentZoom) );
148 mnMinZoom = sal::static_int_cast< sal_uInt16 >( nMinZoom );
149 mnMaxZoom = sal::static_int_cast< sal_uInt16 >( nMaxZoom );
158 case MID_ZOOMSLIDER_CURRENTZOOM:
163 SetValue( static_cast<sal_uInt16>(nVal) );
170 case MID_ZOOMSLIDER_SNAPPINGPOINTS:
172 css::uno::Sequence < sal_Int32 > aValues;
173 if ( rVal >>= aValues )
181 case MID_ZOOMSLIDER_MINZOOM:
186 mnMinZoom =
static_cast<sal_uInt16
>(nVal);
192 case MID_ZOOMSLIDER_MAXZOOM:
197 mnMaxZoom =
static_cast<sal_uInt16
>(nVal);
204 OSL_FAIL(
"svx::SvxZoomSliderItem::PutValue(), Wrong MemberId!");
211 const sal_Int32 nValues =
maValues.getLength();
214 pValues[ nValues ] = nNew;
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
#define ZOOMSLIDER_PARAM_MINZOOM
sal_uInt16 GetValue() const
#define ZOOMSLIDER_PARAM_SNAPPINGPOINTS
void SetValue(sal_uInt16 nTheValue)
void AddSnappingPoint(sal_Int32 nNew)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
css::uno::Sequence< sal_Int32 > maValues
const PropertyValue * pValues
SvxZoomSliderItem(sal_uInt16 nCurrentZoom=100, sal_uInt16 nMinZoom=20, sal_uInt16 nMaxZoom=600, sal_uInt16 nWhich=SID_ATTR_ZOOMSLIDER)
#define ZOOMSLIDER_PARAM_MAXZOOM
#define ZOOMSLIDER_PARAM_CURRENTZOOM
virtual SvxZoomSliderItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool operator==(const SfxPoolItem &) const override
Sequence< sal_Int8 > aSeq
static SfxPoolItem * CreateDefault()
#define ZOOMSLIDER_PARAMS