office-gobmx/sd/source/ui/animations/STLPropertySet.cxx
Caolán McNamara de4b3a135f cid#1545970 COPY_INSTEAD_OF_MOVE
and

cid#1545957 COPY_INSTEAD_OF_MOVE
cid#1545944 COPY_INSTEAD_OF_MOVE
cid#1545939 COPY_INSTEAD_OF_MOVE
cid#1545931 COPY_INSTEAD_OF_MOVE
cid#1545926 COPY_INSTEAD_OF_MOVE
cid#1545909 COPY_INSTEAD_OF_MOVE
cid#1545899 COPY_INSTEAD_OF_MOVE
cid#1545896 COPY_INSTEAD_OF_MOVE
cid#1545894 COPY_INSTEAD_OF_MOVE
cid#1545858 COPY_INSTEAD_OF_MOVE
cid#1545823 COPY_INSTEAD_OF_MOVE
cid#1545820 COPY_INSTEAD_OF_MOVE
cid#1545819 COPY_INSTEAD_OF_MOVE
cid#1545772 COPY_INSTEAD_OF_MOVE
cid#1545749 COPY_INSTEAD_OF_MOVE
cid#1545743 COPY_INSTEAD_OF_MOVE
cid#1545739 COPY_INSTEAD_OF_MOVE
cid#1545635 COPY_INSTEAD_OF_MOVE
cid#1545603 COPY_INSTEAD_OF_MOVE
cid#1545602 COPY_INSTEAD_OF_MOVE
cid#1545592 COPY_INSTEAD_OF_MOVE
cid#1545544 COPY_INSTEAD_OF_MOVE
cid#1545532 COPY_INSTEAD_OF_MOVE
cid#1545520 COPY_INSTEAD_OF_MOVE
cid#1545512 COPY_INSTEAD_OF_MOVE
cid#1545490 COPY_INSTEAD_OF_MOVE
cid#1545483 COPY_INSTEAD_OF_MOVE
cid#1545467 COPY_INSTEAD_OF_MOVE
cid#1545461 COPY_INSTEAD_OF_MOVE
cid#1545458 COPY_INSTEAD_OF_MOVE
cid#1545428 COPY_INSTEAD_OF_MOVE
cid#1545394 COPY_INSTEAD_OF_MOVE
cid#1545385 COPY_INSTEAD_OF_MOVE
cid#1545383 COPY_INSTEAD_OF_MOVE
cid#1545366 COPY_INSTEAD_OF_MOVE
cid#1545357 COPY_INSTEAD_OF_MOVE

Change-Id: I76224326977b4067b94ca3176cad1ca6de17930a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160847
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-16 22:39:20 +01:00

112 lines
2.9 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "STLPropertySet.hxx"
#include <sal/log.hxx>
using com::sun::star::uno::Any;
namespace sd
{
STLPropertySet::STLPropertySet()
{
}
STLPropertySet::~STLPropertySet()
{
}
void STLPropertySet::setPropertyDefaultValue( sal_Int32 nHandle, const Any& rValue )
{
maPropertyMap[nHandle] = STLPropertyMapEntry(rValue);
}
void STLPropertySet::setPropertyValue( sal_Int32 nHandle, const Any& rValue )
{
PropertyMapIter aIter;
if( findProperty( nHandle, aIter ) )
{
(*aIter).second.mnState = STLPropertyState::Direct;
(*aIter).second.maValue = rValue;
}
else
{
SAL_WARN("sd", "sd::STLPropertySet::setPropertyValue(), unknown property!");
}
}
Any STLPropertySet::getPropertyValue( sal_Int32 nHandle ) const
{
PropertyMapConstIter aIter;
if( findProperty( nHandle, aIter ) )
{
return (*aIter).second.maValue;
}
else
{
SAL_WARN("sd", "sd::STLPropertySet::getPropertyValue(), unknown property!");
Any aAny;
return aAny;
}
}
STLPropertyState STLPropertySet::getPropertyState( sal_Int32 nHandle ) const
{
PropertyMapConstIter aIter;
if( findProperty( nHandle, aIter ) )
{
return (*aIter).second.mnState;
}
else
{
SAL_WARN("sd", "sd::STLPropertySet::getPropertyState(), unknown property!");
return STLPropertyState::Ambiguous;
}
}
void STLPropertySet::setPropertyState( sal_Int32 nHandle, STLPropertyState nState )
{
PropertyMapIter aIter;
if( findProperty( nHandle, aIter ) )
{
(*aIter).second.mnState = nState;
}
else
{
SAL_WARN("sd","sd::STLPropertySet::setPropertyState(), unknown property!");
}
}
bool STLPropertySet::findProperty( sal_Int32 nHandle, PropertyMapIter& rIter )
{
rIter = maPropertyMap.find(nHandle);
return( rIter != maPropertyMap.end() );
}
bool STLPropertySet::findProperty( sal_Int32 nHandle, PropertyMapConstIter& rIter ) const
{
rIter = maPropertyMap.find(nHandle);
return( rIter != maPropertyMap.end() );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */