diff options
-rw-r--r-- | chart2/source/controller/dialogs/TitleDialogData.cxx | 26 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx | 22 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/res_Titles.cxx | 30 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx | 7 | ||||
-rw-r--r-- | chart2/source/tools/AxisHelper.cxx | 19 |
5 files changed, 51 insertions, 53 deletions
diff --git a/chart2/source/controller/dialogs/TitleDialogData.cxx b/chart2/source/controller/dialogs/TitleDialogData.cxx index e4e9099011a6..eb4b1443aa1f 100644 --- a/chart2/source/controller/dialogs/TitleDialogData.cxx +++ b/chart2/source/controller/dialogs/TitleDialogData.cxx @@ -32,16 +32,11 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; TitleDialogData::TitleDialogData( std::unique_ptr<ReferenceSizeProvider> pRefSizeProvider ) - : aPossibilityList(7) - , aExistenceList(7) + : aPossibilityList{ true, true, true, true, true, true, true } + , aExistenceList{ false, false, false, false, false, false, false } , aTextList(7) , apReferenceSizeProvider( std::move(pRefSizeProvider) ) { - for (sal_Int32 i = 0; i < 7; i++) - { - aPossibilityList[i] = true; - aExistenceList[i] = false; - } } void TitleDialogData::readFromModel( const uno::Reference< frame::XModel>& xChartModel ) @@ -51,12 +46,15 @@ void TitleDialogData::readFromModel( const uno::Reference< frame::XModel>& xChar //get possibilities uno::Sequence< sal_Bool > aAxisPossibilityList; AxisHelper::getAxisOrGridPossibilities( aAxisPossibilityList, xDiagram ); - aPossibilityList[2]=aAxisPossibilityList[0];//x axis title - aPossibilityList[3]=aAxisPossibilityList[1];//y axis title - aPossibilityList[4]=aAxisPossibilityList[2];//z axis title - aPossibilityList[5]=aAxisPossibilityList[3];//secondary x axis title - aPossibilityList[6]=aAxisPossibilityList[4];//secondary y axis title + sal_Bool* pPossibilityList = aPossibilityList.getArray(); + pPossibilityList[2]=aAxisPossibilityList[0];//x axis title + pPossibilityList[3]=aAxisPossibilityList[1];//y axis title + pPossibilityList[4]=aAxisPossibilityList[2];//z axis title + pPossibilityList[5]=aAxisPossibilityList[3];//secondary x axis title + pPossibilityList[6]=aAxisPossibilityList[4];//secondary y axis title + sal_Bool* pExistenceList = aExistenceList.getArray(); + auto pTextList = aTextList.getArray(); //find out which title exists and get their text //main title: for( sal_Int32 nTitleIndex = static_cast< sal_Int32 >( TitleHelper::TITLE_BEGIN); @@ -65,8 +63,8 @@ void TitleDialogData::readFromModel( const uno::Reference< frame::XModel>& xChar { uno::Reference< XTitle > xTitle = TitleHelper::getTitle( static_cast< TitleHelper::eTitleType >( nTitleIndex ), xChartModel ); - aExistenceList[nTitleIndex] = xTitle.is(); - aTextList[nTitleIndex]=TitleHelper::getCompleteString( xTitle ); + pExistenceList[nTitleIndex] = xTitle.is(); + pTextList[nTitleIndex]=TitleHelper::getCompleteString( xTitle ); } } diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx index 3843263ad664..f20571e22f55 100644 --- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx @@ -23,14 +23,9 @@ namespace chart { InsertAxisOrGridDialogData::InsertAxisOrGridDialogData() - : aPossibilityList(6) - , aExistenceList(6) + : aPossibilityList{ true, true, true, true, true, true } + , aExistenceList{ false, false, false, false, false, false } { - sal_Int32 nN = 0; - for(nN=6;nN--;) - aPossibilityList[nN]=true; - for(nN=6;nN--;) - aExistenceList[nN]=false; } // SchAxisDlg @@ -74,12 +69,13 @@ SchAxisDlg::SchAxisDlg(weld::Window* pWindow, void SchAxisDlg::getResult( InsertAxisOrGridDialogData& rOutput ) { - rOutput.aExistenceList[0]=m_xCbPrimaryX->get_active(); - rOutput.aExistenceList[1]=m_xCbPrimaryY->get_active(); - rOutput.aExistenceList[2]=m_xCbPrimaryZ->get_active(); - rOutput.aExistenceList[3]=m_xCbSecondaryX->get_active(); - rOutput.aExistenceList[4]=m_xCbSecondaryY->get_active(); - rOutput.aExistenceList[5]=m_xCbSecondaryZ->get_active(); + sal_Bool* pExistenceList = rOutput.aExistenceList.getArray(); + pExistenceList[0]=m_xCbPrimaryX->get_active(); + pExistenceList[1]=m_xCbPrimaryY->get_active(); + pExistenceList[2]=m_xCbPrimaryZ->get_active(); + pExistenceList[3]=m_xCbSecondaryX->get_active(); + pExistenceList[4]=m_xCbSecondaryY->get_active(); + pExistenceList[5]=m_xCbSecondaryZ->get_active(); } SchGridDlg::SchGridDlg(weld::Window* pParent, const InsertAxisOrGridDialogData& rInput) diff --git a/chart2/source/controller/dialogs/res_Titles.cxx b/chart2/source/controller/dialogs/res_Titles.cxx index 7665e9ae4a5b..59b0f00b9b37 100644 --- a/chart2/source/controller/dialogs/res_Titles.cxx +++ b/chart2/source/controller/dialogs/res_Titles.cxx @@ -108,21 +108,23 @@ void TitleResources::writeToResources(const TitleDialogData& rInput) void TitleResources::readFromResources(TitleDialogData& rOutput) { - rOutput.aExistenceList[0] = !m_xEd_Main->get_text().isEmpty(); - rOutput.aExistenceList[1] = !m_xEd_Sub->get_text().isEmpty(); - rOutput.aExistenceList[2] = !m_xEd_XAxis->get_text().isEmpty(); - rOutput.aExistenceList[3] = !m_xEd_YAxis->get_text().isEmpty(); - rOutput.aExistenceList[4] = !m_xEd_ZAxis->get_text().isEmpty(); - rOutput.aExistenceList[5] = !m_xEd_SecondaryXAxis->get_text().isEmpty(); - rOutput.aExistenceList[6] = !m_xEd_SecondaryYAxis->get_text().isEmpty(); + sal_Bool* pExistenceList = rOutput.aExistenceList.getArray(); + pExistenceList[0] = !m_xEd_Main->get_text().isEmpty(); + pExistenceList[1] = !m_xEd_Sub->get_text().isEmpty(); + pExistenceList[2] = !m_xEd_XAxis->get_text().isEmpty(); + pExistenceList[3] = !m_xEd_YAxis->get_text().isEmpty(); + pExistenceList[4] = !m_xEd_ZAxis->get_text().isEmpty(); + pExistenceList[5] = !m_xEd_SecondaryXAxis->get_text().isEmpty(); + pExistenceList[6] = !m_xEd_SecondaryYAxis->get_text().isEmpty(); - rOutput.aTextList[0] = m_xEd_Main->get_text(); - rOutput.aTextList[1] = m_xEd_Sub->get_text(); - rOutput.aTextList[2] = m_xEd_XAxis->get_text(); - rOutput.aTextList[3] = m_xEd_YAxis->get_text(); - rOutput.aTextList[4] = m_xEd_ZAxis->get_text(); - rOutput.aTextList[5] = m_xEd_SecondaryXAxis->get_text(); - rOutput.aTextList[6] = m_xEd_SecondaryYAxis->get_text(); + auto pTextList = rOutput.aTextList.getArray(); + pTextList[0] = m_xEd_Main->get_text(); + pTextList[1] = m_xEd_Sub->get_text(); + pTextList[2] = m_xEd_XAxis->get_text(); + pTextList[3] = m_xEd_YAxis->get_text(); + pTextList[4] = m_xEd_ZAxis->get_text(); + pTextList[5] = m_xEd_SecondaryXAxis->get_text(); + pTextList[6] = m_xEd_SecondaryYAxis->get_text(); } } //namespace chart diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx index f99fd203b231..ac350d420459 100644 --- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx +++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx @@ -124,9 +124,10 @@ void TitlesAndObjectsTabPage::commitToModel() uno::Sequence< sal_Bool > aOldExistenceList; AxisHelper::getAxisOrGridExistence( aOldExistenceList, xDiagram, false ); uno::Sequence< sal_Bool > aNewExistenceList(aOldExistenceList); - aNewExistenceList[0] = m_xCB_Grid_X->get_active(); - aNewExistenceList[1] = m_xCB_Grid_Y->get_active(); - aNewExistenceList[2] = m_xCB_Grid_Z->get_active(); + sal_Bool* pNewExistenceList = aNewExistenceList.getArray(); + pNewExistenceList[0] = m_xCB_Grid_X->get_active(); + pNewExistenceList[1] = m_xCB_Grid_Y->get_active(); + pNewExistenceList[2] = m_xCB_Grid_Z->get_active(); AxisHelper::changeVisibilityOfGrids( xDiagram , aOldExistenceList, aNewExistenceList ); } diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 563f734142b1..4c6c5dd0e8cd 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -73,8 +73,7 @@ ScaleData AxisHelper::createDefaultScale() aScaleData.AxisType = chart2::AxisType::REALNUMBER; aScaleData.AutoDateAxis = true; aScaleData.ShiftedCategoryPosition = false; - Sequence< SubIncrement > aSubIncrements(1); - aSubIncrements[0] = SubIncrement(); + Sequence< SubIncrement > aSubIncrements{ SubIncrement() }; aScaleData.IncrementData.SubIncrements = aSubIncrements; return aScaleData; } @@ -886,6 +885,7 @@ void AxisHelper::getAxisOrGridPossibilities( Sequence< sal_Bool >& rPossibilityL , const Reference< XDiagram>& xDiagram, bool bAxis ) { rPossibilityList.realloc(6); + sal_Bool* pPossibilityList = rPossibilityList.getArray(); sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); @@ -893,12 +893,12 @@ void AxisHelper::getAxisOrGridPossibilities( Sequence< sal_Bool >& rPossibilityL sal_Int32 nIndex=0; Reference< XChartType > xChartType = DiagramHelper::getChartTypeByIndex( xDiagram, 0 ); for(nIndex=0;nIndex<3;nIndex++) - rPossibilityList[nIndex]=ChartTypeHelper::isSupportingMainAxis(xChartType,nDimensionCount,nIndex); + pPossibilityList[nIndex]=ChartTypeHelper::isSupportingMainAxis(xChartType,nDimensionCount,nIndex); for(nIndex=3;nIndex<6;nIndex++) if( bAxis ) - rPossibilityList[nIndex]=ChartTypeHelper::isSupportingSecondaryAxis(xChartType,nDimensionCount); + pPossibilityList[nIndex]=ChartTypeHelper::isSupportingSecondaryAxis(xChartType,nDimensionCount); else - rPossibilityList[nIndex] = rPossibilityList[nIndex-3]; + pPossibilityList[nIndex] = rPossibilityList[nIndex-3]; } bool AxisHelper::isSecondaryYAxisNeeded( const Reference< XCoordinateSystem >& xCooSys ) @@ -958,23 +958,24 @@ void AxisHelper::getAxisOrGridExistence( Sequence< sal_Bool >& rExistenceList , const Reference< XDiagram>& xDiagram, bool bAxis ) { rExistenceList.realloc(6); + sal_Bool* pExistenceList = rExistenceList.getArray(); if(bAxis) { sal_Int32 nN; for(nN=0;nN<3;nN++) - rExistenceList[nN] = AxisHelper::isAxisShown( nN, true, xDiagram ); + pExistenceList[nN] = AxisHelper::isAxisShown( nN, true, xDiagram ); for(nN=3;nN<6;nN++) - rExistenceList[nN] = AxisHelper::isAxisShown( nN%3, false, xDiagram ); + pExistenceList[nN] = AxisHelper::isAxisShown( nN%3, false, xDiagram ); } else { sal_Int32 nN; for(nN=0;nN<3;nN++) - rExistenceList[nN] = AxisHelper::isGridShown( nN, 0, true, xDiagram ); + pExistenceList[nN] = AxisHelper::isGridShown( nN, 0, true, xDiagram ); for(nN=3;nN<6;nN++) - rExistenceList[nN] = AxisHelper::isGridShown( nN%3, 0, false, xDiagram ); + pExistenceList[nN] = AxisHelper::isGridShown( nN%3, 0, false, xDiagram ); } } |