diff options
Diffstat (limited to 'chart2/source/controller/dialogs')
14 files changed, 186 insertions, 30 deletions
diff --git a/chart2/source/controller/dialogs/Bitmaps.hrc b/chart2/source/controller/dialogs/Bitmaps.hrc index 58b1d540cc1a..07ed2eeec0d5 100644 --- a/chart2/source/controller/dialogs/Bitmaps.hrc +++ b/chart2/source/controller/dialogs/Bitmaps.hrc @@ -34,23 +34,28 @@ #include <svtools/solar.hrc> #endif -// next free: 100 - #ifndef STD_MASKCOLOR #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } #endif //----------------------------------------------------------------------------- // chart types +// Images: #define IMG_TYPE_COLUMN (RID_APP_START + 1) #define IMG_TYPE_BAR (RID_APP_START + 2) #define IMG_TYPE_PIE (RID_APP_START + 3) -#define IMG_TYPE_LINE (RID_APP_START + 4) -#define IMG_TYPE_AREA (RID_APP_START + 5) -#define IMG_TYPE_NET (RID_APP_START + 6) -#define IMG_TYPE_STOCK (RID_APP_START + 7) -#define IMG_TYPE_COLUMN_LINE (RID_APP_START + 8) +#define IMG_TYPE_AREA (RID_APP_START + 4) +#define IMG_TYPE_LINE (RID_APP_START + 5) +#define IMG_TYPE_XY (RID_APP_START + 6) +#define IMG_TYPE_BUBBLE (RID_APP_START + 7) +#define IMG_TYPE_NET (RID_APP_START + 8) +#define IMG_TYPE_STOCK (RID_APP_START + 9) +#define IMG_TYPE_COLUMN_LINE (RID_APP_START + 10) + +//----------------------------------------------------------------------------- +//Chart Subtypes +// Bitmaps: //---------------------- // Column Chart Subtypes @@ -185,7 +190,13 @@ #define BMP_COLUMN_LINE (RID_APP_START + 86) #define BMP_COLUMN_LINE_STACKED (RID_APP_START + 87) +//---------------------- +// Bubble Chart Subtypes +#define BMP_BUBBLE_1 (RID_APP_START + 88) + //----------------------------------------------------------------------------- +//further Images: + //SchStatisticTabPage and SchDataStatisticsDlg part 1 #define BMP_INDICATE_BOTH_VERTI (RID_APP_START + 89) #define BMP_INDICATE_UP (RID_APP_START + 90) @@ -201,9 +212,8 @@ #define BMP_REGRESSION_EXP (RID_APP_START + 95) #define BMP_REGRESSION_POWER (RID_APP_START + 96) -//----------------------------------------------------------------------------- // hide-button for range-choosing -#define IMG_SELECTRANGE (RID_APP_START + 9) +#define IMG_SELECTRANGE (RID_APP_START + 100) // CHART_BITMAPS_HRC #endif diff --git a/chart2/source/controller/dialogs/Bitmaps.src b/chart2/source/controller/dialogs/Bitmaps.src index 2af607b6963c..35a897848fb1 100644 --- a/chart2/source/controller/dialogs/Bitmaps.src +++ b/chart2/source/controller/dialogs/Bitmaps.src @@ -49,6 +49,11 @@ Image IMG_TYPE_LINE ImageBitmap = Bitmap { File = "typepointline_16.png" ; }; MaskColor = STD_MASKCOLOR; }; +Image IMG_TYPE_XY +{ + ImageBitmap = Bitmap { File = "typexy_16.png" ; }; + MaskColor = STD_MASKCOLOR; +}; Image IMG_TYPE_AREA { ImageBitmap = Bitmap { File = "typearea_16.png" ; }; @@ -69,6 +74,15 @@ Image IMG_TYPE_COLUMN_LINE ImageBitmap = Bitmap { File = "typecolumnline_16.png" ; }; MaskColor = STD_MASKCOLOR; }; +Image IMG_TYPE_BUBBLE +{ + ImageBitmap = Bitmap { File = "typebubble_16.png" ; }; + MaskColor = STD_MASKCOLOR; +}; +Bitmap BMP_BUBBLE_1 +{ + File = "bubble_52x60.png" ; +}; Bitmap BMP_AREAS_2D { File = "areas_52x60.png" ; diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.hrc b/chart2/source/controller/dialogs/Bitmaps_HC.hrc index 0b65579973c5..84a23ba426bc 100644 --- a/chart2/source/controller/dialogs/Bitmaps_HC.hrc +++ b/chart2/source/controller/dialogs/Bitmaps_HC.hrc @@ -41,15 +41,22 @@ //----------------------------------------------------------------------------- // chart types +// Images: #define IMG_TYPE_COLUMN_HC (RID_SCH_START + 1) #define IMG_TYPE_BAR_HC (RID_SCH_START + 2) #define IMG_TYPE_PIE_HC (RID_SCH_START + 3) -#define IMG_TYPE_LINE_HC (RID_SCH_START + 4) -#define IMG_TYPE_AREA_HC (RID_SCH_START + 5) -#define IMG_TYPE_NET_HC (RID_SCH_START + 6) -#define IMG_TYPE_STOCK_HC (RID_SCH_START + 7) -#define IMG_TYPE_COLUMN_LINE_HC (RID_SCH_START + 8) +#define IMG_TYPE_AREA_HC (RID_SCH_START + 4) +#define IMG_TYPE_LINE_HC (RID_SCH_START + 5) +#define IMG_TYPE_XY_HC (RID_SCH_START + 6) +#define IMG_TYPE_BUBBLE_HC (RID_SCH_START + 7) +#define IMG_TYPE_NET_HC (RID_SCH_START + 8) +#define IMG_TYPE_STOCK_HC (RID_SCH_START + 9) +#define IMG_TYPE_COLUMN_LINE_HC (RID_SCH_START + 10) + +//----------------------------------------------------------------------------- +//Chart Subtypes +// Bitmaps: //---------------------- // Column Chart Subtypes @@ -183,7 +190,13 @@ #define BMP_COLUMN_LINE_HC (RID_SCH_START + 86) #define BMP_COLUMN_LINE_STACKED_HC (RID_SCH_START + 87) +//---------------------- +// Bubble Chart Subtypes +#define BMP_BUBBLE_1_HC (RID_SCH_START + 88) + //----------------------------------------------------------------------------- +//further Images: + //SchStatisticTabPage and SchDataStatisticsDlg part 1 #define BMP_INDICATE_BOTH_VERTI_HC (RID_SCH_START + 89) #define BMP_INDICATE_UP_HC (RID_SCH_START + 90) @@ -199,6 +212,5 @@ #define BMP_REGRESSION_EXP_HC (RID_SCH_START + 95) #define BMP_REGRESSION_POWER_HC (RID_SCH_START + 96) -//----------------------------------------------------------------------------- // hide-button for range-choosing -#define IMG_SELECTRANGE_HC (RID_SCH_START + 9) +#define IMG_SELECTRANGE_HC (RID_SCH_START + 100) diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.src b/chart2/source/controller/dialogs/Bitmaps_HC.src index 1e2fe5f4ba14..0fb7ef5e5a1a 100644 --- a/chart2/source/controller/dialogs/Bitmaps_HC.src +++ b/chart2/source/controller/dialogs/Bitmaps_HC.src @@ -49,6 +49,11 @@ Image IMG_TYPE_LINE_HC ImageBitmap = Bitmap { File = "typepointline_16.png" ; }; MaskColor = SC_HC_MASKCOLOR; }; +Image IMG_TYPE_XY_HC +{ + ImageBitmap = Bitmap { File = "typexy_16.png" ; }; + MaskColor = SC_HC_MASKCOLOR; +}; Image IMG_TYPE_AREA_HC { ImageBitmap = Bitmap { File = "typearea_16.png" ; }; @@ -69,6 +74,15 @@ Image IMG_TYPE_COLUMN_LINE_HC ImageBitmap = Bitmap { File = "typecolumnline_16.png" ; }; MaskColor = SC_HC_MASKCOLOR; }; +Image IMG_TYPE_BUBBLE_HC +{ + ImageBitmap = Bitmap { File = "typebubble_16.png" ; }; + MaskColor = SC_HC_MASKCOLOR; +}; +Bitmap BMP_BUBBLE_1_HC +{ + File = "bubble_52x60_h.png" ; +}; Bitmap BMP_AREAS_2D_HC { File = "areas_52x60_h.png" ; diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 79efe0b04919..de57e82e58da 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -808,7 +808,7 @@ String XYChartDialogController::getName() } Image XYChartDialogController::getImage( bool bIsHighContrast ) { - return SELECT_IMAGE( IMG_TYPE_LINE ); + return SELECT_IMAGE( IMG_TYPE_XY ); } const tTemplateServiceChartTypeParameterMap& XYChartDialogController::getTemplateMap() const { @@ -1238,6 +1238,40 @@ void CombiColumnLineChartDialogController::adjustParameterToSubType( ChartTypePa break; } } +//-------------------------------------------------------------------------- +BubbleChartDialogController::BubbleChartDialogController() +{ +} +BubbleChartDialogController::~BubbleChartDialogController() +{ +} +String BubbleChartDialogController::getName() +{ + return String( SchResId( STR_TYPE_BUBBLE )); +} +Image BubbleChartDialogController::getImage( bool bIsHighContrast ) +{ + return SELECT_IMAGE( IMG_TYPE_BUBBLE ); +} +const tTemplateServiceChartTypeParameterMap& BubbleChartDialogController::getTemplateMap() const +{ + static tTemplateServiceChartTypeParameterMap m_aTemplateMap = + tTemplateServiceChartTypeParameterMap + ( C2U( "com.sun.star.chart2.template.Bubble" ), ChartTypeParameter(1,true) ) ; + return m_aTemplateMap; +} +void BubbleChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, bool bIsHighContrast, const ChartTypeParameter& /*rParameter*/ ) +{ + rSubTypeList.Clear(); + rSubTypeList.InsertItem( 1, SELECT_BITMAP( BMP_BUBBLE_1 ) ); + + rSubTypeList.SetItemText( 1, String( SchResId( STR_BUBBLE_1 )) ); +} +void BubbleChartDialogController::adjustParameterToSubType( ChartTypeParameter& rParameter ) +{ + rParameter.b3DLook = false; + rParameter.eStackMode = GlobalStackMode_NONE; +} //............................................................................. } //namespace chart //............................................................................. diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx index 0f6c7a8ae2c0..cdbda807813f 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx @@ -301,6 +301,19 @@ private: MetricField* m_pMF_NumberOfLines; }; +class BubbleChartDialogController : public ChartTypeDialogController +{ +public: + BubbleChartDialogController(); + virtual ~BubbleChartDialogController(); + + virtual String getName(); + virtual Image getImage( bool bIsHighContrast ); + virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const; + virtual void fillSubTypeList( ValueSet& rSubTypeList, bool bIsHighContrast, const ChartTypeParameter& rParameter ); + virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ); +}; + //............................................................................. } //namespace chart //............................................................................. diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index cf61b88a63ac..0a9b58758de6 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -407,8 +407,7 @@ Image SeriesHeader::GetChartTypeImage( } else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_SCATTER )) { - // @todo: correct image for scatter chart type - aResult = SELECT_IMAGE( IMG_TYPE_LINE, bHC ); + aResult = SELECT_IMAGE( IMG_TYPE_XY, bHC ); } else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_PIE )) { @@ -423,6 +422,10 @@ Image SeriesHeader::GetChartTypeImage( // @todo: correct image for candle-stick type aResult = SELECT_IMAGE( IMG_TYPE_STOCK, bHC ); } + else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE )) + { + aResult = SELECT_IMAGE( IMG_TYPE_BUBBLE, bHC ); + } return aResult; } @@ -1068,6 +1071,7 @@ sal_Bool DataBrowser::IsTabAllowed( sal_Bool bForward ) const if( CellContainsNumbers( nRow, nCol )) { + m_aNumberEditField.UseInputStringForFormatting(); m_aNumberEditField.SetFormatKey( GetNumberFormatKey( nRow, nCol )); return m_rNumberEditController; } diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index e612edc0901b..1db67c6721af 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -41,6 +41,8 @@ #include "macros.hxx" #include "StatisticsHelper.hxx" #include "ContainerHelper.hxx" +#include "ChartTypeHelper.hxx" +#include "chartview/ExplicitValueProvider.hxx" #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> @@ -329,6 +331,8 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) Reference< chart2::XDataSeries > xSeries; if( static_cast< tDataColumnVector::size_type >( nAfterColumnIndex ) <= m_aColumns.size()) xSeries.set( m_aColumns[nAfterColumnIndex].m_xDataSeries ); + + sal_Int32 nSeriesNumberFormat = 0; if( xSeries.is()) { xChartType.set( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries )); @@ -337,6 +341,10 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) lcl_DataSeriesOfHeaderMatches( xSeries ))); if( aIt != m_aHeaders.end()) nStartCol = aIt->m_nEndColumn; + + Reference< beans::XPropertySet > xSeriesProps( xSeries, uno::UNO_QUERY ); + if( xSeriesProps.is() ) + xSeriesProps->getPropertyValue( C2U( "NumberFormat" )) >>= nSeriesNumberFormat; } else { @@ -404,6 +412,14 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) } } } + if( nSeriesNumberFormat != 0 ) + { + //give the new series the same number format as the former series especially for bubble charts thus the bubble size values can be edited with same format immidiately + Reference< beans::XPropertySet > xNewSeriesProps( xNewSeries, uno::UNO_QUERY ); + if( xNewSeriesProps.is() ) + xNewSeriesProps->setPropertyValue( C2U( "NumberFormat" ), uno::makeAny( nSeriesNumberFormat ) ); + } + updateFromModel(); } } @@ -724,11 +740,15 @@ void DataBrowserModel::updateFromModel() { Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW ); Sequence< Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes()); + sal_Int32 nXAxisNumberFormat = DataSeriesHelper::getNumberFormatKeyFromAxis( 0, aCooSysSeq[nCooSysIdx], 0, 0 ); + for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx ) { Reference< chart2::XDataSeriesContainer > xSeriesCnt( aChartTypes[nCTIdx], uno::UNO_QUERY ); if( xSeriesCnt.is()) { + rtl::OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( aChartTypes[nCTIdx] ); + Sequence< Reference< chart2::XDataSeries > > aSeries( xSeriesCnt->getDataSeries()); lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries )); for( lcl_tSharedSeqVec::const_iterator aIt( aSharedSequences.begin()); @@ -741,16 +761,15 @@ void DataBrowserModel::updateFromModel() // as the sequences are shared it should be ok to take the first series // @todo: dimension index 0 for x-values used here. This is just a guess. // Also, the axis index is 0, as there is usually only one x-axis - aSharedSequence.m_nNumberFormatKey = - DataSeriesHelper::getNumberFormatKeyFromAxis( - aSeries[0], aCooSysSeq[nCooSysIdx], 0, 0 ); + aSharedSequence.m_nNumberFormatKey = nXAxisNumberFormat; m_aColumns.push_back( aSharedSequence ); ++nHeaderStart; } for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aSeries.getLength(); ++nSeriesIdx ) { tDataColumnVector::size_type nStartColIndex = m_aColumns.size(); - Reference< chart2::data::XDataSource > xSource( aSeries[nSeriesIdx], uno::UNO_QUERY ); + Reference< chart2::XDataSeries > xSeries( aSeries[nSeriesIdx] ); + Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY ); if( xSource.is()) { Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeqs( xSource->getDataSequences()); @@ -768,9 +787,14 @@ void DataBrowserModel::updateFromModel() { sal_Int32 nSequenceNumberFormatKey = nYAxisNumberFormatKey; OUString aRole = lcl_getRole( aLSeqs[nSeqIdx] ); - if( aRole.equals( C2U( "values-x" ) ) ) - nSequenceNumberFormatKey = DataSeriesHelper::getNumberFormatKeyFromAxis( - aSeries[nSeriesIdx], aCooSysSeq[nCooSysIdx], 0, 0 ); + + if( aRole.equals( aRoleForDataLabelNumberFormat ) ) + { + nSequenceNumberFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( + Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ), xSeries, -1, xDiagram ); + } + else if( aRole.equals( C2U( "values-x" ) ) ) + nSequenceNumberFormatKey = nXAxisNumberFormat; if( ::std::find_if( aSharedSequences.begin(), aSharedSequences.end(), lcl_RepresentationsOfLSeqMatch( aLSeqs[nSeqIdx] )) == aSharedSequences.end()) diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 1a7e8675f5bc..69e693911c22 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -108,6 +108,7 @@ OUString lcl_ConvertRole( const OUString & rRoleString, bool bFromInternalToUI ) aTranslationMap[ C2U( "values-min" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_MIN ))); aTranslationMap[ C2U( "values-x" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_X ))); aTranslationMap[ C2U( "values-y" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_Y ))); + aTranslationMap[ C2U( "values-size" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_SIZE ))); } if( bFromInternalToUI ) @@ -155,6 +156,7 @@ void lcl_createRoleIndexMap( lcl_tRoleIndexMap & rOutMap ) rOutMap[ C2U( "values-min" ) ] = ++nIndex; rOutMap[ C2U( "values-max" ) ] = ++nIndex; rOutMap[ C2U( "values-last" ) ] = ++nIndex; + rOutMap[ C2U( "values-size" ) ] = ++nIndex; } struct lcl_DataSeriesContainerAppend : public diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 7ee4ae67761d..1ed974814ea7 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -109,7 +109,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal Sequence< Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() ); - rtl::OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last; + rtl::OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last, a_Size; double fValue = 0; uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY ); @@ -170,6 +170,12 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal sal_Int32 nNumberFormatKey = xDataSequence->getNumberFormatKeyByIndex( nPointIndex ); aY_Last = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged ); } + else if( aRole.equals(C2U("values-size")) ) + { + aData[nPointIndex]>>= fValue; + sal_Int32 nNumberFormatKey = xDataSequence->getNumberFormatKeyByIndex( nPointIndex ); + a_Size = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged ); + } } catch( uno::Exception& e ) { @@ -201,6 +207,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal lcl_addText( aRet, aSeparator, aY_Min ); lcl_addText( aRet, aSeparator, aY_Max ); lcl_addText( aRet, aSeparator, aY_Last ); + lcl_addText( aRet, aSeparator, a_Size ); return aRet; } diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src index b08fe754513f..3b384915f2d0 100644 --- a/chart2/source/controller/dialogs/Strings.src +++ b/chart2/source/controller/dialogs/Strings.src @@ -471,6 +471,11 @@ String STR_DATA_ROLE_Y Text [ en-US ] = "Y-Values" ; }; +String STR_DATA_ROLE_SIZE +{ + Text [ en-US ] = "Bubble Sizes" ; +}; + String STR_DATA_ROLE_X_ERROR { Text [ en-US ] = "X-Error-Bars" ; diff --git a/chart2/source/controller/dialogs/Strings_ChartTypes.src b/chart2/source/controller/dialogs/Strings_ChartTypes.src index 1e18f0e8724f..2234f04a3fcd 100644 --- a/chart2/source/controller/dialogs/Strings_ChartTypes.src +++ b/chart2/source/controller/dialogs/Strings_ChartTypes.src @@ -140,4 +140,13 @@ String STR_DEEP Text [ en-US ] = "Deep" ; }; //----------------------------------------------------------------------------- +String STR_TYPE_BUBBLE +{ + Text [ en-US ] = "Bubble" ; +}; +String STR_BUBBLE_1 +{ + Text [ en-US ] = "Bubble Chart" ; +}; +//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index a93711151ac1..c6129629a51a 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -215,6 +215,13 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState ); m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState); + if( rInAttrs.GetItemState(SCHATTR_DATADESCR_NO_PERCENTVALUE, TRUE, &pPoolItem) == SFX_ITEM_SET ) + { + bool bForbidPercentValue = (static_cast< const SfxBoolItem & >( rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE )).GetValue() ); + if( bForbidPercentValue ) + m_aCBPercent.Enable(false); + } + m_aDC_Dial.SetLinkedField( &m_aNF_Degrees ); } @@ -286,14 +293,14 @@ IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox ) void DataLabelResources::EnableControls() { - m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || m_aCBPercent.IsChecked() || m_aCBCategory.IsChecked() ); + m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || (m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled()) || m_aCBCategory.IsChecked() ); //enable separator { long nNumberOfCheckedLabelParts = 0; if( m_aCBNumber.IsChecked() ) ++nNumberOfCheckedLabelParts; - if( m_aCBPercent.IsChecked() ) + if( m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() ) ++nNumberOfCheckedLabelParts; if( m_aCBCategory.IsChecked() ) ++nNumberOfCheckedLabelParts; @@ -307,7 +314,7 @@ void DataLabelResources::EnableControls() } m_aPB_NumberFormatForValue.Enable( m_pNumberFormatter && m_aCBNumber.IsChecked() ); - m_aPB_NumberFormatForPercent.Enable( m_pNumberFormatter && m_aCBPercent.IsChecked() ); + m_aPB_NumberFormatForPercent.Enable( m_pNumberFormatter && m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() ); bool bEnableRotation = ( m_aCBNumber.IsChecked() || m_aCBPercent.IsChecked() || m_aCBCategory.IsChecked() ); m_aFL_Rotate.Enable( bEnableRotation ); diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index f60637af4c44..b2d64400ef98 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -862,6 +862,7 @@ ChartTypeTabPage::ChartTypeTabPage( Window* pParent m_aChartTypeDialogControllerList.push_back(new AreaChartDialogController() ); m_aChartTypeDialogControllerList.push_back(new LineChartDialogController() ); m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() ); + m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() ); m_aChartTypeDialogControllerList.push_back(new NetChartDialogController() ); m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() ); m_aChartTypeDialogControllerList.push_back(new CombiColumnLineChartDialogController() ); |