1 diff --git oovbaapi/ooo/vba/excel/XVPageBreak.idl oovbaapi/ooo/vba/excel/XVPageBreak.idl
5 +++ oovbaapi/ooo/vba/excel/XVPageBreak.idl
7 +/*************************************************************************
9 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
11 + * Copyright 2008 by Sun Microsystems, Inc.
13 + * OpenOffice.org - a multi-platform office productivity suite
15 + * $RCSfile: XVPageBreak.idl,v $
18 + * This file is part of OpenOffice.org.
20 + * OpenOffice.org is free software: you can redistribute it and/or modify
21 + * it under the terms of the GNU Lesser General Public License version 3
22 + * only, as published by the Free Software Foundation.
24 + * OpenOffice.org is distributed in the hope that it will be useful,
25 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 + * GNU Lesser General Public License version 3 for more details
28 + * (a copy is included in the LICENSE file that accompanied this code).
30 + * You should have received a copy of the GNU Lesser General Public License
31 + * version 3 along with OpenOffice.org. If not, see
32 + * <http://www.openoffice.org/license.html>
33 + * for a copy of the LGPLv3 License.
35 + ************************************************************************/
36 +#ifndef __ooo_vba_excel_XVPageBreak_idl__
37 +#define __ooo_vba_excel_XVPageBreak_idl__
39 +#ifndef __ooo_vba_excel_XPageBreak_idl__
40 +#include <ooo/vba/excel/XPageBreak.idl>
43 +//=============================================================================
45 +module ooo { module vba { module excel {
47 +//=============================================================================
49 +interface XVPageBreak
51 + interface ::ooo::vba::excel::XPageBreak;
54 +//=============================================================================
61 diff --git oovbaapi/ooo/vba/excel/XVPageBreaks.idl oovbaapi/ooo/vba/excel/XVPageBreaks.idl
63 index 0000000..91501db
65 +++ oovbaapi/ooo/vba/excel/XVPageBreaks.idl
67 +/*************************************************************************
69 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
71 + * Copyright 2008 by Sun Microsystems, Inc.
73 + * OpenOffice.org - a multi-platform office productivity suite
75 + * $RCSfile: XVPageBreaks.idl,v $
78 + * This file is part of OpenOffice.org.
80 + * OpenOffice.org is free software: you can redistribute it and/or modify
81 + * it under the terms of the GNU Lesser General Public License version 3
82 + * only, as published by the Free Software Foundation.
84 + * OpenOffice.org is distributed in the hope that it will be useful,
85 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
86 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87 + * GNU Lesser General Public License version 3 for more details
88 + * (a copy is included in the LICENSE file that accompanied this code).
90 + * You should have received a copy of the GNU Lesser General Public License
91 + * version 3 along with OpenOffice.org. If not, see
92 + * <http://www.openoffice.org/license.html>
93 + * for a copy of the LGPLv3 License.
95 + ************************************************************************/
96 +#ifndef __ooo_vba_excel_XVPageBreaks_idl__
97 +#define __ooo_vba_excel_XVPageBreaks_idl__
99 +#ifndef __com_sun_star_uno_XInterface_idl__
100 +#include <com/sun/star/uno/XInterface.idl>
103 +#ifndef __ooo_vba_XHelperInterface_idl__
104 +#include <ooo/vba/XHelperInterface.idl>
107 +#ifndef __com_sun_star_helper_script_BasicErrorException_idl__
108 +#include <com/sun/star/script/BasicErrorException.idl>
111 +#ifndef __ooo_vba_XCollection_idl__
112 +#include <ooo/vba/XCollection.idl>
115 +//=============================================================================
117 +module ooo { module vba { module excel {
119 +//=============================================================================
121 +//interface XVPageBreak;
123 +interface XVPageBreaks
125 + interface ooo::vba::XCollection;
128 + any Add( [in] any Before ) raises( com::sun::star::script::BasicErrorException );
131 +//=============================================================================
138 diff --git oovbaapi/ooo/vba/excel/XWorksheet.idl oovbaapi/ooo/vba/excel/XWorksheet.idl
139 index 03d2cc3..9e9b803 100644
140 --- oovbaapi/ooo/vba/excel/XWorksheet.idl
141 +++ oovbaapi/ooo/vba/excel/XWorksheet.idl
142 @@ -56,6 +56,7 @@ interface XRange;
144 interface XPageSetup;
145 interface XHPageBreaks;
146 +interface XVPageBreaks;
149 interface ::ooo::vba::XHelperInterface;
150 @@ -92,6 +93,7 @@ interface XWorksheet
152 XPageSetup PageSetup();
153 any HPageBreaks([in] any Index);
154 + any VPageBreaks([in] any Index);
155 any OLEObjects([in] any Index);
157 any Shapes([in] any Index);
158 diff --git oovbaapi/ooo/vba/excel/makefile.mk oovbaapi/ooo/vba/excel/makefile.mk
159 index 59333bf..2170810 100644
160 --- oovbaapi/ooo/vba/excel/makefile.mk
161 +++ oovbaapi/ooo/vba/excel/makefile.mk
162 @@ -98,6 +98,8 @@ IDLFILES= XApplication.idl\
170 # ------------------------------------------------------------------
171 diff --git sc/source/ui/vba/vbapagebreak.cxx sc/source/ui/vba/vbapagebreak.cxx
174 index 581e5bd..13ad8b5
175 --- sc/source/ui/vba/vbapagebreak.cxx
176 +++ sc/source/ui/vba/vbapagebreak.cxx
177 @@ -139,3 +139,37 @@ ScVbaHPageBreak::getServiceNames()
178 return aServiceNames;
181 +template class ScVbaPageBreak< excel::XVPageBreak >;
183 +/* class ScVbaVPageBreak */
184 +ScVbaVPageBreak::ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent,
185 + const css::uno::Reference< css::uno::XComponentContext >& xContext,
186 + css::uno::Reference< css::beans::XPropertySet >& xProps,
187 + css::sheet::TablePageBreakData aTablePageBreakData ) throw ( css::uno::RuntimeException )
188 +: ScVbaVPageBreak_BASE( xParent, xContext, xProps, aTablePageBreakData )
192 +ScVbaVPageBreak::~ScVbaVPageBreak()
197 +ScVbaVPageBreak::getServiceImplName()
199 + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaVPageBreak") );
203 +uno::Sequence< rtl::OUString >
204 +ScVbaVPageBreak::getServiceNames()
206 + static uno::Sequence< rtl::OUString > aServiceNames;
207 + if ( aServiceNames.getLength() == 0 )
209 + aServiceNames.realloc( 1 );
210 + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.VPageBreak" ) );
212 + return aServiceNames;
215 diff --git sc/source/ui/vba/vbapagebreak.hxx sc/source/ui/vba/vbapagebreak.hxx
218 index a07cfda..04c8702
219 --- sc/source/ui/vba/vbapagebreak.hxx
220 +++ sc/source/ui/vba/vbapagebreak.hxx
222 #include <cppuhelper/implbase1.hxx>
223 #include <ooo/vba/excel/XPageBreak.hpp>
224 #include <ooo/vba/excel/XHPageBreak.hpp>
225 +#include <ooo/vba/excel/XVPageBreak.hpp>
226 #include <ooo/vba/excel/XRange.hpp>
227 #include <com/sun/star/uno/XComponentContext.hpp>
228 #include <com/sun/star/script/BasicErrorException.hpp>
229 @@ -84,4 +85,22 @@ public:
230 virtual css::uno::Sequence<rtl::OUString> getServiceNames();
234 +typedef ScVbaPageBreak < ov::excel::XVPageBreak > ScVbaVPageBreak_BASE;
236 +class ScVbaVPageBreak : public ScVbaVPageBreak_BASE
239 + ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent,
240 + const css::uno::Reference< css::uno::XComponentContext >& xContext,
241 + css::uno::Reference< css::beans::XPropertySet >& xProps,
242 + css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException);
244 + virtual ~ScVbaVPageBreak();
246 + // XHelperInterface
247 + virtual rtl::OUString& getServiceImplName();
248 + virtual css::uno::Sequence<rtl::OUString> getServiceNames();
252 diff --git sc/source/ui/vba/vbapagebreaks.cxx sc/source/ui/vba/vbapagebreaks.cxx
255 index 8859ca6..51eaffb
256 --- sc/source/ui/vba/vbapagebreaks.cxx
257 +++ sc/source/ui/vba/vbapagebreaks.cxx
258 @@ -90,8 +90,8 @@ public:
259 virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException);
260 virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException)
263 - // return excel::XVPageBreak::static_type(0);
265 + return excel::XVPageBreak::static_type(0);
266 return excel::XHPageBreak::static_type(0);
268 virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
269 @@ -137,8 +137,8 @@ uno::Any SAL_CALL RangePageBreaks::getByIndex( sal_Int32 Index ) throw (lang::In
270 if( (nPos < xIndexAccess->getCount()) && (nPos > -1) )
272 uno::Reference< beans::XPropertySet > xRowColPropertySet( xIndexAccess->getByIndex(nPos), uno::UNO_QUERY_THROW );
274 - // return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
276 + return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
277 return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
280 @@ -187,8 +187,8 @@ uno::Any RangePageBreaks::Add( const css::uno::Any& Before ) throw ( css::script
281 sheet::TablePageBreakData aTablePageBreakData;
282 aTablePageBreakData.ManualBreak = sal_True;
283 aTablePageBreakData.Position = nAPIRowColIndex;
285 - // return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
287 + return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
288 return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
291 @@ -267,3 +267,64 @@ ScVbaHPageBreaks::getServiceNames()
292 return aServiceNames;
296 +ScVbaVPageBreaks::ScVbaVPageBreaks( const uno::Reference< XHelperInterface >& xParent,
297 + const uno::Reference< uno::XComponentContext >& xContext,
298 + uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( uno::RuntimeException )
299 +: ScVbaVPageBreaks_BASE( xParent, xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_True ) ),
300 + mxSheetPageBreak( xSheetPageBreak )
304 +ScVbaVPageBreaks::~ScVbaVPageBreaks()
309 +ScVbaVPageBreaks::Add( const uno::Any& Before ) throw ( script::BasicErrorException, uno::RuntimeException )
311 + RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() );
314 + return pPageBreaks->Add( Before );
319 +uno::Reference< container::XEnumeration >
320 +ScVbaVPageBreaks::createEnumeration() throw ( uno::RuntimeException )
322 + return new RangePageBreaksEnumWrapper( m_xIndexAccess );
326 +ScVbaVPageBreaks::createCollectionObject( const css::uno::Any& aSource )
328 + return aSource; // its already a pagebreak object
332 +ScVbaVPageBreaks::getElementType() throw ( uno::RuntimeException )
334 + return excel::XVPageBreak::static_type( 0 );
338 +ScVbaVPageBreaks::getServiceImplName()
340 + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "ScVbaVPageBreaks" ) );
344 +uno::Sequence< rtl::OUString >
345 +ScVbaVPageBreaks::getServiceNames()
347 + static uno::Sequence< rtl::OUString > aServiceNames;
348 + if ( aServiceNames.getLength() == 0 )
350 + aServiceNames.realloc( 1 );
351 + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.VPageBreaks" ) );
353 + return aServiceNames;
356 diff --git sc/source/ui/vba/vbapagebreaks.hxx sc/source/ui/vba/vbapagebreaks.hxx
359 index 530d82a..cc2a642
360 --- sc/source/ui/vba/vbapagebreaks.hxx
361 +++ sc/source/ui/vba/vbapagebreaks.hxx
363 #include <cppuhelper/implbase1.hxx>
364 #include <ooo/vba/excel/XHPageBreaks.hpp>
365 #include <ooo/vba/excel/XHPageBreak.hpp>
366 +#include <ooo/vba/excel/XVPageBreaks.hpp>
367 +#include <ooo/vba/excel/XVPageBreak.hpp>
368 #include <ooo/vba/excel/XRange.hpp>
369 #include <com/sun/star/uno/XComponentContext.hpp>
370 #include <com/sun/star/script/BasicErrorException.hpp>
371 @@ -68,4 +70,31 @@ public:
372 virtual css::uno::Sequence<rtl::OUString> getServiceNames();
376 +typedef CollTestImplHelper< ov::excel::XVPageBreaks > ScVbaVPageBreaks_BASE;
378 +class ScVbaVPageBreaks : public ScVbaVPageBreaks_BASE
380 + css::uno::Reference< css::sheet::XSheetPageBreak > mxSheetPageBreak;
383 + ScVbaVPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent,
384 + const css::uno::Reference< css::uno::XComponentContext >& xContext,
385 + css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( css::uno::RuntimeException );
387 + virtual ~ScVbaVPageBreaks();
390 + virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Before ) throw ( css::script::BasicErrorException, css::uno::RuntimeException );
392 + // XEnumerationAccess
393 + virtual css::uno::Type SAL_CALL getElementType() throw ( css::uno::RuntimeException );
394 + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw ( css::uno::RuntimeException );
395 + virtual css::uno::Any createCollectionObject( const css::uno::Any& );
397 + // XHelperInterface
398 + virtual rtl::OUString& getServiceImplName();
399 + virtual css::uno::Sequence<rtl::OUString> getServiceNames();
403 diff --git sc/source/ui/vba/vbaworksheet.cxx sc/source/ui/vba/vbaworksheet.cxx
406 index d687610..fddb886
407 --- sc/source/ui/vba/vbaworksheet.cxx
408 +++ sc/source/ui/vba/vbaworksheet.cxx
409 @@ -370,6 +370,16 @@ ScVbaWorksheet::HPageBreaks( const uno::Any& aIndex ) throw (uno::RuntimeExcepti
410 return uno::makeAny( xHPageBreaks );
414 +ScVbaWorksheet::VPageBreaks( const uno::Any& aIndex ) throw ( uno::RuntimeException )
416 + uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak( getSheet(), uno::UNO_QUERY_THROW );
417 + uno::Reference< excel::XVPageBreaks > xVPageBreaks( new ScVbaVPageBreaks( this, mxContext, xSheetPageBreak ) );
418 + if( aIndex.hasValue() )
419 + return xVPageBreaks->Item( aIndex, uno::Any());
420 + return uno::makeAny( xVPageBreaks );
424 ScVbaWorksheet::getStandardWidth() throw (uno::RuntimeException)
426 diff --git sc/source/ui/vba/vbaworksheet.hxx sc/source/ui/vba/vbaworksheet.hxx
427 index e70b282..b275960 100644
428 --- sc/source/ui/vba/vbaworksheet.hxx
429 +++ sc/source/ui/vba/vbaworksheet.hxx
431 #include <ooo/vba/excel/XOutline.hpp>
432 #include <ooo/vba/excel/XPageSetup.hpp>
433 #include <ooo/vba/excel/XHPageBreaks.hpp>
434 +#include <ooo/vba/excel/XVPageBreaks.hpp>
435 #include <ooo/vba/excel/XChartObjects.hpp>
436 #include <com/sun/star/container/XNamed.hpp>
438 @@ -94,6 +95,7 @@ public:
439 virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException);
440 virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup( ) throw (css::uno::RuntimeException);
441 virtual css::uno::Any SAL_CALL HPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
442 + virtual css::uno::Any SAL_CALL VPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
443 virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() throw (css::uno::RuntimeException);
444 virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() throw (css::uno::RuntimeException);
445 virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);