Kaydet (Commit) 7302c4f6 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Change series and trendline pop-up to support more trendlines.

Conflicts:
	chart2/source/controller/main/ChartController_Window.cxx

Change-Id: I70eb06d74670f54fa3792723711e9f73700f12ba
üst 01fc2a65
...@@ -1301,7 +1301,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType() ...@@ -1301,7 +1301,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType()
void SAL_CALL ChartController::executeDispatch_SourceData() void SAL_CALL ChartController::executeDispatch_SourceData()
{ {
git gr //convert properties to ItemSet //convert properties to ItemSet
uno::Reference< XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY ); uno::Reference< XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY );
OSL_ENSURE( xChartDoc.is(), "Invalid XChartDocument" ); OSL_ENSURE( xChartDoc.is(), "Invalid XChartDocument" );
if( !xChartDoc.is()) if( !xChartDoc.is())
......
...@@ -228,10 +228,13 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -228,10 +228,13 @@ const short HITPIX=2; //hit-tolerance in pixel
//----------------------------------------------------------------- //-----------------------------------------------------------------
// awt::XWindow // awt::XWindow
//----------------------------------------------------------------- //-----------------------------------------------------------------
void SAL_CALL ChartController void SAL_CALL ChartController::setPosSize(
::setPosSize( sal_Int32 X, sal_Int32 Y sal_Int32 X,
, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) sal_Int32 Y,
throw (uno::RuntimeException) sal_Int32 Width,
sal_Int32 Height,
sal_Int16 Flags )
throw (uno::RuntimeException)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -250,9 +253,11 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -250,9 +253,11 @@ const short HITPIX=2; //hit-tolerance in pixel
sal_Int32 nScaleXDenominator = aModelPageSize.Width; sal_Int32 nScaleXDenominator = aModelPageSize.Width;
sal_Int32 nScaleYNumerator = aLogicSize.Height(); sal_Int32 nScaleYNumerator = aLogicSize.Height();
sal_Int32 nScaleYDenominator = aModelPageSize.Height; sal_Int32 nScaleYDenominator = aModelPageSize.Height;
MapMode aNewMapMode( MAP_100TH_MM, Point(0,0) MapMode aNewMapMode(
, Fraction(nScaleXNumerator,nScaleXDenominator) MAP_100TH_MM,
, Fraction(nScaleYNumerator,nScaleYDenominator) ); Point(0,0),
Fraction(nScaleXNumerator, nScaleXDenominator),
Fraction(nScaleYNumerator, nScaleYDenominator) );
m_pChartWindow->SetMapMode(aNewMapMode); m_pChartWindow->SetMapMode(aNewMapMode);
m_pChartWindow->setPosSizePixel( X, Y, Width, Height, Flags ); m_pChartWindow->setPosSizePixel( X, Y, Width, Height, Flags );
...@@ -289,12 +294,11 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -289,12 +294,11 @@ const short HITPIX=2; //hit-tolerance in pixel
} }
} }
awt::Rectangle SAL_CALL ChartController awt::Rectangle SAL_CALL ChartController::getPosSize()
::getPosSize() throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
awt::Rectangle aRet(0,0,0,0); awt::Rectangle aRet(0, 0, 0, 0);
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
if(xWindow.is()) if(xWindow.is())
...@@ -303,9 +307,8 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -303,9 +307,8 @@ const short HITPIX=2; //hit-tolerance in pixel
return aRet; return aRet;
} }
void SAL_CALL ChartController void SAL_CALL ChartController::setVisible( sal_Bool Visible )
::setVisible( sal_Bool Visible ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -314,9 +317,8 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -314,9 +317,8 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->setVisible( Visible ); xWindow->setVisible( Visible );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::setEnable( sal_Bool Enable )
::setEnable( sal_Bool Enable ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -325,8 +327,8 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -325,8 +327,8 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->setEnable( Enable ); xWindow->setEnable( Enable );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::setFocus()
::setFocus() throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -335,10 +337,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -335,10 +337,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->setFocus(); xWindow->setFocus();
} }
void SAL_CALL ChartController void SAL_CALL ChartController::addWindowListener(
::addWindowListener( const uno::Reference< const uno::Reference< awt::XWindowListener >& xListener )
awt::XWindowListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -347,10 +348,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -347,10 +348,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->addWindowListener( xListener ); xWindow->addWindowListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::removeWindowListener(
::removeWindowListener( const uno::Reference< const uno::Reference< awt::XWindowListener >& xListener )
awt::XWindowListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -359,10 +359,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -359,10 +359,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->removeWindowListener( xListener ); xWindow->removeWindowListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::addFocusListener(
::addFocusListener( const uno::Reference< const uno::Reference< awt::XFocusListener >& xListener )
awt::XFocusListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -371,10 +370,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -371,10 +370,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->addFocusListener( xListener ); xWindow->addFocusListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::removeFocusListener(
::removeFocusListener( const uno::Reference< const uno::Reference< awt::XFocusListener >& xListener )
awt::XFocusListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -383,10 +381,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -383,10 +381,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->removeFocusListener( xListener ); xWindow->removeFocusListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::addKeyListener(
::addKeyListener( const uno::Reference< const uno::Reference< awt::XKeyListener >& xListener )
awt::XKeyListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -395,10 +392,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -395,10 +392,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->addKeyListener( xListener ); xWindow->addKeyListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::removeKeyListener(
::removeKeyListener( const uno::Reference< const uno::Reference< awt::XKeyListener >& xListener )
awt::XKeyListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -407,10 +403,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -407,10 +403,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->removeKeyListener( xListener ); xWindow->removeKeyListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::addMouseListener(
::addMouseListener( const uno::Reference< const uno::Reference< awt::XMouseListener >& xListener )
awt::XMouseListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -419,10 +414,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -419,10 +414,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->addMouseListener( xListener ); xWindow->addMouseListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::removeMouseListener(
::removeMouseListener( const uno::Reference< const uno::Reference< awt::XMouseListener >& xListener )
awt::XMouseListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -431,10 +425,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -431,10 +425,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->removeMouseListener( xListener ); xWindow->removeMouseListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::addMouseMotionListener(
::addMouseMotionListener( const uno::Reference< const uno::Reference< awt::XMouseMotionListener >& xListener )
awt::XMouseMotionListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -443,10 +436,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -443,10 +436,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->addMouseMotionListener( xListener ); xWindow->addMouseMotionListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::removeMouseMotionListener(
::removeMouseMotionListener( const uno::Reference< const uno::Reference< awt::XMouseMotionListener >& xListener )
awt::XMouseMotionListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -455,10 +447,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -455,10 +447,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->removeMouseMotionListener( xListener ); xWindow->removeMouseMotionListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::addPaintListener(
::addPaintListener( const uno::Reference< const uno::Reference< awt::XPaintListener >& xListener )
awt::XPaintListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -467,10 +458,9 @@ const short HITPIX=2; //hit-tolerance in pixel ...@@ -467,10 +458,9 @@ const short HITPIX=2; //hit-tolerance in pixel
xWindow->addPaintListener( xListener ); xWindow->addPaintListener( xListener );
} }
void SAL_CALL ChartController void SAL_CALL ChartController::removePaintListener(
::removePaintListener( const uno::Reference< const uno::Reference< awt::XPaintListener >& xListener )
awt::XPaintListener >& xListener ) throw (uno::RuntimeException)
throw (uno::RuntimeException)
{ {
//@todo //@todo
uno::Reference<awt::XWindow> xWindow = m_xViewWindow; uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
...@@ -506,7 +496,7 @@ void ChartController::execute_Paint( const Rectangle& rRect ) ...@@ -506,7 +496,7 @@ void ChartController::execute_Paint( const Rectangle& rRect )
uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
if( xProp.is() ) if( xProp.is() )
{ {
awt::Size aResolution(1000,1000); awt::Size aResolution(1000, 1000);
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if( m_pChartWindow ) if( m_pChartWindow )
...@@ -582,9 +572,12 @@ IMPL_LINK_NOARG(ChartController, DoubleClickWaitingHdl) ...@@ -582,9 +572,12 @@ IMPL_LINK_NOARG(ChartController, DoubleClickWaitingHdl)
if( m_pChartWindow ) if( m_pChartWindow )
{ {
Window::PointerState aPointerState( m_pChartWindow->GetPointerState() ); Window::PointerState aPointerState( m_pChartWindow->GetPointerState() );
MouseEvent aMouseEvent( aPointerState.maPos,1/*nClicks*/, MouseEvent aMouseEvent(
0/*nMode*/, static_cast< sal_uInt16 >( aPointerState.mnState )/*nButtons*/, aPointerState.maPos,
0/*nModifier*/ ); 1/*nClicks*/,
0/*nMode*/,
static_cast< sal_uInt16 >( aPointerState.mnState )/*nButtons*/,
0/*nModifier*/ );
impl_SetMousePointer( aMouseEvent ); impl_SetMousePointer( aMouseEvent );
} }
} }
...@@ -686,8 +679,11 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -686,8 +679,11 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
return; return;
} }
m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper m_aSelection.adaptSelectionToNewPos(
, rMEvt.IsRight(), m_bWaitingForDoubleClick ); aMPos,
pDrawViewWrapper,
rMEvt.IsRight(),
m_bWaitingForDoubleClick );
if( !m_aSelection.isRotateableObjectSelected( getModel() ) ) if( !m_aSelection.isRotateableObjectSelected( getModel() ) )
{ {
...@@ -698,7 +694,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -698,7 +694,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
m_aSelection.applySelection(pDrawViewWrapper); m_aSelection.applySelection(pDrawViewWrapper);
} }
if( m_aSelection.isDragableObjectSelected() if( m_aSelection.isDragableObjectSelected()
&& !rMEvt.IsRight() ) && !rMEvt.IsRight() )
{ {
//start drag //start drag
sal_uInt16 nDrgLog = (sal_uInt16)m_pChartWindow->PixelToLogic(Size(DRGPIX,0)).Width(); sal_uInt16 nDrgLog = (sal_uInt16)m_pChartWindow->PixelToLogic(Size(DRGPIX,0)).Width();
...@@ -758,12 +754,11 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt ) ...@@ -758,12 +754,11 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
impl_SetMousePointer( rMEvt ); impl_SetMousePointer( rMEvt );
} }
void ChartController::execute_Tracking( const TrackingEvent& /* rTEvt */ ) void ChartController::execute_Tracking( const TrackingEvent& /* rTEvt */ )
{ {
} }
//-----------------
void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
{ {
ControllerLockGuard aCLGuard( getModel() ); ControllerLockGuard aCLGuard( getModel() );
...@@ -970,10 +965,12 @@ void ChartController::execute_Resize() ...@@ -970,10 +965,12 @@ void ChartController::execute_Resize()
if(m_pChartWindow) if(m_pChartWindow)
m_pChartWindow->Invalidate(); m_pChartWindow->Invalidate();
} }
void ChartController::execute_Activate() void ChartController::execute_Activate()
{ {
///// pDrawViewWrapper->SetEditMode(sal_True); ///// pDrawViewWrapper->SetEditMode(sal_True);
} }
void ChartController::execute_Deactivate() void ChartController::execute_Deactivate()
{ {
/* /*
...@@ -981,9 +978,11 @@ void ChartController::execute_Deactivate() ...@@ -981,9 +978,11 @@ void ChartController::execute_Deactivate()
this->ReleaseMouse(); this->ReleaseMouse();
*/ */
} }
void ChartController::execute_GetFocus() void ChartController::execute_GetFocus()
{ {
} }
void ChartController::execute_LoseFocus() void ChartController::execute_LoseFocus()
{ {
//this->ReleaseMouse(); //this->ReleaseMouse();
...@@ -1130,9 +1129,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) ...@@ -1130,9 +1129,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
} }
if( bHasDataLabelsAtSeries ) if( bHasDataLabelsAtSeries )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataLabels" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatDataLabels" );
if( xTrendline.is() ) //if( xTrendline.is() )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendline" ); // lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendline" );
if( bHasEquation ) if( bHasEquation )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
if( xMeanValue.is() ) if( xMeanValue.is() )
...@@ -1145,11 +1144,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) ...@@ -1145,11 +1144,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
xPopupMenu->insertSeparator( -1 ); xPopupMenu->insertSeparator( -1 );
if( !bHasDataLabelsAtSeries ) if( !bHasDataLabelsAtSeries )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertDataLabels" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertDataLabels" );
if( !xTrendline.is() )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendline" ); //if( !xTrendline.is() )
else if( !bHasEquation ) lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendline" );
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquation" ); //else if( !bHasEquation )
//lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
if( !xMeanValue.is() ) if( !xMeanValue.is() )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMeanValue" ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMeanValue" );
if( !bHasXErrorBars ) if( !bHasXErrorBars )
...@@ -1159,9 +1160,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) ...@@ -1159,9 +1160,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) ) if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteDataLabels" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteDataLabels" );
if( xTrendline.is() ) //if( xTrendline.is() )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendline" ); // lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendline" );
if( bHasEquation ) if( bHasEquation )
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
if( xMeanValue.is() ) if( xMeanValue.is() )
...@@ -1192,12 +1193,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) ...@@ -1192,12 +1193,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
} }
else if( OBJECTTYPE_DATA_CURVE == eObjectType ) else if( OBJECTTYPE_DATA_CURVE == eObjectType )
{ {
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendline" );
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquation" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendlineEquation" );
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertR2Value" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertR2Value" );
lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" ); lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendlineEquation" );
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteR2Value" );
} }
else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType ) else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType )
{ {
......
...@@ -242,12 +242,12 @@ void ControllerState::update( ...@@ -242,12 +242,12 @@ void ControllerState::update(
if( xRegCurveCnt.is()) if( xRegCurveCnt.is())
{ {
uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ); uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
bMayFormatTrendline = bMayDeleteTrendline = xRegCurve.is(); // Trendline
bMayAddTrendline = true;
// Mean Value
bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt ); bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt );
bMayAddTrendline = ! bMayDeleteTrendline;
bMayAddMeanValue = ! bMayDeleteMeanValue; bMayAddMeanValue = ! bMayDeleteMeanValue;
bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
} }
} }
...@@ -275,8 +275,11 @@ void ControllerState::update( ...@@ -275,8 +275,11 @@ void ControllerState::update(
if( aObjectType == OBJECTTYPE_DATA_CURVE ) if( aObjectType == OBJECTTYPE_DATA_CURVE )
{ {
bMayFormatTrendline = true; bMayFormatTrendline = true;
bMayDeleteTrendline = true;
uno::Reference< chart2::XRegressionCurve > xRegCurve( uno::Reference< chart2::XRegressionCurve > xRegCurve(
ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY ); ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
// Trendline Equation
bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve ); bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation; bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
} }
...@@ -286,10 +289,10 @@ void ControllerState::update( ...@@ -286,10 +289,10 @@ void ControllerState::update(
bool bHasR2Value = false; bool bHasR2Value = false;
try try
{ {
uno::Reference< beans::XPropertySet > xEqProp( uno::Reference< beans::XPropertySet > xEquationProperties(
ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY ); ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
if( xEqProp.is()) if( xEquationProperties.is() )
xEqProp->getPropertyValue( "ShowCorrelationCoefficient" ) >>= bHasR2Value; xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient" ) >>= bHasR2Value;
} }
catch(const uno::RuntimeException& e) catch(const uno::RuntimeException& e)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment