LCOV - code coverage report
Current view: top level - chart2/source/controller/dialogs - tp_ChartType.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 587 0.0 %
Date: 2012-08-25 Functions: 0 98 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 1051 0.0 %

           Branch data     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                 :            : 
      21                 :            : #include "tp_ChartType.hxx"
      22                 :            : #include "tp_ChartType.hrc"
      23                 :            : #include "Strings.hrc"
      24                 :            : #include "ResId.hxx"
      25                 :            : #include "ChartModelHelper.hxx"
      26                 :            : #include "DiagramHelper.hxx"
      27                 :            : #include "NoWarningThisInCTOR.hxx"
      28                 :            : #include "res_BarGeometry.hxx"
      29                 :            : #include "ControllerLockGuard.hxx"
      30                 :            : #include "macros.hxx"
      31                 :            : 
      32                 :            : #include <svtools/controldims.hrc>
      33                 :            : 
      34                 :            : // header for define RET_OK
      35                 :            : #include <vcl/msgbox.hxx>
      36                 :            : 
      37                 :            : //for auto_ptr
      38                 :            : #include <memory>
      39                 :            : 
      40                 :            : //.............................................................................
      41                 :            : namespace chart
      42                 :            : {
      43                 :            : //.............................................................................
      44                 :            : using namespace ::com::sun::star;
      45                 :            : using namespace ::com::sun::star::chart2;
      46                 :            : 
      47                 :            : namespace
      48                 :            : {
      49                 :          0 :     long lcl_getDistance()
      50                 :            :     {
      51                 :          0 :         return 6;
      52                 :            :     }
      53                 :            : 
      54                 :          0 :     sal_Bool lcl_getSortByXValues( const uno::Reference< chart2::XChartDocument >& xChartDoc )
      55                 :            :     {
      56                 :          0 :         sal_Bool bRet = sal_False;
      57         [ #  # ]:          0 :         if( xChartDoc.is() )
      58                 :            :         {
      59                 :            :             try
      60                 :            :             {
      61 [ #  # ][ #  # ]:          0 :                 uno::Reference< beans::XPropertySet > xDiaProp( xChartDoc->getFirstDiagram(), uno::UNO_QUERY_THROW );
                 [ #  # ]
      62 [ #  # ][ #  # ]:          0 :                 xDiaProp->getPropertyValue( C2U( "SortByXValues" ) ) >>= bRet;
         [ #  # ][ #  # ]
      63                 :            :             }
      64         [ #  # ]:          0 :             catch( const uno::Exception & ex )
      65                 :            :             {
      66                 :            :                 ASSERT_EXCEPTION( ex );
      67                 :            :             }
      68                 :            :         }
      69                 :          0 :         return bRet;
      70                 :            :     }
      71                 :            : }
      72                 :            : 
      73                 :            : //--------------------------------------------------------------------------
      74                 :            : class AxisTypeResourceGroup : public ChangingResource
      75                 :            : {
      76                 :            : public:
      77                 :            :     AxisTypeResourceGroup( Window* pWindow );
      78                 :            :     virtual ~AxisTypeResourceGroup();
      79                 :            : 
      80                 :            :     void  showControls( bool bShow );
      81                 :            :     Point getPosition();
      82                 :            :     long  getHeight();
      83                 :            :     void  setPosition( const Point& rPoint );
      84                 :            : 
      85                 :            :     void fillControls( const ChartTypeParameter& rParameter );
      86                 :            :     void fillParameter( ChartTypeParameter& rParameter );
      87                 :            : 
      88                 :            : private:
      89                 :            :     DECL_LINK( AxisTypeCheckHdl, void* );
      90                 :            : private:
      91                 :            :     CheckBox    m_aCB_XAxis_Categories;
      92                 :            : };
      93                 :          0 : AxisTypeResourceGroup::AxisTypeResourceGroup( Window* pWindow )
      94                 :            :         : ChangingResource()
      95 [ #  # ][ #  # ]:          0 :         , m_aCB_XAxis_Categories( pWindow, SchResId( CB_X_AXIS_CATEGORIES ) )
      96                 :            : {
      97         [ #  # ]:          0 :     m_aCB_XAxis_Categories.SetToggleHdl( LINK( this, AxisTypeResourceGroup, AxisTypeCheckHdl ) );
      98                 :          0 : }
      99         [ #  # ]:          0 : AxisTypeResourceGroup::~AxisTypeResourceGroup()
     100                 :            : {
     101         [ #  # ]:          0 : }
     102                 :          0 : void AxisTypeResourceGroup::showControls( bool bShow )
     103                 :            : {
     104                 :          0 :     m_aCB_XAxis_Categories.Show(bShow);
     105                 :          0 : }
     106                 :          0 : Point AxisTypeResourceGroup::getPosition()
     107                 :            : {
     108                 :          0 :     return m_aCB_XAxis_Categories.GetPosPixel();
     109                 :            : }
     110                 :          0 : long AxisTypeResourceGroup::getHeight()
     111                 :            : {
     112                 :          0 :     return m_aCB_XAxis_Categories.GetSizePixel().Height();
     113                 :            : }
     114                 :          0 : void AxisTypeResourceGroup::setPosition( const Point& rPoint )
     115                 :            : {
     116                 :          0 :     m_aCB_XAxis_Categories.SetPosPixel(rPoint);
     117                 :          0 : }
     118                 :          0 : void AxisTypeResourceGroup::fillControls( const ChartTypeParameter& rParameter )
     119                 :            : {
     120                 :          0 :     m_aCB_XAxis_Categories.Check(!rParameter.bXAxisWithValues);
     121                 :          0 : }
     122                 :          0 : void AxisTypeResourceGroup::fillParameter( ChartTypeParameter& rParameter )
     123                 :            : {
     124                 :          0 :     rParameter.bXAxisWithValues = !m_aCB_XAxis_Categories.IsChecked();
     125                 :          0 : }
     126                 :          0 : IMPL_LINK_NOARG(AxisTypeResourceGroup, AxisTypeCheckHdl)
     127                 :            : {
     128         [ #  # ]:          0 :     if( m_pChangeListener )
     129                 :          0 :         m_pChangeListener->stateChanged(this);
     130                 :          0 :     return 0;
     131                 :            : }
     132                 :            : //--------------------------------------------------------------------------
     133                 :            : 
     134                 :            : #define POS_3DSCHEME_SIMPLE    0
     135                 :            : #define POS_3DSCHEME_REALISTIC 1
     136                 :            : 
     137                 :            : class Dim3DLookResourceGroup : public ChangingResource
     138                 :            : {
     139                 :            : public:
     140                 :            :     Dim3DLookResourceGroup( Window* pWindow );
     141                 :            :     virtual ~Dim3DLookResourceGroup();
     142                 :            : 
     143                 :            :     void  showControls( bool bShow );
     144                 :            :     long  getHeight();
     145                 :            :     void  setPosition( const Point& rPoint );
     146                 :            : 
     147                 :            :     void fillControls( const ChartTypeParameter& rParameter );
     148                 :            :     void fillParameter( ChartTypeParameter& rParameter );
     149                 :            : 
     150                 :            : private:
     151                 :            :     DECL_LINK( Dim3DLookCheckHdl, void* );
     152                 :            :     DECL_LINK( SelectSchemeHdl, void* );
     153                 :            : 
     154                 :            : private:
     155                 :            :     CheckBox    m_aCB_3DLook;
     156                 :            :     ListBox     m_aLB_Scheme;
     157                 :            : };
     158                 :          0 : Dim3DLookResourceGroup::Dim3DLookResourceGroup( Window* pWindow )
     159                 :            :             : ChangingResource()
     160                 :            :             , m_aCB_3DLook( pWindow, SchResId( CB_3D_LOOK ) )
     161 [ #  # ][ #  # ]:          0 :             , m_aLB_Scheme( pWindow, SchResId( LB_3D_SCHEME ) )
         [ #  # ][ #  # ]
     162                 :            : {
     163         [ #  # ]:          0 :     m_aCB_3DLook.SetToggleHdl( LINK( this, Dim3DLookResourceGroup, Dim3DLookCheckHdl ) );
     164                 :            : 
     165 [ #  # ][ #  # ]:          0 :     m_aLB_Scheme.InsertEntry(String(SchResId(STR_3DSCHEME_SIMPLE)));
         [ #  # ][ #  # ]
     166 [ #  # ][ #  # ]:          0 :     m_aLB_Scheme.InsertEntry(String(SchResId(STR_3DSCHEME_REALISTIC)));
         [ #  # ][ #  # ]
     167         [ #  # ]:          0 :     m_aLB_Scheme.SetDropDownLineCount(2);
     168                 :            : 
     169         [ #  # ]:          0 :     m_aLB_Scheme.SetSelectHdl( LINK( this, Dim3DLookResourceGroup, SelectSchemeHdl ) );
     170 [ #  # ][ #  # ]:          0 :     m_aLB_Scheme.SetAccessibleName(m_aCB_3DLook.GetText());
                 [ #  # ]
     171         [ #  # ]:          0 :     m_aLB_Scheme.SetAccessibleRelationLabeledBy(&m_aCB_3DLook);
     172                 :          0 : }
     173 [ #  # ][ #  # ]:          0 : Dim3DLookResourceGroup::~Dim3DLookResourceGroup()
     174                 :            : {
     175         [ #  # ]:          0 : }
     176                 :          0 : void Dim3DLookResourceGroup::showControls( bool bShow )
     177                 :            : {
     178                 :          0 :     m_aCB_3DLook.Show(bShow);
     179                 :          0 :     m_aLB_Scheme.Show(bShow);
     180                 :          0 : }
     181                 :          0 : long Dim3DLookResourceGroup::getHeight()
     182                 :            : {
     183 [ #  # ][ #  # ]:          0 :     return m_aCB_3DLook.GetSizePixel().Height() + m_aLB_Scheme.LogicToPixel( Size(0,2), MapMode(MAP_APPFONT) ).Height();
                 [ #  # ]
     184                 :            : }
     185                 :          0 : void Dim3DLookResourceGroup::setPosition( const Point& rPoint )
     186                 :            : {
     187         [ #  # ]:          0 :     m_aCB_3DLook.SetPosPixel(rPoint);
     188         [ #  # ]:          0 :     Size aSize( m_aCB_3DLook.CalcMinimumSize() );
     189         [ #  # ]:          0 :     m_aCB_3DLook.SetPosSizePixel(rPoint,aSize);
     190                 :          0 :     Point aLBPos(rPoint);
     191                 :          0 :     aLBPos.X() += aSize.Width()
     192 [ #  # ][ #  # ]:          0 :                 + m_aLB_Scheme.LogicToPixel( Size(6,0), MapMode(MAP_APPFONT) ).Width();
                 [ #  # ]
     193 [ #  # ][ #  # ]:          0 :     aLBPos.Y() -= m_aLB_Scheme.LogicToPixel( Size(0,2), MapMode(MAP_APPFONT) ).Height();
                 [ #  # ]
     194         [ #  # ]:          0 :     m_aLB_Scheme.SetPosPixel(aLBPos);
     195                 :          0 : }
     196                 :          0 : void Dim3DLookResourceGroup::fillControls( const ChartTypeParameter& rParameter )
     197                 :            : {
     198                 :          0 :     m_aCB_3DLook.Check(rParameter.b3DLook);
     199                 :          0 :     m_aLB_Scheme.Enable(rParameter.b3DLook);
     200                 :            : 
     201         [ #  # ]:          0 :     if( rParameter.eThreeDLookScheme == ThreeDLookScheme_Simple )
     202                 :          0 :         m_aLB_Scheme.SelectEntryPos(POS_3DSCHEME_SIMPLE);
     203         [ #  # ]:          0 :     else if( rParameter.eThreeDLookScheme == ThreeDLookScheme_Realistic )
     204                 :          0 :         m_aLB_Scheme.SelectEntryPos(POS_3DSCHEME_REALISTIC);
     205                 :            :     else
     206                 :          0 :         m_aLB_Scheme.SetNoSelection();
     207                 :          0 : }
     208                 :          0 : void Dim3DLookResourceGroup::fillParameter( ChartTypeParameter& rParameter )
     209                 :            : {
     210                 :          0 :     rParameter.b3DLook = m_aCB_3DLook.IsChecked();
     211                 :          0 :     sal_uInt16 nPos = m_aLB_Scheme.GetSelectEntryPos();
     212         [ #  # ]:          0 :     if( POS_3DSCHEME_SIMPLE == nPos )
     213                 :          0 :         rParameter.eThreeDLookScheme = ThreeDLookScheme_Simple;
     214         [ #  # ]:          0 :     else if( POS_3DSCHEME_REALISTIC == nPos )
     215                 :          0 :         rParameter.eThreeDLookScheme = ThreeDLookScheme_Realistic;
     216                 :            :     else
     217                 :          0 :         rParameter.eThreeDLookScheme = ThreeDLookScheme_Unknown;
     218                 :          0 : }
     219                 :          0 : IMPL_LINK_NOARG(Dim3DLookResourceGroup, Dim3DLookCheckHdl)
     220                 :            : {
     221         [ #  # ]:          0 :     if(m_pChangeListener)
     222                 :          0 :         m_pChangeListener->stateChanged(this);
     223                 :          0 :     return 0;
     224                 :            : }
     225                 :          0 : IMPL_LINK_NOARG(Dim3DLookResourceGroup, SelectSchemeHdl)
     226                 :            : {
     227         [ #  # ]:          0 :     if(m_pChangeListener)
     228                 :          0 :         m_pChangeListener->stateChanged(this);
     229                 :          0 :     return 0;
     230                 :            : }
     231                 :            : 
     232                 :            : //--------------------------------------------------------------------------
     233                 :            : 
     234                 :            : class SortByXValuesResourceGroup : public ChangingResource
     235                 :            : {
     236                 :            : public:
     237                 :            :     SortByXValuesResourceGroup( Window* pWindow );
     238                 :            :     virtual ~SortByXValuesResourceGroup();
     239                 :            : 
     240                 :            :     void  showControls( bool bShow );
     241                 :            :     long  getHeight();
     242                 :            :     void  setPosition( const Point& rPoint );
     243                 :            : 
     244                 :            :     void fillControls( const ChartTypeParameter& rParameter );
     245                 :            :     void fillParameter( ChartTypeParameter& rParameter );
     246                 :            : 
     247                 :            : private:
     248                 :            :     DECL_LINK( SortByXValuesCheckHdl, void* );
     249                 :            : 
     250                 :            : private:
     251                 :            :     CheckBox    m_aCB_XValueSorting;
     252                 :            : };
     253                 :          0 : SortByXValuesResourceGroup::SortByXValuesResourceGroup( Window* pWindow )
     254                 :            :             : ChangingResource()
     255 [ #  # ][ #  # ]:          0 :             , m_aCB_XValueSorting( pWindow, SchResId( CB_XVALUE_SORTING ) )
     256                 :            : {
     257         [ #  # ]:          0 :     m_aCB_XValueSorting.SetToggleHdl( LINK( this, SortByXValuesResourceGroup, SortByXValuesCheckHdl ) );
     258                 :          0 : }
     259         [ #  # ]:          0 : SortByXValuesResourceGroup::~SortByXValuesResourceGroup()
     260                 :            : {
     261         [ #  # ]:          0 : }
     262                 :          0 : void SortByXValuesResourceGroup::showControls( bool bShow )
     263                 :            : {
     264                 :          0 :     m_aCB_XValueSorting.Show(bShow);
     265                 :          0 : }
     266                 :          0 : long SortByXValuesResourceGroup::getHeight()
     267                 :            : {
     268                 :          0 :     return m_aCB_XValueSorting.GetSizePixel().Height();
     269                 :            : }
     270                 :          0 : void SortByXValuesResourceGroup::setPosition( const Point& rPoint )
     271                 :            : {
     272                 :          0 :     m_aCB_XValueSorting.SetPosPixel(rPoint);
     273                 :          0 : }
     274                 :          0 : void SortByXValuesResourceGroup::fillControls( const ChartTypeParameter& rParameter )
     275                 :            : {
     276                 :          0 :     m_aCB_XValueSorting.Check( rParameter.bSortByXValues );
     277                 :          0 : }
     278                 :          0 : void SortByXValuesResourceGroup::fillParameter( ChartTypeParameter& rParameter )
     279                 :            : {
     280                 :          0 :     rParameter.bSortByXValues = m_aCB_XValueSorting.IsChecked();
     281                 :          0 : }
     282                 :          0 : IMPL_LINK_NOARG(SortByXValuesResourceGroup, SortByXValuesCheckHdl)
     283                 :            : {
     284         [ #  # ]:          0 :     if(m_pChangeListener)
     285                 :          0 :         m_pChangeListener->stateChanged(this);
     286                 :          0 :     return 0;
     287                 :            : }
     288                 :            : //--------------------------------------------------------------------------
     289                 :            : class StackingResourceGroup : public ChangingResource
     290                 :            : {
     291                 :            : public:
     292                 :            :     StackingResourceGroup( Window* pWindow );
     293                 :            :     virtual ~StackingResourceGroup();
     294                 :            : 
     295                 :            :     void  showControls( bool bShow, bool bShowDeepStacking );
     296                 :            :     Point getPosition();
     297                 :            :     long  getHeight();
     298                 :            :     void  setPosition( const Point& rPoint );
     299                 :            : 
     300                 :            :     void fillControls( const ChartTypeParameter& rParameter );
     301                 :            :     void fillParameter( ChartTypeParameter& rParameter );
     302                 :            : 
     303                 :            : private:
     304                 :            :     DECL_LINK( StackingChangeHdl, RadioButton* );
     305                 :            :     DECL_LINK( StackingEnableHdl, void* );
     306                 :            : 
     307                 :            : private:
     308                 :            :     CheckBox    m_aCB_Stacked;
     309                 :            :     RadioButton m_aRB_Stack_Y;
     310                 :            :     RadioButton m_aRB_Stack_Y_Percent;
     311                 :            :     RadioButton m_aRB_Stack_Z;
     312                 :            : 
     313                 :            :     bool m_bShowDeepStacking;
     314                 :            : };
     315                 :          0 : StackingResourceGroup::StackingResourceGroup( Window* pWindow )
     316                 :            :         : ChangingResource()
     317                 :            :         , m_aCB_Stacked( pWindow, SchResId( CB_STACKED ) )
     318                 :            :         , m_aRB_Stack_Y( pWindow, SchResId( RB_STACK_Y ) )
     319                 :            :         , m_aRB_Stack_Y_Percent( pWindow, SchResId( RB_STACK_Y_PERCENT ) )
     320                 :            :         , m_aRB_Stack_Z( pWindow, SchResId( RB_STACK_Z ) )
     321 [ #  # ][ #  # ]:          0 :         , m_bShowDeepStacking(true)
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     322                 :            : {
     323         [ #  # ]:          0 :     m_aCB_Stacked.SetToggleHdl( LINK( this, StackingResourceGroup, StackingEnableHdl ) );
     324         [ #  # ]:          0 :     m_aRB_Stack_Y.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
     325         [ #  # ]:          0 :     m_aRB_Stack_Y_Percent.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
     326         [ #  # ]:          0 :     m_aRB_Stack_Z.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
     327         [ #  # ]:          0 :     m_aRB_Stack_Y.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
     328         [ #  # ]:          0 :     m_aRB_Stack_Y_Percent.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
     329         [ #  # ]:          0 :     m_aRB_Stack_Z.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
     330                 :          0 : }
     331 [ #  # ][ #  # ]:          0 : StackingResourceGroup::~StackingResourceGroup()
         [ #  # ][ #  # ]
     332                 :            : {
     333         [ #  # ]:          0 : }
     334                 :          0 : void StackingResourceGroup::showControls( bool bShow, bool bShowDeepStacking )
     335                 :            : {
     336                 :          0 :     m_bShowDeepStacking = bShowDeepStacking;
     337                 :          0 :     m_aCB_Stacked.Show(bShow);
     338                 :          0 :     m_aRB_Stack_Y.Show(bShow);
     339                 :          0 :     m_aRB_Stack_Y_Percent.Show(bShow);
     340 [ #  # ][ #  # ]:          0 :     m_aRB_Stack_Z.Show(bShow&&bShowDeepStacking);
     341                 :          0 : }
     342                 :          0 : Point StackingResourceGroup::getPosition()
     343                 :            : {
     344                 :          0 :     return m_aCB_Stacked.GetPosPixel();
     345                 :            : }
     346                 :          0 : long StackingResourceGroup::getHeight()
     347                 :            : {
     348         [ #  # ]:          0 :     RadioButton& rLastButton = m_bShowDeepStacking ? m_aRB_Stack_Z : m_aRB_Stack_Y_Percent;
     349                 :            : 
     350                 :          0 :     long nHeight = rLastButton.GetPosPixel().Y()
     351         [ #  # ]:          0 :         - m_aCB_Stacked.GetPosPixel().Y();
     352                 :          0 :     nHeight += rLastButton.GetSizePixel().Height();
     353                 :          0 :     return nHeight;
     354                 :            : }
     355                 :          0 : void StackingResourceGroup::setPosition( const Point& rPoint )
     356                 :            : {
     357         [ #  # ]:          0 :     Point aOld = this->getPosition();
     358                 :          0 :     long nDiffY = rPoint.Y() - aOld.Y();
     359                 :          0 :     long nDiffX = rPoint.X() - aOld.X();
     360         [ #  # ]:          0 :     m_aCB_Stacked.SetPosPixel( Point( aOld.X()+nDiffX, aOld.Y()+nDiffY ) );
     361                 :            : 
     362         [ #  # ]:          0 :     aOld = m_aRB_Stack_Y.GetPosPixel();
     363         [ #  # ]:          0 :     m_aRB_Stack_Y.SetPosPixel( Point( aOld.X()+nDiffX, aOld.Y()+nDiffY ) );
     364                 :            : 
     365         [ #  # ]:          0 :     aOld = m_aRB_Stack_Y_Percent.GetPosPixel();
     366         [ #  # ]:          0 :     m_aRB_Stack_Y_Percent.SetPosPixel( Point( aOld.X()+nDiffX, aOld.Y()+nDiffY ) );
     367                 :            : 
     368         [ #  # ]:          0 :     aOld = m_aRB_Stack_Z.GetPosPixel();
     369         [ #  # ]:          0 :     m_aRB_Stack_Z.SetPosPixel( Point( aOld.X()+nDiffX, aOld.Y()+nDiffY ) );
     370                 :          0 : }
     371                 :          0 : void StackingResourceGroup::fillControls( const ChartTypeParameter& rParameter )
     372                 :            : {
     373                 :            :     m_aCB_Stacked.Check( rParameter.eStackMode!=GlobalStackMode_NONE
     374 [ #  # ][ #  # ]:          0 :         && rParameter.eStackMode!=GlobalStackMode_STACK_Z ); //todo remove this condition if z stacking radio button is really used
     375   [ #  #  #  # ]:          0 :     switch( rParameter.eStackMode )
     376                 :            :     {
     377                 :            :         case GlobalStackMode_STACK_Y:
     378                 :          0 :             m_aRB_Stack_Y.Check();
     379                 :          0 :             break;
     380                 :            :         case GlobalStackMode_STACK_Y_PERCENT:
     381                 :          0 :             m_aRB_Stack_Y_Percent.Check();
     382                 :          0 :             break;
     383                 :            :         case GlobalStackMode_STACK_Z:
     384                 :            :             //todo uncomment this condition if z stacking radio button is really used
     385                 :            :             /*
     386                 :            :             if( rParameter.b3DLook )
     387                 :            :                 m_aRB_Stack_Z.Check();
     388                 :            :             else
     389                 :            :             */
     390                 :          0 :                 m_aRB_Stack_Y.Check();
     391                 :          0 :             break;
     392                 :            :         default:
     393                 :          0 :             m_aRB_Stack_Y.Check();
     394                 :          0 :             break;
     395                 :            :     }
     396                 :            :     //dis/enabling
     397                 :          0 :     m_aCB_Stacked.Enable( !rParameter.bXAxisWithValues );
     398 [ #  # ][ #  # ]:          0 :     m_aRB_Stack_Y.Enable( m_aCB_Stacked.IsChecked() && !rParameter.bXAxisWithValues );
     399 [ #  # ][ #  # ]:          0 :     m_aRB_Stack_Y_Percent.Enable( m_aCB_Stacked.IsChecked() && !rParameter.bXAxisWithValues );
     400 [ #  # ][ #  # ]:          0 :     m_aRB_Stack_Z.Enable( m_aCB_Stacked.IsChecked() && rParameter.b3DLook );
     401                 :          0 : }
     402                 :          0 : void StackingResourceGroup::fillParameter( ChartTypeParameter& rParameter )
     403                 :            : {
     404         [ #  # ]:          0 :     if(!m_aCB_Stacked.IsChecked())
     405                 :          0 :         rParameter.eStackMode = GlobalStackMode_NONE;
     406         [ #  # ]:          0 :     else if(m_aRB_Stack_Y.IsChecked())
     407                 :          0 :         rParameter.eStackMode = GlobalStackMode_STACK_Y;
     408         [ #  # ]:          0 :     else if(m_aRB_Stack_Y_Percent.IsChecked())
     409                 :          0 :         rParameter.eStackMode = GlobalStackMode_STACK_Y_PERCENT;
     410         [ #  # ]:          0 :     else if(m_aRB_Stack_Z.IsChecked())
     411                 :          0 :         rParameter.eStackMode = GlobalStackMode_STACK_Z;
     412                 :          0 : }
     413                 :          0 : IMPL_LINK( StackingResourceGroup, StackingChangeHdl, RadioButton*, pRadio )
     414                 :            : {
     415                 :            :     //for each radio click ther are coming two change events
     416                 :            :     //first uncheck of previous button -> ignore that call
     417                 :            :     //the second call gives the check of the new button
     418 [ #  # ][ #  # ]:          0 :     if( m_pChangeListener && pRadio && pRadio->IsChecked() )
         [ #  # ][ #  # ]
     419                 :          0 :         m_pChangeListener->stateChanged(this);
     420                 :          0 :     return 0;
     421                 :            : }
     422                 :          0 : IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl)
     423                 :            : {
     424         [ #  # ]:          0 :     if( m_pChangeListener )
     425                 :          0 :         m_pChangeListener->stateChanged(this);
     426                 :          0 :     return 0;
     427                 :            : }
     428                 :            : //--------------------------------------------------------------------------
     429                 :            : class SplinePropertiesDialog : public ModalDialog
     430                 :            : {
     431                 :            : public:
     432                 :            :     SplinePropertiesDialog( Window* pParent );
     433                 :            :     virtual ~SplinePropertiesDialog();
     434                 :            : 
     435                 :            :     void fillControls( const ChartTypeParameter& rParameter );
     436                 :            :     void fillParameter( ChartTypeParameter& rParameter, bool bSmoothLines );
     437                 :            : 
     438                 :            :     virtual void StateChanged( StateChangedType nType );
     439                 :            : 
     440                 :            : private:
     441                 :            :     DECL_LINK( SplineModeRadioHdl, void* );
     442                 :            : 
     443                 :            :     void adjustControlPositions();
     444                 :            :     void adjustSize();
     445                 :            : 
     446                 :            : private:
     447                 :            :     RadioButton m_aRB_Splines_Cubic;
     448                 :            :     RadioButton m_aRB_Splines_B;
     449                 :            : 
     450                 :            :     FixedLine   m_aFL_SplineSeparator;
     451                 :            : 
     452                 :            :     FixedText   m_aFT_SplineResolution;
     453                 :            :     MetricField m_aMF_SplineResolution;
     454                 :            :     FixedText   m_aFT_SplineOrder;
     455                 :            :     MetricField m_aMF_SplineOrder;
     456                 :            : 
     457                 :            :     FixedLine       m_aFL_DialogButtons;
     458                 :            :     HelpButton      m_aBP_Help;
     459                 :            :     OKButton        m_aBP_OK;
     460                 :            :     CancelButton    m_aBP_Cancel;
     461                 :            : };
     462                 :            : 
     463                 :          0 : SplinePropertiesDialog::SplinePropertiesDialog( Window* pParent )
     464                 :            :         : ModalDialog( pParent, SchResId( DLG_SPLINE_PROPERTIES ) )
     465                 :            :         , m_aRB_Splines_Cubic( this, SchResId( RB_SPLINES_CUBIC ) )
     466                 :            :         , m_aRB_Splines_B( this, SchResId( RB_SPLINES_B ) )
     467                 :            :         , m_aFL_SplineSeparator( this, SchResId( FL_SPLINE_SEPARATOR ) )
     468                 :            :         , m_aFT_SplineResolution( this, SchResId( FT_SPLINE_RESOLUTION ) )
     469                 :            :         , m_aMF_SplineResolution( this, SchResId( MF_SPLINE_RESOLUTION ) )
     470                 :            :         , m_aFT_SplineOrder( this, SchResId( FT_SPLINE_ORDER ) )
     471                 :            :         , m_aMF_SplineOrder( this, SchResId( MF_SPLINE_ORDER ) )
     472                 :            :         , m_aFL_DialogButtons( this, SchResId( FL_SPLINE_DIALOGBUTTONS ) )
     473                 :            :     , m_aBP_Help( this, SchResId(BTN_HELP) )
     474                 :            :         , m_aBP_OK( this, SchResId(BTN_OK) )
     475 [ #  # ][ #  # ]:          0 :     , m_aBP_Cancel( this, SchResId(BTN_CANCEL) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     476                 :            : {
     477         [ #  # ]:          0 :     FreeResource();
     478                 :            : 
     479 [ #  # ][ #  # ]:          0 :     this->SetText( String( SchResId( STR_DLG_SMOOTH_LINE_PROPERTIES ) ) );
         [ #  # ][ #  # ]
     480                 :            : 
     481         [ #  # ]:          0 :     m_aRB_Splines_Cubic.SetToggleHdl( LINK( this, SplinePropertiesDialog, SplineModeRadioHdl ) );
     482         [ #  # ]:          0 :     m_aRB_Splines_B.SetToggleHdl( LINK( this, SplinePropertiesDialog, SplineModeRadioHdl ) );
     483                 :          0 : }
     484                 :            : 
     485 [ #  # ][ #  # ]:          0 : SplinePropertiesDialog::~SplinePropertiesDialog()
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     486                 :            : {
     487         [ #  # ]:          0 : }
     488                 :            : 
     489                 :          0 : void SplinePropertiesDialog::StateChanged( StateChangedType nType )
     490                 :            : {
     491                 :          0 :     Dialog::StateChanged( nType );
     492                 :            : 
     493         [ #  # ]:          0 :     if( nType == STATE_CHANGE_INITSHOW )
     494                 :            :     {
     495                 :          0 :         adjustControlPositions();
     496                 :          0 :         adjustSize();
     497                 :            :     }
     498                 :          0 : }
     499                 :            : 
     500                 :          0 : void SplinePropertiesDialog::adjustControlPositions()
     501                 :            : {
     502                 :            :     //position of controls:
     503                 :            :     //----------------
     504                 :            :     //fixed line and Fixed texts as near as possible to radio controls
     505 [ #  # ][ #  # ]:          0 :     long nRBWidth = ::std::max( m_aRB_Splines_Cubic.CalcMinimumSize().Width(), m_aRB_Splines_B.CalcMinimumSize().Width());
     506 [ #  # ][ #  # ]:          0 :     long nFLXPos = m_aRB_Splines_Cubic.GetPosPixel().X()+nRBWidth+m_aFT_SplineOrder.LogicToPixel( Size(RSC_SP_CTRL_GROUP_X,0), MapMode(MAP_APPFONT) ).Width();
                 [ #  # ]
     507 [ #  # ][ #  # ]:          0 :     long nFTXPos = nFLXPos + m_aFL_SplineSeparator.GetSizePixel().Width() + m_aFT_SplineOrder.LogicToPixel( Size(RSC_SP_CTRL_GROUP_X,0), MapMode(MAP_APPFONT) ).Width();
                 [ #  # ]
     508                 :            : 
     509         [ #  # ]:          0 :     m_aRB_Splines_Cubic.SetSizePixel( Size( nRBWidth, m_aRB_Splines_Cubic.GetSizePixel().Height() ) );
     510         [ #  # ]:          0 :     m_aRB_Splines_B.SetSizePixel( Size( nRBWidth, m_aRB_Splines_B.GetSizePixel().Height() ) );
     511                 :            : 
     512         [ #  # ]:          0 :     m_aFL_SplineSeparator.SetPosPixel( Point( nFLXPos, m_aFL_SplineSeparator.GetPosPixel().Y() ) );
     513                 :            : 
     514         [ #  # ]:          0 :     m_aFT_SplineOrder.SetPosPixel( Point( nFTXPos, m_aFT_SplineOrder.GetPosPixel().Y() ) );
     515         [ #  # ]:          0 :     m_aFT_SplineResolution.SetPosPixel( Point( nFTXPos, m_aFT_SplineResolution.GetPosPixel().Y() ) );
     516                 :            : 
     517                 :            :     //----------------
     518                 :            :     //move metric controls as near to text as possible
     519 [ #  # ][ #  # ]:          0 :     long nFTWidth = ::std::max( m_aFT_SplineOrder.CalcMinimumSize().Width(), m_aFT_SplineResolution.CalcMinimumSize().Width());
     520 [ #  # ][ #  # ]:          0 :     long nMFXPos = m_aFT_SplineOrder.GetPosPixel().X()+nFTWidth+m_aFT_SplineOrder.LogicToPixel( Size(RSC_SP_CTRL_DESC_X,0), MapMode(MAP_APPFONT) ).Width();
                 [ #  # ]
     521                 :            : 
     522         [ #  # ]:          0 :     m_aFT_SplineOrder.SetSizePixel( Size( nFTWidth, m_aFT_SplineOrder.GetSizePixel().Height() ) );
     523         [ #  # ]:          0 :     m_aFT_SplineResolution.SetSizePixel( Size( nFTWidth, m_aFT_SplineResolution.GetSizePixel().Height() ) );
     524                 :            : 
     525         [ #  # ]:          0 :     m_aMF_SplineOrder.SetPosPixel( Point( nMFXPos, m_aMF_SplineOrder.GetPosPixel().Y() ) );
     526         [ #  # ]:          0 :     m_aMF_SplineResolution.SetPosPixel( Point( nMFXPos, m_aMF_SplineResolution.GetPosPixel().Y() ) );
     527                 :          0 : }
     528                 :            : 
     529                 :          0 : void SplinePropertiesDialog::adjustSize()
     530                 :            : {
     531         [ #  # ]:          0 :     Size aDlgSize( this->GetSizePixel() );
     532         [ #  # ]:          0 :     long nBorder = m_aRB_Splines_Cubic.GetPosPixel().X();
     533 [ #  # ][ #  # ]:          0 :     long nX = m_aMF_SplineOrder.GetPosPixel().X() + m_aMF_SplineOrder.GetSizePixel().Width();
     534         [ #  # ]:          0 :     if(aDlgSize.Width()< (nX+nBorder) )
     535                 :            :     {
     536                 :          0 :         aDlgSize.Width() = (nX+nBorder);
     537         [ #  # ]:          0 :         this->SetSizePixel(aDlgSize);
     538                 :            : 
     539         [ #  # ]:          0 :         Size aLineSize( m_aFL_DialogButtons.GetSizePixel() );
     540                 :          0 :         aLineSize.Width() = aDlgSize.Width();
     541         [ #  # ]:          0 :         m_aFL_DialogButtons.SetSizePixel(aLineSize);
     542                 :            :     }
     543                 :          0 : }
     544                 :          0 : void SplinePropertiesDialog::fillControls( const ChartTypeParameter& rParameter )
     545                 :            : {
     546      [ #  #  # ]:          0 :     switch(rParameter.eCurveStyle)
     547                 :            :     {
     548                 :            :     case CurveStyle_CUBIC_SPLINES:
     549                 :          0 :         m_aRB_Splines_Cubic.Check();
     550                 :          0 :         break;
     551                 :            :     case CurveStyle_B_SPLINES:
     552                 :          0 :         m_aRB_Splines_B.Check();
     553                 :          0 :         break;
     554                 :            :     default:
     555                 :          0 :         m_aRB_Splines_Cubic.Check();
     556                 :          0 :         break;
     557                 :            :     }
     558                 :          0 :     m_aMF_SplineOrder.SetValue( rParameter.nSplineOrder );
     559                 :          0 :     m_aMF_SplineResolution.SetValue( rParameter.nCurveResolution );
     560                 :            : 
     561                 :            :     //dis/enabling
     562                 :          0 :     m_aFT_SplineOrder.Enable(m_aRB_Splines_B.IsChecked());
     563                 :          0 :     m_aMF_SplineOrder.Enable(m_aRB_Splines_B.IsChecked());
     564                 :          0 : }
     565                 :          0 : void SplinePropertiesDialog::fillParameter( ChartTypeParameter& rParameter, bool bSmoothLines )
     566                 :            : {
     567         [ #  # ]:          0 :     if(!bSmoothLines)
     568                 :          0 :         rParameter.eCurveStyle=CurveStyle_LINES;
     569         [ #  # ]:          0 :     else if(m_aRB_Splines_Cubic.IsChecked())
     570                 :          0 :         rParameter.eCurveStyle=CurveStyle_CUBIC_SPLINES;
     571         [ #  # ]:          0 :     else if(m_aRB_Splines_B.IsChecked())
     572                 :          0 :         rParameter.eCurveStyle=CurveStyle_B_SPLINES;
     573                 :            : 
     574                 :          0 :     rParameter.nCurveResolution = static_cast< sal_Int32 >( m_aMF_SplineResolution.GetValue());
     575                 :          0 :     rParameter.nSplineOrder = static_cast< sal_Int32 >( m_aMF_SplineOrder.GetValue());
     576                 :          0 : }
     577                 :          0 : IMPL_LINK_NOARG(SplinePropertiesDialog, SplineModeRadioHdl)
     578                 :            : {
     579                 :          0 :     m_aFT_SplineOrder.Enable(m_aRB_Splines_B.IsChecked());
     580                 :          0 :     m_aMF_SplineOrder.Enable(m_aRB_Splines_B.IsChecked());
     581                 :          0 :     return 0;
     582                 :            : }
     583                 :            : 
     584                 :            : //--------------------------------------------------------------------------
     585                 :            : 
     586                 :            : class SplineResourceGroup : public ChangingResource
     587                 :            : {
     588                 :            : public:
     589                 :            :     SplineResourceGroup( Window* pWindow );
     590                 :            :     virtual ~SplineResourceGroup();
     591                 :            : 
     592                 :            :     void  showControls( bool bShow );
     593                 :            :     Point getPosition();
     594                 :            :     long  getHeight();
     595                 :            :     void  setPosition( const Point& rPoint );
     596                 :            : 
     597                 :            :     void fillControls( const ChartTypeParameter& rParameter );
     598                 :            :     void fillParameter( ChartTypeParameter& rParameter );
     599                 :            : 
     600                 :            : private:
     601                 :            :     DECL_LINK( SplineChangeHdl, void* );
     602                 :            :     DECL_LINK( SplineDetailsDialogHdl, void* );
     603                 :            :     SplinePropertiesDialog& getSplinePropertiesDialog();
     604                 :            : 
     605                 :            : private:
     606                 :            :     CheckBox    m_aCB_Splines;
     607                 :            :     PushButton  m_aPB_DetailsDialog;
     608                 :            :     ::std::auto_ptr< SplinePropertiesDialog > m_pSplinePropertiesDialog;
     609                 :            : };
     610                 :          0 : SplineResourceGroup::SplineResourceGroup( Window* pWindow )
     611                 :            :         : ChangingResource()
     612                 :            :         , m_aCB_Splines( pWindow, SchResId( CB_SPLINES ) )
     613                 :            :         , m_aPB_DetailsDialog( pWindow, SchResId( PB_SPLINE_DIALOG ) )
     614 [ #  # ][ #  # ]:          0 :         , m_pSplinePropertiesDialog()
         [ #  # ][ #  # ]
     615                 :            : {
     616         [ #  # ]:          0 :     m_aCB_Splines.SetToggleHdl( LINK( this, SplineResourceGroup, SplineChangeHdl ) );
     617         [ #  # ]:          0 :     m_aPB_DetailsDialog.SetClickHdl( LINK( this, SplineResourceGroup, SplineDetailsDialogHdl ) );
     618 [ #  # ][ #  # ]:          0 :     m_aPB_DetailsDialog.SetQuickHelpText( String( SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES) ) );
         [ #  # ][ #  # ]
     619                 :            : 
     620         [ #  # ]:          0 :     Size aButtonSize( m_aPB_DetailsDialog.GetSizePixel() );
     621         [ #  # ]:          0 :     Size aMinSize( m_aPB_DetailsDialog.CalcMinimumSize() );
     622                 :          0 :     sal_Int32 nDistance = 10;
     623         [ #  # ]:          0 :     if( pWindow )
     624                 :            :     {
     625 [ #  # ][ #  # ]:          0 :         Size aDistanceSize( pWindow->LogicToPixel( Size(RSC_SP_CTRL_DESC_X,2), MapMode(MAP_APPFONT) ) );
                 [ #  # ]
     626                 :          0 :         nDistance = 2*aDistanceSize.Width();
     627                 :            :     }
     628                 :          0 :     aButtonSize.Width() = aMinSize.Width() + nDistance;
     629         [ #  # ]:          0 :     m_aPB_DetailsDialog.SetSizePixel( aButtonSize );
     630                 :          0 : }
     631 [ #  # ][ #  # ]:          0 : SplineResourceGroup::~SplineResourceGroup()
                 [ #  # ]
     632                 :            : {
     633         [ #  # ]:          0 : }
     634                 :          0 : SplinePropertiesDialog& SplineResourceGroup::getSplinePropertiesDialog()
     635                 :            : {
     636         [ #  # ]:          0 :     if( !m_pSplinePropertiesDialog.get() )
     637         [ #  # ]:          0 :         m_pSplinePropertiesDialog = ::std::auto_ptr< SplinePropertiesDialog >( new SplinePropertiesDialog( m_aPB_DetailsDialog.GetParent() ) );
     638                 :          0 :     return *m_pSplinePropertiesDialog;
     639                 :            : }
     640                 :          0 : void SplineResourceGroup::showControls( bool bShow )
     641                 :            : {
     642                 :          0 :     m_aCB_Splines.Show(bShow);
     643                 :          0 :     m_aPB_DetailsDialog.Show(bShow);
     644                 :          0 : }
     645                 :          0 : Point SplineResourceGroup::getPosition()
     646                 :            : {
     647                 :          0 :     return m_aCB_Splines.GetPosPixel();
     648                 :            : }
     649                 :          0 : long SplineResourceGroup::getHeight()
     650                 :            : {
     651 [ #  # ][ #  # ]:          0 :     return m_aCB_Splines.GetSizePixel().Height() + m_aPB_DetailsDialog.LogicToPixel( Size(0,2), MapMode(MAP_APPFONT) ).Height();
                 [ #  # ]
     652                 :            : }
     653                 :          0 : void SplineResourceGroup::setPosition( const Point& rPoint )
     654                 :            : {
     655         [ #  # ]:          0 :     Size aSize( m_aCB_Splines.CalcMinimumSize() );
     656 [ #  # ][ #  # ]:          0 :     Size aDistanceSize( m_aCB_Splines.LogicToPixel( Size(RSC_SP_CTRL_GROUP_X,1), MapMode(MAP_APPFONT) ) );
                 [ #  # ]
     657         [ #  # ]:          0 :     m_aCB_Splines.SetSizePixel( aSize );
     658                 :            : 
     659         [ #  # ]:          0 :     Point aOld = this->getPosition();
     660                 :          0 :     long nDiffY = rPoint.Y() - aOld.Y();
     661                 :          0 :     long nDiffX = rPoint.X() - aOld.X();
     662                 :            : 
     663                 :          0 :     Point aNew( aOld.X()+nDiffX, aOld.Y()+nDiffY );
     664         [ #  # ]:          0 :     m_aCB_Splines.SetPosPixel( aNew );
     665                 :            : 
     666                 :          0 :     aNew.X() += ( aSize.Width() + aDistanceSize.Width() );
     667                 :          0 :     aNew.Y() -= 3*aDistanceSize.Height();
     668         [ #  # ]:          0 :     m_aPB_DetailsDialog.SetPosPixel( aNew );
     669                 :          0 : }
     670                 :            : 
     671                 :          0 : void SplineResourceGroup::fillControls( const ChartTypeParameter& rParameter )
     672                 :            : {
     673                 :          0 :     m_aCB_Splines.Check( rParameter.eCurveStyle!=CurveStyle_LINES );
     674                 :          0 :     getSplinePropertiesDialog().fillControls( rParameter );
     675                 :          0 : }
     676                 :          0 : void SplineResourceGroup::fillParameter( ChartTypeParameter& rParameter )
     677                 :            : {
     678                 :          0 :     getSplinePropertiesDialog().fillParameter( rParameter, m_aCB_Splines.IsChecked() );
     679                 :          0 : }
     680                 :          0 : IMPL_LINK_NOARG(SplineResourceGroup, SplineChangeHdl)
     681                 :            : {
     682         [ #  # ]:          0 :     if( m_pChangeListener )
     683                 :          0 :         m_pChangeListener->stateChanged(this);
     684                 :          0 :     return 0;
     685                 :            : }
     686                 :            : 
     687                 :          0 : IMPL_LINK_NOARG(SplineResourceGroup, SplineDetailsDialogHdl)
     688                 :            : {
     689                 :            : 
     690         [ #  # ]:          0 :     ChartTypeParameter aOldParameter;
     691 [ #  # ][ #  # ]:          0 :     getSplinePropertiesDialog().fillParameter( aOldParameter, m_aCB_Splines.IsChecked() );
                 [ #  # ]
     692                 :            : 
     693         [ #  # ]:          0 :     sal_Bool bOldSmoothLines = m_aCB_Splines.IsChecked();
     694         [ #  # ]:          0 :     m_aCB_Splines.Check();
     695 [ #  # ][ #  # ]:          0 :     if( RET_OK == getSplinePropertiesDialog().Execute() )
                 [ #  # ]
     696                 :            :     {
     697         [ #  # ]:          0 :         if( m_pChangeListener )
     698         [ #  # ]:          0 :             m_pChangeListener->stateChanged(this);
     699                 :            :     }
     700                 :            :     else
     701                 :            :     {
     702                 :            :         //restore old state:
     703         [ #  # ]:          0 :         m_aCB_Splines.Check( bOldSmoothLines );
     704 [ #  # ][ #  # ]:          0 :         getSplinePropertiesDialog().fillControls( aOldParameter );
     705                 :            :     }
     706         [ #  # ]:          0 :     return 0;
     707                 :            : }
     708                 :            : 
     709                 :            : //--------------------------------------------------------------------------
     710                 :            : 
     711                 :            : class GeometryResourceGroup : public ChangingResource
     712                 :            : {
     713                 :            : public:
     714                 :            :     GeometryResourceGroup( Window* pWindow );
     715                 :            :     virtual ~GeometryResourceGroup();
     716                 :            : 
     717                 :            :     void  showControls( bool bShow );
     718                 :            :     long  getHeight();
     719                 :            :     void  setPosition( const Point& rPoint );
     720                 :            : 
     721                 :            :     void fillControls( const ChartTypeParameter& rParameter );
     722                 :            :     void fillParameter( ChartTypeParameter& rParameter );
     723                 :            : 
     724                 :            : private:
     725                 :            :     DECL_LINK( GeometryChangeHdl, void* );
     726                 :            : 
     727                 :            : private:
     728                 :            :     BarGeometryResources       m_aGeometryResources;
     729                 :            : };
     730                 :          0 : GeometryResourceGroup::GeometryResourceGroup( Window* pWindow )
     731                 :            :         : ChangingResource()
     732         [ #  # ]:          0 :         , m_aGeometryResources( pWindow )
     733                 :            : {
     734 [ #  # ][ #  # ]:          0 :     m_aGeometryResources.SetSelectHdl( LINK( this, GeometryResourceGroup, GeometryChangeHdl ) );
     735                 :          0 : }
     736         [ #  # ]:          0 : GeometryResourceGroup::~GeometryResourceGroup()
     737                 :            : {
     738         [ #  # ]:          0 : }
     739                 :          0 : void GeometryResourceGroup::showControls( bool bShow )
     740                 :            : {
     741                 :          0 :     m_aGeometryResources.Show(bShow);
     742                 :          0 : }
     743                 :          0 : long GeometryResourceGroup::getHeight()
     744                 :            : {
     745                 :          0 :     return m_aGeometryResources.GetSizePixel().Height();
     746                 :            : }
     747                 :          0 : void GeometryResourceGroup::setPosition( const Point& rPoint )
     748                 :            : {
     749                 :          0 :     m_aGeometryResources.SetPosPixel( rPoint );
     750                 :          0 : }
     751                 :            : 
     752                 :          0 : void GeometryResourceGroup::fillControls( const ChartTypeParameter& rParameter )
     753                 :            : {
     754                 :          0 :     sal_uInt16 nGeometry3D = static_cast<sal_uInt16>(rParameter.nGeometry3D);
     755                 :          0 :     m_aGeometryResources.SelectEntryPos(nGeometry3D);
     756                 :          0 :     m_aGeometryResources.Enable(rParameter.b3DLook);
     757                 :          0 : }
     758                 :          0 : void GeometryResourceGroup::fillParameter( ChartTypeParameter& rParameter )
     759                 :            : {
     760                 :          0 :     rParameter.nGeometry3D = 1;
     761         [ #  # ]:          0 :     if( m_aGeometryResources.GetSelectEntryCount() )
     762                 :          0 :         rParameter.nGeometry3D = m_aGeometryResources.GetSelectEntryPos();
     763                 :          0 : }
     764                 :          0 : IMPL_LINK_NOARG(GeometryResourceGroup, GeometryChangeHdl)
     765                 :            : {
     766         [ #  # ]:          0 :     if( m_pChangeListener )
     767                 :          0 :         m_pChangeListener->stateChanged(this);
     768                 :          0 :     return 0;
     769                 :            : }
     770                 :            : 
     771                 :            : //--------------------------------------------------------------------------
     772                 :            : //--------------------------------------------------------------------------
     773                 :            : //--------------------------------------------------------------------------
     774                 :            : 
     775                 :          0 : ChartTypeTabPage::ChartTypeTabPage( Window* pParent
     776                 :            :         , const uno::Reference< XChartDocument >& xChartModel
     777                 :            :         , const uno::Reference< uno::XComponentContext >& xContext
     778                 :            :         , bool bDoLiveUpdate, bool bHideDescription )
     779                 :            :         : OWizardPage( pParent, SchResId(TP_CHARTTYPE) )
     780                 :            :         , m_aFT_ChooseType( this, SchResId( FT_CHARTTYPE ) )
     781                 :            :         , m_aMainTypeList( this, SchResId( LB_CHARTTYPE ) )
     782                 :            :         , m_aSubTypeList( this, SchResId( CT_CHARTVARIANT ) )
     783         [ #  # ]:          0 :         , m_pAxisTypeResourceGroup( new AxisTypeResourceGroup(this) )
     784         [ #  # ]:          0 :         , m_pDim3DLookResourceGroup( new Dim3DLookResourceGroup(this) )
     785         [ #  # ]:          0 :         , m_pStackingResourceGroup( new StackingResourceGroup(this) )
     786         [ #  # ]:          0 :         , m_pSplineResourceGroup( new SplineResourceGroup(this) )
     787         [ #  # ]:          0 :         , m_pGeometryResourceGroup( new GeometryResourceGroup( this ) )
     788         [ #  # ]:          0 :         , m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup( this ) )
     789                 :            :         , m_nYTopPos(0)
     790                 :            :         , m_xChartModel( xChartModel )
     791                 :            :         , m_xCC( xContext )
     792                 :            :         , m_aChartTypeDialogControllerList(0)
     793                 :            :         , m_pCurrentMainType(0)
     794                 :            :         , m_nChangingCalls(0)
     795                 :            :         , m_bDoLiveUpdate(bDoLiveUpdate)
     796 [ #  # ][ #  # ]:          0 :         , m_aTimerTriggeredControllerLock( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY ) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     797                 :            : {
     798         [ #  # ]:          0 :     FreeResource();
     799                 :            : 
     800         [ #  # ]:          0 :     if( bHideDescription )
     801                 :            :     {
     802         [ #  # ]:          0 :         m_aFT_ChooseType.Hide();
     803 [ #  # ][ #  # ]:          0 :         long nYDiff = m_aMainTypeList.GetPosPixel().Y() - m_aFT_ChooseType.GetPosPixel().Y();
     804                 :            : 
     805         [ #  # ]:          0 :         Point aOldPos( m_aMainTypeList.GetPosPixel() );
     806         [ #  # ]:          0 :         m_aMainTypeList.SetPosPixel( Point( aOldPos.X(), aOldPos.Y() - nYDiff ) );
     807                 :            : 
     808         [ #  # ]:          0 :         aOldPos = m_aSubTypeList.GetPosPixel();
     809         [ #  # ]:          0 :         m_aSubTypeList.SetPosPixel( Point( aOldPos.X(), aOldPos.Y() - nYDiff ) );
     810                 :            : 
     811         [ #  # ]:          0 :         aOldPos = m_pAxisTypeResourceGroup->getPosition();
     812         [ #  # ]:          0 :         m_pAxisTypeResourceGroup->setPosition( Point( aOldPos.X(), aOldPos.Y() - nYDiff ) );
     813                 :            : 
     814         [ #  # ]:          0 :         Size aSize( this->GetSizePixel() );
     815         [ #  # ]:          0 :         this->SetSizePixel( Size( aSize.Width(), aSize.Height()-nYDiff+3 ) );
     816                 :            :     }
     817                 :            :     else
     818                 :            :     {
     819         [ #  # ]:          0 :         Font aFont( m_aFT_ChooseType.GetControlFont() );
     820         [ #  # ]:          0 :         aFont.SetWeight( WEIGHT_BOLD );
     821         [ #  # ]:          0 :         m_aFT_ChooseType.SetControlFont( aFont );
     822                 :            : 
     823 [ #  # ][ #  # ]:          0 :         m_aFT_ChooseType.SetStyle( m_aFT_ChooseType.GetStyle() | WB_NOLABEL );
                 [ #  # ]
     824                 :            :     }
     825                 :            : 
     826 [ #  # ][ #  # ]:          0 :     this->SetText( String(SchResId(STR_PAGE_CHARTTYPE)) );
         [ #  # ][ #  # ]
     827                 :            : 
     828 [ #  # ][ #  # ]:          0 :     m_aMainTypeList.SetStyle(m_aMainTypeList.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_FLATVALUESET | WB_3DLOOK );
     829         [ #  # ]:          0 :     m_aMainTypeList.SetSelectHdl( LINK( this, ChartTypeTabPage, SelectMainTypeHdl ) );
     830         [ #  # ]:          0 :     m_aSubTypeList.SetSelectHdl( LINK( this, ChartTypeTabPage, SelectSubTypeHdl ) );
     831                 :            : 
     832         [ #  # ]:          0 :     m_aSubTypeList.SetStyle(m_aSubTypeList.GetStyle() |
     833         [ #  # ]:          0 :         WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_FLATVALUESET | WB_3DLOOK );
     834         [ #  # ]:          0 :     m_aSubTypeList.SetColCount(4);
     835         [ #  # ]:          0 :     m_aSubTypeList.SetLineCount(1);
     836                 :            : 
     837                 :          0 :     bool bDisableComplexChartTypes = false;
     838         [ #  # ]:          0 :     uno::Reference< beans::XPropertySet > xProps( m_xChartModel, uno::UNO_QUERY );
     839         [ #  # ]:          0 :     if ( xProps.is() )
     840                 :            :     {
     841                 :            :         try
     842                 :            :         {
     843 [ #  # ][ #  # ]:          0 :             xProps->getPropertyValue( C2U( "DisableComplexChartTypes" ) ) >>= bDisableComplexChartTypes;
         [ #  # ][ #  # ]
     844                 :            :         }
     845         [ #  # ]:          0 :         catch( const uno::Exception& e )
     846                 :            :         {
     847                 :            :             ASSERT_EXCEPTION( e );
     848                 :            :         }
     849                 :            :     }
     850                 :            : 
     851 [ #  # ][ #  # ]:          0 :     m_aChartTypeDialogControllerList.push_back(new ColumnChartDialogController() );
                 [ #  # ]
     852 [ #  # ][ #  # ]:          0 :     m_aChartTypeDialogControllerList.push_back(new BarChartDialogController() );
                 [ #  # ]
     853 [ #  # ][ #  # ]:          0 :     m_aChartTypeDialogControllerList.push_back(new PieChartDialogController() );
                 [ #  # ]
     854 [ #  # ][ #  # ]:          0 :     m_aChartTypeDialogControllerList.push_back(new AreaChartDialogController() );
                 [ #  # ]
     855 [ #  # ][ #  # ]:          0 :     m_aChartTypeDialogControllerList.push_back(new LineChartDialogController() );
                 [ #  # ]
     856         [ #  # ]:          0 :     if ( !bDisableComplexChartTypes )
     857                 :            :     {
     858 [ #  # ][ #  # ]:          0 :         m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() );
                 [ #  # ]
     859 [ #  # ][ #  # ]:          0 :         m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() );
                 [ #  # ]
     860                 :            :     }
     861 [ #  # ][ #  # ]:          0 :     m_aChartTypeDialogControllerList.push_back(new NetChartDialogController() );
                 [ #  # ]
     862         [ #  # ]:          0 :     if ( !bDisableComplexChartTypes )
     863                 :            :     {
     864 [ #  # ][ #  # ]:          0 :         m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() );
                 [ #  # ]
     865                 :            :     }
     866 [ #  # ][ #  # ]:          0 :     m_aChartTypeDialogControllerList.push_back(new CombiColumnLineChartDialogController() );
                 [ #  # ]
     867                 :            : 
     868         [ #  # ]:          0 :     ::std::vector< ChartTypeDialogController* >::const_iterator       aIter = m_aChartTypeDialogControllerList.begin();
     869         [ #  # ]:          0 :     const ::std::vector< ChartTypeDialogController* >::const_iterator aEnd  = m_aChartTypeDialogControllerList.end();
     870 [ #  # ][ #  # ]:          0 :     for( ; aIter != aEnd; ++aIter )
     871                 :            :     {
     872 [ #  # ][ #  # ]:          0 :         m_aMainTypeList.InsertEntry( (*aIter)->getName(), (*aIter)->getImage() );
         [ #  # ][ #  # ]
                 [ #  # ]
     873         [ #  # ]:          0 :         (*aIter)->setChangeListener( this );
     874                 :            :     }
     875                 :            : 
     876         [ #  # ]:          0 :     m_nYTopPos = m_pAxisTypeResourceGroup->getPosition().Y();
     877                 :            : 
     878         [ #  # ]:          0 :     m_pAxisTypeResourceGroup->setChangeListener( this );
     879         [ #  # ]:          0 :     m_pDim3DLookResourceGroup->setChangeListener( this );
     880         [ #  # ]:          0 :     m_pStackingResourceGroup->setChangeListener( this );
     881         [ #  # ]:          0 :     m_pSplineResourceGroup->setChangeListener( this );
     882         [ #  # ]:          0 :     m_pGeometryResourceGroup->setChangeListener( this );
     883         [ #  # ]:          0 :     m_pSortByXValuesResourceGroup->setChangeListener( this );
     884                 :          0 : }
     885                 :            : 
     886 [ #  # ][ #  # ]:          0 : ChartTypeTabPage::~ChartTypeTabPage()
         [ #  # ][ #  # ]
                 [ #  # ]
     887                 :            : {
     888                 :            :     //delete all dialog controller
     889         [ #  # ]:          0 :     ::std::vector< ChartTypeDialogController* >::const_iterator       aIter = m_aChartTypeDialogControllerList.begin();
     890         [ #  # ]:          0 :     const ::std::vector< ChartTypeDialogController* >::const_iterator aEnd  = m_aChartTypeDialogControllerList.end();
     891 [ #  # ][ #  # ]:          0 :     for( ; aIter != aEnd; ++aIter )
     892                 :            :     {
     893 [ #  # ][ #  # ]:          0 :         delete *aIter;
     894                 :            :     }
     895                 :          0 :     m_aChartTypeDialogControllerList.clear();
     896                 :            : 
     897                 :            :     //delete all resource helper
     898 [ #  # ][ #  # ]:          0 :     delete m_pAxisTypeResourceGroup;
     899 [ #  # ][ #  # ]:          0 :     delete m_pDim3DLookResourceGroup;
     900 [ #  # ][ #  # ]:          0 :     delete m_pStackingResourceGroup;
     901 [ #  # ][ #  # ]:          0 :     delete m_pSplineResourceGroup;
     902 [ #  # ][ #  # ]:          0 :     delete m_pGeometryResourceGroup;
     903 [ #  # ][ #  # ]:          0 :     delete m_pSortByXValuesResourceGroup;
     904         [ #  # ]:          0 : }
     905                 :          0 : ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
     906                 :            : {
     907                 :          0 :     ChartTypeParameter aParameter;
     908                 :          0 :     aParameter.nSubTypeIndex = static_cast<sal_Int32>( m_aSubTypeList.GetSelectItemId() );
     909         [ #  # ]:          0 :     m_pAxisTypeResourceGroup->fillParameter( aParameter );
     910         [ #  # ]:          0 :     m_pDim3DLookResourceGroup->fillParameter( aParameter );
     911         [ #  # ]:          0 :     m_pStackingResourceGroup->fillParameter( aParameter );
     912         [ #  # ]:          0 :     m_pSplineResourceGroup->fillParameter( aParameter );
     913         [ #  # ]:          0 :     m_pGeometryResourceGroup->fillParameter( aParameter );
     914         [ #  # ]:          0 :     m_pSortByXValuesResourceGroup->fillParameter( aParameter );
     915                 :          0 :     return aParameter;
     916                 :            : }
     917                 :          0 : void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter )
     918                 :            : {
     919         [ #  # ]:          0 :     if( !m_pCurrentMainType )
     920                 :          0 :         return;
     921                 :            : 
     922         [ #  # ]:          0 :     m_aTimerTriggeredControllerLock.startTimer();
     923 [ #  # ][ #  # ]:          0 :     ControllerLockGuard aLockedControllers( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY ) );
     924 [ #  # ][ #  # ]:          0 :     m_pCurrentMainType->commitToModel( rParameter, m_xChartModel );
     925                 :            : }
     926                 :          0 : void ChartTypeTabPage::stateChanged( ChangingResource* /*pResource*/ )
     927                 :            : {
     928         [ #  # ]:          0 :     if(m_nChangingCalls)
     929                 :          0 :         return;
     930                 :          0 :     m_nChangingCalls++;
     931                 :            : 
     932         [ #  # ]:          0 :     ChartTypeParameter aParameter( this->getCurrentParamter() );
     933         [ #  # ]:          0 :     if( m_pCurrentMainType )
     934                 :            :     {
     935         [ #  # ]:          0 :         m_pCurrentMainType->adjustParameterToSubType( aParameter );
     936         [ #  # ]:          0 :         m_pCurrentMainType->adjustSubTypeAndEnableControls( aParameter );
     937                 :            :     }
     938         [ #  # ]:          0 :     if( m_bDoLiveUpdate )
     939         [ #  # ]:          0 :         commitToModel( aParameter );
     940                 :            : 
     941                 :            :     //detect the new ThreeDLookScheme
     942 [ #  # ][ #  # ]:          0 :     aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( ChartModelHelper::findDiagram( m_xChartModel ) );
     943         [ #  # ]:          0 :     aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
     944                 :            :     //the controls have to be enabled/disabled accordingly
     945         [ #  # ]:          0 :     this->fillAllControls( aParameter );
     946                 :            : 
     947         [ #  # ]:          0 :     m_nChangingCalls--;
     948                 :            : }
     949                 :          0 : ChartTypeDialogController* ChartTypeTabPage::getSelectedMainType()
     950                 :            : {
     951                 :          0 :     ChartTypeDialogController* pTypeController = 0;
     952                 :            :     ::std::vector< ChartTypeDialogController* >::size_type nM = static_cast< ::std::vector< ChartTypeDialogController* >::size_type >(
     953                 :          0 :         m_aMainTypeList.GetSelectEntryPos() );
     954         [ #  # ]:          0 :     if( nM<m_aChartTypeDialogControllerList.size() )
     955                 :          0 :         pTypeController = m_aChartTypeDialogControllerList[nM];
     956                 :          0 :     return pTypeController;
     957                 :            : }
     958                 :          0 : IMPL_LINK_NOARG(ChartTypeTabPage, SelectSubTypeHdl)
     959                 :            : {
     960         [ #  # ]:          0 :     if( m_pCurrentMainType )
     961                 :            :     {
     962         [ #  # ]:          0 :         ChartTypeParameter aParameter( this->getCurrentParamter() );
     963         [ #  # ]:          0 :         m_pCurrentMainType->adjustParameterToSubType( aParameter );
     964         [ #  # ]:          0 :         this->fillAllControls( aParameter, false );
     965         [ #  # ]:          0 :         if( m_bDoLiveUpdate )
     966 [ #  # ][ #  # ]:          0 :             commitToModel( aParameter );
     967                 :            :     }
     968                 :          0 :     return 0;
     969                 :            : }
     970                 :            : 
     971                 :          0 : IMPL_LINK_NOARG(ChartTypeTabPage, SelectMainTypeHdl)
     972                 :            : {
     973         [ #  # ]:          0 :     ChartTypeParameter aParameter( this->getCurrentParamter() );
     974                 :            : 
     975         [ #  # ]:          0 :     if( m_pCurrentMainType )
     976                 :            :     {
     977         [ #  # ]:          0 :         m_pCurrentMainType->adjustParameterToSubType( aParameter );
     978         [ #  # ]:          0 :         m_pCurrentMainType->hideExtraControls();
     979                 :            :     }
     980                 :            : 
     981         [ #  # ]:          0 :     m_pCurrentMainType = this->getSelectedMainType();
     982         [ #  # ]:          0 :     if( m_pCurrentMainType )
     983                 :            :     {
     984         [ #  # ]:          0 :         this->showAllControls(*m_pCurrentMainType);
     985                 :            : 
     986         [ #  # ]:          0 :         m_pCurrentMainType->adjustParameterToMainType( aParameter );
     987         [ #  # ]:          0 :         if( m_bDoLiveUpdate )
     988         [ #  # ]:          0 :             commitToModel( aParameter );
     989                 :            :         //detect the new ThreeDLookScheme
     990 [ #  # ][ #  # ]:          0 :         aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( ChartModelHelper::findDiagram( m_xChartModel ) );
     991 [ #  # ][ #  # ]:          0 :         if(!aParameter.b3DLook && aParameter.eThreeDLookScheme!=ThreeDLookScheme_Realistic )
     992                 :          0 :             aParameter.eThreeDLookScheme=ThreeDLookScheme_Realistic;
     993                 :            : 
     994         [ #  # ]:          0 :         aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
     995         [ #  # ]:          0 :         this->fillAllControls( aParameter );
     996 [ #  # ][ #  # ]:          0 :         uno::Reference< beans::XPropertySet > xTemplateProps( this->getCurrentTemplate(), uno::UNO_QUERY );
     997         [ #  # ]:          0 :         m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps);
     998                 :            :     }
     999         [ #  # ]:          0 :     return 0;
    1000                 :            : }
    1001                 :            : 
    1002                 :          0 : void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeController )
    1003                 :            : {
    1004         [ #  # ]:          0 :     m_aSubTypeList.Show();
    1005                 :            : 
    1006                 :          0 :     long nYPos = m_nYTopPos;
    1007                 :            : 
    1008                 :            :     //------
    1009         [ #  # ]:          0 :     bool bShow = rTypeController.shouldShow_XAxisTypeControl();
    1010         [ #  # ]:          0 :     long nXPos = m_pAxisTypeResourceGroup->getPosition().X();
    1011         [ #  # ]:          0 :     m_pAxisTypeResourceGroup->showControls( bShow );
    1012         [ #  # ]:          0 :     if(bShow)
    1013                 :            :     {
    1014         [ #  # ]:          0 :         m_pAxisTypeResourceGroup->setPosition( Point( nXPos, nYPos ) );
    1015         [ #  # ]:          0 :         nYPos += m_pAxisTypeResourceGroup->getHeight() + lcl_getDistance();
    1016                 :            :     }
    1017                 :            :     //------
    1018         [ #  # ]:          0 :     bShow = rTypeController.shouldShow_3DLookControl();
    1019         [ #  # ]:          0 :     m_pDim3DLookResourceGroup->showControls( bShow );
    1020         [ #  # ]:          0 :     if(bShow)
    1021                 :            :     {
    1022         [ #  # ]:          0 :         m_pDim3DLookResourceGroup->setPosition( Point( nXPos, nYPos ) );
    1023         [ #  # ]:          0 :         nYPos += m_pDim3DLookResourceGroup->getHeight() + lcl_getDistance();
    1024                 :            :     }
    1025                 :            :     //------
    1026         [ #  # ]:          0 :     bShow = rTypeController.shouldShow_StackingControl();
    1027 [ #  # ][ #  # ]:          0 :     m_pStackingResourceGroup->showControls( bShow, rTypeController.shouldShow_DeepStackingControl() );
    1028         [ #  # ]:          0 :     if(bShow)
    1029                 :            :     {
    1030                 :          0 :         long nStackingXPos = nXPos;
    1031 [ #  # ][ #  # ]:          0 :         if( rTypeController.shouldShow_XAxisTypeControl() )
    1032 [ #  # ][ #  # ]:          0 :             nStackingXPos += this->LogicToPixel( Size(RSC_SP_CHK_TEXTINDENT,0), MapMode(MAP_APPFONT) ).Width();
                 [ #  # ]
    1033         [ #  # ]:          0 :         m_pStackingResourceGroup->setPosition( Point( nStackingXPos, nYPos ) );
    1034         [ #  # ]:          0 :         nYPos += m_pStackingResourceGroup->getHeight() + lcl_getDistance();
    1035                 :            :     }
    1036                 :            :     //------
    1037         [ #  # ]:          0 :     bShow = rTypeController.shouldShow_SplineControl();
    1038         [ #  # ]:          0 :     m_pSplineResourceGroup->showControls( bShow );
    1039         [ #  # ]:          0 :     if(bShow)
    1040                 :            :     {
    1041         [ #  # ]:          0 :         m_pSplineResourceGroup->setPosition( Point( nXPos, nYPos ) );
    1042         [ #  # ]:          0 :         nYPos += m_pSplineResourceGroup->getHeight() + lcl_getDistance();
    1043                 :            :     }
    1044                 :            :     //------
    1045         [ #  # ]:          0 :     bShow = rTypeController.shouldShow_GeometryControl();
    1046         [ #  # ]:          0 :     m_pGeometryResourceGroup->showControls( bShow );
    1047         [ #  # ]:          0 :     if(bShow)
    1048                 :            :     {
    1049         [ #  # ]:          0 :         m_pGeometryResourceGroup->setPosition( Point( nXPos+17, nYPos ) );
    1050         [ #  # ]:          0 :         nYPos += m_pGeometryResourceGroup->getHeight() + lcl_getDistance();
    1051                 :            :     }
    1052                 :            :     //------
    1053         [ #  # ]:          0 :     bShow = rTypeController.shouldShow_SortByXValuesResourceGroup();
    1054         [ #  # ]:          0 :     m_pSortByXValuesResourceGroup->showControls( bShow );
    1055         [ #  # ]:          0 :     if(bShow)
    1056                 :            :     {
    1057         [ #  # ]:          0 :         m_pSortByXValuesResourceGroup->setPosition( Point( nXPos, nYPos ) );
    1058         [ #  # ]:          0 :         nYPos += m_pSortByXValuesResourceGroup->getHeight() + lcl_getDistance();
    1059                 :            :     }
    1060                 :            :     //------
    1061         [ #  # ]:          0 :     Size aPageSize( this->GetSizePixel() );
    1062                 :          0 :     Size aRemainingSize = Size( aPageSize.Width()-nXPos, aPageSize.Height()-nYPos );
    1063         [ #  # ]:          0 :     rTypeController.showExtraControls( this, Point( nXPos, nYPos ), aRemainingSize );
    1064                 :          0 : }
    1065                 :            : 
    1066                 :          0 : void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bool bAlsoResetSubTypeList )
    1067                 :            : {
    1068                 :          0 :     m_nChangingCalls++;
    1069 [ #  # ][ #  # ]:          0 :     if( m_pCurrentMainType && bAlsoResetSubTypeList )
    1070                 :            :     {
    1071                 :          0 :         m_pCurrentMainType->fillSubTypeList( m_aSubTypeList, rParameter );
    1072                 :            :     }
    1073                 :          0 :     m_aSubTypeList.SelectItem( static_cast<sal_uInt16>( rParameter.nSubTypeIndex) );
    1074                 :          0 :     m_pAxisTypeResourceGroup->fillControls( rParameter );
    1075                 :          0 :     m_pDim3DLookResourceGroup->fillControls( rParameter );
    1076                 :          0 :     m_pStackingResourceGroup->fillControls( rParameter );
    1077                 :          0 :     m_pSplineResourceGroup->fillControls( rParameter );
    1078                 :          0 :     m_pGeometryResourceGroup->fillControls( rParameter );
    1079                 :          0 :     m_pSortByXValuesResourceGroup->fillControls( rParameter );
    1080                 :          0 :     m_nChangingCalls--;
    1081                 :          0 : }
    1082                 :            : 
    1083                 :          0 : void ChartTypeTabPage::initializePage()
    1084                 :            : {
    1085         [ #  # ]:          0 :     if( !m_xChartModel.is() )
    1086                 :          0 :         return;
    1087 [ #  # ][ #  # ]:          0 :     uno::Reference< lang::XMultiServiceFactory > xTemplateManager( m_xChartModel->getChartTypeManager(), uno::UNO_QUERY );
                 [ #  # ]
    1088         [ #  # ]:          0 :     uno::Reference< frame::XModel > xModel( m_xChartModel, uno::UNO_QUERY);
    1089         [ #  # ]:          0 :     uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ) );
    1090                 :            :     DiagramHelper::tTemplateWithServiceName aTemplate =
    1091         [ #  # ]:          0 :         DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateManager );
    1092                 :          0 :     ::rtl::OUString aServiceName( aTemplate.second );
    1093                 :            : 
    1094                 :          0 :     bool bFound = false;
    1095                 :            : 
    1096                 :          0 :     ::std::vector< ChartTypeDialogController* >::iterator             aIter = m_aChartTypeDialogControllerList.begin();
    1097         [ #  # ]:          0 :     const ::std::vector< ChartTypeDialogController* >::const_iterator aEnd  = m_aChartTypeDialogControllerList.end();
    1098 [ #  # ][ #  # ]:          0 :     for( sal_uInt16 nM=0; aIter != aEnd; ++aIter, ++nM )
    1099                 :            :     {
    1100 [ #  # ][ #  # ]:          0 :         if( (*aIter)->isSubType(aServiceName) )
    1101                 :            :         {
    1102                 :          0 :             bFound = true;
    1103                 :            : 
    1104         [ #  # ]:          0 :             m_aMainTypeList.SelectEntryPos( nM );
    1105         [ #  # ]:          0 :             this->showAllControls( **aIter );
    1106         [ #  # ]:          0 :             uno::Reference< beans::XPropertySet > xTemplateProps( aTemplate.first, uno::UNO_QUERY );
    1107         [ #  # ]:          0 :             ChartTypeParameter aParameter = (*aIter)->getChartTypeParameterForService( aServiceName, xTemplateProps );
    1108         [ #  # ]:          0 :             m_pCurrentMainType = this->getSelectedMainType();
    1109                 :            : 
    1110                 :            :             //set ThreeDLookScheme
    1111         [ #  # ]:          0 :             aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( xDiagram );
    1112 [ #  # ][ #  # ]:          0 :             if(!aParameter.b3DLook && aParameter.eThreeDLookScheme!=ThreeDLookScheme_Realistic )
    1113                 :          0 :                 aParameter.eThreeDLookScheme=ThreeDLookScheme_Realistic;
    1114                 :            : 
    1115         [ #  # ]:          0 :             aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
    1116                 :            : 
    1117         [ #  # ]:          0 :             this->fillAllControls( aParameter );
    1118         [ #  # ]:          0 :             if( m_pCurrentMainType )
    1119         [ #  # ]:          0 :                 m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps);
    1120         [ #  # ]:          0 :             break;
    1121                 :            :         }
    1122                 :            :     }
    1123                 :            : 
    1124         [ #  # ]:          0 :     if( !bFound )
    1125                 :            :     {
    1126         [ #  # ]:          0 :         m_aSubTypeList.Hide();
    1127         [ #  # ]:          0 :         m_pAxisTypeResourceGroup->showControls( false );
    1128         [ #  # ]:          0 :         m_pDim3DLookResourceGroup->showControls( false );
    1129         [ #  # ]:          0 :         m_pStackingResourceGroup->showControls( false, false );
    1130         [ #  # ]:          0 :         m_pSplineResourceGroup->showControls( false );
    1131         [ #  # ]:          0 :         m_pGeometryResourceGroup->showControls( false );
    1132         [ #  # ]:          0 :         m_pSortByXValuesResourceGroup->showControls( false );
    1133         [ #  # ]:          0 :     }
    1134                 :            : }
    1135                 :            : 
    1136                 :          0 : sal_Bool ChartTypeTabPage::commitPage( ::svt::WizardTypes::CommitPageReason /*eReason*/ )
    1137                 :            : {
    1138                 :            :     //commit changes to model
    1139 [ #  # ][ #  # ]:          0 :     if( !m_bDoLiveUpdate && m_pCurrentMainType )
    1140                 :            :     {
    1141         [ #  # ]:          0 :         ChartTypeParameter aParameter( this->getCurrentParamter() );
    1142         [ #  # ]:          0 :         m_pCurrentMainType->adjustParameterToSubType( aParameter );
    1143 [ #  # ][ #  # ]:          0 :         commitToModel( aParameter );
    1144                 :            :     }
    1145                 :            : 
    1146                 :          0 :     return sal_True;//return false if this page should not be left
    1147                 :            : }
    1148                 :            : 
    1149                 :          0 : uno::Reference< XChartTypeTemplate > ChartTypeTabPage::getCurrentTemplate() const
    1150                 :            : {
    1151 [ #  # ][ #  # ]:          0 :     if( m_pCurrentMainType && m_xChartModel.is() )
                 [ #  # ]
    1152                 :            :     {
    1153         [ #  # ]:          0 :         ChartTypeParameter aParameter( this->getCurrentParamter() );
    1154         [ #  # ]:          0 :         m_pCurrentMainType->adjustParameterToSubType( aParameter );
    1155 [ #  # ][ #  # ]:          0 :         uno::Reference< lang::XMultiServiceFactory > xTemplateManager( m_xChartModel->getChartTypeManager(), uno::UNO_QUERY );
                 [ #  # ]
    1156 [ #  # ][ #  # ]:          0 :         return m_pCurrentMainType->getCurrentTemplate( aParameter, xTemplateManager );
    1157                 :            :     }
    1158                 :          0 :     return 0;
    1159                 :            : }
    1160                 :            : 
    1161                 :            : //.............................................................................
    1162                 :            : } //namespace chart
    1163                 :            : //.............................................................................
    1164                 :            : 
    1165                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10