From 23f6a9d5f7ca9af7bf01492e962daa2e2381fdda Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Wed, 26 Aug 2009 12:47:18 +0000 Subject: CWS-TOOLING: integrate CWS chart40 2009-08-05 10:28:53 +0200 iha r274640 : CWS-TOOLING: rebase CWS chart40 to trunk@274622 (milestone: DEV300:m54) 2009-07-31 18:03:11 +0200 iha r274546 : #i91420# number of lines on chart type dialog is incorrect 2009-07-23 15:51:13 +0200 iha r274275 : correct detection of old chart files b6700820 2009-07-23 15:10:30 +0200 iha r274273 : #i103287# some lines vanish on import of some old files (opacity-problem) 2009-07-23 13:42:10 +0200 iha r274268 : #i103588# Chart in report cause crash 2009-07-23 10:57:14 +0200 iha r274264 : #i95503# Enter key does not work in source ranges dialog 2009-07-22 10:25:02 +0200 iha r274221 : #i103713# ambiguous && || 2009-07-20 12:59:02 +0200 iha r274120 : #i103468# remove warning --- .../source/controller/dialogs/dlg_DataSource.cxx | 13 ++++++++++++ chart2/source/controller/dialogs/tp_ChartType.cxx | 3 ++- chart2/source/controller/dialogs/tp_DataSource.cxx | 23 ++++++++++++++++++++++ chart2/source/controller/dialogs/tp_DataSource.hxx | 7 +++++++ .../source/controller/dialogs/tp_RangeChooser.cxx | 23 ++++++++++++++++++++++ .../source/controller/dialogs/tp_RangeChooser.hxx | 6 ++++++ chart2/source/controller/inc/dlg_DataSource.hxx | 3 +++ chart2/source/view/charttypes/BubbleChart.cxx | 4 ++-- chart2/source/view/main/VDataSeries.cxx | 2 +- 9 files changed, 80 insertions(+), 4 deletions(-) diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx index fe2165c07..dc18673d1 100644 --- a/chart2/source/controller/dialogs/dlg_DataSource.cxx +++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx @@ -202,6 +202,19 @@ DataSourceDialog::~DataSourceDialog() delete m_pTabControl; } +short DataSourceDialog::Execute() +{ + short nResult = TabDialog::Execute(); + if( nResult == RET_OK ) + { + if( m_pRangeChooserTabePage ) + m_pRangeChooserTabePage->commitPage(); + if( m_pDataSourceTabPage ) + m_pDataSourceTabPage->commitPage(); + } + return nResult; +} + void DataSourceDialog::setInvalidPage( TabPage * pTabPage ) { if( pTabPage == m_pRangeChooserTabePage ) diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 0acd696dc..4af112eb7 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -995,7 +995,8 @@ IMPL_LINK( ChartTypeTabPage, SelectMainTypeHdl, void *, EMPTYARG ) aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel ); this->fillAllControls( aParameter ); - m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel); + uno::Reference< beans::XPropertySet > xTemplateProps( this->getCurrentTemplate(), uno::UNO_QUERY ); + m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps); } return 0; } diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 7466acdd5..b1703e491 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -377,6 +377,29 @@ void DataSourceTabPage::initializePage() { } +void DataSourceTabPage::DeactivatePage() +{ + commitPage(); + svt::OWizardPage::DeactivatePage(); +} + +void DataSourceTabPage::commitPage() +{ + commitPage(eFinish); +} + +sal_Bool DataSourceTabPage::commitPage( CommitPageReason /*eReason*/ ) +{ + //ranges may have been edited in the meanwhile (dirty is true in that case here) + if( isValid() ) + { + updateModelFromControl( 0 /*update all*/ ); + return sal_True;//return false if this page should not be left + } + else + return sal_False; +} + bool DataSourceTabPage::isRangeFieldContentValid( Edit & rEdit ) { OUString aRange( rEdit.GetText()); diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx index 5e9070723..1fe223a2c 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.hxx +++ b/chart2/source/controller/dialogs/tp_DataSource.hxx @@ -87,8 +87,15 @@ public: bool bHideDescription = false ); virtual ~DataSourceTabPage(); + void commitPage(); + +protected: // OWizardPage virtual void ActivatePage(); + virtual sal_Bool commitPage( CommitPageReason eReason ); + + //TabPage + virtual void DeactivatePage(); virtual void initializePage(); diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx index 66329e692..306114923 100644 --- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx +++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx @@ -216,6 +216,29 @@ void RangeChooserTabPage::initControlsFromModel() m_nChangingControlCalls--; } +void RangeChooserTabPage::DeactivatePage() +{ + commitPage(); + svt::OWizardPage::DeactivatePage(); +} + +void RangeChooserTabPage::commitPage() +{ + commitPage(eFinish); +} + +sal_Bool RangeChooserTabPage::commitPage( CommitPageReason /*eReason*/ ) +{ + //ranges may have been edited in the meanwhile (dirty is true in that case here) + if( isValid() ) + { + changeDialogModelAccordingToControls(); + return sal_True;//return false if this page should not be left + } + else + return sal_False; +} + void RangeChooserTabPage::changeDialogModelAccordingToControls() { if(m_nChangingControlCalls>0) diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.hxx b/chart2/source/controller/dialogs/tp_RangeChooser.hxx index 1c3162828..4ede2c67d 100644 --- a/chart2/source/controller/dialogs/tp_RangeChooser.hxx +++ b/chart2/source/controller/dialogs/tp_RangeChooser.hxx @@ -70,10 +70,16 @@ virtual ~RangeChooserTabPage(); virtual void listeningFinished( const ::rtl::OUString & rNewRange ); virtual void disposingRangeSelection(); + void commitPage(); + protected: //methods //OWizardPage virtual void ActivatePage(); + virtual sal_Bool commitPage( CommitPageReason eReason ); + + //TabPage + virtual void DeactivatePage(); void initControlsFromModel(); void changeDialogModelAccordingToControls(); diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx index 393588e31..a0492f2c4 100644 --- a/chart2/source/controller/inc/dlg_DataSource.hxx +++ b/chart2/source/controller/inc/dlg_DataSource.hxx @@ -68,6 +68,9 @@ public: ::com::sun::star::uno::XComponentContext > & xContext ); virtual ~DataSourceDialog(); + // from Dialog (base of TabDialog) + virtual short Execute(); + // TabPageNotifiable virtual void setInvalidPage( TabPage * pTabPage ); virtual void setValidPage( TabPage * pTabPage ); diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx index 730828ab9..0189689b7 100644 --- a/chart2/source/view/charttypes/BubbleChart.cxx +++ b/chart2/source/view/charttypes/BubbleChart.cxx @@ -111,7 +111,7 @@ void BubbleChart::calculateMaximumLogicBubbleSize() double fSize = pSeries->getBubble_Size( nIndex ); if( m_bShowNegativeValues ) - fSize = abs(fSize); + fSize = fabs(fSize); if( fSize > fMaxSize ) fMaxSize = fSize; } @@ -146,7 +146,7 @@ drawing::Direction3D BubbleChart::transformToScreenBubbleSize( double fLogicSize return aRet; if( m_bShowNegativeValues ) - fLogicSize = abs(fLogicSize); + fLogicSize = fabs(fLogicSize); double fMaxSize = m_fMaxLogicBubbleSize; diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 0628f09e9..8f7f0a5e8 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -151,7 +151,7 @@ void lcl_clearIfNoValuesButTextIsContained( VDataSequence& rData, const uno::Ref void lcl_maybeReplaceNanWithZero( double& rfValue, sal_Int32 nMissingValueTreatment ) { if( nMissingValueTreatment == ::com::sun::star::chart::MissingValueTreatment::USE_ZERO - && ::rtl::math::isNan(rfValue) || ::rtl::math::isInf(rfValue) ) + && (::rtl::math::isNan(rfValue) || ::rtl::math::isInf(rfValue)) ) rfValue = 0.0; } -- cgit v1.2.3