diff options
Diffstat (limited to 'chart2/source/view/main/ChartView.cxx')
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 121 |
1 files changed, 118 insertions, 3 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 51504db2a396..0e954b7c7a85 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -71,6 +71,7 @@ // header for class Application #include <vcl/svapp.hxx> #include <vos/mutex.hxx> +#include <svx/unofill.hxx> #include <time.h> @@ -100,6 +101,7 @@ #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> #include <svl/languageoptions.hxx> #include <sot/clsids.hxx> @@ -2423,6 +2425,8 @@ void ChartView::createShapes() { // /-- ::vos::OGuard aSolarGuard( Application::GetSolarMutex()); + // #i12587# support for shapes in chart + m_pDrawModelWrapper->getSdrModel().EnableUndo( FALSE ); m_pDrawModelWrapper->clearMainDrawPage(); // \-- } @@ -2575,6 +2579,13 @@ void ChartView::createShapes() lcl_removeEmptyGroupShapes( xPageShapes ); } + // #i12587# support for shapes in chart + if ( m_pDrawModelWrapper ) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + m_pDrawModelWrapper->getSdrModel().EnableUndo( TRUE ); + } + #if OSL_DEBUG_LEVEL > 0 clock_t nEnd = clock(); double fDuration =(double(nEnd-nStart)*1000.0)/double(CLOCKS_PER_SEC); @@ -2597,6 +2608,12 @@ void ChartView::impl_updateView() if( !m_xChartModel.is() || !m_pDrawModelWrapper ) return; + // #i12587# support for shapes in chart + if ( m_bSdrViewIsInEditMode ) + { + return; + } + if( m_bViewDirty && !m_bInViewUpdate ) { m_bInViewUpdate = true; @@ -2611,7 +2628,6 @@ void ChartView::impl_updateView() // /-- ::vos::OGuard aSolarGuard( Application::GetSolarMutex()); m_pDrawModelWrapper->lockControllers(); - m_pDrawModelWrapper->updateTablesFromChartModel( m_xChartModel ); // \-- } @@ -2686,8 +2702,22 @@ void ChartView::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) //#i77362 change notification for changes on additional shapes are missing if( m_bInViewUpdate ) return; - if( m_bSdrViewIsInEditMode ) - return; + + // #i12587# support for shapes in chart + if ( m_bSdrViewIsInEditMode && m_xChartModel.is() ) + { + uno::Reference< view::XSelectionSupplier > xSelectionSupplier( m_xChartModel->getCurrentController(), uno::UNO_QUERY ); + if ( xSelectionSupplier.is() ) + { + ::rtl::OUString aSelObjCID; + uno::Any aSelObj( xSelectionSupplier->getSelection() ); + aSelObj >>= aSelObjCID; + if ( aSelObjCID.getLength() > 0 ) + { + return; + } + } + } const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >(&rHint); if( !pSdrHint ) @@ -2708,6 +2738,9 @@ void ChartView::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) case HINT_MODELCLEARED: bShapeChanged = true; break; + case HINT_ENDEDIT: + bShapeChanged = true; + break; default: break; } @@ -2879,6 +2912,88 @@ void SAL_CALL ChartView::removeVetoableChangeListener( const ::rtl::OUString& /* OSL_ENSURE(false,"not implemented"); } +// ____ XMultiServiceFactory ____ + +Reference< uno::XInterface > ChartView::createInstance( const ::rtl::OUString& aServiceSpecifier ) + throw (uno::Exception, uno::RuntimeException) +{ + SdrModel* pModel = ( m_pDrawModelWrapper ? &m_pDrawModelWrapper->getSdrModel() : NULL ); + if ( pModel ) + { + if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DashTable" ) ) == 0 ) + { + if ( !m_xDashTable.is() ) + { + m_xDashTable = SvxUnoDashTable_createInstance( pModel ); + } + return m_xDashTable; + } + else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.GradientTable" ) ) == 0 ) + { + if ( !m_xGradientTable.is() ) + { + m_xGradientTable = SvxUnoGradientTable_createInstance( pModel ); + } + return m_xGradientTable; + } + else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.HatchTable" ) ) == 0 ) + { + if ( !m_xHatchTable.is() ) + { + m_xHatchTable = SvxUnoHatchTable_createInstance( pModel ); + } + return m_xHatchTable; + } + else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.BitmapTable" ) ) == 0 ) + { + if ( !m_xBitmapTable.is() ) + { + m_xBitmapTable = SvxUnoBitmapTable_createInstance( pModel ); + } + return m_xBitmapTable; + } + else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.TransparencyGradientTable" ) ) == 0 ) + { + if ( !m_xTransGradientTable.is() ) + { + m_xTransGradientTable = SvxUnoTransGradientTable_createInstance( pModel ); + } + return m_xTransGradientTable; + } + else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.MarkerTable" ) ) == 0 ) + { + if ( !m_xMarkerTable.is() ) + { + m_xMarkerTable = SvxUnoMarkerTable_createInstance( pModel ); + } + return m_xMarkerTable; + } + } + + return 0; +} + +Reference< uno::XInterface > ChartView::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) + throw (uno::Exception, uno::RuntimeException) +{ + OSL_ENSURE( Arguments.getLength(), "ChartView::createInstanceWithArguments: arguments are ignored" ); + (void) Arguments; // avoid warning + return createInstance( ServiceSpecifier ); +} + +uno::Sequence< ::rtl::OUString > ChartView::getAvailableServiceNames() throw (uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString > aServiceNames( 6 ); + + aServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.DashTable" ) ); + aServiceNames[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GradientTable" ) ); + aServiceNames[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.HatchTable" ) ); + aServiceNames[3] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.BitmapTable" ) ); + aServiceNames[4] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.TransparencyGradientTable" ) ); + aServiceNames[5] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MarkerTable" ) ); + + return aServiceNames; +} //............................................................................. } //namespace chart |