summaryrefslogtreecommitdiff
path: root/chart2/source/tools/ChartViewHelper.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-05-22 17:56:25 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-05-22 17:56:25 +0000
commit03f900f9ba5be0ed4c98cbfed65f8e557ddcf69c (patch)
tree7874c6ef192f0ee39d0daf4e56c2bd5b4a256ed7 /chart2/source/tools/ChartViewHelper.cxx
parentfee77901acf77a077c88babeba6ee5432614a691 (diff)
INTEGRATION: CWS chart2mst3 (1.1.2); FILE ADDED
2007/02/08 21:25:42 iha 1.1.2.2: resync m195 -> m202 2006/03/12 01:29:28 iha 1.1.2.1: changed communication between model, view and controller; implemented old AddIn Interface; changed owneship and lifetime of view
Diffstat (limited to 'chart2/source/tools/ChartViewHelper.cxx')
-rw-r--r--chart2/source/tools/ChartViewHelper.cxx89
1 files changed, 89 insertions, 0 deletions
diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx
new file mode 100644
index 000000000000..e604e79ca43b
--- /dev/null
+++ b/chart2/source/tools/ChartViewHelper.cxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ChartViewHelper.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-05-22 18:56:25 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "ChartViewHelper.hxx"
+#include "macros.hxx"
+#include "servicenames.hxx"
+
+// header for define DBG_ASSERT
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
+#include <com/sun/star/lang/XComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XMODIFYLISTENER_HPP_
+#include <com/sun/star/util/XModifyListener.hpp>
+#endif
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using ::com::sun::star::uno::Reference;
+
+//static
+void ChartViewHelper::setViewToDirtyState( const uno::Reference< frame::XModel >& xChartModel )
+{
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFact( xChartModel, uno::UNO_QUERY );
+ if( xFact.is() )
+ {
+ Reference< util::XModifyListener > xModifyListener(
+ xFact->createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
+ if( xModifyListener.is() )
+ {
+ lang::EventObject aEvent( Reference< lang::XComponent >( xChartModel, uno::UNO_QUERY ) );
+ xModifyListener->modified( aEvent );
+ }
+ }
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+}
+//.............................................................................
+} //namespace chart
+//.............................................................................