lok: vcl: fix multiple floatwin removal case more robustly.
[LibreOffice.git] / reportdesign / source / core / api / FormatCondition.cxx
blob6a484663116d1194b35042b38f3afd8d074b5f99
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 .
19 #include <FormatCondition.hxx>
20 #include <com/sun/star/beans/PropertyAttribute.hpp>
21 #include <strings.hxx>
22 #include <tools/color.hxx>
23 #include <connectivity/dbtools.hxx>
24 #include <cppuhelper/supportsservice.hxx>
25 #include <Tools.hxx>
26 #include <com/sun/star/text/ParagraphVertAlign.hpp>
27 #include <ReportHelperImpl.hxx>
29 namespace reportdesign
32 using namespace com::sun::star;
34 uno::Reference< uno::XInterface > OFormatCondition::create(uno::Reference< uno::XComponentContext > const & xContext)
36 return *(new OFormatCondition(xContext));
40 OFormatCondition::OFormatCondition(uno::Reference< uno::XComponentContext > const & _xContext)
41 :FormatConditionBase(m_aMutex)
42 ,FormatConditionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >())
43 ,m_bEnabled(true)
47 OFormatCondition::~OFormatCondition()
51 IMPLEMENT_FORWARD_XINTERFACE2(OFormatCondition,FormatConditionBase,FormatConditionPropertySet)
53 void SAL_CALL OFormatCondition::dispose()
55 FormatConditionPropertySet::dispose();
56 cppu::WeakComponentImplHelperBase::dispose();
59 OUString OFormatCondition::getImplementationName_Static( )
61 return OUString("com.sun.star.comp.report.OFormatCondition");
65 OUString SAL_CALL OFormatCondition::getImplementationName( )
67 return getImplementationName_Static();
70 uno::Sequence< OUString > OFormatCondition::getSupportedServiceNames_Static( )
72 uno::Sequence< OUString > aServices { SERVICE_FORMATCONDITION };
74 return aServices;
77 uno::Sequence< OUString > SAL_CALL OFormatCondition::getSupportedServiceNames( )
79 return getSupportedServiceNames_Static();
82 sal_Bool SAL_CALL OFormatCondition::supportsService(const OUString& ServiceName)
84 return cppu::supportsService(this, ServiceName);
87 uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormatCondition::getPropertySetInfo( )
89 return FormatConditionPropertySet::getPropertySetInfo();
92 void SAL_CALL OFormatCondition::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
94 FormatConditionPropertySet::setPropertyValue( aPropertyName, aValue );
97 uno::Any SAL_CALL OFormatCondition::getPropertyValue( const OUString& PropertyName )
99 return FormatConditionPropertySet::getPropertyValue( PropertyName);
102 void SAL_CALL OFormatCondition::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
104 FormatConditionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
107 void SAL_CALL OFormatCondition::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
109 FormatConditionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
112 void SAL_CALL OFormatCondition::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
114 FormatConditionPropertySet::addVetoableChangeListener( PropertyName, aListener );
117 void SAL_CALL OFormatCondition::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
119 FormatConditionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
122 // XFormatCondition
123 sal_Bool SAL_CALL OFormatCondition::getEnabled()
125 ::osl::MutexGuard aGuard(m_aMutex);
126 return m_bEnabled;
129 void SAL_CALL OFormatCondition::setEnabled( sal_Bool _enabled )
131 set(PROPERTY_ENABLED,_enabled,m_bEnabled);
134 OUString SAL_CALL OFormatCondition::getFormula()
136 ::osl::MutexGuard aGuard(m_aMutex);
137 return m_sFormula;
140 void SAL_CALL OFormatCondition::setFormula( const OUString& _formula )
142 set(PROPERTY_FORMULA,_formula,m_sFormula);
145 // XReportControlFormat
146 REPORTCONTROLFORMAT_IMPL(OFormatCondition,m_aFormatProperties)
148 } // namespace reportdesign
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */