From 9540e9edc0a170e37fc641754b299f4ed0836d67 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Mon, 11 Jun 2007 14:01:42 +0000 Subject: [PATCH] INTEGRATION: CWS chart05 (1.9.2); FILE MERGED 2007/05/25 15:59:11 iha 1.9.2.1: #i71557# Highlight used cell ranges automatically --- chart2/source/tools/ChartModelHelper.cxx | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx index 98855e0baf2f..8b726c450366 100644 --- a/chart2/source/tools/ChartModelHelper.cxx +++ b/chart2/source/tools/ChartModelHelper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: ChartModelHelper.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: vg $ $Date: 2007-05-22 18:56:01 $ + * last change: $Author: obo $ $Date: 2007-06-11 15:01:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -39,6 +39,9 @@ #include "macros.hxx" #include "DiagramHelper.hxx" +#ifndef _COM_SUN_STAR_CHART2_DATA_XDATARECEIVER_HPP_ +#include +#endif #ifndef _COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ #include #endif @@ -58,6 +61,9 @@ #ifndef _COM_SUN_STAR_EMBED_XVISUALOBJECT_HPP_ #include #endif +#ifndef _COM_SUN_STAR_VIEW_XSELECTIONCHANGELISTENER_HPP_ +#include +#endif // header for define DBG_ASSERT #ifndef _TOOLS_DEBUG_HXX @@ -149,6 +155,21 @@ void ChartModelHelper::setPageSize( const awt::Size& rSize, const uno::Reference xVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, rSize ); } +void ChartModelHelper::triggerRangeHighlighting( const uno::Reference< frame::XModel >& xModel ) +{ + uno::Reference< chart2::data::XDataReceiver > xDataReceiver( xModel, uno::UNO_QUERY ); + if( xDataReceiver.is() ) + { + uno::Reference< view::XSelectionChangeListener > xSelectionChangeListener( xDataReceiver->getRangeHighlighter(), uno::UNO_QUERY ); + //trigger selection of cell range + if( xSelectionChangeListener.is() ) + { + lang::EventObject aEvent( xSelectionChangeListener ); + xSelectionChangeListener->selectionChanged( aEvent ); + } + } +} + //............................................................................. } //namespace chart //.............................................................................