ooo-build r14916 - in trunk: . patches/dev300 patches/vba



Author: hbo
Date: Wed Dec 24 05:05:02 2008
New Revision: 14916
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14916&view=rev

Log:
2008-12-24  Han Bo  <hanbo redoffice com>

	* patches/dev300/apply: the-vpagebreak-object.diff
	* patches/vba/the-vpagebreak-object.diff: VPageBreak and 
VPageBreaks
	object porting


Added:
   trunk/patches/vba/the-vpagebreak-object.diff   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Wed Dec 24 05:05:02 2008
@@ -2800,7 +2800,7 @@
 
 [ Fixes ]
 # fix problem with outline numbering broken in master document
-sw-outline-numbering-broken-fix.diff, i96092, n#445536, Amelia Wang
+sw-outline-numbering-broken-fix.diff, i#96092, n#445536, Amelia Wang
 # one of pagebreak enhancements
 sw-insert-pagebreak-in-numbered-paragraph.diff, n#396648, Amelia Wang
 
@@ -2818,6 +2818,9 @@
 #Create langpack and full installers
 ooop-langpack-policy.diff
 
+[ VBAObjects ]
+the-vpagebreak-object.diff, hanbo
+
 [ UnusedMethodsRemoval ]
 # Patches in this section remove unused methods identified by callcatcher.
 

