vbaworksheets.cxx (b3f79822) vbaworksheets.cxx (9f813b30)
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

--- 42 unchanged lines hidden (view full) ---

51#include "unonames.hxx"
52
53using namespace ::ooo::vba;
54using namespace ::com::sun::star;
55
56
57typedef ::cppu::WeakImplHelper1< container::XEnumeration > SheetEnumeration_BASE;
58typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > SheetCollectionHelper_BASE;
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

--- 42 unchanged lines hidden (view full) ---

51#include "unonames.hxx"
52
53using namespace ::ooo::vba;
54using namespace ::com::sun::star;
55
56
57typedef ::cppu::WeakImplHelper1< container::XEnumeration > SheetEnumeration_BASE;
58typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > SheetCollectionHelper_BASE;
59// a map ( or hashmap ) wont do as we need also to preserve the order
59// a map ( or hashmap ) won't do as we need also to preserve the order
60// (as added ) of the items
61typedef std::vector< uno::Reference< sheet::XSpreadsheet > > SheetMap;
62
63
64// #FIXME #TODO the implementation of the Sheets collections sucks,
65// e.g. there is no support for tracking sheets added/removed from the collection
66
67class WorkSheetsEnumeration : public SheetEnumeration_BASE

--- 83 unchanged lines hidden (view full) ---

151
152 virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
153 {
154 uno::Reference< sheet::XSpreadsheet > xSheet( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
155 uno::Reference< XHelperInterface > xIf = excel::getUnoSheetModuleObj( xSheet );
156 uno::Any aRet;
157 if ( !xIf.is() )
158 {
60// (as added ) of the items
61typedef std::vector< uno::Reference< sheet::XSpreadsheet > > SheetMap;
62
63
64// #FIXME #TODO the implementation of the Sheets collections sucks,
65// e.g. there is no support for tracking sheets added/removed from the collection
66
67class WorkSheetsEnumeration : public SheetEnumeration_BASE

--- 83 unchanged lines hidden (view full) ---

151
152 virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
153 {
154 uno::Reference< sheet::XSpreadsheet > xSheet( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
155 uno::Reference< XHelperInterface > xIf = excel::getUnoSheetModuleObj( xSheet );
156 uno::Any aRet;
157 if ( !xIf.is() )
158 {
159 // if the Sheet is in a document created by the api unfortunately ( at the
160 // moment, it actually wont have the special Document modules
159 // if the Sheet is in a document created by the api unfortunately (at the
160 // moment), it actually won't have the special Document modules
161 uno::Reference< excel::XWorksheet > xNewSheet( new ScVbaWorksheet( m_xParent, m_xContext, xSheet, m_xModel ) );
162 aRet <<= xNewSheet;
163 }
164 else
165 aRet <<= xIf;
166 return aRet;
167 }
168

--- 29 unchanged lines hidden (view full) ---

198uno::Any
199ScVbaWorksheets::createCollectionObject( const uno::Any& aSource )
200{
201 uno::Reference< sheet::XSpreadsheet > xSheet( aSource, uno::UNO_QUERY );
202 uno::Reference< XHelperInterface > xIf = excel::getUnoSheetModuleObj( xSheet );
203 uno::Any aRet;
204 if ( !xIf.is() )
205 {
161 uno::Reference< excel::XWorksheet > xNewSheet( new ScVbaWorksheet( m_xParent, m_xContext, xSheet, m_xModel ) );
162 aRet <<= xNewSheet;
163 }
164 else
165 aRet <<= xIf;
166 return aRet;
167 }
168

--- 29 unchanged lines hidden (view full) ---

198uno::Any
199ScVbaWorksheets::createCollectionObject( const uno::Any& aSource )
200{
201 uno::Reference< sheet::XSpreadsheet > xSheet( aSource, uno::UNO_QUERY );
202 uno::Reference< XHelperInterface > xIf = excel::getUnoSheetModuleObj( xSheet );
203 uno::Any aRet;
204 if ( !xIf.is() )
205 {
206 // if the Sheet is in a document created by the api unfortunately ( at the
207 // moment, it actually wont have the special Document modules
206 // if the Sheet is in a document created by the api unfortunately (at the
207 // moment), it actually won't have the special Document modules
208 uno::Reference< excel::XWorksheet > xNewSheet( new ScVbaWorksheet( getParent(), mxContext, xSheet, mxModel ) );
209 aRet <<= xNewSheet;
210 }
211 else
212 aRet <<= xIf;
213 return aRet;
214}
215

--- 265 unchanged lines hidden ---
208 uno::Reference< excel::XWorksheet > xNewSheet( new ScVbaWorksheet( getParent(), mxContext, xSheet, mxModel ) );
209 aRet <<= xNewSheet;
210 }
211 else
212 aRet <<= xIf;
213 return aRet;
214}
215

--- 265 unchanged lines hidden ---