LCOV - code coverage report
Current view: top level - chart2/source/controller/main - ChartController_Tools.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 9 442 2.0 %
Date: 2014-04-11 Functions: 2 21 9.5 %
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 "ChartController.hxx"
      21             : #include "ChartWindow.hxx"
      22             : #include "ChartModelHelper.hxx"
      23             : #include "TitleHelper.hxx"
      24             : #include "ThreeDHelper.hxx"
      25             : #include "DataSeriesHelper.hxx"
      26             : #include "UndoGuard.hxx"
      27             : #include "ControllerLockGuard.hxx"
      28             : #include "macros.hxx"
      29             : #include "ResId.hxx"
      30             : #include "Strings.hrc"
      31             : #include "ObjectIdentifier.hxx"
      32             : #include "ReferenceSizeProvider.hxx"
      33             : #include "chartview/ExplicitValueProvider.hxx"
      34             : #include "chartview/DrawModelWrapper.hxx"
      35             : #include "ChartTransferable.hxx"
      36             : #include "DrawViewWrapper.hxx"
      37             : #include "LegendHelper.hxx"
      38             : #include "AxisHelper.hxx"
      39             : #include "RegressionCurveHelper.hxx"
      40             : #include "ShapeController.hxx"
      41             : #include "DiagramHelper.hxx"
      42             : #include "ObjectNameProvider.hxx"
      43             : 
      44             : #include <com/sun/star/chart2/DataPointLabel.hpp>
      45             : #include <com/sun/star/beans/XPropertyState.hpp>
      46             : #include <com/sun/star/drawing/CameraGeometry.hpp>
      47             : #include <com/sun/star/graphic/XGraphic.hpp>
      48             : #include <com/sun/star/io/XInputStream.hpp>
      49             : #include <com/sun/star/text/XTextRange.hpp>
      50             : #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
      51             : #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
      52             : #include <com/sun/star/chart/ErrorBarStyle.hpp>
      53             : 
      54             : #include <svx/ActionDescriptionProvider.hxx>
      55             : // for TransferableDataHelper/TransferableHelper
      56             : #include <svtools/transfer.hxx>
      57             : // for SotStorageStreamRef
      58             : #include <sot/storage.hxx>
      59             : // for Graphic
      60             : #include <vcl/graph.hxx>
      61             : // for SvxDrawingLayerImport/SvxUnoDrawingModel
      62             : #include <svx/unomodel.hxx>
      63             : // for SdrModel
      64             : #include <svx/svdmodel.hxx>
      65             : // for OInputStreamWrapper
      66             : #include <unotools/streamwrap.hxx>
      67             : // for SolarMutex
      68             : #include <vcl/svapp.hxx>
      69             : #include <osl/mutex.hxx>
      70             : #include <svx/dialmgr.hxx>
      71             : #include <svx/dialogs.hrc>
      72             : // for OutlinerView
      73             : #include <editeng/outliner.hxx>
      74             : #include <svx/svditer.hxx>
      75             : #include <svx/svdpage.hxx>
      76             : #include <svx/svdundo.hxx>
      77             : #include <svx/unoapi.hxx>
      78             : #include <svx/unopage.hxx>
      79             : 
      80             : #include <boost/scoped_ptr.hpp>
      81             : 
      82             : using namespace ::com::sun::star;
      83             : 
      84             : using ::com::sun::star::uno::Reference;
      85             : using ::com::sun::star::uno::Sequence;
      86             : 
      87             : namespace chart
      88             : {
      89             : 
      90             : namespace
      91             : {
      92             : 
      93           0 : bool lcl_deleteDataSeries(
      94             :     const OUString & rCID,
      95             :     const Reference< frame::XModel > & xModel,
      96             :     const Reference< document::XUndoManager > & xUndoManager )
      97             : {
      98           0 :     bool bResult = false;
      99           0 :     uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rCID, xModel ));
     100           0 :     uno::Reference< chart2::XChartDocument > xChartDoc( xModel, uno::UNO_QUERY );
     101           0 :     if( xSeries.is() && xChartDoc.is())
     102             :     {
     103             :         uno::Reference< chart2::XChartType > xChartType(
     104           0 :             DataSeriesHelper::getChartTypeOfSeries( xSeries, xChartDoc->getFirstDiagram()));
     105           0 :         if( xChartType.is())
     106             :         {
     107             :             UndoGuard aUndoGuard(
     108             :                 ActionDescriptionProvider::createDescription(
     109             :                     ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_DATASERIES )),
     110           0 :                 xUndoManager );
     111             : 
     112           0 :             Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ) );
     113           0 :             uno::Reference< chart2::XAxis > xAxis( DiagramHelper::getAttachedAxis( xSeries, xDiagram ) );
     114             : 
     115           0 :             DataSeriesHelper::deleteSeries( xSeries, xChartType );
     116             : 
     117           0 :             AxisHelper::hideAxisIfNoDataIsAttached( xAxis, xDiagram );
     118             : 
     119           0 :             bResult = true;
     120           0 :             aUndoGuard.commit();
     121           0 :         }
     122             :     }
     123           0 :     return bResult;
     124             : }
     125             : 
     126           0 : bool lcl_deleteDataCurve(
     127             :     const OUString & rCID,
     128             :     const Reference< frame::XModel > & xModel,
     129             :     const Reference< document::XUndoManager > & xUndoManager )
     130             : {
     131           0 :     bool bResult = false;
     132             : 
     133             :     uno::Reference< beans::XPropertySet > xProperties(
     134           0 :         ObjectIdentifier::getObjectPropertySet( rCID, xModel));
     135             : 
     136           0 :     uno::Reference< chart2::XRegressionCurve > xRegressionCurve( xProperties, uno::UNO_QUERY );
     137             : 
     138           0 :     if( xRegressionCurve.is())
     139             :     {
     140             :         uno::Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer(
     141             :             ObjectIdentifier::getObjectPropertySet(
     142           0 :                 ObjectIdentifier::getFullParentParticle( rCID ), xModel), uno::UNO_QUERY );
     143             : 
     144           0 :         if( xRegressionCurveContainer.is())
     145             :         {
     146             :             UndoGuard aUndoGuard = UndoGuard(
     147             :                 ActionDescriptionProvider::createDescription(
     148             :                     ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_CURVE )),
     149           0 :                 xUndoManager );
     150             : 
     151           0 :             xRegressionCurveContainer->removeRegressionCurve( xRegressionCurve );
     152             : 
     153           0 :             bResult = true;
     154           0 :             aUndoGuard.commit();
     155           0 :         }
     156             :     }
     157           0 :     return bResult;
     158             : }
     159             : 
     160             : } // anonymous namespace
     161             : 
     162             : SAL_WNODEPRECATED_DECLARATIONS_PUSH
     163           0 : ::std::auto_ptr< ReferenceSizeProvider > ChartController::impl_createReferenceSizeProvider()
     164             : {
     165           0 :     awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
     166             : 
     167             :     return ::std::auto_ptr< ReferenceSizeProvider >(
     168             :         new ReferenceSizeProvider( aPageSize,
     169           0 :             Reference< chart2::XChartDocument >( getModel(), uno::UNO_QUERY )));
     170             : }
     171             : SAL_WNODEPRECATED_DECLARATIONS_POP
     172             : 
     173           0 : void ChartController::impl_adaptDataSeriesAutoResize()
     174             : {
     175             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     176             :     ::std::auto_ptr< ReferenceSizeProvider > apRefSizeProvider(
     177           0 :         impl_createReferenceSizeProvider());
     178             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     179           0 :     if( apRefSizeProvider.get())
     180           0 :         apRefSizeProvider->setValuesAtAllDataSeries();
     181           0 : }
     182             : 
     183           0 : void ChartController::executeDispatch_NewArrangement()
     184             : {
     185             :     // remove manual positions at titles, legend and the diagram, remove manual
     186             :     // size at the diagram
     187             : 
     188             :     try
     189             :     {
     190           0 :         Reference< frame::XModel > xModel( getModel() );
     191           0 :         Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ));
     192           0 :         if( xDiagram.is())
     193             :         {
     194             :             // using assignment for broken gcc 3.3
     195             :             UndoGuard aUndoGuard = UndoGuard(
     196             :                 SCH_RESSTR( STR_ACTION_REARRANGE_CHART ),
     197           0 :                 m_xUndoManager );
     198           0 :             ControllerLockGuardUNO aCtlLockGuard( xModel );
     199             : 
     200             :             // diagram
     201           0 :             Reference< beans::XPropertyState > xState( xDiagram, uno::UNO_QUERY_THROW );
     202           0 :             xState->setPropertyToDefault( "RelativeSize");
     203           0 :             xState->setPropertyToDefault( "RelativePosition");
     204           0 :             xState->setPropertyToDefault( "PosSizeExcludeAxes");
     205             : 
     206             :             // 3d rotation
     207           0 :             ThreeDHelper::set3DSettingsToDefault( uno::Reference< beans::XPropertySet >( xDiagram, uno::UNO_QUERY ) );
     208             : 
     209             :             // legend
     210           0 :             Reference< beans::XPropertyState > xLegendState( xDiagram->getLegend(), uno::UNO_QUERY );
     211           0 :             if( xLegendState.is())
     212             :             {
     213           0 :                 xLegendState->setPropertyToDefault( "RelativePosition");
     214           0 :                 xLegendState->setPropertyToDefault( "RelativeSize");
     215           0 :                 xLegendState->setPropertyToDefault( "AnchorPosition");
     216             :             }
     217             : 
     218             :             // titles
     219           0 :             for( sal_Int32 eType = TitleHelper::TITLE_BEGIN;
     220             :                  eType < TitleHelper::NORMAL_TITLE_END;
     221             :                  ++eType )
     222             :             {
     223             :                 Reference< beans::XPropertyState > xTitleState(
     224             :                     TitleHelper::getTitle(
     225           0 :                         static_cast< TitleHelper::eTitleType >( eType ), xModel ), uno::UNO_QUERY );
     226           0 :                 if( xTitleState.is())
     227           0 :                     xTitleState->setPropertyToDefault( "RelativePosition");
     228           0 :             }
     229             : 
     230             :             // regression curve equations
     231             :             ::std::vector< Reference< chart2::XRegressionCurve > > aRegressionCurves(
     232           0 :                 RegressionCurveHelper::getAllRegressionCurvesNotMeanValueLine( xDiagram ));
     233             :             ::std::for_each( aRegressionCurves.begin(), aRegressionCurves.end(),
     234           0 :                       RegressionCurveHelper::resetEquationPosition );
     235             : 
     236           0 :             aUndoGuard.commit();
     237           0 :         }
     238             :     }
     239           0 :     catch( const uno::RuntimeException & ex )
     240             :     {
     241             :         ASSERT_EXCEPTION( ex );
     242             :     }
     243           0 : }
     244             : 
     245           0 : void ChartController::executeDispatch_ScaleText()
     246             : {
     247           0 :     SolarMutexGuard aSolarGuard;
     248             :     // using assignment for broken gcc 3.3
     249             :     UndoGuard aUndoGuard = UndoGuard(
     250             :         SCH_RESSTR( STR_ACTION_SCALE_TEXT ),
     251           0 :         m_xUndoManager );
     252           0 :     ControllerLockGuardUNO aCtlLockGuard( getModel() );
     253             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     254           0 :     ::std::auto_ptr< ReferenceSizeProvider > apRefSizeProv( impl_createReferenceSizeProvider());
     255             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     256             :     OSL_ASSERT( apRefSizeProv.get());
     257           0 :     if( apRefSizeProv.get())
     258           0 :         apRefSizeProv->toggleAutoResizeState();
     259           0 :     aUndoGuard.commit();
     260           0 : }
     261             : 
     262           0 : void ChartController::executeDispatch_Paste()
     263             : {
     264           0 :     SolarMutexGuard aGuard;
     265           0 :     if( m_pChartWindow )
     266             :     {
     267           0 :         Graphic aGraphic;
     268             :         // paste location: center of window
     269           0 :         Point aPos;
     270           0 :         aPos = m_pChartWindow->PixelToLogic( Rectangle( aPos, m_pChartWindow->GetSizePixel()).Center());
     271             : 
     272             :         // handle different formats
     273           0 :         TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( m_pChartWindow ));
     274           0 :         if( aDataHelper.GetTransferable().is())
     275             :         {
     276           0 :             if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ) )
     277             :             {
     278           0 :                 SotStorageStreamRef xStm;
     279           0 :                 if ( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStm ) )
     280             :                 {
     281           0 :                     xStm->Seek( 0 );
     282           0 :                     Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( *xStm ) );
     283           0 :                     ::boost::scoped_ptr< SdrModel > spModel( new SdrModel() );
     284           0 :                     if ( SvxDrawingLayerImport( spModel.get(), xInputStream ) )
     285             :                     {
     286           0 :                         impl_PasteShapes( spModel.get() );
     287           0 :                     }
     288           0 :                 }
     289             :             }
     290           0 :             else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) )
     291             :             {
     292             :                 // graphic exchange format (graphic manager bitmap format?)
     293           0 :                 SotStorageStreamRef xStm;
     294           0 :                 if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_SVXB, xStm ))
     295           0 :                     ReadGraphic( *xStm, aGraphic );
     296             :             }
     297           0 :             else if( aDataHelper.HasFormat( FORMAT_GDIMETAFILE ))
     298             :             {
     299             :                 // meta file
     300           0 :                 GDIMetaFile aMetafile;
     301           0 :                 if( aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMetafile ))
     302           0 :                     aGraphic = Graphic( aMetafile );
     303             :             }
     304           0 :             else if( aDataHelper.HasFormat( FORMAT_BITMAP ))
     305             :             {
     306             :                 // bitmap (non-graphic-manager)
     307           0 :                 BitmapEx aBmpEx;
     308           0 :                 if( aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ))
     309           0 :                     aGraphic = Graphic( aBmpEx );
     310             :             }
     311           0 :             else if( aDataHelper.HasFormat( FORMAT_STRING ))
     312             :             {
     313           0 :                 OUString aString;
     314           0 :                 if( aDataHelper.GetString( FORMAT_STRING, aString ) && m_pDrawModelWrapper )
     315             :                 {
     316           0 :                     if( m_pDrawViewWrapper )
     317             :                     {
     318           0 :                         OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
     319           0 :                         if( pOutlinerView )//in case of edit mode insert into edited string
     320           0 :                             pOutlinerView->InsertText( aString );
     321             :                         else
     322             :                         {
     323           0 :                             impl_PasteStringAsTextShape( aString, awt::Point( 0, 0 ) );
     324             :                         }
     325             :                     }
     326           0 :                 }
     327             :             }
     328             :         }
     329             : 
     330           0 :         if( aGraphic.GetType() != GRAPHIC_NONE )
     331             :         {
     332           0 :             Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic());
     333           0 :             if( xGraphic.is())
     334           0 :                 impl_PasteGraphic( xGraphic, aPos );
     335           0 :         }
     336           0 :     }
     337           0 : }
     338             : 
     339             : // note: aPosition is ignored for now. The object is always pasted centered to
     340             : // the page
     341           0 : void ChartController::impl_PasteGraphic(
     342             :     uno::Reference< graphic::XGraphic > & xGraphic,
     343             :     const ::Point & /* aPosition */ )
     344             : {
     345             :     // note: the XPropertySet of the model is the old API. Also the property
     346             :     // "AdditionalShapes" that is used there.
     347           0 :     uno::Reference< beans::XPropertySet > xModelProp( getModel(), uno::UNO_QUERY );
     348           0 :     DrawModelWrapper * pDrawModelWrapper( this->GetDrawModelWrapper());
     349           0 :     if( ! (xGraphic.is() && xModelProp.is()))
     350           0 :         return;
     351           0 :     uno::Reference< lang::XMultiServiceFactory > xFact( pDrawModelWrapper->getShapeFactory());
     352             :     uno::Reference< drawing::XShape > xGraphicShape(
     353           0 :         xFact->createInstance( "com.sun.star.drawing.GraphicObjectShape" ), uno::UNO_QUERY );
     354           0 :     uno::Reference< beans::XPropertySet > xGraphicShapeProp( xGraphicShape, uno::UNO_QUERY );
     355           0 :     if( xGraphicShapeProp.is() && xGraphicShape.is())
     356             :     {
     357           0 :         uno::Reference< drawing::XShapes > xPage( pDrawModelWrapper->getMainDrawPage(), uno::UNO_QUERY );
     358           0 :         if( xPage.is())
     359             :         {
     360           0 :             xPage->add( xGraphicShape );
     361             :             //need to change the model state manually
     362             :             {
     363           0 :                 uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY );
     364           0 :                 if( xModifiable.is() )
     365           0 :                     xModifiable->setModified( true );
     366             :             }
     367             :             //select new shape
     368           0 :             m_aSelection.setSelection( xGraphicShape );
     369           0 :             m_aSelection.applySelection( m_pDrawViewWrapper );
     370             :         }
     371           0 :         xGraphicShapeProp->setPropertyValue( "Graphic", uno::makeAny( xGraphic ));
     372           0 :         uno::Reference< beans::XPropertySet > xGraphicProp( xGraphic, uno::UNO_QUERY );
     373             : 
     374           0 :         awt::Size aGraphicSize( 1000, 1000 );
     375             :         // first try size in 100th mm, then pixel size
     376           0 :         if( ! ( xGraphicProp->getPropertyValue( "Size100thMM") >>= aGraphicSize ) &&
     377           0 :             ( ( xGraphicProp->getPropertyValue( "SizePixel") >>= aGraphicSize ) && m_pChartWindow ))
     378             :         {
     379           0 :             ::Size aVCLSize( m_pChartWindow->PixelToLogic( Size( aGraphicSize.Width, aGraphicSize.Height )));
     380           0 :             aGraphicSize.Width = aVCLSize.getWidth();
     381           0 :             aGraphicSize.Height = aVCLSize.getHeight();
     382             :         }
     383           0 :         xGraphicShape->setSize( aGraphicSize );
     384           0 :         xGraphicShape->setPosition( awt::Point( 0, 0 ) );
     385           0 :     }
     386             : }
     387             : 
     388           0 : void ChartController::impl_PasteShapes( SdrModel* pModel )
     389             : {
     390           0 :     DrawModelWrapper* pDrawModelWrapper( this->GetDrawModelWrapper() );
     391           0 :     if ( pDrawModelWrapper && m_pDrawViewWrapper )
     392             :     {
     393           0 :         Reference< drawing::XDrawPage > xDestPage( pDrawModelWrapper->getMainDrawPage() );
     394           0 :         SdrPage* pDestPage = GetSdrPageFromXDrawPage( xDestPage );
     395           0 :         if ( pDestPage )
     396             :         {
     397           0 :             Reference< drawing::XShape > xSelShape;
     398           0 :             m_pDrawViewWrapper->BegUndo( SVX_RESSTR( RID_SVX_3D_UNDO_EXCHANGE_PASTE ) );
     399           0 :             sal_uInt16 nCount = pModel->GetPageCount();
     400           0 :             for ( sal_uInt16 i = 0; i < nCount; ++i )
     401             :             {
     402           0 :                 const SdrPage* pPage = pModel->GetPage( i );
     403           0 :                 SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
     404           0 :                 while ( aIter.IsMore() )
     405             :                 {
     406           0 :                     SdrObject* pObj = aIter.Next();
     407           0 :                     SdrObject* pNewObj = ( pObj ? pObj->Clone() : NULL );
     408           0 :                     if ( pNewObj )
     409             :                     {
     410           0 :                         pNewObj->SetModel( &pDrawModelWrapper->getSdrModel() );
     411           0 :                         pNewObj->SetPage( pDestPage );
     412             : 
     413             :                         // set position
     414           0 :                         Reference< drawing::XShape > xShape( pNewObj->getUnoShape(), uno::UNO_QUERY );
     415           0 :                         if ( xShape.is() )
     416             :                         {
     417           0 :                             xShape->setPosition( awt::Point( 0, 0 ) );
     418             :                         }
     419             : 
     420           0 :                         pDestPage->InsertObject( pNewObj );
     421           0 :                         m_pDrawViewWrapper->AddUndo( new SdrUndoInsertObj( *pNewObj ) );
     422           0 :                         xSelShape = xShape;
     423             :                     }
     424             :                 }
     425           0 :             }
     426             : 
     427           0 :             Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY );
     428           0 :             if ( xModifiable.is() )
     429             :             {
     430           0 :                 xModifiable->setModified( true );
     431             :             }
     432             : 
     433             :             // select last inserted shape
     434           0 :             m_aSelection.setSelection( xSelShape );
     435           0 :             m_aSelection.applySelection( m_pDrawViewWrapper );
     436             : 
     437           0 :             m_pDrawViewWrapper->EndUndo();
     438             : 
     439           0 :             impl_switchDiagramPositioningToExcludingPositioning();
     440           0 :         }
     441             :     }
     442           0 : }
     443             : 
     444           0 : void ChartController::impl_PasteStringAsTextShape( const OUString& rString, const awt::Point& rPosition )
     445             : {
     446           0 :     DrawModelWrapper* pDrawModelWrapper( this->GetDrawModelWrapper() );
     447           0 :     if ( pDrawModelWrapper && m_pDrawViewWrapper )
     448             :     {
     449           0 :         const Reference< lang::XMultiServiceFactory >& xShapeFactory( pDrawModelWrapper->getShapeFactory() );
     450           0 :         const Reference< drawing::XDrawPage >& xDrawPage( pDrawModelWrapper->getMainDrawPage() );
     451             :         OSL_ASSERT( xShapeFactory.is() && xDrawPage.is() );
     452             : 
     453           0 :         if ( xShapeFactory.is() && xDrawPage.is() )
     454             :         {
     455             :             try
     456             :             {
     457             :                 Reference< drawing::XShape > xTextShape(
     458           0 :                     xShapeFactory->createInstance( "com.sun.star.drawing.TextShape" ), uno::UNO_QUERY_THROW );
     459           0 :                 xDrawPage->add( xTextShape );
     460             : 
     461           0 :                 Reference< text::XTextRange > xRange( xTextShape, uno::UNO_QUERY_THROW );
     462           0 :                 xRange->setString( rString );
     463             : 
     464           0 :                 float fCharHeight = 10.0;
     465           0 :                 Reference< beans::XPropertySet > xProperties( xTextShape, uno::UNO_QUERY_THROW );
     466           0 :                 xProperties->setPropertyValue( "TextAutoGrowHeight", uno::makeAny( true ) );
     467           0 :                 xProperties->setPropertyValue( "TextAutoGrowWidth", uno::makeAny( true ) );
     468           0 :                 xProperties->setPropertyValue( "CharHeight", uno::makeAny( fCharHeight ) );
     469           0 :                 xProperties->setPropertyValue( "CharHeightAsian", uno::makeAny( fCharHeight ) );
     470           0 :                 xProperties->setPropertyValue( "CharHeightComplex", uno::makeAny( fCharHeight ) );
     471           0 :                 xProperties->setPropertyValue( "TextVerticalAdjust", uno::makeAny( drawing::TextVerticalAdjust_CENTER ) );
     472           0 :                 xProperties->setPropertyValue( "TextHorizontalAdjust", uno::makeAny( drawing::TextHorizontalAdjust_CENTER ) );
     473           0 :                 xProperties->setPropertyValue( "CharFontName", uno::makeAny( OUString("Albany") ) );
     474             : 
     475           0 :                 xTextShape->setPosition( rPosition );
     476             : 
     477           0 :                 m_aSelection.setSelection( xTextShape );
     478           0 :                 m_aSelection.applySelection( m_pDrawViewWrapper );
     479             : 
     480           0 :                 SdrObject* pObj = DrawViewWrapper::getSdrObject( xTextShape );
     481           0 :                 if ( pObj )
     482             :                 {
     483           0 :                     m_pDrawViewWrapper->BegUndo( SVX_RESSTR( RID_SVX_3D_UNDO_EXCHANGE_PASTE ) );
     484           0 :                     m_pDrawViewWrapper->AddUndo( new SdrUndoInsertObj( *pObj ) );
     485           0 :                     m_pDrawViewWrapper->EndUndo();
     486             : 
     487           0 :                     impl_switchDiagramPositioningToExcludingPositioning();
     488           0 :                 }
     489             :             }
     490           0 :             catch ( const uno::Exception& ex )
     491             :             {
     492             :                 ASSERT_EXCEPTION( ex );
     493             :             }
     494           0 :         }
     495             :     }
     496           0 : }
     497             : 
     498           0 : void ChartController::executeDispatch_Copy()
     499             : {
     500           0 :     if ( m_pDrawViewWrapper )
     501             :     {
     502           0 :         OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
     503           0 :         if ( pOutlinerView )
     504             :         {
     505           0 :             pOutlinerView->Copy();
     506             :         }
     507             :         else
     508             :         {
     509           0 :             Reference< datatransfer::XTransferable > xTransferable;
     510             :             {
     511           0 :                 SolarMutexGuard aSolarGuard;
     512           0 :                 if ( m_pDrawModelWrapper )
     513             :                 {
     514           0 :                     SdrObject* pSelectedObj = 0;
     515           0 :                     ObjectIdentifier aSelOID( m_aSelection.getSelectedOID() );
     516           0 :                     if ( aSelOID.isAutoGeneratedObject() )
     517             :                     {
     518           0 :                         pSelectedObj = m_pDrawModelWrapper->getNamedSdrObject( aSelOID.getObjectCID() );
     519             :                     }
     520           0 :                     else if ( aSelOID.isAdditionalShape() )
     521             :                     {
     522           0 :                         pSelectedObj = DrawViewWrapper::getSdrObject( aSelOID.getAdditionalShape() );
     523             :                     }
     524           0 :                     if ( pSelectedObj )
     525             :                     {
     526           0 :                         xTransferable = Reference< datatransfer::XTransferable >( new ChartTransferable(
     527           0 :                                 &m_pDrawModelWrapper->getSdrModel(), pSelectedObj, aSelOID.isAdditionalShape() ) );
     528           0 :                     }
     529           0 :                 }
     530             :             }
     531           0 :             if ( xTransferable.is() )
     532             :             {
     533           0 :                 Reference< datatransfer::clipboard::XClipboard > xClipboard( TransferableHelper::GetSystemClipboard() );
     534           0 :                 if ( xClipboard.is() )
     535             :                 {
     536           0 :                     xClipboard->setContents( xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >() );
     537           0 :                 }
     538           0 :             }
     539             :         }
     540             :     }
     541           0 : }
     542             : 
     543           0 : void ChartController::executeDispatch_Cut()
     544             : {
     545           0 :     executeDispatch_Copy();
     546           0 :     executeDispatch_Delete();
     547           0 : }
     548             : 
     549         790 : bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
     550             : {
     551         790 :     ObjectIdentifier aSelOID( rSelection );
     552         790 :     if ( aSelOID.isAutoGeneratedObject() )
     553             :     {
     554           0 :         OUString aSelObjCID( aSelOID.getObjectCID() );
     555           0 :         ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID ));
     556             : 
     557           0 :         switch(aObjectType)
     558             :         {
     559             :         case OBJECTTYPE_TITLE:
     560             :         case OBJECTTYPE_LEGEND:
     561             :         case OBJECTTYPE_DATA_SERIES:
     562             :         case OBJECTTYPE_LEGEND_ENTRY:
     563             :         case OBJECTTYPE_DATA_CURVE_EQUATION:
     564             :         case OBJECTTYPE_DATA_CURVE:
     565             :         case OBJECTTYPE_DATA_AVERAGE_LINE:
     566             :         case OBJECTTYPE_DATA_ERRORS_X:
     567             :         case OBJECTTYPE_DATA_ERRORS_Y:
     568             :         case OBJECTTYPE_DATA_ERRORS_Z:
     569             :         case OBJECTTYPE_DATA_LABELS:
     570             :         case OBJECTTYPE_DATA_LABEL:
     571             :         case OBJECTTYPE_AXIS:
     572             :         case OBJECTTYPE_GRID:
     573             :         case OBJECTTYPE_SUBGRID:
     574           0 :             return true;
     575             :         default:
     576           0 :             break;
     577           0 :         }
     578             :     }
     579         790 :     else if ( aSelOID.isAdditionalShape() )
     580             :     {
     581           0 :         return true;
     582             :     }
     583             : 
     584         790 :     return false;
     585             : }
     586             : 
     587         790 : bool ChartController::isShapeContext() const
     588             : {
     589         790 :     if ( m_aSelection.isAdditionalShapeSelected() ||
     590         773 :          ( m_pDrawViewWrapper && m_pDrawViewWrapper->AreObjectsMarked() &&
     591           0 :            ( m_pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) ) )
     592             :     {
     593           0 :         return true;
     594             :     }
     595             : 
     596         790 :     return false;
     597             : }
     598             : 
     599           0 : void ChartController::impl_ClearSelection()
     600             : {
     601           0 :     if( m_aSelection.hasSelection())
     602             :     {
     603           0 :         m_aSelection.clearSelection();
     604           0 :         impl_notifySelectionChangeListeners();
     605             :     }
     606           0 : }
     607             : 
     608           0 : bool ChartController::executeDispatch_Delete()
     609             : {
     610           0 :     bool bReturn = false;
     611             : 
     612             :     // remove the selected object
     613           0 :     OUString aCID( m_aSelection.getSelectedCID() );
     614           0 :     if( !aCID.isEmpty() )
     615             :     {
     616           0 :         if( !isObjectDeleteable( uno::Any( aCID ) ) )
     617           0 :             return false;
     618             : 
     619             :         //remove chart object
     620           0 :         uno::Reference< chart2::XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY );
     621           0 :         if( !xChartDoc.is() )
     622           0 :             return false;
     623             : 
     624           0 :         ObjectType aObjectType( ObjectIdentifier::getObjectType( aCID ));
     625           0 :         switch( aObjectType )
     626             :         {
     627             :             case OBJECTTYPE_TITLE:
     628             :             {
     629             :                 // using assignment for broken gcc 3.3
     630             :                 UndoGuard aUndoGuard = UndoGuard(
     631             :                     ActionDescriptionProvider::createDescription(
     632             :                         ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_TITLE )),
     633           0 :                     m_xUndoManager );
     634             :                 TitleHelper::removeTitle(
     635           0 :                     ObjectIdentifier::getTitleTypeForCID( aCID ), getModel() );
     636           0 :                 bReturn = true;
     637           0 :                 aUndoGuard.commit();
     638           0 :                 break;
     639             :             }
     640             :             case OBJECTTYPE_LEGEND:
     641             :             {
     642           0 :                 uno::Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram());
     643           0 :                 if( xDiagram.is())
     644             :                 {
     645           0 :                     uno::Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
     646           0 :                     if( xLegendProp.is())
     647             :                     {
     648             :                         // using assignment for broken gcc 3.3
     649             :                         UndoGuard aUndoGuard = UndoGuard(
     650             :                             ActionDescriptionProvider::createDescription(
     651             :                                 ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_LEGEND )),
     652           0 :                             m_xUndoManager );
     653           0 :                         xLegendProp->setPropertyValue( "Show", uno::makeAny( false ));
     654           0 :                         bReturn = true;
     655           0 :                         aUndoGuard.commit();
     656           0 :                     }
     657             :                 }
     658           0 :                 break;
     659             :             }
     660             : 
     661             :             case OBJECTTYPE_DATA_SERIES:
     662           0 :                 bReturn = lcl_deleteDataSeries( aCID, getModel(), m_xUndoManager );
     663           0 :                 break;
     664             : 
     665             :             case OBJECTTYPE_LEGEND_ENTRY:
     666             :             {
     667             :                 ObjectType eParentObjectType = ObjectIdentifier::getObjectType(
     668           0 :                     ObjectIdentifier::getFullParentParticle( aCID ));
     669           0 :                 if( eParentObjectType == OBJECTTYPE_DATA_SERIES )
     670             :                 {
     671           0 :                     bReturn = lcl_deleteDataSeries( aCID, getModel(), m_xUndoManager );
     672             :                 }
     673           0 :                 else if( eParentObjectType == OBJECTTYPE_DATA_CURVE )
     674             :                 {
     675           0 :                     sal_Int32 nEndPos = aCID.lastIndexOf(':');
     676           0 :                     OUString aParentCID = aCID.copy(0, nEndPos);
     677             : 
     678           0 :                     bReturn = lcl_deleteDataCurve(aParentCID, getModel(), m_xUndoManager );
     679             :                 }
     680           0 :                 else if( eParentObjectType == OBJECTTYPE_DATA_AVERAGE_LINE )
     681             :                 {
     682           0 :                     executeDispatch_DeleteMeanValue();
     683           0 :                     bReturn = true;
     684             :                 }
     685           0 :                 break;
     686             :             }
     687             : 
     688             :             case OBJECTTYPE_DATA_AVERAGE_LINE:
     689             :             {
     690             :                 uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
     691             :                     ObjectIdentifier::getObjectPropertySet(
     692           0 :                         ObjectIdentifier::getFullParentParticle( aCID ), getModel()), uno::UNO_QUERY );
     693           0 :                 if( xRegCurveCnt.is())
     694             :                 {
     695             :                     // using assignment for broken gcc 3.3
     696             :                     UndoGuard aUndoGuard = UndoGuard(
     697             :                         ActionDescriptionProvider::createDescription(
     698             :                             ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_AVERAGE_LINE )),
     699           0 :                         m_xUndoManager );
     700           0 :                     RegressionCurveHelper::removeMeanValueLine( xRegCurveCnt );
     701           0 :                     bReturn = true;
     702           0 :                     aUndoGuard.commit();
     703           0 :                 }
     704             :             }
     705           0 :             break;
     706             : 
     707             :             case OBJECTTYPE_DATA_CURVE:
     708             :             {
     709           0 :                 bReturn = lcl_deleteDataCurve( aCID, getModel(), m_xUndoManager );
     710             :             }
     711           0 :             break;
     712             : 
     713             :             case OBJECTTYPE_DATA_CURVE_EQUATION:
     714             :             {
     715             :                 uno::Reference< beans::XPropertySet > xEqProp(
     716           0 :                     ObjectIdentifier::getObjectPropertySet( aCID, getModel()));
     717             : 
     718           0 :                 if( xEqProp.is())
     719             :                 {
     720           0 :                     uno::Reference< frame::XModel > xModel( getModel() );
     721             :                     // using assignment for broken gcc 3.3
     722             :                     UndoGuard aUndoGuard = UndoGuard(
     723             :                         ActionDescriptionProvider::createDescription(
     724             :                             ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_CURVE_EQUATION )),
     725           0 :                         m_xUndoManager );
     726             :                     {
     727           0 :                         ControllerLockGuardUNO aCtlLockGuard( xModel );
     728           0 :                         xEqProp->setPropertyValue( "ShowEquation", uno::makeAny( false ));
     729           0 :                         xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::makeAny( false ));
     730             :                     }
     731           0 :                     bReturn = true;
     732           0 :                     aUndoGuard.commit();
     733           0 :                 }
     734             :             }
     735           0 :             break;
     736             : 
     737             :             case OBJECTTYPE_DATA_ERRORS_X:
     738             :             case OBJECTTYPE_DATA_ERRORS_Y:
     739             :             case OBJECTTYPE_DATA_ERRORS_Z:
     740             :             {
     741             :                 uno::Reference< beans::XPropertySet > xErrorBarProp(
     742           0 :                     ObjectIdentifier::getObjectPropertySet( aCID, getModel() ));
     743           0 :                 if( xErrorBarProp.is())
     744             :                 {
     745             :                     sal_Int16 nId;
     746             : 
     747           0 :                     if ( aObjectType == OBJECTTYPE_DATA_ERRORS_X )
     748           0 :                         nId = STR_OBJECT_ERROR_BARS_X;
     749           0 :                     else if ( aObjectType == OBJECTTYPE_DATA_ERRORS_Y )
     750           0 :                         nId = STR_OBJECT_ERROR_BARS_Y;
     751             :                     else
     752           0 :                         nId = STR_OBJECT_ERROR_BARS_Z;
     753             : 
     754           0 :                     uno::Reference< frame::XModel > xModel( getModel() );
     755             :                     // using assignment for broken gcc 3.3
     756             :                     UndoGuard aUndoGuard = UndoGuard(
     757             :                         ActionDescriptionProvider::createDescription(
     758             :                             ActionDescriptionProvider::DELETE, SCH_RESSTR( nId )),
     759           0 :                         m_xUndoManager );
     760             :                     {
     761           0 :                         ControllerLockGuardUNO aCtlLockGuard( xModel );
     762           0 :                         xErrorBarProp->setPropertyValue(
     763             :                             "ErrorBarStyle",
     764           0 :                             uno::makeAny( ::com::sun::star::chart::ErrorBarStyle::NONE ));
     765             :                     }
     766           0 :                     bReturn = true;
     767           0 :                     aUndoGuard.commit();
     768             :                 }
     769           0 :                 break;
     770             :             }
     771             : 
     772             :             case OBJECTTYPE_DATA_LABELS:
     773             :             case OBJECTTYPE_DATA_LABEL:
     774             :             {
     775             :                 uno::Reference< beans::XPropertySet > xObjectProperties =
     776           0 :                     ObjectIdentifier::getObjectPropertySet( aCID, getModel() );
     777           0 :                 if( xObjectProperties.is() )
     778             :                 {
     779             :                     UndoGuard aUndoGuard = UndoGuard(
     780             :                         ActionDescriptionProvider::createDescription(
     781             :                         ActionDescriptionProvider::DELETE,
     782             :                             SCH_RESSTR( aObjectType == OBJECTTYPE_DATA_LABEL ? STR_OBJECT_LABEL : STR_OBJECT_DATALABELS )),
     783           0 :                                 m_xUndoManager );
     784           0 :                     chart2::DataPointLabel aLabel;
     785           0 :                     xObjectProperties->getPropertyValue( "Label" ) >>= aLabel;
     786           0 :                     aLabel.ShowNumber = false;
     787           0 :                     aLabel.ShowNumberInPercent = false;
     788           0 :                     aLabel.ShowCategoryName = false;
     789           0 :                     aLabel.ShowLegendSymbol = false;
     790           0 :                     if( aObjectType == OBJECTTYPE_DATA_LABELS )
     791             :                     {
     792           0 :                         uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( aCID, getModel() ));
     793           0 :                         ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "Label", uno::makeAny(aLabel) );
     794             :                     }
     795             :                     else
     796           0 :                         xObjectProperties->setPropertyValue( "Label", uno::makeAny(aLabel) );
     797           0 :                     bReturn = true;
     798           0 :                     aUndoGuard.commit();
     799             :                 }
     800           0 :                 break;
     801             :             }
     802             :             case OBJECTTYPE_AXIS:
     803             :             {
     804           0 :                 executeDispatch_DeleteAxis();
     805           0 :                 bReturn = true;
     806           0 :                 break;
     807             :             }
     808             :             case OBJECTTYPE_GRID:
     809             :             {
     810           0 :                 executeDispatch_DeleteMajorGrid();
     811           0 :                 bReturn = true;
     812           0 :                 break;
     813             :             }
     814             :             case OBJECTTYPE_SUBGRID:
     815             :             {
     816           0 :                 executeDispatch_DeleteMinorGrid();
     817           0 :                 bReturn = true;
     818           0 :                 break;
     819             :             }
     820             : 
     821             :             default:
     822             :             {
     823           0 :                 break;
     824             :             }
     825           0 :         }
     826             :     }
     827             :     else
     828             :     {
     829             :         //remove additional shape
     830           0 :         impl_ClearSelection();
     831             :         {
     832           0 :             SolarMutexGuard aSolarGuard;
     833           0 :             if ( m_pDrawViewWrapper )
     834             :             {
     835           0 :                 m_pDrawViewWrapper->DeleteMarked();
     836           0 :                 bReturn = true;
     837           0 :             }
     838             :         }
     839             :     }
     840           0 :     return bReturn;
     841             : }
     842             : 
     843           0 : void ChartController::executeDispatch_ToggleLegend()
     844             : {
     845           0 :     Reference< frame::XModel > xModel( getModel() );
     846             :     UndoGuard aUndoGuard = UndoGuard(
     847           0 :         SCH_RESSTR( STR_ACTION_TOGGLE_LEGEND ), m_xUndoManager );
     848           0 :     ChartModel* pModel = dynamic_cast<ChartModel*>(xModel.get());
     849           0 :     Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend( *pModel ), uno::UNO_QUERY );
     850           0 :     bool bChanged = false;
     851           0 :     if( xLegendProp.is())
     852             :     {
     853             :         try
     854             :         {
     855           0 :             bool bShow = false;
     856           0 :             if( xLegendProp->getPropertyValue( "Show") >>= bShow )
     857             :             {
     858           0 :                 xLegendProp->setPropertyValue( "Show", uno::makeAny( ! bShow ));
     859           0 :                 bChanged = true;
     860             :             }
     861             :         }
     862           0 :         catch( const uno::Exception & ex )
     863             :         {
     864             :             ASSERT_EXCEPTION( ex );
     865             :         }
     866             :     }
     867             :     else
     868             :     {
     869           0 :         xLegendProp.set( LegendHelper::getLegend( *pModel, m_xCC, true ), uno::UNO_QUERY );
     870           0 :         if( xLegendProp.is())
     871           0 :             bChanged = true;
     872             :     }
     873             : 
     874           0 :     if( bChanged )
     875           0 :         aUndoGuard.commit();
     876           0 : }
     877             : 
     878           0 : void ChartController::executeDispatch_ToggleGridHorizontal()
     879             : {
     880           0 :     Reference< frame::XModel > xModel( getModel() );
     881             :     UndoGuard aUndoGuard = UndoGuard(
     882           0 :         SCH_RESSTR( STR_ACTION_TOGGLE_GRID_HORZ ), m_xUndoManager );
     883           0 :     Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( getModel() ));
     884           0 :     if( xDiagram.is())
     885             :     {
     886           0 :         sal_Int32 nDimensionIndex = 1;
     887           0 :         sal_Int32 nCooSysIndex = 0;
     888             : 
     889           0 :         bool bHasMajorYGrid = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, true,  xDiagram );
     890           0 :         bool bHasMinorYGrid = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, false, xDiagram );
     891             : 
     892           0 :         if( bHasMajorYGrid )
     893             :         {
     894           0 :             if ( bHasMinorYGrid )
     895             :             {
     896           0 :                 AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, true,  xDiagram );
     897           0 :                 AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, false, xDiagram );
     898             :             }
     899             :             else
     900             :             {
     901           0 :                 AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, false, xDiagram, m_xCC );
     902             :             }
     903             :         }
     904             :         else
     905             :         {
     906           0 :             AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, true, xDiagram, m_xCC );
     907             :         }
     908           0 :         aUndoGuard.commit();
     909           0 :     }
     910           0 : }
     911             : 
     912           0 : void ChartController::executeDispatch_ToggleGridVertical()
     913             : {
     914           0 :     Reference< frame::XModel > xModel( getModel() );
     915             :     UndoGuard aUndoGuard = UndoGuard(
     916           0 :         SCH_RESSTR( STR_ACTION_TOGGLE_GRID_VERTICAL ), m_xUndoManager );
     917           0 :     Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( getModel() ));
     918           0 :     if( xDiagram.is())
     919             :     {
     920           0 :         sal_Int32 nDimensionIndex = 0;
     921           0 :         sal_Int32 nCooSysIndex = 0;
     922             : 
     923           0 :         bool bHasMajorXGrid = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, true,  xDiagram );
     924           0 :         bool bHasMinorXGrid = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, false, xDiagram );
     925           0 :         if( bHasMajorXGrid )
     926             :         {
     927           0 :             if (bHasMinorXGrid)
     928             :             {
     929           0 :                 AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, true,  xDiagram );
     930           0 :                 AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, false, xDiagram );
     931             :             }
     932             :             else
     933             :             {
     934           0 :                 AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, false, xDiagram, m_xCC );
     935             :             }
     936             :         }
     937             :         else
     938             :         {
     939           0 :             AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, true, xDiagram, m_xCC );
     940             :         }
     941             : 
     942           0 :         aUndoGuard.commit();
     943           0 :     }
     944           0 : }
     945             : 
     946           0 : void ChartController::impl_ShapeControllerDispatch( const util::URL& rURL, const Sequence< beans::PropertyValue >& rArgs )
     947             : {
     948           0 :     Reference< frame::XDispatch > xDispatch( m_aDispatchContainer.getShapeController() );
     949           0 :     if ( xDispatch.is() )
     950             :     {
     951           0 :         xDispatch->dispatch( rURL, rArgs );
     952           0 :     }
     953           0 : }
     954             : 
     955           0 : void ChartController::impl_switchDiagramPositioningToExcludingPositioning()
     956             : {
     957             :     UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
     958             :         ActionDescriptionProvider::POS_SIZE,
     959             :         ObjectNameProvider::getName( OBJECTTYPE_DIAGRAM)),
     960           0 :         m_xUndoManager );
     961           0 :     ChartModel* pModel = dynamic_cast<ChartModel*>(m_aModel->getModel().get());
     962           0 :     if( DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, true, true ) )
     963           0 :         aUndoGuard.commit();
     964           0 : }
     965             : 
     966             : } //  namespace chart
     967             : 
     968             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10