Added: trunk/patches/vba/the-vpagebreak-object.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/the-vpagebreak-object.diff	Wed Dec 24 05:05:02 2008
@@ -0,0 +1,445 @@
+diff --git oovbaapi/ooo/vba/excel/XVPageBreak.idl oovbaapi/ooo/vba/excel/XVPageBreak.idl
+new file mode 100755
+index 0000000..8dc9692
+--- /dev/null
++++ oovbaapi/ooo/vba/excel/XVPageBreak.idl
+@@ -0,0 +1,54 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: XVPageBreak.idl,v $
++ * $Revision: 1.0 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org 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 version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++#ifndef __ooo_vba_excel_XVPageBreak_idl__
++#define __ooo_vba_excel_XVPageBreak_idl__
++
++#ifndef __ooo_vba_excel_XPageBreak_idl__
++#include <ooo/vba/excel/XPageBreak.idl>
++#endif
++
++//=============================================================================
++
++module ooo {  module vba {  module excel { 
++
++//=============================================================================
++
++interface XVPageBreak
++{
++	interface ::ooo::vba::excel::XPageBreak;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+diff --git oovbaapi/ooo/vba/excel/XVPageBreaks.idl oovbaapi/ooo/vba/excel/XVPageBreaks.idl
+new file mode 100755
+index 0000000..91501db
+--- /dev/null
++++ oovbaapi/ooo/vba/excel/XVPageBreaks.idl
+@@ -0,0 +1,71 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: XVPageBreaks.idl,v $
++ * $Revision: 1.0 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org 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 version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++#ifndef __ooo_vba_excel_XVPageBreaks_idl__
++#define __ooo_vba_excel_XVPageBreaks_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __ooo_vba_XHelperInterface_idl__
++#include <ooo/vba/XHelperInterface.idl>
++#endif
++
++#ifndef __com_sun_star_helper_script_BasicErrorException_idl__
++#include <com/sun/star/script/BasicErrorException.idl>
++#endif
++
++#ifndef  __ooo_vba_XCollection_idl__
++#include <ooo/vba/XCollection.idl>
++#endif
++
++//=============================================================================
++
++module ooo {  module vba {  module excel { 
++
++//=============================================================================
++
++//interface XVPageBreak;
++
++interface XVPageBreaks
++{
++	interface ooo::vba::XCollection;
++	
++	//Methods	
++	any Add( [in] any Before ) raises( com::sun::star::script::BasicErrorException );
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+diff --git oovbaapi/ooo/vba/excel/XWorksheet.idl oovbaapi/ooo/vba/excel/XWorksheet.idl
+index 03d2cc3..9e9b803 100644
+--- oovbaapi/ooo/vba/excel/XWorksheet.idl
++++ oovbaapi/ooo/vba/excel/XWorksheet.idl
+@@ -56,6 +56,7 @@ interface XRange;
+ interface XOutline;
+ interface XPageSetup;
+ interface XHPageBreaks;
++interface XVPageBreaks;
+ interface XWorksheet
+ {
+ 	interface ::ooo::vba::XHelperInterface;
+@@ -92,6 +93,7 @@ interface XWorksheet
+ 	XOutline Outline();
+ 	XPageSetup PageSetup();
+ 	any HPageBreaks([in] any Index);
++	any VPageBreaks([in] any Index);
+ 	any OLEObjects([in] any Index);
+ 	void ShowDataForm();
+ 	any Shapes([in] any Index);
+diff --git oovbaapi/ooo/vba/excel/makefile.mk oovbaapi/ooo/vba/excel/makefile.mk
+index 59333bf..2170810 100644
+--- oovbaapi/ooo/vba/excel/makefile.mk
++++ oovbaapi/ooo/vba/excel/makefile.mk
+@@ -98,6 +98,8 @@ IDLFILES= XApplication.idl\
+  	XPageBreak.idl \
+  	XHPageBreak.idl \
+  	XHPageBreaks.idl \
++ 	XVPageBreak.idl \
++ 	XVPageBreaks.idl \
+ 
+ 
+ # ------------------------------------------------------------------
+diff --git sc/source/ui/vba/vbapagebreak.cxx sc/source/ui/vba/vbapagebreak.cxx
+old mode 100644
+new mode 100755
+index 581e5bd..13ad8b5
+--- sc/source/ui/vba/vbapagebreak.cxx
++++ sc/source/ui/vba/vbapagebreak.cxx
+@@ -139,3 +139,37 @@ ScVbaHPageBreak::getServiceNames()
+ 	return aServiceNames;
+ }
+ 
++template class ScVbaPageBreak< excel::XVPageBreak >;
++
++/* class ScVbaVPageBreak */
++ScVbaVPageBreak::ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, 
++								  const css::uno::Reference< css::uno::XComponentContext >& xContext,
++								  css::uno::Reference< css::beans::XPropertySet >& xProps,
++								  css::sheet::TablePageBreakData aTablePageBreakData ) throw ( css::uno::RuntimeException )
++:   ScVbaVPageBreak_BASE( xParent, xContext, xProps, aTablePageBreakData )
++{
++}
++            
++ScVbaVPageBreak::~ScVbaVPageBreak()
++{
++}
++
++rtl::OUString& 
++ScVbaVPageBreak::getServiceImplName()
++{
++	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaVPageBreak") );
++	return sImplName;
++}
++
++uno::Sequence< rtl::OUString > 
++ScVbaVPageBreak::getServiceNames()
++{
++	static uno::Sequence< rtl::OUString > aServiceNames;
++	if ( aServiceNames.getLength() == 0 )
++	{
++		aServiceNames.realloc( 1 );
++		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.VPageBreak" ) );
++	}
++	return aServiceNames;
++}
++
+diff --git sc/source/ui/vba/vbapagebreak.hxx sc/source/ui/vba/vbapagebreak.hxx
+old mode 100644
+new mode 100755
+index a07cfda..04c8702
+--- sc/source/ui/vba/vbapagebreak.hxx
++++ sc/source/ui/vba/vbapagebreak.hxx
+@@ -33,6 +33,7 @@
+ #include <cppuhelper/implbase1.hxx>
+ #include <ooo/vba/excel/XPageBreak.hpp>
+ #include <ooo/vba/excel/XHPageBreak.hpp>
++#include <ooo/vba/excel/XVPageBreak.hpp>
+ #include <ooo/vba/excel/XRange.hpp>
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/script/BasicErrorException.hpp>
+@@ -84,4 +85,22 @@ public:
+ 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ };
+ 
++//VPageBreak
++typedef ScVbaPageBreak < ov::excel::XVPageBreak > ScVbaVPageBreak_BASE;
++
++class ScVbaVPageBreak :  public ScVbaVPageBreak_BASE
++{
++public:
++	ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, 
++					 const css::uno::Reference< css::uno::XComponentContext >& xContext,
++					 css::uno::Reference< css::beans::XPropertySet >& xProps,
++					 css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException);
++            
++	virtual ~ScVbaVPageBreak();
++	
++	// XHelperInterface
++	virtual rtl::OUString& getServiceImplName();
++	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
+ #endif
+diff --git sc/source/ui/vba/vbapagebreaks.cxx sc/source/ui/vba/vbapagebreaks.cxx
+old mode 100644
+new mode 100755
+index 8859ca6..51eaffb
+--- sc/source/ui/vba/vbapagebreaks.cxx
++++ sc/source/ui/vba/vbapagebreaks.cxx
+@@ -90,8 +90,8 @@ public:
+ 	virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException);
+ 	virtual uno::Type SAL_CALL getElementType(  ) throw (uno::RuntimeException)
+ 	{
+-		//if( m_bColumn )
+-			// return excel::XVPageBreak::static_type(0);
++		if( m_bColumn )
++			 return excel::XVPageBreak::static_type(0);
+ 		return  excel::XHPageBreak::static_type(0);
+ 	}
+ 	virtual sal_Bool SAL_CALL hasElements(  ) throw (uno::RuntimeException)
+@@ -137,8 +137,8 @@ uno::Any SAL_CALL RangePageBreaks::getByIndex( sal_Int32 Index ) throw (lang::In
+         if( (nPos < xIndexAccess->getCount()) && (nPos > -1) )
+         {
+             uno::Reference< beans::XPropertySet > xRowColPropertySet( xIndexAccess->getByIndex(nPos), uno::UNO_QUERY_THROW );
+-			//if( m_bColumn )
+-			//	return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
++			if( m_bColumn )
++				return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
+ 			return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
+         }
+     }
+@@ -187,8 +187,8 @@ uno::Any RangePageBreaks::Add( const css::uno::Any& Before ) throw ( css::script
+ 	sheet::TablePageBreakData aTablePageBreakData;
+ 	aTablePageBreakData.ManualBreak = sal_True;
+ 	aTablePageBreakData.Position = nAPIRowColIndex;
+-	//if( m_bColumn )
+-	//	return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
++	if( m_bColumn )
++		return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
+ 	return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
+ }
+ 
+@@ -267,3 +267,64 @@ ScVbaHPageBreaks::getServiceNames()
+ 	return aServiceNames;
+ }
+ 
++//VPageBreak
++ScVbaVPageBreaks::ScVbaVPageBreaks( const uno::Reference< XHelperInterface >& xParent, 
++                                    const uno::Reference< uno::XComponentContext >& xContext,
++            		                uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( uno::RuntimeException )
++:   ScVbaVPageBreaks_BASE( xParent, xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_True ) ), 
++	mxSheetPageBreak( xSheetPageBreak )
++{
++}
++
++ScVbaVPageBreaks::~ScVbaVPageBreaks()
++{
++}
++
++uno::Any SAL_CALL 
++ScVbaVPageBreaks::Add( const uno::Any& Before ) throw ( script::BasicErrorException, uno::RuntimeException )
++{
++	RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() );
++	if( pPageBreaks )
++	{
++		return pPageBreaks->Add( Before );
++	}
++	return uno::Any();
++}
++
++uno::Reference< container::XEnumeration >
++ScVbaVPageBreaks::createEnumeration() throw ( uno::RuntimeException )
++{
++	return new RangePageBreaksEnumWrapper( m_xIndexAccess );
++}
++
++uno::Any
++ScVbaVPageBreaks::createCollectionObject( const css::uno::Any& aSource )
++{
++	return aSource; // its already a pagebreak object
++}
++
++uno::Type 
++ScVbaVPageBreaks::getElementType() throw ( uno::RuntimeException )
++{
++	return excel::XVPageBreak::static_type( 0 );
++}
++
++rtl::OUString& 
++ScVbaVPageBreaks::getServiceImplName()
++{
++	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "ScVbaVPageBreaks" ) );
++	return sImplName;
++}
++
++uno::Sequence< rtl::OUString > 
++ScVbaVPageBreaks::getServiceNames()
++{
++	static uno::Sequence< rtl::OUString > aServiceNames;
++	if ( aServiceNames.getLength() == 0 )
++	{
++		aServiceNames.realloc( 1 );
++		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.VPageBreaks" ) );
++	}
++	return aServiceNames;
++}
++
+diff --git sc/source/ui/vba/vbapagebreaks.hxx sc/source/ui/vba/vbapagebreaks.hxx
+old mode 100644
+new mode 100755
+index 530d82a..cc2a642
+--- sc/source/ui/vba/vbapagebreaks.hxx
++++ sc/source/ui/vba/vbapagebreaks.hxx
+@@ -33,6 +33,8 @@
+ #include <cppuhelper/implbase1.hxx>
+ #include <ooo/vba/excel/XHPageBreaks.hpp>
+ #include <ooo/vba/excel/XHPageBreak.hpp>
++#include <ooo/vba/excel/XVPageBreaks.hpp>
++#include <ooo/vba/excel/XVPageBreak.hpp>
+ #include <ooo/vba/excel/XRange.hpp>
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/script/BasicErrorException.hpp>
+@@ -68,4 +70,31 @@ public:
+ 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ };
+ 
++//VPageBreaks
++typedef CollTestImplHelper< ov::excel::XVPageBreaks > ScVbaVPageBreaks_BASE;
++
++class ScVbaVPageBreaks : public ScVbaVPageBreaks_BASE
++{
++	css::uno::Reference< css::sheet::XSheetPageBreak > mxSheetPageBreak;
++
++public:
++	ScVbaVPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent, 
++					  const css::uno::Reference< css::uno::XComponentContext >& xContext,
++            		  css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( css::uno::RuntimeException );
++
++	virtual ~ScVbaVPageBreaks();
++
++	// XVPageBreaks 
++	virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Before ) throw ( css::script::BasicErrorException, css::uno::RuntimeException );
++
++	// XEnumerationAccess
++	virtual css::uno::Type SAL_CALL getElementType() throw ( css::uno::RuntimeException );
++	virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw ( css::uno::RuntimeException );	
++	virtual css::uno::Any createCollectionObject( const css::uno::Any& );
++
++	// XHelperInterface
++	virtual rtl::OUString& getServiceImplName();
++	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
+ #endif
+diff --git sc/source/ui/vba/vbaworksheet.cxx sc/source/ui/vba/vbaworksheet.cxx
+old mode 100644
+new mode 100755
+index d687610..fddb886
+--- sc/source/ui/vba/vbaworksheet.cxx
++++ sc/source/ui/vba/vbaworksheet.cxx
+@@ -370,6 +370,16 @@ ScVbaWorksheet::HPageBreaks( const uno::Any& aIndex ) throw (uno::RuntimeExcepti
+    return uno::makeAny( xHPageBreaks );
+ }
+ 
++uno::Any
++ScVbaWorksheet::VPageBreaks( const uno::Any& aIndex ) throw ( uno::RuntimeException )
++{
++	uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak( getSheet(), uno::UNO_QUERY_THROW );
++	uno::Reference< excel::XVPageBreaks > xVPageBreaks( new ScVbaVPageBreaks( this, mxContext, xSheetPageBreak ) ); 
++	if( aIndex.hasValue() )
++		return xVPageBreaks->Item( aIndex, uno::Any()); 
++	return uno::makeAny( xVPageBreaks );
++}
++
+ sal_Int32 
+ ScVbaWorksheet::getStandardWidth() throw (uno::RuntimeException)
+ {
+diff --git sc/source/ui/vba/vbaworksheet.hxx sc/source/ui/vba/vbaworksheet.hxx
+index e70b282..b275960 100644
+--- sc/source/ui/vba/vbaworksheet.hxx
++++ sc/source/ui/vba/vbaworksheet.hxx
+@@ -44,6 +44,7 @@
+ #include <ooo/vba/excel/XOutline.hpp>
+ #include <ooo/vba/excel/XPageSetup.hpp>
+ #include <ooo/vba/excel/XHPageBreaks.hpp>
++#include <ooo/vba/excel/XVPageBreaks.hpp>
+ #include <ooo/vba/excel/XChartObjects.hpp>
+ #include <com/sun/star/container/XNamed.hpp>
+ 
+@@ -94,6 +95,7 @@ public:
+ 	virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException);
+ 	virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup( ) throw (css::uno::RuntimeException);
+ 	virtual css::uno::Any SAL_CALL HPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
++	virtual css::uno::Any SAL_CALL VPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() throw (css::uno::RuntimeException);
+ 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() throw (css::uno::RuntimeException);
+  	virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]