LCOV - code coverage report
Current view: top level - chart2/source/controller/chartapiwrapper - DiagramWrapper.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 688 868 79.3 %
Date: 2014-04-11 Functions: 105 123 85.4 %
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             : 
      20             : #include "DiagramWrapper.hxx"
      21             : #include "macros.hxx"
      22             : #include "servicenames_charttypes.hxx"
      23             : #include "DataSeriesPointWrapper.hxx"
      24             : #include "AxisWrapper.hxx"
      25             : #include "AxisHelper.hxx"
      26             : #include "Chart2ModelContact.hxx"
      27             : #include "PositionAndSizeHelper.hxx"
      28             : #include "WallFloorWrapper.hxx"
      29             : #include "MinMaxLineWrapper.hxx"
      30             : #include "UpDownBarWrapper.hxx"
      31             : #include "DiagramHelper.hxx"
      32             : #include "DataSourceHelper.hxx"
      33             : #include "ChartModelHelper.hxx"
      34             : #include "WrappedIgnoreProperty.hxx"
      35             : #include "WrappedAxisAndGridExistenceProperties.hxx"
      36             : #include "WrappedStatisticProperties.hxx"
      37             : #include "WrappedSymbolProperties.hxx"
      38             : #include "WrappedDataCaptionProperties.hxx"
      39             : #include "WrappedSplineProperties.hxx"
      40             : #include "WrappedStockProperties.hxx"
      41             : #include "WrappedSceneProperty.hxx"
      42             : #include "WrappedGL3DProperties.hxx"
      43             : #include "RelativePositionHelper.hxx"
      44             : #include "ContainerHelper.hxx"
      45             : #include "ControllerLockGuard.hxx"
      46             : #include "ModifyListenerHelper.hxx"
      47             : #include "DisposeHelper.hxx"
      48             : #include <comphelper/InlineContainer.hxx>
      49             : #include "WrappedAutomaticPositionProperties.hxx"
      50             : #include "CommonConverters.hxx"
      51             : #include <unonames.hxx>
      52             : 
      53             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      54             : #include <com/sun/star/chart2/XTitled.hpp>
      55             : #include <com/sun/star/chart/ChartDataRowSource.hpp>
      56             : #include <com/sun/star/chart2/RelativeSize.hpp>
      57             : #include <com/sun/star/chart2/RelativePosition.hpp>
      58             : #include <com/sun/star/chart/ChartSolidType.hpp>
      59             : 
      60             : #include "LinePropertiesHelper.hxx"
      61             : #include "FillProperties.hxx"
      62             : #include "UserDefinedProperties.hxx"
      63             : #include "SceneProperties.hxx"
      64             : 
      65             : #include <algorithm>
      66             : #include <rtl/ustrbuf.hxx>
      67             : #include <com/sun/star/lang/XServiceName.hpp>
      68             : #include <com/sun/star/util/XRefreshable.hpp>
      69             : 
      70             : using namespace ::com::sun::star;
      71             : using namespace ::chart::wrapper;
      72             : 
      73             : using ::com::sun::star::uno::Reference;
      74             : using ::com::sun::star::uno::Any;
      75             : using ::com::sun::star::uno::Sequence;
      76             : using ::com::sun::star::beans::Property;
      77             : using ::com::sun::star::chart::XAxis;
      78             : using ::osl::MutexGuard;
      79             : 
      80             : namespace
      81             : {
      82          15 : static const OUString lcl_aServiceName( "com.sun.star.comp.chart.Diagram" );
      83             : 
      84             : enum
      85             : {
      86             :     PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS,
      87             :     PROP_DIAGRAM_PERCENT_STACKED,
      88             :     PROP_DIAGRAM_STACKED,
      89             :     PROP_DIAGRAM_THREE_D,
      90             :     PROP_DIAGRAM_SOLIDTYPE,
      91             :     PROP_DIAGRAM_DEEP,
      92             :     PROP_DIAGRAM_VERTICAL,
      93             :     PROP_DIAGRAM_NUMBER_OF_LINES,
      94             :     PROP_DIAGRAM_STACKED_BARS_CONNECTED,
      95             :     PROP_DIAGRAM_DATAROW_SOURCE,
      96             : 
      97             :     PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
      98             :     PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
      99             : 
     100             :     PROP_DIAGRAM_SORT_BY_X_VALUES,
     101             : 
     102             :     PROP_DIAGRAM_STARTING_ANGLE,
     103             : 
     104             :     PROP_DIAGRAM_RIGHT_ANGLED_AXES,
     105             :     PROP_DIAGRAM_PERSPECTIVE,
     106             :     PROP_DIAGRAM_ROTATION_HORIZONTAL,
     107             :     PROP_DIAGRAM_ROTATION_VERTICAL,
     108             : 
     109             :     PROP_DIAGRAM_MISSING_VALUE_TREATMENT,
     110             : 
     111             :     PROP_DIAGRAM_HAS_X_AXIS,
     112             :     PROP_DIAGRAM_HAS_X_AXIS_DESCR,
     113             :     PROP_DIAGRAM_HAS_X_AXIS_TITLE,
     114             :     PROP_DIAGRAM_HAS_X_AXIS_GRID,
     115             :     PROP_DIAGRAM_HAS_X_AXIS_HELP_GRID,
     116             : 
     117             :     PROP_DIAGRAM_HAS_Y_AXIS,
     118             :     PROP_DIAGRAM_HAS_Y_AXIS_DESCR,
     119             :     PROP_DIAGRAM_HAS_Y_AXIS_TITLE,
     120             :     PROP_DIAGRAM_HAS_Y_AXIS_GRID,
     121             :     PROP_DIAGRAM_HAS_Y_AXIS_HELP_GRID,
     122             : 
     123             :     PROP_DIAGRAM_HAS_Z_AXIS,
     124             :     PROP_DIAGRAM_HAS_Z_AXIS_DESCR,
     125             :     PROP_DIAGRAM_HAS_Z_AXIS_TITLE,
     126             :     PROP_DIAGRAM_HAS_Z_AXIS_GRID,
     127             :     PROP_DIAGRAM_HAS_Z_AXIS_HELP_GRID,
     128             : 
     129             :     PROP_DIAGRAM_HAS_SECOND_X_AXIS,
     130             :     PROP_DIAGRAM_HAS_SECOND_X_AXIS_DESCR,
     131             : 
     132             :     PROP_DIAGRAM_HAS_SECOND_Y_AXIS,
     133             :     PROP_DIAGRAM_HAS_SECOND_Y_AXIS_DESCR,
     134             : 
     135             :     PROP_DIAGRAM_HAS_SECOND_X_AXIS_TITLE,
     136             :     PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE,
     137             : 
     138             :     PROP_DIAGRAM_AUTOMATIC_SIZE,
     139             :     PROP_DIAGRAM_DATATABLEHBORDER,
     140             :     PROP_DIAGRAM_DATATABLEVBORDER,
     141             :     PROP_DIAGRAM_DATATABLEOUTLINE,
     142             :     PROP_DIAGRAM_EXTERNALDATA,
     143             : 
     144             :     PROP_DIAGRAM_ROUNDED_EDGE
     145             : };
     146             : 
     147          12 : void lcl_AddPropertiesToVector(
     148             :     ::std::vector< Property > & rOutProperties )
     149             : {
     150             :     rOutProperties.push_back(
     151             :         Property( "AttributedDataPoints",
     152             :                   PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS,
     153          12 :                   ::getCppuType( reinterpret_cast< const uno::Sequence< uno::Sequence< sal_Int32 > > * >(0)),
     154             :                   beans::PropertyAttribute::BOUND
     155          24 :                   | beans::PropertyAttribute::MAYBEVOID ));
     156             : 
     157             :     // see com.sun.star.chart.StackableDiagram
     158             :     rOutProperties.push_back(
     159             :         Property( "Percent",
     160             :                   PROP_DIAGRAM_PERCENT_STACKED,
     161          12 :                   ::getBooleanCppuType(),
     162             :                   beans::PropertyAttribute::BOUND
     163          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     164             :     rOutProperties.push_back(
     165             :         Property( "Stacked",
     166             :                   PROP_DIAGRAM_STACKED,
     167          12 :                   ::getBooleanCppuType(),
     168             :                   beans::PropertyAttribute::BOUND
     169          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     170             : 
     171             :     rOutProperties.push_back(
     172             :         Property( "Dim3D",
     173             :                   PROP_DIAGRAM_THREE_D,
     174          12 :                   ::getBooleanCppuType(),
     175             :                   beans::PropertyAttribute::BOUND
     176          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     177             : 
     178             :     // see com.sun.star.chart.Chart3DBarProperties
     179             :     rOutProperties.push_back(
     180             :         Property( "SolidType",
     181             :                   PROP_DIAGRAM_SOLIDTYPE,
     182          12 :                   ::getCppuType( reinterpret_cast< sal_Int32 * >(0)),
     183             :                   beans::PropertyAttribute::BOUND
     184          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     185             : 
     186             :     // see com.sun.star.chart.BarDiagram
     187             :     rOutProperties.push_back(
     188             :         Property( "Deep",
     189             :                   PROP_DIAGRAM_DEEP,
     190          12 :                   ::getBooleanCppuType(),
     191             :                   beans::PropertyAttribute::BOUND
     192          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     193             :     rOutProperties.push_back(
     194             :         Property( "Vertical",
     195             :                   PROP_DIAGRAM_VERTICAL,
     196          12 :                   ::getBooleanCppuType(),
     197             :                   beans::PropertyAttribute::BOUND
     198          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     199             :     rOutProperties.push_back(
     200             :         Property( "NumberOfLines",
     201             :                   PROP_DIAGRAM_NUMBER_OF_LINES,
     202          12 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
     203             :                   beans::PropertyAttribute::BOUND
     204          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     205             :     rOutProperties.push_back(
     206             :         Property( "StackedBarsConnected",
     207             :                   PROP_DIAGRAM_STACKED_BARS_CONNECTED,
     208          12 :                   ::getBooleanCppuType(),
     209             :                   beans::PropertyAttribute::BOUND
     210          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     211             : 
     212             :     rOutProperties.push_back(
     213             :         Property( "DataRowSource",
     214             :                   PROP_DIAGRAM_DATAROW_SOURCE,
     215          12 :                   ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartDataRowSource * >(0)),
     216             :                   beans::PropertyAttribute::BOUND
     217          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     218             : 
     219             :     rOutProperties.push_back(
     220             :         Property( "GroupBarsPerAxis",
     221             :                   PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
     222          12 :                   ::getBooleanCppuType(),
     223             :                   beans::PropertyAttribute::BOUND
     224          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     225             : 
     226             :     rOutProperties.push_back(
     227             :         Property( "IncludeHiddenCells",
     228             :                   PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
     229          12 :                   ::getBooleanCppuType(),
     230             :                   beans::PropertyAttribute::BOUND
     231          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     232             : 
     233             :     //new for XY charts
     234             :     rOutProperties.push_back(
     235             :         Property( CHART_UNONAME_SORT_BY_XVALUES,
     236             :                   PROP_DIAGRAM_SORT_BY_X_VALUES,
     237          12 :                   ::getBooleanCppuType(),
     238             :                   beans::PropertyAttribute::BOUND
     239          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     240             : 
     241             :     //for pie and donut charts
     242             :     rOutProperties.push_back(
     243             :         Property( "StartingAngle",
     244             :                   PROP_DIAGRAM_STARTING_ANGLE,
     245          12 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0) ),
     246             :                   beans::PropertyAttribute::BOUND
     247          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     248             : 
     249             :     //new for 3D charts
     250             :     rOutProperties.push_back(
     251             :         Property( "RightAngledAxes",
     252             :                   PROP_DIAGRAM_RIGHT_ANGLED_AXES,
     253          12 :                   ::getBooleanCppuType(),
     254             :                   beans::PropertyAttribute::BOUND
     255          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     256             : 
     257             :     rOutProperties.push_back(
     258             :         Property( "Perspective",
     259             :                   PROP_DIAGRAM_PERSPECTIVE,
     260          12 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
     261          12 :                   beans::PropertyAttribute::MAYBEVOID ));
     262             : 
     263             :     rOutProperties.push_back(
     264             :         Property( "RotationHorizontal",
     265             :                   PROP_DIAGRAM_ROTATION_HORIZONTAL,
     266          12 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
     267          12 :                   beans::PropertyAttribute::MAYBEVOID ));
     268             : 
     269             :     rOutProperties.push_back(
     270             :         Property( "RotationVertical",
     271             :                   PROP_DIAGRAM_ROTATION_VERTICAL,
     272          12 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
     273          12 :                   beans::PropertyAttribute::MAYBEVOID ));
     274             : 
     275             :     // XAxisXSupplier
     276             :     rOutProperties.push_back(
     277             :         Property( "HasXAxis",
     278             :                   PROP_DIAGRAM_HAS_X_AXIS,
     279          12 :                   ::getBooleanCppuType(),
     280             :                   beans::PropertyAttribute::BOUND
     281          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     282             :     rOutProperties.push_back(
     283             :         Property( "HasXAxisDescription",
     284             :                   PROP_DIAGRAM_HAS_X_AXIS_DESCR,
     285          12 :                   ::getBooleanCppuType(),
     286             :                   beans::PropertyAttribute::BOUND
     287          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     288             :     rOutProperties.push_back(
     289             :         Property( "HasXAxisTitle",
     290             :                   PROP_DIAGRAM_HAS_X_AXIS_TITLE,
     291          12 :                   ::getBooleanCppuType(),
     292             :                   beans::PropertyAttribute::BOUND
     293          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     294             :     rOutProperties.push_back(
     295             :         Property( "HasXAxisGrid",
     296             :                   PROP_DIAGRAM_HAS_X_AXIS_GRID,
     297          12 :                   ::getBooleanCppuType(),
     298             :                   beans::PropertyAttribute::BOUND
     299          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     300             :     rOutProperties.push_back(
     301             :         Property( "HasXAxisHelpGrid",
     302             :                   PROP_DIAGRAM_HAS_X_AXIS_HELP_GRID,
     303          12 :                   ::getBooleanCppuType(),
     304             :                   beans::PropertyAttribute::BOUND
     305          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     306             : 
     307             :     // XAxisYSupplier
     308             :     rOutProperties.push_back(
     309             :         Property( "HasYAxis",
     310             :                   PROP_DIAGRAM_HAS_Y_AXIS,
     311          12 :                   ::getBooleanCppuType(),
     312             :                   beans::PropertyAttribute::BOUND
     313          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     314             :     rOutProperties.push_back(
     315             :         Property( "HasYAxisDescription",
     316             :                   PROP_DIAGRAM_HAS_Y_AXIS_DESCR,
     317          12 :                   ::getBooleanCppuType(),
     318             :                   beans::PropertyAttribute::BOUND
     319          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     320             :     rOutProperties.push_back(
     321             :         Property( "HasYAxisTitle",
     322             :                   PROP_DIAGRAM_HAS_Y_AXIS_TITLE,
     323          12 :                   ::getBooleanCppuType(),
     324             :                   beans::PropertyAttribute::BOUND
     325          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     326             :     rOutProperties.push_back(
     327             :         Property( "HasYAxisGrid",
     328             :                   PROP_DIAGRAM_HAS_Y_AXIS_GRID,
     329          12 :                   ::getBooleanCppuType(),
     330             :                   beans::PropertyAttribute::BOUND
     331          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     332             :     rOutProperties.push_back(
     333             :         Property( "HasYAxisHelpGrid",
     334             :                   PROP_DIAGRAM_HAS_Y_AXIS_HELP_GRID,
     335          12 :                   ::getBooleanCppuType(),
     336             :                   beans::PropertyAttribute::BOUND
     337          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     338             : 
     339             :     // XAxisZSupplier
     340             :     rOutProperties.push_back(
     341             :         Property( "HasZAxis",
     342             :                   PROP_DIAGRAM_HAS_Z_AXIS,
     343          12 :                   ::getBooleanCppuType(),
     344             :                   beans::PropertyAttribute::BOUND
     345          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     346             :     rOutProperties.push_back(
     347             :         Property( "HasZAxisDescription",
     348             :                   PROP_DIAGRAM_HAS_Z_AXIS_DESCR,
     349          12 :                   ::getBooleanCppuType(),
     350             :                   beans::PropertyAttribute::BOUND
     351          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     352             :     rOutProperties.push_back(
     353             :         Property( "HasZAxisTitle",
     354             :                   PROP_DIAGRAM_HAS_Z_AXIS_TITLE,
     355          12 :                   ::getBooleanCppuType(),
     356             :                   beans::PropertyAttribute::BOUND
     357          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     358             :     rOutProperties.push_back(
     359             :         Property( "HasZAxisGrid",
     360             :                   PROP_DIAGRAM_HAS_Z_AXIS_GRID,
     361          12 :                   ::getBooleanCppuType(),
     362             :                   beans::PropertyAttribute::BOUND
     363          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     364             :     rOutProperties.push_back(
     365             :         Property( "HasZAxisHelpGrid",
     366             :                   PROP_DIAGRAM_HAS_Z_AXIS_HELP_GRID,
     367          12 :                   ::getBooleanCppuType(),
     368             :                   beans::PropertyAttribute::BOUND
     369          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     370             : 
     371             :     // XTwoAxisXSupplier
     372             :     rOutProperties.push_back(
     373             :         Property( "HasSecondaryXAxis",
     374             :                   PROP_DIAGRAM_HAS_SECOND_X_AXIS,
     375          12 :                   ::getBooleanCppuType(),
     376             :                   beans::PropertyAttribute::BOUND
     377          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     378             :     rOutProperties.push_back(
     379             :         Property( "HasSecondaryXAxisDescription",
     380             :                   PROP_DIAGRAM_HAS_SECOND_X_AXIS_DESCR,
     381          12 :                   ::getBooleanCppuType(),
     382             :                   beans::PropertyAttribute::BOUND
     383          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     384             : 
     385             :     // XTwoAxisYSupplier
     386             :     rOutProperties.push_back(
     387             :         Property( "HasSecondaryYAxis",
     388             :                   PROP_DIAGRAM_HAS_SECOND_Y_AXIS,
     389          12 :                   ::getBooleanCppuType(),
     390             :                   beans::PropertyAttribute::BOUND
     391          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     392             :     rOutProperties.push_back(
     393             :         Property( "HasSecondaryYAxisDescription",
     394             :                   PROP_DIAGRAM_HAS_SECOND_Y_AXIS_DESCR,
     395          12 :                   ::getBooleanCppuType(),
     396             :                   beans::PropertyAttribute::BOUND
     397          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     398             : 
     399             :     // XSecondAxisTitleSupplier
     400             :     rOutProperties.push_back(
     401             :         Property( "HasSecondaryXAxisTitle",
     402             :                   PROP_DIAGRAM_HAS_SECOND_X_AXIS_TITLE,
     403          12 :                   ::getBooleanCppuType(),
     404             :                   beans::PropertyAttribute::BOUND
     405          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     406             :     rOutProperties.push_back(
     407             :         Property( "HasSecondaryYAxisTitle",
     408             :                   PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE,
     409          12 :                   ::getBooleanCppuType(),
     410             :                   beans::PropertyAttribute::BOUND
     411          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     412             : 
     413             :     rOutProperties.push_back(
     414             :         Property( "MissingValueTreatment",
     415             :                   PROP_DIAGRAM_MISSING_VALUE_TREATMENT,
     416          12 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
     417             :                   beans::PropertyAttribute::BOUND
     418          24 :                   | beans::PropertyAttribute::MAYBEVOID ));
     419             : 
     420             :     rOutProperties.push_back(
     421             :         Property( "AutomaticSize",
     422             :                   PROP_DIAGRAM_AUTOMATIC_SIZE,
     423          12 :                   ::getBooleanCppuType(),
     424             :                   beans::PropertyAttribute::BOUND
     425          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     426             :     rOutProperties.push_back(
     427             :         Property( "DataTableHBorder",
     428             :                 PROP_DIAGRAM_DATATABLEHBORDER,
     429          12 :                   ::getBooleanCppuType(),
     430             :                   beans::PropertyAttribute::BOUND
     431          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     432             :     rOutProperties.push_back(
     433             :         Property( "DataTableVBorder",
     434             :                 PROP_DIAGRAM_DATATABLEVBORDER,
     435          12 :                   ::getBooleanCppuType(),
     436             :                   beans::PropertyAttribute::BOUND
     437          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     438             :     rOutProperties.push_back(
     439             :         Property( "DataTableOutline",
     440             :                 PROP_DIAGRAM_DATATABLEOUTLINE,
     441          12 :                   ::getBooleanCppuType(),
     442             :                   beans::PropertyAttribute::BOUND
     443          24 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     444             :     rOutProperties.push_back(
     445             :         Property( "ExternalData",
     446             :                   PROP_DIAGRAM_EXTERNALDATA,
     447          12 :                   ::getCppuType( reinterpret_cast< const OUString * >(0)),
     448             :                   beans::PropertyAttribute::BOUND
     449          24 :                   | beans::PropertyAttribute::MAYBEVOID ));
     450          12 : }
     451             : 
     452             : struct StaticDiagramWrapperPropertyArray_Initializer
     453             : {
     454          12 :     Sequence< Property >* operator()()
     455             :     {
     456          12 :         static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
     457          12 :         return &aPropSeq;
     458             :     }
     459             : 
     460             : private:
     461          12 :     uno::Sequence< Property > lcl_GetPropertySequence()
     462             :     {
     463          12 :         ::std::vector< ::com::sun::star::beans::Property > aProperties;
     464          12 :         lcl_AddPropertiesToVector( aProperties );
     465          12 :         ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
     466          12 :         ::chart::FillProperties::AddPropertiesToVector( aProperties );
     467          12 :         ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
     468          12 :         ::chart::SceneProperties::AddPropertiesToVector( aProperties );
     469          12 :         WrappedStatisticProperties::addProperties( aProperties );
     470          12 :         WrappedSymbolProperties::addProperties( aProperties );
     471          12 :         WrappedDataCaptionProperties::addProperties( aProperties );
     472          12 :         WrappedSplineProperties::addProperties( aProperties );
     473          12 :         WrappedStockProperties::addProperties( aProperties );
     474          12 :         WrappedAutomaticPositionProperties::addProperties( aProperties );
     475          12 :         WrappedGL3DProperties::addProperties(aProperties);
     476             : 
     477             :         ::std::sort( aProperties.begin(), aProperties.end(),
     478          12 :                      ::chart::PropertyNameLess() );
     479             : 
     480          12 :         return ::chart::ContainerHelper::ContainerToSequence( aProperties );
     481             :     }
     482             : };
     483             : 
     484             : struct StaticDiagramWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticDiagramWrapperPropertyArray_Initializer >
     485             : {
     486             : };
     487             : 
     488          43 : bool lcl_isXYChart( const Reference< chart2::XDiagram > xDiagram )
     489             : {
     490          43 :     bool bRet = false;
     491          43 :     Reference< chart2::XChartType > xChartType( ::chart::DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
     492          43 :     if( xChartType.is() )
     493             :     {
     494          43 :         OUString aChartType( xChartType->getChartType() );
     495          43 :         if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
     496           0 :             bRet = true;
     497             :     }
     498          43 :     return bRet;
     499             : }
     500             : 
     501          43 : sal_Int32 lcl_getNewAPIIndexForOldAPIIndex(
     502             :                 sal_Int32 nOldAPIIndex
     503             :                 , Reference< chart2::XDiagram > xDiagram )
     504             : {
     505          43 :     sal_Int32 nNewAPIIndex = nOldAPIIndex;
     506             : 
     507          43 :     if( lcl_isXYChart( xDiagram ) )
     508             :     {
     509           0 :         if( nNewAPIIndex >= 1 )
     510           0 :             nNewAPIIndex -= 1;
     511             :     }
     512             : 
     513             :     ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
     514          43 :         ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
     515          43 :     if( nNewAPIIndex >= static_cast<sal_Int32>(aSeriesList.size()) )
     516           0 :         nNewAPIIndex = -1;
     517             : 
     518          43 :     return nNewAPIIndex;
     519             : }
     520             : 
     521         636 : OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
     522             : {
     523         636 :     const OUString aPrefix("com.sun.star.chart2.template.");
     524             : 
     525         636 :     if( rTemplateServiceName.match( aPrefix ))
     526             :     {
     527         636 :         const OUString aName( rTemplateServiceName.copy( aPrefix.getLength()));
     528             : 
     529         636 :         if (aName.indexOf("GL3DBar") != -1)
     530           0 :             return OUString("com.sun.star.chart.GL3DBarDiagram");
     531             : 
     532             :         // "Area" "StackedArea" "PercentStackedArea" "ThreeDArea"
     533             :         // "StackedThreeDArea" "PercentStackedThreeDArea"
     534         636 :         if( aName.indexOf( "Area" ) != -1 )
     535          21 :             return OUString("com.sun.star.chart.AreaDiagram");
     536             : 
     537             :         // "Pie" "PieAllExploded" "ThreeDPie" "ThreeDPieAllExploded"
     538         615 :         if( aName.indexOf( "Pie" ) != -1 )
     539         102 :             return OUString("com.sun.star.chart.PieDiagram");
     540             : 
     541             :         // "Column" "StackedColumn" "PercentStackedColumn" "ThreeDColumnDeep"
     542             :         // "ThreeDColumnFlat" "StackedThreeDColumnFlat"
     543             :         // "PercentStackedThreeDColumnFlat" "Bar" "StackedBar"
     544             :         // "PercentStackedBar" "ThreeDBarDeep" "ThreeDBarFlat"
     545             :         // "StackedThreeDBarFlat" "PercentStackedThreeDBarFlat" "ColumnWithLine"
     546             :         // "StackedColumnWithLine"
     547         513 :         if( aName.indexOf( "Column" ) != -1 || aName.indexOf( "Bar" ) != -1 )
     548         390 :             return OUString( "com.sun.star.chart.BarDiagram" );
     549             : 
     550             :         // "Donut" "DonutAllExploded" "ThreeDDonut" "ThreeDDonutAllExploded"
     551         123 :         if( aName.indexOf( "Donut" ) != -1 )
     552          21 :             return OUString( "com.sun.star.chart.DonutDiagram" );
     553             : 
     554             :         // "ScatterLineSymbol" "ScatterLine" "ScatterSymbol" "ThreeDScatter"
     555         102 :         if( aName.indexOf( "Scatter" ) != -1 )
     556          44 :             return OUString( "com.sun.star.chart.XYDiagram" );
     557             : 
     558             :         // "FilledNet" "StackedFilledNet" "PercentStackedFilledNet"
     559          58 :         if( aName.indexOf( "FilledNet" ) != -1 )
     560           0 :             return OUString( "com.sun.star.chart.FilledNetDiagram" );
     561             : 
     562             :         // "Net" "NetSymbol" "NetLine" "StackedNet" "StackedNetSymbol"
     563             :         // "StackedNetLine" "PercentStackedNet" "PercentStackedNetSymbol"
     564             :         // "PercentStackedNetLine"
     565          58 :         if( aName.indexOf( "Net" ) != -1 )
     566           0 :             return OUString( "com.sun.star.chart.NetDiagram" );
     567             : 
     568             :         // "StockLowHighClose" "StockOpenLowHighClose" "StockVolumeLowHighClose"
     569             :         // "StockVolumeOpenLowHighClose"
     570          58 :         if( aName.indexOf( "Stock" ) != -1 )
     571          22 :             return OUString( "com.sun.star.chart.StockDiagram" );
     572             : 
     573          36 :         if( aName.indexOf( "Bubble" ) != -1 )
     574           0 :             return OUString( "com.sun.star.chart.BubbleDiagram" );
     575             : 
     576             :         // Note: this must be checked after Bar, Net and Scatter
     577             : 
     578             :         // "Symbol" "StackedSymbol" "PercentStackedSymbol" "Line" "StackedLine"
     579             :         // "PercentStackedLine" "LineSymbol" "StackedLineSymbol"
     580             :         // "PercentStackedLineSymbol" "ThreeDLine" "StackedThreeDLine"
     581             :         // "PercentStackedThreeDLine" "ThreeDLineDeep"
     582          36 :         if( aName.indexOf( "Line" ) != -1 || aName.indexOf( "Symbol" ) != -1 )
     583          36 :             return OUString( "com.sun.star.chart.LineDiagram" );
     584             : 
     585           0 :         OSL_FAIL( "unknown template" );
     586             :     }
     587             : 
     588           0 :     return OUString();
     589             : }
     590             : 
     591             : typedef ::comphelper::MakeMap< OUString, OUString > tMakeStringStringMap;
     592             : 
     593           0 : const tMakeStringStringMap& lcl_getChartTypeNameMap()
     594             : {
     595             :     static tMakeStringStringMap g_aChartTypeNameMap =
     596             :         tMakeStringStringMap
     597             :         ( "com.sun.star.chart2.LineChartType", "com.sun.star.chart.LineDiagram" )
     598           0 :         ( "com.sun.star.chart2.AreaChartType", "com.sun.star.chart.AreaDiagram" )
     599           0 :         ( "com.sun.star.chart2.ColumnChartType", "com.sun.star.chart.BarDiagram" )
     600           0 :         ( "com.sun.star.chart2.PieChartType", "com.sun.star.chart.PieDiagram" )
     601           0 :         ( "com.sun.star.chart2.DonutChartType", "com.sun.star.chart.DonutDiagram" )
     602           0 :         ( "com.sun.star.chart2.ScatterChartType", "com.sun.star.chart.XYDiagram" )
     603           0 :         ( "com.sun.star.chart2.FilledNetChartType", "com.sun.star.chart.FilledNetDiagram" )
     604           0 :         ( "com.sun.star.chart2.NetChartType", "com.sun.star.chart.NetDiagram" )
     605           0 :         ( "com.sun.star.chart2.CandleStickChartType", "com.sun.star.chart.StockDiagram" )
     606           0 :         ( "com.sun.star.chart2.BubbleChartType", "com.sun.star.chart.BubbleDiagram" )
     607           0 :         ( "com.sun.star.chart2.GL3DBarChartType", "com.sun.star.chart.GL3DBarDiagram" )
     608             :         ;
     609           0 :     return g_aChartTypeNameMap;
     610             : }
     611             : 
     612           0 : OUString lcl_getOldChartTypeName( const OUString & rNewChartTypeName )
     613             : {
     614           0 :     OUString aOld(rNewChartTypeName);
     615             : 
     616           0 :     const tMakeStringStringMap& rMap = lcl_getChartTypeNameMap();
     617           0 :     tMakeStringStringMap::const_iterator aIt( rMap.find( rNewChartTypeName ));
     618           0 :     if( aIt != rMap.end())
     619             :     {
     620           0 :         aOld = aIt->second;
     621             :     }
     622           0 :     return aOld;
     623             : }
     624             : 
     625             : } // anonymous namespace
     626             : 
     627             : namespace chart
     628             : {
     629             : namespace wrapper
     630             : {
     631             : 
     632         217 : DiagramWrapper::DiagramWrapper(
     633             :     ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ) :
     634             :         m_spChart2ModelContact( spChart2ModelContact ),
     635         217 :         m_aEventListenerContainer( m_aMutex )
     636             : {
     637         217 : }
     638             : 
     639         422 : DiagramWrapper::~DiagramWrapper()
     640         422 : {}
     641             : 
     642             : // ____ XDiagram ____
     643         636 : OUString SAL_CALL DiagramWrapper::getDiagramType()
     644             :     throw (uno::RuntimeException, std::exception)
     645             : {
     646         636 :     OUString aRet;
     647             : 
     648        1272 :     Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
     649        1272 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
     650         636 :     if( xChartDoc.is() && xDiagram.is() )
     651             :     {
     652         636 :         Reference< beans::XPropertySet > xChartDocProp( xChartDoc, uno::UNO_QUERY );
     653         636 :         if( xChartDocProp.is() )
     654             :         {
     655         636 :             uno::Reference< util::XRefreshable > xAddIn;
     656         636 :             if( xChartDocProp->getPropertyValue( "AddIn" ) >>= xAddIn )
     657             :             {
     658         636 :                 uno::Reference< lang::XServiceName > xServiceName( xAddIn, uno::UNO_QUERY );
     659         636 :                 if( xServiceName.is())
     660           0 :                     return xServiceName->getServiceName();
     661         636 :             }
     662             :         }
     663             : 
     664        1272 :         Reference< lang::XMultiServiceFactory > xChartTypeManager( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
     665             :         DiagramHelper::tTemplateWithServiceName aTemplateAndService =
     666        1272 :             DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
     667             : 
     668        1272 :         aRet = lcl_getDiagramType( aTemplateAndService.second );
     669             :     }
     670             : 
     671         636 :     if( aRet.isEmpty())
     672             :     {
     673             :         // none of the standard templates matched
     674             :         // use first chart type
     675           0 :         Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
     676           0 :         if( xChartType.is() )
     677             :         {
     678           0 :             aRet = xChartType->getChartType();
     679           0 :             if( !aRet.isEmpty() )
     680           0 :                 aRet = lcl_getOldChartTypeName( aRet );
     681             :         }
     682           0 :         if( aRet.isEmpty())
     683           0 :             aRet = "com.sun.star.chart.BarDiagram";
     684             :     }
     685             : 
     686        1272 :     return aRet;
     687             : }
     688             : 
     689             : Reference<
     690           3 :     beans::XPropertySet > SAL_CALL DiagramWrapper::getDataRowProperties( sal_Int32 nRow )
     691             :     throw (lang::IndexOutOfBoundsException,
     692             :            uno::RuntimeException, std::exception)
     693             : {
     694           3 :     if( nRow < 0 )
     695             :         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
     696           0 :                                               static_cast< ::cppu::OWeakObject * >( this ));
     697             : 
     698           3 :     Reference< chart2::XDataSeries > xSeries;
     699             : 
     700           3 :     sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getChart2Diagram() );
     701           3 :     if( nNewAPIIndex < 0 )
     702             :         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
     703           0 :                                               static_cast< ::cppu::OWeakObject * >( this ));
     704             : 
     705             :     Reference< beans::XPropertySet > xRet( new DataSeriesPointWrapper(
     706           3 :           DataSeriesPointWrapper::DATA_SERIES, nNewAPIIndex, 0, m_spChart2ModelContact ) );
     707           3 :     return xRet;
     708             : }
     709             : 
     710             : Reference<
     711          40 :     beans::XPropertySet > SAL_CALL DiagramWrapper::getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow )
     712             :     throw (lang::IndexOutOfBoundsException,
     713             :            uno::RuntimeException, std::exception)
     714             : {
     715          40 :     if( nCol < 0 || nRow < 0 )
     716             :         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
     717           0 :                                               static_cast< ::cppu::OWeakObject * >( this ));
     718             : 
     719          40 :     Reference< chart2::XDataSeries > xSeries;
     720             : 
     721          40 :     sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getChart2Diagram() );
     722          40 :     if( nNewAPIIndex < 0 )
     723             :         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
     724           0 :                                               static_cast< ::cppu::OWeakObject * >( this ));
     725             : 
     726             :     //todo: check borders of point index
     727             : 
     728             :     Reference< beans::XPropertySet > xRet( new DataSeriesPointWrapper(
     729          40 :           DataSeriesPointWrapper::DATA_POINT, nNewAPIIndex, nCol, m_spChart2ModelContact ) );
     730             : 
     731          40 :     return xRet;
     732             : }
     733             : 
     734             : // ____ XShape (base of XDiagram) ____
     735         173 : awt::Point SAL_CALL DiagramWrapper::getPosition()
     736             :     throw (uno::RuntimeException, std::exception)
     737             : {
     738         173 :     awt::Point aPosition = ToPoint( m_spChart2ModelContact->GetDiagramRectangleIncludingAxes() );
     739         173 :     return aPosition;
     740             : }
     741             : 
     742           1 : void SAL_CALL DiagramWrapper::setPosition( const awt::Point& aPosition )
     743             :     throw (uno::RuntimeException, std::exception)
     744             : {
     745           1 :     ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
     746           2 :     Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() );
     747           1 :     if( xProp.is() )
     748             :     {
     749           1 :         awt::Size aPageSize( m_spChart2ModelContact->GetPageSize() );
     750             : 
     751           1 :         chart2::RelativePosition aRelativePosition;
     752           1 :         aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
     753           1 :         aRelativePosition.Primary = double(aPosition.X)/double(aPageSize.Width);
     754           1 :         aRelativePosition.Secondary = double(aPosition.Y)/double(aPageSize.Height);
     755           1 :         if( aRelativePosition.Primary < 0 || aRelativePosition.Secondary < 0 || aRelativePosition.Primary > 1 || aRelativePosition.Secondary > 1 )
     756             :         {
     757             :             OSL_FAIL("DiagramWrapper::setPosition called with a position out of range -> automatic values are taken instead" );
     758           0 :             uno::Any aEmpty;
     759           0 :             xProp->setPropertyValue( "RelativePosition", aEmpty );
     760           1 :             return;
     761             :         }
     762           1 :         xProp->setPropertyValue( "RelativePosition", uno::makeAny(aRelativePosition) );
     763           1 :         xProp->setPropertyValue( "PosSizeExcludeAxes", uno::makeAny(false) );
     764           1 :     }
     765             : }
     766             : 
     767         173 : awt::Size SAL_CALL DiagramWrapper::getSize()
     768             :     throw (uno::RuntimeException, std::exception)
     769             : {
     770         173 :     awt::Size aSize = ToSize( m_spChart2ModelContact->GetDiagramRectangleIncludingAxes() );
     771         173 :     return aSize;
     772             : }
     773             : 
     774           1 : void SAL_CALL DiagramWrapper::setSize( const awt::Size& aSize )
     775             :     throw (beans::PropertyVetoException,
     776             :            uno::RuntimeException, std::exception)
     777             : {
     778           1 :     ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
     779           2 :     Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() );
     780           1 :     if( xProp.is() )
     781             :     {
     782           1 :         awt::Size aPageSize( m_spChart2ModelContact->GetPageSize() );
     783             : 
     784           1 :         chart2::RelativeSize aRelativeSize;
     785           1 :         aRelativeSize.Primary = double(aSize.Width)/double(aPageSize.Width);
     786           1 :         aRelativeSize.Secondary = double(aSize.Height)/double(aPageSize.Height);
     787             : 
     788           1 :         if( aRelativeSize.Primary > 1 || aRelativeSize.Secondary > 1 )
     789             :         {
     790             :             OSL_FAIL("DiagramWrapper::setSize called with sizes bigger than page -> automatic values are taken instead" );
     791           0 :             uno::Any aEmpty;
     792           0 :             xProp->setPropertyValue( "RelativeSize", aEmpty );
     793           1 :             return;
     794             :         }
     795             : 
     796           1 :         xProp->setPropertyValue( "RelativeSize", uno::makeAny(aRelativeSize) );
     797           1 :         xProp->setPropertyValue( "PosSizeExcludeAxes", uno::makeAny(false) );
     798           1 :     }
     799             : }
     800             : 
     801             : // ____ XShapeDescriptor (base of XShape) ____
     802           1 : OUString SAL_CALL DiagramWrapper::getShapeType()
     803             :     throw (uno::RuntimeException, std::exception)
     804             : {
     805           1 :     return OUString( "com.sun.star.chart.Diagram" );
     806             : }
     807             : 
     808             : // ____ XDiagramPositioning ____
     809             : 
     810           0 : void SAL_CALL DiagramWrapper::setAutomaticDiagramPositioning() throw (uno::RuntimeException, std::exception)
     811             : {
     812           0 :     ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
     813           0 :     uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
     814           0 :     if( xDiaProps.is() )
     815             :     {
     816           0 :         xDiaProps->setPropertyValue( "RelativeSize", Any() );
     817           0 :         xDiaProps->setPropertyValue( "RelativePosition", Any() );
     818           0 :     }
     819           0 : }
     820          16 : sal_Bool SAL_CALL DiagramWrapper::isAutomaticDiagramPositioning(  ) throw (uno::RuntimeException, std::exception)
     821             : {
     822          16 :     uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
     823          16 :     if( xDiaProps.is() )
     824             :     {
     825          16 :         Any aRelativeSize( xDiaProps->getPropertyValue( "RelativeSize" ) );
     826          32 :         Any aRelativePosition( xDiaProps->getPropertyValue( "RelativePosition" ) );
     827          16 :         if( aRelativeSize.hasValue() && aRelativePosition.hasValue() )
     828          16 :             return false;
     829             :     }
     830          16 :     return true;
     831             : }
     832          37 : void SAL_CALL DiagramWrapper::setDiagramPositionExcludingAxes( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException, std::exception)
     833             : {
     834          37 :     ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
     835          37 :     DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getChartModel(), rPositionRect );
     836          74 :     uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
     837          37 :     if( xDiaProps.is() )
     838          74 :         xDiaProps->setPropertyValue("PosSizeExcludeAxes", uno::makeAny(true) );
     839          37 : }
     840           0 : sal_Bool SAL_CALL DiagramWrapper::isExcludingDiagramPositioning() throw (uno::RuntimeException, std::exception)
     841             : {
     842           0 :     uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
     843           0 :     if( xDiaProps.is() )
     844             :     {
     845           0 :         Any aRelativeSize( xDiaProps->getPropertyValue( "RelativeSize" ) );
     846           0 :         Any aRelativePosition( xDiaProps->getPropertyValue( "RelativePosition" ) );
     847           0 :         if( aRelativeSize.hasValue() && aRelativePosition.hasValue() )
     848             :         {
     849           0 :             sal_Bool bPosSizeExcludeAxes = false;
     850           0 :             xDiaProps->getPropertyValue( "PosSizeExcludeAxes" ) >>= bPosSizeExcludeAxes;
     851           0 :             return bPosSizeExcludeAxes;
     852           0 :         }
     853             :     }
     854           0 :     return false;
     855             : }
     856         187 : awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionExcludingAxes(  ) throw (uno::RuntimeException, std::exception)
     857             : {
     858         187 :     return m_spChart2ModelContact->GetDiagramRectangleExcludingAxes();
     859             : }
     860           5 : void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxes( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException, std::exception)
     861             : {
     862           5 :     ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
     863           5 :     DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getChartModel(), rPositionRect );
     864          10 :     uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
     865           5 :     if( xDiaProps.is() )
     866          10 :         xDiaProps->setPropertyValue("PosSizeExcludeAxes", uno::makeAny(false) );
     867           5 : }
     868          16 : awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionIncludingAxes(  ) throw (uno::RuntimeException, std::exception)
     869             : {
     870          16 :     return m_spChart2ModelContact->GetDiagramRectangleIncludingAxes();
     871             : }
     872           0 : void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxesAndAxisTitles( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException, std::exception)
     873             : {
     874           0 :     ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
     875           0 :     awt::Rectangle aRect( m_spChart2ModelContact->SubstractAxisTitleSizes(rPositionRect) );
     876           0 :     DiagramWrapper::setDiagramPositionIncludingAxes( aRect );
     877           0 : }
     878           0 : ::com::sun::star::awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionIncludingAxesAndAxisTitles(  ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     879             : {
     880           0 :     return m_spChart2ModelContact->GetDiagramRectangleIncludingTitle();
     881             : }
     882             : 
     883             : // ____ XAxisSupplier ____
     884        1274 : Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex )
     885             :     throw (uno::RuntimeException, std::exception)
     886             : {
     887        1274 :     Reference< XAxis > xAxis;
     888        1274 :     if(!nDimensionIndex)
     889             :     {
     890         492 :         if( !m_xXAxis.is() )
     891         145 :             m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
     892         492 :         xAxis = m_xXAxis;
     893             :     }
     894         782 :     else if(1==nDimensionIndex)
     895             :     {
     896         578 :         if( !m_xYAxis.is() )
     897         144 :             m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
     898         578 :         xAxis = m_xYAxis;
     899             :     }
     900         204 :     else if(2==nDimensionIndex)
     901             :     {
     902         204 :         if( !m_xZAxis.is() )
     903          57 :             m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
     904         204 :         xAxis = m_xZAxis;
     905             :     }
     906        1274 :     return xAxis;
     907             : }
     908             : 
     909          56 : Reference< XAxis > SAL_CALL DiagramWrapper::getSecondaryAxis( sal_Int32 nDimensionIndex )
     910             :     throw (uno::RuntimeException, std::exception)
     911             : {
     912          56 :     Reference< XAxis > xAxis;
     913          56 :     if(!nDimensionIndex)
     914             :     {
     915          28 :         if( !m_xSecondXAxis.is() )
     916           8 :             m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
     917          28 :         xAxis = m_xSecondXAxis;
     918             :     }
     919          28 :     else if(1==nDimensionIndex)
     920             :     {
     921          28 :         if( !m_xSecondYAxis.is() )
     922           8 :             m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
     923          28 :         xAxis = m_xSecondYAxis;
     924             :     }
     925          56 :     return xAxis;
     926             : }
     927             : 
     928             : // ____ XAxisZSupplier ____
     929           1 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle()
     930             :     throw (uno::RuntimeException, std::exception)
     931             : {
     932           1 :     Reference< drawing::XShape > xRet;
     933           2 :     Reference< XAxis > xAxis( getAxis(2) );
     934           1 :     if( xAxis.is() )
     935           1 :         xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
     936           2 :     return xRet;
     937             : }
     938             : 
     939           1 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid()
     940             :     throw (uno::RuntimeException, std::exception)
     941             : {
     942           1 :     Reference< beans::XPropertySet > xRet;
     943           2 :     Reference< XAxis > xAxis( getAxis(2) );
     944           1 :     if( xAxis.is() )
     945           1 :         xRet = xAxis->getMajorGrid();
     946           2 :     return xRet;
     947             : }
     948             : 
     949           1 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid()
     950             :     throw (uno::RuntimeException, std::exception)
     951             : {
     952           1 :     Reference< beans::XPropertySet > xRet;
     953           2 :     Reference< XAxis > xAxis( getAxis(2) );
     954           1 :     if( xAxis.is() )
     955           1 :         xRet = xAxis->getMinorGrid();
     956           2 :     return xRet;
     957             : }
     958             : 
     959           1 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis()
     960             :     throw (uno::RuntimeException, std::exception)
     961             : {
     962           1 :     if( ! m_xZAxis.is())
     963           0 :         m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
     964           1 :     return Reference< beans::XPropertySet >( m_xZAxis, uno::UNO_QUERY );
     965             : }
     966             : 
     967             : // ____ XTwoAxisXSupplier ____
     968           1 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis()
     969             :     throw (uno::RuntimeException, std::exception)
     970             : {
     971           1 :     if( ! m_xSecondXAxis.is())
     972           1 :         m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
     973           1 :     return Reference< beans::XPropertySet >( m_xSecondXAxis, uno::UNO_QUERY );
     974             : }
     975             : 
     976             : // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
     977          18 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle()
     978             :     throw (uno::RuntimeException, std::exception)
     979             : {
     980          18 :     Reference< drawing::XShape > xRet;
     981          36 :     Reference< XAxis > xAxis( getAxis(0) );
     982          18 :     if( xAxis.is() )
     983          18 :         xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
     984          36 :     return xRet;
     985             : }
     986             : 
     987          25 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis()
     988             :     throw (uno::RuntimeException, std::exception)
     989             : {
     990          25 :     if( ! m_xXAxis.is())
     991           0 :         m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
     992          25 :     return Reference< beans::XPropertySet >( m_xXAxis, uno::UNO_QUERY );
     993             : }
     994             : 
     995           5 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid()
     996             :     throw (uno::RuntimeException, std::exception)
     997             : {
     998           5 :     Reference< beans::XPropertySet > xRet;
     999          10 :     Reference< XAxis > xAxis( getAxis(0) );
    1000           5 :     if( xAxis.is() )
    1001           5 :         xRet = xAxis->getMajorGrid();
    1002          10 :     return xRet;
    1003             : }
    1004             : 
    1005           1 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid()
    1006             :     throw (uno::RuntimeException, std::exception)
    1007             : {
    1008           1 :     Reference< beans::XPropertySet > xRet;
    1009           2 :     Reference< XAxis > xAxis( getAxis(0) );
    1010           1 :     if( xAxis.is() )
    1011           1 :         xRet = xAxis->getMinorGrid();
    1012           2 :     return xRet;
    1013             : }
    1014             : 
    1015             : // ____ XTwoAxisYSupplier ____
    1016           3 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis()
    1017             :     throw (uno::RuntimeException, std::exception)
    1018             : {
    1019           3 :     if( ! m_xSecondYAxis.is())
    1020           1 :         m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
    1021           3 :     return Reference< beans::XPropertySet >( m_xSecondYAxis, uno::UNO_QUERY );
    1022             : }
    1023             : 
    1024             : // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
    1025          15 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle()
    1026             :     throw (uno::RuntimeException, std::exception)
    1027             : {
    1028          15 :     Reference< drawing::XShape > xRet;
    1029          30 :     Reference< XAxis > xAxis( getAxis(1) );
    1030          15 :     if( xAxis.is() )
    1031          15 :         xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
    1032          30 :     return xRet;
    1033             : }
    1034             : 
    1035          24 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis()
    1036             :     throw (uno::RuntimeException, std::exception)
    1037             : {
    1038          24 :     if( ! m_xYAxis.is())
    1039           1 :         m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
    1040          24 :     return Reference< beans::XPropertySet >( m_xYAxis, uno::UNO_QUERY );
    1041             : }
    1042             : 
    1043          21 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid()
    1044             :     throw (uno::RuntimeException, std::exception)
    1045             : {
    1046          21 :     Reference< beans::XPropertySet > xRet;
    1047          42 :     Reference< XAxis > xAxis( getAxis(1) );
    1048          21 :     if( xAxis.is() )
    1049          21 :         xRet = xAxis->getMajorGrid();
    1050          42 :     return xRet;
    1051             : }
    1052             : 
    1053           6 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid()
    1054             :     throw (uno::RuntimeException, std::exception)
    1055             : {
    1056           6 :     Reference< beans::XPropertySet > xRet;
    1057          12 :     Reference< XAxis > xAxis( getAxis(1) );
    1058           6 :     if( xAxis.is() )
    1059           6 :         xRet = xAxis->getMinorGrid();
    1060          12 :     return xRet;
    1061             : }
    1062             : 
    1063             : // ____ XSecondAxisTitleSupplier ____
    1064           0 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle()
    1065             :     throw (uno::RuntimeException, std::exception)
    1066             : {
    1067           0 :     Reference< drawing::XShape > xRet;
    1068           0 :     Reference< XAxis > xAxis( getSecondaryAxis(0) );
    1069           0 :     if( xAxis.is() )
    1070           0 :         xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
    1071           0 :     return xRet;
    1072             : }
    1073             : 
    1074           0 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle()
    1075             :     throw (uno::RuntimeException, std::exception)
    1076             : {
    1077           0 :     Reference< drawing::XShape > xRet;
    1078           0 :     Reference< XAxis > xAxis( getSecondaryAxis(1) );
    1079           0 :     if( xAxis.is() )
    1080           0 :         xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
    1081           0 :     return xRet;
    1082             : }
    1083             : 
    1084             : // ____ XStatisticDisplay ____
    1085             : Reference<
    1086          19 :     beans::XPropertySet > SAL_CALL DiagramWrapper::getUpBar()
    1087             :     throw (uno::RuntimeException, std::exception)
    1088             : {
    1089          19 :     if( !m_xUpBarWrapper.is() )
    1090             :     {
    1091           8 :         m_xUpBarWrapper = new UpDownBarWrapper( true, m_spChart2ModelContact );
    1092             :     }
    1093          19 :     return m_xUpBarWrapper;
    1094             : }
    1095             : 
    1096             : Reference<
    1097          19 :     beans::XPropertySet > SAL_CALL DiagramWrapper::getDownBar()
    1098             :     throw (uno::RuntimeException, std::exception)
    1099             : {
    1100          19 :     if( !m_xDownBarWrapper.is() )
    1101             :     {
    1102           8 :         m_xDownBarWrapper = new UpDownBarWrapper( false, m_spChart2ModelContact );
    1103             :     }
    1104          19 :     return m_xDownBarWrapper;
    1105             : }
    1106             : 
    1107             : Reference<
    1108          23 :     beans::XPropertySet > SAL_CALL DiagramWrapper::getMinMaxLine()
    1109             :     throw (uno::RuntimeException, std::exception)
    1110             : {
    1111          23 :     if( !m_xMinMaxLineWrapper.is() )
    1112             :     {
    1113           8 :         m_xMinMaxLineWrapper = new MinMaxLineWrapper( m_spChart2ModelContact );
    1114             :     }
    1115          23 :     return m_xMinMaxLineWrapper;
    1116             : }
    1117             : 
    1118             : // ____ X3DDisplay ____
    1119         453 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getWall()
    1120             :     throw (uno::RuntimeException, std::exception)
    1121             : {
    1122         453 :     if( !m_xWall.is() )
    1123             :     {
    1124         143 :         m_xWall = new WallFloorWrapper( true, m_spChart2ModelContact );
    1125             :     }
    1126         453 :     return m_xWall;
    1127             : }
    1128             : 
    1129             : Reference<
    1130         425 :     beans::XPropertySet > SAL_CALL DiagramWrapper::getFloor()
    1131             :     throw (uno::RuntimeException, std::exception)
    1132             : {
    1133         425 :     if( !m_xFloor.is() )
    1134             :     {
    1135         140 :         m_xFloor = new WallFloorWrapper( false, m_spChart2ModelContact );
    1136             :     }
    1137         425 :     return m_xFloor;
    1138             : }
    1139             : 
    1140             : // ____ X3DDefaultSetter ____
    1141           0 : void SAL_CALL DiagramWrapper::set3DSettingsToDefault()
    1142             :     throw (uno::RuntimeException, std::exception)
    1143             : {
    1144           0 :     Reference< X3DDefaultSetter > x3DDefaultSetter( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
    1145           0 :     if( x3DDefaultSetter.is() )
    1146           0 :         x3DDefaultSetter->set3DSettingsToDefault();
    1147           0 : }
    1148             : 
    1149           0 : void SAL_CALL DiagramWrapper::setDefaultRotation()
    1150             :     throw (uno::RuntimeException, std::exception)
    1151             : {
    1152           0 :     Reference< X3DDefaultSetter > x3DDefaultSetter( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
    1153           0 :     if( x3DDefaultSetter.is() )
    1154           0 :         x3DDefaultSetter->setDefaultRotation();
    1155           0 : }
    1156             : 
    1157           0 : void SAL_CALL DiagramWrapper::setDefaultIllumination()
    1158             :     throw (uno::RuntimeException, std::exception)
    1159             : {
    1160           0 :     Reference< X3DDefaultSetter > x3DDefaultSetter( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
    1161           0 :     if( x3DDefaultSetter.is() )
    1162           0 :         x3DDefaultSetter->setDefaultIllumination();
    1163           0 : }
    1164             : 
    1165             : // ____ XComponent ____
    1166         199 : void SAL_CALL DiagramWrapper::dispose()
    1167             :     throw (uno::RuntimeException, std::exception)
    1168             : {
    1169         199 :     m_aEventListenerContainer.disposeAndClear( lang::EventObject( static_cast< ::cppu::OWeakObject* >( this )));
    1170             : 
    1171         199 :     MutexGuard aGuard( GetMutex());
    1172             : 
    1173         199 :     DisposeHelper::DisposeAndClear( m_xXAxis );
    1174         199 :     DisposeHelper::DisposeAndClear( m_xYAxis );
    1175         199 :     DisposeHelper::DisposeAndClear( m_xZAxis );
    1176         199 :     DisposeHelper::DisposeAndClear( m_xSecondXAxis );
    1177         199 :     DisposeHelper::DisposeAndClear( m_xSecondYAxis );
    1178         199 :     DisposeHelper::DisposeAndClear( m_xWall );
    1179         199 :     DisposeHelper::DisposeAndClear( m_xFloor );
    1180         199 :     DisposeHelper::DisposeAndClear( m_xMinMaxLineWrapper );
    1181         199 :     DisposeHelper::DisposeAndClear( m_xUpBarWrapper );
    1182         199 :     DisposeHelper::DisposeAndClear( m_xDownBarWrapper );
    1183             : 
    1184         199 :     clearWrappedPropertySet();
    1185         199 : }
    1186             : 
    1187           0 : void SAL_CALL DiagramWrapper::addEventListener(
    1188             :     const Reference< lang::XEventListener >& xListener )
    1189             :     throw (uno::RuntimeException, std::exception)
    1190             : {
    1191           0 :     m_aEventListenerContainer.addInterface( xListener );
    1192           0 : }
    1193             : 
    1194           0 : void SAL_CALL DiagramWrapper::removeEventListener(
    1195             :     const Reference< lang::XEventListener >& aListener )
    1196             :     throw (uno::RuntimeException, std::exception)
    1197             : {
    1198           0 :     m_aEventListenerContainer.removeInterface( aListener );
    1199           0 : }
    1200             : 
    1201             : //PROP_DIAGRAM_DATAROW_SOURCE
    1202             : class WrappedDataRowSourceProperty : public WrappedProperty
    1203             : {
    1204             : public:
    1205             :     WrappedDataRowSourceProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1206             :     virtual ~WrappedDataRowSourceProperty();
    1207             : 
    1208             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1209             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1210             : 
    1211             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1212             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1213             : 
    1214             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1215             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1216             : 
    1217             : private: //member
    1218             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1219             :     mutable Any                                 m_aOuterValue;
    1220             : };
    1221             : 
    1222         204 : WrappedDataRowSourceProperty::WrappedDataRowSourceProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1223             :             : WrappedProperty("DataRowSource",OUString())
    1224             :             , m_spChart2ModelContact( spChart2ModelContact )
    1225         204 :             , m_aOuterValue()
    1226             : {
    1227         204 :     m_aOuterValue = WrappedDataRowSourceProperty::getPropertyDefault( 0 );
    1228         204 : }
    1229             : 
    1230         396 : WrappedDataRowSourceProperty::~WrappedDataRowSourceProperty()
    1231             : {
    1232         396 : }
    1233             : 
    1234          89 : void WrappedDataRowSourceProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1235             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1236             : {
    1237          89 :     ::com::sun::star::chart::ChartDataRowSource eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource_ROWS;
    1238          89 :     if( ! (rOuterValue >>= eChartDataRowSource) )
    1239             :     {
    1240           0 :         sal_Int32 nNew = ::com::sun::star::chart::ChartDataRowSource_ROWS;
    1241           0 :         if( !(rOuterValue >>= nNew) )
    1242           0 :             throw lang::IllegalArgumentException( "Property DataRowSource requires ::com::sun::star::chart::ChartDataRowSource value", 0, 0 );
    1243             :         else
    1244           0 :             eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource(nNew);
    1245             :     }
    1246             : 
    1247          89 :     m_aOuterValue = rOuterValue;
    1248             : 
    1249          89 :     bool bNewUseColumns = eChartDataRowSource == ::com::sun::star::chart::ChartDataRowSource_COLUMNS;
    1250             : 
    1251          89 :     OUString aRangeString;
    1252          89 :     bool bUseColumns = true;
    1253          89 :     bool bFirstCellAsLabel = true;
    1254          89 :     bool bHasCategories = true;
    1255         178 :     uno::Sequence< sal_Int32 > aSequenceMapping;
    1256             : 
    1257         178 :     if( DataSourceHelper::detectRangeSegmentation(
    1258             :             m_spChart2ModelContact->getChartModel(), aRangeString, aSequenceMapping, bUseColumns
    1259         178 :             , bFirstCellAsLabel, bHasCategories ) )
    1260             :     {
    1261          59 :         if( bUseColumns != bNewUseColumns )
    1262             :         {
    1263           2 :             aSequenceMapping.realloc(0);
    1264             :             DataSourceHelper::setRangeSegmentation(
    1265           2 :                 m_spChart2ModelContact->getChartModel(), aSequenceMapping, bNewUseColumns , bHasCategories, bFirstCellAsLabel );
    1266             :         }
    1267          89 :     }
    1268          89 : }
    1269             : 
    1270         451 : Any WrappedDataRowSourceProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1271             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1272             : {
    1273         451 :     OUString aRangeString;
    1274         451 :     bool bUseColumns = true;
    1275         451 :     bool bFirstCellAsLabel = true;
    1276         451 :     bool bHasCategories = true;
    1277         902 :     uno::Sequence< sal_Int32 > aSequenceMapping;
    1278             : 
    1279         902 :     if( DataSourceHelper::detectRangeSegmentation(
    1280             :             m_spChart2ModelContact->getChartModel(), aRangeString, aSequenceMapping, bUseColumns
    1281         902 :             , bFirstCellAsLabel, bHasCategories ) )
    1282             :     {
    1283         421 :         ::com::sun::star::chart::ChartDataRowSource eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource_ROWS;
    1284         421 :         if(bUseColumns)
    1285         419 :             eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource_COLUMNS;
    1286             : 
    1287         421 :         m_aOuterValue <<= eChartDataRowSource;
    1288             :     }
    1289             : 
    1290         902 :     return m_aOuterValue;
    1291             : }
    1292             : 
    1293         546 : Any WrappedDataRowSourceProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1294             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1295             : {
    1296         546 :     Any aRet;
    1297         546 :     aRet <<= ::com::sun::star::chart::ChartDataRowSource_COLUMNS;
    1298         546 :     return aRet;
    1299             : }
    1300             : 
    1301             : //PROP_DIAGRAM_STACKED
    1302             : //PROP_DIAGRAM_DEEP
    1303             : //PROP_DIAGRAM_PERCENT_STACKED
    1304             : class WrappedStackingProperty : public WrappedProperty
    1305             : {
    1306             : public:
    1307             :     WrappedStackingProperty( StackMode eStackMode, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1308             :     virtual ~WrappedStackingProperty();
    1309             : 
    1310             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1311             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1312             : 
    1313             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1314             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1315             : 
    1316             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1317             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1318             : 
    1319             : protected: //methods
    1320             :     bool    detectInnerValue( StackMode& eInnerStackMode ) const;
    1321             : 
    1322             : private: //member
    1323             : ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1324             :     const StackMode                         m_eStackMode;
    1325             :     mutable Any                             m_aOuterValue;
    1326             : };
    1327             : 
    1328         612 : WrappedStackingProperty::WrappedStackingProperty( StackMode eStackMode, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1329             :             : WrappedProperty(OUString(),OUString())
    1330             :             , m_spChart2ModelContact( spChart2ModelContact )
    1331             :             , m_eStackMode( eStackMode )
    1332         612 :             , m_aOuterValue()
    1333             : {
    1334         612 :     switch( m_eStackMode )
    1335             :     {
    1336             :     case StackMode_Y_STACKED:
    1337         204 :         m_aOuterName = "Stacked";
    1338         204 :         break;
    1339             :     case StackMode_Y_STACKED_PERCENT:
    1340         204 :         m_aOuterName = "Percent";
    1341         204 :         break;
    1342             :     case StackMode_Z_STACKED:
    1343         204 :         m_aOuterName = "Deep";
    1344         204 :         break;
    1345             :     default:
    1346             :         OSL_FAIL( "unexpected stack mode" );
    1347           0 :         break;
    1348             :     }
    1349         612 : }
    1350             : 
    1351        1188 : WrappedStackingProperty::~WrappedStackingProperty()
    1352             : {
    1353        1188 : }
    1354             : 
    1355        1484 : bool WrappedStackingProperty::detectInnerValue( StackMode& eStackMode ) const
    1356             : {
    1357        1484 :     bool bHasDetectableInnerValue = false;
    1358        1484 :     bool bIsAmbiguous = false;
    1359             :     eStackMode = DiagramHelper::getStackMode( m_spChart2ModelContact->getChart2Diagram()
    1360        1484 :         , bHasDetectableInnerValue, bIsAmbiguous );
    1361        1484 :     return bHasDetectableInnerValue;
    1362             : }
    1363             : 
    1364          39 : void WrappedStackingProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1365             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1366             : {
    1367          39 :     sal_Bool bNewValue = false;
    1368          39 :     if( ! (rOuterValue >>= bNewValue) )
    1369           0 :         throw lang::IllegalArgumentException( "Stacking Properties require boolean values", 0, 0 );
    1370             : 
    1371             :     StackMode eInnerStackMode;
    1372          39 :     bool bHasDetectableInnerValue = detectInnerValue( eInnerStackMode );
    1373             : 
    1374          39 :     if( !bHasDetectableInnerValue )
    1375             :     {
    1376          18 :         m_aOuterValue = rOuterValue;
    1377          18 :         return;
    1378             :     }
    1379             : 
    1380          21 :     if( bNewValue && eInnerStackMode == m_eStackMode )
    1381           0 :         return;
    1382          21 :     if( !bNewValue && eInnerStackMode != m_eStackMode )
    1383           3 :         return;
    1384             : 
    1385          18 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1386          18 :     if( xDiagram.is() )
    1387             :     {
    1388          18 :         StackMode eNewStackMode = bNewValue ? m_eStackMode : StackMode_NONE;
    1389          18 :         DiagramHelper::setStackMode( xDiagram, eNewStackMode );
    1390          18 :     }
    1391             : }
    1392             : 
    1393        1445 : Any WrappedStackingProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1394             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1395             : {
    1396             :     StackMode eInnerStackMode;
    1397        1445 :     if( detectInnerValue( eInnerStackMode ) )
    1398             :     {
    1399        1196 :         sal_Bool bValue = (eInnerStackMode == m_eStackMode);
    1400        1196 :         Any aAny;
    1401        1196 :         aAny <<= bValue;
    1402        1196 :         return aAny;
    1403             :     }
    1404         249 :     return m_aOuterValue;
    1405             : }
    1406             : 
    1407        1026 : Any WrappedStackingProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1408             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1409             : {
    1410        1026 :     Any aRet;
    1411        1026 :     aRet <<= sal_Bool( sal_False );
    1412        1026 :     return aRet;
    1413             : }
    1414             : 
    1415             : //PROP_DIAGRAM_THREE_D
    1416             : class WrappedDim3DProperty : public WrappedProperty
    1417             : {
    1418             : public:
    1419             :     WrappedDim3DProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1420             :     virtual ~WrappedDim3DProperty();
    1421             : 
    1422             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1423             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1424             : 
    1425             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1426             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1427             : 
    1428             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1429             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1430             : 
    1431             : private: //member
    1432             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1433             :     mutable Any                                 m_aOuterValue;
    1434             : };
    1435             : 
    1436         204 : WrappedDim3DProperty::WrappedDim3DProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1437             :             : WrappedProperty("Dim3D",OUString())
    1438             :             , m_spChart2ModelContact( spChart2ModelContact )
    1439         204 :             , m_aOuterValue()
    1440             : {
    1441         204 :     m_aOuterValue = WrappedDim3DProperty::getPropertyDefault( 0 );
    1442         204 : }
    1443             : 
    1444         396 : WrappedDim3DProperty::~WrappedDim3DProperty()
    1445             : {
    1446         396 : }
    1447             : 
    1448          37 : void WrappedDim3DProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1449             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1450             : {
    1451          37 :     sal_Bool bNew3D = false;
    1452          37 :     if( ! (rOuterValue >>= bNew3D) )
    1453           0 :         throw lang::IllegalArgumentException( "Property Dim3D requires boolean value", 0, 0 );
    1454             : 
    1455          37 :     m_aOuterValue = rOuterValue;
    1456             : 
    1457          37 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1458          37 :     if( !xDiagram.is() )
    1459          37 :         return;
    1460             : 
    1461          37 :     sal_Bool bOld3D = DiagramHelper::getDimension( xDiagram ) == 3;
    1462          37 :     if( bOld3D != bNew3D )
    1463          33 :         DiagramHelper::setDimension( xDiagram, bNew3D ? 3 : 2 );
    1464             : }
    1465             : 
    1466         798 : Any WrappedDim3DProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1467             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1468             : {
    1469         798 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1470         798 :     if( xDiagram.is() )
    1471             :     {
    1472         798 :         sal_Bool b3D = DiagramHelper::getDimension( xDiagram ) == 3;
    1473         798 :         m_aOuterValue <<= b3D;
    1474             :     }
    1475         798 :     return m_aOuterValue;
    1476             : }
    1477             : 
    1478         546 : Any WrappedDim3DProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1479             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1480             : {
    1481         546 :     Any aRet;
    1482         546 :     aRet <<= sal_Bool( sal_False );
    1483         546 :     return aRet;
    1484             : }
    1485             : 
    1486             : //PROP_DIAGRAM_VERTICAL
    1487             : class WrappedVerticalProperty : public WrappedProperty
    1488             : {
    1489             : public:
    1490             :     WrappedVerticalProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1491             :     virtual ~WrappedVerticalProperty();
    1492             : 
    1493             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1494             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1495             : 
    1496             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1497             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1498             : 
    1499             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1500             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1501             : 
    1502             : private: //member
    1503             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1504             :     mutable Any                                 m_aOuterValue;
    1505             : };
    1506             : 
    1507         204 : WrappedVerticalProperty::WrappedVerticalProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1508             :             : WrappedProperty("Vertical",OUString())
    1509             :             , m_spChart2ModelContact( spChart2ModelContact )
    1510         204 :             , m_aOuterValue()
    1511             : {
    1512         204 :     m_aOuterValue = WrappedVerticalProperty::getPropertyDefault( 0 );
    1513         204 : }
    1514             : 
    1515         396 : WrappedVerticalProperty::~WrappedVerticalProperty()
    1516             : {
    1517         396 : }
    1518             : 
    1519          15 : void WrappedVerticalProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1520             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1521             : {
    1522          15 :     sal_Bool bNewVertical = false;
    1523          15 :     if( ! (rOuterValue >>= bNewVertical) )
    1524           0 :         throw lang::IllegalArgumentException( "Property Vertical requires boolean value", 0, 0 );
    1525             : 
    1526          15 :     m_aOuterValue = rOuterValue;
    1527             : 
    1528          15 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1529          15 :     if( !xDiagram.is() )
    1530          15 :         return;
    1531             : 
    1532          15 :     bool bFound = false;
    1533          15 :     bool bAmbiguous = false;
    1534          15 :     sal_Bool bOldVertical = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
    1535          15 :     if( bFound && ( bOldVertical != bNewVertical || bAmbiguous ) )
    1536          11 :         DiagramHelper::setVertical( xDiagram, bNewVertical );
    1537             : }
    1538             : 
    1539         420 : Any WrappedVerticalProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1540             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1541             : {
    1542         420 :     bool bFound = false;
    1543         420 :     bool bAmbiguous = false;
    1544         420 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1545         420 :     if( xDiagram.is() )
    1546             :     {
    1547         420 :         sal_Bool bVertical = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
    1548         420 :         if( bFound )
    1549         420 :             m_aOuterValue <<= bVertical;
    1550             :     }
    1551         420 :     return m_aOuterValue;
    1552             : }
    1553             : 
    1554         546 : Any WrappedVerticalProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1555             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1556             : {
    1557         546 :     Any aRet;
    1558         546 :     aRet <<= sal_Bool( sal_False );
    1559         546 :     return aRet;
    1560             : }
    1561             : 
    1562             : //PROP_DIAGRAM_NUMBER_OF_LINES
    1563             : class WrappedNumberOfLinesProperty : public WrappedProperty
    1564             : {
    1565             : public:
    1566             :     WrappedNumberOfLinesProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1567             :     virtual ~WrappedNumberOfLinesProperty();
    1568             : 
    1569             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1570             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1571             : 
    1572             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1573             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1574             : 
    1575             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1576             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1577             : 
    1578             : protected: //methods
    1579             :     bool    detectInnerValue( uno::Any& rInnerValue ) const;
    1580             : 
    1581             : private: //member
    1582             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1583             :     mutable Any                                 m_aOuterValue;
    1584             : };
    1585             : 
    1586         204 : WrappedNumberOfLinesProperty::WrappedNumberOfLinesProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1587             :             : WrappedProperty("NumberOfLines",OUString())
    1588             :             , m_spChart2ModelContact( spChart2ModelContact )
    1589         204 :             , m_aOuterValue( this->getPropertyDefault(0) )
    1590             : {
    1591         204 : }
    1592             : 
    1593         396 : WrappedNumberOfLinesProperty::~WrappedNumberOfLinesProperty()
    1594             : {
    1595         396 : }
    1596             : 
    1597         439 : bool WrappedNumberOfLinesProperty::detectInnerValue( uno::Any& rInnerValue ) const
    1598             : {
    1599         439 :     sal_Int32 nNumberOfLines = 0;
    1600         439 :     bool bHasDetectableInnerValue = false;
    1601         439 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1602         878 :     uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
    1603         439 :     if( xDiagram.is() && xChartDoc.is() )
    1604             :     {
    1605             :         ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector(
    1606         439 :             DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
    1607         439 :         if( aSeriesVector.size() > 0 )
    1608             :         {
    1609         356 :             Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
    1610             :             DiagramHelper::tTemplateWithServiceName aTemplateAndService =
    1611         712 :                     DiagramHelper::getTemplateForDiagram( xDiagram, xFact );
    1612         356 :             if( aTemplateAndService.second == "com.sun.star.chart2.template.ColumnWithLine" )
    1613             :             {
    1614             :                 try
    1615             :                 {
    1616          24 :                     uno::Reference< beans::XPropertySet > xProp( aTemplateAndService.first, uno::UNO_QUERY );
    1617          24 :                     xProp->getPropertyValue( m_aOuterName ) >>= nNumberOfLines;
    1618          24 :                     bHasDetectableInnerValue = true;
    1619             :                 }
    1620           0 :                 catch( const uno::Exception & ex )
    1621             :                 {
    1622             :                     ASSERT_EXCEPTION( ex );
    1623             :                 }
    1624         356 :             }
    1625         439 :         }
    1626             :     }
    1627         439 :     if(bHasDetectableInnerValue)
    1628          24 :         rInnerValue = uno::makeAny(nNumberOfLines);
    1629         878 :     return bHasDetectableInnerValue;
    1630             : }
    1631             : 
    1632           4 : void WrappedNumberOfLinesProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1633             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1634             : {
    1635             :     sal_Int32 nNewValue;
    1636           4 :     if( ! (rOuterValue >>= nNewValue) )
    1637           0 :         throw lang::IllegalArgumentException( "property NumberOfLines requires sal_Int32 value", 0, 0 );
    1638             : 
    1639           4 :     m_aOuterValue = rOuterValue;
    1640             : 
    1641           4 :     uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
    1642           5 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1643           4 :     sal_Int32 nDimension = ::chart::DiagramHelper::getDimension( xDiagram );
    1644           4 :     if( xChartDoc.is() && xDiagram.is() && nDimension == 2 )
    1645             :     {
    1646           4 :         Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
    1647             :         DiagramHelper::tTemplateWithServiceName aTemplateAndService =
    1648           5 :                 DiagramHelper::getTemplateForDiagram( xDiagram, xFact );
    1649             : 
    1650           5 :         uno::Reference< chart2::XChartTypeTemplate > xTemplate(0);
    1651           4 :         if( aTemplateAndService.second == "com.sun.star.chart2.template.ColumnWithLine" )
    1652             :         {
    1653           0 :             if( nNewValue != 0 )
    1654             :             {
    1655           0 :                 xTemplate.set( aTemplateAndService.first );
    1656             :                 try
    1657             :                 {
    1658           0 :                     sal_Int32 nOldValue = 0;
    1659           0 :                     uno::Reference< beans::XPropertySet > xProp( xTemplate, uno::UNO_QUERY );
    1660           0 :                     xProp->getPropertyValue( m_aOuterName ) >>= nOldValue;
    1661           0 :                     if( nOldValue == nNewValue )
    1662           0 :                         return;
    1663             :                 }
    1664           0 :                 catch( const uno::Exception & ex )
    1665             :                 {
    1666             :                     ASSERT_EXCEPTION( ex );
    1667             :                 }
    1668             :             }
    1669             :             else
    1670             :             {
    1671           0 :                 xTemplate.set( xFact->createInstance("com.sun.star.chart2.template.Column"), uno::UNO_QUERY );
    1672             :             }
    1673             :         }
    1674           4 :         else if( aTemplateAndService.second == "com.sun.star.chart2.template.Column" )
    1675             :         {
    1676           3 :             if( nNewValue == 0 )
    1677           3 :                 return;
    1678           0 :             xTemplate.set( xFact->createInstance( "com.sun.star.chart2.template.ColumnWithLine" ), uno::UNO_QUERY );
    1679             :         }
    1680             : 
    1681           1 :         if(xTemplate.is())
    1682             :         {
    1683             :             try
    1684             :             {
    1685             :                 // locked controllers
    1686           0 :                 ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
    1687           0 :                 uno::Reference< beans::XPropertySet > xProp( xTemplate, uno::UNO_QUERY );
    1688           0 :                 xProp->setPropertyValue( "NumberOfLines", uno::makeAny(nNewValue) );
    1689           0 :                 xTemplate->changeDiagram( xDiagram );
    1690             :             }
    1691           0 :             catch( const uno::Exception & ex )
    1692             :             {
    1693             :                 ASSERT_EXCEPTION( ex );
    1694             :             }
    1695           1 :         }
    1696           1 :     }
    1697             : }
    1698             : 
    1699         439 : Any WrappedNumberOfLinesProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1700             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1701             : {
    1702         439 :     Any aRet;
    1703         439 :     if( !detectInnerValue( aRet ) )
    1704         415 :         aRet = m_aOuterValue;
    1705         439 :     return aRet;
    1706             : }
    1707             : 
    1708         546 : Any WrappedNumberOfLinesProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1709             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1710             : {
    1711         546 :     Any aRet;
    1712         546 :     aRet <<= sal_Int32( 0 );
    1713         546 :     return aRet;
    1714             : }
    1715             : 
    1716             : //PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS
    1717             : class WrappedAttributedDataPointsProperty : public WrappedProperty
    1718             : {
    1719             : public:
    1720             :     WrappedAttributedDataPointsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1721             :     virtual ~WrappedAttributedDataPointsProperty();
    1722             : 
    1723             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1724             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1725             : 
    1726             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1727             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1728             : 
    1729             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1730             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1731             : 
    1732             : private: //member
    1733             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1734             :     mutable Any                                 m_aOuterValue;
    1735             : };
    1736             : 
    1737         204 : WrappedAttributedDataPointsProperty::WrappedAttributedDataPointsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1738             :             : WrappedProperty("AttributedDataPoints",OUString())
    1739             :             , m_spChart2ModelContact( spChart2ModelContact )
    1740         204 :             , m_aOuterValue()
    1741             : {
    1742         204 :     m_aOuterValue = WrappedAttributedDataPointsProperty::getPropertyDefault( 0 );
    1743         204 : }
    1744             : 
    1745         408 : WrappedAttributedDataPointsProperty::~WrappedAttributedDataPointsProperty()
    1746             : {
    1747         408 : }
    1748             : 
    1749           0 : void WrappedAttributedDataPointsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1750             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1751             : {
    1752           0 :     uno::Sequence< uno::Sequence< sal_Int32 > > aNewValue;
    1753           0 :     if( ! (rOuterValue >>= aNewValue) )
    1754           0 :         throw lang::IllegalArgumentException( "Property AttributedDataPoints requires value of type uno::Sequence< uno::Sequence< sal_Int32 > >", 0, 0 );
    1755             : 
    1756           0 :     m_aOuterValue = rOuterValue;
    1757             : 
    1758           0 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1759           0 :     Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
    1760             : 
    1761           0 :     if( xDiagram.is() && xDiaProp.is())
    1762             :     {
    1763             :         ::std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
    1764           0 :             ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
    1765             :         ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
    1766           0 :                 aSeriesVector.begin();
    1767           0 :         sal_Int32 i = 0;
    1768           0 :         for( ; aIt != aSeriesVector.end(); ++aIt, ++i )
    1769             :         {
    1770           0 :             Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
    1771           0 :             if( xProp.is())
    1772             :             {
    1773           0 :                 uno::Any aVal;
    1774           0 :                 if( i < aNewValue.getLength() )
    1775           0 :                     aVal <<= aNewValue[i];
    1776             :                 else
    1777             :                 {
    1778             :                     //set empty sequence
    1779           0 :                     uno::Sequence< sal_Int32 > aSeq;
    1780           0 :                     aVal <<= aSeq;
    1781             :                 }
    1782           0 :                 xProp->setPropertyValue( "AttributedDataPoints", aVal );
    1783             :             }
    1784           0 :         }
    1785           0 :     }
    1786           0 : }
    1787             : 
    1788           0 : Any WrappedAttributedDataPointsProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1789             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1790             : {
    1791           0 :     Reference< chart2::XDiagram >    xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1792           0 :     Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
    1793             : 
    1794           0 :     if( xDiagram.is() && xDiaProp.is())
    1795             :     {
    1796             :         ::std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
    1797           0 :             ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
    1798             : 
    1799           0 :         uno::Sequence< uno::Sequence< sal_Int32 > > aResult( aSeriesVector.size() );
    1800             : 
    1801             :         ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
    1802           0 :                 aSeriesVector.begin();
    1803           0 :         sal_Int32 i = 0;
    1804           0 :         for( ; aIt != aSeriesVector.end(); ++aIt, ++i )
    1805             :         {
    1806           0 :             Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
    1807           0 :             if( xProp.is())
    1808             :             {
    1809             :                 uno::Any aVal(
    1810           0 :                     xProp->getPropertyValue("AttributedDataPoints"));
    1811           0 :                 uno::Sequence< sal_Int32 > aSeq;
    1812           0 :                 if( aVal >>= aSeq )
    1813           0 :                     aResult[ i ] = aSeq;
    1814             :             }
    1815           0 :         }
    1816           0 :         m_aOuterValue <<= aResult;
    1817             :     }
    1818           0 :     return m_aOuterValue;
    1819             : }
    1820             : 
    1821         204 : Any WrappedAttributedDataPointsProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1822             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1823             : {
    1824         204 :     Any aRet;
    1825         408 :     uno::Sequence< uno::Sequence< sal_Int32 > > aSeq;
    1826         204 :     aRet <<= aSeq;
    1827         408 :     return aRet;
    1828             : }
    1829             : 
    1830             : //PROP_DIAGRAM_SOLIDTYPE
    1831             : class WrappedSolidTypeProperty : public WrappedProperty
    1832             : {
    1833             : public:
    1834             :     WrappedSolidTypeProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1835             :     virtual ~WrappedSolidTypeProperty();
    1836             : 
    1837             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1838             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1839             : 
    1840             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1841             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1842             : 
    1843             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1844             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1845             : 
    1846             : private: //member
    1847             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1848             :     mutable Any                                 m_aOuterValue;
    1849             : };
    1850             : 
    1851         204 : WrappedSolidTypeProperty::WrappedSolidTypeProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1852             :             : WrappedProperty( "SolidType", OUString() )
    1853             :             , m_spChart2ModelContact( spChart2ModelContact )
    1854         204 :             , m_aOuterValue()
    1855             : {
    1856         204 :     m_aOuterValue = WrappedSolidTypeProperty::getPropertyDefault( 0 );
    1857         204 : }
    1858             : 
    1859         396 : WrappedSolidTypeProperty::~WrappedSolidTypeProperty()
    1860             : {
    1861         396 : }
    1862             : 
    1863          18 : void WrappedSolidTypeProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1864             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1865             : {
    1866          18 :     sal_Int32 nNewSolidType = ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID;
    1867          18 :     if( ! (rOuterValue >>= nNewSolidType) )
    1868           0 :         throw lang::IllegalArgumentException( "Property SolidType requires integer value", 0, 0 );
    1869             : 
    1870          18 :     m_aOuterValue = rOuterValue;
    1871             : 
    1872          18 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1873          18 :     if( !xDiagram.is() )
    1874          18 :         return;
    1875             : 
    1876          18 :     bool bFound = false;
    1877          18 :     bool bAmbiguous = false;
    1878          18 :     sal_Int32 nOldSolidType = DiagramHelper::getGeometry3D( xDiagram, bFound, bAmbiguous );
    1879          18 :     if( bFound && ( nOldSolidType != nNewSolidType || bAmbiguous ) )
    1880           1 :         DiagramHelper::setGeometry3D( xDiagram, nNewSolidType );
    1881             : }
    1882             : 
    1883         455 : Any WrappedSolidTypeProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    1884             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1885             : {
    1886         455 :     bool bFound = false;
    1887         455 :     bool bAmbiguous = false;
    1888         455 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
    1889         455 :     if( xDiagram.is() )
    1890             :     {
    1891         455 :         sal_Int32 nGeometry = DiagramHelper::getGeometry3D( xDiagram, bFound, bAmbiguous );
    1892         455 :         if( bFound )
    1893         455 :             m_aOuterValue <<= nGeometry;
    1894             :     }
    1895         455 :     return m_aOuterValue;
    1896             : }
    1897             : 
    1898         546 : Any WrappedSolidTypeProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1899             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1900             : {
    1901         546 :     return uno::makeAny( ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID );
    1902             : }
    1903             : 
    1904             : class WrappedAutomaticSizeProperty : public WrappedProperty
    1905             : {
    1906             : public:
    1907             :     WrappedAutomaticSizeProperty();
    1908             :     virtual ~WrappedAutomaticSizeProperty();
    1909             : 
    1910             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1911             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1912             : 
    1913             :     virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1914             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1915             : 
    1916             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
    1917             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1918             : };
    1919             : 
    1920         204 : WrappedAutomaticSizeProperty::WrappedAutomaticSizeProperty()
    1921         204 :             : WrappedProperty( "AutomaticSize", OUString() )
    1922             : {
    1923         204 : }
    1924             : 
    1925         396 : WrappedAutomaticSizeProperty::~WrappedAutomaticSizeProperty()
    1926             : {
    1927         396 : }
    1928             : 
    1929          80 : void WrappedAutomaticSizeProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
    1930             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    1931             : {
    1932          80 :     if( xInnerPropertySet.is() )
    1933             :     {
    1934          80 :         bool bNewValue = true;
    1935          80 :         if( ! (rOuterValue >>= bNewValue) )
    1936           0 :             throw lang::IllegalArgumentException( "Property AutomaticSize requires value of type boolean", 0, 0 );
    1937             : 
    1938             :         try
    1939             :         {
    1940          80 :             if( bNewValue )
    1941             :             {
    1942          80 :                 Any aRelativeSize( xInnerPropertySet->getPropertyValue( "RelativeSize" ) );
    1943          80 :                 if( aRelativeSize.hasValue() )
    1944           0 :                     xInnerPropertySet->setPropertyValue( "RelativeSize", Any() );
    1945             :             }
    1946             :         }
    1947           0 :         catch( const uno::Exception & ex )
    1948             :         {
    1949             :             ASSERT_EXCEPTION( ex );
    1950             :         }
    1951             :     }
    1952          80 : }
    1953             : 
    1954         684 : Any WrappedAutomaticSizeProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
    1955             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1956             : {
    1957         684 :     Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
    1958         684 :     if( xInnerPropertySet.is() )
    1959             :     {
    1960         684 :         Any aRelativeSize( xInnerPropertySet->getPropertyValue( "RelativeSize" ) );
    1961         684 :         if( !aRelativeSize.hasValue() )
    1962         684 :             aRet <<= true;
    1963             :     }
    1964         684 :     return aRet;
    1965             : }
    1966             : 
    1967        1026 : Any WrappedAutomaticSizeProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
    1968             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
    1969             : {
    1970        1026 :     Any aRet;
    1971        1026 :     aRet <<= false;
    1972        1026 :     return aRet;
    1973             : }
    1974             : 
    1975             : //PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
    1976             : class WrappedIncludeHiddenCellsProperty : public WrappedProperty
    1977             : {
    1978             : public:
    1979             :     WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
    1980             :     virtual ~WrappedIncludeHiddenCellsProperty();
    1981             : 
    1982             :     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
    1983             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
    1984             : 
    1985             : private: //member
    1986             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
    1987             : };
    1988             : 
    1989         204 : WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
    1990             :             : WrappedProperty("IncludeHiddenCells","IncludeHiddenCells")
    1991         204 :             , m_spChart2ModelContact( spChart2ModelContact )
    1992             : {
    1993         204 : }
    1994             : 
    1995         396 : WrappedIncludeHiddenCellsProperty::~WrappedIncludeHiddenCellsProperty()
    1996             : {
    1997         396 : }
    1998             : 
    1999         189 : void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
    2000             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
    2001             : {
    2002         189 :     sal_Bool bNewValue = false;
    2003         189 :     if( ! (rOuterValue >>= bNewValue) )
    2004           0 :         throw lang::IllegalArgumentException( "Property Dim3D requires boolean value", 0, 0 );
    2005             : 
    2006         189 :     ChartModelHelper::setIncludeHiddenCells( bNewValue, *m_spChart2ModelContact->getModel() );
    2007         189 : }
    2008             : 
    2009             : // ____ XDiagramProvider ____
    2010         152 : Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram()
    2011             :     throw (uno::RuntimeException, std::exception)
    2012             : {
    2013         152 :     return m_spChart2ModelContact->getChart2Diagram();
    2014             : }
    2015             : 
    2016           0 : void SAL_CALL DiagramWrapper::setDiagram(
    2017             :     const Reference< chart2::XDiagram >& /*xDiagram*/ )
    2018             :     throw (uno::RuntimeException, std::exception)
    2019             : {
    2020             :     //@todo: remove this method from interface
    2021             :     OSL_FAIL("DiagramWrapper::setDiagram is not implemented, should be removed and not be called" );
    2022           0 : }
    2023             : 
    2024       38591 : Reference< beans::XPropertySet > DiagramWrapper::getInnerPropertySet()
    2025             : {
    2026       38591 :     return Reference< beans::XPropertySet >( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
    2027             : }
    2028             : 
    2029         204 : const Sequence< beans::Property >& DiagramWrapper::getPropertySequence()
    2030             : {
    2031         204 :     return *StaticDiagramWrapperPropertyArray::get();
    2032             : }
    2033             : 
    2034         204 : const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
    2035             : {
    2036         204 :     ::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
    2037             : 
    2038         204 :     WrappedAxisAndGridExistenceProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
    2039         204 :     WrappedAxisTitleExistenceProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
    2040         204 :     WrappedAxisLabelExistenceProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
    2041         204 :     WrappedSceneProperty::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
    2042         204 :     WrappedIgnoreProperties::addIgnoreFillProperties( aWrappedProperties );
    2043         204 :     WrappedIgnoreProperties::addIgnoreLineProperties( aWrappedProperties );
    2044         204 :     WrappedStatisticProperties::addWrappedPropertiesForDiagram( aWrappedProperties, m_spChart2ModelContact );
    2045         204 :     WrappedSymbolProperties::addWrappedPropertiesForDiagram( aWrappedProperties, m_spChart2ModelContact );
    2046         204 :     WrappedDataCaptionProperties::addWrappedPropertiesForDiagram( aWrappedProperties, m_spChart2ModelContact );
    2047         204 :     WrappedSplineProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
    2048         204 :     WrappedStockProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
    2049         204 :     WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
    2050         204 :     WrappedGL3DProperties::addWrappedProperties(aWrappedProperties, m_spChart2ModelContact);
    2051             : 
    2052         204 :     aWrappedProperties.push_back( new WrappedDataRowSourceProperty( m_spChart2ModelContact ) );
    2053         204 :     aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Y_STACKED,m_spChart2ModelContact ) );
    2054         204 :     aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Y_STACKED_PERCENT, m_spChart2ModelContact ) );
    2055         204 :     aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Z_STACKED, m_spChart2ModelContact ) );
    2056         204 :     aWrappedProperties.push_back( new WrappedDim3DProperty( m_spChart2ModelContact ) );
    2057         204 :     aWrappedProperties.push_back( new WrappedVerticalProperty( m_spChart2ModelContact ) );
    2058         204 :     aWrappedProperties.push_back( new WrappedNumberOfLinesProperty( m_spChart2ModelContact ) );
    2059         204 :     aWrappedProperties.push_back( new WrappedAttributedDataPointsProperty( m_spChart2ModelContact ) );
    2060         204 :     aWrappedProperties.push_back( new WrappedProperty( "StackedBarsConnected", "ConnectBars" ) );
    2061         204 :     aWrappedProperties.push_back( new WrappedSolidTypeProperty( m_spChart2ModelContact ) );
    2062         204 :     aWrappedProperties.push_back( new WrappedAutomaticSizeProperty() );
    2063         204 :     aWrappedProperties.push_back( new WrappedIncludeHiddenCellsProperty( m_spChart2ModelContact ) );
    2064             : 
    2065         204 :     return aWrappedProperties;
    2066             : }
    2067             : 
    2068          27 : uno::Sequence< OUString > DiagramWrapper::getSupportedServiceNames_Static()
    2069             : {
    2070          27 :     uno::Sequence< OUString > aServices( 8 );
    2071          27 :     aServices[ 0 ] = "com.sun.star.chart.Diagram";
    2072          27 :     aServices[ 1 ] = "com.sun.star.xml.UserDefinedAttributesSupplier";
    2073          27 :     aServices[ 2 ] = "com.sun.star.chart.StackableDiagram";
    2074          27 :     aServices[ 3 ] = "com.sun.star.chart.ChartAxisXSupplier";
    2075          27 :     aServices[ 4 ] = "com.sun.star.chart.ChartAxisYSupplier";
    2076          27 :     aServices[ 5 ] = "com.sun.star.chart.ChartAxisZSupplier";
    2077          27 :     aServices[ 6 ] = "com.sun.star.chart.ChartTwoAxisXSupplier";
    2078          27 :     aServices[ 7 ] = "com.sun.star.chart.ChartTwoAxisYSupplier";
    2079             : 
    2080          27 :     return aServices;
    2081             : }
    2082             : 
    2083             : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
    2084          53 : APPHELPER_XSERVICEINFO_IMPL( DiagramWrapper, lcl_aServiceName );
    2085             : 
    2086             : } //  namespace wrapper
    2087          45 : } //  namespace chart
    2088             : 
    2089             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10