23#include <osl/diagnose.h>
26#include <com/sun/star/beans/PropertyValue.hpp>
35#define ZOOMSLIDER_PARAMS 4
39:
SfxUInt16Item( _nWhich, nCurrentZoom ), mnMinZoom( nMinZoom ), mnMaxZoom( nMaxZoom )
50 assert(SfxPoolItem::operator==(rAttr));
60 nMemberId &= ~CONVERT_TWIPS;
65 css::uno::Sequence< css::beans::PropertyValue >
aSeq{
76 case MID_ZOOMSLIDER_CURRENTZOOM :
78 rVal <<= static_cast<sal_Int32>(
GetValue());
81 case MID_ZOOMSLIDER_SNAPPINGPOINTS:
86 case MID_ZOOMSLIDER_MINZOOM:
91 case MID_ZOOMSLIDER_MAXZOOM:
97 OSL_FAIL(
"svx::SvxZoomSliderItem::QueryValue(), Wrong MemberId!");
106 nMemberId &= ~CONVERT_TWIPS;
111 css::uno::Sequence< css::beans::PropertyValue >
aSeq;
114 sal_Int32 nCurrentZoom( 0 );
115 css::uno::Sequence < sal_Int32 > aValues;
117 bool bAllConverted(
true );
118 sal_Int16 nConvertedCount( 0 );
119 sal_Int32 nMinZoom( 0 ), nMaxZoom( 0 );
121 for (
const auto& rProp : std::as_const(
aSeq) )
125 bAllConverted &= ( rProp.Value >>= nCurrentZoom );
130 bAllConverted &= ( rProp.Value >>= aValues );
135 bAllConverted &= ( rProp.Value >>= nMinZoom );
140 bAllConverted &= ( rProp.Value >>= nMaxZoom );
147 SetValue(
static_cast<sal_uInt16
>(nCurrentZoom) );
149 mnMinZoom = sal::static_int_cast< sal_uInt16 >( nMinZoom );
150 mnMaxZoom = sal::static_int_cast< sal_uInt16 >( nMaxZoom );
159 case MID_ZOOMSLIDER_CURRENTZOOM:
164 SetValue(
static_cast<sal_uInt16
>(nVal) );
171 case MID_ZOOMSLIDER_SNAPPINGPOINTS:
173 css::uno::Sequence < sal_Int32 > aValues;
174 if ( rVal >>= aValues )
182 case MID_ZOOMSLIDER_MINZOOM:
187 mnMinZoom =
static_cast<sal_uInt16
>(nVal);
193 case MID_ZOOMSLIDER_MAXZOOM:
198 mnMaxZoom =
static_cast<sal_uInt16
>(nVal);
205 OSL_FAIL(
"svx::SvxZoomSliderItem::PutValue(), Wrong MemberId!");
212 const sal_Int32 nValues =
maValues.getLength();
const PropertyValue * pValues
sal_uInt16 GetValue() const
void SetValue(sal_uInt16 nTheValue)
virtual bool operator==(const SfxPoolItem &) const override
SvxZoomSliderItem(sal_uInt16 nCurrentZoom=100, sal_uInt16 nMinZoom=20, sal_uInt16 nMaxZoom=600, TypedWhichId< SvxZoomSliderItem > nWhich=SID_ATTR_ZOOMSLIDER)
virtual SvxZoomSliderItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
void AddSnappingPoint(sal_Int32 nNew)
static SfxPoolItem * CreateDefault()
css::uno::Sequence< sal_Int32 > maValues
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Sequence< sal_Int8 > aSeq
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
constexpr OUStringLiteral ZOOMSLIDER_PARAM_CURRENTZOOM
constexpr OUStringLiteral ZOOMSLIDER_PARAM_MINZOOM
#define ZOOMSLIDER_PARAMS
constexpr OUStringLiteral ZOOMSLIDER_PARAM_MAXZOOM
constexpr OUStringLiteral ZOOMSLIDER_PARAM_SNAPPINGPOINTS