summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx19
-rw-r--r--chart2/source/controller/dialogs/res_ErrorBar.cxx19
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.cxx26
-rw-r--r--chart2/source/controller/inc/res_ErrorBar.hxx1
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx23
-rw-r--r--chart2/source/tools/WrappedPropertySet.cxx14
6 files changed, 92 insertions, 10 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index fba67df65..8c3187234 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -160,7 +160,9 @@ enum
PROP_DOCUMENT_BASEDIAGRAM,
PROP_DOCUMENT_ADDITIONAL_SHAPES,
PROP_DOCUMENT_UPDATE_ADDIN,
- PROP_DOCUMENT_NULL_DATE
+ PROP_DOCUMENT_NULL_DATE,
+ PROP_DOCUMENT_DISABLE_COMPLEX_CHARTTYPES,
+ PROP_DOCUMENT_DISABLE_DATATABLE_DIALOG
};
void lcl_AddPropertiesToVector(
@@ -231,6 +233,19 @@ void lcl_AddPropertiesToVector(
PROP_DOCUMENT_NULL_DATE,
::getCppuType( static_cast< const ::com::sun::star::util::DateTime * >(0)),
beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
+ Property( C2U( "DisableComplexChartTypes" ),
+ PROP_DOCUMENT_DISABLE_COMPLEX_CHARTTYPES,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ) );
+ rOutProperties.push_back(
+ Property( C2U( "DisableDataTableDialog" ),
+ PROP_DOCUMENT_DISABLE_DATATABLE_DIALOG,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ) );
}
const uno::Sequence< Property > & lcl_GetPropertySequence()
@@ -1570,6 +1585,8 @@ const std::vector< WrappedProperty* > ChartDocumentWrapper::createWrappedPropert
aWrappedProperties.push_back( new WrappedAdditionalShapesProperty( *this ) );
aWrappedProperties.push_back( new WrappedRefreshAddInAllowedProperty( *this ) );
aWrappedProperties.push_back( new WrappedIgnoreProperty( C2U("NullDate"),Any() ) ); // i99104
+ aWrappedProperties.push_back( new WrappedIgnoreProperty( C2U( "DisableComplexChartTypes" ), uno::makeAny( sal_False ) ) );
+ aWrappedProperties.push_back( new WrappedIgnoreProperty( C2U( "DisableDataTableDialog" ), uno::makeAny( sal_False ) ) );
return aWrappedProperties;
}
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 482286ec8..7a1c337d2 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -37,6 +37,7 @@
#include "RangeSelectionHelper.hxx"
// for RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR
#include "TabPageNotifiable.hxx"
+#include "macros.hxx"
#include <rtl/math.hxx>
#include <vcl/dialog.hxx>
@@ -147,7 +148,8 @@ ErrorBarResources::ErrorBarResources( Window* pParent, Dialog * pParentDialog,
m_pParentWindow( pParent ),
m_pParentDialog( pParentDialog ),
m_pCurrentRangeChoosingField( 0 ),
- m_bHasInternalDataProvider( true )
+ m_bHasInternalDataProvider( true ),
+ m_bDisableDataTableDialog( false )
{
if( m_bNoneAvailable )
m_aRbNone.SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen ));
@@ -197,7 +199,21 @@ void ErrorBarResources::SetChartDocumentForRangeChoosing(
const uno::Reference< chart2::XChartDocument > & xChartDocument )
{
if( xChartDocument.is())
+ {
m_bHasInternalDataProvider = xChartDocument->hasInternalDataProvider();
+ uno::Reference< beans::XPropertySet > xProps( xChartDocument, uno::UNO_QUERY );
+ if ( xProps.is() )
+ {
+ try
+ {
+ xProps->getPropertyValue( C2U( "DisableDataTableDialog" ) ) >>= m_bDisableDataTableDialog;
+ }
+ catch( uno::Exception& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ }
+ }
m_apRangeSelectionHelper.reset( new RangeSelectionHelper( xChartDocument ));
// has internal data provider => rename "cell range" to "from data"
@@ -240,6 +256,7 @@ void ErrorBarResources::UpdateControlStates()
m_aLbFunction.Enable( bIsFunction );
// range buttons
+ m_aRbRange.Enable( !m_bHasInternalDataProvider || !m_bDisableDataTableDialog );
bool bShowRange = ( m_aRbRange.IsChecked());
bool bCanChooseRange =
( bShowRange &&
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 81a97b750..fbfc9cac9 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -853,15 +853,35 @@ ChartTypeTabPage::ChartTypeTabPage( Window* pParent
bool bIsHighContrast = ( true && GetSettings().GetStyleSettings().GetHighContrastMode() );
+ bool bDisableComplexChartTypes = false;
+ uno::Reference< beans::XPropertySet > xProps( m_xChartModel, uno::UNO_QUERY );
+ if ( xProps.is() )
+ {
+ try
+ {
+ xProps->getPropertyValue( C2U( "DisableComplexChartTypes" ) ) >>= bDisableComplexChartTypes;
+ }
+ catch( uno::Exception& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ }
+
m_aChartTypeDialogControllerList.push_back(new ColumnChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new BarChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new PieChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new AreaChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new LineChartDialogController() );
- m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() );
- m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() );
+ if ( !bDisableComplexChartTypes )
+ {
+ m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() );
+ m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() );
+ }
m_aChartTypeDialogControllerList.push_back(new NetChartDialogController() );
- m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() );
+ if ( !bDisableComplexChartTypes )
+ {
+ m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() );
+ }
m_aChartTypeDialogControllerList.push_back(new CombiColumnLineChartDialogController() );
::std::vector< ChartTypeDialogController* >::const_iterator aIter = m_aChartTypeDialogControllerList.begin();
diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx
index 94ed46178..f0007199c 100644
--- a/chart2/source/controller/inc/res_ErrorBar.hxx
+++ b/chart2/source/controller/inc/res_ErrorBar.hxx
@@ -135,6 +135,7 @@ private:
m_apRangeSelectionHelper;
Edit * m_pCurrentRangeChoosingField;
bool m_bHasInternalDataProvider;
+ bool m_bDisableDataTableDialog;
DECL_LINK( CategoryChosen, void * );
DECL_LINK( SynchronizePosAndNeg, void * );
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 3eef0396f..c62de3dfe 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -528,6 +528,23 @@ void ControllerCommandDispatch::updateCommandAvailability()
bool bShapeContext = ( m_pChartController ? m_pChartController->isShapeContext() : false );
+ bool bDisableDataTableDialog = false;
+ if ( m_xController.is() )
+ {
+ Reference< beans::XPropertySet > xProps( m_xController->getModel(), uno::UNO_QUERY );
+ if ( xProps.is() )
+ {
+ try
+ {
+ xProps->getPropertyValue( C2U( "DisableDataTableDialog" ) ) >>= bDisableDataTableDialog;
+ }
+ catch( uno::Exception& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ }
+ }
+
// edit commands
m_aCommandAvailability[ C2U(".uno:Cut")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsDeleteableObjectSelected;
m_aCommandAvailability[ C2U(".uno:Copy")] = bControllerStateIsValid && m_apControllerState->bHasSelectedObject;
@@ -595,7 +612,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
// depending on own data
m_aCommandAvailability[ C2U(".uno:DataRanges")] = bIsWritable && bModelStateIsValid && (! m_apModelState->bHasOwnData);
- m_aCommandAvailability[ C2U(".uno:DiagramData")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasOwnData;
+ m_aCommandAvailability[ C2U(".uno:DiagramData")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasOwnData && !bDisableDataTableDialog;
// titles
m_aCommandAvailability[ C2U(".uno:MainTitle")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainTitle;
@@ -631,9 +648,9 @@ void ControllerCommandDispatch::updateCommandAvailability()
// series arrangement
m_aCommandAvailability[ C2U(".uno:Forward")] = ( bShapeContext ? isShapeControllerCommandAvailable( C2U( ".uno:Forward" ) ) :
- ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward ) );
+ ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward && !bDisableDataTableDialog ) );
m_aCommandAvailability[ C2U(".uno:Backward")] = ( bShapeContext ? isShapeControllerCommandAvailable( C2U( ".uno:Backward" ) ) :
- ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward ) );
+ ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward && !bDisableDataTableDialog ) );
m_aCommandAvailability[ C2U(".uno:InsertDataLabels")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:InsertDataLabel")] = bIsWritable;
diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx
index 29db225d4..f66d16d0c 100644
--- a/chart2/source/tools/WrappedPropertySet.cxx
+++ b/chart2/source/tools/WrappedPropertySet.cxx
@@ -34,6 +34,8 @@
// header for define DELETEZ
#include <tools/solar.h>
+#include <tools/debug.hxx>
+
//.............................................................................
namespace chart
{
@@ -115,7 +117,11 @@ void SAL_CALL WrappedPropertySet::setPropertyValue( const OUString& rPropertyNam
else if( xInnerPropertySet.is() )
xInnerPropertySet->setPropertyValue( rPropertyName, rValue );
else
- throw beans::UnknownPropertyException();
+ {
+#if OSL_DEBUG_LEVEL > 1
+ DBG_ERROR("found no inner property set to map to");
+#endif
+ }
}
catch( beans::UnknownPropertyException& ex )
{
@@ -160,7 +166,11 @@ Any SAL_CALL WrappedPropertySet::getPropertyValue( const OUString& rPropertyName
else if( xInnerPropertySet.is() )
aRet = xInnerPropertySet->getPropertyValue( rPropertyName );
else
- throw beans::UnknownPropertyException();
+ {
+#if OSL_DEBUG_LEVEL > 1
+ DBG_ERROR("found no inner property set to map to");
+#endif
+ }
}
catch( beans::UnknownPropertyException& ex )
{