From c4fc6f85c50c08f6e493b04845603cdfbe1f4681 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 2 Jul 2010 16:17:22 +0200 Subject: [PATCH] calc56: #i112666# broken UNO API tests due to broken method XDiagram::setPosition() and wrongly flagged properties --- .../chartapiwrapper/ChartDocumentWrapper.cxx | 8 ++++---- .../controller/chartapiwrapper/DiagramWrapper.cxx | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index edf8ad2b6209..d6487d425657 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -239,14 +239,14 @@ void lcl_AddPropertiesToVector( Property( C2U( "DisableComplexChartTypes" ), PROP_DOCUMENT_DISABLE_COMPLEX_CHARTTYPES, ::getBooleanCppuType(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ) ); + //#i112666# no PropertyChangeEvent is fired on change so far + beans::PropertyAttribute::MAYBEDEFAULT ) ); rOutProperties.push_back( Property( C2U( "DisableDataTableDialog" ), PROP_DOCUMENT_DISABLE_DATATABLE_DIALOG, ::getBooleanCppuType(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ) ); + //#i112666# no PropertyChangeEvent is fired on change so far + beans::PropertyAttribute::MAYBEDEFAULT ) ); } const uno::Sequence< Property > & lcl_GetPropertySequence() diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index eb3c76dd2c40..c0be0ddcbf0d 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -749,20 +749,19 @@ void SAL_CALL DiagramWrapper::setPosition( const awt::Point& aPosition ) Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() ); if( xProp.is() ) { - if( aPosition.X < 0 || aPosition.Y < 0 || aPosition.X > 1 || aPosition.Y > 1 ) - { - DBG_ERROR("DiagramWrapper::setPosition called with a position out of range -> automatic values are taken instead" ); - uno::Any aEmpty; - xProp->setPropertyValue( C2U( "RelativePosition" ), aEmpty ); - return; - } - awt::Size aPageSize( m_spChart2ModelContact->GetPageSize() ); chart2::RelativePosition aRelativePosition; aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT; aRelativePosition.Primary = double(aPosition.X)/double(aPageSize.Width); aRelativePosition.Secondary = double(aPosition.Y)/double(aPageSize.Height); + if( aRelativePosition.Primary < 0 || aRelativePosition.Secondary < 0 || aRelativePosition.Primary > 1 || aRelativePosition.Secondary > 1 ) + { + DBG_ERROR("DiagramWrapper::setPosition called with a position out of range -> automatic values are taken instead" ); + uno::Any aEmpty; + xProp->setPropertyValue( C2U( "RelativePosition" ), aEmpty ); + return; + } xProp->setPropertyValue( C2U( "RelativePosition" ), uno::makeAny(aRelativePosition) ); xProp->setPropertyValue( C2U( "PosSizeExcludeAxes" ), uno::makeAny(false) ); }