LCOV - code coverage report
Current view: top level - reportdesign/source/core/api - ImageControl.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 27 190 14.2 %
Date: 2014-11-03 Functions: 11 196 5.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : #include "ImageControl.hxx"
      20             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      21             : #include <com/sun/star/beans/XPropertyState.hpp>
      22             : #include "corestrings.hrc"
      23             : #include "core_resource.hrc"
      24             : #include "core_resource.hxx"
      25             : #include "Tools.hxx"
      26             : #include <tools/color.hxx>
      27             : #include <tools/debug.hxx>
      28             : #include <comphelper/property.hxx>
      29             : #include <cppuhelper/supportsservice.hxx>
      30             : #include "FormatCondition.hxx"
      31             : #include <com/sun/star/awt/ImageScaleMode.hpp>
      32             : #include <com/sun/star/text/ParagraphVertAlign.hpp>
      33             : #include "ReportHelperImpl.hxx"
      34             : 
      35             : namespace reportdesign
      36             : {
      37             : 
      38             :     using namespace com::sun::star;
      39             :     using namespace comphelper;
      40           2 : uno::Sequence< OUString > lcl_getImageOptionals()
      41             : {
      42             :     OUString pProps[] = {
      43             :             OUString(PROPERTY_CHARCOLOR)
      44             :             ,OUString(PROPERTY_CHAREMPHASIS)
      45             :             ,OUString(PROPERTY_CHARFONTCHARSET)
      46             :             ,OUString(PROPERTY_CHARFONTFAMILY)
      47             :             ,OUString(PROPERTY_CHARFONTNAME)
      48             :             ,OUString(PROPERTY_CHARFONTPITCH)
      49             :             ,OUString(PROPERTY_CHARFONTSTYLENAME)
      50             :             ,OUString(PROPERTY_CHARHEIGHT)
      51             :             ,OUString(PROPERTY_CHARPOSTURE)
      52             :             ,OUString(PROPERTY_CHARRELIEF)
      53             :             ,OUString(PROPERTY_FONTDESCRIPTOR)
      54             :             ,OUString(PROPERTY_FONTDESCRIPTORASIAN)
      55             :             ,OUString(PROPERTY_FONTDESCRIPTORCOMPLEX)
      56             :             ,OUString(PROPERTY_CONTROLTEXTEMPHASISMARK)
      57             :             ,OUString(PROPERTY_CHARROTATION)
      58             :             ,OUString(PROPERTY_CHARSCALEWIDTH)
      59             :             ,OUString(PROPERTY_CHARSTRIKEOUT)
      60             :             ,OUString(PROPERTY_CHARUNDERLINECOLOR)
      61             :             ,OUString(PROPERTY_CHARUNDERLINE)
      62             :             ,OUString(PROPERTY_CHARWEIGHT)
      63             :             ,OUString(PROPERTY_CHARWORDMODE)
      64             :             ,OUString(PROPERTY_CHARFLASH)
      65             :             ,OUString(PROPERTY_CHARAUTOKERNING)
      66             :             ,OUString(PROPERTY_CHARESCAPEMENTHEIGHT)
      67             :             ,OUString(PROPERTY_CHARLOCALE)
      68             :             ,OUString(PROPERTY_CHARESCAPEMENT)
      69             :             ,OUString(PROPERTY_CHARCASEMAP)
      70             :             ,OUString(PROPERTY_CHARCOMBINEISON)
      71             :             ,OUString(PROPERTY_CHARCOMBINEPREFIX)
      72             :             ,OUString(PROPERTY_CHARCOMBINESUFFIX)
      73             :             ,OUString(PROPERTY_CHARHIDDEN)
      74             :             ,OUString(PROPERTY_CHARSHADOWED)
      75             :             ,OUString(PROPERTY_CHARCONTOURED)
      76             :             ,OUString(PROPERTY_VISITEDCHARSTYLENAME)
      77             :             ,OUString(PROPERTY_UNVISITEDCHARSTYLENAME)
      78             :             ,OUString(PROPERTY_CHARKERNING)
      79             :             ,OUString(PROPERTY_MASTERFIELDS)
      80             :             ,OUString(PROPERTY_DETAILFIELDS)
      81             :             ,OUString(PROPERTY_PARAADJUST)
      82             :             , OUString(PROPERTY_CHAREMPHASISASIAN)
      83             :             , OUString(PROPERTY_CHARFONTNAMEASIAN)
      84             :             , OUString(PROPERTY_CHARFONTSTYLENAMEASIAN)
      85             :             , OUString(PROPERTY_CHARFONTFAMILYASIAN)
      86             :             , OUString(PROPERTY_CHARFONTCHARSETASIAN)
      87             :             , OUString(PROPERTY_CHARFONTPITCHASIAN)
      88             :             , OUString(PROPERTY_CHARHEIGHTASIAN)
      89             :             , OUString(PROPERTY_CHARUNDERLINEASIAN)
      90             :             , OUString(PROPERTY_CHARWEIGHTASIAN)
      91             :             , OUString(PROPERTY_CHARPOSTUREASIAN)
      92             :             , OUString(PROPERTY_CHARWORDMODEASIAN)
      93             :             , OUString(PROPERTY_CHARROTATIONASIAN)
      94             :             , OUString(PROPERTY_CHARSCALEWIDTHASIAN)
      95             :             , OUString(PROPERTY_CHARLOCALEASIAN)
      96             :             , OUString(PROPERTY_CHAREMPHASISCOMPLEX)
      97             :             , OUString(PROPERTY_CHARFONTNAMECOMPLEX)
      98             :             , OUString(PROPERTY_CHARFONTSTYLENAMECOMPLEX)
      99             :             , OUString(PROPERTY_CHARFONTFAMILYCOMPLEX)
     100             :             , OUString(PROPERTY_CHARFONTCHARSETCOMPLEX)
     101             :             , OUString(PROPERTY_CHARFONTPITCHCOMPLEX)
     102             :             , OUString(PROPERTY_CHARHEIGHTCOMPLEX)
     103             :             , OUString(PROPERTY_CHARUNDERLINECOMPLEX)
     104             :             , OUString(PROPERTY_CHARWEIGHTCOMPLEX)
     105             :             , OUString(PROPERTY_CHARPOSTURECOMPLEX)
     106             :             , OUString(PROPERTY_CHARWORDMODECOMPLEX)
     107             :             , OUString(PROPERTY_CHARROTATIONCOMPLEX)
     108             :             , OUString(PROPERTY_CHARSCALEWIDTHCOMPLEX)
     109             :             , OUString(PROPERTY_CHARLOCALECOMPLEX)
     110             : 
     111         136 :     };
     112         136 :     return uno::Sequence< OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
     113             : }
     114             : 
     115             : 
     116           2 : OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext)
     117             : :ImageControlBase(m_aMutex)
     118             : ,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
     119             : ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
     120             : ,m_nScaleMode(awt::ImageScaleMode::NONE)
     121           2 : ,m_bPreserveIRI(true)
     122             : {
     123           2 :     m_aProps.aComponent.m_sName  = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
     124           2 : }
     125             : 
     126           0 : OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext
     127             :                            ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
     128             :                            ,uno::Reference< drawing::XShape >& _xShape)
     129             : :ImageControlBase(m_aMutex)
     130             : ,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
     131             : ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
     132             : ,m_nScaleMode(awt::ImageScaleMode::NONE)
     133           0 : ,m_bPreserveIRI(true)
     134             : {
     135           0 :     m_aProps.aComponent.m_sName  = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
     136           0 :     m_aProps.aComponent.m_xFactory = _xFactory;
     137           0 :     osl_atomic_increment( &m_refCount );
     138             :     {
     139           0 :         m_aProps.aComponent.setShape(_xShape,this,m_refCount);
     140             :     }
     141           0 :     osl_atomic_decrement( &m_refCount );
     142           0 : }
     143             : 
     144           4 : OImageControl::~OImageControl()
     145             : {
     146           4 : }
     147             : 
     148             : //IMPLEMENT_FORWARD_XINTERFACE2(OImageControl,ImageControlBase,ImageControlPropertySet)
     149          40 : IMPLEMENT_FORWARD_REFCOUNT( OImageControl, ImageControlBase )
     150             : 
     151           2 : uno::Any SAL_CALL OImageControl::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException, std::exception)
     152             : {
     153           2 :     uno::Any aReturn = ImageControlBase::queryInterface(_rType);
     154           2 :     if ( !aReturn.hasValue() )
     155           0 :         aReturn = ImageControlPropertySet::queryInterface(_rType);
     156             : 
     157           2 :     if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
     158           0 :         return aReturn;
     159             : 
     160           2 :     return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
     161             : }
     162             : 
     163             : 
     164           2 : void SAL_CALL OImageControl::dispose() throw(uno::RuntimeException, std::exception)
     165             : {
     166           2 :     ImageControlPropertySet::dispose();
     167           2 :     cppu::WeakComponentImplHelperBase::dispose();
     168           2 : }
     169             : 
     170          16 : OUString OImageControl::getImplementationName_Static(  ) throw(uno::RuntimeException)
     171             : {
     172          16 :     return OUString("com.sun.star.comp.report.OImageControl");
     173             : }
     174             : 
     175             : 
     176           0 : OUString SAL_CALL OImageControl::getImplementationName(  ) throw(uno::RuntimeException, std::exception)
     177             : {
     178           0 :     return getImplementationName_Static();
     179             : }
     180             : 
     181           2 : uno::Sequence< OUString > OImageControl::getSupportedServiceNames_Static(  ) throw(uno::RuntimeException)
     182             : {
     183           2 :     uno::Sequence< OUString > aServices(1);
     184           2 :     aServices.getArray()[0] = SERVICE_IMAGECONTROL;
     185             : 
     186           2 :     return aServices;
     187             : }
     188             : 
     189           2 : uno::Reference< uno::XInterface > OImageControl::create(uno::Reference< uno::XComponentContext > const & xContext)
     190             : {
     191           2 :     return *(new OImageControl(xContext));
     192             : }
     193             : 
     194             : 
     195           0 : uno::Sequence< OUString > SAL_CALL OImageControl::getSupportedServiceNames(  ) throw(uno::RuntimeException, std::exception)
     196             : {
     197           0 :     return getSupportedServiceNames_Static();
     198             : }
     199             : 
     200           0 : sal_Bool SAL_CALL OImageControl::supportsService(const OUString& ServiceName) throw( uno::RuntimeException, std::exception )
     201             : {
     202           0 :     return cppu::supportsService(this, ServiceName);
     203             : }
     204             : 
     205             : // XReportComponent
     206           0 : REPORTCOMPONENT_IMPL(OImageControl,m_aProps.aComponent)
     207           0 : REPORTCOMPONENT_IMPL2(OImageControl,m_aProps.aComponent)
     208           0 : REPORTCOMPONENT_NOMASTERDETAIL(OImageControl)
     209           0 : NO_REPORTCONTROLFORMAT_IMPL(OImageControl)
     210           0 : OUString SAL_CALL OImageControl::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
     211             : {
     212           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     213           0 :     return m_aProps.aFormatProperties.sHyperLinkURL;
     214             : }
     215           0 : void SAL_CALL OImageControl::setHyperLinkURL(const OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
     216             : {
     217           0 :     set(PROPERTY_HYPERLINKURL,the_value,m_aProps.aFormatProperties.sHyperLinkURL);
     218           0 : }
     219           0 : OUString SAL_CALL OImageControl::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
     220             : {
     221           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     222           0 :     return m_aProps.aFormatProperties.sHyperLinkTarget;
     223             : }
     224           0 : void SAL_CALL OImageControl::setHyperLinkTarget(const OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
     225             : {
     226           0 :     set(PROPERTY_HYPERLINKTARGET,the_value,m_aProps.aFormatProperties.sHyperLinkTarget);
     227           0 : }
     228           0 : OUString SAL_CALL OImageControl::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
     229             : {
     230           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     231           0 :     return m_aProps.aFormatProperties.sHyperLinkName;
     232             : }
     233           0 : void SAL_CALL OImageControl::setHyperLinkName(const OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
     234             : {
     235           0 :     set(PROPERTY_HYPERLINKNAME,the_value,m_aProps.aFormatProperties.sHyperLinkName);
     236           0 : }
     237             : 
     238             : 
     239           0 : ::sal_Int32 SAL_CALL OImageControl::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     240             : {
     241           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     242           0 :     return m_aProps.aFormatProperties.m_bBackgroundTransparent ? COL_TRANSPARENT : m_aProps.aFormatProperties.nBackgroundColor;
     243             : }
     244             : 
     245           0 : void SAL_CALL OImageControl::setControlBackground( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException, beans::UnknownPropertyException, std::exception)
     246             : {
     247           0 :     bool bTransparent = _backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT);
     248           0 :     setControlBackgroundTransparent(bTransparent);
     249           0 :     if ( !bTransparent )
     250           0 :         set(PROPERTY_CONTROLBACKGROUND,_backgroundcolor,m_aProps.aFormatProperties.nBackgroundColor);
     251           0 : }
     252             : 
     253           0 : sal_Bool SAL_CALL OImageControl::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     254             : {
     255           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     256           0 :     return m_aProps.aFormatProperties.m_bBackgroundTransparent;
     257             : }
     258             : 
     259           0 : void SAL_CALL OImageControl::setControlBackgroundTransparent( sal_Bool _controlbackgroundtransparent ) throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     260             : {
     261           0 :     set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT,_controlbackgroundtransparent,m_aProps.aFormatProperties.m_bBackgroundTransparent);
     262           0 :     if ( _controlbackgroundtransparent )
     263           0 :         set(PROPERTY_CONTROLBACKGROUND,static_cast<sal_Int32>(COL_TRANSPARENT),m_aProps.aFormatProperties.nBackgroundColor);
     264           0 : }
     265             : 
     266             : 
     267           0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL OImageControl::getPropertySetInfo(  ) throw(uno::RuntimeException, std::exception)
     268             : {
     269           0 :     return ImageControlPropertySet::getPropertySetInfo();
     270             : }
     271             : 
     272           0 : void SAL_CALL OImageControl::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     273             : {
     274           0 :     ImageControlPropertySet::setPropertyValue( aPropertyName, aValue );
     275           0 : }
     276             : 
     277           0 : uno::Any SAL_CALL OImageControl::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     278             : {
     279           0 :     return ImageControlPropertySet::getPropertyValue( PropertyName);
     280             : }
     281             : 
     282           0 : void SAL_CALL OImageControl::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     283             : {
     284           0 :     ImageControlPropertySet::addPropertyChangeListener( aPropertyName, xListener );
     285           0 : }
     286             : 
     287           0 : void SAL_CALL OImageControl::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     288             : {
     289           0 :     ImageControlPropertySet::removePropertyChangeListener( aPropertyName, aListener );
     290           0 : }
     291             : 
     292           0 : void SAL_CALL OImageControl::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     293             : {
     294           0 :     ImageControlPropertySet::addVetoableChangeListener( PropertyName, aListener );
     295           0 : }
     296             : 
     297           0 : void SAL_CALL OImageControl::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     298             : {
     299           0 :     ImageControlPropertySet::removeVetoableChangeListener( PropertyName, aListener );
     300           0 : }
     301             : 
     302             : // XReportControlModel
     303           0 : OUString SAL_CALL OImageControl::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     304             : {
     305           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     306           0 :     return m_aProps.aDataField;
     307             : }
     308             : 
     309           0 : void SAL_CALL OImageControl::setDataField( const OUString& _datafield ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     310             : {
     311           0 :     set(PROPERTY_DATAFIELD,_datafield,m_aProps.aDataField);
     312           0 : }
     313             : 
     314             : 
     315           0 : sal_Bool SAL_CALL OImageControl::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     316             : {
     317           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     318           0 :     return m_aProps.bPrintWhenGroupChange;
     319             : }
     320             : 
     321           0 : void SAL_CALL OImageControl::setPrintWhenGroupChange( sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     322             : {
     323           0 :     set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
     324           0 : }
     325             : 
     326           0 : OUString SAL_CALL OImageControl::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     327             : {
     328           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     329           0 :     return m_aProps.aConditionalPrintExpression;
     330             : }
     331             : 
     332           0 : void SAL_CALL OImageControl::setConditionalPrintExpression( const OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     333             : {
     334           0 :     set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
     335           0 : }
     336             : 
     337             : 
     338             : 
     339             : // XCloneable
     340           0 : uno::Reference< util::XCloneable > SAL_CALL OImageControl::createClone(  ) throw (uno::RuntimeException, std::exception)
     341             : {
     342           0 :     uno::Reference< report::XReportComponent> xSource = this;
     343           0 :     uno::Reference< report::XImageControl> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_IMAGECONTROL),uno::UNO_QUERY_THROW);
     344           0 :     return xSet.get();
     345             : }
     346             : 
     347             : 
     348             : // XImageControl
     349             : 
     350           0 : OUString SAL_CALL OImageControl::getImageURL() throw (uno::RuntimeException, std::exception)
     351             : {
     352           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     353           0 :     return m_aImageURL;
     354             : }
     355             : 
     356           0 : void SAL_CALL OImageControl::setImageURL( const OUString& _imageurl ) throw (uno::RuntimeException, std::exception)
     357             : {
     358           0 :     set(PROPERTY_IMAGEURL,_imageurl,m_aImageURL);
     359           0 : }
     360             : 
     361           0 : uno::Reference< awt::XImageProducer > SAL_CALL OImageControl::getImageProducer(  ) throw (uno::RuntimeException, std::exception)
     362             : {
     363           0 :     return uno::Reference< awt::XImageProducer >();
     364             : }
     365             : 
     366             : // XChild
     367           0 : uno::Reference< uno::XInterface > SAL_CALL OImageControl::getParent(  ) throw (uno::RuntimeException, std::exception)
     368             : {
     369           0 :     return OShapeHelper::getParent(this);
     370             : }
     371             : 
     372           0 : void SAL_CALL OImageControl::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException, std::exception)
     373             : {
     374           0 :     OShapeHelper::setParent(Parent,this);
     375           0 : }
     376           0 : uno::Reference< report::XFormatCondition > SAL_CALL OImageControl::createFormatCondition(  ) throw (uno::Exception, uno::RuntimeException, std::exception)
     377             : {
     378           0 :     return new OFormatCondition(m_aProps.aComponent.m_xContext);
     379             : }
     380             : 
     381             : // XContainer
     382           0 : void SAL_CALL OImageControl::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException, std::exception)
     383             : {
     384           0 :     m_aProps.addContainerListener(xListener);
     385           0 : }
     386             : 
     387           0 : void SAL_CALL OImageControl::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException, std::exception)
     388             : {
     389           0 :     m_aProps.removeContainerListener(xListener);
     390           0 : }
     391             : 
     392             : // XElementAccess
     393           0 : uno::Type SAL_CALL OImageControl::getElementType(  ) throw (uno::RuntimeException, std::exception)
     394             : {
     395           0 :     return cppu::UnoType<report::XFormatCondition>::get();
     396             : }
     397             : 
     398           0 : sal_Bool SAL_CALL OImageControl::hasElements(  ) throw (uno::RuntimeException, std::exception)
     399             : {
     400           0 :     return m_aProps.hasElements();
     401             : }
     402             : 
     403             : // XIndexContainer
     404           0 : void SAL_CALL OImageControl::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     405             : {
     406           0 :     m_aProps.insertByIndex(Index,Element);
     407           0 : }
     408             : 
     409           0 : void SAL_CALL OImageControl::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     410             : {
     411           0 :     m_aProps.removeByIndex(Index);
     412           0 : }
     413             : 
     414             : // XIndexReplace
     415           0 : void SAL_CALL OImageControl::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     416             : {
     417           0 :     m_aProps.replaceByIndex(Index,Element);
     418           0 : }
     419             : 
     420             : // XIndexAccess
     421           0 : ::sal_Int32 SAL_CALL OImageControl::getCount(  ) throw (uno::RuntimeException, std::exception)
     422             : {
     423           0 :     return m_aProps.getCount();
     424             : }
     425             : 
     426           0 : uno::Any SAL_CALL OImageControl::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     427             : {
     428           0 :     return m_aProps.getByIndex( Index );
     429             : }
     430             : 
     431             : 
     432             : // XShape
     433           0 : awt::Point SAL_CALL OImageControl::getPosition(  ) throw (uno::RuntimeException, std::exception)
     434             : {
     435           0 :     return OShapeHelper::getPosition(this);
     436             : }
     437             : 
     438           0 : void SAL_CALL OImageControl::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException, std::exception)
     439             : {
     440           0 :     OShapeHelper::setPosition(aPosition,this);
     441           0 : }
     442             : 
     443           0 : awt::Size SAL_CALL OImageControl::getSize(  ) throw (uno::RuntimeException, std::exception)
     444             : {
     445           0 :     return OShapeHelper::getSize(this);
     446             : }
     447             : 
     448           0 : void SAL_CALL OImageControl::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException, std::exception)
     449             : {
     450           0 :     OShapeHelper::setSize(aSize,this);
     451           0 : }
     452             : 
     453             : 
     454             : // XShapeDescriptor
     455           0 : OUString SAL_CALL OImageControl::getShapeType(  ) throw (uno::RuntimeException, std::exception)
     456             : {
     457           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     458           0 :     if ( m_aProps.aComponent.m_xShape.is() )
     459           0 :         return m_aProps.aComponent.m_xShape->getShapeType();
     460           0 :     return OUString("com.sun.star.drawing.ControlShape");
     461             : }
     462             : 
     463           0 : ::sal_Int16 SAL_CALL OImageControl::getScaleMode() throw (uno::RuntimeException, std::exception)
     464             : {
     465           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     466           0 :     return m_nScaleMode;
     467             : }
     468             : 
     469           0 : void SAL_CALL OImageControl::setScaleMode( ::sal_Int16 _scalemode ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
     470             : {
     471           0 :     if ( _scalemode < awt::ImageScaleMode::NONE ||_scalemode > awt::ImageScaleMode::ANISOTROPIC )
     472           0 :         throw lang::IllegalArgumentException();
     473           0 :     set(PROPERTY_SCALEMODE,_scalemode,m_nScaleMode);
     474           0 : }
     475             : 
     476           0 : sal_Bool SAL_CALL OImageControl::getPreserveIRI() throw (uno::RuntimeException, std::exception)
     477             : {
     478           0 :     ::osl::MutexGuard aGuard(m_aMutex);
     479           0 :     return m_bPreserveIRI;
     480             : }
     481             : 
     482           0 : void SAL_CALL OImageControl::setPreserveIRI( sal_Bool _preserveiri ) throw (uno::RuntimeException, std::exception)
     483             : {
     484           0 :     set(PROPERTY_PRESERVEIRI,_preserveiri,m_bPreserveIRI);
     485           0 : }
     486             : 
     487             : } // namespace reportdesign
     488             : 
     489             : 
     490             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10