1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <svl/imageitm.hxx>
22 #include <com/sun/star/uno/Sequence.hxx>
25 SfxPoolItem
* SfxImageItem::CreateDefault() { return new SfxImageItem
; }
27 SfxImageItem::SfxImageItem( sal_uInt16 which
)
28 : SfxInt16Item( which
, 0 ), mnAngle(0), mbMirrored(false)
32 SfxImageItem::SfxImageItem( const SfxImageItem
& rItem
)
33 : SfxInt16Item( rItem
),
34 mnAngle(rItem
.mnAngle
), mbMirrored(rItem
.mbMirrored
)
38 SfxImageItem::~SfxImageItem()
42 SfxImageItem
* SfxImageItem::Clone( SfxItemPool
* ) const
44 return new SfxImageItem( *this );
47 bool SfxImageItem::operator==( const SfxPoolItem
& rItem
) const
49 if (!SfxInt16Item::operator==(rItem
))
51 const SfxImageItem
& rOther
= static_cast<const SfxImageItem
&>(rItem
);
52 return mnAngle
== rOther
.mnAngle
&& mbMirrored
== rOther
.mbMirrored
;
55 bool SfxImageItem::QueryValue( css::uno::Any
& rVal
, sal_uInt8
) const
57 css::uno::Sequence
< css::uno::Any
> aSeq( 4 );
58 aSeq
[0] <<= GetValue();
59 aSeq
[1] <<= sal_Int16(mnAngle
);
60 aSeq
[2] <<= mbMirrored
;
67 bool SfxImageItem::PutValue( const css::uno::Any
& rVal
, sal_uInt8
)
69 css::uno::Sequence
< css::uno::Any
> aSeq
;
70 if (( rVal
>>= aSeq
) && ( aSeq
.getLength() == 4 ))
72 sal_Int16 nVal
= sal_Int16();
73 if ( aSeq
[0] >>= nVal
)
77 mnAngle
= Degree10(nTmp
);
78 aSeq
[2] >>= mbMirrored
;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */