1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_chart2.hxx" 26 27 #include "WeakListenerAdapter.hxx" 28 29 using namespace ::com::sun::star; 30 31 using ::com::sun::star::uno::Reference; 32 using ::com::sun::star::uno::Sequence; 33 using ::rtl::OUString; 34 35 namespace chart 36 { 37 WeakModifyListenerAdapter(const uno::WeakReference<util::XModifyListener> & xListener)38WeakModifyListenerAdapter::WeakModifyListenerAdapter( 39 const uno::WeakReference< util::XModifyListener > & xListener ) : 40 WeakListenerAdapter< ::com::sun::star::util::XModifyListener >( xListener ) 41 {} 42 ~WeakModifyListenerAdapter()43WeakModifyListenerAdapter::~WeakModifyListenerAdapter() 44 {} 45 modified(const lang::EventObject & aEvent)46void SAL_CALL WeakModifyListenerAdapter::modified( const lang::EventObject& aEvent ) 47 throw (uno::RuntimeException) 48 { 49 Reference< util::XModifyListener > xModListener( getListener() ); 50 if( xModListener.is()) 51 xModListener->modified( aEvent ); 52 } 53 54 // -------------------------------------------------------------------------------- 55 WeakSelectionChangeListenerAdapter(const Reference<view::XSelectionChangeListener> & xListener)56WeakSelectionChangeListenerAdapter::WeakSelectionChangeListenerAdapter( 57 const Reference< view::XSelectionChangeListener > & xListener ) : 58 WeakListenerAdapter< ::com::sun::star::view::XSelectionChangeListener >( xListener ) 59 {} 60 ~WeakSelectionChangeListenerAdapter()61WeakSelectionChangeListenerAdapter::~WeakSelectionChangeListenerAdapter() 62 {} 63 selectionChanged(const lang::EventObject & aEvent)64void SAL_CALL WeakSelectionChangeListenerAdapter::selectionChanged( const lang::EventObject& aEvent ) 65 throw (uno::RuntimeException) 66 { 67 Reference< view::XSelectionChangeListener > xSelChgListener( getListener() ); 68 if( xSelChgListener.is()) 69 xSelChgListener->selectionChanged( aEvent ); 70 } 71 72 } // namespace chart 73