attempt to fix macos jenkins hangs - part 3
[LibreOffice.git] / svl / source / items / imageitm.cxx
blobcba4b7103b82ed73ba8fb444ffc720d87c5956a7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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))
50 return false;
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{ css::uno::Any(GetValue()),
58 css::uno::Any(sal_Int16(mnAngle)),
59 css::uno::Any(mbMirrored),
60 css::uno::Any(maURL) };
61 rVal <<= aSeq;
62 return true;
65 bool SfxImageItem::PutValue( const css::uno::Any& rVal, sal_uInt8 )
67 css::uno::Sequence< css::uno::Any > aSeq;
68 if (( rVal >>= aSeq ) && ( aSeq.getLength() == 4 ))
70 sal_Int16 nVal = sal_Int16();
71 if ( aSeq[0] >>= nVal )
72 SetValue( nVal );
73 sal_Int16 nTmp = 0;
74 aSeq[1] >>= nTmp;
75 mnAngle = Degree10(nTmp);
76 aSeq[2] >>= mbMirrored;
77 aSeq[3] >>= maURL;
78 return true;
81 return false;
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */