ooo-build r13458 - in trunk: . patches/dev300 patches/vba
- From: pflin svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r13458 - in trunk: . patches/dev300 patches/vba
- Date: Fri, 1 Aug 2008 08:35:30 +0000 (UTC)
Author: pflin
Date: Fri Aug 1 08:35:30 2008
New Revision: 13458
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13458&view=rev
Log:
2008-08-01 Fong Lin <pflin novell com>
* patches/dev300/cws-npower11.diff: Add vba events stuff.
* patches/dev300/cws-npower11-m25.diff:
* patches/vba/vbaevents-services-sources.diff:
* patches/dev300/apply.
Added:
trunk/patches/dev300/cws-npower11-m25.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/dev300/cws-npower11.diff
trunk/patches/vba/vbaevents-services-sources.diff
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Fri Aug 1 08:35:30 2008
@@ -334,6 +334,9 @@
[ CWSBackports ]
cws-pflin10.diff
#api changes
+[ CWSBackports < dev300-m26 ]
+cws-npower11-m25.diff
+[ CWSBackports >= dev300-m26 ]
cws-npower11.diff
# not for upstreaming: don't disable the entire visibility, just
@@ -1674,7 +1677,7 @@
[ VBAObjects >= dev300-m26 < beb300-m0 ]
vbaevents-services-sources.diff, i#68893
-[ VBAObjects ]
+[ VBAObjects < dev300-m26 ]
#merged into vba-workbook-worksheet-events-dev300.diff
#vba-workbook-worksheet-events-buildfix.diff,
vba-workbook-worksheet-events.diff
Added: trunk/patches/dev300/cws-npower11-m25.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/cws-npower11-m25.diff Fri Aug 1 08:35:30 2008
@@ -0,0 +1,15111 @@
+cvs diff: Diffing sc
+cvs diff: Diffing sc/addin
+cvs diff: Diffing sc/addin/datefunc
+cvs diff: Diffing sc/addin/inc
+cvs diff: Diffing sc/addin/rot13
+cvs diff: Diffing sc/addin/util
+cvs diff: Diffing sc/inc
+Index: sc/inc/document.hxx
+===================================================================
+RCS file: /cvs/sc/sc/inc/document.hxx,v
+retrieving revision 1.115
+retrieving revision 1.115.22.1
+diff -u -p -b -w -B -r1.115 -r1.115.22.1
+--- sc/inc/document.hxx 8 Jul 2008 07:19:13 -0000 1.115
++++ sc/inc/document.hxx 29 Jul 2008 06:35:39 -0000 1.115.22.1
+@@ -703,7 +703,7 @@ SC_DLLPUBLIC ScDBCollection* GetDBCollec
+ BOOL HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect );
+ BOOL HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect );
+
+- ScOutlineTable* GetOutlineTable( SCTAB nTab, BOOL bCreate = FALSE );
++ SC_DLLPUBLIC ScOutlineTable* GetOutlineTable( SCTAB nTab, BOOL bCreate = FALSE );
+ BOOL SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline );
+
+ void DoAutoOutline( SCCOL nStartCol, SCROW nStartRow,
+Index: sc/inc/olinetab.hxx
+===================================================================
+RCS file: /cvs/sc/sc/inc/olinetab.hxx,v
+retrieving revision 1.6
+retrieving revision 1.6.96.1
+diff -u -p -b -w -B -r1.6 -r1.6.96.1
+--- sc/inc/olinetab.hxx 10 Apr 2008 18:41:55 -0000 1.6
++++ sc/inc/olinetab.hxx 29 Jul 2008 06:35:39 -0000 1.6.96.1
+@@ -114,7 +114,7 @@ public:
+
+ ScOutlineEntry* GetEntry( USHORT nLevel, USHORT nIndex ) const;
+ USHORT GetCount( USHORT nLevel ) const;
+- ScOutlineEntry* GetEntryByPos( USHORT nLevel, SCCOLROW nPos ) const;
++ SC_DLLPUBLIC ScOutlineEntry* GetEntryByPos( USHORT nLevel, SCCOLROW nPos ) const;
+
+ BOOL GetEntryIndex( USHORT nLevel, SCCOLROW nPos, USHORT& rnIndex ) const;
+ BOOL GetEntryIndexInRange(
+cvs diff: Diffing sc/inc/pch
+cvs diff: Diffing sc/prj
+cvs diff: Diffing sc/qa
+cvs diff: Diffing sc/qa/complex
+cvs diff: Diffing sc/qa/complex/calcPreview
+cvs diff: Diffing sc/qa/complex/calcPreview/test_documents
+cvs diff: Diffing sc/qa/complex/cellRanges
+cvs diff: Diffing sc/qa/complex/dataPilot
+cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests
+cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests/beans
+cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests/container
+cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests/sheet
+cvs diff: Diffing sc/qa/complex/sc
+cvs diff: Diffing sc/qa/unoapi
+cvs diff: Diffing sc/qa/unoapi/testdocuments
+cvs diff: Diffing sc/sdi
+cvs diff: Diffing sc/source
+cvs diff: Diffing sc/source/core
+cvs diff: Diffing sc/source/core/data
+cvs diff: Diffing sc/source/core/inc
+cvs diff: Diffing sc/source/core/src
+cvs diff: Diffing sc/source/core/tool
+cvs diff: Diffing sc/source/filter
+cvs diff: Diffing sc/source/filter/dif
+cvs diff: Diffing sc/source/filter/excel
+cvs diff: Diffing sc/source/filter/ftools
+cvs diff: Diffing sc/source/filter/html
+cvs diff: Diffing sc/source/filter/inc
+cvs diff: Diffing sc/source/filter/lotus
+cvs diff: Diffing sc/source/filter/qpro
+cvs diff: Diffing sc/source/filter/rtf
+cvs diff: Diffing sc/source/filter/starcalc
+cvs diff: Diffing sc/source/filter/xcl97
+cvs diff: Diffing sc/source/filter/xml
+cvs diff: Diffing sc/source/ui
+cvs diff: Diffing sc/source/ui/Accessibility
+cvs diff: Diffing sc/source/ui/app
+cvs diff: Diffing sc/source/ui/attrdlg
+cvs diff: Diffing sc/source/ui/cctrl
+cvs diff: Diffing sc/source/ui/dbgui
+cvs diff: Diffing sc/source/ui/docshell
+cvs diff: Diffing sc/source/ui/drawfunc
+cvs diff: Diffing sc/source/ui/formdlg
+cvs diff: Diffing sc/source/ui/inc
+cvs diff: Diffing sc/source/ui/miscdlgs
+cvs diff: Diffing sc/source/ui/namedlg
+cvs diff: Diffing sc/source/ui/navipi
+cvs diff: Diffing sc/source/ui/optdlg
+cvs diff: Diffing sc/source/ui/pagedlg
+cvs diff: Diffing sc/source/ui/src
+cvs diff: Diffing sc/source/ui/styleui
+cvs diff: Diffing sc/source/ui/undo
+cvs diff: Diffing sc/source/ui/unoobj
+cvs diff: Diffing sc/source/ui/vba
+Index: sc/source/ui/vba/makefile.mk
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/makefile.mk,v
+retrieving revision 1.6
+retrieving revision 1.5.42.5
+diff -u -p -b -w -B -r1.6 -r1.5.42.5
+--- sc/source/ui/vba/makefile.mk 11 Apr 2008 00:46:57 -0000 1.6
++++ sc/source/ui/vba/makefile.mk 29 Jul 2008 06:35:39 -0000 1.5.42.5
+@@ -88,6 +88,7 @@ SLOFILES= \
+ $(SLO)$/vbabutton.obj \
+ $(SLO)$/vbalabel.obj \
+ $(SLO)$/vbatextbox.obj \
++ $(SLO)$/vbatextboxshape.obj \
+ $(SLO)$/vbaradiobutton.obj \
+ $(SLO)$/vbalistbox.obj \
+ $(SLO)$/vbapropvalue.obj \
+@@ -111,6 +112,24 @@ SLOFILES= \
+ $(SLO)$/vbaformatconditions.obj \
+ $(SLO)$/vbastyle.obj \
+ $(SLO)$/vbastyles.obj \
++ $(SLO)$/vbaassistant.obj \
++ $(SLO)$/vbauserform.obj \
++ $(SLO)$/vbacheckbox.obj \
++ $(SLO)$/vbatogglebutton.obj \
++ $(SLO)$/vbaframe.obj \
++ $(SLO)$/vbascrollbar.obj \
++ $(SLO)$/vbaprogressbar.obj \
++ $(SLO)$/vbamultipage.obj \
++ $(SLO)$/vbapages.obj \
++ $(SLO)$/vbacommandbarcontrol.obj \
++ $(SLO)$/vbacommandbarcontrols.obj \
++ $(SLO)$/vbacommandbar.obj \
++ $(SLO)$/vbacommandbars.obj \
++ $(SLO)$/vbahyperlink.obj \
++ $(SLO)$/vbapagesetup.obj \
++ $(SLO)$/vbapagebreak.obj \
++ $(SLO)$/vbapagebreaks.obj \
++ $(SLO)$/vbaspinbutton.obj \
+ $(SLO)$/service.obj \
+
+
+Index: sc/source/ui/vba/service.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/service.cxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.3
+diff -u -p -b -w -B -r1.4 -r1.3.42.3
+--- sc/source/ui/vba/service.cxx 11 Apr 2008 00:47:11 -0000 1.4
++++ sc/source/ui/vba/service.cxx 29 Jul 2008 06:35:39 -0000 1.3.42.3
+@@ -53,11 +53,22 @@ namespace worksheet
+ {
+ extern sdecl::ServiceDecl const serviceDecl;
+ }
++namespace window
++{
++extern sdecl::ServiceDecl const serviceDecl;
++}
+ namespace globals
+ {
+ extern sdecl::ServiceDecl const serviceDecl;
+ }
+-
++namespace userform
++{
++extern sdecl::ServiceDecl const serviceDecl;
++}
++namespace hyperlink
++{
++extern sdecl::ServiceDecl const serviceDecl;
++}
+
+
+ extern "C"
+@@ -76,7 +87,7 @@ extern "C"
+
+ // Component registration
+ if ( component_writeInfoHelper( pServiceManager, pRegistryKey,
+- range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl ) )
++ range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ) )
+ {
+ // Singleton registration
+ try
+@@ -104,7 +115,7 @@ extern "C"
+ {
+ OSL_TRACE("In component_getFactory for %s", pImplName );
+ void* pRet = component_getFactoryHelper(
+- pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl );
++ pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl );
+ OSL_TRACE("Ret is 0x%x", pRet);
+ return pRet;
+ }
+Index: sc/source/ui/vba/vbaapplication.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaapplication.cxx,v
+retrieving revision 1.7
+retrieving revision 1.5.42.4
+diff -u -p -b -w -B -r1.7 -r1.5.42.4
+--- sc/source/ui/vba/vbaapplication.cxx 11 Apr 2008 00:47:25 -0000 1.7
++++ sc/source/ui/vba/vbaapplication.cxx 29 Jul 2008 06:35:39 -0000 1.5.42.4
+@@ -42,6 +42,7 @@
+ #include <com/sun/star/task/XStatusIndicator.hpp>
+ #include <org/openoffice/excel/XlMousePointer.hpp>
+ #include <com/sun/star/sheet/XNamedRanges.hpp>
++#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+
+ #include "vbaapplication.hxx"
+ #include "vbaworkbooks.hxx"
+@@ -57,6 +58,9 @@
+ #include "gridwin.hxx"
+ #include "vbanames.hxx"
+ #include "vbashape.hxx"
++#include "vbatextboxshape.hxx"
++#include "vbaassistant.hxx"
++#include "vbacommandbars.hxx"
+ #include "sc.hrc"
+
+ #include <osl/file.hxx>
+@@ -78,6 +82,10 @@
+ #include <basic/sbuno.hxx>
+ #include <basic/sbmeth.hxx>
+
++#include "convuno.hxx"
++#include "cellsuno.hxx"
++#include "docsh.hxx"
++
+ using namespace ::org::openoffice;
+ using namespace ::com::sun::star;
+
+@@ -122,9 +130,25 @@ ScVbaApplication::getThisWorkbook() thro
+ return getActiveWorkbook();
+ }
+
++uno::Reference< vba::XAssistant > SAL_CALL
++ScVbaApplication::getAssistant() throw (uno::RuntimeException)
++{
++ return uno::Reference< vba::XAssistant >( new ScVbaAssistant( this, mxContext ) );
++}
++
++uno::Any SAL_CALL
++ScVbaApplication::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
++{
++ uno::Reference< vba::XCommandBars > xCommandBars( new ScVbaCommandBars( this, mxContext, uno::Reference< container::XIndexAccess >() ) );
++ if( aIndex.hasValue() )
++ return uno::makeAny( xCommandBars->Item( aIndex, uno::Any() ) );
++ return uno::makeAny( xCommandBars );
++}
++
+ uno::Any SAL_CALL
+ ScVbaApplication::getSelection() throw (uno::RuntimeException)
+ {
++ OSL_TRACE("** ScVbaApplication::getSelection() ** ");
+ uno::Reference< lang::XServiceInfo > xServiceInfo( getCurrentDocument()->getCurrentSelection(), uno::UNO_QUERY_THROW );
+ rtl::OUString sImpementaionName = xServiceInfo->getImplementationName();
+ if( sImpementaionName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") )
+@@ -132,6 +156,17 @@ ScVbaApplication::getSelection() throw (
+ uno::Reference< drawing::XShapes > xShapes( getCurrentDocument()->getCurrentSelection(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShape > xShape( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
++ // if ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape
++ // and the uno object implements the com.sun.star.drawing.Text service
++ // return a textboxshape object
++ if ( ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape )
++ {
++ uno::Reference< lang::XServiceInfo > xShapeServiceInfo( xShape, uno::UNO_QUERY_THROW );
++ if ( xShapeServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.Text" ) ) ) )
++ {
++ return uno::makeAny( uno::Reference< msforms::XTextBoxShape >(new ScVbaTextBoxShape( mxContext, xShape, xShapes, getCurrentDocument() ) ) );
++ }
++ }
+ return uno::makeAny( uno::Reference< msforms::XShape >(new ScVbaShape( this, mxContext, xShape, xShapes, ScVbaShape::getType( xShape ) ) ) );
+ }
+ else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRange")) ||
+@@ -426,12 +461,17 @@ ScVbaApplication::Range( const uno::Any&
+ }
+
+ uno::Any SAL_CALL
+-ScVbaApplication::Names( ) throw ( uno::RuntimeException )
++ScVbaApplication::Names( const css::uno::Any& aIndex ) throw ( uno::RuntimeException )
+ {
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+- uno::Reference< sheet::XNamedRanges > xNamedRanges( getActiveSheet() , uno::UNO_QUERY_THROW );
++ uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
++ uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("NamedRanges")) , uno::UNO_QUERY_THROW );
+ css::uno::Reference< excel::XNames > xNames ( new ScVbaNames( this , mxContext , xNamedRanges , xModel ) );
+- return uno::makeAny( xNames );
++ if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID )
++ {
++ return uno::Any( xNames );
++ }
++ return uno::Any( xNames->Item( aIndex, uno::Any() ) );
+ }
+
+
+@@ -883,6 +923,97 @@ ScVbaApplication::Intersect( const uno::
+ return xRefRange;
+ }
+
++uno::Reference< excel::XRange > SAL_CALL
++ScVbaApplication::Union( const uno::Reference< excel::XRange >& Arg1, const uno::Reference< excel::XRange >& Arg2, const uno::Any& Arg3, const uno::Any& Arg4, const uno::Any& Arg5, const uno::Any& Arg6, const uno::Any& Arg7, const uno::Any& Arg8, const uno::Any& Arg9, const uno::Any& Arg10, const uno::Any& Arg11, const uno::Any& Arg12, const uno::Any& Arg13, const uno::Any& Arg14, const uno::Any& Arg15, const uno::Any& Arg16, const uno::Any& Arg17, const uno::Any& Arg18, const uno::Any& Arg19, const uno::Any& Arg20, const uno::Any& Arg21, const uno::Any& Arg22, const uno::Any& Arg23, const uno::Any& Arg24, const uno::Any& Arg25, const uno::Any& Arg26, const uno::Any& Arg27, const uno::Any& Arg28, const uno::Any& Arg29, const uno::Any& Arg30 ) throw (script::BasicErrorException, uno::RuntimeException)
++{
++ std::vector< uno::Reference< excel::XRange > > vRanges;
++ if ( !Arg1.is() || !Arg2.is() )
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++
++ vRanges.push_back( Arg1 );
++ vRanges.push_back( Arg2 );
++
++ if ( Arg3.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg3, uno::UNO_QUERY_THROW ) );
++ if ( Arg4.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg4, uno::UNO_QUERY_THROW ) );
++ if ( Arg5.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg5, uno::UNO_QUERY_THROW ) );
++ if ( Arg6.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg6, uno::UNO_QUERY_THROW ) );
++ if ( Arg7.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg7, uno::UNO_QUERY_THROW ) );
++ if ( Arg8.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg8, uno::UNO_QUERY_THROW ) );
++ if ( Arg9.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg9, uno::UNO_QUERY_THROW ) );
++ if ( Arg10.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg10, uno::UNO_QUERY_THROW ) );
++ if ( Arg11.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg11, uno::UNO_QUERY_THROW ) );
++ if ( Arg12.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg12, uno::UNO_QUERY_THROW ) );
++ if ( Arg13.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg13, uno::UNO_QUERY_THROW ) );
++ if ( Arg14.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg14, uno::UNO_QUERY_THROW ) );
++ if ( Arg15.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg15, uno::UNO_QUERY_THROW ) );
++ if ( Arg16.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg16, uno::UNO_QUERY_THROW ) );
++ if ( Arg17.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg17, uno::UNO_QUERY_THROW ) );
++ if ( Arg18.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg18, uno::UNO_QUERY_THROW ) );
++ if ( Arg19.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg19, uno::UNO_QUERY_THROW ) );
++ if ( Arg20.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg20, uno::UNO_QUERY_THROW ) );
++ if ( Arg21.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg21, uno::UNO_QUERY_THROW ) );
++ if ( Arg22.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg22, uno::UNO_QUERY_THROW ) );
++ if ( Arg23.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg23, uno::UNO_QUERY_THROW ) );
++ if ( Arg24.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg24, uno::UNO_QUERY_THROW ) );
++ if ( Arg25.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg25, uno::UNO_QUERY_THROW ) );
++ if ( Arg26.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg26, uno::UNO_QUERY_THROW ) );
++ if ( Arg27.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg27, uno::UNO_QUERY_THROW ) );
++ if ( Arg28.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg28, uno::UNO_QUERY_THROW ) );
++ if ( Arg29.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg29, uno::UNO_QUERY_THROW ) );
++ if ( Arg30.hasValue() )
++ vRanges.push_back( uno::Reference< excel::XRange >( Arg30, uno::UNO_QUERY_THROW ) );
++
++ std::vector< uno::Reference< excel::XRange > >::iterator it = vRanges.begin();
++ std::vector< uno::Reference< excel::XRange > >::iterator it_end = vRanges.end();
++
++ uno::Reference< excel::XRange > xRange;
++ ScRangeList aCellRanges;
++ for( ; it != it_end; ++it )
++ {
++ xRange = *it;
++ uno::Reference< table::XCellRange > xRangeParam;
++ xRange->getCellRange() >>= xRangeParam;
++ uno::Reference< sheet::XCellRangeAddressable > xAddressable( xRangeParam, uno::UNO_QUERY_THROW );
++ ScRange refRange;
++ ScUnoConversion::FillScRange( refRange, xAddressable->getRangeAddress() );
++ aCellRanges.Append( refRange );
++ }
++
++ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
++ ScDocShell* pDocShell = getDocShell( xModel );
++ uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) );
++ // #FIXME need proper (WorkSheet) parent
++ xRange = new ScVbaRange( uno::Reference< vba::XHelperInterface >(), mxContext, xRanges );
++ return xRange;
++}
++
+ void
+ ScVbaApplication::Volatile( const uno::Any& aVolatile ) throw ( uno::RuntimeException )
+ {
+Index: sc/source/ui/vba/vbaapplication.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaapplication.hxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.3
+diff -u -p -b -w -B -r1.4 -r1.3.42.3
+--- sc/source/ui/vba/vbaapplication.hxx 11 Apr 2008 00:47:42 -0000 1.4
++++ sc/source/ui/vba/vbaapplication.hxx 29 Jul 2008 06:35:39 -0000 1.3.42.3
+@@ -75,6 +75,8 @@ public:
+ virtual ::sal_Bool SAL_CALL getDisplayFormulaBar() throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( css::uno::RuntimeException );
+
++ virtual css::uno::Reference< oo::vba::XAssistant > SAL_CALL getAssistant() throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< oo::excel::XWorkbook > SAL_CALL getThisWorkbook() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Workbooks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+@@ -94,10 +96,11 @@ public:
+ virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL wait( double time ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
+- virtual css::uno::Any SAL_CALL Names( ) throw ( css::uno::RuntimeException );
++ virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL GoTo( const css::uno::Any& Reference, const css::uno::Any& Scroll ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Calculate() throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< oo::excel::XRange >& Arg1, const css::uno::Reference< oo::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorEx
ception, css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Union( const css::uno::Reference< oo::excel::XRange >& Arg1, const css::uno::Reference< oo::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorExcept
ion, css::uno::RuntimeException);
+ virtual void SAL_CALL Volatile( const css::uno::Any& Volatile ) throw (css::uno::RuntimeException );
+ virtual void SAL_CALL DoEvents() throw (css::uno::RuntimeException);
+ // XHelperInterface
+Index: sc/source/ui/vba/vbaassistant.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaassistant.cxx
+diff -N sc/source/ui/vba/vbaassistant.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaassistant.cxx 18 Jan 2008 19:27:41 -0000 1.1.2.1
+@@ -0,0 +1,140 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include <sfx2/app.hxx>
++#include <svtools/helpopt.hxx>
++
++#include <org/openoffice/office/MsoAnimationType.hpp>
++
++#include"vbaassistant.hxx"
++
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++using namespace org::openoffice::office::MsoAnimationType;
++
++ScVbaAssistant::ScVbaAssistant( const uno::Reference< vba::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext ): ScVbaAssistantImpl_BASE( xParent, xContext )
++{
++ m_bIsVisible = sal_False;
++ m_nPointsLeft = 795;
++ m_nPointsTop = 248;
++ m_sName = rtl::OUString::createFromAscii( "Clippit" );
++ m_nAnimation = msoAnimationIdle;
++}
++
++ScVbaAssistant::~ScVbaAssistant()
++{
++}
++
++sal_Bool SAL_CALL ScVbaAssistant::getVisible() throw (uno::RuntimeException)
++{
++ return m_bIsVisible;
++}
++
++void SAL_CALL ScVbaAssistant::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
++{
++ m_bIsVisible = bVisible;
++}
++
++sal_Bool SAL_CALL ScVbaAssistant::getOn() throw (uno::RuntimeException)
++{
++ if( SvtHelpOptions().IsHelpAgentAutoStartMode() )
++ return sal_True;
++ else
++ return sal_False;
++}
++
++void SAL_CALL ScVbaAssistant::setOn( sal_Bool bOn ) throw (uno::RuntimeException)
++{
++ SvtHelpOptions().SetHelpAgentAutoStartMode( bOn );
++ setVisible( bOn );
++}
++
++
++::sal_Int32 SAL_CALL
++ScVbaAssistant::getTop() throw (css::uno::RuntimeException)
++{
++ return m_nPointsTop;
++}
++void SAL_CALL
++ScVbaAssistant::setTop( ::sal_Int32 _top ) throw (css::uno::RuntimeException)
++{
++ m_nPointsTop = _top;
++}
++::sal_Int32 SAL_CALL
++ScVbaAssistant::getLeft() throw (css::uno::RuntimeException)
++{
++ return m_nPointsLeft;
++}
++void SAL_CALL
++ScVbaAssistant::setLeft( ::sal_Int32 _left ) throw (css::uno::RuntimeException)
++{
++ m_nPointsLeft = _left;
++}
++::sal_Int32 SAL_CALL
++ScVbaAssistant::getAnimation() throw (css::uno::RuntimeException)
++{
++ return m_nAnimation;
++}
++void SAL_CALL
++ScVbaAssistant::setAnimation( ::sal_Int32 _animation ) throw (css::uno::RuntimeException)
++{
++ m_nAnimation = _animation;
++}
++
++::rtl::OUString SAL_CALL
++ScVbaAssistant::Name( ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ return m_sName;
++}
++
++rtl::OUString&
++ScVbaAssistant::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaAssistant") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaAssistant::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.vba.Assistant" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbaassistant.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaassistant.hxx
+diff -N sc/source/ui/vba/vbaassistant.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaassistant.hxx 18 Jan 2008 19:27:42 -0000 1.1.2.1
+@@ -0,0 +1,78 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_ASSISTANT_HXX
++#define SC_VBA_ASSISTANT_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/vba/XAssistant.hpp>
++
++#include <sfx2/sfxhelp.hxx>
++
++#include "vbahelper.hxx"
++#include "vbahelperinterface.hxx"
++
++typedef ::cppu::WeakImplHelper1< oo::vba::XAssistant > Assistant;
++typedef InheritedHelperInterfaceImpl< Assistant > ScVbaAssistantImpl_BASE;
++
++class ScVbaAssistant : public ScVbaAssistantImpl_BASE
++{
++private:
++ sal_Bool m_bIsVisible;
++ sal_Int32 m_nPointsLeft;
++ sal_Int32 m_nPointsTop;
++ rtl::OUString m_sName;
++ sal_Int32 m_nAnimation;
++public:
++ ScVbaAssistant( const css::uno::Reference< oo::vba::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext );
++ virtual ~ScVbaAssistant();
++ // XAssistant
++ virtual sal_Bool SAL_CALL getOn() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setOn( sal_Bool _on ) throw (css::uno::RuntimeException);
++ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getTop() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setTop( ::sal_Int32 _top ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getLeft() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setLeft( ::sal_Int32 _left ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getAnimation() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setAnimation( ::sal_Int32 _animation ) throw (css::uno::RuntimeException);
++
++ virtual ::rtl::OUString SAL_CALL Name( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
++#endif//SC_VBA_ASSISTANT_HXX
+Index: sc/source/ui/vba/vbaaxis.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaaxis.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbaaxis.cxx 11 Apr 2008 00:48:27 -0000 1.3
++++ sc/source/ui/vba/vbaaxis.cxx 6 Jul 2008 15:31:03 -0000 1.2.42.2
+@@ -42,8 +42,8 @@ using namespace ::org::openoffice::excel
+
+ const rtl::OUString ORIGIN( RTL_CONSTASCII_USTRINGPARAM("Origin") );
+ const rtl::OUString AUTOORIGIN( RTL_CONSTASCII_USTRINGPARAM("AutoOrigin") );
+-const rtl::OUString MIN( RTL_CONSTASCII_USTRINGPARAM("AutoOrigin") );
+-const rtl::OUString MAX( RTL_CONSTASCII_USTRINGPARAM("AutoOrigin") );
++const rtl::OUString VBA_MIN( RTL_CONSTASCII_USTRINGPARAM("Max") );
++const rtl::OUString VBA_MAX( RTL_CONSTASCII_USTRINGPARAM("Min") );
+ ScVbaChart*
+ ScVbaAxis::getChartPtr() throw( uno::RuntimeException )
+ {
+@@ -137,12 +137,12 @@ ScVbaAxis::setCrosses( ::sal_Int32 _nCro
+ bCrossesAreCustomized = sal_False;
+ return;
+ case xlAxisCrossesMinimum: // The axis crosses at the minimum value.
+- mxPropertySet->getPropertyValue(MIN) >>= fNum;
++ mxPropertySet->getPropertyValue(VBA_MIN) >>= fNum;
+ setCrossesAt( fNum );
+ bCrossesAreCustomized = sal_False;
+ break;
+ case xlAxisCrossesMaximum: // The axis crosses at the maximum value.
+- mxPropertySet->getPropertyValue(MAX) >>= fNum;
++ mxPropertySet->getPropertyValue(VBA_MAX) >>= fNum;
+ setCrossesAt(fNum);
+ bCrossesAreCustomized = sal_False;
+ break;
+@@ -177,7 +177,7 @@ ScVbaAxis::getCrosses( ) throw (script:
+ mxPropertySet->getPropertyValue(ORIGIN) >>= forigin;
+ //obsolete double fmax = AnyConverter.toDouble(mxPropertySet.getPropertyValue("Max"));
+ double fmin = 0.0;
+- mxPropertySet->getPropertyValue(MIN) >>= fmin;
++ mxPropertySet->getPropertyValue(VBA_MIN) >>= fmin;
+ if (forigin == fmin)
+ nCrosses = xlAxisCrossesMinimum;
+ else
+Index: sc/source/ui/vba/vbabutton.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbabutton.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbabutton.cxx 11 Apr 2008 00:50:02 -0000 1.3
++++ sc/source/ui/vba/vbabutton.cxx 6 Jul 2008 15:31:19 -0000 1.2.42.2
+@@ -35,7 +35,7 @@ using namespace org::openoffice;
+
+
+ const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-ScVbaButton::ScVbaButton( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : ButtonImpl_BASE( xContext, xControlShape )
++ScVbaButton::ScVbaButton( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, xControl, pGeomHelper )
+ {
+ }
+
+@@ -53,3 +53,22 @@ ScVbaButton::setCaption( const rtl::OUSt
+ {
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+ }
++
++rtl::OUString&
++ScVbaButton::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaButton") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaButton::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.Button" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbabutton.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbabutton.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbabutton.hxx 11 Apr 2008 00:50:19 -0000 1.3
++++ sc/source/ui/vba/vbabutton.hxx 6 Jul 2008 15:29:34 -0000 1.2.42.2
+@@ -40,10 +40,12 @@ typedef cppu::ImplInheritanceHelper1< Sc
+ class ScVbaButton : public ButtonImpl_BASE
+ {
+ public:
+- ScVbaButton( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
++ ScVbaButton( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ };
+ #endif //SC_VBA_BUTTON_HXX
+Index: sc/source/ui/vba/vbacharacters.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbacharacters.cxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.2
+diff -u -p -b -w -B -r1.4 -r1.3.42.2
+--- sc/source/ui/vba/vbacharacters.cxx 11 Apr 2008 00:50:34 -0000 1.4
++++ sc/source/ui/vba/vbacharacters.cxx 6 Jul 2008 15:30:46 -0000 1.3.42.2
+@@ -46,7 +46,11 @@ ScVbaCharacters::ScVbaCharacters( const
+ uno::Reference< text::XTextCursor > xTextCursor( m_xSimpleText->createTextCursor(), uno::UNO_QUERY_THROW );
+ xTextCursor->collapseToStart();
+ if ( nStart )
++ {
++ if ( ( nStart + 1 ) > xRange->getString().getLength() )
++ nStart = xRange->getString().getLength();
+ xTextCursor->goRight( nStart, sal_False );
++ }
+ if ( nLength < 0 ) // expand to end
+ xTextCursor->gotoEnd( sal_True );
+ else
+Index: sc/source/ui/vba/vbacheckbox.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacheckbox.cxx
+diff -N sc/source/ui/vba/vbacheckbox.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacheckbox.cxx 22 Apr 2008 19:53:15 -0000 1.1.2.1
+@@ -0,0 +1,110 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbacheckbox.hxx"
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++
++const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
++const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
++ScVbaCheckbox::ScVbaCheckbox( const uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper ) : CheckBoxImpl_BASE( xParent, xContext, xControl, pGeomHelper )
++{
++}
++
++// Attributes
++rtl::OUString SAL_CALL
++ScVbaCheckbox::getCaption() throw (css::uno::RuntimeException)
++{
++ rtl::OUString Label;
++ m_xProps->getPropertyValue( LABEL ) >>= Label;
++ return Label;
++}
++
++void SAL_CALL
++ScVbaCheckbox::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
++}
++
++uno::Any SAL_CALL
++ScVbaCheckbox::getValue() throw (css::uno::RuntimeException)
++{
++ sal_Int16 nValue = -1;
++ m_xProps->getPropertyValue( STATE ) >>= nValue;
++ if( nValue != 0 )
++ nValue = -1;
++// return uno::makeAny( nValue );
++// I must be missing something MSO says value should be -1 if selected, 0 if not
++// selected
++ return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False );
++}
++
++void SAL_CALL
++ScVbaCheckbox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
++{
++ sal_Int16 nValue = 0;
++ sal_Bool bValue = false;
++ if( _value >>= nValue )
++ {
++ if( nValue == -1)
++ nValue = 1;
++ }
++ else if ( _value >>= bValue )
++ {
++ if ( bValue )
++ nValue = 1;
++ }
++ m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
++}
++rtl::OUString&
++ScVbaCheckbox::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCheckbox") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaCheckbox::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.CheckBox" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbacheckbox.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacheckbox.hxx
+diff -N sc/source/ui/vba/vbacheckbox.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacheckbox.hxx 22 Apr 2008 19:53:15 -0000 1.1.2.1
+@@ -0,0 +1,58 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_CHECKBOX_HXX
++#define SC_VBA_CHECKBOX_HXX
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/msforms/XRadioButton.hpp>
++
++#include "vbacontrol.hxx"
++#include "vbahelper.hxx"
++
++typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XRadioButton > CheckBoxImpl_BASE;
++
++class ScVbaCheckbox : public CheckBoxImpl_BASE
++{
++public:
++ ScVbaCheckbox( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
++ // Attributes
++ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif //SC_VBA_CHECKBOX_HXX
+Index: sc/source/ui/vba/vbacombobox.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbacombobox.cxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.2
+diff -u -p -b -w -B -r1.4 -r1.3.42.2
+--- sc/source/ui/vba/vbacombobox.cxx 11 Apr 2008 00:55:28 -0000 1.4
++++ sc/source/ui/vba/vbacombobox.cxx 6 Jul 2008 15:29:37 -0000 1.3.42.2
+@@ -34,34 +34,93 @@ using namespace com::sun::star;
+ using namespace org::openoffice;
+
+
+-const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") );
++//SelectedItems list of integer indexes
++//StringItemList list of items
++
++const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") );
++const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") );
+ const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
++const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") );
+
+-ScVbaComboBox::ScVbaComboBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : ComboBoxImpl_BASE( xContext, xControlShape )
++ScVbaComboBox::ScVbaComboBox( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper, bool bDialogType ) : ComboBoxImpl_BASE( xParent, xContext, xControl, pGeomHelper ), mbDialogType( bDialogType )
+ {
++ if ( !mbDialogType )
+ // grab the default value property name
+ m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
+ }
+
+-ScVbaComboBox::ScVbaComboBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xPropSet, const css::uno::Reference< css::drawing::XControlShape > xControlShape ) : ComboBoxImpl_BASE( xContext, xPropSet, xControlShape )
+-{
+- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
+-}
++// Attributes
+
+
+-// Attributes
++// Value, [read] e.g. getValue returns the value of ooo Text propery e.g. the value in
++// the drop down
+ uno::Any SAL_CALL
+ ScVbaComboBox::getValue() throw (uno::RuntimeException)
+ {
++ if ( mbDialogType )
++ return m_xProps->getPropertyValue( TEXT );
++ else
+ return m_xProps->getPropertyValue( sSourceName );
+ }
+
+ void SAL_CALL
++ScVbaComboBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
++{
++// #TODO Test me please
++ uno::Sequence< rtl::OUString > sItems;
++ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
++ uno::Sequence< sal_Int16 > sSelection(1);
++ _value >>= sSelection[ 0 ];
++ if ( mbDialogType )
++ {
++ if ( sItems.getLength() == 0 || sSelection[0] < 0 || sSelection[ 0 ] >= sItems.getLength() )
++ throw uno::RuntimeException( rtl::OUString::createFromAscii("Illegal index"), uno::Reference< uno::XInterface >() );
++ setValue( uno::makeAny( sItems[ sSelection[ 0 ] ] ) );
++ }
++ else
++ {
++ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( sSelection ) );
++ }
++}
++
++uno::Any SAL_CALL
++ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
++{
++ uno::Sequence< rtl::OUString > sItems;
++ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
++ // should really return the item that has focus regardless of
++ // it been selected
++ if ( sItems.getLength() > 0 )
++ {
++ rtl::OUString sText = getText();
++ sal_Int32 nLen = sItems.getLength();
++ for ( sal_Int32 index = 0; sText.getLength() && index < nLen; ++index )
++ {
++ if ( sItems[ index ].equals( sText ) )
++ {
++ OSL_TRACE("getListIndex returning %d", index );
++ return uno::makeAny( index );
++ }
++
++ }
++ }
++ OSL_TRACE("getListIndex returning %d", -1 );
++ return uno::makeAny( sal_Int32( -1 ) );
++}
++
++// Value, [write]e.g. setValue sets the value in the drop down, and if the value is one
++// of the values in the list then the selection is also set
++void SAL_CALL
+ ScVbaComboBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+ {
++ if ( mbDialogType )
++ m_xProps->setPropertyValue( TEXT, _value );
++ else
+ m_xProps->setPropertyValue( sSourceName, _value );
+ }
+
++// see Value
++
+ ::rtl::OUString SAL_CALL
+ ScVbaComboBox::getText() throw (uno::RuntimeException)
+ {
+@@ -140,3 +199,22 @@ ScVbaComboBox::Clear( ) throw (uno::Run
+ setValue( uno::makeAny( rtl::OUString() ) );
+ m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) );
+ }
++
++rtl::OUString&
++ScVbaComboBox::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaComboBox") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaComboBox::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.ComboBox" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbacombobox.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbacombobox.hxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.2
+diff -u -p -b -w -B -r1.4 -r1.3.42.2
+--- sc/source/ui/vba/vbacombobox.hxx 11 Apr 2008 00:55:42 -0000 1.4
++++ sc/source/ui/vba/vbacombobox.hxx 6 Jul 2008 15:30:26 -0000 1.3.42.2
+@@ -44,22 +44,16 @@
+ typedef cppu::ImplInheritanceHelper2<ScVbaControl, oo::msforms::XComboBox, css::script::XDefaultProperty > ComboBoxImpl_BASE;
+ class ScVbaComboBox : public ComboBoxImpl_BASE
+ {
+-
+- //css::uno::Reference< css::uno::XComponentContext > m_xContext;
+- //css::uno::Reference< css::beans::XPropertySet > m_xProps;
+ rtl::OUString sSourceName;
+ rtl::OUString msDftPropName;
+-
++ bool mbDialogType;
+
+ public:
+- ScVbaComboBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
+- ScVbaComboBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::beans::XPropertySet >& xProps,
+- const css::uno::Reference< css::drawing::XControlShape> xControlShape );
+-
++ ScVbaComboBox( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper, bool bDialogType = false );
+
+ // Attributes
++ virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+@@ -71,6 +65,9 @@ public:
+
+ // XDefaultProperty
+ ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ };
+
+ #endif //
+Index: sc/source/ui/vba/vbacommandbar.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbar.cxx
+diff -N sc/source/ui/vba/vbacommandbar.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbar.cxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,329 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
++#include <com/sun/star/frame/XFrame.hpp>
++#include <com/sun/star/frame/XDesktop.hpp>
++#include <com/sun/star/frame/XLayoutManager.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++
++#include "vbacommandbar.hxx"
++#include "vbacommandbarcontrols.hxx"
++#include "vbahelper.hxx"
++
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< vba::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, sal_Int32 nModuleType ) throw (uno::RuntimeException) : CommandBar_BASE( xParent, xContext )
++{
++ // it's a menu bar
++ // only supporting factory menus ( no custom menus )
++ m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW );
++ initCommandBar();
++ switch( nModuleType )
++ {
++ case 0:
++ m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" );
++ break;
++ case 1:
++ m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" );
++ break;
++ default:
++ m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" );
++ }
++ getMenuSettings();
++ m_bIsMenu = sal_True;
++ m_bCustom = sal_False;
++}
++ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< vba::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sToolBarName, sal_Bool bTemporary, sal_Bool bCreate ) throw (uno::RuntimeException) : CommandBar_BASE( xParent, xContext )
++{
++ // it's a tool bar
++ m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW );
++ initCommandBar();
++ m_bTemporary = bTemporary;
++ m_bCreate = bCreate;
++ // get OOo ToolBarName
++ CommandBarNameMap::const_iterator iter = mCommandBarNameMap.find( sToolBarName.toAsciiLowerCase() );
++ if( iter != mCommandBarNameMap.end() )
++ {
++ m_sToolBarName = iter->second;
++ }
++ else
++ {
++ m_sToolBarName = sToolBarName;
++ }
++ m_sUIName = m_sToolBarName;
++ m_bIsMenu = sal_False;
++ getToolBarSettings( m_sToolBarName );
++}
++void
++ScVbaCommandBar::initCommandBar() throw (uno::RuntimeException)
++{
++ m_pScVbaCommandBars = dynamic_cast< ScVbaCommandBars* >( m_xParentHardRef.get() );
++ if ( !m_pScVbaCommandBars )
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Parent needs to be a ScVbaCommandBars"), uno::Reference< uno::XInterface >() );
++ m_bIsMenu = sal_False;
++ m_bCustom = sal_False;
++ m_bTemporary = sal_True;
++ m_sToolBarName = rtl::OUString::createFromAscii("");
++ m_sUIName = rtl::OUString::createFromAscii("");
++ m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" );
++}
++void
++ScVbaCommandBar::getToolBarSettings( rtl::OUString sToolBarName ) throw( uno::RuntimeException )
++{
++ rtl::OUString sFactoryToolBar = rtl::OUString::createFromAscii("private:resource/toolbar/") + sToolBarName.toAsciiLowerCase();
++ rtl::OUString sCustomToolBar = rtl::OUString::createFromAscii("private:resource/toolbar/custom_toolbar_") + sToolBarName;
++ uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
++ uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xUICfgManagerSup( xMSF->createInstance(rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier") ), uno::UNO_QUERY_THROW );
++ m_xUICfgManager.set( xUICfgManagerSup->getUIConfigurationManager( m_pScVbaCommandBars->GetModuleName() ), uno::UNO_QUERY_THROW );
++ m_xUICfgPers.set( m_xUICfgManager, uno::UNO_QUERY_THROW );
++ if( m_xUICfgManager->hasSettings( sFactoryToolBar ) )
++ {
++ // exsiting standard ToolBar
++ m_xBarSettings.set( m_xUICfgManager->getSettings( sFactoryToolBar, sal_True ), uno::UNO_QUERY_THROW );
++ m_sToolBarName = sFactoryToolBar;
++ }
++ else if( m_xUICfgManager->hasSettings( sCustomToolBar ) )
++ {
++ // exisiting custom ToolBar
++ m_xBarSettings.set( m_xUICfgManager->getSettings( sCustomToolBar, sal_True ), uno::UNO_QUERY_THROW );
++ m_sToolBarName = sCustomToolBar;
++ m_bCustom = sal_True;
++ }
++ else if( m_bCreate )
++ {
++ // new custom ToolBar
++ m_xBarSettings.set( m_xUICfgManager->createSettings(), uno::UNO_QUERY_THROW );
++ m_sToolBarName = sCustomToolBar;
++ m_bCustom = sal_True;
++ addCustomBar();
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii("ToolBar do not exist"), uno::Reference< uno::XInterface >() );
++ if( m_pScVbaCommandBars->GetWindows()->hasByName( m_sToolBarName ) )
++ {
++ uno::Any aToolBar = m_pScVbaCommandBars->GetWindows()->getByName( m_sToolBarName );
++ aToolBar >>= m_aToolBar;
++ }
++}
++void
++ScVbaCommandBar::addCustomBar()
++{
++ uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
++ xPropertySet->setPropertyValue(rtl::OUString::createFromAscii("UIName"), uno::makeAny( m_sUIName ));
++
++ if( m_xUICfgManager->hasSettings(m_sToolBarName) )
++ {
++ m_xUICfgManager->replaceSettings( m_sToolBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ else
++ {
++ m_xUICfgManager->insertSettings( m_sToolBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++}
++void
++ScVbaCommandBar::getMenuSettings()
++{
++ try
++ {
++ rtl::OUString sMenuBar = rtl::OUString::createFromAscii( "private:resource/menubar/menubar" );
++ uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
++ uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xUICfgManagerSup( xMSF->createInstance(rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier") ), uno::UNO_QUERY_THROW );
++ m_xUICfgManager.set( xUICfgManagerSup->getUIConfigurationManager( m_sMenuModuleName ), uno::UNO_QUERY_THROW );
++ m_xUICfgPers.set( m_xUICfgManager, uno::UNO_QUERY_THROW );
++ m_xBarSettings.set( m_xUICfgManager->getSettings( sMenuBar, sal_True ), uno::UNO_QUERY_THROW );
++ }
++ catch ( uno::Exception e)
++ {
++ OSL_TRACE( "getMenuSetting got a error\n" );
++ }
++}
++::rtl::OUString SAL_CALL
++ScVbaCommandBar::getName() throw ( uno::RuntimeException )
++{
++ // This will get a "NULL length string" when Name is not set.
++ uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
++ uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") );
++ rtl::OUString sName;
++ aName >>= sName;
++ if( sName.getLength() < 1 && !m_bIsMenu )
++ {
++ uno::Reference< container::XNameAccess > xNameAccess( m_pScVbaCommandBars->GetWindows(), uno::UNO_QUERY_THROW );
++ if( xNameAccess->hasByName( m_sToolBarName ) )
++ {
++ beans::PropertyValues aToolBar;
++ xNameAccess->getByName( m_sToolBarName ) >>= aToolBar;
++ sal_Int32 nCount = aToolBar.getLength();
++ beans::PropertyValue aPropertyValue;
++ for( sal_Int32 i = 0; i < nCount; i++ )
++ {
++ aPropertyValue = aToolBar[i];
++ if( aPropertyValue.Name.equals( rtl::OUString::createFromAscii("UIName") ) )
++ {
++ aPropertyValue.Value >>= sName;
++ return sName;
++ }
++ }
++ }
++ }
++ return sName;
++}
++void SAL_CALL
++ScVbaCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException)
++{
++ uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
++ xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("UIName"), uno::makeAny( _name ) );
++ uno::Reference< container::XIndexAccess > xIndexAccess( m_xBarSettings, uno::UNO_QUERY_THROW );
++
++ if( m_xUICfgManager->hasSettings( m_sToolBarName ) )
++ {
++ m_xUICfgManager->replaceSettings( m_sToolBarName, xIndexAccess );
++ }
++ else
++ {
++ // toolbar not found
++ }
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++}
++::sal_Bool SAL_CALL
++ScVbaCommandBar::getVisible() throw (uno::RuntimeException)
++{
++ sal_Bool bVisible = sal_False;
++ try
++ {
++ sal_Int32 i = 0;
++ while( !m_aToolBar[i].Name.equals( rtl::OUString::createFromAscii( "Visible" ) ) )
++ {
++ i++;
++ }
++ m_aToolBar[i].Value >>= bVisible;
++ }
++ catch ( uno::Exception e )
++ {
++ }
++ return bVisible;
++}
++void SAL_CALL
++ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
++{
++ try
++ {
++ uno::Reference< frame::XFrame > xFrame( getCurrentDocument()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
++ uno::Reference< beans::XPropertySet > xPropertySet( xFrame, uno::UNO_QUERY_THROW );
++ uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("LayoutManager") ), uno::UNO_QUERY_THROW );
++ if( _visible )
++ {
++ xLayoutManager->createElement( m_sToolBarName );
++ xLayoutManager->showElement( m_sToolBarName );
++ }
++ else
++ {
++ xLayoutManager->hideElement( m_sToolBarName );
++ xLayoutManager->destroyElement( m_sToolBarName );
++ }
++ }
++ catch( uno::Exception e )
++ {
++ OSL_TRACE( "SetVisible get an exception\n" );
++ }
++}
++void SAL_CALL
++ScVbaCommandBar::Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ if( m_bCustom )
++ {
++ if( m_xUICfgManager->hasSettings( m_sToolBarName ) )
++ {
++ m_xUICfgManager->removeSettings(m_sToolBarName);
++ // make it permanent
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++ }
++ else
++ {
++ // toolbar not found
++ // TODO throw Error
++ }
++ uno::Reference< container::XNameContainer > xNameContainer( m_pScVbaCommandBars->GetWindows(), uno::UNO_QUERY_THROW );
++ if( xNameContainer->hasByName( m_sToolBarName ) )
++ {
++ xNameContainer->removeByName( m_sToolBarName );
++ }
++ }
++}
++uno::Any SAL_CALL
++ScVbaCommandBar::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
++{
++ sal_Int32 nIndex;
++ uno::Reference< vba::XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, uno::Reference< container::XIndexAccess >() ) );
++ if( aIndex.hasValue() )
++ {
++ if( aIndex >>= nIndex )
++ {
++ uno::Reference< vba::XCommandBarControl > xCommandBarControl( xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW );
++ return uno::makeAny( xCommandBarControl );
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "invalid index" ), uno::Reference< uno::XInterface >() );
++ }
++ return uno::makeAny( xCommandBarControls );
++}
++rtl::OUString&
++ScVbaCommandBar::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBar") );
++ return sImplName;
++}
++uno::Sequence<rtl::OUString>
++ScVbaCommandBar::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.vba.CommandBar" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbacommandbar.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbar.hxx
+diff -N sc/source/ui/vba/vbacommandbar.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbar.hxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,105 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_COMMANDBAR_HXX
++#define SC_VBA_COMMANDBAR_HXX
++
++#include <org/openoffice/vba/XCommandBar.hpp>
++#include <com/sun/star/ui/XUIConfigurationManager.hpp>
++#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
++#include <com/sun/star/container/XIndexContainer.hpp>
++#include <com/sun/star/beans/PropertyValues.hpp>
++
++#include "vbahelperinterface.hxx"
++#include "vbacommandbars.hxx"
++
++#include <map>
++typedef std::map< const rtl::OUString, rtl::OUString > CommandBarNameMap;
++typedef std::pair< const rtl::OUString, rtl::OUString > CommandBarNamePair;
++const CommandBarNamePair namePair[] = {
++ CommandBarNamePair( rtl::OUString::createFromAscii("standard"), rtl::OUString::createFromAscii("standardbar") ),
++ CommandBarNamePair( rtl::OUString::createFromAscii("formatting"), rtl::OUString::createFromAscii("formatobjectbar") ),
++};
++static const CommandBarNameMap mCommandBarNameMap( namePair, ( namePair + sizeof(namePair) / sizeof(namePair[0]) ) );
++
++
++typedef InheritedHelperInterfaceImpl1< oo::vba::XCommandBar > CommandBar_BASE;
++
++class ScVbaCommandBar : public CommandBar_BASE
++{
++private:
++ rtl::OUString m_sToolBarName;
++ rtl::OUString m_sMenuModuleName;
++ rtl::OUString m_sUIName;
++ sal_Bool m_bTemporary;
++ sal_Bool m_bIsMenu;
++ sal_Bool m_bCustom;
++ sal_Bool m_bCreate;
++ ScVbaCommandBars* m_pScVbaCommandBars;
++ css::beans::PropertyValues m_aToolBar;
++ // hard reference for parent
++ css::uno::Reference< oo::vba::XHelperInterface > m_xParentHardRef;
++ css::uno::Reference< css::ui::XUIConfigurationManager > m_xUICfgManager;
++ css::uno::Reference< css::ui::XUIConfigurationPersistence > m_xUICfgPers;
++ css::uno::Reference< css::container::XIndexContainer > m_xBarSettings;
++ void initCommandBar() throw( css::uno::RuntimeException );
++protected:
++ void getToolBarSettings( rtl::OUString sToolBarName ) throw( css::uno::RuntimeException );
++ void getMenuSettings();
++ void addCustomBar();
++public:
++ ScVbaCommandBar( const css::uno::Reference< oo::vba::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, sal_Int32 nModuleType ) throw( css::uno::RuntimeException );
++ ScVbaCommandBar( const css::uno::Reference< oo::vba::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sToolBarName, sal_Bool bTemporary, sal_Bool bCreate ) throw( css::uno::RuntimeException );
++
++ sal_Bool IsMenu() { return m_bIsMenu; };
++ css::uno::Reference< css::ui::XUIConfigurationManager > GetUICfgManager() { return m_xUICfgManager; };
++ css::uno::Reference< css::ui::XUIConfigurationPersistence > GetUICfgPers() { return m_xUICfgPers; };
++ css::uno::Reference< css::container::XIndexContainer > GetBarSettings() { return m_xBarSettings; };
++ rtl::OUString GetToolBarName() { return m_sToolBarName; };
++
++ // Attributes
++ virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException);
++ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
++
++ // Methods
++ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif//SC_VBA_COMMANDBAR_HXX
+Index: sc/source/ui/vba/vbacommandbarcontrol.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbarcontrol.cxx
+diff -N sc/source/ui/vba/vbacommandbarcontrol.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbarcontrol.cxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,403 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbacommandbarcontrol.hxx"
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++uno::Any lcl_getPropertyValue( beans::PropertyValues aPropertyValues, rtl::OUString sPropertyName )
++{
++ sal_Int32 nCount = aPropertyValues.getLength();
++ for( sal_Int32 i = 0; i < nCount; i++ )
++ {
++ if( aPropertyValues[i].Name.equalsIgnoreAsciiCase( sPropertyName ) )
++ {
++ return aPropertyValues[i].Value;
++ }
++ }
++ return uno::Any();
++}
++
++beans::PropertyValues lcl_repalcePropertyValue( beans::PropertyValues aPropertyValues, rtl::OUString sPropertyName, uno::Any aValue )
++{
++ sal_Int32 nCount = aPropertyValues.getLength();
++ for( sal_Int32 i = 0; i < nCount; i++ )
++ {
++ if( aPropertyValues[i].Name.equalsIgnoreAsciiCase( sPropertyName ) )
++ {
++ aPropertyValues[i].Value = aValue;
++ return aPropertyValues;
++ }
++ }
++ return aPropertyValues;
++}
++
++ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< vba::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_sName( sName )
++{
++ // exsiting CommandBarBarControl
++ m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW );
++ initObjects();
++ if( m_xBarSettings->hasElements() )
++ {
++ ScVbaCommandBarControl* pParentCommandBarControl = m_pCommandBarControls->GetParentCommandBarControl();
++ if( pParentCommandBarControl )
++ {
++ beans::PropertyValues aPropertyValues;
++ pParentCommandBarControl->GetCurrentSettings()->getByIndex( pParentCommandBarControl->GetPosition() ) >>= aPropertyValues;
++ pParentCommandBarControl->SetPropertyValues( aPropertyValues );
++ m_xCurrentSettings.set( lcl_getPropertyValue( pParentCommandBarControl->GetPropertyValues(), rtl::OUString::createFromAscii( "ItemDescriptorContainer" ) ), uno::UNO_QUERY_THROW );
++ }
++ if( !m_xCurrentSettings.is() )
++ {
++ m_xCurrentSettings.set( m_xUICfgManager->getSettings( m_pCommandBarControls->GetParentToolBarName(), sal_True ), uno::UNO_QUERY_THROW );
++ }
++ for( sal_Int32 i = 0; i < m_xCurrentSettings->getCount(); i++ )
++ {
++ beans::PropertyValues aPropertyValuesTemp;
++ m_xCurrentSettings->getByIndex( i ) >>= aPropertyValuesTemp;
++ // Label always empty in OOo
++ rtl::OUString sLabel;
++ lcl_getPropertyValue( aPropertyValuesTemp, rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
++ if( sLabel.equalsIgnoreAsciiCase( sName ) )
++ {
++ m_nPosition = i;
++ break;
++ }
++ // using CammandURL to find
++ rtl::OUString sCommandURL;
++ lcl_getPropertyValue( aPropertyValuesTemp, rtl::OUString::createFromAscii( "CommandURL" ) ) >>= sCommandURL;
++ sal_Int32 nLastIndex = sCommandURL.lastIndexOf( rtl::OUString::createFromAscii(":") );
++ if( ( nLastIndex != -1 ) && ( ( nLastIndex + 1 ) < sCommandURL.getLength() ) )
++ {
++ sCommandURL = sCommandURL.copy( nLastIndex + 1 );
++ }
++ if( sCommandURL.equalsIgnoreAsciiCase( sName ) )
++ {
++ m_nPosition = i;
++ break;
++ }
++ }
++ if( m_nPosition == -1 )
++ throw uno::RuntimeException( rtl::OUString::createFromAscii("The CommandBarControl do not exist"), uno::Reference< uno::XInterface >() );
++ }
++ if( m_bIsMenu )
++ {
++ m_sBarName = rtl::OUString::createFromAscii("private:resource/menubar/menubar");
++ }
++ else
++ {
++ m_sBarName = m_pCommandBarControls->GetParentToolBarName();
++ }
++ m_bTemporary = sal_True;
++}
++ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< vba::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_nPosition( nPosition ), m_bTemporary( bTemporary )
++{
++ m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW );
++ initObjects();
++ if( sName.getLength() > 0 )
++ {
++ m_sName = sName;
++ }
++ if( sCommand.getLength() > 0 )
++ {
++ m_sCommand = sCommand;
++ }
++ else
++ {
++ m_sCommand = rtl::OUString::createFromAscii("vnd.openoffice.org:") + sName;
++ }
++ if( m_bIsMenu )
++ {
++ m_sBarName = rtl::OUString::createFromAscii("private:resource/menubar/menubar");
++ createNewMenuBarControl();
++ }
++ else
++ {
++ m_sBarName = m_pCommandBarControls->GetParentToolBarName();
++ createNewToolBarControl();
++ }
++}
++
++void
++ScVbaCommandBarControl::initObjects() throw (uno::RuntimeException)
++{
++ m_pCommandBarControls = dynamic_cast< ScVbaCommandBarControls* >( m_xParentHardRef.get() );
++ if( !m_pCommandBarControls )
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Parent needs to be a ScVbaCommandBarControls"), uno::Reference< uno::XInterface >() );
++ m_xUICfgManager.set( m_pCommandBarControls->GetUICfgManager(), uno::UNO_QUERY_THROW );
++ m_xUICfgPers.set( m_pCommandBarControls->GetUICfgPers(), uno::UNO_QUERY_THROW );
++ m_xBarSettings.set( m_pCommandBarControls->GetBarSettings(), uno::UNO_QUERY_THROW );
++ m_bIsMenu = m_pCommandBarControls->IsMenu();
++ m_sName = rtl::OUString::createFromAscii( "Custom" );
++ m_nPosition = -1;
++}
++
++void
++ScVbaCommandBarControl::createNewMenuBarControl()
++{
++ uno::Sequence< beans::PropertyValue > aPropertys(4);
++ aPropertys[0].Name = rtl::OUString::createFromAscii("CommandURL");
++ aPropertys[0].Value <<= m_sCommand;
++ aPropertys[1].Name = rtl::OUString::createFromAscii("Label");
++ aPropertys[1].Value <<= m_sName;
++ aPropertys[2].Name = rtl::OUString::createFromAscii("Type");
++ aPropertys[2].Value <<= m_nType;
++ aPropertys[3].Name = rtl::OUString::createFromAscii("ItemDescriptorContainer");
++
++ m_xBarSettings->insertByIndex( m_nPosition, uno::makeAny( aPropertys ) );
++ uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
++ rtl::OUString sUIName;
++ xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") ) >>= sUIName;
++
++ uno::Reference< lang::XSingleComponentFactory > xMenuMSF( m_xBarSettings, uno::UNO_QUERY_THROW );
++ if( m_pCommandBarControls->GetParentCommandBar() != NULL )
++ {
++ // create a new menu
++ m_xBarSettings->insertByIndex( m_nPosition, uno::makeAny( aPropertys ) );
++ m_xCurrentSettings.set( m_xBarSettings, uno::UNO_QUERY_THROW );
++ }
++ else if( m_pCommandBarControls->GetParentCommandBarControl() != NULL )
++ {
++ // create a new menu entry
++ // change the parent MenuItem to a PopupMenu
++ ScVbaCommandBarControl* pPc = m_pCommandBarControls->GetParentCommandBarControl();
++ beans::PropertyValues aPropertyValues;
++ pPc->GetCurrentSettings()->getByIndex( pPc->GetPosition() ) >>= aPropertyValues;
++ pPc->SetPropertyValues( aPropertyValues );
++
++ // has the property already been set?
++ if( lcl_getPropertyValue( pPc->GetPropertyValues(), rtl::OUString::createFromAscii("ItemDescriptorContainer") ).hasValue() )
++ {
++ lcl_repalcePropertyValue( pPc->GetPropertyValues(), rtl::OUString::createFromAscii("ItemDescriptorContainer"), uno::makeAny( xMenuMSF->createInstanceWithContext( mxContext ) ) );
++ pPc->GetCurrentSettings()->replaceByIndex( pPc->GetPosition(), uno::makeAny( pPc->GetPropertyValues() ) );
++ }
++ m_xCurrentSettings.set( lcl_getPropertyValue( pPc->GetPropertyValues(), rtl::OUString::createFromAscii("ItemDescriptorContainer") ), uno::UNO_QUERY_THROW );
++ m_xCurrentSettings->insertByIndex( m_nPosition, uno::makeAny( m_aPropertyValues ) );
++ }
++ if( m_xUICfgManager->hasSettings( m_sBarName ) )
++ {
++ m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ else
++ {
++ m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++}
++
++void
++ScVbaCommandBarControl::createNewToolBarControl()
++{
++ uno::Sequence< beans::PropertyValue > aPropertys(4);
++ aPropertys[0].Name = rtl::OUString::createFromAscii("CommandURL");
++ aPropertys[0].Value <<= m_sCommand;
++ aPropertys[1].Name = rtl::OUString::createFromAscii("Label");
++ aPropertys[1].Value <<= m_sName;
++ aPropertys[2].Name = rtl::OUString::createFromAscii("Type");
++ aPropertys[2].Value <<= m_nType;
++ aPropertys[3].Name = rtl::OUString::createFromAscii("IsVisible");
++ aPropertys[3].Value <<= sal_True;
++
++ m_xBarSettings->insertByIndex( m_nPosition, uno::makeAny( aPropertys ) );
++ uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
++ rtl::OUString sUIName;
++ xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") ) >>= sUIName;
++
++ m_xCurrentSettings.set( m_xBarSettings, uno::UNO_QUERY_THROW );
++ if( m_xUICfgManager->hasSettings( m_sBarName ) )
++ {
++ m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ else
++ {
++ m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++}
++
++::rtl::OUString SAL_CALL
++ScVbaCommandBarControl::getCaption() throw ( uno::RuntimeException )
++{
++ // "Label" always empty
++ rtl::OUString sCaption;
++ beans::PropertyValues aPropertyValues;
++ if( m_xCurrentSettings.is() )
++ {
++ m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues;
++ lcl_getPropertyValue( aPropertyValues, rtl::OUString::createFromAscii("Label") ) >>= sCaption;
++ }
++ else if( m_xBarSettings.is() )
++ {
++ m_xBarSettings->getByIndex( m_nPosition ) >>= aPropertyValues;
++ lcl_getPropertyValue( aPropertyValues, rtl::OUString::createFromAscii("Label") ) >>= sCaption;
++ }
++ return sCaption;
++}
++void SAL_CALL
++ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
++{
++ if( m_xCurrentSettings.is() )
++ {
++ beans::PropertyValues aPropertyValues;
++ m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues;
++ beans::PropertyValues aNewPropertyValues;
++ aNewPropertyValues = lcl_repalcePropertyValue( aPropertyValues, rtl::OUString::createFromAscii("Label"), uno::makeAny( _caption ) );
++ m_xCurrentSettings->replaceByIndex( m_nPosition, uno::makeAny( aNewPropertyValues ) );
++ if( m_xUICfgManager->hasSettings( m_sBarName ) )
++ {
++ m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ else
++ {
++ m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ // make it permanent
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++ }
++}
++::rtl::OUString SAL_CALL
++ScVbaCommandBarControl::getOnAction() throw (uno::RuntimeException)
++{
++ if( m_xCurrentSettings.is() )
++ {
++ beans::PropertyValues aPropertyValues;
++ m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues;
++ rtl::OUString sCommandURL;
++ lcl_getPropertyValue( aPropertyValues, rtl::OUString::createFromAscii( "CommandURL" ) ) >>= sCommandURL;
++ return sCommandURL;
++ }
++ return ::rtl::OUString();
++}
++void SAL_CALL
++ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException)
++{
++ if( m_xCurrentSettings.is() )
++ {
++ beans::PropertyValues aPropertyValues;
++ m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues;
++ beans::PropertyValues aNewPropertyValues;
++ aNewPropertyValues = lcl_repalcePropertyValue( aPropertyValues, rtl::OUString::createFromAscii("CommandURL"), uno::makeAny( _onaction ) );
++ m_xCurrentSettings->replaceByIndex( m_nPosition, uno::makeAny( aNewPropertyValues ) );
++ if( m_xUICfgManager->hasSettings( m_sBarName ) )
++ {
++ m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ else
++ {
++ m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ // make it permanent
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++ }
++}
++::sal_Bool SAL_CALL
++ScVbaCommandBarControl::getVisible() throw (uno::RuntimeException)
++{
++ // not possible in UNO?
++ return sal_True;
++}
++void SAL_CALL
++ScVbaCommandBarControl::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
++{
++ // "IsVisilbe"
++}
++void SAL_CALL
++ScVbaCommandBarControl::Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ if( m_xCurrentSettings.is() )
++ {
++ m_xCurrentSettings->removeByIndex( m_nPosition );
++
++ if( m_xUICfgManager->hasSettings( m_sBarName ) )
++ {
++ m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ else
++ {
++ m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) );
++ }
++ // make it permanent
++ if( !m_bTemporary )
++ {
++ m_xUICfgPers->store();
++ }
++ }
++}
++uno::Any SAL_CALL
++ScVbaCommandBarControl::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
++{
++ sal_Int32 nIndex;
++ uno::Reference< vba::XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, uno::Reference< container::XIndexAccess >() ) );
++ if( aIndex.hasValue() )
++ {
++ if( aIndex >>= nIndex )
++ {
++ uno::Reference< vba::XCommandBarControl > xCommandBarControl( xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW );
++ return uno::makeAny( xCommandBarControl );
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "invalid index" ), uno::Reference< uno::XInterface >() );
++ }
++ return uno::makeAny( xCommandBarControls );
++}
++rtl::OUString&
++ScVbaCommandBarControl::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControl") );
++ return sImplName;
++}
++uno::Sequence<rtl::OUString>
++ScVbaCommandBarControl::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.vba.CommandBarControl" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbacommandbarcontrol.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbarcontrol.hxx
+diff -N sc/source/ui/vba/vbacommandbarcontrol.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbarcontrol.hxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,90 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_COMMANDBARCONTROL_HXX
++#define SC_VBA_COMMANDBARCONTROL_HXX
++
++#include <org/openoffice/vba/XCommandBarControl.hpp>
++
++#include "vbahelperinterface.hxx"
++#include "vbacommandbarcontrols.hxx"
++
++typedef InheritedHelperInterfaceImpl1< oo::vba::XCommandBarControl > CommandBarControl_BASE;
++
++class ScVbaCommandBarControl : public CommandBarControl_BASE
++{
++private:
++ rtl::OUString m_sName;
++ rtl::OUString m_sBarName;
++ rtl::OUString m_sCommand;
++ sal_Int32 m_nType;
++ sal_Int32 m_nPosition;
++ sal_Bool m_bTemporary;
++ sal_Bool m_bIsMenu;
++ ScVbaCommandBarControls* m_pCommandBarControls;
++ css::uno::Reference< oo::vba::XHelperInterface > m_xParentHardRef;
++ css::uno::Reference< css::ui::XUIConfigurationManager > m_xUICfgManager;
++ css::uno::Reference< css::ui::XUIConfigurationPersistence > m_xUICfgPers;
++ css::uno::Reference< css::container::XIndexContainer > m_xBarSettings;
++ css::uno::Reference< css::container::XIndexContainer > m_xCurrentSettings;
++ css::beans::PropertyValues m_aPropertyValues;
++
++ void initObjects() throw (css::uno::RuntimeException);
++ void createNewMenuBarControl();
++ void createNewToolBarControl();
++public:
++ ScVbaCommandBarControl( const css::uno::Reference< oo::vba::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName ) throw (css::uno::RuntimeException);
++ ScVbaCommandBarControl( const css::uno::Reference< oo::vba::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
++ sal_Int32 GetPosition() { return m_nPosition; };
++ css::uno::Reference< css::container::XIndexContainer > GetCurrentSettings() { return m_xCurrentSettings; };
++ css::beans::PropertyValues GetPropertyValues() { return m_aPropertyValues; };
++ void SetPropertyValues( css::beans::PropertyValues aPropertyValues ) { m_aPropertyValues = aPropertyValues; };
++
++ // Attributes
++ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException);
++ virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException);
++ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
++
++ // Methods
++ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif//SC_VBA_COMMANDBARCONTROL_HXX
+Index: sc/source/ui/vba/vbacommandbarcontrols.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbarcontrols.cxx
+diff -N sc/source/ui/vba/vbacommandbarcontrols.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbarcontrols.cxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,247 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbacommandbarcontrols.hxx"
++#include "vbacommandbarcontrol.hxx"
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++typedef ::cppu::WeakImplHelper1< container::XEnumeration > CommandBarControlEnumeration_BASE;
++class CommandBarControlEnumeration : public CommandBarControlEnumeration_BASE
++{
++ //uno::Reference< uno::XComponentContext > m_xContext;
++ ScVbaCommandBarControls* m_pCommandBarControls;
++ sal_Int32 m_nCurrentPosition;
++public:
++ CommandBarControlEnumeration( ScVbaCommandBarControls* pCommandBarControls ) : m_pCommandBarControls( pCommandBarControls ), m_nCurrentPosition( 0 ) {}
++ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
++ {
++ if( m_nCurrentPosition < m_pCommandBarControls->getCount() )
++ return sal_True;
++ return sal_False;
++ }
++ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
++ {
++ if( hasMoreElements() )
++ {
++ rtl::OUString sName = m_pCommandBarControls->GetControlNameByIndex( m_nCurrentPosition );
++ m_nCurrentPosition = m_nCurrentPosition + 1;
++ if( sName.getLength() > 0 )
++ return m_pCommandBarControls->createCollectionObject( uno::makeAny( sName ) );
++ else
++ return nextElement();
++ }
++ else
++ throw container::NoSuchElementException();
++ return uno::Any();
++ }
++};
++
++ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< vba::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< container::XIndexAccess> xIndexAccess ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess )
++{
++ m_bIsMenu = sal_False;
++ m_bHasElements = sal_False;
++ m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW );
++ m_pCommandBar = dynamic_cast< ScVbaCommandBar* >( m_xParentHardRef.get() );
++ m_pCommandBarControl = dynamic_cast< ScVbaCommandBarControl* >( m_xParentHardRef.get() );
++ if( m_pCommandBar )
++ {
++ m_xUICfgManager.set( m_pCommandBar->GetUICfgManager(), uno::UNO_QUERY_THROW );
++ m_xUICfgPers.set( m_pCommandBar->GetUICfgPers(), uno::UNO_QUERY_THROW );
++ m_xBarSettings.set( m_pCommandBar->GetBarSettings(), uno::UNO_QUERY_THROW );
++ m_bIsMenu = m_pCommandBar->IsMenu();
++ if( m_xBarSettings->hasElements() )
++ {
++ m_bHasElements = sal_True;
++ }
++ }
++ else if( m_pCommandBarControl )
++ {
++ }
++ else
++ {
++ throw uno::RuntimeException( rtl::OUString::createFromAscii("Parent needs to be a ScVbaCommandBar or a ScVbaCommandBarControl"), uno::Reference< uno::XInterface >() );
++ }
++}
++rtl::OUString
++ScVbaCommandBarControls::GetControlNameByIndex( const sal_Int32 nIndex ) throw ( uno::RuntimeException )
++{
++ sal_Int32 nCount = 0;
++ if( m_bHasElements )
++ {
++ sal_Int32 nBarSettingsCount = m_xBarSettings->getCount();
++ for( sal_Int32 i = 0; i < nBarSettingsCount; i++ )
++ {
++ beans::PropertyValues aMenuValues;
++ m_xBarSettings->getByIndex( i ) >>= aMenuValues;
++ for( sal_Int32 j = 0; j < aMenuValues.getLength(); j++ )
++ {
++ if( aMenuValues[j].Name.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii( "CommandURL" ) ) )
++ {
++ nCount++;
++ if( nIndex == nCount )
++ {
++ rtl::OUString sCommandURL;
++ aMenuValues[j].Value >>= sCommandURL;
++ sal_Int32 nLastIndex = sCommandURL.lastIndexOf( rtl::OUString::createFromAscii(":") );
++ if( ( nLastIndex != -1 ) && ( ( nLastIndex +1 ) < sCommandURL.getLength() ) )
++ {
++ sCommandURL = sCommandURL.copy( nLastIndex + 1 );
++ return sCommandURL;
++ }
++ }
++ }
++ }
++ }
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Out of bound" ), uno::Reference< uno::XInterface >() );
++ return rtl::OUString();
++}
++
++// Attributes
++sal_Int32 SAL_CALL
++ScVbaCommandBarControls::getCount() throw (uno::RuntimeException)
++{
++ sal_Int32 nCount = 0;
++ if( m_bHasElements )
++ {
++ sal_Int32 nBarSettingsCount = m_xBarSettings->getCount();
++ for( sal_Int32 i = 0; i < nBarSettingsCount; i++ )
++ {
++ beans::PropertyValues aMenuValues;
++ m_xBarSettings->getByIndex( i ) >>= aMenuValues;
++ for( sal_Int32 j = 0; j < aMenuValues.getLength(); j++ )
++ {
++ if( aMenuValues[j].Name.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii( "CommandURL" ) ) )
++ {
++ nCount++;
++ }
++ }
++ }
++ }
++ return nCount;
++}
++// XEnumerationAccess
++uno::Type SAL_CALL
++ScVbaCommandBarControls::getElementType() throw ( uno::RuntimeException )
++{
++ return vba::XCommandBarControls::static_type( 0 );
++}
++uno::Reference< container::XEnumeration >
++ScVbaCommandBarControls::createEnumeration() throw ( uno::RuntimeException )
++{
++ return uno::Reference< container::XEnumeration >( new CommandBarControlEnumeration( this ) );
++}
++uno::Any
++ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
++{
++ // only surport the aSource as a name string, because this class is a API wrapper
++ rtl::OUString sName;
++ if( aSource >>= sName )
++ return uno::makeAny( uno::Reference< vba::XCommandBarControl > ( new ScVbaCommandBarControl( this, mxContext, sName ) ) );
++ return uno::Any();
++}
++
++// Methods
++uno::Any SAL_CALL
++ScVbaCommandBarControls::Item( const uno::Any& aIndex, const uno::Any& /*aIndex*/ ) throw (uno::RuntimeException)
++{
++ if( aIndex.getValueTypeClass() == uno::TypeClass_STRING )
++ {
++ return createCollectionObject( aIndex );
++ }
++ sal_Int32 nIndex;
++ if( aIndex >>= nIndex )
++ {
++ return createCollectionObject( uno::makeAny( GetControlNameByIndex( nIndex ) ) );
++ }
++
++ return uno::Any();
++}
++uno::Reference< vba::XCommandBarControl > SAL_CALL
++ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const uno::Any& Parameter, const uno::Any& Before, const uno::Any& Temporary ) throw (script::BasicErrorException, uno::RuntimeException)
++{
++ // Parameter is not supported
++ // the following name needs to be individually created;
++ rtl::OUString sCaption( rtl::OUString::createFromAscii("custom Control") );
++ rtl::OUString sCommand( rtl::OUString::createFromAscii("macro:///Standard.Module1.Test()") );
++ sal_Int32 nType =0;
++ sal_Int32 nPosition = 0;
++ sal_Int32 nId;
++ sal_Bool bTemporary = sal_True;
++
++ if( Type.hasValue() )
++ if( Type >>= nType )
++ {
++ // evalute the type of the new control
++ }
++ if( Id.hasValue() )
++ if( Id >>= nId )
++ {
++ // evalute the action of the new control
++ }
++ if( Before.hasValue() )
++ if( Before >>= nPosition )
++ {
++ // evalute the position of the new Control
++ }
++ if( Temporary.hasValue() )
++ if( Temporary >>= bTemporary )
++ {
++ // evalute the temporary of the new Control
++ }
++ return uno::Reference< vba::XCommandBarControl > ( new ScVbaCommandBarControl( this, mxContext, sCaption, sCommand, nPosition, bTemporary ) );
++}
++
++// XHelperInterface
++rtl::OUString&
++ScVbaCommandBarControls::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControls") );
++ return sImplName;
++}
++uno::Sequence<rtl::OUString>
++ScVbaCommandBarControls::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.vba.CommandBarControls" ) );
++ }
++ return aServiceNames;
++}
++
+Index: sc/source/ui/vba/vbacommandbarcontrols.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbarcontrols.hxx
+diff -N sc/source/ui/vba/vbacommandbarcontrols.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbarcontrols.hxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,90 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_COMMANDBARCONTROLS_HXX
++#define SC_VBA_COMMANDBARCONTROLS_HXX
++
++#include <org/openoffice/vba/XCommandBarControls.hpp>
++
++#include "vbahelperinterface.hxx"
++#include "vbacommandbar.hxx"
++#include "vbacollectionimpl.hxx"
++
++class ScVbaCommandBarControl;
++
++typedef CollTestImplHelper< oo::vba::XCommandBarControls > CommandBarControls_BASE;
++
++class ScVbaCommandBarControls : public CommandBarControls_BASE
++{
++private:
++ sal_Bool m_bIsMenu;
++ sal_Bool m_bHasElements;
++ ScVbaCommandBar* m_pCommandBar;
++ ScVbaCommandBarControl* m_pCommandBarControl;
++ css::uno::Reference< oo::vba::XHelperInterface > m_xParentHardRef;
++ css::uno::Reference< css::ui::XUIConfigurationManager > m_xUICfgManager;
++ css::uno::Reference< css::ui::XUIConfigurationPersistence > m_xUICfgPers;
++ css::uno::Reference< css::container::XIndexContainer > m_xBarSettings;
++
++public:
++ ScVbaCommandBarControls( const css::uno::Reference< oo::vba::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::container::XIndexAccess > xIndexAccess ) throw( css::uno::RuntimeException );
++ css::uno::Reference< css::ui::XUIConfigurationManager > GetUICfgManager() { return m_xUICfgManager; };
++ css::uno::Reference< css::ui::XUIConfigurationPersistence > GetUICfgPers() { return m_xUICfgPers; };
++ css::uno::Reference< css::container::XIndexContainer > GetBarSettings() { return m_xBarSettings; };
++ sal_Bool IsMenu() { return m_bIsMenu; };
++ ScVbaCommandBar* GetParentCommandBar() { return m_pCommandBar; };
++ ScVbaCommandBarControl* GetParentCommandBarControl() { return m_pCommandBarControl; };
++ rtl::OUString GetParentToolBarName()
++ {
++ if( m_pCommandBar ) return m_pCommandBar->GetToolBarName();
++ else return rtl::OUString();
++ }
++ rtl::OUString GetControlNameByIndex( const sal_Int32 nIndex ) throw ( css::uno::RuntimeException );
++
++ // Attributes
++ virtual ::sal_Int32 SAL_CALL getCount() throw (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& aSource );
++
++ // Methods
++ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::vba::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
++#endif//SC_VBA_COMMANDBARCONTROLS_HXX
+Index: sc/source/ui/vba/vbacommandbars.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbars.cxx
+diff -N sc/source/ui/vba/vbacommandbars.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbars.cxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,247 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#include <com/sun/star/frame/XDesktop.hpp>
++#include <com/sun/star/container/XNameAccess.hpp>
++
++#include "vbacommandbars.hxx"
++#include "vbacommandbar.hxx"
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++typedef ::cppu::WeakImplHelper1< container::XEnumeration > CommandBarEnumeration_BASE;
++
++static rtl::OUString sSpreadsheetDocumentUrl( rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ) );
++static rtl::OUString sTextDocumentUrl( rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" ) );
++static rtl::OUString sWindowStateConfUrl( rtl::OUString::createFromAscii( "com.sun.star.ui.WindowStateConfiguration" ) );
++
++class CommandBarEnumeration : public CommandBarEnumeration_BASE
++{
++ uno::Reference< uno::XComponentContext > m_xContext;
++ uno::Reference< vba::XCommandBars > m_xCommandBars;
++ uno::Sequence< rtl::OUString > m_sNames;
++ sal_Int32 m_nCurrentPosition;
++public:
++ CommandBarEnumeration( const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< vba::XCommandBars > xCommandBars, const uno::Sequence< rtl::OUString > sNames ) : m_xContext( xContext ), m_xCommandBars( xCommandBars ), m_sNames( sNames ), m_nCurrentPosition( 0 )
++ {
++ }
++ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
++ {
++ if( m_nCurrentPosition < m_sNames.getLength() )
++ return sal_True;
++ return sal_False;
++ }
++ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
++ {
++ if( hasMoreElements() )
++ {
++ rtl::OUString sName( m_sNames[ m_nCurrentPosition ] );
++ m_nCurrentPosition = m_nCurrentPosition + 1;
++ if( sName.indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
++ {
++ sal_Int32 nLastIndex = sName.lastIndexOf( rtl::OUString::createFromAscii( "/" ) );
++ if( ( nLastIndex != -1 ) && ( ( nLastIndex + 1 ) < sName.getLength() ) )
++ {
++ sName = sName.copy( nLastIndex + 1);
++ if( sName.getLength() > 0 )
++ {
++ uno::Reference< vba::XHelperInterface > xHelperInterface( m_xCommandBars, uno::UNO_QUERY_THROW );
++ uno::Reference< vba::XCommandBar > xCommandBar( new ScVbaCommandBar( xHelperInterface, m_xContext, sName, sal_True, sal_False ) );
++ if( xCommandBar.is() )
++ return uno::makeAny( xCommandBar );
++ else
++ return nextElement();
++ }
++ else
++ return nextElement();
++ }
++ }
++ else
++ return nextElement();
++ }
++ else
++ throw container::NoSuchElementException();
++ return uno::Any();
++ }
++};
++
++
++ScVbaCommandBars::ScVbaCommandBars( const uno::Reference< vba::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< container::XIndexAccess > xIndexAccess ) : CommandBars_BASE( xParent, xContext, xIndexAccess )
++{
++ retrieveObjects();
++}
++void
++ScVbaCommandBars::retrieveObjects() throw ( uno::RuntimeException )
++{
++ uno::Reference< lang::XServiceInfo > xServiceInfo( getCurrentDocument(), uno::UNO_QUERY_THROW );
++ if( xServiceInfo->supportsService( sSpreadsheetDocumentUrl ) )
++ {
++ m_sModuleName = sSpreadsheetDocumentUrl;
++ }
++ else if( xServiceInfo->supportsService( sTextDocumentUrl ) )
++ {
++ m_sModuleName = sTextDocumentUrl;
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Unsupported Document" ), uno::Reference< uno::XInterface >() );
++
++ uno::Reference < lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
++ uno::Reference < container::XNameAccess > xNameAccess( xMSF->createInstance( sWindowStateConfUrl ), uno::UNO_QUERY_THROW );
++ m_xNameAccess.set( xNameAccess->getByName( m_sModuleName ), uno::UNO_QUERY_THROW );
++}
++
++// XEnumerationAccess
++uno::Type SAL_CALL
++ScVbaCommandBars::getElementType() throw ( uno::RuntimeException )
++{
++ return vba::XCommandBars::static_type( 0 );
++}
++uno::Reference< container::XEnumeration >
++ScVbaCommandBars::createEnumeration() throw ( uno::RuntimeException )
++{
++ return uno::Reference< container::XEnumeration >( new CommandBarEnumeration( mxContext, this, m_xNameAccess->getElementNames() ) );
++}
++
++uno::Any
++ScVbaCommandBars::createCollectionObject( const uno::Any& aSource )
++{
++ // aSource should be a name at this time, because of the class is API wrapper.
++ rtl::OUString sToolBarName;
++ if( aSource >>= sToolBarName )
++ {
++ sToolBarName = sToolBarName.toAsciiLowerCase();
++ if( sToolBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Worksheet Menu Bar") ) )
++ {
++ return uno::makeAny( uno::Reference< vba::XCommandBar > ( new ScVbaCommandBar( this, mxContext, 0 ) ) );
++ }
++ else if( sToolBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Menu Bar") ) )
++ {
++ return uno::makeAny( uno::Reference< vba::XCommandBar > ( new ScVbaCommandBar( this, mxContext, 1 ) ) );
++ }
++ else if( checkToolBarExist( sToolBarName ) )
++ {
++ return uno::makeAny( uno::Reference< vba::XCommandBar > (new ScVbaCommandBar( this, mxContext, sToolBarName, sal_True, sal_False ) ) );
++ }
++ }
++ return uno::Any();
++}
++
++// XCommandBars
++uno::Reference< vba::XCommandBar > SAL_CALL
++ScVbaCommandBars::Add( const css::uno::Any& Name, const css::uno::Any& /*Position*/, const css::uno::Any& /*MenuBar*/, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ // Position - MsoBar MenuBar - sal_Bool
++ // Currently only the Name is supported.
++ rtl::OUString sName;
++ if( !( Name >>= sName ) )
++ {
++ sName = rtl::OUString::createFromAscii("Custom1");
++ }
++ sal_Bool bTemporary;
++ if( !( Temporary >>= bTemporary ) )
++ {
++ bTemporary = sal_True;
++ }
++ return uno::Reference< vba::XCommandBar >( new ScVbaCommandBar( this, mxContext, sName.toAsciiLowerCase(), bTemporary, sal_True ) );
++}
++sal_Int32 SAL_CALL
++ScVbaCommandBars::getCount() throw(css::uno::RuntimeException)
++{
++ // Filter out all toolbars from the window collection
++ sal_Int32 nCount = 0;
++ uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames();
++ for( sal_Int32 i = 0; i < allNames.getLength(); i++ )
++ {
++ if(allNames[i].indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
++ {
++ nCount++;
++ }
++ }
++ return nCount;
++}
++
++// ScVbaCollectionBaseImpl
++uno::Any SAL_CALL
++ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
++{
++ if( aIndex.getValueTypeClass() == uno::TypeClass_STRING )
++ {
++ return createCollectionObject( aIndex );
++ }
++ return uno::Any();
++}
++
++sal_Bool
++ScVbaCommandBars::checkToolBarExist( rtl::OUString sToolBarName )
++{
++ CommandBarNameMap::const_iterator iter = mCommandBarNameMap.find( sToolBarName.toAsciiLowerCase() );
++ if( iter != mCommandBarNameMap.end() )
++ {
++ return sal_True;
++ }
++ uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames();
++ for( sal_Int32 i = 0; i < allNames.getLength(); i++ )
++ {
++ if(allNames[i].indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 )
++ {
++ if( allNames[i].indexOf( sToolBarName ) != -1 )
++ {
++ return sal_True;
++ }
++ }
++ }
++ return sal_False;
++}
++
++// XHelperInterface
++rtl::OUString&
++ScVbaCommandBars::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBars") );
++ return sImplName;
++}
++uno::Sequence<rtl::OUString>
++ScVbaCommandBars::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.vba.CommandBars" ) );
++ }
++ return aServiceNames;
++}
++
+Index: sc/source/ui/vba/vbacommandbars.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbacommandbars.hxx
+diff -N sc/source/ui/vba/vbacommandbars.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbacommandbars.hxx 29 Jul 2008 06:35:40 -0000 1.1.2.1
+@@ -0,0 +1,79 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_COMMANDBARS_HXX
++#define SC_VBA_COMMANDBARS_HXX
++
++#include <org/openoffice/vba/XCommandBar.hpp>
++#include <org/openoffice/vba/XCommandBars.hpp>
++#include <com/sun/star/container/XNameAccess.hpp>
++
++#include <cppuhelper/implbase1.hxx>
++
++#include "vbahelperinterface.hxx"
++#include "vbacollectionimpl.hxx"
++
++typedef CollTestImplHelper< oo::vba::XCommandBars > CommandBars_BASE;
++
++class ScVbaCommandBars : public CommandBars_BASE
++{
++private:
++ css::uno::Reference< css::container::XNameAccess > m_xNameAccess;
++ rtl::OUString m_sModuleName;
++ void retrieveObjects() throw( css::uno::RuntimeException );
++public:
++ ScVbaCommandBars( const css::uno::Reference< oo::vba::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::container::XIndexAccess > xIndexAccess );
++
++ sal_Bool checkToolBarExist( rtl::OUString sToolBarName );
++ rtl::OUString GetModuleName(){ return m_sModuleName; };
++ css::uno::Reference< css::container::XNameAccess > GetWindows()
++ {
++ retrieveObjects();
++ return m_xNameAccess;
++ };
++ // XCommandBars
++ virtual css::uno::Reference< oo::vba::XCommandBar > SAL_CALL Add( const css::uno::Any& Name, const css::uno::Any& Position, const css::uno::Any& MenuBar, const css::uno::Any& Temporary ) 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& aSource );
++
++ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException);
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
++#endif//SC_VBA_COMMANDBARS_HXX
+Index: sc/source/ui/vba/vbacontrol.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbacontrol.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.3
+diff -u -p -b -w -B -r1.3 -r1.2.42.3
+--- sc/source/ui/vba/vbacontrol.cxx 11 Apr 2008 00:57:50 -0000 1.3
++++ sc/source/ui/vba/vbacontrol.cxx 29 Jul 2008 06:35:41 -0000 1.2.42.3
+@@ -44,17 +44,26 @@
+ #include "vbatextbox.hxx"
+ #include "vbaradiobutton.hxx"
+ #include "vbalistbox.hxx"
++#include "vbatogglebutton.hxx"
++#include "vbacheckbox.hxx"
++#include "vbaframe.hxx"
++#include "vbascrollbar.hxx"
++#include "vbaprogressbar.hxx"
++#include "vbamultipage.hxx"
++#include "vbaspinbutton.hxx"
+
+
+ using namespace com::sun::star;
+ using namespace org::openoffice;
+
+-sal_Int32 pt2mm( double pt );
+-double mm2pt( sal_Int32 mm );
+-
+ uno::Reference< css::awt::XWindowPeer >
+-ScVbaControl::getWindowPeer( const uno::Reference< ::drawing::XControlShape >& xControlShape ) throw (uno::RuntimeException)
++ScVbaControl::getWindowPeer() throw (uno::RuntimeException)
+ {
++ // #FIXME why don't we already have the XModel instead of getting it
++ // directly from the controlmodel, probablye we thought there was a reason
++ // at some stage.
++ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
++
+ uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+ //init m_xWindowPeer
+ uno::Reference< container::XChild > xChild( xControlModel, uno::UNO_QUERY_THROW );
+@@ -62,17 +71,18 @@ ScVbaControl::getWindowPeer( const uno::
+ xChild.set( xChild->getParent(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XModel > xModel( xChild->getParent(), uno::UNO_QUERY_THROW );
+ uno::Reference< view::XControlAccess > xControlAccess( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+- uno::Reference< awt::XControl > xControl;
++ uno::Reference< css::awt::XWindowPeer > xWinPeer;
+ try
+ {
+- xControl.set( xControlAccess->getControl( xControlModel ), uno::UNO_QUERY );
++ uno::Reference< awt::XControl > xControl( xControlAccess->getControl( xControlModel ), uno::UNO_QUERY );
++ xWinPeer = xControl->getPeer();
+ }
+ catch( uno::Exception )
+ {
+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "The Control does not exsit" ),
+ uno::Reference< uno::XInterface >() );
+ }
+- return xControl->getPeer();
++ return xWinPeer;
+ }
+
+ //ScVbaControlListener
+@@ -106,67 +116,44 @@ ScVbaControlListener::disposing( const l
+
+ //ScVbaControl
+
+-ScVbaControl::ScVbaControl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::drawing::XControlShape >& xControlShape ) : m_xContext( xContext ), m_xControlShape( xControlShape )
++ScVbaControl::ScVbaControl( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ), m_xControl( xControl )
+ {
+- //init m_xProps
+- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+- uno::Reference< beans::XPropertySet > xProps( xControlModel, uno::UNO_QUERY_THROW );
+- m_xProps.set( xProps, uno::UNO_QUERY_THROW );
+ //add listener
+ m_xEventListener.set( new ScVbaControlListener( this ) );
+- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
++ setGeometryHelper( pGeomHelper );
++ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+ xComponent->addEventListener( m_xEventListener );
++
++ //init m_xProps
++ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ) ;
++ uno::Reference< awt::XControl> xUserFormControl( m_xControl, uno::UNO_QUERY ) ;
++ if ( xControlShape.is() ) // form control
++ m_xProps.set( xControlShape->getControl(), uno::UNO_QUERY_THROW );
++ else if ( xUserFormControl.is() ) // userform control
++ m_xProps.set( xUserFormControl->getModel(), uno::UNO_QUERY_THROW );
+ }
+
+ ScVbaControl::~ScVbaControl()
+ {
+- if( m_xControlShape.is() )
+- {
+- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
+- xComponent->removeEventListener( m_xEventListener );
+- }
+-}
+-
+-void ScVbaControl::removeResouce() throw( uno::RuntimeException )
++ if( m_xControl.is() )
+ {
+- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
++ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+ xComponent->removeEventListener( m_xEventListener );
+- m_xControlShape = NULL;
+- m_xProps = NULL;
+ }
+-
+-
+-ScVbaControl::ScVbaControl( const uno::Reference< uno::XComponentContext >& xContext,
+- const uno::Reference< beans::XPropertySet >& xProps,
+- const uno::Reference< drawing::XControlShape > xControlShape ) : m_xContext( xContext ),
+- m_xProps( xProps ), m_xControlShape( xControlShape )
+-{
+- m_xEventListener.set( new ScVbaControlListener( this ) );
+- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
+- xComponent->addEventListener( m_xEventListener );
+ }
+
+-void ScVbaControl::SetControl( const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< ::drawing::XControlShape > xControlShape )
++void
++ScVbaControl::setGeometryHelper( AbstractGeometryAttributes* pHelper )
+ {
+- m_xEventListener.set( new ScVbaControlListener( this ) );
+- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
+- m_xContext.set( xContext, uno::UNO_QUERY_THROW );
+- m_xControlShape.set( xControlShape, uno::UNO_QUERY_THROW );
+- //init m_xProps
+- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+- uno::Reference< beans::XPropertySet > xProps( xControlModel, uno::UNO_QUERY_THROW );
+- m_xProps = xProps;
++ mpGeometryHelper.reset( pHelper );
+ }
+
+-void ScVbaControl::SetControl( const uno::Reference< uno::XComponentContext > xContext,
+- const uno::Reference< beans::XPropertySet > xProps,
+- const uno::Reference< drawing::XControlShape > xControlShape )
++void ScVbaControl::removeResouce() throw( uno::RuntimeException )
+ {
+- m_xEventListener.set( new ScVbaControlListener( this ) );
+- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
+- m_xContext.set( xContext, uno::UNO_QUERY_THROW );
+- m_xProps.set( xProps, uno::UNO_QUERY_THROW );
+- m_xControlShape.set( xControlShape, uno::UNO_QUERY_THROW );
++ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
++ xComponent->removeEventListener( m_xEventListener );
++ m_xControl= NULL;
++ m_xProps = NULL;
+ }
+
+ //In design model has different behavior
+@@ -189,132 +176,173 @@ void SAL_CALL ScVbaControl::setEnabled(
+
+ sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException)
+ {
+- uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer( m_xControlShape ), uno::UNO_QUERY_THROW );
++ uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
+ return xWindow2->isVisible();
+ }
+
+ void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
+ {
+- uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer( m_xControlShape ), uno::UNO_QUERY_THROW );
++ uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
+ xWindow2->setVisible( bVisible );
+ }
+ double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException)
+ {
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- return mm2pt( xShape->getSize().Height ) / 100;
++ return mpGeometryHelper->getHeight();
+ }
+ void SAL_CALL ScVbaControl::setHeight( double _height ) throw (uno::RuntimeException)
+ {
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- awt::Size aSize( xShape->getSize() );
+- aSize.Height = pt2mm( _height ) * 100;
+- xShape->setSize( aSize );
++ mpGeometryHelper->setHeight( _height );
+ }
+
+ double SAL_CALL ScVbaControl::getWidth() throw (uno::RuntimeException)
+ {
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- return mm2pt( xShape->getSize().Width ) / 100;
++ return mpGeometryHelper->getWidth();
+ }
+ void SAL_CALL ScVbaControl::setWidth( double _width ) throw (uno::RuntimeException)
+ {
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- awt::Size aSize( xShape->getSize() );
+- aSize.Width = pt2mm( _width ) * 100;
+- xShape->setSize( aSize );
++ mpGeometryHelper->setWidth( _width );
+ }
+
+ double SAL_CALL
+ ScVbaControl::getLeft() throw (uno::RuntimeException)
+ {
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- return mm2pt( xShape->getPosition().X / 100 );
++ return mpGeometryHelper->getLeft();
+ }
+
+ void SAL_CALL
+ ScVbaControl::setLeft( double _left ) throw (uno::RuntimeException)
+ {
+- awt::Point oldPosition;
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- oldPosition = xShape->getPosition();
+- oldPosition.X = pt2mm( _left ) * 100;
+- xShape->setPosition( oldPosition );
++ mpGeometryHelper->setLeft( _left );
+
+ }
+
+ double SAL_CALL
+ ScVbaControl::getTop() throw (uno::RuntimeException)
+ {
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- return mm2pt( xShape->getPosition().Y / 100 );
++ return mpGeometryHelper->getTop();
+ }
+
+ void SAL_CALL
+ ScVbaControl::setTop( double _top ) throw (uno::RuntimeException)
+ {
+- awt::Point oldPosition;
+- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
+- oldPosition = xShape->getPosition();
+- oldPosition.Y = pt2mm( _top ) * 100;;
+- xShape->setPosition( oldPosition );
++ mpGeometryHelper->setTop( _top );
++}
++
++void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException)
++{
++ uno::Reference< awt::XWindow > xWin( m_xControl, uno::UNO_QUERY_THROW );
++ xWin->setFocus();
+ }
+
+ //ScVbaControlFactory
+
+-ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XControlShape >& xControlShape ): m_xContext( xContext ), m_xControlShape( xControlShape )
++ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ): m_xContext( xContext ), m_xControl( xControl )
+ {
+- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+- uno::Reference< beans::XPropertySet > xProps( xControlModel, uno::UNO_QUERY_THROW );
+- m_xProps.set( xProps, uno::UNO_QUERY_THROW );
+ }
+
+-ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xProps, const uno::Reference< drawing::XControlShape > xControlShape ): m_xContext( xContext ), m_xProps( xProps ), m_xControlShape( xControlShape )
++ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
+ {
++ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
++ if ( xControlShape.is() ) // form controls
++ return createControl( xControlShape, xParent );
++ uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY );
++ if ( !xControl.is() )
++ throw uno::RuntimeException(); // really we should be more informative
++ return createControl( xControl, xParent );
++
+ }
+
+-ScVbaControl* ScVbaControlFactory::createControl( const sal_Int16 nClassId ) throw (uno::RuntimeException)
++ScVbaControl* ScVbaControlFactory::createControl(const uno::Reference< drawing::XControlShape >& xControlShape, const uno::Reference< uno::XInterface >& /*xParent*/ ) throw (uno::RuntimeException)
+ {
++ uno::Reference< beans::XPropertySet > xProps( xControlShape->getControl(), uno::UNO_QUERY_THROW );
++ sal_Int32 nClassId = -1;
++ const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
++ xProps->getPropertyValue( sClassId ) >>= nClassId;
++ uno::Reference< vba::XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
+ switch( nClassId )
+ {
+ case form::FormComponentType::COMBOBOX:
+- return new ScVbaComboBox( m_xContext, m_xProps, m_xControlShape );
++ return new ScVbaComboBox( xVbaParent, m_xContext, xControlShape, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::COMMANDBUTTON:
+- return new ScVbaButton( m_xContext, m_xControlShape );
++ return new ScVbaButton( xVbaParent, m_xContext, xControlShape, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::FIXEDTEXT:
+- return new ScVbaLabel( m_xContext, m_xControlShape );
++ return new ScVbaLabel( xVbaParent, m_xContext, xControlShape, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::TEXTFIELD:
+- return new ScVbaTextBox( m_xContext, m_xControlShape );
++ return new ScVbaTextBox( xVbaParent, m_xContext, xControlShape, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::RADIOBUTTON:
+- return new ScVbaRadioButton( m_xContext, m_xControlShape );
++ return new ScVbaRadioButton( xVbaParent, m_xContext, xControlShape, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ case form::FormComponentType::LISTBOX:
+- return new ScVbaListBox( m_xContext, m_xControlShape );
++ return new ScVbaListBox( xVbaParent, m_xContext, xControlShape, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
++ case form::FormComponentType::SPINBUTTON:
++ return new ScVbaSpinButton( xVbaParent, m_xContext, xControlShape, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+ default:
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Donot surpport this Control Type." ), uno::Reference< uno::XInterface >() );
+ }
+ }
+
+-ScVbaControl* ScVbaControlFactory::createControl() throw (uno::RuntimeException)
++ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< awt::XControl >& xControl, const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
+ {
+- sal_Int32 nClassId = -1;
+- const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
+- m_xProps->getPropertyValue( sClassId ) >>= nClassId;
+- switch( nClassId )
++ uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW );
++ uno::Reference< lang::XServiceInfo > xServiceInfo( xProps, uno::UNO_QUERY_THROW );
++ ScVbaControl* pControl = NULL;
++ uno::Reference< vba::XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
++ if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) )
++ pControl = new ScVbaCheckbox( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) )
++ pControl = new ScVbaRadioButton( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) )
++ pControl = new ScVbaTextBox( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ), true );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) )
++ {
++ sal_Bool bToggle = sal_False;
++ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toggle") ) ) >>= bToggle;
++ if ( bToggle )
++ pControl = new ScVbaToggleButton( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else
++ pControl = new ScVbaButton( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ }
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) )
++ pControl = new ScVbaComboBox( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ), true );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) )
++ pControl = new ScVbaListBox( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) )
++ pControl = new ScVbaLabel( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) )
++ //pControl = new ScVbaImage( m_xContext, xControl );
++ throw uno::RuntimeException();
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) )
++ pControl = new ScVbaProgressBar( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) )
++ pControl = new ScVbaFrame( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) )
++ pControl = new ScVbaScrollBar( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) )
++ pControl = new ScVbaMultiPage( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ), xParent );
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
++ pControl = new ScVbaSpinButton( xVbaParent, m_xContext, xControl, new UserFormGeometryHelper( m_xContext, xControl ) );
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control " ), uno::Reference< uno::XInterface >() );
++ return pControl;
++}
++
++rtl::OUString&
++ScVbaControl::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControl") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaControl::getServiceNames()
+ {
+- case form::FormComponentType::COMBOBOX:
+- return new ScVbaComboBox( m_xContext, m_xControlShape );
+- case form::FormComponentType::COMMANDBUTTON:
+- return new ScVbaButton( m_xContext, m_xControlShape );
+- case form::FormComponentType::FIXEDTEXT:
+- return new ScVbaLabel( m_xContext, m_xControlShape );
+- case form::FormComponentType::TEXTFIELD:
+- return new ScVbaTextBox( m_xContext, m_xControlShape );
+- case form::FormComponentType::RADIOBUTTON:
+- return new ScVbaRadioButton( m_xContext, m_xControlShape );
+- case form::FormComponentType::LISTBOX:
+- return new ScVbaListBox( m_xContext, m_xControlShape );
+- default:
+- throw uno::RuntimeException( rtl::OUString::createFromAscii(
+- "Donot surpport this Control Type." ), uno::Reference< uno::XInterface >() );
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Control" ) );
+ }
++ return aServiceNames;
+ }
++
++
+Index: sc/source/ui/vba/vbacontrol.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbacontrol.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbacontrol.hxx 11 Apr 2008 00:58:09 -0000 1.3
++++ sc/source/ui/vba/vbacontrol.hxx 6 Jul 2008 15:30:36 -0000 1.2.42.2
+@@ -35,40 +35,33 @@
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/script/XDefaultProperty.hpp>
+ #include <com/sun/star/drawing/XControlShape.hpp>
++#include <com/sun/star/awt/XControl.hpp>
+ #include <com/sun/star/awt/XWindowPeer.hpp>
+ #include <org/openoffice/msforms/XControl.hpp>
+
+ #include "vbahelper.hxx"
++#include "vbahelperinterface.hxx"
+
+-typedef ::cppu::WeakImplHelper1< oo::msforms::XControl > ControlImpl_BASE;
++//typedef ::cppu::WeakImplHelper1< oo::msforms::XControl > ControlImpl_BASE;
++typedef InheritedHelperInterfaceImpl1< oo::msforms::XControl > ControlImpl_BASE;
+
+ class ScVbaControl : public ControlImpl_BASE
+ {
+-/* this will cause error when the sheet is invisible.
+ private:
+- css::uno::Reference< css::awt::XWindowPeer > m_xWindowPeer;
+-*/
+-private:
+- css::uno::Reference< css::awt::XWindowPeer > getWindowPeer( const css::uno::Reference< css::drawing::XControlShape >& xControlShape ) throw (css::uno::RuntimeException);
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
+ protected:
+- css::uno::Reference< css::uno::XComponentContext > m_xContext;
++ std::auto_ptr< oo::AbstractGeometryAttributes > mpGeometryHelper;
+ css::uno::Reference< css::beans::XPropertySet > m_xProps;
+- css::uno::Reference< css::drawing::XControlShape > m_xControlShape;
+-protected:
+- ScVbaControl(){ m_xContext = 0; m_xProps = 0; m_xControlShape = 0; }
+- void SetControl( const css::uno::Reference< css::uno::XComponentContext > xContext,
+- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
+- void SetControl( const css::uno::Reference< css::uno::XComponentContext > xContext,
+- const css::uno::Reference< css::beans::XPropertySet > xProps,
+- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
++ css::uno::Reference< css::uno::XInterface > m_xControl;
++
++ virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException);
+ public:
+- ScVbaControl( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
+- ScVbaControl( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::beans::XPropertySet >& xProps,
+- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
++ ScVbaControl( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
++ const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pHelper );
+ virtual ~ScVbaControl();
++ // This class will own the helper, so make sure it is allocated from
++ // the heap
++ void setGeometryHelper( oo::AbstractGeometryAttributes* pHelper );
+ // XControl
+ virtual sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (css::uno::RuntimeException);
+@@ -82,9 +75,14 @@ public:
+ virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
++ virtual void SAL_CALL SetFocus( ) throw (css::uno::RuntimeException);
++
+
+ //remove resouce because org.openoffice.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape
+ virtual void removeResouce() throw( css::uno::RuntimeException );
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ };
+
+
+@@ -92,16 +90,13 @@ class ScVbaControlFactory
+ {
+ public:
+ ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
+- ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::beans::XPropertySet >& xProps,
+- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
+- ScVbaControl* createControl( const sal_Int16 nClassID ) throw ( css::uno::RuntimeException );
+- ScVbaControl* createControl() throw ( css::uno::RuntimeException );
++ const css::uno::Reference< css::uno::XInterface >& xControl );
++ ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent ) throw ( css::uno::RuntimeException );
+ private:
++ ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException );
++ ScVbaControl* createControl( const css::uno::Reference< css::drawing::XControlShape >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+- css::uno::Reference< css::beans::XPropertySet > m_xProps;
+- css::uno::Reference< css::drawing::XControlShape > m_xControlShape;
++ css::uno::Reference< css::uno::XInterface > m_xControl;
+ };
+
+ #endif//SC_VBA_CONTROL_HXX
+Index: sc/source/ui/vba/vbaframe.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaframe.cxx
+diff -N sc/source/ui/vba/vbaframe.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaframe.cxx 22 Apr 2008 19:53:15 -0000 1.1.2.1
+@@ -0,0 +1,93 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbaframe.hxx"
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++
++const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
++ScVbaFrame::ScVbaFrame( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper ) : FrameImpl_BASE( xParent, xContext, xControl, pGeomHelper )
++{
++}
++
++// Attributes
++rtl::OUString SAL_CALL
++ScVbaFrame::getCaption() throw (css::uno::RuntimeException)
++{
++ rtl::OUString Label;
++ m_xProps->getPropertyValue( LABEL ) >>= Label;
++ return Label;
++}
++
++void SAL_CALL
++ScVbaFrame::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
++}
++
++uno::Any SAL_CALL
++ScVbaFrame::getValue() throw (css::uno::RuntimeException)
++{
++ return uno::makeAny( getCaption() );
++}
++
++void SAL_CALL
++ScVbaFrame::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
++{
++ rtl::OUString sCaption;
++ _value >>= sCaption;
++ setCaption( sCaption );
++}
++
++rtl::OUString&
++ScVbaFrame::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFrame") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaFrame::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.Frame" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbaframe.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaframe.hxx
+diff -N sc/source/ui/vba/vbaframe.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaframe.hxx 22 Apr 2008 19:53:15 -0000 1.1.2.1
+@@ -0,0 +1,58 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_FRAME_HXX
++#define SC_VBA_FRAME_HXX
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/msforms/XLabel.hpp>
++
++#include "vbacontrol.hxx"
++#include "vbahelper.hxx"
++
++typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XLabel > FrameImpl_BASE;
++
++class ScVbaFrame : public FrameImpl_BASE
++{
++public:
++ ScVbaFrame( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
++ // Attributes
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
++ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif //SC_VBA_LABEL_HXX
+Index: sc/source/ui/vba/vbaglobals.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaglobals.cxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.2
+diff -u -p -b -w -B -r1.4 -r1.3.42.2
+--- sc/source/ui/vba/vbaglobals.cxx 11 Apr 2008 01:02:04 -0000 1.4
++++ sc/source/ui/vba/vbaglobals.cxx 6 Jul 2008 15:29:30 -0000 1.3.42.2
+@@ -153,9 +153,9 @@ ScVbaGlobals::Range( const uno::Any& Cel
+ }
+
+ uno::Any SAL_CALL
+-ScVbaGlobals::Names( ) throw ( uno::RuntimeException )
++ScVbaGlobals::Names( const css::uno::Any& aIndex ) throw ( uno::RuntimeException )
+ {
+- return getApplication()->Names();
++ return getApplication()->Names( aIndex );
+ }
+
+ namespace globals
+Index: sc/source/ui/vba/vbaglobals.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaglobals.hxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.2
+diff -u -p -b -w -B -r1.4 -r1.3.42.2
+--- sc/source/ui/vba/vbaglobals.hxx 11 Apr 2008 01:02:19 -0000 1.4
++++ sc/source/ui/vba/vbaglobals.hxx 6 Jul 2008 15:30:20 -0000 1.3.42.2
+@@ -70,6 +70,6 @@
+ virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< css::uno::Any > SAL_CALL getGlobals( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
+- virtual css::uno::Any SAL_CALL Names( ) throw ( css::uno::RuntimeException );
++ virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw ( css::uno::RuntimeException );
+ };
+ #endif //
+Index: sc/source/ui/vba/vbahelper.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbahelper.cxx,v
+retrieving revision 1.5
+retrieving revision 1.3.42.4
+diff -u -p -b -w -B -r1.5 -r1.3.42.4
+--- sc/source/ui/vba/vbahelper.cxx 11 Apr 2008 01:02:33 -0000 1.5
++++ sc/source/ui/vba/vbahelper.cxx 6 Jul 2008 15:30:59 -0000 1.3.42.4
+@@ -37,6 +37,7 @@
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/lang/XMultiComponentFactory.hpp>
+ #include <com/sun/star/beans/XPropertySet.hpp>
++#include <com/sun/star/beans/XIntrospection.hpp>
+
+ #include <comphelper/processfactory.hxx>
+
+@@ -57,7 +58,8 @@
+ #include "tabvwsh.hxx"
+ #include "transobj.hxx"
+ #include "scmod.hxx"
+-
++#include "vbashape.hxx"
++#include "unonames.hxx"
+ using namespace ::com::sun::star;
+ using namespace ::org::openoffice;
+
+@@ -74,6 +76,18 @@ namespace openoffice
+
+ const double Millimeter::factor = 35.27778;
+
++uno::Reference< beans::XIntrospectionAccess >
++getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
++{
++ static uno::Reference< beans::XIntrospection > xIntrospection;
++ if( !xIntrospection.is() )
++ {
++ uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
++ xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW );
++ }
++ return xIntrospection->inspect( aObject );
++}
++
+ uno::Reference< script::XTypeConverter >
+ getTypeConverter( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+ {
+@@ -215,6 +229,22 @@ dispatchRequests (uno::Reference< frame:
+ }
+
+
++void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall)
++{
++ ScTabViewShell* pViewShell = getBestViewShell( xModel );
++ SfxViewFrame* pViewFrame = NULL;
++ if ( pViewShell )
++ pViewFrame = pViewShell->GetViewFrame();
++ if ( pViewFrame )
++ {
++ SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
++ if( pDispatcher )
++ {
++ pDispatcher->Execute( nSlot , nCall );
++ }
++ }
++}
++
+ void
+ implnPaste()
+ {
+@@ -531,6 +561,11 @@ void PrintOutHelper( const uno::Any& Fro
+ // of this method
+ }
+
++ void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, css::uno::Reference< css::frame::XModel >& xModel )
++{
++ dispatchExecute( xModel, SID_VIEWSHELL1 );
++}
++
+ rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException )
+ {
+ uno::Type aType = pvargItem.getValueType();
+@@ -744,5 +779,56 @@ double PixelsToPoints( css::uno::Referen
+ return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR;
+ }
+
++ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape )
++{
++ m_xShape = new ScVbaShape( xContext, xShape );
++}
++
++#define VBA_LEFT "PositionX"
++#define VBA_TOP "PositionY"
++UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< awt::XControl >& xControl )
++{
++ mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW );
++}
++ double UserFormGeometryHelper::getLeft()
++ {
++ sal_Int32 nLeft = 0;
++ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;
++ return nLeft;
++ }
++ void UserFormGeometryHelper::setLeft( double nLeft )
++ {
++ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( static_cast< sal_Int32 >( nLeft ) ) );
++ }
++ double UserFormGeometryHelper::getTop()
++ {
++ sal_Int32 nTop = 0;
++ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop;
++ return nTop;
++ }
++ void UserFormGeometryHelper::setTop( double nTop )
++ {
++ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ), uno::makeAny( static_cast< sal_Int32 >( nTop ) ) );
++ }
++ double UserFormGeometryHelper::getHeight()
++ {
++ sal_Int32 nHeight = 0;
++ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ) ) >>= nHeight;
++ return static_cast< double >( nHeight );
++ }
++ void UserFormGeometryHelper::setHeight( double nHeight )
++ {
++ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ), uno::makeAny( static_cast< sal_Int32 >( nHeight ) ) );
++ }
++ double UserFormGeometryHelper::getWidth()
++ {
++ sal_Int32 nWidth = 0;
++ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ) ) >>= nWidth;
++ return static_cast< sal_Int32 >( nWidth );
++ }
++ void UserFormGeometryHelper::setWidth( double nWidth)
++ {
++ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ), uno::makeAny( static_cast< sal_Int32 >( nWidth ) ) );
++ }
+ } // openoffice
+ } //org
+Index: sc/source/ui/vba/vbahelper.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbahelper.hxx,v
+retrieving revision 1.5
+retrieving revision 1.4.42.3
+diff -u -p -b -w -B -r1.5 -r1.4.42.3
+--- sc/source/ui/vba/vbahelper.hxx 11 Apr 2008 01:02:47 -0000 1.5
++++ sc/source/ui/vba/vbahelper.hxx 6 Jul 2008 15:31:23 -0000 1.4.42.3
+@@ -31,14 +31,18 @@
+ #define SC_VBA_HELPER_HXX
+
+ #include <com/sun/star/drawing/XShape.hpp>
++#include <com/sun/star/beans/XIntrospectionAccess.hpp>
+ #include <com/sun/star/script/BasicErrorException.hpp>
+ #include <com/sun/star/script/XTypeConverter.hpp>
+ #include <com/sun/star/lang/IllegalArgumentException.hpp>
++#include <com/sun/star/awt/XControl.hpp>
+ #include <com/sun/star/awt/XDevice.hpp>
+ #include <basic/sberrors.hxx>
+ #include <cppuhelper/implbase1.hxx>
+ #include <com/sun/star/frame/XModel.hpp>
+ #include <docsh.hxx>
++#include <sfx2/dispatch.hxx>
++#include <org/openoffice/msforms/XShape.hpp>
+
+ namespace css = ::com::sun::star;
+
+@@ -56,10 +60,12 @@ namespace org
+ throw css::lang::IllegalArgumentException();
+ return aSomething;
+ }
++ css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+
+ void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl) ;
+ void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl, css::uno::Sequence< css::beans::PropertyValue >& sProps ) ;
++ void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON );
+ void implnCopy();
+ void implnPaste();
+ void implnCut();
+@@ -80,6 +86,7 @@ namespace org
+ // contains an empty object reference
+ const css::uno::Any& aNULL();
+ void PrintOutHelper( const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, css::uno::Reference< css::frame::XModel >& xModel, sal_Bool bSelection );
++ void PrintPreviewHelper( const css::uno::Any& EnableChanges, css::uno::Reference< css::frame::XModel >& xModel );
+
+ rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException );
+ rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic )
+@@ -137,6 +144,80 @@ public:
+ return points;
+ }
+ };
++
++class AbstractGeometryAttributes // probably should replace the ShapeHelper below
++{
++public:
++ virtual ~AbstractGeometryAttributes() {}
++ virtual double getLeft() = 0;
++ virtual void setLeft( double ) = 0;
++ virtual double getTop() = 0;
++ virtual void setTop( double ) = 0;
++ virtual double getHeight() = 0;
++ virtual void setHeight( double ) = 0;
++ virtual double getWidth() = 0;
++ virtual void setWidth( double ) = 0;
++};
++
++class ConcreteXShapeGeometryAttributes : public AbstractGeometryAttributes
++{
++public:
++ css::uno::Reference< org::openoffice::msforms::XShape > m_xShape;
++ ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape );
++ virtual double getLeft()
++ {
++ return m_xShape->getLeft();
++ }
++ virtual void setLeft( double nLeft )
++ {
++ m_xShape->setLeft( nLeft );
++ }
++ virtual double getTop()
++ {
++ return m_xShape->getTop();
++ }
++ virtual void setTop( double nTop )
++ {
++ m_xShape->setTop( nTop );
++ }
++
++ virtual double getHeight()
++ {
++ return m_xShape->getHeight();
++ }
++ virtual void setHeight( double nHeight )
++ {
++ m_xShape->setHeight( nHeight );
++ }
++ virtual double getWidth()
++ {
++ return m_xShape->getWidth();
++ }
++ virtual void setWidth( double nWidth)
++ {
++ m_xShape->setHeight( nWidth );
++ }
++
++
++};
++#define VBA_LEFT "PositionX"
++#define VBA_TOP "PositionY"
++class UserFormGeometryHelper : public AbstractGeometryAttributes
++{
++
++ css::uno::Reference< css::beans::XPropertySet > mxModel;
++public:
++ UserFormGeometryHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::awt::XControl >& xControl );
++ virtual double getLeft();
++ virtual void setLeft( double nLeft );
++ virtual double getTop();
++ virtual void setTop( double nTop );
++ virtual double getHeight();
++ virtual void setHeight( double nHeight );
++ virtual double getWidth();
++ virtual void setWidth( double nWidth);
++};
++
+ class ShapeHelper
+ {
+ protected:
+Index: sc/source/ui/vba/vbahyperlink.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbahyperlink.cxx
+diff -N sc/source/ui/vba/vbahyperlink.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbahyperlink.cxx 29 Jul 2008 06:35:41 -0000 1.1.2.1
+@@ -0,0 +1,139 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "helperdecl.hxx"
++#include "vbahyperlink.hxx"
++#include <com/sun/star/container/XIndexAccess.hpp>
++#include <com/sun/star/text/XTextFieldsSupplier.hpp>
++#include <com/sun/star/container/XEnumerationAccess.hpp>
++#include "vbarange.hxx"
++
++using namespace ::org::openoffice;
++using namespace ::com::sun::star;
++
++ScVbaHyperlink::ScVbaHyperlink( uno::Sequence< uno::Any> const & args,
++ uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : HyperlinkImpl_BASE( getXSomethingFromArgs< vba::XHelperInterface >( args, 0 ), xContext ), mxCell( getXSomethingFromArgs< table::XCell >( args, 1, false ) )
++{
++ mxCell = getXSomethingFromArgs< table::XCell >( args, 1, false );
++ uno::Reference< text::XTextFieldsSupplier > xTextFields( mxCell, uno::UNO_QUERY_THROW );
++ uno::Reference< container::XIndexAccess > xIndex( xTextFields->getTextFields(), uno::UNO_QUERY_THROW );
++ mxTextField.set( xIndex->getByIndex(0), uno::UNO_QUERY_THROW );
++}
++
++ScVbaHyperlink::~ScVbaHyperlink()
++{
++}
++
++::rtl::OUString
++ScVbaHyperlink::getAddress() throw (css::uno::RuntimeException)
++{
++ rtl::OUString aAddress;
++ uno::Any aValue = mxTextField->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
++ aValue >>= aAddress;
++ return aAddress;
++}
++
++void
++ScVbaHyperlink::setAddress( const ::rtl::OUString & rAddress ) throw (css::uno::RuntimeException)
++{
++ uno::Any aValue;
++ aValue <<= rAddress;
++ mxTextField->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ), aValue );
++}
++
++::rtl::OUString
++ScVbaHyperlink::getName() throw (css::uno::RuntimeException)
++{
++ // it seems this attribute is same as TextToDisplay
++ return getTextToDisplay();
++}
++
++void
++ScVbaHyperlink::setName( const ::rtl::OUString & rName ) throw (css::uno::RuntimeException)
++{
++ setTextToDisplay( rName );
++}
++
++::rtl::OUString
++ScVbaHyperlink::getTextToDisplay() throw (css::uno::RuntimeException)
++{
++ rtl::OUString aTextToDisplay;
++ uno::Any aValue = mxTextField->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ) );
++ aValue >>= aTextToDisplay;
++ return aTextToDisplay;
++}
++
++void
++ScVbaHyperlink::setTextToDisplay( const ::rtl::OUString & rTextToDisplay ) throw (css::uno::RuntimeException)
++{
++ uno::Any aValue;
++ aValue <<= rTextToDisplay;
++ mxTextField->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ), aValue );
++}
++
++css::uno::Reference< oo::excel::XRange > SAL_CALL ScVbaHyperlink::Range() throw (css::uno::RuntimeException)
++{
++ uno::Reference< table::XCellRange > xRange( mxCell,uno::UNO_QUERY_THROW );
++ // FIXME: need to pass current worksheet as the parent of XRange.
++ return uno::Reference< excel::XRange >( new ScVbaRange( uno::Reference< vba::XHelperInterface > (), mxContext, xRange ) );
++}
++
++rtl::OUString&
++ScVbaHyperlink::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaHyperlink") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaHyperlink::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Hyperlink" ) );
++ }
++ return aServiceNames;
++}
++
++namespace hyperlink
++{
++namespace sdecl = comphelper::service_decl;
++sdecl::vba_service_class_<ScVbaHyperlink, sdecl::with_args<true> > serviceImpl;
++extern sdecl::ServiceDecl const serviceDecl(
++ serviceImpl,
++ "ScVbaHyperlink",
++ "org.openoffice.excel.Hyperlink" );
++}
+Index: sc/source/ui/vba/vbahyperlink.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbahyperlink.hxx
+diff -N sc/source/ui/vba/vbahyperlink.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbahyperlink.hxx 29 Jul 2008 06:35:41 -0000 1.1.2.1
+@@ -0,0 +1,72 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_HYPERLINK_HXX
++#define SC_VBA_HYPERLINK_HXX
++
++#include <org/openoffice/excel/XHyperlink.hpp>
++#include <com/sun/star/table/XCell.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include <org/openoffice/excel/XRange.hpp>
++
++#include "vbahelperinterface.hxx"
++
++typedef InheritedHelperInterfaceImpl1< oo::excel::XHyperlink > HyperlinkImpl_BASE;
++
++class ScVbaHyperlink : public HyperlinkImpl_BASE
++{
++ css::uno::Reference< css::table::XCell > mxCell;
++ css::uno::Reference< css::beans::XPropertySet > mxTextField;
++
++public:
++ ScVbaHyperlink( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext ) throw ( css::lang::IllegalArgumentException );
++ virtual ~ScVbaHyperlink();
++
++ // Attributes
++ virtual ::rtl::OUString SAL_CALL getAddress() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setAddress( const ::rtl::OUString &rAddress ) throw (css::uno::RuntimeException);
++ virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
++ virtual ::rtl::OUString SAL_CALL getTextToDisplay() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setTextToDisplay( const ::rtl::OUString &rTextToDisplay ) throw (css::uno::RuntimeException);
++
++ // Methods
++ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Range() throw (css::uno::RuntimeException);
++
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif /* SC_VBA_HYPERLINK_HXX */
++
+Index: sc/source/ui/vba/vbainterior.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbainterior.cxx,v
+retrieving revision 1.5
+retrieving revision 1.5.96.1
+diff -u -p -b -w -B -r1.5 -r1.5.96.1
+--- sc/source/ui/vba/vbainterior.cxx 11 Apr 2008 01:03:23 -0000 1.5
++++ sc/source/ui/vba/vbainterior.cxx 29 Jul 2008 06:35:41 -0000 1.5.96.1
+@@ -34,8 +34,11 @@
+ #include <com/sun/star/beans/XIntrospectionAccess.hpp>
+ #include <com/sun/star/reflection/XIdlMethod.hpp>
+ #include <com/sun/star/beans/MethodConcept.hpp>
++#include <com/sun/star/beans/NamedValue.hpp>
++#include <com/sun/star/xml/AttributeData.hpp>
+
+ #include <org/openoffice/excel/XlColorIndex.hpp>
++#include <org/openoffice/excel/XlPattern.hpp>
+
+ #include <comphelper/processfactory.hxx>
+ #include <cppuhelper/queryinterface.hxx>
+@@ -44,12 +47,53 @@
+
+ #include "vbainterior.hxx"
+ #include "vbapalette.hxx"
++
++#define STATIC_TABLE_SIZE( array ) (sizeof(array)/sizeof(*(array)))
++#define COLORMAST 0xFFFFFF
++const sal_uInt16 EXC_COLOR_WINDOWBACK = 65;
++typedef std::map< sal_Int32, sal_Int32 > PatternMap;
++typedef std::pair< sal_Int32, sal_Int32 > PatternPair;
+ using namespace ::com::sun::star;
+ using namespace ::org::openoffice;
++using namespace ::org::openoffice::excel::XlPattern;
+ static const rtl::OUString BACKCOLOR( RTL_CONSTASCII_USTRINGPARAM( "CellBackColor" ) );
++static const rtl::OUString PATTERN( RTL_CONSTASCII_USTRINGPARAM( "Pattern" ) );
++static const rtl::OUString PATTERNCOLOR( RTL_CONSTASCII_USTRINGPARAM( "PatternColor" ) );
++
++PatternMap lcl_getPatternMap()
++{
++ PatternMap aPatternMap;
++ aPatternMap.insert( PatternPair( xlPatternAutomatic, 0 ) );
++ aPatternMap.insert( PatternPair( xlPatternChecker, 9 ) );
++ aPatternMap.insert( PatternPair( xlPatternCrissCross, 16 ) );
++ aPatternMap.insert( PatternPair( xlPatternDown, 7 ) );
++ aPatternMap.insert( PatternPair( xlPatternGray16, 17 ) );
++ aPatternMap.insert( PatternPair( xlPatternGray25, 4 ) );
++ aPatternMap.insert( PatternPair( xlPatternGray50, 2 ) );
++ aPatternMap.insert( PatternPair( xlPatternGray75, 3 ) );
++ aPatternMap.insert( PatternPair( xlPatternGray8, 18 ) );
++ aPatternMap.insert( PatternPair( xlPatternGrid, 15 ) );
++ aPatternMap.insert( PatternPair( xlPatternHorizontal, 5 ) );
++ aPatternMap.insert( PatternPair( xlPatternLightDown, 13 ) );
++ aPatternMap.insert( PatternPair( xlPatternLightHorizontal, 11 ) );
++ aPatternMap.insert( PatternPair( xlPatternLightUp, 14 ) );
++ aPatternMap.insert( PatternPair( xlPatternLightVertical, 12 ) );
++ aPatternMap.insert( PatternPair( xlPatternNone, 0 ) );
++ aPatternMap.insert( PatternPair( xlPatternSemiGray75, 10 ) );
++ aPatternMap.insert( PatternPair( xlPatternSolid, 0 ) );
++ aPatternMap.insert( PatternPair( xlPatternUp, 8 ) );
++ aPatternMap.insert( PatternPair( xlPatternVertical, 6 ) );
++ return aPatternMap;
++}
++
++static PatternMap aPatternMap( lcl_getPatternMap() );
+
+ ScVbaInterior::ScVbaInterior( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xProps, ScDocument* pScDoc ) throw ( lang::IllegalArgumentException) : ScVbaInterior_BASE( xParent, xContext ), m_xProps(xProps), m_pScDoc( pScDoc )
+ {
++ // auto color
++ //m_aPattColor.SetColor( (sal_uInt32)0xFFFFFFFF );
++ m_aPattColor.SetColor( (sal_uInt32)0x0 );
++ m_nPattern = 0L;
+ if ( !m_xProps.is() )
+ throw lang::IllegalArgumentException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "properties") ), uno::Reference< uno::XInterface >(), 2 );
+ }
+@@ -57,15 +101,50 @@ ScVbaInterior::ScVbaInterior( const uno:
+ uno::Any
+ ScVbaInterior::getColor() throw (uno::RuntimeException)
+ {
+- uno::Any aAny;
+- aAny = OORGBToXLRGB( m_xProps->getPropertyValue( BACKCOLOR ) );
+- return aAny;
++ Color aBackColor( GetBackColor() );
++ return uno::makeAny( OORGBToXLRGB( aBackColor.GetColor() ) );
+ }
+
+ void
+ ScVbaInterior::setColor( const uno::Any& _color ) throw (uno::RuntimeException)
+ {
+- m_xProps->setPropertyValue( BACKCOLOR , XLRGBToOORGB(_color));
++ sal_Int32 nColor;
++ if( _color >>= nColor )
++ {
++ SetUserDefinedAttributes( BACKCOLOR, SetAttributeData( XLRGBToOORGB( nColor ) ) );
++ //m_xProps->setPropertyValue( BACKCOLOR , XLRGBToOORGB(_color));
++ SetMixedColor();
++ }
++}
++
++void
++ScVbaInterior::SetMixedColor()
++{
++ // pattern
++ uno::Any aPattern = GetUserDefinedAttributes( PATTERN );
++ if( aPattern.hasValue() )
++ {
++ m_nPattern = GetAttributeData( aPattern );
++ }
++ sal_Int32 nPattern = aPatternMap[ m_nPattern ];
++ // pattern color
++ uno::Any aPatternColor = GetUserDefinedAttributes( PATTERNCOLOR );
++ if( aPatternColor.hasValue() )
++ {
++ sal_uInt32 nPatternColor = GetAttributeData( aPatternColor );
++ m_aPattColor.SetColor( nPatternColor );
++ }
++ sal_Int32 nPatternColor = m_aPattColor.GetColor();
++ // back color
++ Color aBackColor( GetBackColor() );
++ // set mixed color
++ Color aMixedColor;
++ if( nPattern > 0 )
++ aMixedColor = GetPatternColor( Color(nPatternColor), aBackColor, (sal_uInt32)nPattern );
++ else
++ aMixedColor = GetPatternColor( aBackColor, aBackColor, (sal_uInt32)nPattern );
++ sal_Int32 nMixedColor = aMixedColor.GetColor() & COLORMAST;
++ m_xProps->setPropertyValue( BACKCOLOR , uno::makeAny( nMixedColor ) );
+ }
+
+ uno::Reference< container::XIndexAccess >
+@@ -83,28 +162,28 @@ ScVbaInterior::setColorIndex( const css:
+ {
+ sal_Int32 nIndex = 0;
+ _colorindex >>= nIndex;
++
++ // setColor expects colors in XL RGB values
++ // #FIXME this is daft we convert OO RGB val to XL RGB val and
++ // then back again to OO RGB value
++ setColor( OORGBToXLRGB( GetIndexColor( nIndex ) ) );
++}
++uno::Any
++ScVbaInterior::GetIndexColor( const sal_Int32& nColorIndex )
++{
++ sal_Int32 nIndex = nColorIndex;
+ // #FIXME xlColorIndexAutomatic & xlColorIndexNone are not really
+ // handled properly here
+-
+ if ( !nIndex || ( nIndex == excel::XlColorIndex::xlColorIndexAutomatic ) || ( nIndex == excel::XlColorIndex::xlColorIndexNone ) )
+ nIndex = 2; // default is white ( this maybe will probably break, e.g. we may at some stage need to know what this interior is, a cell or something else and then pick a default colour based on that )
+ --nIndex; // OOo indices are zero bases
+ uno::Reference< container::XIndexAccess > xIndex = getPalette();
+- // setColor expects colors in XL RGB values
+- // #FIXME this is daft we convert OO RGB val to XL RGB val and
+- // then back again to OO RGB value
+- setColor( OORGBToXLRGB(xIndex->getByIndex( nIndex )) );
++ return xIndex->getByIndex( nIndex );
+ }
+
+-uno::Any SAL_CALL
+-ScVbaInterior::getColorIndex() throw ( css::uno::RuntimeException )
++sal_Int32
++ScVbaInterior::GetColorIndex( const sal_Int32 nColor )
+ {
+- sal_Int32 nColor = 0;
+- // getColor returns Xl ColorValue, need to convert it to OO val
+- // as the palette deals with OO RGB values
+- // #FIXME this is daft in getColor we convert OO RGB val to XL RGB val
+- // and then back again to OO RGB value
+- XLRGBToOORGB( getColor() ) >>= nColor;
+ uno::Reference< container::XIndexAccess > xIndex = getPalette();
+ sal_Int32 nElems = xIndex->getCount();
+ sal_Int32 nIndex = -1;
+@@ -118,7 +197,187 @@ ScVbaInterior::getColorIndex() throw ( c
+ break;
+ }
+ }
+- return uno::makeAny( nIndex );
++ return nIndex;
++}
++
++uno::Any SAL_CALL
++ScVbaInterior::getColorIndex() throw ( css::uno::RuntimeException )
++{
++ sal_Int32 nColor = 0;
++ // getColor returns Xl ColorValue, need to convert it to OO val
++ // as the palette deals with OO RGB values
++ // #FIXME this is daft in getColor we convert OO RGB val to XL RGB val
++ // and then back again to OO RGB value
++ XLRGBToOORGB( getColor() ) >>= nColor;
++
++ return uno::makeAny( GetIndexColor( nColor ) );
++}
++Color
++ScVbaInterior::GetPatternColor( const Color& rPattColor, const Color& rBackColor, sal_uInt32 nXclPattern )
++{
++ // 0x00 == 0% transparence (full rPattColor)
++ // 0x80 == 100% transparence (full rBackColor)
++ static const sal_uInt8 pnRatioTable[] =
++ {
++ 0x80, 0x00, 0x40, 0x20, 0x60, 0x40, 0x40, 0x40, // 00 - 07
++ 0x40, 0x40, 0x20, 0x60, 0x60, 0x60, 0x60, 0x48, // 08 - 15
++ 0x50, 0x70, 0x78 // 16 - 18
++ };
++ return ( nXclPattern < STATIC_TABLE_SIZE( pnRatioTable ) ) ?
++ GetMixedColor( rPattColor, rBackColor, pnRatioTable[ nXclPattern ] ) : rPattColor;
++}
++Color
++ScVbaInterior::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans )
++{
++ return Color(
++ nTrans,
++ GetMixedColorComp( rFore.GetRed(), rBack.GetRed(), nTrans ),
++ GetMixedColorComp( rFore.GetGreen(), rBack.GetGreen(), nTrans ),
++ GetMixedColorComp( rFore.GetBlue(), rBack.GetBlue(), nTrans ));
++}
++sal_uInt8
++ScVbaInterior::GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans )
++{
++ sal_uInt32 nTemp = ((static_cast< sal_Int32 >( nBack ) - nFore) * nTrans) / 0x80 + nFore;
++ return static_cast< sal_uInt8 >( nTemp );
++}
++uno::Reference< container::XNameContainer >
++ScVbaInterior::GetAttributeContainer()
++{
++ return uno::Reference < container::XNameContainer > ( m_xProps->getPropertyValue( rtl::OUString::createFromAscii( "UserDefinedAttributes" ) ), uno::UNO_QUERY_THROW );
++}
++sal_Int32
++ScVbaInterior::GetAttributeData( uno::Any aValue )
++{
++ xml::AttributeData aDataValue;
++ if( aValue >>= aDataValue )
++ {
++ return aDataValue.Value.toInt32();
++ }
++ return sal_Int32( 0 );
++}
++uno::Any
++ScVbaInterior::SetAttributeData( sal_Int32 nValue )
++{
++ xml::AttributeData aAttributeData;
++ //aAttributeData.Namespace = rtl::OUString::createFromAscii( "org.openoffice.excel.CellPatten");
++ aAttributeData.Type = rtl::OUString::createFromAscii( "sal_Int32" );
++ aAttributeData.Value = rtl::OUString::valueOf( nValue );
++ return uno::makeAny( aAttributeData );
++}
++uno::Any
++ScVbaInterior::GetUserDefinedAttributes( const rtl::OUString& sName )
++{
++ uno::Reference< container::XNameContainer > xNameContainer( GetAttributeContainer(), uno::UNO_QUERY_THROW );
++ if( xNameContainer->hasByName( sName ) )
++ {
++ return xNameContainer->getByName( sName );
++ }
++ return uno::Any();
++}
++void
++ScVbaInterior::SetUserDefinedAttributes( const rtl::OUString& sName, const uno::Any& aValue )
++{
++ if( aValue.hasValue() )
++ {
++ uno::Reference< container::XNameContainer > xNameContainer( GetAttributeContainer(), uno::UNO_QUERY_THROW );
++ if( xNameContainer->hasByName( sName ) )
++ xNameContainer->removeByName( sName );
++ xNameContainer->insertByName( sName, aValue );
++ m_xProps->setPropertyValue( rtl::OUString::createFromAscii( "UserDefinedAttributes" ), uno::makeAny( xNameContainer ) );
++ }
++}
++// OOo do not support below API
++uno::Any SAL_CALL
++ScVbaInterior::getPattern() throw (uno::RuntimeException)
++{
++ // XlPattern
++ uno::Any aPattern = GetUserDefinedAttributes( PATTERN );
++ if( aPattern.hasValue() )
++ return uno::makeAny( GetAttributeData( aPattern ) );
++ return uno::makeAny( excel::XlPattern::xlPatternNone );
++}
++void SAL_CALL
++ScVbaInterior::setPattern( const uno::Any& _pattern ) throw (uno::RuntimeException)
++{
++ if( _pattern >>= m_nPattern )
++ {
++ SetUserDefinedAttributes( PATTERN, SetAttributeData( m_nPattern ) );
++ SetMixedColor();
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern index" ), uno::Reference< uno::XInterface >() );
++}
++Color
++ScVbaInterior::GetBackColor()
++{
++ sal_Int32 nColor;
++ Color aBackColor;
++ uno::Any aColor = GetUserDefinedAttributes( BACKCOLOR );
++ if( aColor.hasValue() )
++ {
++ nColor = GetAttributeData( aColor );
++ aBackColor.SetColor( nColor );
++ }
++ else
++ {
++ uno::Any aAny;
++ aAny = OORGBToXLRGB( m_xProps->getPropertyValue( BACKCOLOR ) );
++ if( aAny >>= nColor )
++ {
++ nColor = XLRGBToOORGB( nColor );
++ aBackColor.SetColor( nColor );
++ SetUserDefinedAttributes( BACKCOLOR, SetAttributeData( nColor ) );
++ }
++ }
++ return aBackColor;
++}
++uno::Any SAL_CALL
++ScVbaInterior::getPatternColor() throw (uno::RuntimeException)
++{
++ // 0 is the default color. no filled.
++ uno::Any aPatternColor = GetUserDefinedAttributes( PATTERNCOLOR );
++ if( aPatternColor.hasValue() )
++ {
++ sal_uInt32 nPatternColor = GetAttributeData( aPatternColor );
++ return uno::makeAny( OORGBToXLRGB( nPatternColor ) );
++ }
++ return uno::makeAny( sal_Int32( 0 ) );
++}
++void SAL_CALL
++ScVbaInterior::setPatternColor( const uno::Any& _patterncolor ) throw (uno::RuntimeException)
++{
++ sal_Int32 nPattColor;
++ if( _patterncolor >>= nPattColor )
++ {
++ SetUserDefinedAttributes( PATTERNCOLOR, SetAttributeData( XLRGBToOORGB( nPattColor ) ) );
++ SetMixedColor();
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern Color" ), uno::Reference< uno::XInterface >() );
++}
++uno::Any SAL_CALL
++ScVbaInterior::getPatternColorIndex() throw (uno::RuntimeException)
++{
++ sal_Int32 nColor = 0;
++ XLRGBToOORGB( getPatternColor() ) >>= nColor;
++
++ return uno::makeAny( GetIndexColor( nColor ) );
++}
++void SAL_CALL
++ScVbaInterior::setPatternColorIndex( const uno::Any& _patterncolorindex ) throw (uno::RuntimeException)
++{
++ sal_Int32 nColorIndex = 0;
++ if( _patterncolorindex >>= nColorIndex )
++ {
++ if( nColorIndex == 0 )
++ return;
++ sal_Int32 nPattColor = 0;
++ GetIndexColor( nColorIndex ) >>= nPattColor;
++ setPatternColor( uno::makeAny( OORGBToXLRGB( nPattColor ) ) );
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern Color" ), uno::Reference< uno::XInterface >() );
+ }
+
+ rtl::OUString&
+Index: sc/source/ui/vba/vbainterior.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbainterior.hxx,v
+retrieving revision 1.4
+retrieving revision 1.4.96.1
+diff -u -p -b -w -B -r1.4 -r1.4.96.1
+--- sc/source/ui/vba/vbainterior.hxx 11 Apr 2008 01:03:36 -0000 1.4
++++ sc/source/ui/vba/vbainterior.hxx 29 Jul 2008 06:35:41 -0000 1.4.96.1
+@@ -46,8 +46,23 @@ class ScVbaInterior : public ScVbaInter
+ {
+ css::uno::Reference< css::beans::XPropertySet > m_xProps;
+ ScDocument* m_pScDoc;
++ Color m_aPattColor;
++ sal_Int32 m_nPattern;
+
+ css::uno::Reference< css::container::XIndexAccess > getPalette();
++ css::uno::Reference< css::container::XNameContainer > GetAttributeContainer();
++ css::uno::Any SetAttributeData( sal_Int32 nValue );
++ sal_Int32 GetAttributeData( css::uno::Any aValue );
++ Color GetBackColor();
++protected:
++ Color GetPatternColor( const Color& rPattColor, const Color& rBackColor, sal_uInt32 nXclPattern );
++ Color GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans );
++ sal_uInt8 GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans );
++ css::uno::Any GetIndexColor( const sal_Int32& nColorIndex );
++ sal_Int32 GetColorIndex( const sal_Int32 nColor );
++ css::uno::Any GetUserDefinedAttributes( const rtl::OUString& sName );
++ void SetUserDefinedAttributes( const rtl::OUString& sName, const css::uno::Any& aValue );
++ void SetMixedColor();
+ public:
+ ScVbaInterior( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::beans::XPropertySet >& xProps, ScDocument* pScDoc = NULL) throw ( css::lang::IllegalArgumentException);
+@@ -59,6 +74,12 @@ public:
+
+ virtual css::uno::Any SAL_CALL getColorIndex() throw ( css::uno::RuntimeException);
+ virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw ( css::uno::RuntimeException );
++ virtual css::uno::Any SAL_CALL getPattern() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setPattern( const css::uno::Any& _pattern ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getPatternColor() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setPatternColor( const css::uno::Any& _patterncolor ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getPatternColorIndex() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setPatternColorIndex( const css::uno::Any& _patterncolorindex ) throw (css::uno::RuntimeException);
+ //XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+Index: sc/source/ui/vba/vbalabel.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbalabel.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbalabel.cxx 11 Apr 2008 01:03:52 -0000 1.3
++++ sc/source/ui/vba/vbalabel.cxx 6 Jul 2008 15:30:14 -0000 1.2.42.2
+@@ -35,7 +35,7 @@ using namespace org::openoffice;
+
+
+ const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-ScVbaLabel::ScVbaLabel( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : LabelImpl_BASE( xContext, xControlShape )
++ScVbaLabel::ScVbaLabel( const css::uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper ) : LabelImpl_BASE( xParent, xContext, xControl, pGeomHelper )
+ {
+ }
+
+@@ -53,3 +53,36 @@ ScVbaLabel::setCaption( const rtl::OUStr
+ {
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+ }
++uno::Any SAL_CALL
++ScVbaLabel::getValue() throw (css::uno::RuntimeException)
++{
++ return uno::makeAny( getCaption() );
++}
++
++void SAL_CALL
++ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
++{
++ rtl::OUString sCaption;
++ _value >>= sCaption;
++ setCaption( sCaption );
++}
++
++
++rtl::OUString&
++ScVbaLabel::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLabel") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaLabel::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.Label" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbalabel.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbalabel.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbalabel.hxx 11 Apr 2008 01:04:06 -0000 1.3
++++ sc/source/ui/vba/vbalabel.hxx 6 Jul 2008 15:30:52 -0000 1.2.42.2
+@@ -34,16 +34,23 @@
+
+ #include "vbacontrol.hxx"
+ #include "vbahelper.hxx"
++#include <cppuhelper/implbase2.hxx>
+
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XLabel > LabelImpl_BASE;
++typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XLabel, css::script::XDefaultProperty > LabelImpl_BASE;
+
+ class ScVbaLabel : public LabelImpl_BASE
+ {
+ public:
+- ScVbaLabel( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
++ ScVbaLabel( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++ // XDefaultProperty
++ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ };
+ #endif //SC_VBA_LABEL_HXX
+Index: sc/source/ui/vba/vbalistbox.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbalistbox.cxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.3
+diff -u -p -b -w -B -r1.4 -r1.3.42.3
+--- sc/source/ui/vba/vbalistbox.cxx 11 Apr 2008 01:05:34 -0000 1.4
++++ sc/source/ui/vba/vbalistbox.cxx 29 Jul 2008 06:35:41 -0000 1.3.42.3
+@@ -37,31 +37,49 @@
+ using namespace com::sun::star;
+ using namespace org::openoffice;
+
+-const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") );
++const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") );
++const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") );
+ const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
+
+
+-ScVbaListBox::ScVbaListBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : ListBoxImpl_BASE( xContext, xControlShape )
++ScVbaListBox::ScVbaListBox( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper ) : ListBoxImpl_BASE( xParent, xContext, xControl, pGeomHelper )
+ {
+- // grab the default value property name
+- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
+ }
+
+-ScVbaListBox::ScVbaListBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xPropSet, const css::uno::Reference< css::drawing::XControlShape > xControlShape ) : ListBoxImpl_BASE( xContext, xPropSet, xControlShape )
++// Attributes
++void SAL_CALL
++ScVbaListBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
+ {
+- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
++ sal_Int32 nIndex = 0;
++ _value >>= nIndex;
++ Selected( nIndex );
+ }
+
++uno::Any SAL_CALL
++ScVbaListBox::getListIndex() throw (uno::RuntimeException)
++{
++ uno::Sequence< sal_Int16 > sSelection;
++ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
++ if ( sSelection.getLength() == 0 )
++ return uno::Any( sal_Int32( -1 ) );
++ return uno::Any( sSelection[ 0 ] );
++}
+
+-// Attributes
+ uno::Any SAL_CALL
+ ScVbaListBox::getValue() throw (uno::RuntimeException)
+ {
++ uno::Sequence< sal_Int16 > sSelection;
++ uno::Sequence< rtl::OUString > sItems;
++ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
++ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
+ if( getMultiSelect() )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+ uno::Reference< form::validation::XValidatableFormComponent > xValidatableFormComponent( m_xProps, uno::UNO_QUERY_THROW );
+- return xValidatableFormComponent->getCurrentValue();
++ uno::Any aRet;
++ if ( sSelection.getLength() )
++ aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] );
++ return aRet;
+ }
+
+ void SAL_CALL
+@@ -91,18 +109,17 @@ ScVbaListBox::setValue( const uno::Any&
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+
+- nList.realloc( 1 );
+- nList[0] = nValue;
+-
+- m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
++ uno::Sequence< sal_Int16 > nSelectedIndices(1);
++ nSelectedIndices[ 0 ] = nValue;
++ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) );
++ m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) );
+ }
+
+ ::rtl::OUString SAL_CALL
+ ScVbaListBox::getText() throw (uno::RuntimeException)
+ {
+ rtl::OUString result;
+- uno::Reference< form::validation::XValidatableFormComponent > xValidatableFormComponent( m_xProps, uno::UNO_QUERY_THROW );
+- xValidatableFormComponent->getCurrentValue() >>= result;
++ getValue() >>= result;
+ return result;
+ }
+
+@@ -125,29 +142,7 @@ ScVbaListBox::setMultiSelect( sal_Bool _
+ {
+ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( _multiselect ) );
+ }
+-/*
+-css::uno::Sequence< sal_Bool > SAL_CALL
+-ScVbaListBox::getSelected() throw (css::uno::RuntimeException)
+-{
+- uno::Sequence< rtl::OUString > sList;
+- uno::Sequence< sal_Int16 > nList;
+- m_xProps->getPropertyValue( ITEMS ) >>= sList;
+- uno::Sequence< sal_Bool > bSelected( sList.getLength() );
+- for( sal_Int16 i = 0; i < bSelected.getLength(); i++ )
+- bSelected[i] = sal_False;
+- m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList;
+- for( sal_Int16 i = 0; i < nList.getLength(); i++ )
+- {
+- bSelected[nList[i]] = sal_True;
+- }
+- return bSelected;
+-}
+
+-void SAL_CALL
+-ScVbaListBox::setSelected( const css::uno::Sequence< sal_Bool >& _selected ) throw (css::uno::RuntimeException)
+-{
+-}
+-*/
+ css::uno::Any SAL_CALL
+ ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException)
+ {
+@@ -219,12 +214,45 @@ ScVbaListBox::AddItem( const uno::Any& p
+ }
+
+ void SAL_CALL
++ScVbaListBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
++{
++ sal_Int32 nIndex = 0;
++ // for int index
++ if ( index >>= nIndex )
++ {
++ uno::Sequence< rtl::OUString > sList;
++ m_xProps->getPropertyValue( ITEMS ) >>= sList;
++ if( nIndex < 0 || nIndex > ( sList.getLength() - 1 ) )
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid index" ), uno::Reference< uno::XInterface > () );
++ if( sList.hasElements() )
++ {
++ if( sList.getLength() == 1 )
++ {
++ Clear();
++ return;
++ }
++ for( sal_Int32 i = nIndex; i < ( sList.getLength()-1 ); i++ )
++ {
++ sList[i] = sList[i+1];
++ }
++ sList.realloc( sList.getLength() - 1 );
++ }
++
++ m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) );
++ }
++}
++
++void SAL_CALL
+ ScVbaListBox::Clear( ) throw (uno::RuntimeException)
+ {
+ // urk, setValue doesn't seem to work !!
+ //setValue( uno::makeAny( sal_Int16() ) );
+ m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) );
+ }
++
++// this is called when something like the following vba code is used
++// to set the selected state of particular entries in the Listbox
++// ListBox1.Selected( 3 ) = false
+ //PropListener
+ void
+ ScVbaListBox::setValueEvent( const uno::Any& value )
+@@ -234,7 +262,7 @@ ScVbaListBox::setValueEvent( const uno::
+ throw uno::RuntimeException( rtl::OUString::createFromAscii(
+ "Invalid type\n. need boolean." ), uno::Reference< uno::XInterface >() );
+ uno::Sequence< sal_Int16 > nList;
+- m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList;
++ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nList;
+ sal_Int16 nLength = static_cast<sal_Int16>( nList.getLength() );
+ sal_Int16 nIndex = m_nIndex;
+ for( sal_Int16 i = 0; i < nLength; i++ )
+@@ -250,7 +278,8 @@ ScVbaListBox::setValueEvent( const uno::
+ nList[i] = nList[i + 1];
+ }
+ nList.realloc( nLength - 1 );
+- m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
++ //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
++ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) );
+ return;
+ }
+ }
+@@ -271,6 +300,10 @@ ScVbaListBox::setValueEvent( const uno::
+ }
+ }
+
++// this is called when something like the following vba code is used
++// to determine the selected state of particular entries in the Listbox
++// msgbox ListBox1.Selected( 3 )
++
+ css::uno::Any
+ ScVbaListBox::getValueEvent()
+ {
+@@ -287,3 +320,22 @@ ScVbaListBox::getValueEvent()
+
+ return uno::makeAny( sal_False );
+ }
++
++rtl::OUString&
++ScVbaListBox::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaListBox") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaListBox::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.ScVbaListBox" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbalistbox.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbalistbox.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.3
+diff -u -p -b -w -B -r1.3 -r1.2.42.3
+--- sc/source/ui/vba/vbalistbox.hxx 11 Apr 2008 01:05:48 -0000 1.3
++++ sc/source/ui/vba/vbalistbox.hxx 29 Jul 2008 06:35:41 -0000 1.2.42.3
+@@ -49,14 +49,11 @@ class ScVbaListBox : public ListBoxImpl_
+ sal_Int16 m_nIndex;
+
+ public:
+- ScVbaListBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
+- ScVbaListBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::beans::XPropertySet >& xProps,
+- const css::uno::Reference< css::drawing::XControlShape> xControlShape );
+-
++ ScVbaListBox( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
+
+ // Attributes
++ virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+@@ -67,12 +64,17 @@ public:
+
+ // Methods
+ virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
++ virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException);
+
+
+ // XDefaultProperty
+ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++
+ //PropListener
+ virtual void setValueEvent( const css::uno::Any& value );
+ virtual css::uno::Any getValueEvent();
+Index: sc/source/ui/vba/vbamultipage.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbamultipage.cxx
+diff -N sc/source/ui/vba/vbamultipage.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbamultipage.cxx 22 Apr 2008 19:53:15 -0000 1.1.2.1
+@@ -0,0 +1,132 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbamultipage.hxx"
++#include <org/openoffice/vba/XCollection.hpp>
++#include "vbapages.hxx"
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++// uno servicename com.sun.star.awt.UnoControlProgressBarMode
++const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
++const rtl::OUString SVALUEMAX( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") );
++const rtl::OUString SSTEP( RTL_CONSTASCII_USTRINGPARAM("Step") );
++
++typedef cppu::WeakImplHelper1< container::XIndexAccess > PagesImpl_Base;
++class PagesImpl : public PagesImpl_Base
++{
++ sal_Int32 mnPages;
++public:
++ PagesImpl( sal_Int32 nPages ) : mnPages( nPages ) {}
++ virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException) { return mnPages; }
++ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, ::uno::RuntimeException)
++ {
++ if ( Index < 0 || Index > mnPages )
++ throw lang::IndexOutOfBoundsException();
++ return uno::makeAny( uno::Reference< uno::XInterface >() );
++ }
++ // XElementAccess
++ virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException)
++ {
++ // no Pages object yet #FIXME
++ //return msforms::XPage::static_type(0);
++ return uno::XInterface::static_type(0);
++ }
++ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
++ {
++ return ( mnPages > 0 );
++ }
++};
++uno::Reference< container::XIndexAccess >
++ScVbaMultiPage::getPages( sal_Int32 nPages )
++{
++ return new PagesImpl( nPages );
++}
++
++ScVbaMultiPage::ScVbaMultiPage( const uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper, const uno::Reference< uno::XInterface >& xDialog ) : MultiPageImpl_BASE( xParent, xContext, xControl, pGeomHelper )
++{
++ mxDialogProps.set( xDialog, uno::UNO_QUERY_THROW );
++ // set dialog step to value of multipage pseudo model
++ setValue(getValue());
++}
++
++// Attributes
++sal_Int32 SAL_CALL
++ScVbaMultiPage::getValue() throw (css::uno::RuntimeException)
++{
++ sal_Int32 nValue = 0;
++ m_xProps->getPropertyValue( SVALUE ) >>= nValue;
++ return nValue;
++}
++
++void SAL_CALL
++ScVbaMultiPage::setValue( const sal_Int32 _value ) throw (::com::sun::star::uno::RuntimeException)
++{
++ // track change in dialog ( dialog value is 1 based, 0 is a special value )
++ m_xProps->setPropertyValue( SVALUE, uno::makeAny( _value ) );
++ mxDialogProps->setPropertyValue( SSTEP, uno::makeAny( _value + 1) );
++}
++
++
++rtl::OUString&
++ScVbaMultiPage::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMultiPage") );
++ return sImplName;
++}
++
++uno::Any SAL_CALL
++ScVbaMultiPage::Pages( const uno::Any& index ) throw (uno::RuntimeException)
++{
++ sal_Int32 nValue = 0;
++ m_xProps->getPropertyValue( SVALUEMAX ) >>= nValue;
++ uno::Reference< vba::XCollection > xColl( new ScVbaPages( this, mxContext, getPages( nValue ) ) );
++ if ( !index.hasValue() )
++ return uno::makeAny( xColl );
++ return xColl->Item( uno::makeAny( index ), uno::Any() );
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaMultiPage::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.MultiPage" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbamultipage.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbamultipage.hxx
+diff -N sc/source/ui/vba/vbamultipage.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbamultipage.hxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,65 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_MULTIPAGE_HXX
++#define SC_VBA_MULTIPAGE_HXX
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/msforms/XMultiPage.hpp>
++#include <com/sun/star/container/XIndexAccess.hpp>
++
++#include "vbacontrol.hxx"
++#include "vbahelper.hxx"
++//#include <cppuhelper/implbase2.hxx>
++#include <cppuhelper/implbase1.hxx>
++
++typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XMultiPage > MultiPageImpl_BASE;
++
++class ScVbaMultiPage : public MultiPageImpl_BASE
++{
++ css::uno::Reference< css::container::XIndexAccess > getPages( sal_Int32 nPages );
++ css::uno::Reference< css::beans::XPropertySet > mxDialogProps;
++public:
++ ScVbaMultiPage( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper, const css::uno::Reference< css::uno::XInterface >& xDialog );
++ // Attributes
++ virtual sal_Int32 SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const sal_Int32 _value ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL Pages( const css::uno::Any& index ) throw (css::uno::RuntimeException);
++
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++ // XDefaultProperty
++ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
++};
++#endif //SC_VBA_LABEL_HXX
+Index: sc/source/ui/vba/vbaname.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaname.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbaname.cxx 11 Apr 2008 01:06:07 -0000 1.3
++++ sc/source/ui/vba/vbaname.cxx 6 Jul 2008 15:31:26 -0000 1.2.42.2
+@@ -31,6 +31,7 @@
+
+ #include <com/sun/star/table/XCellRange.hpp>
+ #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
++#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
+
+ #include "vbaname.hxx"
+ #include "vbarange.hxx"
+@@ -110,17 +111,37 @@ ScVbaName::getValue() throw (css::uno::R
+ {
+ ::rtl::OUString sValue = mxNamedRange->getContent();
+ ::rtl::OUString sSheetName = getWorkSheet()->getName();
+- if ( sValue.toChar() == '$' )
++ ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( ";" );
++ ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( "," );
++ ::rtl::OUString sResult;
++ sal_Int32 nFrom = 0;
++ sal_Int32 nTo = 0;
++ nTo = sValue.indexOf( sSegmentation, nFrom );
++ while ( nTo != -1 )
+ {
+- ::rtl::OUString sTmp = sValue.copy(1);
+- sValue = sTmp;
++ ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom );
++ if ( sTmpValue.toChar() == '$' )
++ {
++ ::rtl::OUString sTmp = sTmpValue.copy( 1 );
++ sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!"));
++ sResult += sTmp;
++ sResult += sNewSegmentation;
++ }
++ nFrom = nTo + 1;
++ nTo = sValue.indexOf( sSegmentation, nFrom );
++ }
++ ::rtl::OUString sTmpValue = sValue.copy( nFrom );
++ if ( sTmpValue.toChar() == '$' )
++ {
++ ::rtl::OUString sTmp = sTmpValue.copy(1);
++ sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!"));
++ sResult += sTmp;
+ }
+- sValue = sValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!"));
+- if (sValue.indexOf('=') != 0)
++ if (sResult.indexOf('=') != 0)
+ {
+- sValue = ::rtl::OUString::createFromAscii("=") + sValue;
++ sResult = ::rtl::OUString::createFromAscii("=") + sResult;
+ }
+- return sValue;
++ return sResult;
+ }
+
+ void
+@@ -128,17 +149,38 @@ ScVbaName::setValue( const ::rtl::OUStri
+ {
+ ::rtl::OUString sSheetName = getWorkSheet()->getName();
+ ::rtl::OUString sValue = rValue;
++ ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( "," );
++ ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( ";" );
++ ::rtl::OUString sResult;
++ sal_Int32 nFrom = 0;
++ sal_Int32 nTo = 0;
+ if (sValue.indexOf('=') == 0)
+ {
+ ::rtl::OUString sTmp = sValue.copy(1);
+ sValue = sTmp;
+ }
+- if (sValue.copy(0, sSheetName.getLength()).equals(sSheetName))
++ nTo = sValue.indexOf( sSegmentation, nFrom );
++ while ( nTo != -1 )
++ {
++ ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom );
++ sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("."));
++ if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName))
++ {
++ sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue;
++ }
++ sTmpValue += sNewSegmentation;
++ sResult += sTmpValue;
++ nFrom = nTo + 1;
++ nTo = sValue.indexOf( sSegmentation, nFrom );
++ }
++ ::rtl::OUString sTmpValue = sValue.copy( nFrom );
++ sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("."));
++ if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName))
+ {
+- sValue = ::rtl::OUString::createFromAscii("$") + sSheetName;
++ sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue;
+ }
+- sValue = sValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("."));
+- mxNamedRange->setContent(sValue);
++ sResult += sTmpValue;
++ mxNamedRange->setContent(sResult);
+ }
+
+ ::rtl::OUString
+@@ -192,7 +234,7 @@ ScVbaName::setRefersToR1C1Local( const :
+ css::uno::Reference< oo::excel::XRange >
+ ScVbaName::getRefersToRange() throw (css::uno::RuntimeException)
+ {
+- css::uno::Reference< oo::excel::XRange > xRange;
++ uno::Reference< oo::excel::XRange > xRange = ScVbaRange::getRangeObjectForName( mxContext, mxNamedRange->getName(), getDocShell( mxModel ), ScAddress::CONV_XL_R1C1 );
+ return xRange;
+ }
+
+Index: sc/source/ui/vba/vbanames.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbanames.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbanames.cxx 11 Apr 2008 01:06:56 -0000 1.3
++++ sc/source/ui/vba/vbanames.cxx 6 Jul 2008 15:29:52 -0000 1.2.42.2
+@@ -70,6 +70,7 @@ ScVbaNames::ScVbaNames(const css::uno::R
+ mxModel( xModel ),
+ mxNames( xNames )
+ {
++ m_xNameAccess.set( xNames, uno::UNO_QUERY_THROW );
+ }
+
+ ScVbaNames::~ScVbaNames()
+Index: sc/source/ui/vba/vbapagebreak.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapagebreak.cxx
+diff -N sc/source/ui/vba/vbapagebreak.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapagebreak.cxx 29 Jul 2008 06:35:41 -0000 1.1.2.1
+@@ -0,0 +1,141 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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.
++ *
++ ************************************************************************/
++#include "vbapagebreak.hxx"
++#include "vbarange.hxx"
++#include <org/openoffice/excel/XlPageBreak.hpp>
++using namespace ::com::sun::star;
++using namespace ::org::openoffice;
++
++template< typename Ifc1 >
++ScVbaPageBreak<Ifc1>::ScVbaPageBreak( const uno::Reference< vba::XHelperInterface >& xParent,
++ const uno::Reference< uno::XComponentContext >& xContext,
++ uno::Reference< beans::XPropertySet >& xProps,
++ sheet::TablePageBreakData aTablePageBreakData) throw (uno::RuntimeException):
++ ScVbaPageBreak_BASE( xParent, xContext ),
++ mxRowColPropertySet( xProps ),
++ maTablePageBreakData( aTablePageBreakData )
++{
++}
++
++template< typename Ifc1 >
++sal_Int32 ScVbaPageBreak<Ifc1>::getType() throw (uno::RuntimeException)
++{
++ uno::Any aValue = mxRowColPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )));
++ sal_Bool hasPageBreak = sal_False;
++ aValue >>= hasPageBreak;
++
++ if( !hasPageBreak )
++ return excel::XlPageBreak::xlPageBreakNone;
++
++ if( maTablePageBreakData.ManualBreak )
++ return excel::XlPageBreak::xlPageBreakManual;
++
++ return excel::XlPageBreak::xlPageBreakAutomatic;
++}
++
++template< typename Ifc1 >
++void ScVbaPageBreak<Ifc1>::setType(sal_Int32 type) throw (uno::RuntimeException)
++{
++ if( (type != excel::XlPageBreak::xlPageBreakNone) &&
++ (type != excel::XlPageBreak::xlPageBreakManual) &&
++ (type != excel::XlPageBreak::xlPageBreakAutomatic) )
++ {
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ }
++
++ if( type == excel::XlPageBreak::xlPageBreakNone )
++ {
++ mxRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(sal_False));
++ return;
++ }
++
++ mxRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(sal_True));
++ if( type == excel::XlPageBreak::xlPageBreakManual )
++ maTablePageBreakData.ManualBreak = sal_True;
++ else
++ maTablePageBreakData.ManualBreak = sal_False;
++}
++
++template< typename Ifc1 >
++void ScVbaPageBreak<Ifc1>::Delete() throw ( script::BasicErrorException, uno::RuntimeException)
++{
++ mxRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(sal_False));
++}
++
++template< typename Ifc1 >
++uno::Reference< excel::XRange> ScVbaPageBreak<Ifc1>::Location() throw ( script::BasicErrorException, uno::RuntimeException)
++{
++ uno::Reference< table::XCellRange > xRange( mxRowColPropertySet, uno::UNO_QUERY_THROW );
++ return new ScVbaRange( ScVbaPageBreak_BASE::getParent(), ScVbaPageBreak_BASE::mxContext, xRange);
++}
++
++template< typename Ifc1 >
++rtl::OUString&
++ScVbaPageBreak<Ifc1>::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPageBreak") );
++ return sImplName;
++}
++
++template< typename Ifc1 >
++uno::Sequence< rtl::OUString >
++ScVbaPageBreak<Ifc1>::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.PageBreak" ) );
++ }
++ return aServiceNames;
++}
++
++template class ScVbaPageBreak< excel::XHPageBreak >;
++
++/* class ScVbaHPageBreak */
++rtl::OUString&
++ScVbaHPageBreak::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaHPageBreak") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaHPageBreak::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.HPageBreak" ) );
++ }
++ return aServiceNames;
++}
++
+Index: sc/source/ui/vba/vbapagebreak.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapagebreak.hxx
+diff -N sc/source/ui/vba/vbapagebreak.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapagebreak.hxx 29 Jul 2008 06:35:41 -0000 1.1.2.1
+@@ -0,0 +1,87 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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 SC_VBA_PAGEBREAK_HXX
++#define SC_VBA_PAGEBREAK_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/excel/XPageBreak.hpp>
++#include <org/openoffice/excel/XHPageBreak.hpp>
++#include <org/openoffice/excel/XRange.hpp>
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/script/BasicErrorException.hpp>
++#include <com/sun/star/sheet/TablePageBreakData.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include "vbahelperinterface.hxx"
++
++template< typename Ifc1 >
++class ScVbaPageBreak : public InheritedHelperInterfaceImpl1< Ifc1 >
++{
++typedef InheritedHelperInterfaceImpl1< Ifc1 > ScVbaPageBreak_BASE;
++protected:
++ css::sheet::TablePageBreakData maTablePageBreakData;
++ css::uno::Reference< css::beans::XPropertySet > mxRowColPropertySet;
++public:
++ ScVbaPageBreak( const css::uno::Reference< oo::vba::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 ~ScVbaPageBreak(){}
++
++ virtual sal_Int32 SAL_CALL getType( ) throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setType(sal_Int32 type) throw (css::uno::RuntimeException);
++
++ virtual void SAL_CALL Delete() throw ( css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::excel::XRange> SAL_CALL Location() throw ( css::script::BasicErrorException, css::uno::RuntimeException);
++
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
++
++typedef ScVbaPageBreak < oo::excel::XHPageBreak > ScVbaHPageBreak_BASE;
++
++class ScVbaHPageBreak : public ScVbaHPageBreak_BASE
++{
++public:
++ ScVbaHPageBreak( const css::uno::Reference< oo::vba::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):
++ ScVbaHPageBreak_BASE( xParent,xContext,xProps,aTablePageBreakData ){}
++
++ virtual ~ScVbaHPageBreak(){}
++
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
++#endif
+Index: sc/source/ui/vba/vbapagebreaks.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapagebreaks.cxx
+diff -N sc/source/ui/vba/vbapagebreaks.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapagebreaks.cxx 29 Jul 2008 06:35:41 -0000 1.1.2.1
+@@ -0,0 +1,269 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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.
++ *
++ ************************************************************************/
++#include "vbapagebreaks.hxx"
++#include "vbapagebreak.hxx"
++#include <org/openoffice/excel/XWorksheet.hpp>
++using namespace ::com::sun::star;
++using namespace ::org::openoffice;
++
++typedef ::cppu::WeakImplHelper1<container::XIndexAccess > RangePageBreaks_Base;
++class RangePageBreaks : public RangePageBreaks_Base
++{
++private:
++ uno::Reference< vba::XHelperInterface > mxParent;
++ uno::Reference< uno::XComponentContext > mxContext;
++ uno::Reference< sheet::XSheetPageBreak > mxSheetPageBreak;
++ sal_Bool m_bColumn;
++
++public:
++ RangePageBreaks( const uno::Reference< vba::XHelperInterface >& xParent,
++ const uno::Reference< uno::XComponentContext >& xContext,
++ uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak,
++ sal_Bool bColumn ) : mxParent( xParent ), mxContext( xContext ), mxSheetPageBreak( xSheetPageBreak ), m_bColumn( bColumn )
++ {
++ }
++
++ sal_Int32 getAPIStartofRange( const uno::Reference< excel::XRange >& xRange ) throw (css::uno::RuntimeException)
++ {
++ if( m_bColumn )
++ return xRange->getColumn() - 1;
++ return xRange->getRow() - 1;
++ }
++
++ sal_Int32 getAPIEndIndexofRange( const uno::Reference< excel::XRange >& xRange, sal_Int32 nUsedStart ) throw (uno::RuntimeException)
++ {
++ if( m_bColumn )
++ return nUsedStart + xRange->Columns( uno::Any() )->getCount();
++ return nUsedStart + xRange->Rows( uno::Any() )->getCount();
++ }
++
++ uno::Sequence<sheet::TablePageBreakData> getAllPageBreaks() throw (uno::RuntimeException)
++ {
++ if( m_bColumn )
++ return mxSheetPageBreak->getColumnPageBreaks();
++ return mxSheetPageBreak->getRowPageBreaks();
++ }
++
++ uno::Reference<container::XIndexAccess> getRowColContainer() throw (uno::RuntimeException)
++ {
++ uno::Reference< table::XColumnRowRange > xColumnRowRange( mxSheetPageBreak, uno::UNO_QUERY_THROW );
++ uno::Reference<container::XIndexAccess> xIndexAccess;
++ if( m_bColumn )
++ xIndexAccess.set( xColumnRowRange->getColumns(), uno::UNO_QUERY_THROW );
++ else
++ xIndexAccess.set( xColumnRowRange->getRows(), uno::UNO_QUERY_THROW );
++ return xIndexAccess;
++ }
++
++ sheet::TablePageBreakData getTablePageBreakData( sal_Int32 nAPIItemIndex ) throw ( script::BasicErrorException, uno::RuntimeException);
++ uno::Any Add( const css::uno::Any& Before ) throw ( css::script::BasicErrorException, css::uno::RuntimeException);
++
++ // XIndexAccess
++ virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException);
++ 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);
++ return excel::XHPageBreak::static_type(0);
++ }
++ virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
++ {
++ return sal_True;
++ }
++};
++
++/** @TODO Unlike MS Excel this method only considers the pagebreaks that intersect the used range
++* To become completely compatible the print area has to be considered. As far as I found out this printarea
++* also considers the position and sizes of shapes and manually inserted page breaks
++* Note: In MS there is a limit of 1026 horizontal page breaks per sheet.
++*/
++sal_Int32 SAL_CALL RangePageBreaks::getCount( ) throw (uno::RuntimeException)
++{
++ sal_Int32 nCount = 0;
++ uno::Reference< excel::XWorksheet > xWorksheet( mxParent, uno::UNO_QUERY_THROW );
++ uno::Reference< excel::XRange > xRange = xWorksheet->getUsedRange();
++ sal_Int32 nUsedStart = getAPIStartofRange( xRange );
++ sal_Int32 nUsedEnd = getAPIEndIndexofRange( xRange, nUsedStart );
++ uno::Sequence<sheet::TablePageBreakData> aTablePageBreakData = getAllPageBreaks();
++
++ sal_Int32 nLength = aTablePageBreakData.getLength();
++ for( sal_Int32 i=0; i<nLength; i++ )
++ {
++ sal_Int32 nPos = aTablePageBreakData[i].Position;
++ if( nPos > nUsedEnd )
++ return nCount;
++ if( nPos >= nUsedStart )
++ nCount++;
++ }
++
++ return nCount;
++}
++
++uno::Any SAL_CALL RangePageBreaks::getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
++{
++ if( (Index < getCount()) && ( Index >= 0 ))
++ {
++ sheet::TablePageBreakData aTablePageBreakData = getTablePageBreakData( Index );
++ uno::Reference< container::XIndexAccess > xIndexAccess = getRowColContainer();
++ sal_Int32 nPos = aTablePageBreakData.Position;
++ 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) ));
++ return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
++ }
++ }
++ throw lang::IndexOutOfBoundsException();
++}
++
++sheet::TablePageBreakData RangePageBreaks::getTablePageBreakData( sal_Int32 nAPIItemIndex ) throw ( script::BasicErrorException, uno::RuntimeException)
++{
++ sal_Int32 index = -1;
++ sheet::TablePageBreakData aTablePageBreakData;
++ uno::Reference< excel::XWorksheet > xWorksheet( mxParent, uno::UNO_QUERY_THROW );
++ uno::Reference< excel::XRange > xRange = xWorksheet->getUsedRange();
++ sal_Int32 nUsedStart = getAPIStartofRange( xRange );
++ sal_Int32 nUsedEnd = getAPIEndIndexofRange( xRange, nUsedStart );
++ uno::Sequence<sheet::TablePageBreakData> aTablePageBreakDataList = getAllPageBreaks();
++
++ sal_Int32 nLength = aTablePageBreakDataList.getLength();
++ for( sal_Int32 i=0; i<nLength; i++ )
++ {
++ aTablePageBreakData = aTablePageBreakDataList[i];
++ sal_Int32 nPos = aTablePageBreakData.Position;
++ if( nPos >= nUsedStart )
++ index++;
++ if( nPos > nUsedEnd )
++ DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
++ if( index == nAPIItemIndex )
++ return aTablePageBreakData;
++ }
++
++ return aTablePageBreakData;
++}
++
++uno::Any RangePageBreaks::Add( const css::uno::Any& Before ) throw ( css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ uno::Reference< excel::XRange > xRange;
++ Before >>= xRange;
++ if( !xRange.is() )
++ {
++ DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
++ }
++
++ sal_Int32 nAPIRowColIndex = getAPIStartofRange( xRange );
++ uno::Reference< container::XIndexAccess > xIndexAccess = getRowColContainer();
++ uno::Reference< beans::XPropertySet > xRowColPropertySet( xIndexAccess->getByIndex(nAPIRowColIndex), uno::UNO_QUERY_THROW );
++ xRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(sal_True));
++ 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) ));
++ return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) ));
++}
++
++
++class RangePageBreaksEnumWrapper : public EnumerationHelper_BASE
++{
++ uno::Reference<container::XIndexAccess > m_xIndexAccess;
++ sal_Int32 nIndex;
++public:
++ RangePageBreaksEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {}
++ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
++ {
++ return ( nIndex < m_xIndexAccess->getCount() );
++ }
++
++ virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
++ {
++ if ( nIndex < m_xIndexAccess->getCount() )
++ return m_xIndexAccess->getByIndex( nIndex++ );
++ throw container::NoSuchElementException();
++ }
++};
++
++ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< vba::XHelperInterface >& xParent,
++ const uno::Reference< uno::XComponentContext >& xContext,
++ uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak) throw (uno::RuntimeException):
++ ScVbaHPageBreaks_BASE( xParent,xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_False )),
++ mxSheetPageBreak( xSheetPageBreak )
++{
++}
++
++uno::Any SAL_CALL ScVbaHPageBreaks::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 >
++ScVbaHPageBreaks::createEnumeration() throw (uno::RuntimeException)
++{
++ return new RangePageBreaksEnumWrapper( m_xIndexAccess );
++}
++
++uno::Any
++ScVbaHPageBreaks::createCollectionObject( const css::uno::Any& aSource )
++{
++ return aSource; // its already a pagebreak object
++}
++
++uno::Type
++ScVbaHPageBreaks::getElementType() throw (uno::RuntimeException)
++{
++ return excel::XHPageBreak::static_type(0);
++}
++
++rtl::OUString&
++ScVbaHPageBreaks::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaHPageBreaks") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaHPageBreaks::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.HPageBreaks" ) );
++ }
++ return aServiceNames;
++}
++
+Index: sc/source/ui/vba/vbapagebreaks.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapagebreaks.hxx
+diff -N sc/source/ui/vba/vbapagebreaks.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapagebreaks.hxx 29 Jul 2008 06:35:42 -0000 1.1.2.1
+@@ -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$
++ * $Revision$
++ *
++ * 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 SC_VBA_PAGEBREAKS_HXX
++#define SC_VBA_PAGEBREAKS_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/excel/XHPageBreaks.hpp>
++#include <org/openoffice/excel/XHPageBreak.hpp>
++#include <org/openoffice/excel/XRange.hpp>
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/script/BasicErrorException.hpp>
++#include <com/sun/star/sheet/XSheetPageBreak.hpp>
++#include <com/sun/star/sheet/TablePageBreakData.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include <com/sun/star/container/XIndexAccess.hpp>
++#include <com/sun/star/table/XColumnRowRange.hpp>
++#include "vbahelperinterface.hxx"
++#include "vbacollectionimpl.hxx"
++
++typedef CollTestImplHelper< oo::excel::XHPageBreaks > ScVbaHPageBreaks_BASE;
++
++class ScVbaHPageBreaks : public ScVbaHPageBreaks_BASE
++{
++ css::uno::Reference< css::sheet::XSheetPageBreak > mxSheetPageBreak;
++public:
++ ScVbaHPageBreaks( const css::uno::Reference< oo::vba::XHelperInterface >& xParent,
++ const css::uno::Reference< css::uno::XComponentContext >& xContext,
++ css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak) throw (css::uno::RuntimeException);
++ virtual ~ScVbaHPageBreaks(){}
++
++ // XHPageBreaks
++ 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
+Index: sc/source/ui/vba/vbapages.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapages.cxx
+diff -N sc/source/ui/vba/vbapages.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapages.cxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,81 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbapages.hxx"
++
++using namespace ::org::openoffice;
++using namespace ::com::sun::star;
++using namespace ::vos;
++
++ScVbaPages::ScVbaPages( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPages ) throw( lang::IllegalArgumentException ) : ScVbaPages_BASE( xParent, xContext, xPages )
++{
++}
++
++uno::Type SAL_CALL
++ScVbaPages::getElementType() throw (uno::RuntimeException)
++{
++ // return msforms::XPage::static_type(0);
++ return uno::XInterface::static_type(0);
++}
++
++uno::Any
++ScVbaPages::createCollectionObject( const css::uno::Any& aSource )
++{
++ return aSource;
++}
++
++rtl::OUString&
++ScVbaPages::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPages") );
++ return sImplName;
++}
++
++uno::Reference< container::XEnumeration > SAL_CALL
++ScVbaPages::createEnumeration() throw (uno::RuntimeException)
++{
++ return uno::Reference< container::XEnumeration >();
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaPages::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msform.Pages" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbapages.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapages.hxx
+diff -N sc/source/ui/vba/vbapages.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapages.hxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,64 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_PAGES_HXX
++#define SC_VBA_PAGES_HXX
++
++#include <org/openoffice/office/MsoShapeType.hpp>
++#include <com/sun/star/lang/XEventListener.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include <org/openoffice/msforms/XPages.hpp>
++#include <cppuhelper/implbase2.hxx>
++#include <cppuhelper/implbase1.hxx>
++
++#include "vbacollectionimpl.hxx"
++typedef CollTestImplHelper<
++oo::msforms::XPages > ScVbaPages_BASE;
++
++class ScVbaPages : public ScVbaPages_BASE
++{
++protected:
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++public:
++ ScVbaPages( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xPages ) throw ( css::lang::IllegalArgumentException );
++ virtual ~ScVbaPages() {}
++ // 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);
++ // ScVbaPages_BASE
++ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
++
++};
++#endif//SC_VBA_SHAPE_HXX
+Index: sc/source/ui/vba/vbapagesetup.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapagesetup.cxx
+diff -N sc/source/ui/vba/vbapagesetup.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapagesetup.cxx 29 Jul 2008 06:35:42 -0000 1.1.2.1
+@@ -0,0 +1,892 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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.
++ *
++ ************************************************************************/
++#include "vbapagesetup.hxx"
++#include "cellsuno.hxx"
++#include "convuno.hxx"
++#include "rangelst.hxx"
++#include <com/sun/star/sheet/XPrintAreas.hpp>
++#include <com/sun/star/sheet/XHeaderFooterContent.hpp>
++#include <com/sun/star/text/XText.hpp>
++#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
++#include <com/sun/star/container/XNameAccess.hpp>
++#include <org/openoffice/excel/XlPageOrientation.hpp>
++#include <org/openoffice/excel/XlOrder.hpp>
++#include <org/openoffice/excel/Constants.hpp>
++
++using namespace ::com::sun::star;
++using namespace ::org::openoffice;
++
++#define ZOOM_IN 10
++#define ZOOM_MAX 400
++
++bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, ScRange& refRange, ScRangeList& aCellRanges, ScAddress::Convention aConv = ScAddress::CONV_XL_A1 ) throw ( uno::RuntimeException );
++
++ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< vba::XHelperInterface >& xParent,
++ const uno::Reference< uno::XComponentContext >& xContext,
++ const uno::Reference< sheet::XSpreadsheet >& xSheet,
++ const uno::Reference< frame::XModel >& xModel) throw (uno::RuntimeException):
++ ScVbaPageSetup_BASE( xParent, xContext ),
++ mxSheet( xSheet ), mxModel( xModel )
++{
++ // query for current page style
++ uno::Reference< beans::XPropertySet > xSheetProps( mxSheet, uno::UNO_QUERY_THROW );
++ uno::Any aValue = xSheetProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageStyle" )));
++ rtl::OUString aStyleName;
++ aValue >>= aStyleName;
++
++ uno::Reference< style::XStyleFamiliesSupplier > xStyleFamiliesSup( mxModel, uno::UNO_QUERY_THROW );
++ uno::Reference< container::XNameAccess > xStyleFamilies = xStyleFamiliesSup->getStyleFamilies();
++ uno::Reference< container::XNameAccess > xPageStyle( xStyleFamilies->getByName(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyles"))), uno::UNO_QUERY_THROW );
++ mxPageProps.set( xPageStyle->getByName(aStyleName), uno::UNO_QUERY_THROW );
++}
++
++rtl::OUString SAL_CALL ScVbaPageSetup::getPrintArea() throw (css::uno::RuntimeException)
++{
++ String aPrintArea;
++ uno::Reference< sheet::XPrintAreas > xPrintAreas( mxSheet, uno::UNO_QUERY_THROW );
++ uno::Sequence< table::CellRangeAddress > aSeq = xPrintAreas->getPrintAreas();
++ sal_Int32 nCount = aSeq.getLength();
++ if( nCount )
++ {
++ ScAddress::Details aDetails( ScAddress::CONV_XL_A1, 0, 0 );
++ USHORT nFlags = SCA_VALID;
++ nFlags |= ( SCA_TAB_ABSOLUTE | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB2_ABSOLUTE | SCA_COL2_ABSOLUTE | SCA_ROW2_ABSOLUTE );
++ ScRangeList aRangeList;
++ for( sal_Int32 i=0; i<nCount; i++ )
++ {
++ ScRange aRange;
++ ScUnoConversion::FillScRange( aRange, aSeq[i] );
++ aRangeList.Append( aRange );
++ }
++ ScDocument* pDoc = getDocShell( mxModel )->GetDocument();
++ aRangeList.Format( aPrintArea, nFlags, pDoc, ScAddress::CONV_XL_A1, ',' );
++ }
++
++ return aPrintArea;
++}
++
++void SAL_CALL ScVbaPageSetup::setPrintArea( const rtl::OUString& rAreas ) throw (css::uno::RuntimeException)
++{
++ uno::Reference< sheet::XPrintAreas > xPrintAreas( mxSheet, uno::UNO_QUERY_THROW );
++ if( rAreas.getLength() == 0 ||
++ rAreas.equalsIgnoreAsciiCase ( rtl::OUString::createFromAscii("FALSE") ) )
++ {
++ // print the whole sheet
++ uno::Sequence< table::CellRangeAddress > aSeq;
++ xPrintAreas->setPrintAreas( aSeq );
++ }
++ else
++ {
++ ScRangeList aCellRanges;
++ ScRange aRange;
++ if( getScRangeListForAddress( rAreas, getDocShell( mxModel ) , aRange, aCellRanges ) )
++ {
++ uno::Sequence< table::CellRangeAddress > aSeq( aCellRanges.Count() );
++ USHORT i=0;
++ for( ScRange* pRange = aCellRanges.First(); pRange; pRange = aCellRanges.Next() )
++ {
++ table::CellRangeAddress aRangeAddress;
++ ScUnoConversion::FillApiRange( aRangeAddress, *pRange );
++ aSeq[ i++ ] = aRangeAddress;
++ }
++ xPrintAreas->setPrintAreas( aSeq );
++ }
++ }
++}
++
++double SAL_CALL ScVbaPageSetup::getTopMargin() throw (css::uno::RuntimeException)
++{
++ sal_Bool headerOn = sal_False;
++ sal_Int32 topMargin = 0;
++ sal_Int32 headerHeight = 0;
++
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn")));
++ aValue >>= headerOn;
++
++ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")));
++ aValue >>= topMargin;
++
++ if( headerOn )
++ {
++ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight")));
++ aValue >>= headerHeight;
++ topMargin += headerHeight;
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return Millimeter::getInPoints( topMargin );
++}
++
++void SAL_CALL ScVbaPageSetup::setTopMargin( double margin ) throw (css::uno::RuntimeException)
++{
++ sal_Int32 topMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
++ sal_Bool headerOn = sal_False;
++ sal_Int32 headerHeight = 0;
++
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn")));
++ aValue >>= headerOn;
++
++ if( headerOn )
++ {
++ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight")));
++ aValue >>= headerHeight;
++ topMargin -= headerHeight;
++ }
++
++ aValue <<= topMargin;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue );
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++double SAL_CALL ScVbaPageSetup::getBottomMargin() throw (css::uno::RuntimeException)
++{
++ sal_Bool footerOn = sal_False;
++ sal_Int32 bottomMargin = 0;
++ sal_Int32 footerHeight = 0;
++
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn")));
++ aValue >>= footerOn;
++
++ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")));
++ aValue >>= bottomMargin;
++
++ if( footerOn )
++ {
++ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight")));
++ aValue >>= footerHeight;
++ bottomMargin += footerHeight;
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return Millimeter::getInPoints( bottomMargin );
++}
++
++void SAL_CALL ScVbaPageSetup::setBottomMargin( double margin ) throw (css::uno::RuntimeException)
++{
++ sal_Int32 bottomMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
++ sal_Bool footerOn = sal_False;
++ sal_Int32 footerHeight = 0;
++
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn")));
++ aValue >>= footerOn;
++
++ if( footerOn )
++ {
++ aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight")));
++ aValue >>= footerHeight;
++ bottomMargin -= footerHeight;
++ }
++
++ aValue <<= bottomMargin;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue );
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++double SAL_CALL ScVbaPageSetup::getRightMargin() throw (css::uno::RuntimeException)
++{
++ sal_Int32 rightMargin = 0;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin")));
++ aValue >>= rightMargin;
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return Millimeter::getInPoints( rightMargin );;
++}
++
++void SAL_CALL ScVbaPageSetup::setRightMargin( double margin ) throw (css::uno::RuntimeException)
++{
++ sal_Int32 rightMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
++ try
++ {
++ uno::Any aValue;
++ aValue <<= rightMargin;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin")), aValue );
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++}
++
++double SAL_CALL ScVbaPageSetup::getLeftMargin() throw (css::uno::RuntimeException)
++{
++ sal_Int32 leftMargin = 0;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin")));
++ aValue >>= leftMargin;
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return Millimeter::getInPoints( leftMargin );;
++}
++
++void SAL_CALL ScVbaPageSetup::setLeftMargin( double margin ) throw (css::uno::RuntimeException)
++{
++ sal_Int32 leftMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
++ try
++ {
++ uno::Any aValue;
++ aValue <<= leftMargin;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin")), aValue );
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++double SAL_CALL ScVbaPageSetup::getHeaderMargin() throw (css::uno::RuntimeException)
++{
++ sal_Int32 headerMargin = 0;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")));
++ aValue >>= headerMargin;
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return Millimeter::getInPoints( headerMargin );;
++}
++
++void SAL_CALL ScVbaPageSetup::setHeaderMargin( double margin ) throw (css::uno::RuntimeException)
++{
++ sal_Int32 headerMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
++ try
++ {
++ uno::Any aValue;
++ aValue <<= headerMargin;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue );
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++double SAL_CALL ScVbaPageSetup::getFooterMargin() throw (css::uno::RuntimeException)
++{
++ sal_Int32 footerMargin = 0;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")));
++ aValue >>= footerMargin;
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return Millimeter::getInPoints( footerMargin );;
++}
++
++void SAL_CALL ScVbaPageSetup::setFooterMargin( double margin ) throw (css::uno::RuntimeException)
++{
++ sal_Int32 footerMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
++ try
++ {
++ uno::Any aValue;
++ aValue <<= footerMargin;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue );
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++sal_Int32 SAL_CALL ScVbaPageSetup::getOrientation() throw (css::uno::RuntimeException)
++{
++ sal_Int32 orientation = excel::XlPageOrientation::xlPortrait;
++ try
++ {
++ sal_Bool isLandscape = sal_False;
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
++ aValue >>= isLandscape;
++
++ if( isLandscape )
++ {
++ orientation = excel::XlPageOrientation::xlLandscape;
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++ return orientation;
++}
++
++void SAL_CALL ScVbaPageSetup::setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException)
++{
++ if( ( orientation != excel::XlPageOrientation::xlPortrait ) &&
++ ( orientation != excel::XlPageOrientation::xlLandscape ) )
++ {
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ }
++
++ try
++ {
++ sal_Bool isLandscape = sal_False;
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
++ aValue >>= isLandscape;
++
++ sal_Bool switchOrientation = sal_False;
++ if(( isLandscape && orientation != excel::XlPageOrientation::xlLandscape ) ||
++ ( !isLandscape && orientation != excel::XlPageOrientation::xlPortrait ))
++ {
++ switchOrientation = sal_True;
++ }
++
++ if( switchOrientation )
++ {
++ aValue <<= !isLandscape;
++ uno::Any aHeight = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")));
++ uno::Any aWidth = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")));
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")), aValue );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")), aHeight );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")), aWidth );
++ }
++
++ if( isLandscape )
++ {
++ orientation = excel::XlPageOrientation::xlLandscape;
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++uno::Any SAL_CALL ScVbaPageSetup::getFitToPagesTall() throw (css::uno::RuntimeException)
++{
++ return mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleToPagesY")));
++}
++
++void SAL_CALL ScVbaPageSetup::setFitToPagesTall( const uno::Any& fitToPagesTall) throw (css::uno::RuntimeException)
++{
++ USHORT scaleToPageY = 0;
++ try
++ {
++ sal_Bool aValue;
++ if( fitToPagesTall.getValueTypeClass() != uno::TypeClass_BOOLEAN || (fitToPagesTall >>= aValue))
++ {
++ fitToPagesTall >>= scaleToPageY;
++ }
++
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleToPagesY")), uno::makeAny( scaleToPageY ));
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++uno::Any SAL_CALL ScVbaPageSetup::getFitToPagesWide() throw (css::uno::RuntimeException)
++{
++ return mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleToPagesX")));
++}
++
++void SAL_CALL ScVbaPageSetup::setFitToPagesWide( const uno::Any& fitToPagesWide) throw (css::uno::RuntimeException)
++{
++ USHORT scaleToPageX = 0;
++ try
++ {
++ sal_Bool aValue = sal_False;
++ if( fitToPagesWide.getValueTypeClass() != uno::TypeClass_BOOLEAN || (fitToPagesWide >>= aValue))
++ {
++ fitToPagesWide >>= scaleToPageX;
++ }
++
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleToPagesX")), uno::makeAny( scaleToPageX ));
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++uno::Any SAL_CALL ScVbaPageSetup::getZoom() throw (css::uno::RuntimeException)
++{
++ return mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageScale")));
++}
++
++void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom) throw (css::uno::RuntimeException)
++{
++ USHORT pageScale = 0;
++ try
++ {
++ if( zoom.getValueTypeClass() == uno::TypeClass_BOOLEAN )
++ {
++ sal_Bool aValue = sal_False;
++ zoom >>= aValue;
++ if( aValue )
++ {
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ }
++ }
++ else
++ {
++ zoom >>= pageScale;
++ if(( pageScale < ZOOM_IN )||( pageScale > ZOOM_MAX ))
++ {
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ }
++ }
++
++ // these only exist in S08
++ USHORT nScale = 0;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleToPages")), uno::makeAny( nScale ));
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleToPagesX")), uno::makeAny( nScale ));
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleToPagesY")), uno::makeAny( nScale ));
++ }
++ catch( beans::UnknownPropertyException& )
++ {
++ if( pageScale == 0 )
++ {
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageScale")), uno::makeAny( pageScale ));
++}
++
++rtl::OUString SAL_CALL ScVbaPageSetup::getLeftHeader() throw (css::uno::RuntimeException)
++{
++ rtl::OUString leftHeader;
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent"))), uno::UNO_QUERY_THROW);
++ if( xHeaderContent.is() )
++ {
++ uno::Reference< text::XText > xText = xHeaderContent->getLeftText();
++ leftHeader = xText->getString();
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return leftHeader;
++}
++
++void SAL_CALL ScVbaPageSetup::setLeftHeader( const rtl::OUString& leftHeader) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent"))), uno::UNO_QUERY_THROW);
++ if( xHeaderContent.is() )
++ {
++ uno::Reference< text::XText > xText = xHeaderContent->getLeftText();
++ xText->setString( leftHeader );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) );
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++rtl::OUString SAL_CALL ScVbaPageSetup::getCenterHeader() throw (css::uno::RuntimeException)
++{
++ rtl::OUString centerHeader;
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent"))), uno::UNO_QUERY_THROW);
++ if( xHeaderContent.is() )
++ {
++ uno::Reference< text::XText > xText = xHeaderContent->getCenterText();
++ centerHeader = xText->getString();
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return centerHeader;
++}
++
++void SAL_CALL ScVbaPageSetup::setCenterHeader( const rtl::OUString& centerHeader) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent"))), uno::UNO_QUERY_THROW);
++ if( xHeaderContent.is() )
++ {
++ uno::Reference< text::XText > xText = xHeaderContent->getCenterText();
++ xText->setString( centerHeader );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) );
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++rtl::OUString SAL_CALL ScVbaPageSetup::getRightHeader() throw (css::uno::RuntimeException)
++{
++ rtl::OUString rightHeader;
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent"))), uno::UNO_QUERY_THROW);
++ if( xHeaderContent.is() )
++ {
++ uno::Reference< text::XText > xText = xHeaderContent->getRightText();
++ rightHeader = xText->getString();
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return rightHeader;
++}
++
++void SAL_CALL ScVbaPageSetup::setRightHeader( const rtl::OUString& rightHeader) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent"))), uno::UNO_QUERY_THROW);
++ if( xHeaderContent.is() )
++ {
++ uno::Reference< text::XText > xText = xHeaderContent->getRightText();
++ xText->setString( rightHeader );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) );
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++rtl::OUString SAL_CALL ScVbaPageSetup::getLeftFooter() throw (css::uno::RuntimeException)
++{
++ rtl::OUString leftFooter;
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent"))), uno::UNO_QUERY_THROW);
++ if( xFooterContent.is() )
++ {
++ uno::Reference< text::XText > xText = xFooterContent->getLeftText();
++ leftFooter = xText->getString();
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return leftFooter;
++}
++
++void SAL_CALL ScVbaPageSetup::setLeftFooter( const rtl::OUString& leftFooter) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent"))), uno::UNO_QUERY_THROW);
++ if( xFooterContent.is() )
++ {
++ uno::Reference< text::XText > xText = xFooterContent->getLeftText();
++ xText->setString( leftFooter );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) );
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++rtl::OUString SAL_CALL ScVbaPageSetup::getCenterFooter() throw (css::uno::RuntimeException)
++{
++ rtl::OUString centerFooter;
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent"))), uno::UNO_QUERY_THROW);
++ if( xFooterContent.is() )
++ {
++ uno::Reference< text::XText > xText = xFooterContent->getCenterText();
++ centerFooter = xText->getString();
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return centerFooter;
++}
++
++void SAL_CALL ScVbaPageSetup::setCenterFooter( const rtl::OUString& centerFooter) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent"))), uno::UNO_QUERY_THROW);
++ if( xFooterContent.is() )
++ {
++ uno::Reference< text::XText > xText = xFooterContent->getCenterText();
++ xText->setString( centerFooter );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) );
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++}
++
++rtl::OUString SAL_CALL ScVbaPageSetup::getRightFooter() throw (css::uno::RuntimeException)
++{
++ rtl::OUString rightFooter;
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent"))), uno::UNO_QUERY_THROW);
++ if( xFooterContent.is() )
++ {
++ uno::Reference< text::XText > xText = xFooterContent->getRightText();
++ rightFooter = xText->getString();
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return rightFooter;
++}
++
++void SAL_CALL ScVbaPageSetup::setRightFooter( const rtl::OUString& rightFooter) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent"))), uno::UNO_QUERY_THROW);
++ if( xFooterContent.is() )
++ {
++ uno::Reference< text::XText > xText = xFooterContent->getRightText();
++ xText->setString( rightFooter );
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) );
++ }
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++sal_Int32 SAL_CALL ScVbaPageSetup::getOrder() throw (css::uno::RuntimeException)
++{
++ sal_Int32 order = excel::XlOrder::xlDownThenOver;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrintDownFirst")));
++ sal_Bool bPrintDownFirst = sal_False;
++ aValue >>= bPrintDownFirst;
++ if( !bPrintDownFirst )
++ order = excel::XlOrder::xlOverThenDown;
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ return order;
++}
++
++void SAL_CALL ScVbaPageSetup::setOrder( sal_Int32 order) throw (css::uno::RuntimeException)
++{
++ sal_Bool bOrder = sal_True;
++ switch( order )
++ {
++ case excel::XlOrder::xlDownThenOver:
++ break;
++ case excel::XlOrder::xlOverThenDown:
++ bOrder = sal_False;
++ break;
++ default:
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ }
++
++ try
++ {
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrintDownFirst")), uno::makeAny( bOrder ));
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++sal_Int32 SAL_CALL ScVbaPageSetup::getFirstPageNumber() throw (css::uno::RuntimeException)
++{
++ sal_Int16 number = 0;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstPageNumber")));
++ aValue >>= number;
++ }
++ catch( uno::Exception& )
++ {
++ }
++
++ if( number ==0 )
++ {
++ number = excel::Constants::xlAutomatic;
++ }
++
++ return number;
++}
++
++void SAL_CALL ScVbaPageSetup::setFirstPageNumber( sal_Int32 firstPageNumber) throw (css::uno::RuntimeException)
++{
++ if( firstPageNumber < 0 )
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ if( firstPageNumber == excel::Constants::xlAutomatic )
++ firstPageNumber = 0;
++
++ try
++ {
++ uno::Any aValue;
++ aValue <<= (sal_Int16)firstPageNumber;
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstPageNumber")), aValue );
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++sal_Bool SAL_CALL ScVbaPageSetup::getCenterVertically() throw (css::uno::RuntimeException)
++{
++ sal_Bool centerVertically = sal_False;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CenterVertically")));
++ aValue >>= centerVertically;
++ }
++ catch( uno::Exception& )
++ {
++ }
++ return centerVertically;
++}
++
++void SAL_CALL ScVbaPageSetup::setCenterVertically( sal_Bool centerVertically) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CenterVertically")), uno::makeAny( centerVertically ));
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++sal_Bool SAL_CALL ScVbaPageSetup::getCenterHorizontally() throw (css::uno::RuntimeException)
++{
++ sal_Bool centerHorizontally = sal_False;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CenterHorizontally")));
++ aValue >>= centerHorizontally;
++ }
++ catch( uno::Exception& )
++ {
++ }
++ return centerHorizontally;
++}
++
++void SAL_CALL ScVbaPageSetup::setCenterHorizontally( sal_Bool centerHorizontally) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CenterHorizontally")), uno::makeAny( centerHorizontally ));
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++sal_Bool SAL_CALL ScVbaPageSetup::getPrintHeadings() throw (css::uno::RuntimeException)
++{
++ sal_Bool printHeadings = sal_False;
++ try
++ {
++ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrintHeaders")));
++ aValue >>= printHeadings;
++ }
++ catch( uno::Exception& )
++ {
++ }
++ return printHeadings;
++}
++
++void SAL_CALL ScVbaPageSetup::setPrintHeadings( sal_Bool printHeadings) throw (css::uno::RuntimeException)
++{
++ try
++ {
++ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrintHeaders")), uno::makeAny( printHeadings ));
++ }
++ catch( uno::Exception& )
++ {
++ }
++}
++
++rtl::OUString&
++ScVbaPageSetup::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPageSetup") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaPageSetup::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.PageSetup" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbapagesetup.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbapagesetup.hxx
+diff -N sc/source/ui/vba/vbapagesetup.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbapagesetup.hxx 29 Jul 2008 06:35:42 -0000 1.1.2.1
+@@ -0,0 +1,104 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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 SC_VBA_PAGESETUP_HXX
++#define SC_VBA_PAGESETUP_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/excel/XPageSetup.hpp>
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/sheet/XSpreadsheet.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include "vbahelperinterface.hxx"
++
++typedef InheritedHelperInterfaceImpl1< oo::excel::XPageSetup > ScVbaPageSetup_BASE;
++
++class ScVbaPageSetup : public ScVbaPageSetup_BASE
++{
++ css::uno::Reference< css::sheet::XSpreadsheet > mxSheet;
++ css::uno::Reference< css::beans::XPropertySet > mxPageProps;
++ css::uno::Reference< css::frame::XModel > mxModel;
++public:
++ ScVbaPageSetup( const css::uno::Reference< oo::vba::XHelperInterface >& xParent,
++ const css::uno::Reference< css::uno::XComponentContext >& xContext,
++ const css::uno::Reference< css::sheet::XSpreadsheet>& xSheet,
++ const css::uno::Reference< css::frame::XModel >& xModlel) throw (css::uno::RuntimeException);
++ virtual ~ScVbaPageSetup(){}
++
++ // Attribute
++ virtual rtl::OUString SAL_CALL getPrintArea() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setPrintArea( const rtl::OUString& rAreas ) throw (css::uno::RuntimeException);
++ virtual double SAL_CALL getTopMargin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setTopMargin( double margin ) throw (css::uno::RuntimeException);
++ virtual double SAL_CALL getBottomMargin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setBottomMargin( double margin ) throw (css::uno::RuntimeException);
++ virtual double SAL_CALL getRightMargin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setRightMargin( double margin ) throw (css::uno::RuntimeException);
++ virtual double SAL_CALL getLeftMargin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setLeftMargin( double margin ) throw (css::uno::RuntimeException);
++ virtual double SAL_CALL getHeaderMargin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setHeaderMargin( double margin ) throw (css::uno::RuntimeException);
++ virtual double SAL_CALL getFooterMargin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setFooterMargin( double margin ) throw (css::uno::RuntimeException);
++ virtual sal_Int32 SAL_CALL getOrientation() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getFitToPagesTall() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setFitToPagesTall( const css::uno::Any& fitToPagesTall ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getFitToPagesWide() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setFitToPagesWide( const css::uno::Any& fitToPagesWide ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setZoom( const css::uno::Any& zoom ) throw (css::uno::RuntimeException);
++ virtual rtl::OUString SAL_CALL getLeftHeader() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setLeftHeader( const rtl::OUString& leftHeader ) throw (css::uno::RuntimeException);
++ virtual rtl::OUString SAL_CALL getCenterHeader() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCenterHeader( const rtl::OUString& centerHeader ) throw (css::uno::RuntimeException);
++ virtual rtl::OUString SAL_CALL getRightHeader() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setRightHeader( const rtl::OUString& rightHeader ) throw (css::uno::RuntimeException);
++ virtual rtl::OUString SAL_CALL getLeftFooter() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setLeftFooter( const rtl::OUString& leftFooter ) throw (css::uno::RuntimeException);
++ virtual rtl::OUString SAL_CALL getCenterFooter() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCenterFooter( const rtl::OUString& centerFooter ) throw (css::uno::RuntimeException);
++ virtual rtl::OUString SAL_CALL getRightFooter() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setRightFooter( const rtl::OUString& rightFooter ) throw (css::uno::RuntimeException);
++ virtual sal_Int32 SAL_CALL getOrder() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setOrder( sal_Int32 order ) throw (css::uno::RuntimeException);
++ virtual sal_Int32 SAL_CALL getFirstPageNumber() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setFirstPageNumber( sal_Int32 firstPageNumber ) throw (css::uno::RuntimeException);
++ virtual sal_Bool SAL_CALL getCenterVertically() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCenterVertically( sal_Bool centerVertically ) throw (css::uno::RuntimeException);
++ virtual sal_Bool SAL_CALL getCenterHorizontally() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCenterHorizontally( sal_Bool centerHorizontally ) throw (css::uno::RuntimeException);
++ virtual sal_Bool SAL_CALL getPrintHeadings() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setPrintHeadings( sal_Bool printHeadings ) throw (css::uno::RuntimeException);
++
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif
+Index: sc/source/ui/vba/vbaprogressbar.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaprogressbar.cxx
+diff -N sc/source/ui/vba/vbaprogressbar.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaprogressbar.cxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,78 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbaprogressbar.hxx"
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++// uno servicename com.sun.star.awt.UnoControlProgressBarMode
++const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
++
++ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper ) : ProgressBarImpl_BASE( xParent, xContext, xControl, pGeomHelper )
++{
++}
++
++// Attributes
++uno::Any SAL_CALL
++ScVbaProgressBar::getValue() throw (css::uno::RuntimeException)
++{
++ return m_xProps->getPropertyValue( SVALUE );
++}
++
++void SAL_CALL
++ScVbaProgressBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SVALUE, _value );
++}
++
++rtl::OUString&
++ScVbaProgressBar::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaProgressBar") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaProgressBar::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.Label" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbaprogressbar.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaprogressbar.hxx
+diff -N sc/source/ui/vba/vbaprogressbar.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaprogressbar.hxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,59 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_PROGRESSBAR_HXX
++#define SC_VBA_PROGRESSBAR_HXX
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/msforms/XProgressBar.hpp>
++
++#include "vbacontrol.hxx"
++#include "vbahelper.hxx"
++#include <cppuhelper/implbase2.hxx>
++
++typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XProgressBar, css::script::XDefaultProperty > ProgressBarImpl_BASE;
++
++class ScVbaProgressBar : public ProgressBarImpl_BASE
++{
++public:
++ ScVbaProgressBar( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
++ // Attributes
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++ // XDefaultProperty
++ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
++};
++#endif //SC_VBA_LABEL_HXX
+Index: sc/source/ui/vba/vbaradiobutton.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaradiobutton.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbaradiobutton.cxx 11 Apr 2008 01:12:55 -0000 1.3
++++ sc/source/ui/vba/vbaradiobutton.cxx 6 Jul 2008 15:31:33 -0000 1.2.42.2
+@@ -36,7 +36,7 @@ using namespace org::openoffice;
+
+ const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+ const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
+-ScVbaRadioButton::ScVbaRadioButton( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : RadioButtonImpl_BASE( xContext, xControlShape )
++ScVbaRadioButton::ScVbaRadioButton( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper ) : RadioButtonImpl_BASE( xParent, xContext, xControl, pGeomHelper )
+ {
+ }
+
+@@ -55,22 +55,53 @@ ScVbaRadioButton::setCaption( const rtl:
+ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+ }
+
+-sal_Bool SAL_CALL
++uno::Any SAL_CALL
+ ScVbaRadioButton::getValue() throw (css::uno::RuntimeException)
+ {
+- sal_Bool bValue = sal_False;
+ sal_Int16 nValue = -1;
+ m_xProps->getPropertyValue( STATE ) >>= nValue;
+ if( nValue != 0 )
+- bValue = sal_True;
+- return bValue;
++ nValue = -1;
++// return uno::makeAny( nValue );
++// I must be missing something MSO says value should be -1 if selected, 0 if not
++// selected
++ return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False );
++
+ }
+
+ void SAL_CALL
+-ScVbaRadioButton::setValue( sal_Bool _value ) throw (css::uno::RuntimeException)
++ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+ {
+ sal_Int16 nValue = 0;
+- if( _value )
++ sal_Bool bValue = sal_False;
++ if( _value >>= nValue )
++ {
++ if( nValue == -1)
+ nValue = 1;
++ }
++ else if ( _value >>= bValue )
++ {
++ if ( bValue )
++ nValue = 1;
++ }
+ m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
+ }
++
++rtl::OUString&
++ScVbaRadioButton::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaRadioButton") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaRadioButton::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.RadioButton" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbaradiobutton.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaradiobutton.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbaradiobutton.hxx 11 Apr 2008 01:13:09 -0000 1.3
++++ sc/source/ui/vba/vbaradiobutton.hxx 6 Jul 2008 15:30:03 -0000 1.2.42.2
+@@ -29,24 +29,27 @@
+ ************************************************************************/
+ #ifndef SC_VBA_RADIOBUTTON_HXX
+ #define SC_VBA_RADIOBUTTON_HXX
+-#include <cppuhelper/implbase1.hxx>
+ #include <org/openoffice/msforms/XRadioButton.hpp>
+-
+ #include "vbacontrol.hxx"
+ #include "vbahelper.hxx"
++#include <cppuhelper/implbase2.hxx>
+
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XRadioButton > RadioButtonImpl_BASE;
++typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XRadioButton, css::script::XDefaultProperty > RadioButtonImpl_BASE;
+
+ class ScVbaRadioButton : public RadioButtonImpl_BASE
+ {
+ public:
+- ScVbaRadioButton( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
++ ScVbaRadioButton( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
+ // Attributes
+ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+- virtual sal_Bool SAL_CALL getValue() throw (css::uno::RuntimeException);
+- virtual void SAL_CALL setValue( sal_Bool _value ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue(const com::sun::star::uno::Any&) throw (css::uno::RuntimeException);
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++ // XDefaultProperty
++ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+
+ };
+ #endif //SC_VBA_RADIOBUTTON_HXX
+Index: sc/source/ui/vba/vbarange.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbarange.cxx,v
+retrieving revision 1.9
+retrieving revision 1.5.34.11
+diff -u -p -b -w -B -r1.9 -r1.5.34.11
+--- sc/source/ui/vba/vbarange.cxx 14 May 2008 10:03:31 -0000 1.9
++++ sc/source/ui/vba/vbarange.cxx 29 Jul 2008 09:36:01 -0000 1.5.34.11
+@@ -115,6 +115,7 @@
+ #include <org/openoffice/excel/XlCellType.hpp>
+ #include <org/openoffice/excel/XlSpecialCellsValue.hpp>
+ #include <org/openoffice/excel/XlConsolidationFunction.hpp>
++#include <org/openoffice/excel/XlSearchDirection.hpp>
+
+ #include <scitems.hxx>
+ #include <svx/srchitem.hxx>
+@@ -150,6 +151,7 @@
+ #include "undodat.hxx"
+ #include "dbdocfun.hxx"
+ #include "patattr.hxx"
++#include "olinetab.hxx"
+ #include <comphelper/anytostring.hxx>
+
+ #include <global.hxx>
+@@ -212,6 +214,8 @@ uno::Reference< excel::XRange > lcl_make
+ uno::Sequence< table::CellRangeAddress > sAddresses = xLocSheetCellRanges->getRangeAddresses();
+ ScRangeList aCellRanges;
+ sal_Int32 nLen = sAddresses.getLength();
++ if ( nLen )
++ {
+ for ( sal_Int32 index = 0; index < nLen; ++index )
+ {
+ ScRange refRange;
+@@ -231,6 +235,7 @@ uno::Reference< excel::XRange > lcl_make
+ // #FIXME need proper (WorkSheet) parent
+ xRange = new ScVbaRange( xParent, xContext, xRanges );
+ }
++ }
+ return xRange;
+ }
+
+@@ -517,6 +522,34 @@ sal_Int32 m_nArea;
+ typedef ::cppu::WeakImplHelper1< container::XEnumeration > CellsEnumeration_BASE;
+ typedef ::std::vector< CellPos > vCellPos;
+
++// #FIXME - QUICK
++// we could probably could and should modify CellsEnumeration below
++// to handle rows and columns ( but I do this seperately for now
++// and.. this class only handles singe areas ( does it have to handle
++// multi area ranges?? )
++class ColumnsRowEnumeration: public CellsEnumeration_BASE
++{
++ uno::Reference< uno::XComponentContext > mxContext;
++ uno::Reference< excel::XRange > mxRange;
++ sal_Int32 mMaxElems;
++ sal_Int32 mCurElem;
++
++public:
++ ColumnsRowEnumeration( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< excel::XRange >& xRange, sal_Int32 nElems ) : mxContext( xContext ), mxRange( xRange ), mMaxElems( nElems ), mCurElem( 0 )
++ {
++ }
++
++ virtual ::sal_Bool SAL_CALL hasMoreElements() throw (::uno::RuntimeException){ return mCurElem < mMaxElems; }
++
++ virtual uno::Any SAL_CALL nextElement() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
++ {
++ if ( !hasMoreElements() )
++ throw container::NoSuchElementException();
++ sal_Int32 vbaIndex = 1 + mCurElem++;
++ return uno::makeAny( mxRange->Item( uno::makeAny( vbaIndex ), uno::Any() ) );
++ }
++};
++
+ class CellsEnumeration : public CellsEnumeration_BASE
+ {
+ uno::Reference< uno::XComponentContext > mxContext;
+@@ -739,6 +772,7 @@ protected:
+ bool processValue( const uno::Any& aValue, const uno::Reference< table::XCell >& xCell )
+ {
+ rtl::OUString sFormula;
++ double aDblValue;
+ if ( aValue >>= sFormula )
+ {
+ // convert to CONV_OOO style formula string because XCell::setFormula
+@@ -765,6 +799,11 @@ protected:
+ xCell->setFormula( sFormula );
+ return true;
+ }
++ else if ( aValue >>= aDblValue )
++ {
++ xCell->setValue( aDblValue );
++ return true;
++ }
+ return false;
+ }
+
+@@ -1150,10 +1189,19 @@ lcl_setupBorders( const uno::Reference<
+ }
+
+ ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args,
+- uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< vba::XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), getModelFromRange( getXSomethingFromArgs< table::XCellRange >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False )
++ uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< vba::XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), getModelFromXIf( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False )
++{
++ mxRange.set( mxPropertySet, uno::UNO_QUERY );
++ mxRanges.set( mxPropertySet, uno::UNO_QUERY );
++ uno::Reference< container::XIndexAccess > xIndex;
++ if ( mxRange.is() )
+ {
+- mxRange.set( mxPropertySet, uno::UNO_QUERY_THROW );
+- uno::Reference< container::XIndexAccess > xIndex( new SingleRangeIndexAccess( mxContext, mxRange ) );
++ xIndex = new SingleRangeIndexAccess( mxContext, mxRange );
++ }
++ else if ( mxRanges.is() )
++ {
++ xIndex.set( mxRanges, uno::UNO_QUERY_THROW );
++ }
+ m_Areas = new ScVbaRangeAreas( mxContext, xIndex, mbIsRows, mbIsColumns );
+ }
+
+@@ -1833,7 +1881,36 @@ ScVbaRange::Cells( const uno::Any &nRowI
+ }
+
+ sal_Int32 nRow = 0, nColumn = 0;
+- sal_Bool bIsIndex = nRowIndex >>= nRow, bIsColumnIndex = nColumnIndex >>= nColumn;
++
++ sal_Bool bIsIndex = nRowIndex.hasValue();
++ sal_Bool bIsColumnIndex = nColumnIndex.hasValue();
++
++ // Sometimes we might get a float or a double or whatever
++ // set in the Any, we should convert as appropriate
++ // #FIXME - perhaps worth turning this into some sort of
++ // convertion routine e.g. bSuccess = getValueFromAny( nRow, nRowIndex, getCppuType((sal_Int32*)0) )
++ if ( nRowIndex.hasValue() && !( nRowIndex >>= nRow ) )
++ {
++ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
++ uno::Any aConverted;
++ try
++ {
++ aConverted = xConverter->convertTo( nRowIndex, getCppuType((sal_Int32*)0) );
++ bIsIndex = ( aConverted >>= nRow );
++ }
++ catch( uno::Exception& ) {} // silence any errors
++ }
++ if ( bIsColumnIndex && !( nColumnIndex >>= nColumn ) )
++ {
++ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
++ uno::Any aConverted;
++ try
++ {
++ aConverted = xConverter->convertTo( nColumnIndex, getCppuType((sal_Int32*)0) );
++ bIsColumnIndex = ( aConverted >>= nColumn );
++ }
++ catch( uno::Exception& ) {} // silence any errors
++ }
+
+ RangeHelper thisRange( mxRange );
+ table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
+@@ -2686,6 +2763,166 @@ ScVbaRange::Replace( const ::rtl::OUStri
+ return sal_True; // always
+ }
+
++uno::Reference< excel::XRange > SAL_CALL
++ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& LookIn, const uno::Any& LookAt, const uno::Any& SearchOrder, const uno::Any& SearchDirection, const uno::Any& MatchCase, const uno::Any& MatchByte, const uno::Any& SearchFormat ) throw (uno::RuntimeException)
++{
++ // return a Range object that represents the first cell where that information is found.
++ rtl::OUString sWhat;
++ sal_Int32 nWhat;
++ float fWhat;
++
++ // string.
++ if( What >>= sWhat )
++ {
++ if( !sWhat.getLength() )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Find, missing params" )) , uno::Reference< uno::XInterface >() );
++ }
++ else if( What >>= nWhat )
++ {
++ sWhat = rtl::OUString::valueOf( nWhat );
++ }
++ else if( What >>= fWhat )
++ {
++ sWhat = rtl::OUString::valueOf( fWhat );
++ }
++ else
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Find, missing params" )) , uno::Reference< uno::XInterface >() );
++
++ rtl::OUString sSearch = VBAToRegexp( sWhat );
++
++ const SvxSearchItem& globalSearchOptions = ScGlobal::GetSearchItem();
++ SvxSearchItem newOptions( globalSearchOptions );
++
++ sal_Int16 nLookAt = globalSearchOptions.GetWordOnly() ? excel::XlLookAt::xlPart : excel::XlLookAt::xlWhole;
++ sal_Int16 nSearchOrder = globalSearchOptions.GetRowDirection() ? excel::XlSearchOrder::xlByRows : excel::XlSearchOrder::xlByColumns;
++
++ uno::Reference< util::XSearchable > xSearch( mxRange, uno::UNO_QUERY );
++ if( xSearch.is() )
++ {
++ uno::Reference< util::XSearchDescriptor > xDescriptor = xSearch->createSearchDescriptor();
++ xDescriptor->setSearchString( sSearch );
++
++ uno::Reference< excel::XRange > xAfterRange;
++ uno::Reference< table::XCellRange > xStartCell;
++ if( After >>= xAfterRange )
++ {
++ // After must be a single cell in the range
++ if( xAfterRange->getCount() > 1 )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("After must be a single cell." )) , uno::Reference< uno::XInterface >() );
++ uno::Reference< excel::XRange > xCell( Cells( uno::makeAny( xAfterRange->getRow() ), uno::makeAny( xAfterRange->getColumn() ) ), uno::UNO_QUERY );
++ if( !xCell.is() )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("After must be in range." )) , uno::Reference< uno::XInterface >() );
++ xStartCell.set( xAfterRange->getCellRange(), uno::UNO_QUERY_THROW );
++ }
++
++ // LookIn
++ if( LookIn.hasValue() )
++ {
++ sal_Int32 nLookIn;
++ if( LookIn >>= nLookIn )
++ {
++ sal_Int16 nSearchType;
++ switch( nLookIn )
++ {
++ case excel::XlFindLookIn::xlComments :
++ nSearchType = SVX_SEARCHIN_NOTE; // Notes
++ break;
++ case excel::XlFindLookIn::xlFormulas :
++ nSearchType = SVX_SEARCHIN_FORMULA;
++ break;
++ case excel::XlFindLookIn::xlValues :
++ nSearchType = SVX_SEARCHIN_VALUE;
++ break;
++ default:
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, illegal value for LookIn." )) , uno::Reference< uno::XInterface >() );
++ }
++ newOptions.SetCellType( nSearchType );
++ xDescriptor->setPropertyValue( rtl::OUString::createFromAscii( "SearchType" ), uno::makeAny( nSearchType ) );
++ }
++ }
++
++ // LookAt
++ if ( LookAt.hasValue() )
++ {
++ nLookAt = ::comphelper::getINT16( LookAt );
++ sal_Bool bSearchWords = sal_False;
++ if ( nLookAt == excel::XlLookAt::xlPart )
++ bSearchWords = sal_False;
++ else if ( nLookAt == excel::XlLookAt::xlWhole )
++ bSearchWords = sal_True;
++ else
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, illegal value for LookAt" )) , uno::Reference< uno::XInterface >() );
++ newOptions.SetWordOnly( bSearchWords );
++ xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHWORDS ) ), uno::makeAny( bSearchWords ) );
++ }
++
++ // SearchOrder
++ if ( SearchOrder.hasValue() )
++ {
++ nSearchOrder = ::comphelper::getINT16( SearchOrder );
++ sal_Bool bSearchByRow = sal_False;
++ if ( nSearchOrder == excel::XlSearchOrder::xlByColumns )
++ bSearchByRow = sal_False;
++ else if ( nSearchOrder == excel::XlSearchOrder::xlByRows )
++ bSearchByRow = sal_True;
++ else
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, illegal value for SearchOrder" )) , uno::Reference< uno::XInterface >() );
++
++ newOptions.SetRowDirection( bSearchByRow );
++ xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHBYROW ) ), uno::makeAny( bSearchByRow ) );
++ }
++
++ // SearchDirection
++ if ( SearchDirection.hasValue() )
++ {
++ sal_Int32 nSearchDirection;
++ if( SearchDirection >>= nSearchDirection )
++ {
++ sal_Bool bSearchBackwards = sal_False;
++ if ( nSearchDirection == excel::XlSearchDirection::xlNext )
++ bSearchBackwards = sal_False;
++ else if( nSearchDirection == excel::XlSearchDirection::xlPrevious )
++ bSearchBackwards = sal_True;
++ else
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, illegal value for SearchDirection" )) , uno::Reference< uno::XInterface >() );
++ newOptions.SetBackward( bSearchBackwards );
++ xDescriptor->setPropertyValue( rtl::OUString::createFromAscii( "SearchBackwards" ), uno::makeAny( bSearchBackwards ) );
++ }
++ }
++
++ // MatchCase
++ sal_Bool bMatchCase = sal_False;
++ if ( MatchCase.hasValue() )
++ {
++ // SearchCaseSensitive
++ if( !( MatchCase >>= bMatchCase ) )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, illegal value for MatchCase" )) , uno::Reference< uno::XInterface >() );
++ }
++ xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHCASE ) ), uno::makeAny( bMatchCase ) );
++
++ // MatchByte
++ // SearchFormat
++ // ignore
++
++ ScGlobal::SetSearchItem( newOptions );
++
++ uno::Reference< util::XSearchDescriptor > xSearchDescriptor( xDescriptor, uno::UNO_QUERY );
++ uno::Reference< table::XCellRange > xCellRange( xSearch->findNext( xStartCell, xSearchDescriptor ), uno::UNO_QUERY );
++ if ( xCellRange.is() )
++ {
++ uno::Reference< excel::XRange > xResultRange = new ScVbaRange( this, mxContext, xCellRange );
++ if( xResultRange.is() )
++ {
++ xResultRange->Select();
++ return xResultRange;
++ }
++ }
++
++ }
++
++ return uno::Reference< excel::XRange >();
++}
++
+ uno::Reference< table::XCellRange > processKey( const uno::Any& Key, uno::Reference< uno::XComponentContext >& xContext, ScDocShell* pDocSh )
+ {
+ uno::Reference< excel::XRange > xKeyRange;
+@@ -3116,6 +3353,18 @@ ScVbaRange::hasElements() throw (uno::Ru
+ uno::Reference< container::XEnumeration > SAL_CALL
+ ScVbaRange::createEnumeration() throw (uno::RuntimeException)
+ {
++ if ( mbIsColumns || mbIsRows )
++ {
++ uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY );
++ uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( sal_Int32(1) ), uno::Any() ), uno::UNO_QUERY_THROW );
++ sal_Int32 nElems = 0;
++ if ( mbIsColumns )
++ nElems = xColumnRowRange->getColumns()->getCount();
++ else
++ nElems = xColumnRowRange->getRows()->getCount();
++ return new ColumnsRowEnumeration( mxContext, xRange, nElems );
++
++ }
+ return new CellsEnumeration( mxContext, m_Areas );
+ }
+
+@@ -4119,7 +4368,7 @@ ScVbaRange::Autofit() throw (uno::Runtim
+ // if the range is a not a row or column range autofit will
+ // throw an error
+
+- if ( !mbIsColumns )
++ if ( !( mbIsColumns || mbIsRows ) )
+ DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
+ ScDocShell* pDocShell = getDocShellFromRange( mxRange );
+ if ( pDocShell )
+@@ -4298,6 +4547,113 @@ void ScVbaRange::setFormulaHidden(const
+ xProps->setPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CELLPRO)), uno::makeAny(rCellAttr));
+ }
+
++uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException)
++{
++ // #FIXME, If the specified range is in a PivotTable report
++
++ // In MSO VBA, the specified range must be a single summary column or row in an outline. otherwise throw exception
++ if( m_Areas->getCount() > 1 )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can not get Range.ShowDetail attribute ")), uno::Reference< uno::XInterface >() );
++
++ sal_Bool bShowDetail = sal_False;
++
++ RangeHelper helper( mxRange );
++ uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor();
++ xSheetCellCursor->collapseToCurrentRegion();
++ uno::Reference< sheet::XCellRangeAddressable > xCellRangeAddressable(xSheetCellCursor, uno::UNO_QUERY_THROW);
++ table::CellRangeAddress aOutlineAddress = xCellRangeAddressable->getRangeAddress();
++
++ // check if the specified range is a single summary column or row.
++ table::CellRangeAddress thisAddress = helper.getCellRangeAddressable()->getRangeAddress();
++ if( (thisAddress.StartRow == thisAddress.EndRow && thisAddress.EndRow == aOutlineAddress.EndRow ) ||
++ (thisAddress.StartColumn == thisAddress.EndColumn && thisAddress.EndColumn == aOutlineAddress.EndColumn ))
++ {
++ sal_Bool bColumn =thisAddress.StartRow == thisAddress.EndRow ? sal_False:sal_True;
++ ScDocument* pDoc = getDocumentFromRange( mxRange );
++ ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(static_cast<SCTAB>(thisAddress.Sheet), sal_True);
++ const ScOutlineArray* pOutlineArray = bColumn ? pOutlineTable->GetColArray(): pOutlineTable->GetRowArray();
++ if( pOutlineArray )
++ {
++ SCCOLROW nPos = bColumn ? (SCCOLROW)(thisAddress.EndColumn-1):(SCCOLROW)(thisAddress.EndRow-1);
++ ScOutlineEntry* pEntry = pOutlineArray->GetEntryByPos( 0, nPos );
++ if( pEntry )
++ {
++ bShowDetail = !pEntry->IsHidden();
++ return uno::makeAny( bShowDetail );
++ }
++ }
++ }
++ else
++ {
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can not set Range.ShowDetail attribute ")), uno::Reference< uno::XInterface >() );
++ }
++ return aNULL();
++}
++
++void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::RuntimeException)
++{
++ // #FIXME, If the specified range is in a PivotTable report
++
++ // In MSO VBA, the specified range must be a single summary column or row in an outline. otherwise throw exception
++ if( m_Areas->getCount() > 1 )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can not set Range.ShowDetail attribute ")), uno::Reference< uno::XInterface >() );
++
++ sal_Bool bShowDetail = sal_False;
++ aShowDetail >>= bShowDetail;
++
++ RangeHelper helper( mxRange );
++ uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor();
++ xSheetCellCursor->collapseToCurrentRegion();
++ uno::Reference< sheet::XCellRangeAddressable > xCellRangeAddressable(xSheetCellCursor, uno::UNO_QUERY_THROW);
++ table::CellRangeAddress aOutlineAddress = xCellRangeAddressable->getRangeAddress();
++
++ // check if the specified range is a single summary column or row.
++ table::CellRangeAddress thisAddress = helper.getCellRangeAddressable()->getRangeAddress();
++ if( (thisAddress.StartRow == thisAddress.EndRow && thisAddress.EndRow == aOutlineAddress.EndRow ) ||
++ (thisAddress.StartColumn == thisAddress.EndColumn && thisAddress.EndColumn == aOutlineAddress.EndColumn ))
++ {
++ // #FIXME, seems there is a different behavior between MSO and OOo.
++ // In OOo, the showDetail will show all the level entrys, while only show the first level entry in MSO
++ uno::Reference< sheet::XSheetOutline > xSheetOutline( helper.getSpreadSheet(), uno::UNO_QUERY_THROW );
++ if( bShowDetail )
++ xSheetOutline->showDetail( aOutlineAddress );
++ else
++ xSheetOutline->hideDetail( aOutlineAddress );
++ }
++ else
++ {
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can not set Range.ShowDetail attribute ")), uno::Reference< uno::XInterface >() );
++ }
++}
++
++uno::Reference< excel::XRange > SAL_CALL
++ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeException)
++{
++ uno::Reference< sheet::XSheetCellRange > xMergeShellCellRange(mxRange->getCellRangeByPosition(0,0,0,0), uno::UNO_QUERY_THROW);
++ uno::Reference< sheet::XSheetCellCursor > xMergeSheetCursor(xMergeShellCellRange->getSpreadsheet()->createCursorByRange( xMergeShellCellRange ), uno::UNO_QUERY_THROW);
++ if( xMergeSheetCursor.is() )
++ {
++ xMergeSheetCursor->collapseToMergedArea();
++ uno::Reference<sheet::XCellRangeAddressable> xMergeCellAddress(xMergeSheetCursor, uno::UNO_QUERY_THROW);
++ if( xMergeCellAddress.is() )
++ {
++ table::CellRangeAddress aCellAddress = xMergeCellAddress->getRangeAddress();
++ if( aCellAddress.StartColumn ==0 && aCellAddress.EndColumn==0 &&
++ aCellAddress.StartRow==0 && aCellAddress.EndRow==0)
++ {
++ return new ScVbaRange( getParent(),mxContext,mxRange );
++ }
++ else
++ {
++ ScRange refRange( aCellAddress.StartColumn, aCellAddress.StartRow, aCellAddress.Sheet,
++ aCellAddress.EndColumn, aCellAddress.EndRow, aCellAddress.Sheet);
++ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell() , refRange ) );
++ return new ScVbaRange( getParent(),mxContext,xRange );
++ }
++ }
++ }
++ return new ScVbaRange( getParent(),mxContext,mxRange );
++}
+
+ void SAL_CALL
+ ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& ActivePrinter, const uno::Any& PrintToFile, const uno::Any& Collate, const uno::Any& PrToFileName ) throw (uno::RuntimeException)
+@@ -4516,7 +4872,7 @@ ScVbaRange::AutoOutline( ) throw (scrip
+ {
+ // #TODO #FIXME needs to check for summary row/col ( whatever they are )
+ // not valid for multi Area Addresses
+- if ( m_Areas->getCount() )
++ if ( m_Areas->getCount() > 1 )
+ DebugHelper::exception(SbERR_METHOD_FAILED, STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY);
+ // So needs to either span an entire Row or a just be a single cell
+ // ( that contains a summary RowColumn )
+@@ -4734,6 +5090,7 @@ ScVbaRange::SpecialCells( const uno::Any
+ case excel::XlCellType::xlCellTypeConstants:
+ case excel::XlCellType::xlCellTypeFormulas:
+ case excel::XlCellType::xlCellTypeVisible:
++ case excel::XlCellType::xlCellTypeLastCell:
+ {
+ if ( bIsMultiArea )
+ {
+Index: sc/source/ui/vba/vbarange.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbarange.hxx,v
+retrieving revision 1.6
+retrieving revision 1.6.70.1
+diff -u -p -b -w -B -r1.6 -r1.6.70.1
+--- sc/source/ui/vba/vbarange.hxx 14 May 2008 10:03:47 -0000 1.6
++++ sc/source/ui/vba/vbarange.hxx 29 Jul 2008 06:35:42 -0000 1.6.70.1
+@@ -171,6 +171,10 @@ public:
+ virtual css::uno::Reference< oo::excel::XValidation > SAL_CALL getValidation() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getFormulaHidden() throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual void SAL_CALL setFormulaHidden(const css::uno::Any& aHidden) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ //virtual css::uno::Any SAL_CALL getLocked() throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ //virtual void SAL_CALL setLocked(const css::uno::Any& aLocked) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getShowDetail() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setShowDetail(const css::uno::Any& aShowDetail) throw (css::uno::RuntimeException);
+ // Methods
+ sal_Bool IsRows() { return mbIsRows; }
+ sal_Bool IsColumns() { return mbIsColumns; }
+@@ -210,6 +214,7 @@ public:
+ virtual css::uno::Any SAL_CALL getCellRange( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL PasteSpecial( const css::uno::Any& Paste, const css::uno::Any& Operation, const css::uno::Any& SkipBlanks, const css::uno::Any& Transpose ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replacement, const css::uno::Any& LookAt, const css::uno::Any& SearchOrder, const css::uno::Any& MatchCase, const css::uno::Any& MatchByte, const css::uno::Any& SearchFormat, const css::uno::Any& ReplaceFormat ) throw (css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Find( const css::uno::Any& What, const css::uno::Any& After, const css::uno::Any& LookIn, const css::uno::Any& LookAt, const css::uno::Any& SearchOrder, const css::uno::Any& SearchDirection, const css::uno::Any& MatchCase, const css::uno::Any& MatchByte, const css::uno::Any& SearchFormat ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Sort( const css::uno::Any& Key1, const css::uno::Any& Order1, const css::uno::Any& Key2, const css::uno::Any& Type, const css::uno::Any& Order2, const css::uno::Any& Key3, const css::uno::Any& Order3, const css::uno::Any& Header, const css::uno::Any& OrderCustom, const css::uno::Any& MatchCase, const css::uno::Any& Orientation, const css::uno::Any& SortMethod, const css::uno::Any& DataOption1, const css::uno::Any& DataOption2, const css::uno::Any& DataOption3 ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL End( ::sal_Int32 Direction ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< oo::excel::XCharacters > SAL_CALL characters( const css::uno::Any& Start, const css::uno::Any& Length ) throw (css::uno::RuntimeException);
+@@ -241,6 +246,7 @@ public:
+ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Next() throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Previous() throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual void SAL_CALL RemoveSubtotal( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL MergeArea() throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual void SAL_CALL Subtotal( ::sal_Int32 GroupBy, ::sal_Int32 Function, const css::uno::Sequence< ::sal_Int32 >& TotalList, const css::uno::Any& Replace, const css::uno::Any& PageBreaks, const css::uno::Any& SummaryBelowData ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XEnumerationAccess
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+Index: sc/source/ui/vba/vbascrollbar.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbascrollbar.cxx
+diff -N sc/source/ui/vba/vbascrollbar.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbascrollbar.cxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,139 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbascrollbar.hxx"
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++
++const static rtl::OUString LARGECHANGE( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") );
++const static rtl::OUString SMALLCHANGE( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") );
++const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
++const static rtl::OUString SCROLLVALUE( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") );
++const static rtl::OUString SCROLLMAX( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") );
++const static rtl::OUString SCROLLMIN( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMin") );
++
++ScVbaScrollBar::ScVbaScrollBar( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper ) : ScrollBarImpl_BASE( xParent, xContext, xControl, pGeomHelper )
++{
++}
++
++// Attributes
++uno::Any SAL_CALL
++ScVbaScrollBar::getValue() throw (css::uno::RuntimeException)
++{
++ return m_xProps->getPropertyValue( SCROLLVALUE );
++}
++
++void SAL_CALL
++ScVbaScrollBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SCROLLVALUE, _value );
++}
++
++::sal_Int32 SAL_CALL
++ScVbaScrollBar::getMax() throw (uno::RuntimeException)
++{
++ sal_Int32 nMax = 0;
++ m_xProps->getPropertyValue( SCROLLMAX ) >>= nMax;
++ return nMax;
++}
++
++void SAL_CALL
++ScVbaScrollBar::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SCROLLMAX, uno::makeAny( nVal ) );
++}
++
++::sal_Int32 SAL_CALL
++ScVbaScrollBar::getMin() throw (uno::RuntimeException)
++{
++ sal_Int32 nVal = 0;
++ m_xProps->getPropertyValue( SCROLLMIN ) >>= nVal;
++ return nVal;
++}
++
++void SAL_CALL
++ScVbaScrollBar::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SCROLLMIN, uno::makeAny( nVal ) );
++}
++
++void SAL_CALL
++ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange ) throw (uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( LARGECHANGE, uno::makeAny( _largechange ) );
++}
++
++::sal_Int32 SAL_CALL
++ScVbaScrollBar::getLargeChange() throw (uno::RuntimeException)
++{
++ sal_Int32 nVal = 0;
++ m_xProps->getPropertyValue( LARGECHANGE ) >>= nVal;
++ return nVal;
++}
++
++::sal_Int32 SAL_CALL
++ScVbaScrollBar::getSmallChange() throw (uno::RuntimeException)
++{
++ sal_Int32 nSmallChange = 0;
++ m_xProps->getPropertyValue( SMALLCHANGE ) >>= nSmallChange;
++ return nSmallChange;
++}
++
++void SAL_CALL
++ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange ) throw (uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SMALLCHANGE, uno::makeAny( _smallchange ) );
++}
++
++rtl::OUString&
++ScVbaScrollBar::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaScrollBar") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaScrollBar::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.Frame" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbascrollbar.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbascrollbar.hxx
+diff -N sc/source/ui/vba/vbascrollbar.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbascrollbar.hxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,66 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_SCROLLBAR_HXX
++#define SC_VBA_SCROLLBAR_HXX
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/msforms/XScrollBar.hpp>
++
++#include "vbacontrol.hxx"
++#include "vbahelper.hxx"
++
++typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XScrollBar > ScrollBarImpl_BASE;
++
++class ScVbaScrollBar : public ScrollBarImpl_BASE
++{
++public:
++ ScVbaScrollBar( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
++ // Attributes
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getLargeChange() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setLargeChange( ::sal_Int32 _largechange ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getSmallChange() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setSmallChange( ::sal_Int32 _smallchange ) throw (css::uno::RuntimeException);
++
++
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif //SC_VBA_LABEL_HXX
+Index: sc/source/ui/vba/vbashape.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbashape.cxx,v
+retrieving revision 1.4
+retrieving revision 1.3.34.2
+diff -u -p -b -w -B -r1.4 -r1.3.34.2
+--- sc/source/ui/vba/vbashape.cxx 11 Apr 2008 01:16:34 -0000 1.4
++++ sc/source/ui/vba/vbashape.cxx 6 Jul 2008 15:29:40 -0000 1.3.34.2
+@@ -50,13 +50,13 @@ using namespace ::org::openoffice;
+ using namespace ::com::sun::star;
+ using namespace ::vos;
+
+-ScVbaShape::ScVbaShape( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape > xShape, const uno::Reference< drawing::XShapes > xShapes, sal_Int32 nType ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( xParent, xContext ), m_xShape( xShape ), m_xShapes( xShapes ), m_nType( nType )
++ScVbaShape::ScVbaShape( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShapes >& xShapes, sal_Int32 nType ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( xParent, xContext ), m_xShape( xShape ), m_xShapes( xShapes ), m_nType( nType )
+ {
+ m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW );
+ addListeners();
+ }
+
+-ScVbaShape::ScVbaShape( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape > xShape ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( uno::Reference< vba::XHelperInterface >(), xContext ), m_xShape( xShape )
++ScVbaShape::ScVbaShape( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( uno::Reference< vba::XHelperInterface >(), xContext ), m_xShape( xShape )
+ {
+ // add listener
+ addListeners();
+Index: sc/source/ui/vba/vbashape.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbashape.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.3
+diff -u -p -b -w -B -r1.3 -r1.2.42.3
+--- sc/source/ui/vba/vbashape.hxx 11 Apr 2008 01:16:51 -0000 1.3
++++ sc/source/ui/vba/vbashape.hxx 6 Jul 2008 15:30:30 -0000 1.2.42.3
+@@ -47,21 +47,22 @@ typedef InheritedHelperInterfaceImpl< Li
+
+ class ScVbaShape : public ScVbaShape_BASE
+ {
++friend class ConcreteXShapeHelper; // perhaps an accessor would be better
+ private:
++protected:
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::drawing::XShapes > m_xShapes;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+ sal_Int32 m_nType;
+ css::uno::Any m_aRange;
+-protected:
+ virtual void addListeners();
+ virtual void removeShapeListener() throw( css::uno::RuntimeException );
+ virtual void removeShapesListener() throw( css::uno::RuntimeException );
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ public:
+- ScVbaShape( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape, const css::uno::Reference< css::drawing::XShapes > xShapes, sal_Int32 nType ) throw ( css::lang::IllegalArgumentException );
+- ScVbaShape( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape ) throw ( css::lang::IllegalArgumentException );
++ ScVbaShape( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::drawing::XShapes >& xShapes, sal_Int32 nType ) throw ( css::lang::IllegalArgumentException );
++ ScVbaShape( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape ) throw ( css::lang::IllegalArgumentException );
+ virtual ~ScVbaShape();
+ css::uno::Any getRange() { return m_aRange; };
+ void setRange( css::uno::Any aRange ) { m_aRange = aRange; };
+Index: sc/source/ui/vba/vbaspinbutton.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaspinbutton.cxx
+diff -N sc/source/ui/vba/vbaspinbutton.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaspinbutton.cxx 29 Jul 2008 06:35:42 -0000 1.1.2.1
+@@ -0,0 +1,109 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbaspinbutton.hxx"
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++
++const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
++const static rtl::OUString SPINVALUE( RTL_CONSTASCII_USTRINGPARAM("SpinValue") );
++const static rtl::OUString SPINMAX( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") );
++const static rtl::OUString SPINMIN( RTL_CONSTASCII_USTRINGPARAM("SpinValueMin") );
++
++ScVbaSpinButton::ScVbaSpinButton( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper ) : SpinButtonImpl_BASE( xParent, xContext, xControl, pGeomHelper )
++{
++}
++
++// Attributes
++uno::Any SAL_CALL
++ScVbaSpinButton::getValue() throw (css::uno::RuntimeException)
++{
++ return m_xProps->getPropertyValue( SPINVALUE );
++}
++
++void SAL_CALL
++ScVbaSpinButton::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SPINVALUE, _value );
++}
++
++::sal_Int32 SAL_CALL
++ScVbaSpinButton::getMax() throw (uno::RuntimeException)
++{
++ sal_Int32 nMax = 0;
++ m_xProps->getPropertyValue( SPINMAX ) >>= nMax;
++ return nMax;
++}
++
++void SAL_CALL
++ScVbaSpinButton::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SPINMAX, uno::makeAny( nVal ) );
++}
++
++::sal_Int32 SAL_CALL
++ScVbaSpinButton::getMin() throw (uno::RuntimeException)
++{
++ sal_Int32 nVal = 0;
++ m_xProps->getPropertyValue( SPINMIN ) >>= nVal;
++ return nVal;
++}
++
++void SAL_CALL
++ScVbaSpinButton::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( SPINMIN, uno::makeAny( nVal ) );
++}
++
++rtl::OUString&
++ScVbaSpinButton::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaSpinButton") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaSpinButton::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.Frame" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbaspinbutton.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaspinbutton.hxx
+diff -N sc/source/ui/vba/vbaspinbutton.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaspinbutton.hxx 29 Jul 2008 06:35:43 -0000 1.1.2.1
+@@ -0,0 +1,61 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_SPINBUTTON_HXX
++#define SC_VBA_SPINBUTTON_HXX
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/msforms/XSpinButton.hpp>
++
++#include "vbacontrol.hxx"
++#include "vbahelper.hxx"
++
++typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XSpinButton > SpinButtonImpl_BASE;
++
++class ScVbaSpinButton : public SpinButtonImpl_BASE
++{
++public:
++ ScVbaSpinButton( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
++ // Attributes
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException);
++ virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException);
++
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif //SC_VBA_SPINBUTTON_HXX
+Index: sc/source/ui/vba/vbatextbox.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbatextbox.cxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbatextbox.cxx 11 Apr 2008 01:19:17 -0000 1.3
++++ sc/source/ui/vba/vbatextbox.cxx 6 Jul 2008 15:30:55 -0000 1.2.42.2
+@@ -37,11 +37,24 @@ using namespace org::openoffice;
+
+
+
+-ScVbaTextBox::ScVbaTextBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : TextBoxImpl_BASE( xContext, xControlShape )
++ScVbaTextBox::ScVbaTextBox( const uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, AbstractGeometryAttributes* pGeomHelper, bool bDialog ) : TextBoxImpl_BASE( xParent, xContext, xControl, pGeomHelper ), mbDialog( bDialog )
+ {
+ }
+
+ // Attributes
++uno::Any SAL_CALL
++ScVbaTextBox::getValue() throw (css::uno::RuntimeException)
++{
++ return uno::makeAny( getText() );
++}
++
++void SAL_CALL
++ScVbaTextBox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
++{
++ rtl::OUString sVal = getAnyAsString( _value );
++ setText( sVal );
++}
++
+ //getString() will cause some imfo lose.
+ rtl::OUString SAL_CALL
+ ScVbaTextBox::getText() throw (css::uno::RuntimeException)
+@@ -57,9 +70,14 @@ ScVbaTextBox::getText() throw (css::uno:
+ void SAL_CALL
+ ScVbaTextBox::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException)
+ {
++ if ( !mbDialog )
++ {
+ uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
+ xTextRange->setString( _text );
+ }
++ else
++ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), uno::makeAny( _text ) );
++}
+
+ sal_Int32 SAL_CALL
+ ScVbaTextBox::getMaxLength() throw (css::uno::RuntimeException)
+@@ -98,3 +116,22 @@ ScVbaTextBox::setMultiline( sal_Bool _mu
+ m_xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), aValue);
+ }
++
++rtl::OUString&
++ScVbaTextBox::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaTextBox") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaTextBox::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.TextBox" ) );
++ }
++ return aServiceNames;
++}
+Index: sc/source/ui/vba/vbatextbox.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbatextbox.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.42.2
+diff -u -p -b -w -B -r1.3 -r1.2.42.2
+--- sc/source/ui/vba/vbatextbox.hxx 11 Apr 2008 01:19:33 -0000 1.3
++++ sc/source/ui/vba/vbatextbox.hxx 6 Jul 2008 15:31:16 -0000 1.2.42.2
+@@ -38,16 +38,20 @@ typedef cppu::ImplInheritanceHelper1< Sc
+
+ class ScVbaTextBox : public TextBoxImpl_BASE
+ {
++ bool mbDialog;
+ public:
+- ScVbaTextBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
++ ScVbaTextBox( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper, bool bDialog = false );
+ // Attributes
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMaxLength() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getMultiline() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMultiline( sal_Bool _multiline ) throw (css::uno::RuntimeException);
+-
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ };
+ #endif //SC_VBA_TEXTBOX_HXX
+Index: sc/source/ui/vba/vbatextboxshape.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbatextboxshape.cxx
+diff -N sc/source/ui/vba/vbatextboxshape.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbatextboxshape.cxx 14 Feb 2008 15:27:49 -0000 1.1.2.1
+@@ -0,0 +1,74 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++
++#include "vbatextboxshape.hxx"
++#include "vbacharacters.hxx"
++#include <com/sun/star/text/XSimpleText.hpp>
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++ScVbaTextBoxShape::ScVbaTextBoxShape( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel ) : TextBoxShapeImpl_BASE( uno::Reference< vba::XHelperInterface >(), xContext, xShape, xShapes, ScVbaShape::getType( xShape ) )
++{
++ m_xTextRange.set( xShape , uno::UNO_QUERY_THROW );
++ m_xModel.set( xModel );
++}
++
++rtl::OUString SAL_CALL
++ScVbaTextBoxShape::getText() throw (css::uno::RuntimeException)
++{
++ return m_xTextRange->getString();
++}
++
++void SAL_CALL
++ScVbaTextBoxShape::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException)
++{
++ m_xTextRange->setString( _text );
++}
++
++uno::Reference< excel::XCharacters > SAL_CALL
++ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) throw (uno::RuntimeException)
++{
++ ScDocShell* pDocShell = getDocShell( m_xModel );
++ ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
++
++ if ( !pDoc )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() );
++ uno::Reference< text::XSimpleText > xSimple( m_xTextRange, uno::UNO_QUERY_THROW );
++
++ ScVbaPalette aPalette( pDoc->GetDocumentShell() );
++ return new ScVbaCharacters( this, mxContext, aPalette, xSimple, Start, Length, sal_True );
++}
+Index: sc/source/ui/vba/vbatextboxshape.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbatextboxshape.hxx
+diff -N sc/source/ui/vba/vbatextboxshape.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbatextboxshape.hxx 14 Feb 2008 15:27:49 -0000 1.1.2.1
+@@ -0,0 +1,58 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_TEXTBOX_HXX
++#define SC_VBA_TEXTBOX_HXX
++#include <cppuhelper/implbase1.hxx>
++#include <com/sun/star/text/XTextRange.hpp>
++#include <org/openoffice/msforms/XTextBoxShape.hpp>
++#include "vbashape.hxx"
++#include "vbahelper.hxx"
++#include "vbacharacters.hxx"
++
++typedef cppu::ImplInheritanceHelper1< ScVbaShape, oo::msforms::XTextBoxShape > TextBoxShapeImpl_BASE;
++
++class ScVbaTextBoxShape : public TextBoxShapeImpl_BASE
++{
++ css::uno::Reference< css::text::XTextRange > m_xTextRange;
++ css::uno::Reference< css::frame::XModel > m_xModel;
++public:
++ ScVbaTextBoxShape( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::drawing::XShapes >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel );
++
++ // Attributes
++ virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::excel::XCharacters > SAL_CALL characters( const css::uno::Any& Start, const css::uno::Any& Length ) throw (css::uno::RuntimeException);
++};
++#endif //SC_VBA_TEXTBOX_HXX
+Index: sc/source/ui/vba/vbatogglebutton.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbatogglebutton.cxx
+diff -N sc/source/ui/vba/vbatogglebutton.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbatogglebutton.cxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,108 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbatogglebutton.hxx"
++#include <vector>
++
++using namespace com::sun::star;
++using namespace org::openoffice;
++
++
++const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
++const static rtl::OUString TOGGLE( RTL_CONSTASCII_USTRINGPARAM("Toggle") );
++const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
++ScVbaToggleButton::ScVbaToggleButton( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper ) : ToggleButtonImpl_BASE( xParent, xContext, xControl, pGeomHelper )
++{
++ OSL_TRACE("ScVbaToggleButton(ctor)");
++ m_xProps->setPropertyValue( TOGGLE, uno::makeAny( sal_True ) );
++}
++
++ScVbaToggleButton::~ScVbaToggleButton()
++{
++ OSL_TRACE("~ScVbaToggleButton(dtor)");
++}
++
++// Attributes
++rtl::OUString SAL_CALL
++ScVbaToggleButton::getCaption() throw (css::uno::RuntimeException)
++{
++ rtl::OUString Label;
++ m_xProps->getPropertyValue( LABEL ) >>= Label;
++ return Label;
++}
++
++void SAL_CALL
++ScVbaToggleButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
++}
++
++uno::Any SAL_CALL
++ScVbaToggleButton::getValue() throw (uno::RuntimeException)
++{
++ sal_Int16 nState = 0;
++ m_xProps->getPropertyValue( STATE ) >>= nState;
++ return uno::makeAny( nState ? sal_Int16( -1 ) : sal_Int16( 0 ) );
++}
++
++void SAL_CALL
++ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
++{
++ sal_Int16 nState = 0;
++ _value >>= nState;
++ OSL_TRACE( "nState - %d", nState );
++ nState = ( nState == -1 ) ? 1 : 0;
++ OSL_TRACE( "nState - %d", nState );
++ m_xProps->setPropertyValue( STATE, uno::makeAny( nState ) );
++}
++
++rtl::OUString&
++ScVbaToggleButton::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaToggleButton") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaToggleButton::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.ToggleButton" ) );
++ }
++ return aServiceNames;
++}
++
+Index: sc/source/ui/vba/vbatogglebutton.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbatogglebutton.hxx
+diff -N sc/source/ui/vba/vbatogglebutton.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbatogglebutton.hxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,63 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_TOGGLEBUTTON_HXX
++#define SC_VBA_TOGGLEBUTTON_HXX
++#include <cppuhelper/implbase2.hxx>
++#include <org/openoffice/msforms/XToggleButton.hpp>
++
++#include "vbacontrol.hxx"
++#include "vbahelper.hxx"
++
++typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XToggleButton, css::script::XDefaultProperty > ToggleButtonImpl_BASE;
++
++class ScVbaToggleButton : public ToggleButtonImpl_BASE
++{
++ rtl::OUString msDftPropName;
++public:
++ ScVbaToggleButton( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, oo::AbstractGeometryAttributes* pGeomHelper );
++ ~ScVbaToggleButton();
++ // Attributes
++ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
++
++ virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++ // XDefaultProperty
++ rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
++};
++#endif //SC_VBA_TOGGLEBUTTON_HXX
+Index: sc/source/ui/vba/vbauserform.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbauserform.cxx
+diff -N sc/source/ui/vba/vbauserform.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbauserform.cxx 22 Apr 2008 19:53:16 -0000 1.1.2.1
+@@ -0,0 +1,219 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "helperdecl.hxx"
++#include "vbauserform.hxx"
++#include <com/sun/star/awt/XControl.hpp>
++#include <com/sun/star/awt/XControlContainer.hpp>
++#include <com/sun/star/beans/PropertyConcept.hpp>
++#include <basic/sbx.hxx>
++#include <basic/sbstar.hxx>
++#include <basic/sbmeth.hxx>
++#include "unonames.hxx"
++
++using namespace ::org::openoffice;
++using namespace ::com::sun::star;
++
++// some little notes
++// XDialog implementation has the following interesting bits
++// a Controls property ( which is an array of the container controls )
++// each item in the controls array is a XControl, where the model is
++// basically a property bag
++// additionally the XDialog instance has itself a model
++// this model has a ControlModels ( array of models ) property
++// the models in ControlModels can be accessed by name
++// also the XDialog is a XControl ( to access the model above
++
++ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) : ScVbaUserForm_BASE( getXSomethingFromArgs< vba::XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), static_cast< org::openoffice::AbstractGeometryAttributes* >(0) ), m_pDocShell( 0 ), mbDispose( true )
++{
++ m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
++ uno::Reference< frame::XModel > xModel = getXSomethingFromArgs< frame::XModel >( aArgs, 2 );
++ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
++ m_pDocShell = getDocShell( xModel );
++ m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
++ setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) );
++}
++
++ScVbaUserForm::~ScVbaUserForm()
++{
++}
++
++void SAL_CALL
++ScVbaUserForm::Show( ) throw (uno::RuntimeException)
++{
++ OSL_TRACE("ScVbaUserForm::Show( )");
++ short aRet = 0;
++ if ( m_xDialog.is() )
++ aRet = m_xDialog->execute();
++ OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
++ if ( mbDispose )
++ {
++ try
++ {
++ uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
++ m_xDialog = NULL;
++ xComp->dispose();
++ mbDispose = false;
++ }
++ catch( uno::Exception& )
++ {
++ }
++ }
++}
++
++rtl::OUString SAL_CALL
++ScVbaUserForm::getCaption() throw (::com::sun::star::uno::RuntimeException)
++{
++ rtl::OUString sCaption;
++ m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ) ) >>= sCaption;
++ return sCaption;
++}
++void
++ScVbaUserForm::setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
++{
++ m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), uno::makeAny( _caption ) );
++}
++
++void SAL_CALL
++ScVbaUserForm::Hide( ) throw (uno::RuntimeException)
++{
++ mbDispose = false; // hide not dispose
++ if ( m_xDialog.is() )
++ m_xDialog->endExecute();
++}
++
++void SAL_CALL
++ScVbaUserForm::RePaint( ) throw (uno::RuntimeException)
++{
++ // do nothing
++}
++
++void SAL_CALL
++ScVbaUserForm::UnloadObject( ) throw (uno::RuntimeException)
++{
++ mbDispose = true;
++ if ( m_xDialog.is() )
++ m_xDialog->endExecute();
++}
++
++rtl::OUString&
++ScVbaUserForm::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++ScVbaUserForm::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.UserForm" ) );
++ }
++ return aServiceNames;
++}
++
++uno::Reference< beans::XIntrospectionAccess > SAL_CALL
++ScVbaUserForm::getIntrospection( ) throw (uno::RuntimeException)
++{
++ return uno::Reference< beans::XIntrospectionAccess >();
++}
++
++uno::Any SAL_CALL
++ScVbaUserForm::invoke( const ::rtl::OUString& /*aFunctionName*/, const uno::Sequence< uno::Any >& /*aParams*/, uno::Sequence< ::sal_Int16 >& /*aOutParamIndex*/, uno::Sequence< uno::Any >& /*aOutParam*/ ) throw (lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
++{
++ throw uno::RuntimeException(); // unsupported operation
++}
++
++void SAL_CALL
++ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
++{
++ uno::Any aObject = getValue( aPropertyName );
++ // The Object *must* support XDefaultProperty here because getValue will
++ // only return properties that are Objects ( e.g. controls )
++ // e.g. Userform1.aControl = something
++ // 'aControl' has to support XDefaultProperty to make sense here
++ uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
++ rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
++ uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
++ uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
++ xPropSet->setPropertyValue( aDfltPropName, aValue );
++}
++
++uno::Any SAL_CALL
++ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
++{
++ uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
++ uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
++ uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
++ ScVbaControlFactory aFac( mxContext, xControl );
++ uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
++ ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
++ pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
++ return uno::makeAny( xVBAControl );
++}
++
++::sal_Bool SAL_CALL
++ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException)
++{
++ return sal_False;
++}
++
++::sal_Bool SAL_CALL
++ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
++{
++ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY );
++ OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is() );
++ if ( xControl.is() )
++ {
++ uno::Reference< container::XNameAccess > xNameAccess( xControl->getModel(), uno::UNO_QUERY_THROW );
++ sal_Bool bRes = xNameAccess->hasByName( aName );
++ OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is(), bRes );
++ return bRes;
++ }
++ return sal_False;
++}
++
++namespace userform
++{
++namespace sdecl = comphelper::service_decl;
++sdecl::vba_service_class_<ScVbaUserForm, sdecl::with_args<true> > serviceImpl;
++extern sdecl::ServiceDecl const serviceDecl(
++ serviceImpl,
++ "ScVbaUserForm",
++ "org.openoffice.excel.UserForm" );
++}
++
+Index: sc/source/ui/vba/vbauserform.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbauserform.hxx
+diff -N sc/source/ui/vba/vbauserform.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbauserform.hxx 22 Apr 2008 19:53:17 -0000 1.1.2.1
+@@ -0,0 +1,77 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef SC_VBA_USERFORM_HXX
++#define SC_VBA_USERFORM_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <org/openoffice/msforms/XUserForm.hpp>
++#include <com/sun/star/awt/XDialog.hpp>
++
++#include "vbahelperinterface.hxx"
++#include "vbacontrol.hxx"
++
++//typedef InheritedHelperInterfaceImpl1< oo::msforms::XUserForm > ScVbaUserForm_BASE;
++typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XUserForm > ScVbaUserForm_BASE;
++
++class ScVbaUserForm : public ScVbaUserForm_BASE
++{
++private:
++ css::uno::Reference< css::awt::XDialog > m_xDialog;
++ ScDocShell* m_pDocShell;
++ bool mbDispose;
++protected:
++public:
++ ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
++ virtual ~ScVbaUserForm();
++ // XUserForm
++ virtual void SAL_CALL RePaint( ) throw (css::uno::RuntimeException);
++ virtual void SAL_CALL Show( ) throw (css::uno::RuntimeException);
++ // XIntrospection
++ virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
++ virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
++ virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
++ virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
++ virtual ::rtl::OUString SAL_CALL getCaption() throw (::com::sun::star::uno::RuntimeException);
++ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException);
++ virtual void SAL_CALL Hide( ) throw (css::uno::RuntimeException);
++ virtual void SAL_CALL UnloadObject( ) throw (css::uno::RuntimeException);
++
++ //XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif
+Index: sc/source/ui/vba/vbawindow.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbawindow.cxx,v
+retrieving revision 1.5
+retrieving revision 1.3.42.4
+diff -u -p -b -w -B -r1.5 -r1.3.42.4
+--- sc/source/ui/vba/vbawindow.cxx 11 Apr 2008 01:21:13 -0000 1.5
++++ sc/source/ui/vba/vbawindow.cxx 29 Jul 2008 06:35:43 -0000 1.3.42.4
+@@ -27,6 +27,7 @@
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
++#include "helperdecl.hxx"
+ #include "vbawindow.hxx"
+ #include "vbaworksheets.hxx"
+ #include "vbaworksheet.hxx"
+@@ -37,7 +38,11 @@
+ #include <com/sun/star/view/DocumentZoomType.hpp>
+ #include <com/sun/star/table/CellRangeAddress.hpp>
+ #include <org/openoffice/excel/XlWindowState.hpp>
++#include <org/openoffice/excel/XlWindowView.hpp>
+ #include <org/openoffice/excel/Constants.hpp>
++#include <com/sun/star/awt/XWindow.hpp>
++#include <com/sun/star/awt/XWindow2.hpp>
++#include <com/sun/star/awt/PosSize.hpp>
+
+ #include <docsh.hxx>
+ #include <tabvwsh.hxx>
+@@ -199,7 +204,19 @@ public:
+
+ ScVbaWindow::ScVbaWindow( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : WindowImpl_BASE( xParent, xContext ), m_xModel( xModel )
+ {
+- uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
++ init();
++}
++
++ScVbaWindow::ScVbaWindow( uno::Sequence< uno::Any > const & args, uno::Reference< uno::XComponentContext > const & xContext )
++ : WindowImpl_BASE( getXSomethingFromArgs< vba::XHelperInterface >( args, 0 ), xContext ),
++ m_xModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) )
++{
++ init();
++}
++void
++ScVbaWindow::init()
++{
++ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ m_xViewPane.set( xController, uno::UNO_QUERY_THROW );
+ m_xViewFreezable.set( xController, uno::UNO_QUERY_THROW );
+ m_xViewSplitable.set( xController, uno::UNO_QUERY_THROW );
+@@ -441,8 +456,8 @@ ScVbaWindow::Close( const uno::Any& Save
+ workbook.Close(SaveChanges, FileName, RouteWorkBook );
+ }
+
+-uno::Reference< excel::XPane >
+-ScVbaWindow::ActivePane()
++uno::Reference< excel::XPane > SAL_CALL
++ScVbaWindow::ActivePane() throw (script::BasicErrorException, uno::RuntimeException)
+ {
+ return new ScVbaPane( mxContext, m_xViewPane );
+ }
+@@ -629,7 +644,8 @@ ScVbaWindow::setSplitColumn( sal_Int32 _
+ if( getSplitColumn() != _splitcolumn )
+ {
+ sal_Bool bFrozen = getFreezePanes();
+- m_xViewFreezable->freezeAtPosition( _splitcolumn, 0 );
++ sal_Int32 nRow = getSplitRow();
++ m_xViewFreezable->freezeAtPosition( _splitcolumn, nRow );
+ SplitAtDefinedPosition( !bFrozen );
+ }
+ }
+@@ -661,7 +677,8 @@ ScVbaWindow::setSplitRow( sal_Int32 _spl
+ if( getSplitRow() != _splitrow )
+ {
+ sal_Bool bFrozen = getFreezePanes();
+- m_xViewFreezable->freezeAtPosition( 0, _splitrow );
++ sal_Int32 nColumn = getSplitColumn();
++ m_xViewFreezable->freezeAtPosition( nColumn , _splitrow );
+ SplitAtDefinedPosition( !bFrozen );
+ }
+ }
+@@ -736,6 +753,184 @@ ScVbaWindow::setZoom( const uno::Any& _z
+ }
+ }
+
++uno::Reference< excel::XWorksheet > SAL_CALL
++ScVbaWindow::ActiveSheet( ) throw (script::BasicErrorException, uno::RuntimeException)
++{
++ return ScVbaGlobals::getGlobalsImpl(mxContext)->getApplication()->getActiveSheet();
++}
++
++uno::Any SAL_CALL
++ScVbaWindow::getView() throw (uno::RuntimeException)
++{
++ // not supported now
++ sal_Int32 nWindowView = excel::XlWindowView::xlNormalView;
++ return uno::makeAny( nWindowView );
++}
++
++void SAL_CALL
++ScVbaWindow::setView( const uno::Any& _view) throw (uno::RuntimeException)
++{
++ sal_Int32 nWindowView = excel::XlWindowView::xlNormalView;
++ _view >>= nWindowView;
++ USHORT nSlot = FID_NORMALVIEWMODE;
++ switch ( nWindowView )
++ {
++ case excel::XlWindowView::xlNormalView:
++ nSlot = FID_NORMALVIEWMODE;
++ break;
++ case excel::XlWindowView::xlPageBreakPreview:
++ nSlot = FID_PAGEBREAKMODE;
++ break;
++ default:
++ DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++ }
++ dispatchExecute( m_xModel, nSlot );
++}
++
++sal_Bool SAL_CALL
++ScVbaWindow::getVisible() throw (uno::RuntimeException)
++{
++ sal_Bool bVisible = sal_True;
++ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
++ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
++ uno::Reference< css::awt::XWindow2 > xWindow2 (xWindow, uno::UNO_QUERY_THROW );
++ if( xWindow2.is() )
++ {
++ bVisible = xWindow2->isVisible();
++ }
++ return bVisible;
++}
++
++void SAL_CALL
++ScVbaWindow::setVisible(sal_Bool _visible) throw (uno::RuntimeException)
++{
++ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
++ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
++ if( xWindow.is() )
++ {
++ xWindow->setVisible( _visible );
++ }
++}
++
++css::awt::Rectangle getPosSize( const uno::Reference< frame::XModel >& xModel )
++{
++ css::awt::Rectangle aRect;
++ uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
++ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
++ if( xWindow.is() )
++ {
++ aRect = xWindow->getPosSize();
++ }
++ return aRect;
++}
++
++void setPosSize( const uno::Reference< frame::XModel >& xModel, sal_Int32 nValue, USHORT nFlag )
++{
++ uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
++ uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW );
++ if( xWindow.is() )
++ {
++ css::awt::Rectangle aRect = xWindow->getPosSize();
++ switch( nFlag )
++ {
++ case css::awt::PosSize::X:
++ xWindow->setPosSize( nValue, aRect.Y, 0, 0, css::awt::PosSize::X );
++ break;
++ case css::awt::PosSize::Y:
++ xWindow->setPosSize( aRect.X, nValue, 0, 0, css::awt::PosSize::Y );
++ break;
++ case css::awt::PosSize::WIDTH:
++ xWindow->setPosSize( 0, 0, nValue, aRect.Height, css::awt::PosSize::WIDTH );
++ break;
++ case css::awt::PosSize::HEIGHT:
++ xWindow->setPosSize( 0, 0, aRect.Width, nValue, css::awt::PosSize::HEIGHT );
++ break;
++ default:
++ break;
++ }
++ }
++}
++
++sal_Int32 SAL_CALL
++ScVbaWindow::getHeight() throw (uno::RuntimeException)
++{
++ css::awt::Rectangle aRect = getPosSize(m_xModel);
++ return aRect.Height;
++}
++
++void SAL_CALL
++ScVbaWindow::setHeight( sal_Int32 _height ) throw (uno::RuntimeException)
++{
++ setPosSize(m_xModel, _height, css::awt::PosSize::HEIGHT);
++}
++
++sal_Int32 SAL_CALL
++ScVbaWindow::getLeft() throw (uno::RuntimeException)
++{
++ css::awt::Rectangle aRect = getPosSize(m_xModel);
++ return aRect.X;
++}
++
++void SAL_CALL
++ScVbaWindow::setLeft( sal_Int32 _left ) throw (uno::RuntimeException)
++{
++ setPosSize(m_xModel, _left, css::awt::PosSize::X);
++}
++sal_Int32 SAL_CALL
++ScVbaWindow::getTop() throw (uno::RuntimeException)
++{
++ css::awt::Rectangle aRect = getPosSize(m_xModel);
++ return aRect.Y;
++}
++
++void SAL_CALL
++ScVbaWindow::setTop( sal_Int32 _top ) throw (uno::RuntimeException)
++{
++ setPosSize(m_xModel, _top, css::awt::PosSize::Y);
++}
++sal_Int32 SAL_CALL
++ScVbaWindow::getWidth() throw (uno::RuntimeException)
++{
++ css::awt::Rectangle aRect = getPosSize(m_xModel);
++ return aRect.Width;
++}
++
++void SAL_CALL
++ScVbaWindow::setWidth( sal_Int32 _width ) throw (uno::RuntimeException)
++{
++ setPosSize(m_xModel, _width, css::awt::PosSize::WIDTH);
++}
++
++sal_Int32 SAL_CALL
++ScVbaWindow::PointsToScreenPixelsX(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ sal_Int32 nHundredthsofOneMillimeters = Millimeter::getInHundredthsOfOneMillimeter( _points );
++ double fConvertFactor = (m_xDevice->getInfo().PixelPerMeterX/100000);
++ return static_cast<sal_Int32>(fConvertFactor * nHundredthsofOneMillimeters );
++}
++
++sal_Int32 SAL_CALL
++ScVbaWindow::PointsToScreenPixelsY(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ sal_Int32 nHundredthsofOneMillimeters = Millimeter::getInHundredthsOfOneMillimeter( _points );
++ double fConvertFactor = (m_xDevice->getInfo().PixelPerMeterY/100000);
++ return static_cast<sal_Int32>(fConvertFactor * nHundredthsofOneMillimeters );
++}
++
++void SAL_CALL
++ScVbaWindow::PrintOut( const css::uno::Any& From, const css::uno::Any&To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ // need test, print current active sheet
++ PrintOutHelper( From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, m_xModel, sal_True );
++}
++
++void SAL_CALL
++ScVbaWindow::PrintPreview( const css::uno::Any& EnableChanges ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
++{
++ // need test, print preview current active sheet
++ PrintPreviewHelper( EnableChanges, m_xModel );
++}
++
+ rtl::OUString&
+ ScVbaWindow::getServiceImplName()
+ {
+@@ -754,3 +949,12 @@ ScVbaWindow::getServiceNames()
+ }
+ return aServiceNames;
+ }
++namespace window
++{
++namespace sdecl = comphelper::service_decl;
++sdecl::vba_service_class_<ScVbaWindow, sdecl::with_args<true> > serviceImpl;
++extern sdecl::ServiceDecl const serviceDecl(
++ serviceImpl,
++ "ScVbaWindow",
++ "org.openoffice.excel.Window" );
++}
+Index: sc/source/ui/vba/vbawindow.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbawindow.hxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.3
+diff -u -p -b -w -B -r1.4 -r1.3.42.3
+--- sc/source/ui/vba/vbawindow.hxx 11 Apr 2008 01:21:27 -0000 1.4
++++ sc/source/ui/vba/vbawindow.hxx 29 Jul 2008 06:35:43 -0000 1.3.42.3
+@@ -53,14 +53,19 @@ private:
+ css::uno::Reference< css::sheet::XViewSplitable > m_xViewSplitable;
+ css::uno::Reference< oo::excel::XPane > m_xPane;
+ css::uno::Reference< css::awt::XDevice > m_xDevice;
++ void init();
+ protected:
+ void SplitAtDefinedPosition(sal_Bool _bUnFreezePane);
+ public:
+ void Scroll( const css::uno::Any& Down, const css::uno::Any& Up, const css::uno::Any& ToRight, const css::uno::Any& ToLeft, bool bLargeScroll = false ) throw (css::uno::RuntimeException);
+ public:
+ ScVbaWindow( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel );
+- css::uno::Reference< oo::excel::XPane > ActivePane();
++ ScVbaWindow( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext );
++
+ // XWindow
++ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL ActiveCell( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::excel::XPane > SAL_CALL ActivePane() throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::excel::XWorksheet > SAL_CALL ActiveSheet( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const css::uno::Any& _caption ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getDisplayGridlines() throw (css::uno::RuntimeException);
+@@ -77,6 +82,10 @@ public:
+ virtual void SAL_CALL setDisplayWorkbookTabs( ::sal_Bool _bDisplayWorkbookTabs ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getFreezePanes() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setFreezePanes( ::sal_Bool _bFreezePanes ) throw (css::uno::RuntimeException);
++ virtual sal_Int32 SAL_CALL getHeight() throw (css::uno::RuntimeException) ;
++ virtual void SAL_CALL setHeight( sal_Int32 _height ) throw (css::uno::RuntimeException) ;
++ virtual sal_Int32 SAL_CALL getLeft() throw (css::uno::RuntimeException) ;
++ virtual void SAL_CALL setLeft( sal_Int32 _left ) throw (css::uno::RuntimeException) ;
+ virtual ::sal_Bool SAL_CALL getSplit() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSplit( ::sal_Bool _bSplit ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSplitColumn() throw (css::uno::RuntimeException) ;
+@@ -91,6 +100,14 @@ public:
+ virtual void SAL_CALL setScrollRow( const css::uno::Any& _scrollrow ) throw (css::uno::RuntimeException) ;
+ virtual css::uno::Any SAL_CALL getScrollColumn() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setScrollColumn( const css::uno::Any& _scrollcolumn ) throw (css::uno::RuntimeException) ;
++ virtual sal_Int32 SAL_CALL getTop() throw (css::uno::RuntimeException) ;
++ virtual void SAL_CALL setTop( sal_Int32 _top ) throw (css::uno::RuntimeException) ;
++ virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setView( const css::uno::Any& _view ) throw (css::uno::RuntimeException);
++ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
++ virtual sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException) ;
++ virtual void SAL_CALL setWidth( sal_Int32 _width ) throw (css::uno::RuntimeException) ;
+ virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException);
+@@ -103,8 +120,11 @@ public:
+ virtual void SAL_CALL ScrollWorkbookTabs( const css::uno::Any& Sheets, const css::uno::Any& Position ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Activate( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& FileName, const css::uno::Any& RouteWorkBook ) throw (css::uno::RuntimeException);
+- virtual css::uno::Reference< oo::excel::XRange > SAL_CALL ActiveCell( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Selection( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual sal_Int32 SAL_CALL PointsToScreenPixelsX(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual sal_Int32 SAL_CALL PointsToScreenPixelsY(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual void SAL_CALL PrintOut( const css::uno::Any& From, const css::uno::Any&To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
++ virtual void SAL_CALL PrintPreview( const css::uno::Any& EnableChanges ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+Index: sc/source/ui/vba/vbaworkbook.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaworkbook.cxx,v
+retrieving revision 1.5
+retrieving revision 1.4.42.2
+diff -u -p -b -w -B -r1.5 -r1.4.42.2
+--- sc/source/ui/vba/vbaworkbook.cxx 11 Apr 2008 01:22:11 -0000 1.5
++++ sc/source/ui/vba/vbaworkbook.cxx 6 Jul 2008 15:29:44 -0000 1.4.42.2
+@@ -428,14 +428,18 @@ ScVbaWorkbook::Styles( const::uno::Any&
+
+ // Amelia Wang
+ uno::Any SAL_CALL
+-ScVbaWorkbook::Names( ) throw (uno::RuntimeException)
++ScVbaWorkbook::Names( const css::uno::Any& aIndex ) throw (uno::RuntimeException)
+ {
+ uno::Reference< frame::XModel > xModel( getModel() );
+ uno::Reference< beans::XPropertySet > xProps( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NamedRanges") ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< vba::XCollection > xNames( new ScVbaNames( this , mxContext , xNamedRanges , xModel ));
++ if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID )
++ {
+ return uno::Any( xNames );
+ }
++ return uno::Any( xNames->Item( aIndex, uno::Any() ) );
++}
+
+ rtl::OUString&
+ ScVbaWorkbook::getServiceImplName()
+Index: sc/source/ui/vba/vbaworkbook.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaworkbook.hxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.2
+diff -u -p -b -w -B -r1.4 -r1.3.42.2
+--- sc/source/ui/vba/vbaworkbook.hxx 11 Apr 2008 01:22:26 -0000 1.4
++++ sc/source/ui/vba/vbaworkbook.hxx 6 Jul 2008 15:30:33 -0000 1.3.42.2
+@@ -75,7 +75,7 @@ public:
+ virtual void SAL_CALL Save() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
+ // Amelia Wang
+- virtual css::uno::Any SAL_CALL Names( ) throw (css::uno::RuntimeException);
++ virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL Styles( const css::uno::Any& Item ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ResetColors( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+Index: sc/source/ui/vba/vbaworksheet.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaworksheet.cxx,v
+retrieving revision 1.5
+retrieving revision 1.3.42.5
+diff -u -p -b -w -B -r1.5 -r1.3.42.5
+--- sc/source/ui/vba/vbaworksheet.cxx 11 Apr 2008 01:23:10 -0000 1.5
++++ sc/source/ui/vba/vbaworksheet.cxx 29 Jul 2008 06:35:43 -0000 1.3.42.5
+@@ -47,6 +47,7 @@
+ #include <com/sun/star/sheet/XSheetPastable.hpp>
+ #include <com/sun/star/sheet/XCellAddressable.hpp>
+ #include <com/sun/star/sheet/XSheetOutline.hpp>
++#include <com/sun/star/sheet/XSheetPageBreak.hpp>
+ #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
+ #include <com/sun/star/util/XURLTransformer.hpp>
+ #include <com/sun/star/frame/XDispatchProvider.hpp>
+@@ -56,6 +57,7 @@
+ #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+ #include <com/sun/star/drawing/XControlShape.hpp>
+ #include <com/sun/star/form/FormComponentType.hpp>
++#include <com/sun/star/form/XFormsSupplier.hpp>
+
+ #include <comphelper/processfactory.hxx>
+
+@@ -84,6 +86,8 @@
+ #include "vbaoleobject.hxx"
+ #include "vbaoleobjects.hxx"
+ #include "vbashapes.hxx"
++#include "vbapagesetup.hxx"
++#include "vbapagebreaks.hxx"
+
+ #define STANDARDWIDTH 2267
+ #define STANDARDHEIGHT 427
+@@ -247,6 +251,12 @@ ScVbaWorksheet::setVisible( sal_Bool bVi
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ), aValue);
+ }
+
++sal_Int16
++ScVbaWorksheet::getIndex() throw (uno::RuntimeException)
++{
++ return getSheetID() + 1;
++}
++
+ uno::Reference< excel::XRange >
+ ScVbaWorksheet::getUsedRange() throw (uno::RuntimeException)
+ {
+@@ -266,6 +276,22 @@ ScVbaWorksheet::Outline( ) throw (uno::R
+ return new ScVbaOutline( this, mxContext, xOutline);
+ }
+
++uno::Reference< excel::XPageSetup >
++ScVbaWorksheet::PageSetup( ) throw (uno::RuntimeException)
++{
++ return new ScVbaPageSetup( this, mxContext, getSheet(), getModel() );
++}
++
++uno::Any
++ScVbaWorksheet::HPageBreaks( const uno::Any& aIndex ) throw (uno::RuntimeException)
++{
++ uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(getSheet(),uno::UNO_QUERY_THROW);
++ uno::Reference< excel::XHPageBreaks > xHPageBreaks( new ScVbaHPageBreaks( this, mxContext, xSheetPageBreak));
++ if ( aIndex.hasValue() )
++ return xHPageBreaks->Item( aIndex, uno::Any());
++ return uno::makeAny( xHPageBreaks );
++}
++
+ sal_Int32
+ ScVbaWorksheet::getStandardWidth() throw (uno::RuntimeException)
+ {
+@@ -416,6 +442,7 @@ ScVbaWorksheet::Delete() throw (uno::Run
+ uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
+ uno::Reference<container::XNameContainer> xNameContainer(xSheets,uno::UNO_QUERY_THROW);
+ xNameContainer->removeByName(aSheetName);
++ mxSheet.clear();
+ }
+ }
+
+@@ -656,29 +683,10 @@ ScVbaWorksheet::setValue( const ::rtl::O
+ uno::Any SAL_CALL
+ ScVbaWorksheet::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+ {
+-/* uno::Any aProp = getControl( aPropertyName );
+-
+- if ( !aProp.hasValue() )
+- throw beans::UnknownPropertyException(); // unsupported operation
+- // #TODO we need a factory here when we support
+- // more control types
+- sal_Int32 nClassId = -1;
+- uno::Reference< beans::XPropertySet > xProps( aProp, uno::UNO_QUERY_THROW );
+- const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
+- xProps->getPropertyValue( sClassId ) >>= nClassId;
+- ScVbaControlFactory controlFactory( m_xContext, xProps, xControlShape );
+- uno::Reference< vba::XControl > xControl( controlFactory.createControl( nClassId ) );
+- if ( nClassId == form::FormComponentType::COMBOBOX )
+- {
+- uno::Reference< msforms::XComboBox > xCbx( new ScVbaComboBox( m_xContext, xProps ) );
+- return uno::makeAny( xCbx );
+- }
+-*/
+ uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW );
+ ScVbaControlFactory controlFactory( mxContext, xControlShape );
+- uno::Reference< msforms::XControl > xControl( controlFactory.createControl() );
++ uno::Reference< msforms::XControl > xControl( controlFactory.createControl( getModel() ) );
+ return uno::makeAny( xControl );
+-// return aProp;
+ }
+
+ ::sal_Bool SAL_CALL
+@@ -686,82 +694,67 @@ ScVbaWorksheet::hasMethod( const ::rtl::
+ {
+ return sal_False;
+ }
+-::sal_Bool SAL_CALL
+-ScVbaWorksheet::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
++
++uno::Reference< container::XNameAccess >
++ScVbaWorksheet::getFormControls()
+ {
++ uno::Reference< container::XNameAccess > xFormControls;
+ try
+ {
+- if ( getControl( aName ).hasValue() )
+- return sal_True;
++ uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW );
++ uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
++ uno::Reference< form::XFormsSupplier > xFormSupplier( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
++ uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
++ // get the www-standard container ( maybe we should access the
++ // 'www-standard' by name rather than index, this seems an
++ // implementation detail
++ xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
++
+ }
+ catch( uno::Exception& )
+ {
+ }
+- return sal_False;
+-}
+-uno::Any
+-ScVbaWorksheet::getControl( const ::rtl::OUString& sName )
+-{
+- uno::Reference< sheet::XScenarioEnhanced > xIf( getSheet(), uno::UNO_QUERY_THROW );
+- ScTableSheetObj* pTab= static_cast< ScTableSheetObj* >( xIf.get() );
+- ScDocShell* pShell = NULL;
+- if ( pTab )
+- pShell = pTab->GetDocShell();
+- if ( pShell )
+- {
+- ScDrawLayer* pDrawLayer = pShell->MakeDrawLayer();
+- SCTAB nTab = 0;
+- // make GetTab_Impl() public or this class a friend
+- const ScRangeList& rRanges = pTab->GetRangeList();
+- const ScRange* pFirst = rRanges.GetObject(0);
+- if (pFirst)
+- nTab = pFirst->aStart.Tab();
++ return xFormControls;
+
+- SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
+- if ( pPage )
+- {
+- ULONG nCount = pPage->GetObjCount();
+- for ( ULONG index=0; index<nCount; ++index )
+- {
+- SdrObject* pObj = pPage->GetObj( index );
+- if ( pObj )
+- {
+-
+- SdrUnoObj* pUnoObj = PTR_CAST(SdrUnoObj, pObj);
+- if ( pUnoObj )
+- {
+- uno::Reference< container::XNamed > xNamed( pUnoObj->GetUnoControlModel(), uno::UNO_QUERY_THROW );
+- if ( sName.equals( xNamed->getName() ) )
+- return uno::makeAny( xNamed );
+- }
+ }
+- }
+- }
+- }
+-
+- return uno::Any();
++::sal_Bool SAL_CALL
++ScVbaWorksheet::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
++{
++ uno::Reference< container::XNameAccess > xFormControls( getFormControls() );
++ if ( xFormControls.is() )
++ return xFormControls->hasByName( aName );
++ return sal_False;
+ }
+
+ uno::Any
+ ScVbaWorksheet::getControlShape( const ::rtl::OUString& sName )
+ {
+- //uno::Reference< sheet::XScenarioEnhanced > xIf( getSheet(), uno::UNO_QUERY_THROW );
+- uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW );
+- uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
+- uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
+- uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPage, uno::UNO_QUERY_THROW );
++ // ideally we would get an XControl object but it appears an XControl
++ // implementation only exists for a Control implementation optained from the
++ // view ( e.g. in basic you would get this from
++ // thiscomponent.currentcontroller.getControl( controlModel ) )
++ // and the thing to realise is that it is only possible to get an XControl
++ // for a currently displayed control :-( often we would want to modify
++ // a control not on the active sheet. But.. you can always access the
++ // XControlShape from the DrawPage whether that is the active drawpage or not
++
++ uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getSheet(), uno::UNO_QUERY_THROW );
++ uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
++
+ sal_Int32 nCount = xIndexAccess->getCount();
+ for( int index = 0; index < nCount; index++ )
+ {
+ uno::Any aUnoObj = xIndexAccess->getByIndex( index );
+- uno::Reference< drawing::XControlShape > xControlShape( aUnoObj, uno::UNO_QUERY_THROW );
+- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl() );
+- uno::Reference< container::XNamed > xNamed( xControlModel, uno::UNO_QUERY_THROW );
++ // It seems there are some drawing objects that can not query into Control shapes?
++ uno::Reference< drawing::XControlShape > xControlShape( aUnoObj, uno::UNO_QUERY );
++ if( xControlShape.is() )
++ {
++ uno::Reference< container::XNamed > xNamed( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+ if( sName.equals( xNamed->getName() ))
+ {
+ return aUnoObj;
+ }
+-
++ }
+ }
+ return uno::Any();
+ }
+@@ -856,6 +849,29 @@ ScVbaWorksheet::getSheetID() throw (uno:
+ return xAddressable->getRangeAddress().Sheet;
+ }
+
++void SAL_CALL
++ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& ActivePrinter, const uno::Any& PrintToFile, const uno::Any& Collate, const uno::Any& PrToFileName, const uno::Any& IgnorePrintAreas ) throw (uno::RuntimeException)
++{
++ sal_Int32 nTo = 0;
++ sal_Int32 nFrom = 0;
++ sal_Int16 nCopies = 1;
++ sal_Bool bCollate = sal_False;
++ sal_Bool bSelection = sal_False;
++ sal_Bool bIgnorePrintAreas = sal_False;
++ From >>= nFrom;
++ To >>= nTo;
++ Copies >>= nCopies;
++ IgnorePrintAreas >>= bIgnorePrintAreas;
++ if ( nCopies > 1 ) // Collate only useful when more that 1 copy
++ Collate >>= bCollate;
++
++ if ( !( nFrom || nTo ) )
++ bSelection = sal_True;
++
++ uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
++ PrintOutHelper( From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, xModel, bSelection );
++}
++
+
+ namespace worksheet
+ {
+Index: sc/source/ui/vba/vbaworksheet.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbaworksheet.hxx,v
+retrieving revision 1.4
+retrieving revision 1.3.42.4
+diff -u -p -b -w -B -r1.4 -r1.3.42.4
+--- sc/source/ui/vba/vbaworksheet.hxx 11 Apr 2008 01:23:24 -0000 1.4
++++ sc/source/ui/vba/vbaworksheet.hxx 29 Jul 2008 06:35:43 -0000 1.3.42.4
+@@ -42,6 +42,8 @@
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/frame/XModel.hpp>
+ #include <org/openoffice/excel/XOutline.hpp>
++#include <org/openoffice/excel/XPageSetup.hpp>
++#include <org/openoffice/excel/XHPageBreaks.hpp>
+ #include <org/openoffice/excel/XChartObjects.hpp>
+
+ #include "vbahelperinterface.hxx"
+@@ -57,7 +59,7 @@ class ScVbaWorksheet : public WorksheetI
+ css::uno::Reference< oo::excel::XWorksheet > getSheetAtOffset(SCTAB offset) throw (css::uno::RuntimeException);
+ css::uno::Reference< oo::excel::XRange > getSheetRange() throw (css::uno::RuntimeException);
+
+- css::uno::Any getControl( const rtl::OUString& sName );
++ css::uno::Reference< css::container::XNameAccess > getFormControls();
+ css::uno::Any getControlShape( const rtl::OUString& sName );
+ protected:
+
+@@ -89,8 +91,11 @@ public:
+ virtual css::uno::Reference< oo::excel::XRange > SAL_CALL getUsedRange() throw (css::uno::RuntimeException) ;
+ virtual css::uno::Any SAL_CALL ChartObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< oo::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException);
++ virtual css::uno::Reference< oo::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::Reference< oo::excel::XWorksheet > SAL_CALL getNext() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< oo::excel::XWorksheet > SAL_CALL getPrevious() throw (css::uno::RuntimeException);
++ virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
+@@ -131,6 +136,7 @@ public:
+ virtual void SAL_CALL setCodeName( const rtl::OUString& sCodeName ) throw (css::uno::RuntimeException);
+ sal_Int16 getSheetID() throw (css::uno::RuntimeException);
+
++ virtual void SAL_CALL PrintOut( const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, const css::uno::Any& IgnorePrintAreas ) throw (css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+cvs diff: Diffing sc/source/ui/vba/testvba
+Index: sc/source/ui/vba/testvba/README
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/testvba/README,v
+retrieving revision 1.2
+retrieving revision 1.2.42.1
+diff -u -p -b -w -B -r1.2 -r1.2.42.1
+--- sc/source/ui/vba/testvba/README 7 Dec 2007 11:14:59 -0000 1.2
++++ sc/source/ui/vba/testvba/README 29 Jul 2008 07:22:41 -0000 1.2.42.1
+@@ -1,35 +1,37 @@
+-running dmake in this directory runs a set of regression (unit) tests.
++to run the tests
+
+-Note:
+- o you need to set OFFICEPATH env variable to the install directory of your office installation e.g.
++build
++=====
++ dmake
+
+-export OFFICEPATH="/cygdrive/f/Program\ Files/OpenOffice.org\ 2.3"
++windows
++=======
++ a) you can download a cygwin bash shell environment and install perl ( http://cygwin.com/setup.exe )
++ from the cmdline './runTests.pl $(OFFICE_PROGRAM_PATH)' should run the testclient and compare the logs
++ b) use ordinary windows perl [1], but additionally you will need the 'diff' program for window ( download from http://gnuwin32.sourceforge.net/packages/diffutils.htm )
+
+- o naturally in order to run the tests you need to source the build env scripts in the top level build directory [1]
++[1] for the testclient the perl ( all inclusive ) bundle from ActivePerl is mor e than adeqate ( download from http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.822-MSWin32-x86-280952.msi )
+
+- o the testclient runs looks for testdocuments in the '../TestDocuments' [3] directory. For each document the test client runs the macro 'Standard.TestMacros.Main' located in that test document. The macro(s) write a log file, the log files end up in the Logs sub-directory ( in this directory ). A logfile exists for each testdocument that has successfully run. The log files are compared against benchmark logfiles to ensure no regressions have occured ( see [4] for directory structure and location of benchmark files ). At this point we are not concerned with known failures [5]
++ to run all test cases type
++ 'perl ./runTests.pl $(OFFICE_PROGRAM_PATH)'
++ to run a test case type
++ 'perl ./runTests.pl $(OFFICE_PROGRAM_PATH) testfilename'
+
++unix
++====
+
+-[1] Ideally this should not be necessary and you should be able to run the tests without a build env - future
++assuming perl is installed
++ './runTests.pl $(OFFICE_PROGRAM_PATH)'
++ or './runTests.pl $(OFFICE_PROGRAM_PATH) testfilename' for one file test.
+
+-[2] The test client should be re-written in C++ to get a better handle on lifecycle issues. E.g. currently on windows and sometimes on linux the client won't exit, also the office process doesn't alway exit
+
+-[3]
++Note: For either windows or unix all of the tests should pass ( and you should get a result like )
++Note Also: If you meat a problem that stop running test after serveral test documents have been run. please clean your .ooo-2.0 or .oooxxx first, and then re-run.
+
+-The TestDocument directory contains
+- o test documents ( *.xls )
+- o logs directory ( contains the benchmark logs to compare against )
++========>
+
+-[4]
++skipped 0 test-cases(s)
++compared 9 test-case documents
++ 9 tests passedTests
+
+-The logs directory contains the following sub-directories
+- o excel ( the orig logs produced by an excel file )
+- o unix ( the log produced by OpenOffice running imported Excel document under unix )
+- o win ( the log produced by OpenOffice running imported Excel document under windows )
+-
+-[*] the seperate win & unix directories are to facilate tests that will produce different results under the different platforms e.g. paths etc.
+-
+-[5]
+-
+-o Currently the logs in the excel directory are only stored for comparison, they are not used by the tooling
+-o Currently we don't measure how many tests pass or fail, the immediate focus is that we don't get any regressions ( but of course we do look at these manually and try and get all tests to pass )
++Note also: the testclient will attempt to connect to an existing instance of open-office, when the testClient exits the soffice process may still be running, if you wish to repeat tests you may want to kill the office instance before re-running.
+Index: sc/source/ui/vba/testvba/makefile.mk
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/testvba/makefile.mk,v
+retrieving revision 1.3
+retrieving revision 1.3.96.2
+diff -u -p -b -w -B -r1.3 -r1.3.96.2
+--- sc/source/ui/vba/testvba/makefile.mk 11 Apr 2008 01:25:09 -0000 1.3
++++ sc/source/ui/vba/testvba/makefile.mk 29 Jul 2008 09:36:01 -0000 1.3.96.2
+@@ -30,28 +30,44 @@
+ #*************************************************************************
+
+ PRJ=..$/..$/..$/..$/
++
+ PRJNAME=sc
+ TARGET=testvba
++ENABLE_EXCEPTIONS=TRUE
+
+-.INCLUDE : ant.mk
+-
+-.IF "$(SOLAR_JAVA)"!=""
++# --- Settings -----------------------------------------------------
+
+-ALLTAR : PROCESSRESULTS
++.INCLUDE : settings.mk
++DLLPRE =
+
+-TESTDOCUMENTS=..$/TestDocuments
+-.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC"
+-TESTDOCUMENTLOGS=$(TESTDOCUMENTS)$/logs$/unix
+-.ELSE
+-TESTDOCUMENTLOGS=$(TESTDOCUMENTS)$/logs$/win
++.IF "$(ENABLE_VBA)"!="YES"
++dummy:
++ @echo "not building vba..."
+ .ENDIF
+
+-OUTPUTDIR:=..$/$(TARGET)$/Logs
+-ANT_FLAGS+=-Dtest.documents=$(TESTDOCUMENTS)
+-ANT_FLAGS+=-Dtest.out=$(OUTPUTDIR)
+-ANT_FLAGS+=-Dtest.officepath=$(OFFICEPATH)
+-#UNITTEST : $(LOCAL_COMMON_OUT)$/class/TestVBA.class
+-PROCESSRESULTS : ANTBUILD
+- $(PERL) testResults.pl $(OUTPUTDIR) $(TESTDOCUMENTLOGS)
++INCPRE=$(INCCOM)$/$(TARGET)
++CDEFS+=-DVBA_OOBUILD_HACK
++# ------------------------------------------------------------------
++
++SLOFILES= \
++ $(SLO)$/testvba.obj \
++
++
++# --- Targets ------------------------------------------------------
++
++APP1TARGET=testclient
++APP1OBJS= $(SLOFILES)
++
++APP1STDLIBS=\
++ $(SALLIB) \
++ $(STDLIBCPP) \
++ $(CPPULIB) \
++ $(CPPUHELPERLIB) \
++ $(COMPHELPERLIB) \
++ $(TOOLSLIB) \
++ $(UNOTOOLSLIB) \
++
++#APP1OBJS= $(OBJ)$/testclient.obj
++.INCLUDE : target.mk
++
+
+-.ENDIF
+Index: sc/source/ui/vba/testvba/runTests.pl
+===================================================================
+RCS file: sc/source/ui/vba/testvba/runTests.pl
+diff -N sc/source/ui/vba/testvba/runTests.pl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/runTests.pl 29 Jul 2008 07:22:41 -0000 1.1.2.1
+@@ -0,0 +1,121 @@
++#!/usr/bin/perl -w
++use URI::Escape;
++use File::Basename;
++use Cwd;
++use Cwd 'abs_path';
++
++$numArgs = $#ARGV + 1;
++print "thanks, you gave me $numArgs command-line arguments.\n";
++
++foreach $argnum (0 .. $#ARGV) {
++ print "$ARGV[$argnum]\n";
++}
++
++
++my $binDir = abs_path( dirname($0) );
++
++my $sysDir = "unix";
++my $fileSep = "/";
++my $theResult;
++my $officepath = shift || die "please specify path to office installation program dir";
++my $DocName = shift || "";
++my $programpath = "$officepath/program";
++my $basiclibrarypath = "$officepath/basis3.0/program";
++my $urelibpath = "$officepath/ure/lib";
++my $binext = "";
++my $testDocDir = "$binDir/TestDocuments";
++my $testLogDir = "$binDir/Logs";
++my $testclientname = "testclient";
++my $buildtestclient = "../../../../unxlngi6.pro/bin/$testclientname";
++
++# test testclient
++if ( -e "$buildtestclient" )
++{
++ print "use the latest build\n";
++ system( "cp $buildtestclient ." );
++}
++elsif ( !( -e "$testclientname" ) )
++{
++ print "$testclientname do not exist\n";
++ exit;
++}
++
++# test for uname
++system("uname");
++$exit_value = $? >> 8;
++$signal_num = $? & 127;
++$dumped_core = $? & 128;
++
++$failed = ( $exit_value || $signal_num || $dumped_core );
++
++print "$failed = ( $exit_value || $signal_num || $dumped_core )\n";
++
++if ( !$failed && open(UNAME, "uname -a|") ) {
++ $theResult = <UNAME>;
++ close(UNAME);
++ if ( $theResult =~ /^CYGWIN/ ) {
++ # windows under cygwin
++ $sysDir = "win" ;
++ $tmpPath=$ENV{"PATH"};
++ $ENV{"PATH"} = "$officepath:$tmpPath";
++ $testDocDir=`cygpath -m $testDocDir`;
++ uri_escape($testDocDir);
++ # hacky windows url construction
++ $testDocDir="file:///$testDocDir";
++
++ chomp($testDocDir);
++ #print "*** doc dir is $testDocDir\n";
++ $testLogDir = `cygpath -m "$testLogDir"`;
++ uri_escape($testLogDir);
++ $testLogDir="file:///$testLogDir";
++ chomp($testLogDir);
++ #print "*** log dir is $testLogDir\n";
++ $binext = ".exe";
++ }
++ else{
++ # unix we need to find sal etc. ( from the office path )
++ my $tmpPath=$ENV{"PATH"};
++ $ENV{"PATH"} = "$programpath:$basiclibrarypath:$urelibpath/../bin:$tmpPath";
++ $tmpPATH = $ENV{"LD_LIBRARY_PATH"};
++ $ENV{"LD_LIBRARY_PATH"} = "$officepath:$programpath:$basiclibrarypath:$urelibpath:$urelibpath../bin/javaldx:$urelibpath/../bin:$tmpPATH";
++ $ENV{"LD_LIBRARY_PATH"} = "$officepath:$programpath:$basiclibrarypath:$urelibpath:$tmpPATH";
++ my $testPath = $ENV{"LD_LIBRARY_PATH"};
++ print "$testPath\n";
++ $testPath = $ENV{"PATH"};
++ print "$testPath\n";
++ $ENV{"STAR_RESOURCEPATH"} = "$officepath/basis3.0/program/resource";
++ $ENV{"SAL_ALLOW_LINKOO_SYMLINKS"} = "1";
++ $testPath = $ENV{"LANG"};
++ print "$testPath\n";
++ }
++}
++else
++{
++ # ordinary windows, not sure if this will actually work
++ $sysDir = "win" ;
++ $tmpPath=$ENV{"PATH"};
++ $ENV{"PATH"} = "$tmpPath;$officepath";
++ $binext = ".exe";
++}
++
++# the exe needs system paths or urls ( urls are by far the least troublesome )
++
++my $runCmd = "";
++my $analyseCmd = "";
++
++if ( "$DocName" eq "" )
++{
++ $runCmd = "$binDir/testclient$binext $testDocDir $testLogDir";
++ $analyseCmd = "perl $binDir/testResults.pl $binDir/Logs $binDir/TestDocuments/logs/$sysDir";
++}
++else
++{
++ $runCmd = "$binDir/testclient$binext $testDocDir $testLogDir $testDocDir/$DocName";
++ $analyseCmd = "perl $binDir/testResult.pl $binDir/Logs $binDir/TestDocuments/logs/$sysDir $DocName";
++}
++print "runCmd = $runCmd\n";
++
++system ("rm -rf $testLogDir/*");
++my $status = system( $runCmd );
++print "analyseCmd = $analyseCmd\n";
++$status = system( $analyseCmd );
+Index: sc/source/ui/vba/testvba/testResult.pl
+===================================================================
+RCS file: sc/source/ui/vba/testvba/testResult.pl
+diff -N sc/source/ui/vba/testvba/testResult.pl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/testResult.pl 29 Jul 2008 07:22:42 -0000 1.1.2.1
+@@ -0,0 +1,171 @@
++#!/usr/bin/perl -w
++use File::Temp qw/ tempfile tempdir /;
++use File::Basename;
++use File::stat;
++use File::Copy;
++
++my $binDir = dirname($0);
++my $timestampclean= "perl $binDir/timestampsClean.pl";
++#sub gen_diff($)
++
++sub testLog
++{
++ # 2 No Log to compare against
++ # 1 Log passed
++ # 0 Log failed
++ my $result = 0;
++ my $testfile = shift;
++ my $dirtocheck = shift;
++ my $filename = basename($testfile);
++ $filename = "$logdir/$filename";
++ print "processing $testfile $filename\n";
++ if ( -f $filename ) {
++ my $tmpFile;
++ $dir = tempdir( CLEANUP => 1 );
++ ($fh, $tmpFile) = tempfile( DIR => $dir );
++ close($fh);
++ #
++ my $status = system("diff -U 0 -p $testfile $filename | $timestampclean > $tmpFile");
++ my $info = stat($tmpFile) or die "no $tmpFile: $!";
++ if ( ($status >>=8) == 0 && ( $info->size == 0) ) {
++ #print "diff worked size is 0\n";
++ $result = 1;
++ }
++ elsif ( ($status >>=8) == 0 && ( $info->size > 0) )
++ {
++ #print "diff worked size > 0\n";
++ $result = 0;
++ }
++ else
++ {
++ #print "diff failed size > 0\n";
++ $result = 0;
++ }
++ }
++ else
++ {
++ #print "not file > 0\n";
++ $result = 2;
++ }
++ #print "diff result = $result\n";
++ return $result;
++}
++
++if ( ! ( $logdir = shift @ARGV ) ) {
++ print STDERR "No logdir specified!\n";
++ usage();
++ exit 1;
++}
++
++if ( ! ( $testlogdir = shift @ARGV ) ) {
++ print STDERR "No testdocuments dir to compare against specified!\n";
++ usage();
++ exit 1;
++}
++
++if ( !(-d $logdir ) ) {
++ print STDERR "No output directory $logdir exists, please create it!!!!\n";
++ exit 1;
++}
++if ( !(-d $testlogdir ) ) {
++ print STDERR "the directory containing the logfiles to compare against \"$logdir\" does not exist\n";
++ usage();
++ exit 1;
++}
++print "logdir $logdir\n";
++print "testlogdir $testlogdir\n";
++sub filter_crud($)
++{
++ my $a = shift;
++
++ $a =~ /~$/ && return;
++ $a =~ /\#$/ && return;
++ $a =~ /\.orig$/ && return;
++ $a =~ /unxlng.*\.pro$/ && return;
++ $a =~ /wntmsc.*\.pro$/ && return;
++ $a =~ /.swp$/ && return;
++ $a =~ /POSITION/ && return;
++ $a =~ /ReadMe/ && return;
++ $a =~ /.tmp$/ && return;
++ $a =~ /\.svn/ && return;
++ $a eq 'CVS' && return;
++ $a eq '.' && return;
++ $a eq '..' && return;
++
++ return $a;
++}
++sub slurp_dir($);
++
++sub slurp_dir($)
++{
++ my $dir = shift;
++ my ($dirhandle, $fname);
++ my @files = ();
++
++ opendir ($dirhandle, $dir) || die "Can't open $dir";
++ while ($fname = readdir ($dirhandle)) {
++ $fname = filter_crud($fname);
++ defined $fname || next;
++# if (-d "$dir/$fname") {
++# push @files, slurp_dir("$dir/$fname");
++# } else
++ {
++ push @files, "$dir/$fname";
++ }
++ }
++ closedir ($dirhandle);
++
++ return @files;
++}
++
++if (-d $testlogdir) {
++ push @files, slurp_dir($testlogdir);
++}
++
++my $processed = 0;
++my $passed = 0;
++my @passedTests=();
++my @skippedTests=();
++my @failedTests=();
++
++my $failureCmd="";
++my $testfile = shift @ARGV;
++my $testfilepath = "$testlogdir/$testfile";
++$testfilepath =~ s/\.xls/\.log/;
++print "$testfilepath\n";
++for $a (@files) {
++ $filename = $a;
++ if ( "$testfilepath" eq "$filename" )
++ {
++ $processed++;
++ my $testcase = $a;
++ $testcase =~ s/\.log/\.xls/;
++ my $result = testLog( $a, $logdir );
++ if ( $result == 0 ) {
++ push @failedTests, basename($testcase);
++ if ( $failureCmd eq "" ) { $failureCmd = " diff -up $a $logdir "; }
++ }
++ elsif ( $result == 2 ) {
++ #print "skipped $a\n";
++ push @skippedTests, $testcase;
++ }
++ else {
++ $passed++;
++ push @passedTests, $testcase;
++ #print "Test document for $a \t \t passed. \n";
++ }
++ }
++}
++my $compared= passedTests+@failedTests;
++my $skip = @skippedTests;
++print "skipped $skip test-cases(s)\n";
++print "compared $compared test-case documents\n";
++print "\t \t $passed tests $ passedTests\n";
++if ( @failedTests > 0 ) {
++ print "the following test-case documents failed, please examine the logs manually\n";
++
++ for $a (@failedTests) {
++ print "\t$a\n";
++ }
++ print "e.g. $failureCmd\n"
++}
+Index: sc/source/ui/vba/testvba/testResults.pl
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/testvba/testResults.pl,v
+retrieving revision 1.2
+retrieving revision 1.2.42.1
+diff -u -p -b -w -B -r1.2 -r1.2.42.1
+--- sc/source/ui/vba/testvba/testResults.pl 7 Dec 2007 11:15:50 -0000 1.2
++++ sc/source/ui/vba/testvba/testResults.pl 29 Jul 2008 07:22:42 -0000 1.2.42.1
+@@ -1,5 +1,5 @@
+ #!/usr/bin/perl -w
+-
++use File::Temp qw/ tempfile tempdir /;
+ use File::Basename;
+ use File::stat;
+ use File::Copy;
+@@ -3,8 +3,9 @@
+ use File::Basename;
+ use File::stat;
+ use File::Copy;
++
+ my $binDir = dirname($0);
+-my $timestampclean= "$binDir/timestampsClean.pl";
++my $timestampclean= "perl $binDir/timestampsClean.pl";
+ #sub gen_diff($)
+
+ sub testLog
+@@ -19,8 +20,11 @@ sub testLog
+ $filename = "$logdir/$filename";
+ print "processing $testfile $filename\n";
+ if ( -f $filename ) {
+- #print "diffing\n";
+- my $tmpFile = "/tmp/gen_diff";
++ my $tmpFile;
++ $dir = tempdir( CLEANUP => 1 );
++ ($fh, $tmpFile) = tempfile( DIR => $dir );
++ close($fh);
++ #
+ my $status = system("diff -U 0 -p $testfile $filename | $timestampclean > $tmpFile");
+ my $info = stat($tmpFile) or die "no $tmpFile: $!";
+ if ( ($status >>=8) == 0 && ( $info->size == 0) ) {
+Index: sc/source/ui/vba/testvba/testvba.cxx
+===================================================================
+RCS file: sc/source/ui/vba/testvba/testvba.cxx
+diff -N sc/source/ui/vba/testvba/testvba.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/testvba.cxx 29 Jul 2008 07:22:42 -0000 1.1.2.1
+@@ -0,0 +1,309 @@
++#include "cppuhelper/bootstrap.hxx"
++
++#include <com/sun/star/beans/Property.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include <com/sun/star/beans/XPropertySetInfo.hpp>
++#include <com/sun/star/container/XNameAccess.hpp>
++#include <com/sun/star/container/XNameContainer.hpp>
++#include <com/sun/star/frame/XComponentLoader.hpp>
++#include <com/sun/star/lang/XMultiComponentFactory.hpp>
++#include <com/sun/star/sheet/XSpreadsheet.hpp>
++#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
++#include <com/sun/star/util/XCloseable.hpp>
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
++#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
++#include <com/sun/star/document/XTypeDetection.hpp>
++
++#include <tools/urlobj.hxx>
++#include <osl/file.hxx>
++
++#include <memory>
++#include <iostream>
++
++using namespace ::com::sun::star;
++using namespace ::com::sun::star::sheet;
++
++using ::com::sun::star::beans::Property;
++using ::com::sun::star::beans::PropertyValue;
++using ::com::sun::star::beans::XPropertySet;
++using ::com::sun::star::beans::XPropertySetInfo;
++using ::com::sun::star::container::XNameContainer;
++using ::com::sun::star::lang::XComponent;
++using ::com::sun::star::lang::XMultiComponentFactory;
++using ::com::sun::star::frame::XComponentLoader;
++using ::com::sun::star::uno::Reference;
++using ::com::sun::star::uno::Sequence;
++using ::com::sun::star::uno::UNO_QUERY;
++using ::com::sun::star::uno::UNO_QUERY_THROW;
++using ::com::sun::star::uno::XComponentContext;
++using ::com::sun::star::uno::XInterface;
++using ::com::sun::star::ucb::XSimpleFileAccess;
++using ::com::sun::star::document::XTypeDetection;
++using ::rtl::OUString;
++
++using ::std::auto_ptr;
++
++const OUString EXTN = rtl::OUString::createFromAscii(".xls");
++
++OUString convertToURL( const OUString& rPath )
++{
++ rtl::OUString aURL;
++ INetURLObject aObj;
++ aObj.SetURL( rPath );
++ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
++ if ( bIsURL )
++ aURL = rPath;
++ else
++ {
++ osl::FileBase::getFileURLFromSystemPath( rPath, aURL );
++ if ( aURL.equals( rPath ) )
++ throw uno::RuntimeException( rtl::OUString::createFromAscii( "could'nt convert " ).concat( rPath ).concat( rtl::OUString::createFromAscii( " to a URL, is it a fully qualified path name? " ) ), Reference< uno::XInterface >() );
++ }
++ return aURL;
++}
++
++OUString ascii(const sal_Char* cstr)
++{
++ return OUString::createFromAscii(cstr);
++}
++
++const sal_Char* getStr(const OUString& ou)
++{
++ return OUStringToOString(ou, RTL_TEXTENCODING_UTF8).getStr();
++}
++
++
++int usage( const char* pName )
++{
++ std::cerr << "usage: " << pName << "<path to testdocument dir> <output_directory>" << std::endl;
++ return 1;
++
++}
++
++class TestVBA
++{
++private:
++ Reference< XComponentContext > mxContext;
++ Reference< XMultiComponentFactory > mxMCF;
++ Reference< XComponentLoader > mxCompLoader;
++ Reference< XSimpleFileAccess > mxSFA;
++ rtl::OUString msOutDirPath;
++protected:
++public:
++ TestVBA( const Reference< XComponentContext >& _xContext,
++ const Reference< XMultiComponentFactory >& _xMCF,
++ const Reference< XComponentLoader >& _xCompLoader,
++ const rtl::OUString& _outDirPath ) : mxContext( _xContext ), mxMCF( _xMCF ),
++mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
++ {
++ mxSFA.set( mxMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), mxContext), uno::UNO_QUERY_THROW );
++ }
++
++ rtl::OUString getLogLocation() throw ( beans::UnknownPropertyException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::Exception )
++ {
++ rtl::OUString sLogLocation;
++ Reference< XPropertySet > pathSettings( mxMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.comp.framework.PathSettings" ), mxContext), uno::UNO_QUERY_THROW );
++ pathSettings->getPropertyValue( rtl::OUString::createFromAscii( "Work" ) ) >>= sLogLocation;
++ sLogLocation = sLogLocation.concat( rtl::OUString::createFromAscii( "/" ) ).concat( rtl::OUString::createFromAscii( "HelperAPI-test.log" ) );
++ return sLogLocation;
++ }
++ rtl::OUString getLogLocationWithName( OUString fileName ) throw ( beans::UnknownPropertyException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::Exception )
++ {
++ printf("%s\n", getenv("HOME") );
++ printf("file name %s\n", rtl::OUStringToOString( fileName, RTL_TEXTENCODING_UTF8 ).getStr() );
++ //rtl::OUString sLogLocation( rtl::OUString::createFromAscii( getenv("HOME") ) );
++ rtl::OUString sLogLocation;
++ Reference< XPropertySet > pathSettings( mxMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.comp.framework.PathSettings" ), mxContext), uno::UNO_QUERY_THROW );
++ pathSettings->getPropertyValue( rtl::OUString::createFromAscii( "Work" ) ) >>= sLogLocation;
++ sLogLocation = sLogLocation.concat( rtl::OUString::createFromAscii( "/" ) ).concat( fileName.copy ( 0, fileName.lastIndexOf( EXTN ) ) + rtl::OUString::createFromAscii( ".log" ) );
++ return sLogLocation;
++ }
++
++ void init()
++ {
++ // blow away previous logs?
++ }
++
++ void proccessDocument( const rtl::OUString& sUrl )
++ {
++ if ( !mxSFA->isFolder( sUrl ) && sUrl.endsWithIgnoreAsciiCaseAsciiL( ".xls", 4 ) )
++
++ {
++ try
++ {
++ OSL_TRACE( "processing %s", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
++ printf( "processing %s\n", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
++ // Loading the wanted document
++ Sequence< PropertyValue > propertyValues(1);
++ propertyValues[0].Name = rtl::OUString::createFromAscii( "Hidden" );
++ propertyValues[0].Value <<= sal_False;
++
++ rtl::OUString sfileUrl = convertToURL( sUrl );
++ printf( "try to get xDoc %s\n", rtl::OUStringToOString( sfileUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
++ Reference< uno::XInterface > xDoc =
++ mxCompLoader->loadComponentFromURL( sfileUrl, rtl::OUString::createFromAscii( "_blank" ), 0, propertyValues);
++ printf( "got xDoc\n" );
++
++ OUString logFileURL = convertToURL( getLogLocation() );
++ try
++ {
++ Reference< script::provider::XScriptProviderSupplier > xSupplier( xDoc, uno::UNO_QUERY_THROW ) ;
++ if ( mxSFA->exists( logFileURL ) )
++ mxSFA->kill( logFileURL );
++
++ printf("try to get the ScriptProvider\n");
++ Reference< script::provider::XScriptProvider > xProv = xSupplier->getScriptProvider();
++ printf("get the ScriptProvider\n");
++ printf("try to get the Script\n");
++ Reference< script::provider::XScript > xScript;
++ try
++ {
++ xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.TestMacros.Main?language=Basic&location=document" ));
++ } catch ( uno::Exception& e )
++ {
++ try
++ {
++ xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMacro.Main?language=Basic&location=document" ));
++ } catch ( uno::Exception& e2 )
++ {
++ xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMain.Main?language=Basic&location=document" ));
++ }
++ }
++ OSL_TRACE("Got script for doc %s", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
++ printf("get the Script\n");
++ Sequence< uno::Any > aArgs;
++ Sequence< sal_Int16 > aOutArgsIndex;
++ Sequence< uno::Any > aOutArgs;
++
++ xScript->invoke(aArgs, aOutArgsIndex, aOutArgs);
++
++ OUString fileName = sUrl.copy ( sUrl.lastIndexOf( '/' ) );
++ OUString newLocation = msOutDirPath + fileName.copy ( 0, fileName.lastIndexOf( EXTN ) ) + rtl::OUString::createFromAscii( ".log" );
++ try
++ {
++ printf("move log file\n");
++ mxSFA->move( logFileURL, newLocation );
++ OSL_TRACE("new logfile location is %s ", rtl::OUStringToOString( newLocation, RTL_TEXTENCODING_UTF8 ).getStr() );
++ printf("moved to new location\n");
++ }
++ catch ( uno::Exception& e )
++ {
++ logFileURL = convertToURL( getLogLocationWithName( fileName ) );
++ printf("move log file from %s\n", rtl::OUStringToOString( logFileURL, RTL_TEXTENCODING_UTF8 ).getStr() );
++ mxSFA->move( logFileURL, newLocation );
++ OSL_TRACE("new logfile location is %s ", rtl::OUStringToOString( newLocation, RTL_TEXTENCODING_UTF8 ).getStr() );
++ printf("moved to new location\n");
++ }
++
++ }
++ catch ( uno::Exception& e )
++ {
++ std::cerr << "Caught exception " << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() << std::endl;
++ }
++
++ // interface is supported, otherwise use XComponent.dispose
++ Reference< util::XCloseable > xCloseable ( xDoc, uno::UNO_QUERY );
++
++ if ( xCloseable.is() )
++ {
++ printf("try to close\n");
++ // will close application. and only run a test case for 3.0
++ // maybe it is a bug. yes, it is a bug
++ // if only one frame and model, click a button which related will colse.
++ // will make a crash. It related with window listener.
++ // so, for run all test cases, it should not close the document at this moment.
++ xCloseable->close(sal_False);
++ printf("closed\n");
++ }
++ else
++ {
++ printf("try to dispose\n");
++ Reference< XComponent > xComp( xDoc, uno::UNO_QUERY_THROW );
++ // same as close.
++ xComp->dispose();
++ printf("disposed\n");
++ }
++ }
++ catch( uno::Exception& e )
++ {
++ std::cerr << "Caught exception " << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() << std::endl;
++ }
++
++ }
++ printf("complete processing %s\n", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
++ }
++
++ void traverse( const rtl::OUString& sFileDirectory )
++ {
++ rtl::OUString sFileDirectoryURL = convertToURL( sFileDirectory );
++ if ( !mxSFA->isFolder( sFileDirectoryURL) )
++ {
++ throw lang::IllegalArgumentException( rtl::OUString::createFromAscii( "not a directory: ").concat( sFileDirectoryURL ), Reference<uno::XInterface>(), 1 );
++ }
++ // Getting all files and directories in the current directory
++ Sequence<OUString> entries = mxSFA->getFolderContents( sFileDirectoryURL, sal_False );
++
++ // Iterating for each file and directory
++ printf( "Entries %d\n", (int)entries.getLength() );
++ for ( sal_Int32 i = 0; i < entries.getLength(); ++i )
++ {
++ proccessDocument( entries[ i ] );
++ }
++ }
++};
++
++void tryDispose( Reference< uno::XInterface > xIF, const char* sComp )
++{
++ Reference< lang::XComponent > xComponent( xIF, uno::UNO_QUERY );
++ if ( xComponent.is() )
++ {
++ try
++ {
++ xComponent->dispose();
++ }
++ catch( uno::Exception& e )
++ {
++ std::cerr << "tryDispose caught exception " <<rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() << " while disposing " << sComp << std::endl;
++ }
++ }
++}
++int main( int argv, char** argc )
++{
++ if ( !( argv > 2 ) )
++ return usage( argc[0] );
++ try
++ {
++
++ OSL_TRACE("Attempting to bootstrap normal");
++ Reference<XComponentContext> xCC = ::cppu::bootstrap();
++ Reference<XMultiComponentFactory> xFactory = xCC->getServiceManager();
++ OSL_TRACE("got servicemanager");
++ std::cout << "got servicemanager" << std::endl;
++ Reference<XInterface> desktop = xFactory->createInstanceWithContext(
++ ascii("com.sun.star.frame.Desktop"), xCC);
++ OSL_TRACE("got desktop");
++ std::cout << "got desktop" << std::endl;
++ Reference<frame::XComponentLoader> xLoader(desktop, UNO_QUERY_THROW);
++ TestVBA* dTest = new TestVBA( xCC, xFactory, xLoader, ascii( argc[ 2 ] ) );
++ if ( argv == 4 )
++ {
++ std::cout << "before process" << std::endl;
++ dTest->proccessDocument( ascii( argc[ 3 ] ) );
++ std::cout << "after process" << std::endl;
++ }
++ else
++ {
++ dTest->traverse( ascii( argc[ 1 ] ) );
++ }
++ delete dTest;
++// tryDispose( xLoader, "desktop" );
++// tryDispose( xCC, "remote context" );
++
++ }
++ catch( uno::Exception& e )
++ {
++ std::cerr << "Caught Exception " << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() << std::endl;
++ }
++
++}
+cvs diff: Diffing sc/source/ui/vba/testvba/TestDocuments
+Index: sc/source/ui/vba/testvba/TestDocuments/AutoFilter.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/AutoFilter.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/AutoFilter.xls
+Binary files /dev/null and /tmp/cvs6sa4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/MiscRangeTests.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/MiscRangeTests.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/MiscRangeTests.xls
+Binary files /dev/null and /tmp/cvs7sa4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/PageBreaks.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/PageBreaks.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/PageBreaks.xls
+Binary files /dev/null and /tmp/cvs8sa4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls
+Binary files /dev/null and /tmp/cvs9sa4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/Ranges-2.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/Ranges-2.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/Ranges-2.xls
+Binary files /dev/null and /tmp/cvs.sa4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/Ranges-3.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/Ranges-3.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/Ranges-3.xls
+Binary files /dev/null and /tmp/cvs_sa4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/Ranges.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/Ranges.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/Ranges.xls
+Binary files /dev/null and /tmp/cvsata4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/Shapes.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/Shapes.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/Shapes.xls
+Binary files /dev/null and /tmp/cvsbta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/StrConv-test.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/StrConv-test.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/StrConv-test.xls
+Binary files /dev/null and /tmp/cvscta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/Template.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/Template.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/Template.xls
+Binary files /dev/null and /tmp/cvsdta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls
+Binary files /dev/null and /tmp/cvseta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest.xls
+Binary files /dev/null and /tmp/cvsfta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest2.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest2.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest2.xls
+Binary files /dev/null and /tmp/cvsgta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/Window.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/Window.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/Window.xls
+Binary files /dev/null and /tmp/cvshta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/bytearraystring.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/bytearraystring.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/bytearraystring.xls
+Binary files /dev/null and /tmp/cvsita4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/dateserial.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/dateserial.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/dateserial.xls
+Binary files /dev/null and /tmp/cvsjta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/datevalue.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/datevalue.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/datevalue.xls
+Binary files /dev/null and /tmp/cvskta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/format.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/format.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/format.xls
+Binary files /dev/null and /tmp/cvslta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/partition.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/partition.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/partition.xls
+Binary files /dev/null and /tmp/cvsmta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/range-4.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/range-4.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/range-4.xls
+Binary files /dev/null and /tmp/cvsnta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/replace.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/replace.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/replace.xls
+Binary files /dev/null and /tmp/cvsota4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/stringplusdouble.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/stringplusdouble.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/stringplusdouble.xls
+Binary files /dev/null and /tmp/cvspta4KP differ
+Index: sc/source/ui/vba/testvba/TestDocuments/window2.xls
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/window2.xls
+diff -N sc/source/ui/vba/testvba/TestDocuments/window2.xls
+Binary files /dev/null and /tmp/cvsqta4KP differ
+cvs diff: Diffing sc/source/ui/vba/testvba/TestDocuments/logs
+cvs diff: Diffing sc/source/ui/vba/testvba/TestDocuments/logs/excel
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/AutoFilter.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/AutoFilter.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/AutoFilter.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/AutoFilter.log 29 Jul 2008 07:22:50 -0000 1.1.2.2
+@@ -0,0 +1,20 @@
++Test run started : 17/07/2007 17:36:22
++----------------------------------------------------------------
++TestAddress
++ TEST START : TestAddress
++ ITEM Assertion OK : test1 'starts with' string criteria
++ ITEM Assertion OK : test2 'not equal to' string criteria
++ ITEM Assertion OK : test3 'ends with' string criteria
++ ITEM Assertion OK : test4 field 'all'
++ ITEM Assertion OK : test5 numeric '<15'
++ ITEM Assertion OK : test6 numeric '>=15'
++ ITEM Assertion OK : test7 numeric '<=12'
++Test Results
++============
++
++Tests passed: 7
++Tests failed: 0
++
++END 'TestAddress
++ TEST OK : TestAddress
++Test run finished : 17/07/2007 17:36:23
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/MiscRangeTests.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/MiscRangeTests.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/MiscRangeTests.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/MiscRangeTests.log 29 Jul 2008 07:22:51 -0000 1.1.2.2
+@@ -0,0 +1,45 @@
++Test run started : 17/07/2007 15:01:37
++----------------------------------------------------------------
++MiscRangeTests
++ TEST START : MiscRangeTests
++ ITEM Assertion OK : test 1
++ ITEM Assertion OK : test 2
++ ITEM Assertion OK : test 3
++ ITEM Assertion OK : test 4
++ ITEM Assertion OK : test 5
++ ITEM Assertion OK : test 6
++ ITEM Assertion OK : test 7
++ ITEM Assertion OK : test 8
++ ITEM Assertion OK : test 9
++ ITEM Assertion OK : test 10
++ ITEM Assertion OK : test 11
++ ITEM Assertion OK : test 12
++ ITEM Assertion OK : test 13
++ ITEM Assertion OK : test 14
++ ITEM Assertion OK : test 15
++ ITEM Assertion OK : test 16
++ ITEM Assertion OK : test 17
++ ITEM Assertion OK : test 18
++ ITEM Assertion OK : test 19
++ ITEM Assertion OK : test 20
++ ITEM Assertion OK : test 21
++ ITEM Assertion OK : test 22
++ ITEM Assertion OK : test 23
++ ITEM Assertion OK : test 24
++ ITEM Assertion OK : test 25
++ ITEM Assertion OK : test 26
++ ITEM Assertion OK : test 27
++ ITEM Assertion OK : test 28
++ ITEM Assertion OK : test 29
++ ITEM Assertion OK : test 30
++ ITEM Assertion OK : test 31
++No. tests: 31
++Summary
++=======
++Run: 31
++Passed: 31
++Failed: 0
++
++END 'MiscRangeTests
++ TEST OK : MiscRangeTests
++Test run finished : 17/07/2007 15:01:39
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-2.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-2.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-2.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-2.log 29 Jul 2008 07:22:51 -0000 1.1.2.2
+@@ -0,0 +1,68 @@
++Test run started : 18/06/2007 17:50:04
++----------------------------------------------------------------
++ClearFormtsIssue
++ TEST START : ClearFormtsIssue
++ ITEM Assertion OK : Range.Font.Bold is: True
++ ITEM Assertion OK : Range.Font.Bold is: False
++END 'ClearFormtsIssue' Symbol
++ TEST OK : ClearFormtsIssue
++----------------------------------------------------------------
++VerticalAlignment-Issue
++ TEST START : VerticalAlignment-Issue
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : Range.VeritcalAlignment is Null
++END 'VerticalAlignment-Issue' Symbol
++ TEST OK : VerticalAlignment-Issue
++----------------------------------------------------------------
++HorizontalAlignment-Issue
++ TEST START : HorizontalAlignment-Issue
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : Range.HorizontalAlignment is Null
++END 'HorizontalAlignment-Issue' Symbol
++ TEST OK : HorizontalAlignment-Issue
++----------------------------------------------------------------
++WrapText-Issue
++ TEST START : WrapText-Issue
++ ITEM Assertion OK : - Range.WrapText (get)
++ ITEM Assertion OK : - Range.WrapText (get)
++ ITEM Assertion OK : Range.WrapText is Null
++END 'WrapText-Issue' Symbol
++ TEST OK : WrapText-Issue
++----------------------------------------------------------------
++FontBorderIssues
++ TEST START : FontBorderIssues
++ ITEM Assertion OK : - = Borders.Color (getColor)
++ ITEM Assertion OK : - = Font.Color (getColor)
++END 'FontBorderIssues' Symbol
++ TEST OK : FontBorderIssues
++----------------------------------------------------------------
++RangeSizeIssues
++ TEST START : RangeSizeIssues
++ ITEM Assertion OK : Range.Left is: 114
++ ITEM Assertion OK : Range.Top is: 95.25
++ ITEM Assertion OK : Range.Width is: 216
++ ITEM Assertion OK : Range.Height is: 271.5
++END 'RangeSizeIssues' Symbol
++ TEST OK : RangeSizeIssues
++----------------------------------------------------------------
++ApplicationIssues
++ TEST START : ApplicationIssues
++ ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1
++END 'ApplicationIssues' Symbol
++ TEST OK : ApplicationIssues
++Test run finished : 18/06/2007 17:50:04
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-3.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-3.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-3.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-3.log 29 Jul 2008 07:22:51 -0000 1.1.2.2
+@@ -0,0 +1,8 @@
++Test run started : 19/06/2007 11:21:42
++----------------------------------------------------------------
++MyGoalseek-Issue
++ TEST START : MyGoalseek-Issue
++ ITEM Assertion OK : Variable Range value: 15
++END 'MyGoalseek-Issue' Symbol
++ TEST OK : MyGoalseek-Issue
++Test run finished : 19/06/2007 11:21:42
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges.log 29 Jul 2008 07:22:51 -0000 1.1.2.2
+@@ -0,0 +1,280 @@
++Test run started : 01/06/2007 11:28:58
++----------------------------------------------------------------
++ApplicationMethods
++ TEST START : ApplicationMethods
++ ITEM Assertion OK : Name of Workbook is: Ranges.xls
++ ITEM Assertion OK : Address of Application.Columns is: $A:$A
++ ITEM Assertion OK : Address of Application.Rows is: $1:$1
++ ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7
++ ITEM Assertion OK : Please check manually: DefaultFilePath is: C:\Documents and Settings\vituosity\My Documents
++ ITEM Assertion OK : Please check manually: Library Path is: C:\Program Files\Microsoft Office\OFFICE11\LIBRARY
++ ITEM Assertion OK : Please check manually: Template Path is: C:\Documents and Settings\vituosity\Application Data\Microsoft\Templates\
++ ITEM Assertion OK : FileSeparator is \
++ ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls
++END 'ApplicationMethods' Symbol
++ TEST OK : ApplicationMethods
++----------------------------------------------------------------
++Insert-Issue
++ TEST START : Insert-Issue
++ ITEM Assertion OK : Insert with xlShiftToRight: 10
++END 'Insert-Issue' Symbol
++ TEST OK : Insert-Issue
++----------------------------------------------------------------
++MergeCells-Issue
++ TEST START : MergeCells-Issue
++ ITEM Assertion OK : Range.MergeCells is True
++ ITEM Assertion OK : MergeCells is null: True
++ ITEM Assertion OK : RowCount after Merge: 6
++ ITEM Assertion OK : Range.MergeCells is False
++ ITEM Assertion OK : MergeCells is null: False
++ ITEM Assertion OK : MergeCells of Second Area is null : True
++ ITEM Assertion OK : MergeCells of Ranges is Null: True
++ ITEM Assertion OK : RowCount after Merge: 7
++ ITEM Assertion OK : Range.MergeCells is False
++ ITEM Assertion OK : MergeCells is null: False
++ ITEM Assertion OK : RowCount after Merge: 7
++END 'MergeCells-Issue' Symbol
++ TEST OK : MergeCells-Issue
++----------------------------------------------------------------
++Areas-Issue
++ TEST START : Areas-Issue
++ ITEM Assertion OK : Range Areas Count is2
++ ITEM Assertion OK : First Range Address is: $E$8:$G$13
++ ITEM Assertion OK : First Row is: 8
++ ITEM Assertion OK : First Column is: 5
++ ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19
++ ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K
++ ITEM Assertion OK : Range Count:53
++END 'Areas-Issue' Symbol
++ TEST OK : Areas-Issue
++----------------------------------------------------------------
++Fill-Methods-Issue
++ TEST START : Fill-Methods-Issue
++ ITEM Assertion OK : Range Value after FillDown: MyFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyRightFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue
++END 'Fill-Methods-Issue' Symbol
++ TEST OK : Fill-Methods-Issue
++----------------------------------------------------------------
++Range/Item-Method-Issue
++ TEST START : Range/Item-Method-Issue
++ ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C
++ ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7
++ ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D
++ ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10
++ ITEM Assertion OK : Range of several single cells is: $C$5,$E$8
++ ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range of a single Item Cell is: $E$21
++ ITEM Assertion OK : Range of a single Item Cell is: $F$21
++ ITEM Assertion OK : Range of a single Item Cell is: $F$10
++END 'Range/Item-Method-Issue' Symbol
++ TEST OK : Range/Item-Method-Issue
++----------------------------------------------------------------
++R1C1-Formulas-Issue
++ TEST START : R1C1-Formulas-Issue
++ ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"")
++ ITEM Assertion OK : Range.Formula is: =IF(OR(J8=0,K10="YES"),"")
++END 'R1C1-Formulas-Issue' Symbol
++ TEST OK : R1C1-Formulas-Issue
++----------------------------------------------------------------
++Verify_Delete
++ TEST START : Verify_Delete
++ ITEM Assertion OK : Ranges are intersecting: $G$13
++ ITEM Assertion OK : Delete with Default: $AJ$4
++ ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4
++ ITEM Assertion OK : Delete with ShiftUp: $M$22
++END 'Verify_Delete' Symbol
++ TEST OK : Verify_Delete
++----------------------------------------------------------------
++Value-Issue
++ TEST START : Value-Issue
++ ITEM Assertion OK : Value of Range is: 12.3
++ ITEM Assertion OK : Text of Range is: 12.3
++ ITEM Assertion OK : Range has Formula: False
++ ITEM Assertion OK : Cell has Formula: False
++ ITEM Assertion OK : Text of Range is null: True
++ ITEM Assertion OK : Range has Formula: True
++ ITEM Assertion OK : Cell has Formula: True
++ ITEM Assertion OK : Value of Cell is: 12
++ ITEM Assertion OK : Application.Calculation is : -4135
++ ITEM Assertion OK : Calculation is automated: True
++ ITEM Assertion OK : Range has Formula: True
++ ITEM Assertion OK : Value of Cell is: 16
++ ITEM Assertion OK : Text of Cell is: 16
++ ITEM Assertion OK : Text of Cell is: 16
++ ITEM Assertion OK : Range has Formula after 'ClearContents: False
++ ITEM Assertion OK : Text of Cell is:
++ ITEM Assertion OK : Text of Cell is:
++END 'Value-Issue' Symbol
++ TEST OK : Value-Issue
++----------------------------------------------------------------
++AutoFit issue
++ TEST START : AutoFit issue
++ ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 673
++ ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 612
++END 'AutoFit issue' Symbol
++ TEST OK : AutoFit issue
++----------------------------------------------------------------
++Selections
++ TEST START : Selections
++ ITEM Assertion OK : ActiveCell is : $E$8
++ ITEM Assertion OK : Active Cell is : $E$8
++ ITEM Assertion OK : Number of Cells in Range: 53
++ ITEM Assertion OK : Number of Cells in Range: 53
++ ITEM Assertion OK : Number of Cells in Range: 53
++END 'Selections' Symbol
++ TEST OK : Selections
++----------------------------------------------------------------
++Offset-Resize
++ TEST START : Offset-Resize
++ ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21
++ ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18
++ ITEM Assertion OK : Resized Range is : $A$20:$D$23
++END 'Offset-Resize' Symbol
++ TEST OK : Offset-Resize
++----------------------------------------------------------------
++Ranges-Address
++ TEST START : Ranges-Address
++ ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19
++ ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19
++ ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19
++END 'Ranges-Address' Symbol
++ TEST OK : Ranges-Address
++----------------------------------------------------------------
++Range-Address
++ TEST START : Range-Address
++ ITEM Assertion OK : Range Address is: $E$8:$G$13
++ ITEM Assertion OK : Range Address is: $E8:$G13
++ ITEM Assertion OK : Range Address is: E$8:G$13
++ ITEM Assertion OK : Range Address is: R8C5:R13C7
++ ITEM Assertion OK : Range Address is: $E$8:$G$13
++ ITEM Assertion OK : Range Address is: R8C5:R13C7
++ ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13
++END 'Range-Address' Symbol
++ TEST OK : Range-Address
++----------------------------------------------------------------
++Column-Address
++ TEST START : Column-Address
++ ITEM Assertion OK : Range Address is: $F$8:$F$13
++ ITEM Assertion OK : Range Address is: $F8:$F13
++ ITEM Assertion OK : Range Address is: F$8:F$13
++ ITEM Assertion OK : Range Address is: R8C6:R13C6
++ ITEM Assertion OK : Range Address is: $F$8:$F$13
++ ITEM Assertion OK : Range Address is: R8C6:R13C6
++ ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13
++END 'Column-Address' Symbol
++ TEST OK : Column-Address
++----------------------------------------------------------------
++Row-Address
++ TEST START : Row-Address
++ ITEM Assertion OK : Range Address is: $E$9:$G$9
++ ITEM Assertion OK : Range Address is: $E9:$G9
++ ITEM Assertion OK : Range Address is: E$9:G$9
++ ITEM Assertion OK : Range Address is: R9C5:R9C7
++ ITEM Assertion OK : Range Address is: $E$9:$G$9
++ ITEM Assertion OK : Range Address is: R9C5:R9C7
++ ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9
++END 'Row-Address' Symbol
++ TEST OK : Row-Address
++----------------------------------------------------------------
++SingleCell-Address
++ TEST START : SingleCell-Address
++ ITEM Assertion OK : Range Address is: $F$9
++ ITEM Assertion OK : Range Address is: $F9
++ ITEM Assertion OK : Range Address is: F$9
++ ITEM Assertion OK : Range Address is: R9C6
++ ITEM Assertion OK : Range Address is: $F$9
++ ITEM Assertion OK : Range Address is: R9C6
++ ITEM Assertion OK : Range Address is: R[7]C[4]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9
++END 'SingleCell-Address' Symbol
++ TEST OK : SingleCell-Address
++----------------------------------------------------------------
++Heights and Widths
++ TEST START : Heights and Widths
++ ITEM Assertion OK : Range RowHeight is 40
++ ITEM Assertion OK : Range ColumnWidth is 50
++ ITEM Assertion OK : Range Height is 238
++ ITEM Assertion OK : Range Width is 798.75
++ ITEM Assertion OK : Range RowHeight is 50
++ ITEM Assertion OK : Range ColumnWidth is 50
++ ITEM Assertion OK : Range Height is 297
++ ITEM Assertion OK : Range Width is 798.75
++ ITEM Assertion OK : RowHeight is null: True
++ ITEM Assertion OK : ColumnWidth is null: True
++END 'Heights and Widths' Symbol
++ TEST OK : Heights and Widths
++----------------------------------------------------------------
++RangeRowColumn-Issue
++ TEST START : RangeRowColumn-Issue
++ ITEM Assertion OK : Row is: 8
++ ITEM Assertion OK : Column is: 5
++ ITEM Assertion OK : EntireRow.Columns.Count = 256
++ ITEM Assertion OK : EntireColumn.Rows.Count = 65536
++END 'RangeRowColumn-Issue' Symbol
++ TEST OK : RangeRowColumn-Issue
++----------------------------------------------------------------
++Replace-Issue
++ TEST START : Replace-Issue
++ ITEM Assertion OK : Value after Replace: YourValue
++ ITEM Assertion OK : Value after Replace: YourValue
++ ITEM Assertion OK : Value after Replace: ReplaceValue
++ ITEM Assertion OK : Value after Replace: New ReplaceValue
++ ITEM Assertion OK : Value after Replace: New ReplaceValue
++ ITEM Assertion OK : Value after Replace: New Replace
++ ITEM Assertion OK : Value after Replace:
++END 'Replace-Issue' Symbol
++ TEST OK : Replace-Issue
++----------------------------------------------------------------
++Hidden-Issue
++ TEST START : Hidden-Issue
++ ITEM Assertion OK : - Range.Rows.Hidden (set)
++ ITEM Assertion OK : - Range.Rows.Hidden (get)
++ ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set)
++ ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get)
++ ITEM Assertion OK : - Range.Columns.Hidden (set)
++ ITEM Assertion OK : - Range.Columns.Hidden (get)
++ ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set)
++ ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get)
++END 'Hidden-Issue' Symbol
++ TEST OK : Hidden-Issue
++----------------------------------------------------------------
++End issue
++ TEST START : End issue
++ ITEM Assertion OK : - = $E$48
++ ITEM Assertion OK : - = $E$1
++ ITEM Assertion OK : - = $E$3
++ ITEM Assertion OK : - = $A$8
++ ITEM Assertion OK : - = $B$8
++ ITEM Assertion OK : - = $IV$8
++ ITEM Assertion OK : - = $Z$8
++END 'End issue' Symbol
++ TEST OK : End issue
++----------------------------------------------------------------
++Outline issue
++ TEST START : Outline issue
++ ITEM Assertion OK : - Range.clearOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++END 'Outline issue' Symbol
++ TEST OK : Outline issue
++----------------------------------------------------------------
++Validation
++ TEST START : Validation
++ ITEM Assertion OK : Validation Input Message is : Attention!
++ ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten
++ ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten
++ ITEM Assertion OK : Validation Error Message is : An Error occured
++ ITEM Assertion OK : Validation Error Title is : Microsoft Excel
++END 'Validation' Symbol
++ TEST OK : Validation
++Test run finished : 01/06/2007 11:29:00
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestAddress.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestAddress.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestAddress.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestAddress.log 29 Jul 2008 07:22:52 -0000 1.1.2.2
+@@ -0,0 +1,62 @@
++Test run started : 17/07/2007 15:25:17
++----------------------------------------------------------------
++TestAddress
++ TEST START : TestAddress
++ ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing
++ ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing
++ ITEM Assertion OK : test3 Range ('e:f') A1 style addressing
++ ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing
++ ITEM Assertion OK : test5 Columns A1 style addressing
++ ITEM Assertion OK : test6 Columns R1C1 style addressing
++ ITEM Assertion OK : test7 Columns(3) A1 style addressing
++ ITEM Assertion OK : test8 Columns(3) R1C1 style addressing
++ ITEM Assertion OK : test9 Columns('e') A1 style addressing
++ ITEM Assertion OK : test10 Columns('e') R1C1 style addressing
++ ITEM Assertion OK : test11 Columns('b:d') A1 style addressing
++ ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing
++ ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing
++ ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing
++ ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing
++ ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing
++ ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing
++ ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing
++ ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing
++ ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing
++ ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing
++ ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing
++ ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing
++ ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing
++ ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing
++ ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false
++ ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false
++ ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing
++ ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing
++ ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing
++ ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing
++ ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing
++ ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing
++ ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing
++ ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing
++ ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing
++ ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing
++ ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing
++ ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing
++ ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing
++ ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing
++ ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c')
++ ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f')
++ ITEM Assertion OK : test44 Range('g20:h40').Columns(-1)
++ ITEM Assertion OK : test45 Range('c4:g10').Rows(-1)
++ ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1')
++ ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2')
++ ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2')
++ ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3')
++Test Results
++============
++
++Tests passed: 49
++Tests failed: 0
++
++END 'TestAddress
++ TEST OK : TestAddress
++Test run finished : 17/07/2007 15:25:19
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest.log 29 Jul 2008 07:22:52 -0000 1.1.2.2
+@@ -0,0 +1,60 @@
++Test run started : 30/05/2007 11:33:13
++BEGIN TestCalc
++ TEST START : RangeTest2
++ ITEM Assertion OK : - Range("D15").Row
++ ITEM Assertion OK : - WorkSheet("D15").Range.Row
++ ITEM Assertion OK : - Range("D15").Column
++ ITEM Assertion OK : - Worksheet.Range("D15").Column
++ ITEM Assertion OK : - Range("D1").EntireRow.Valuer
++ ITEM Assertion OK : - Range("D1").EntireRow.Valuer
++ ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count
++ ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count
++ ITEM Assertion OK : - Range("D15").ClearContent
++ ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get)
++ ITEM Assertion OK : - Range("B38").Orientation (get)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical)
++ ITEM Assertion OK : - Range("B39").WrapText (get)
++ ITEM Assertion OK : - Range("B39").WrapText (set)
++ ITEM Assertion OK : - Range("B39").WrapText (set)
++ ITEM Assertion OK : - Range("E39").MergeCells (get)
++ ITEM Assertion OK : - Range("F39").MergeCells (get)
++ ITEM Assertion OK : - Range("E39").MergeCells (set)
++ ITEM Assertion OK : - Range("F39").MergeCells (set)
++ ITEM Assertion OK : - Range("E39").MergeCells (set)
++ ITEM Assertion OK : - Range("F39").MergeCells (set)
++ ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True
++ ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True
++ ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM OK (RangeTest2)
++ TEST succesfully completed : RangeTest2
++END TestCalc
++Test run finished : 30/05/2007 11:33:14
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest2.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest2.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest2.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest2.log 29 Jul 2008 07:22:52 -0000 1.1.2.2
+@@ -0,0 +1,64 @@
++Test run started : 31/05/2007 11:02:10
++BEGIN TestCalc
++ TEST START : RangeTest3
++ ITEM Assertion OK : - setFormulaR1C1
++ ITEM Assertion OK : - getFormulaR1C1
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy(Range("I10"))
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats
++ ITEM Assertion OK : PasteSpecial
++ ITEM Assertion OK : PasteSpecial SkipBlanks:=True
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide
++ ITEM Assertion OK : PasteSpecial Transpose:=True
++ ITEM Assertion OK : ActiveWorkbook.Name
++ ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path
++ ITEM Assertion OK : - = Range("K22").End (xlDown)
++ ITEM Assertion OK : - = Range("K22").End (xlUo)
++ ITEM Assertion OK : - = Range("K22").End (xlToLeft)
++ ITEM Assertion OK : - = Range("K22").End (xlRight)
++ ITEM Assertion OK : - ActiveSpreadsheet.Next
++ ITEM Assertion OK : - ActiveSpreadsheet.Next
++ ITEM Assertion OK : - ActiveSpreadsheet.Previous
++ ITEM Assertion OK : - ActiveSpreadsheet.Previous
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x"
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>"
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="="
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter
++ ITEM Assertion OK : - ActiveSheet.Resize.Select
++ ITEM Assertion OK : - Application.GoTo Reference:="R8C2"
++ ITEM Assertion OK : - Application.GoTo Reference:="R[8]C[2]"
++ ITEM Assertion OK : - Application.GoTo Reference:="R8C2"
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Ungroup- please check visually
++ ITEM Assertion OK : - Range.Ungroup - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.clearOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - ActiveSheet.UsedRange.Select
++ ITEM Assertion FAIL : - Range("A13").AddIndent
++ ITEM Assertion OK : - Range("A13").IndentLevel set
++ ITEM Assertion OK : - Range("A13").IndentLevel get
++ ITEM Assertion OK : - Range("A13").IndentLevel get
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Calculate
++ ITEM Assertion OK : Worksheet.Calculate
++ ITEM Assertion OK : - Application.Calculate
++ ITEM Assertion OK : Global.Calculate
++ ITEM Assertion OK : Calculation set
++ ITEM Assertion OK : - = ActiveWorkbook.Colors(3) set
++ ITEM Assertion OK : - = ActiveWorkbook.ResetColors
++ ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get
++ ITEM FAIL (RangeTest3)
++ TEST Not succesfully completed : RangeTest3
++END TestCalc
++Test run finished : 31/05/2007 11:02:12
+cvs diff: Diffing sc/source/ui/vba/testvba/TestDocuments/logs/unix
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/AutoFilter.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/AutoFilter.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/AutoFilter.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/AutoFilter.log 28 Jan 2008 17:30:46 -0000 1.1.2.1
+@@ -0,0 +1,20 @@
++Test run started : 18/07/2007 10:56:38
++----------------------------------------------------------------
++TestAddress
++ TEST START : TestAddress
++ ITEM Assertion OK : test1 'starts with' string criteria
++ ITEM Assertion OK : test2 'not equal to' string criteria
++ ITEM Assertion OK : test3 'ends with' string criteria
++ ITEM Assertion OK : test4 field 'all'
++ ITEM Assertion OK : test5 numeric '<15'
++ ITEM Assertion OK : test6 numeric '>=15'
++ ITEM Assertion OK : test7 numeric '<=12'
++Test Results
++============
++
++Tests passed: 7
++Tests failed: 0
++
++END 'TestAddress
++ TEST OK : TestAddress
++Test run finished : 18/07/2007 10:56:44
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/MiscRangeTests.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/MiscRangeTests.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/MiscRangeTests.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/MiscRangeTests.log 28 Jan 2008 17:30:46 -0000 1.1.2.1
+@@ -0,0 +1,45 @@
++Test run started : 17/07/2007 20:54:56
++----------------------------------------------------------------
++MiscRangeTests
++ TEST START : MiscRangeTests
++ ITEM Assertion OK : test 1
++ ITEM Assertion OK : test 2
++ ITEM Assertion OK : test 3
++ ITEM Assertion OK : test 4
++ ITEM Assertion OK : test 5
++ ITEM Assertion OK : test 6
++ ITEM Assertion OK : test 7
++ ITEM Assertion OK : test 8
++ ITEM Assertion OK : test 9
++ ITEM Assertion OK : test 10
++ ITEM Assertion OK : test 11
++ ITEM Assertion OK : test 12
++ ITEM Assertion OK : test 13
++ ITEM Assertion OK : test 14
++ ITEM Assertion OK : test 15
++ ITEM Assertion OK : test 16
++ ITEM Assertion OK : test 17
++ ITEM Assertion OK : test 18
++ ITEM Assertion OK : test 19
++ ITEM Assertion OK : test 20
++ ITEM Assertion OK : test 21
++ ITEM Assertion OK : test 22
++ ITEM Assertion OK : test 23
++ ITEM Assertion OK : test 24
++ ITEM Assertion OK : test 25
++ ITEM Assertion OK : test 26
++ ITEM Assertion OK : test 27
++ ITEM Assertion OK : test 28
++ ITEM Assertion OK : test 29
++ ITEM Assertion OK : test 30
++ ITEM Assertion OK : test 31
++No. tests: 31
++Summary
++=======
++Run: 31
++Passed: 31
++Failed: 0
++
++END 'MiscRangeTests
++ TEST OK : MiscRangeTests
++Test run finished : 17/07/2007 20:55:03
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/PageBreaks.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/PageBreaks.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/PageBreaks.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/PageBreaks.log 29 Jul 2008 07:22:53 -0000 1.1.2.1
+@@ -0,0 +1,10 @@
++Test run started : 07/24/2008 05:06:12 PM
++----------------------------------------------------------------
++ TEST START : PageBreaks-Issue
++ ITEM Assertion OK : HPageBreaks.Count is 3
++ ITEM Assertion OK : HPageBreak.Type is -4135
++ ITEM Assertion OK : HPageBreak.Location: Range.Row is 5
++ ITEM Assertion OK : HPageBreak.Delete: HPageBreaks.Count is 2
++END 'PageBreaks-Issue' Symbol
++ TEST OK : PageBreaks-Issue
++Test run finished : 07/24/2008 05:06:13 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-2.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-2.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-2.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-2.log 28 Jan 2008 17:30:46 -0000 1.1.2.1
+@@ -0,0 +1,68 @@
++Test run started : 19/06/2007 11:14:01
++----------------------------------------------------------------
++ClearFormtsIssue
++ TEST START : ClearFormtsIssue
++ ITEM Assertion OK : Range.Font.Bold is: True
++ ITEM Assertion OK : Range.Font.Bold is: False
++END 'ClearFormtsIssue' Symbol
++ TEST OK : ClearFormtsIssue
++----------------------------------------------------------------
++VerticalAlignment-Issue
++ TEST START : VerticalAlignment-Issue
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : Range.VeritcalAlignment is Null
++END 'VerticalAlignment-Issue' Symbol
++ TEST OK : VerticalAlignment-Issue
++----------------------------------------------------------------
++HorizontalAlignment-Issue
++ TEST START : HorizontalAlignment-Issue
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : Range.HorizontalAlignment is Null
++END 'HorizontalAlignment-Issue' Symbol
++ TEST OK : HorizontalAlignment-Issue
++----------------------------------------------------------------
++WrapText-Issue
++ TEST START : WrapText-Issue
++ ITEM Assertion OK : - Range.WrapText (get)
++ ITEM Assertion OK : - Range.WrapText (get)
++ ITEM Assertion OK : Range.WrapText is Null
++END 'WrapText-Issue' Symbol
++ TEST OK : WrapText-Issue
++----------------------------------------------------------------
++FontBorderIssues
++ TEST START : FontBorderIssues
++ ITEM Assertion OK : - = Borders.Color (getColor)
++ ITEM Assertion OK : - = Font.Color (getColor)
++END 'FontBorderIssues' Symbol
++ TEST OK : FontBorderIssues
++----------------------------------------------------------------
++RangeSizeIssues
++ TEST START : RangeSizeIssues
++ ITEM Assertion OK : Range.Left is: 118.8432
++ ITEM Assertion OK : Range.Top is: 92.16585
++ ITEM Assertion OK : Range.Width is: 226.2
++ ITEM Assertion OK : Range.Height is: 271.5
++END 'RangeSizeIssues' Symbol
++ TEST OK : RangeSizeIssues
++----------------------------------------------------------------
++ApplicationIssues
++ TEST START : ApplicationIssues
++ ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1
++END 'ApplicationIssues' Symbol
++ TEST OK : ApplicationIssues
++Test run finished : 19/06/2007 11:14:02
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-3.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-3.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-3.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-3.log 28 Jan 2008 17:30:46 -0000 1.1.2.1
+@@ -0,0 +1,8 @@
++Test run started : 19/06/2007 11:26:09
++----------------------------------------------------------------
++MyGoalseek-Issue
++ TEST START : MyGoalseek-Issue
++ ITEM Assertion OK : Variable Range value: 15
++END 'MyGoalseek-Issue' Symbol
++ TEST OK : MyGoalseek-Issue
++Test run finished : 19/06/2007 11:26:10
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log 29 Jul 2008 07:22:53 -0000 1.1.2.2
+@@ -0,0 +1,280 @@
++Test run started : 10/03/2008 15:15:11
++----------------------------------------------------------------
++ApplicationMethods
++ TEST START : ApplicationMethods
++ ITEM Assertion OK : Name of Workbook is: Ranges.xls
++ ITEM Assertion OK : Address of Application.Columns is: $A:$A
++ ITEM Assertion OK : Address of Application.Rows is: $1:$1
++ ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7
++ ITEM Assertion OK : Please check manually: DefaultFilePath is: /data4/home/npower/Documents
++ ITEM Assertion OK : Please check manually: Library Path is: /data4/home/npower/.ooo-2.0/user/basic
++ ITEM Assertion OK : Please check manually: Template Path is: /data4/home/npower/.ooo-2.0/user/template
++ ITEM Assertion OK : FileSeparator is /
++ ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls
++END 'ApplicationMethods' Symbol
++ TEST OK : ApplicationMethods
++----------------------------------------------------------------
++Insert-Issue
++ TEST START : Insert-Issue
++ ITEM Assertion OK : Insert with xlShiftToRight: 10
++END 'Insert-Issue' Symbol
++ TEST OK : Insert-Issue
++----------------------------------------------------------------
++MergeCells-Issue
++ TEST START : MergeCells-Issue
++ ITEM Assertion OK : Range.MergeCells is True
++ ITEM Assertion FAIL : MergeCells is null: False
++ ITEM Assertion OK : RowCount after Merge: 13
++ ITEM Assertion OK : Range.MergeCells is False
++ ITEM Assertion OK : MergeCells is null: False
++ ITEM Assertion FAIL : MergeCells of Second Area is null : False
++ ITEM Assertion FAIL : MergeCells of Ranges is Null: False
++ ITEM Assertion OK : RowCount after Merge: 7
++ ITEM Assertion OK : Range.MergeCells is False
++ ITEM Assertion OK : MergeCells is null: False
++ ITEM Assertion OK : RowCount after Merge: 7
++END 'MergeCells-Issue' Symbol
++ TEST OK : MergeCells-Issue
++----------------------------------------------------------------
++Areas-Issue
++ TEST START : Areas-Issue
++ ITEM Assertion OK : Range Areas Count is2
++ ITEM Assertion OK : First Range Address is: $E$8:$G$13
++ ITEM Assertion OK : First Row is: 8
++ ITEM Assertion OK : First Column is: 5
++ ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19
++ ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K
++ ITEM Assertion OK : Range Count:53
++END 'Areas-Issue' Symbol
++ TEST OK : Areas-Issue
++----------------------------------------------------------------
++Fill-Methods-Issue
++ TEST START : Fill-Methods-Issue
++ ITEM Assertion OK : Range Value after FillDown: MyFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyRightFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue
++END 'Fill-Methods-Issue' Symbol
++ TEST OK : Fill-Methods-Issue
++----------------------------------------------------------------
++Range/Item-Method-Issue
++ TEST START : Range/Item-Method-Issue
++ ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C
++ ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7
++ ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D
++ ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10
++ ITEM Assertion OK : Range of several single cells is: $C$5,$E$8
++ ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range of a single Item Cell is: $E$21
++ ITEM Assertion OK : Range of a single Item Cell is: $F$21
++ ITEM Assertion OK : Range of a single Item Cell is: $F$10
++END 'Range/Item-Method-Issue' Symbol
++ TEST OK : Range/Item-Method-Issue
++----------------------------------------------------------------
++R1C1-Formulas-Issue
++ TEST START : R1C1-Formulas-Issue
++ ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"")
++ ITEM Assertion OK : Range.Formula is: =IF(OR(J8=0,K10="YES"),"")
++END 'R1C1-Formulas-Issue' Symbol
++ TEST OK : R1C1-Formulas-Issue
++----------------------------------------------------------------
++Verify_Delete
++ TEST START : Verify_Delete
++ ITEM Assertion OK : Ranges are intersecting: $G$13
++ ITEM Assertion OK : Delete with Default: $AJ$4
++ ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4
++ ITEM Assertion OK : Delete with ShiftUp: $M$22
++END 'Verify_Delete' Symbol
++ TEST OK : Verify_Delete
++----------------------------------------------------------------
++Value-Issue
++ TEST START : Value-Issue
++ ITEM Assertion OK : Value of Range is: 12.3
++ ITEM Assertion OK : Text of Range is: 12.3
++ ITEM Assertion OK : Range has Formula: False
++ ITEM Assertion OK : Cell has Formula: False
++ ITEM Assertion FAIL : Text of Range is null: False
++ ITEM Assertion OK : Range has Formula: True
++ ITEM Assertion OK : Cell has Formula: True
++ ITEM Assertion OK : Value of Cell is: 12
++ ITEM Assertion OK : Application.Calculation is : -4135
++ ITEM Assertion OK : Calculation is automated: True
++ ITEM Assertion OK : Range has Formula: True
++ ITEM Assertion OK : Value of Cell is: 16
++ ITEM Assertion OK : Text of Cell is: 16
++ ITEM Assertion OK : Text of Cell is: 16
++ ITEM Assertion OK : Range has Formula after 'ClearContents: False
++ ITEM Assertion OK : Text of Cell is:
++ ITEM Assertion OK : Text of Cell is:
++END 'Value-Issue' Symbol
++ TEST OK : Value-Issue
++----------------------------------------------------------------
++AutoFit issue
++ TEST START : AutoFit issue
++ ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 680
++ ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 554
++END 'AutoFit issue' Symbol
++ TEST OK : AutoFit issue
++----------------------------------------------------------------
++Selections
++ TEST START : Selections
++ ITEM Assertion OK : ActiveCell is : $E$8
++ ITEM Assertion OK : Active Cell is : $E$8
++ ITEM Assertion OK : Number of Cells in Range: 52
++ ITEM Assertion OK : Number of Cells in Range: 52
++ ITEM Assertion OK : Number of Cells in Range: 52
++END 'Selections' Symbol
++ TEST OK : Selections
++----------------------------------------------------------------
++Offset-Resize
++ TEST START : Offset-Resize
++ ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21
++ ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18
++ ITEM Assertion OK : Resized Range is : $A$20:$D$23
++END 'Offset-Resize' Symbol
++ TEST OK : Offset-Resize
++----------------------------------------------------------------
++Ranges-Address
++ TEST START : Ranges-Address
++ ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19
++ ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19
++ ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion FAIL : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19
++END 'Ranges-Address' Symbol
++ TEST OK : Ranges-Address
++----------------------------------------------------------------
++Range-Address
++ TEST START : Range-Address
++ ITEM Assertion OK : Range Address is: $E$8:$G$13
++ ITEM Assertion OK : Range Address is: $E8:$G13
++ ITEM Assertion OK : Range Address is: E$8:G$13
++ ITEM Assertion OK : Range Address is: R8C5:R13C7
++ ITEM Assertion FAIL : Range Address is: R8C5:R13C7
++ ITEM Assertion OK : Range Address is: R8C5:R13C7
++ ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13
++END 'Range-Address' Symbol
++ TEST OK : Range-Address
++----------------------------------------------------------------
++Column-Address
++ TEST START : Column-Address
++ ITEM Assertion OK : Range Address is: $F$8:$F$13
++ ITEM Assertion OK : Range Address is: $F8:$F13
++ ITEM Assertion OK : Range Address is: F$8:F$13
++ ITEM Assertion OK : Range Address is: R8C6:R13C6
++ ITEM Assertion FAIL : Range Address is: R8C6:R13C6
++ ITEM Assertion OK : Range Address is: R8C6:R13C6
++ ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13
++END 'Column-Address' Symbol
++ TEST OK : Column-Address
++----------------------------------------------------------------
++Row-Address
++ TEST START : Row-Address
++ ITEM Assertion OK : Range Address is: $E$9:$G$9
++ ITEM Assertion OK : Range Address is: $E9:$G9
++ ITEM Assertion OK : Range Address is: E$9:G$9
++ ITEM Assertion OK : Range Address is: R9C5:R9C7
++ ITEM Assertion FAIL : Range Address is: R9C5:R9C7
++ ITEM Assertion OK : Range Address is: R9C5:R9C7
++ ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9
++END 'Row-Address' Symbol
++ TEST OK : Row-Address
++----------------------------------------------------------------
++SingleCell-Address
++ TEST START : SingleCell-Address
++ ITEM Assertion OK : Range Address is: $F$9
++ ITEM Assertion OK : Range Address is: $F9
++ ITEM Assertion OK : Range Address is: F$9
++ ITEM Assertion OK : Range Address is: R9C6
++ ITEM Assertion FAIL : Range Address is: R9C6
++ ITEM Assertion OK : Range Address is: R9C6
++ ITEM Assertion OK : Range Address is: R[7]C[4]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9
++END 'SingleCell-Address' Symbol
++ TEST OK : SingleCell-Address
++----------------------------------------------------------------
++Heights and Widths
++ TEST START : Heights and Widths
++ ITEM Assertion OK : Range RowHeight is 40
++ ITEM Assertion OK : Range ColumnWidth is 50
++ ITEM Assertion OK : Range Height is 240
++ ITEM Assertion OK : Range Width is 795
++ ITEM Assertion OK : Range RowHeight is 50
++ ITEM Assertion OK : Range ColumnWidth is 50
++ ITEM Assertion OK : Range Height is 300
++ ITEM Assertion OK : Range Width is 795
++ ITEM Assertion OK : RowHeight is null: True
++ ITEM Assertion OK : ColumnWidth is null: True
++END 'Heights and Widths' Symbol
++ TEST OK : Heights and Widths
++----------------------------------------------------------------
++RangeRowColumn-Issue
++ TEST START : RangeRowColumn-Issue
++ ITEM Assertion OK : Row is: 8
++ ITEM Assertion OK : Column is: 5
++ ITEM Assertion OK : EntireRow.Columns.Count = 256
++ ITEM Assertion OK : EntireColumn.Rows.Count = 131072
++END 'RangeRowColumn-Issue' Symbol
++ TEST OK : RangeRowColumn-Issue
++----------------------------------------------------------------
++Replace-Issue
++ TEST START : Replace-Issue
++ ITEM Assertion OK : Value after Replace: YourValue
++ ITEM Assertion OK : Value after Replace: YourValue
++ ITEM Assertion OK : Value after Replace: ReplaceValue
++ ITEM Assertion OK : Value after Replace: New ReplaceValue
++ ITEM Assertion OK : Value after Replace: New ReplaceValue
++ ITEM Assertion OK : Value after Replace: New Replace
++ ITEM Assertion OK : Value after Replace:
++END 'Replace-Issue' Symbol
++ TEST OK : Replace-Issue
++----------------------------------------------------------------
++Hidden-Issue
++ TEST START : Hidden-Issue
++ ITEM Assertion OK : - Range.Rows.Hidden (set)
++ ITEM Assertion OK : - Range.Rows.Hidden (get)
++ ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set)
++ ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get)
++ ITEM Assertion OK : - Range.Columns.Hidden (set)
++ ITEM Assertion OK : - Range.Columns.Hidden (get)
++ ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set)
++ ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get)
++END 'Hidden-Issue' Symbol
++ TEST OK : Hidden-Issue
++----------------------------------------------------------------
++End issue
++ TEST START : End issue
++ ITEM Assertion OK : - = $E$48
++ ITEM Assertion OK : - = $E$1
++ ITEM Assertion OK : - = $E$3
++ ITEM Assertion OK : - = $A$8
++ ITEM Assertion OK : - = $B$8
++ ITEM Assertion OK : - = $IV$8
++ ITEM Assertion OK : - = $Z$8
++END 'End issue' Symbol
++ TEST OK : End issue
++----------------------------------------------------------------
++Outline issue
++ TEST START : Outline issue
++ ITEM Assertion OK : - Range.clearOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++END 'Outline issue' Symbol
++ TEST OK : Outline issue
++----------------------------------------------------------------
++Validation
++ TEST START : Validation
++ ITEM Assertion OK : Validation Input Message is : Attention!
++ ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten
++ ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten
++ ITEM Assertion OK : Validation Error Message is : An Error occured
++ ITEM Assertion OK : Validation Error Title is : Microsoft Excel
++END 'Validation' Symbol
++ TEST OK : Validation
++Test run finished : 10/03/2008 15:15:13
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Shapes.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Shapes.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/Shapes.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/Shapes.log 28 Jan 2008 17:30:46 -0000 1.1.2.1
+@@ -0,0 +1,77 @@
++Test run started : 10/16/2007 05:25:21 PM
++BEGIN Shapes_Collection_Behaviour
++ TEST START : Shapes_Collection_Behaviour
++ ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape1'
++ ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape2'
++ TEST Success. : Shapes_Collection_Behaviour
++END Shapes_Collection_Behaviour
++BEGIN Shapes_Select_Item
++ TEST START : Shapes_Select_Item
++ ITEM Assertion OK : Correctly selected shape through Range
++ ITEM Assertion OK : Correctly selected shape through Item
++ ITEM Assertion OK : Needs to be visually checked. Is there a line on the document?
++ ITEM Assertion OK : Needs to be visually checked. Are All Shapes Selected?
++ TEST Success. : Shapes_Select_Item
++END Shapes_Select_Item
++BEGIN Shapes_Fill
++ TEST START : Shapes_Fill
++ ITEM Assertion OK : correctly set visibility of shape fill
++ ITEM Assertion OK : correctly set transparency of shape line
++ ITEM Assertion OK : correctly set forecolor of shape fill
++ ITEM Assertion FAIL : correctly set backcolor of shape fill
++ ITEM Assertion OK : the success of the TwoColorGradient method needs to be verified visually!
++ ITEM Assertion OK : correctly set forecolor of shape fill
++ ITEM Assertion FAIL : correctly set forecolor of shape fill
++ TEST Success. : Shapes_Fill
++END Shapes_Fill
++BEGIN Shapes_Line
++ TEST START : Shapes_Line
++ ITEM Assertion FAIL : correctly set weight of shape line
++ ITEM Assertion OK : correctly set visibility of shape line
++ ITEM Assertion OK : correctly set transparency of shape line
++ ITEM Assertion OK : correctly set dash style of shape line
++ ITEM Assertion OK : correctly set dash style of shape line
++ ITEM Assertion OK : correctly set forecolor of shape line
++ ITEM Assertion FAIL : correctly set backcolor of shape line
++ TEST Success. : Shapes_Line
++END Shapes_Line
++BEGIN Shapes_TextFrame
++ TEST START : Shapes_TextFrame
++ ITEM Assertion OK : correctly set Autosize of Shape TextFrame
++ TEST Success. : Shapes_TextFrame
++END Shapes_TextFrame
++BEGIN Shapes_SimpleGeometry
++ TEST START : Shapes_SimpleGeometery
++ ITEM Assertion OK : shape height should be 47.0425168477155 and got 46.9984222363199
++ ITEM Assertion OK : shape width should be 101.467710269751 and got 101.423615658355
++ ITEM Assertion OK : shape left should be 68.5574761223637 and got 68.5417279658754
++ ITEM Assertion OK : shape top should be 42.0251943291216 and got 42.0094461726333
++ ITEM Assertion OK : shape rotation should be 0 and got 0
++ ITEM Assertion OK : shape rotation should be 25 and got 25
++ ITEM Assertion OK : shape incrementrotation should be 50 and got 50
++ ITEM Assertion OK : shape incrementleft should be 70.6834602404119 and got 70.6677120839236
++ ITEM Assertion OK : shape incrementtop should be 91.262986503119 and got 91.2472383466307
++ TEST Success. : Shapes_SimpleGeometery
++END Shapes_SimpleGeometry
++BEGIN Shapes_Range
++ TEST START : Shapes_Range
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to contain 1 element, it contains 1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to return Sheet2Shape1 got Sheet2Shape1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to contain 1 element, it contains 1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to return Sheet2Shape3 got Sheet2Shape3
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to contain 2 elements, it contains 2
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to return concated element/shape names Sheet2Shape3Sheet2Shape1 and got Sheet2Shape3Sheet2Shape1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to contain 3 elements, it contains 3
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to return concated element/shape names Sheet2Shape3Sheet2Shape1Sheet2Shape2 and got Sheet2Shape3Sheet2Shape1Sheet2Shape2
++ TEST Success. : Shapes_Range
++END Shapes_Range
++BEGIN Shapes_ShapeRange
++ TEST START : Shapes_ShapeRange
++ ITEM Assertion OK : ShapeRange.IncrementLeft shp1.left should be 90.6677120839236 and got 90.6519627935771
++ ITEM Assertion OK : ShapeRange.IncrementLeft shp2.left should be 240.02518299054 and got 240.009433700193
++ ITEM Assertion OK : ShapeRange.IncrementTop shp1.Top should be 111.247238346631 and got 111.231489056284
++ ITEM Assertion OK : ShapeRange.IncrementTop shp2.Top should be 65.0708633026228 and got 65.0551140122763
++ ITEM Assertion OK : ShapeRange.IncrementRotation shp1.Rotation should be 70 and got 70
++ ITEM Assertion OK : ShapeRange.IncrementRotation shp2.Rotation should be 20 and got 20
++END Shapes_ShapeRange
++Test run finished : 10/16/2007 05:25:22 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/StrConv-test.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/StrConv-test.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/StrConv-test.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/StrConv-test.log 29 Jul 2008 07:22:53 -0000 1.1.2.1
+@@ -0,0 +1,9 @@
++Test run started : 05/29/2008 02:51:03 PM
++BEGIN StrConv
++ TEST START : Test StrConv function
++ ITEM Assertion OK : Converts the string to uppercase characters:ABC EFG HIJ
++ ITEM Assertion OK : Converts the string to lowercase characters:abc efg hij
++ ITEM Assertion OK : Converts the first letter of every word in string to uppercase:Abc Efg Hij
++ TEST OK : Test StrConv function
++END StrConv
++Test run finished : 05/29/2008 02:51:03 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Template.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Template.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/Template.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/Template.log 29 Jul 2008 07:22:53 -0000 1.1.2.1
+@@ -0,0 +1,14 @@
++Test run started : 2008ï07ï10 11:57:05
++----------------------------------------------------------------
++TestCaseName
++ TEST START : TestCaseName
++ ITEM Assertion OK : Something has been done.
++Test Results
++============
++
++Tests passed: 1
++Tests failed: 0
++
++END 'TestCaseName
++ TEST OK : TestCaseName
++Test run finished : 2008ï07ï10 11:57:05
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log 28 Jan 2008 17:30:46 -0000 1.1.2.1
+@@ -0,0 +1,62 @@
++Test run started : 17/07/2007 20:56:04
++----------------------------------------------------------------
++TestAddress
++ TEST START : TestAddress
++ ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing
++ ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing
++ ITEM Assertion OK : test3 Range ('e:f') A1 style addressing
++ ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing
++ ITEM Assertion OK : test5 Columns A1 style addressing
++ ITEM Assertion OK : test6 Columns R1C1 style addressing
++ ITEM Assertion OK : test7 Columns(3) A1 style addressing
++ ITEM Assertion OK : test8 Columns(3) R1C1 style addressing
++ ITEM Assertion OK : test9 Columns('e') A1 style addressing
++ ITEM Assertion OK : test10 Columns('e') R1C1 style addressing
++ ITEM Assertion OK : test11 Columns('b:d') A1 style addressing
++ ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing
++ ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing
++ ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing
++ ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing
++ ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing
++ ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing
++ ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing
++ ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing
++ ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing
++ ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing
++ ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing
++ ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing
++ ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing
++ ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing
++ ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false
++ ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false
++ ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing
++ ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing
++ ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing
++ ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing
++ ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing
++ ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing
++ ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing
++ ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing
++ ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing
++ ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing
++ ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing
++ ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing
++ ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing
++ ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing
++ ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c')
++ ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f')
++ ITEM Assertion OK : test44 Range('g20:h40').Columns(-1)
++ ITEM Assertion OK : test45 Range('c4:g10').Rows(-1)
++ ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1')
++ ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2')
++ ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2')
++ ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3')
++Test Results
++============
++
++Tests passed: 49
++Tests failed: 0
++
++END 'TestAddress
++ TEST OK : TestAddress
++Test run finished : 17/07/2007 20:56:05
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest.log 28 Jan 2008 17:30:46 -0000 1.1.2.1
+@@ -0,0 +1,60 @@
++Test run started : 30/05/2007 15:59:40
++BEGIN TestCalc
++ TEST START : RangeTest2
++ ITEM Assertion OK : - Range("D15").Row
++ ITEM Assertion OK : - WorkSheet("D15").Range.Row
++ ITEM Assertion OK : - Range("D15").Column
++ ITEM Assertion OK : - Worksheet.Range("D15").Column
++ ITEM Assertion OK : - Range("D1").EntireRow.Valuer
++ ITEM Assertion OK : - Range("D1").EntireRow.Valuer
++ ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count
++ ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count
++ ITEM Assertion OK : - Range("D15").ClearContent
++ ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get)
++ ITEM Assertion OK : - Range("B38").Orientation (get)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical)
++ ITEM Assertion OK : - Range("B39").WrapText (get)
++ ITEM Assertion OK : - Range("B39").WrapText (set)
++ ITEM Assertion OK : - Range("B39").WrapText (set)
++ ITEM Assertion OK : - Range("E39").MergeCells (get)
++ ITEM Assertion OK : - Range("F39").MergeCells (get)
++ ITEM Assertion OK : - Range("E39").MergeCells (set)
++ ITEM Assertion FAIL : - Range("F39").MergeCells (set)
++ ITEM Assertion OK : - Range("E39").MergeCells (set)
++ ITEM Assertion OK : - Range("F39").MergeCells (set)
++ ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True
++ ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True
++ ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM FAIL (RangeTest2)
++ TEST Not succesfully completed : RangeTest2
++END TestCalc
++Test run finished : 30/05/2007 15:59:42
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest2.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest2.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest2.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest2.log 29 Jul 2008 07:22:54 -0000 1.1.2.2
+@@ -0,0 +1,65 @@
++Test run started : 10/03/2008 15:15:19
++BEGIN TestCalc
++ TEST START : RangeTest3
++ ITEM Assertion OK : - setFormulaR1C1
++ ITEM Assertion OK : - getFormulaR1C1
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy(Range("I10"))
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats
++ ITEM Assertion OK : PasteSpecial
++ ITEM Assertion OK : PasteSpecial SkipBlanks:=True
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide
++ ITEM Assertion OK : PasteSpecial Transpose:=True
++ ITEM Assertion FAIL : ActiveWorkbook.FileFormat
++ ITEM Assertion OK : ActiveWorkbook.Name
++ ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path
++ ITEM Assertion FAIL : - = ActiveWorkbook.Colors(3) set
++ ITEM Assertion OK : - = ActiveWorkbook.ResetColors
++ ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get
++ ITEM Assertion OK : - = Range("K22").End (xlDown)
++ ITEM Assertion OK : - = Range("K22").End (xlUo)
++ ITEM Assertion OK : - = Range("K22").End (xlToLeft)
++ ITEM Assertion OK : - = Range("K22").End (xlRight)
++ ITEM Assertion OK : - ActiveSpreadsheet.Next
++ ITEM Assertion OK : - ActiveSpreadsheet.Next
++ ITEM Assertion OK : - ActiveSpreadsheet.Previous
++ ITEM Assertion OK : - ActiveSpreadsheet.Previous
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x"
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>"
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="="
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter
++ ITEM Assertion OK : - ActiveSheet.Resize.Select
++ ITEM Assertion OK : - Application.GoTo Reference:="R8C2"
++ ITEM Assertion FAIL : - Application.GoTo Reference:="R[8]C[2]"
++ ITEM Assertion OK : - Application.GoTo Reference:="R8C2"
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Ungroup- please check visually
++ ITEM Assertion OK : - Range.Ungroup - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.clearOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - ActiveSheet.UsedRange.Select
++ ITEM Assertion OK : - Range("A13").AddIndent
++ ITEM Assertion OK : - Range("A13").IndentLevel set
++ ITEM Assertion OK : - Range("A13").IndentLevel get
++ ITEM Assertion OK : - Range("A13").IndentLevel get
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Calculate
++ ITEM Assertion OK : Worksheet.Calculate
++ ITEM Assertion OK : - Application.Calculate
++ ITEM Assertion OK : Global.Calculate
++ ITEM Assertion OK : Calculation set
++ ITEM FAIL (RangeTest3)
++ TEST Not succesfully completed : RangeTest3
++END TestCalc
++Test run finished : 10/03/2008 15:15:21
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Window.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/Window.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/Window.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/Window.log 29 Jul 2008 07:22:54 -0000 1.1.2.1
+@@ -0,0 +1,46 @@
++Test run started : 05/29/2008 02:55:00 PM
++----------------------------------------------------------------
++ TEST START : Window-Issue
++ ITEM Assertion OK : Window.Left is: 0 (Test only applies to maximized Window)
++ ITEM Assertion OK : Window.Top is: 21 (Test only applies to maximized Window)
++ ITEM Assertion OK : Window.Width is: 1280 (Test only applies to maximized Window)
++ ITEM Assertion OK : Window.Height is: 752 (Test only applies to maximized Window)
++ ITEM Assertion OK : Window.ScrollColumn is: 100
++ ITEM Assertion OK : Window.ScrollColumn is: 1
++ ITEM Assertion OK : Window.ScrollRow is: 100
++ ITEM Assertion OK : Window.ScrollRow is: 1
++ ITEM Assertion OK : Window.LargeScroll(Down): ScrollRow is: 94 (Test may only apply to maximized Window)
++ ITEM Assertion OK : Window.LargeScroll(Up): ScrollRow is: 1
++ ITEM Assertion OK : Window.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window)
++ ITEM Assertion OK : Window.LargeScroll(ToLeft): ScrollColumn is: 1
++ ITEM Assertion OK : Window.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window)
++ ITEM Assertion OK : Window.SmallScroll(ToLeft): ScrollColumn is: 1
++ ITEM Assertion OK : Window.DisplayWorkBookTabs is: False
++ ITEM Assertion OK : Window.DisplayWorkBookTabs is: True
++ ITEM Assertion OK : Window.DisplayVerticalScrollBar is: True
++ ITEM Assertion OK : Window.DisplayVerticalScrollBar is: False
++ ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: False
++ ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: True
++ ITEM Assertion OK : Window.DisplayHeadings is: False
++ ITEM Assertion OK : Window.DisplayHeadings is: True
++ ITEM Assertion OK : Window.DisplayOutline is: False
++ ITEM Assertion OK : Window.DisplayOutline is: True
++ ITEM Assertion OK : Window.Visible is: False
++ ITEM Assertion OK : Window.Visible is: True
++ ITEM Assertion OK : Window.Caption is: MyCaption
++ ITEM Assertion OK : Pane.ScrollColumn is: 100
++ ITEM Assertion OK : Pane.ScrollColumn is: 1
++ ITEM Assertion OK : Pane.ScrollRow is: 100
++ ITEM Assertion OK : Pane.ScrollRow is: 1
++ ITEM Assertion OK : Pane.LargeScroll(Down): ScrollRow is: 94 (Test may only apply to maximized Window)
++ ITEM Assertion OK : Pane.LargeScroll(Up): ScrollRow is: 1
++ ITEM Assertion OK : Pane.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window)
++ ITEM Assertion OK : Pane.LargeScroll(ToLeft): ScrollColumn is: 1
++ ITEM Assertion OK : Pane.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window)
++ ITEM Assertion OK : Pane.SmallScroll(ToLeft): ScrollColumn is: 1
++ ITEM Assertion OK : Window Selection: $A$2:$D$5
++ ITEM Assertion OK : ActiveSheet name of Window: Sheet1
++ ITEM Assertion OK : Window ActiveCell: $A$1
++END 'Window-Issue' Symbol
++ TEST OK : Window-Issue
++Test run finished : 05/29/2008 02:55:01 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/bytearraystring.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/bytearraystring.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/bytearraystring.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/bytearraystring.log 29 Jul 2008 07:22:55 -0000 1.1.2.1
+@@ -0,0 +1,8 @@
++Test run started : 05/29/2008 02:25:58 PM
++BEGIN Bytearray To String
++ TEST START : Test the conversion between bytearray and string
++ ITEM Assertion OK : The number of byte is:6
++ ITEM Assertion OK : the return string is: abc
++ TEST OK : Test the conversion between bytearray and string
++END Bytearray To String
++Test run finished : 05/29/2008 02:25:58 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/dateserial.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/dateserial.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/dateserial.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/dateserial.log 29 Jul 2008 07:22:55 -0000 1.1.2.1
+@@ -0,0 +1,9 @@
++Test run started : 01/24/2008 01:24:50 PM
++BEGIN DateSerial
++ TEST START : Test DateSerial function
++ ITEM Assertion OK : the return date is: 06/15/1999
++ ITEM Assertion OK : the return date is: 06/15/1999
++ ITEM Assertion OK : the return date is: 06/15/1999
++ TEST OK : Test DateSerial function
++END DateSerial
++Test run finished : 01/24/2008 01:24:50 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/datevalue.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/datevalue.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/datevalue.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/datevalue.log 29 Jul 2008 07:22:55 -0000 1.1.2.1
+@@ -0,0 +1,8 @@
++Test run started : 01/24/2008 01:24:41 PM
++BEGIN DateValue
++ TEST START : Test DateValue function
++ ITEM Assertion OK : the return date is: 02/12/1969
++ ITEM Assertion OK : the return date is: 01/21/2008
++ TEST OK : Test DateValue function
++END DateValue
++Test run finished : 01/24/2008 01:24:41 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log 29 Jul 2008 07:22:56 -0000 1.1.2.1
+@@ -0,0 +1,82 @@
++Test run started : 01/29/2008 02:38:27 PM
++BEGIN Format
++ TEST START : Test Predefined_Datetime_Format_Sample function
++ ITEM Assertion OK : General Date: 1/6/98
++ ITEM Assertion OK : Long Date: Tuesday, January 06, 1998
++ ITEM Assertion FAIL : Medium Date: 06-Jan-1998
++ ITEM Assertion OK : Short Date: 1/6/98
++ ITEM Assertion FAIL : Long Time: 05:08:06 PM
++ ITEM Assertion OK : Medium Time: 05:08 PM
++ ITEM Assertion OK : Short Time: 17:08
++ TEST OK : Test Predefined_Datetime_Format_Sample function
++ TEST START : Test Predefined_Number_Format_Sample function
++ ITEM Assertion OK : General Number: 562486.2356
++ ITEM Assertion OK : General Number: -3456.789
++ ITEM Assertion OK : General Number: 213.21
++ ITEM Assertion OK : Currency: $562,486.24
++ ITEM Assertion OK : Fixed: 0.20
++ ITEM Assertion OK : Standard: 562,486.24
++ ITEM Assertion OK : Percent: 75.21%
++ ITEM Assertion OK : Scientific: 5.62E+05
++ ITEM Assertion OK : Scientific: -3.46E+03
++ ITEM Assertion OK : Yes/No: No
++ ITEM Assertion OK : Yes/No: Yes
++ ITEM Assertion OK : True/False: False
++ ITEM Assertion OK : True/False: True
++ ITEM Assertion OK : On/Off: Off
++ ITEM Assertion OK : On/Off: On
++ TEST OK : Test Predefined_Number_Format_Sample function
++ TEST START : Test Custom_Datetime_Format_Sample function
++ ITEM Assertion FAIL : c: 1/6/98 05:08:06 PM
++ ITEM Assertion OK : dddddd: Tuesday, January 06, 1998
++ ITEM Assertion OK : mm-dd-yyyy: 01-06-1998
++ ITEM Assertion OK : d: 6
++ ITEM Assertion OK : dd: 06
++ ITEM Assertion OK : ddd: Tue
++ ITEM Assertion OK : dddd: Tuesday
++ ITEM Assertion OK : ddddd: 1/6/98
++ ITEM Assertion OK : h: 5
++ ITEM Assertion OK : hh: 05
++ ITEM Assertion OK : n: 8
++ ITEM Assertion OK : nn: 08
++ ITEM Assertion OK : m: 1
++ ITEM Assertion OK : mm: 01
++ ITEM Assertion OK : mmm: Jan
++ ITEM Assertion OK : mmmm: January
++ ITEM Assertion FAIL : q: Q1
++ ITEM Assertion OK : s: 6
++ ITEM Assertion OK : ss: 06
++ ITEM Assertion FAIL : ttttt: 05:08:06 AM
++ ITEM Assertion OK : hh:mm:ss AM/PM: 05:08:06 PM
++ ITEM Assertion FAIL : hh:mm:ss am/pm: 05:08:06 PM
++ ITEM Assertion FAIL : hh:mm:ss A/P: 05:08:06 p
++ ITEM Assertion OK : hh:mm:ss a/p: 05:08:06 p
++ ITEM Assertion OK : hh:mm:ss: 17:08:06
++ ITEM Assertion OK : ww: 2
++ ITEM Assertion OK : w: 3
++ ITEM Assertion OK : y: 6
++ ITEM Assertion OK : yy: 98
++ ITEM Assertion OK : yyyy: 1998
++ TEST OK : Test Custom_Datetime_Format_Sample function
++ TEST START : Test Custom_Number_Format_Sample function
++ ITEM Assertion OK : 00.0000: 23.6750
++ ITEM Assertion OK : 00.00: 23.68
++ ITEM Assertion OK : 00000: 02658
++ ITEM Assertion OK : 00.00: 2658.00
++ ITEM Assertion OK : ##.####: 23.675
++ ITEM Assertion OK : ##.##: 23.68
++ ITEM Assertion OK : #,###.##: 12,345.25
++ ITEM Assertion OK : ##.00%: 25.00%
++ ITEM Assertion OK : #,###: 1,000,000
++ ITEM Assertion OK : ######E-###: 109838E-5
++ ITEM Assertion OK : $#,###.##: $2,345.25
++ ITEM Assertion OK : ##.###\%: .25%
++ TEST OK : Test Custom_Number_Format_Sample function
++ TEST START : Test Custom_Text_Format_Sample function
++ ITEM Assertion FAIL : \* \*@@@@@: *VBA*VBAVBAVBAVBAVBA
++ ITEM Assertion FAIL : \*&&\*&&&&: VBA
++ ITEM Assertion OK : <: vba
++ ITEM Assertion OK : >: VBA
++ TEST OK : Test Custom_Text_Format_Sample function
++END Format
++Test run finished : 01/29/2008 02:38:27 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/pagesetup.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/pagesetup.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/pagesetup.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/pagesetup.log 29 Jul 2008 07:22:56 -0000 1.1.2.1
+@@ -0,0 +1,77 @@
++Test run started : 07/21/2008 02:00:06 PM
++BEGIN PageSetup
++ TEST START : Sheet_PrintArea
++ ITEM Assertion OK : PrintArea has changed as expected
++ TEST OK : Sheet_PrintArea
++ TEST START : Test margins (no headers)
++ ITEM Assertion OK : PageSetup.LeftMargin set/get
++ ITEM Assertion OK : PageSetup.RightMargin set/get
++ ITEM Assertion OK : PageSetup.TopMargin set/get
++ ITEM Assertion OK : PageSetup.BottomMargin set/get
++Verify that page margins on sheet 1 are all 0.5inch
++ TEST OK : Test margins (no headers)
++ TEST START : Test margins (headers)
++ ITEM Assertion OK : PageSetup.HeaderMargin set/get
++ ITEM Assertion OK : PageSetup.FooterMargin set/get
++ ITEM Assertion OK : PageSetup.LeftMargin set/get
++ ITEM Assertion OK : PageSetup.LeftMargin set/get
++Verify that top/bottom/header/footer page margins on sheet 2 are all 0.5inch
++ TEST OK : Test margins (headers)
++ TEST START : Test header/footer text
++ ITEM Assertion OK : PageSetup.LeftHeader set
++ ITEM Assertion OK : PageSetup.LeftHeader set/get
++ ITEM Assertion OK : PageSetup.CenterHeader set
++ ITEM Assertion OK : PageSetup.CenterHeader set/get
++ ITEM Assertion OK : PageSetup.RightHeader set
++ ITEM Assertion OK : PageSetup.RightHeader set/get
++ ITEM Assertion OK : PageSetup.LeftFooter set
++ ITEM Assertion OK : PageSetup.LeftFooter set/get
++ ITEM Assertion OK : PageSetup.CenterFooter set
++ ITEM Assertion OK : PageSetup.CenterFooter set/get
++ ITEM Assertion OK : PageSetup.RightFooter set
++ ITEM Assertion OK : PageSetup.RightFooter set/get
++Verify that headers on sheet 2 are Ready,to,go
++Verify that footers on sheet 2 are This,now,Works
++ TEST OK : Test header/footer text
++ TEST START : Test zoom
++ ITEM Assertion OK : PageSetup.Zoom set
++ ITEM Assertion OK : PageSetup.Zoom set/get
++Verify that sheet 1 zoom is 10%
++ TEST OK : Test zoom
++ TEST START : Test orientation
++ ITEM Assertion OK : PageSetup.Zoom set
++ ITEM Assertion OK : PageSetup.Orientation set/get
++Verify that sheet 1 orientation is now landscape
++ TEST OK : Test orientation
++ TEST START : Test order
++ ITEM Assertion OK : PageSetup.Order get
++ ITEM Assertion OK : PageSetup.Order set/get
++Verify that order on sheet 1 is now over, then down.
++ TEST OK : Test order
++ TEST START : Test first page number
++ ITEM Assertion OK : PageSetup.FirstPageNumber get
++ ITEM Assertion OK : PageSetup.FirstPageNumber set/get
++Verify that first page number on sheet 1 is now 2.
++ TEST OK : Test first page number
++ TEST START : Test center vertically
++ ITEM Assertion OK : PageSetup.CenterVertically get
++ ITEM Assertion OK : PageSetup.CenterVertically set/get
++Verify that CenterVertically on sheet 1 is now true.
++ TEST OK : Test center vertically
++ TEST START : Test center horizontally
++ ITEM Assertion OK : PageSetup.CenterHorizontally get
++ ITEM Assertion OK : PageSetup.CenterHorizontally set/get
++Verify that CenterHorizontally on sheet 1 is now true.
++ TEST OK : Test center horizontally
++ TEST START : Test FitToPagesTall
++ ITEM Assertion OK : PageSetup.FitToPagesTall set/get
++ TEST OK : Test FitToPagesTall
++ TEST START : Test FitToPagesWide
++ ITEM Assertion OK : PageSetup.FitToPagesWide set/get
++ TEST OK : Test FitToPagesWide
++ TEST START : Test PrintHeadings
++ ITEM Assertion OK : PageSetup.PrintHeadings set/get
++ ITEM Assertion OK : PageSetup.PrintHeadings set/get
++ TEST OK : Test PrintHeadings
++END PageSetup
++Test run finished : 07/21/2008 02:00:07 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/partition.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/partition.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/partition.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/partition.log 29 Jul 2008 07:22:57 -0000 1.1.2.1
+@@ -0,0 +1,11 @@
++Test run started : 12/10/2007 11:26:43 AM
++BEGIN Partition
++ TEST START : Test Partition function
++ ITEM Assertion OK : the number 20 occurs in the range:20:24
++ ITEM Assertion OK : the number 20 occurs in the range: 20: 20
++ ITEM Assertion OK : the number 120 occurs in the range:100:
++ ITEM Assertion OK : the number -5 occurs in the range: : -1
++ ITEM Assertion OK : the number 2 occurs in the range: 2: 3
++ TEST OK : Test Partition function
++END Partition
++Test run finished : 12/10/2007 11:26:43 AM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/range-4.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/range-4.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/range-4.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/range-4.log 29 Jul 2008 07:22:57 -0000 1.1.2.1
+@@ -0,0 +1,16 @@
++Test run started : 2008ï06ï19 17:14:57
++----------------------------------------------------------------
++ShowDetail-Issue
++ TEST START : ShowDetail-Issue
++ ITEM Assertion OK : Range.ShowDetail is True
++ ITEM Assertion OK : Range.ShowDetail is False
++END 'ShowDetail-Issue' Symbol
++ TEST OK : ShowDetail-Issue
++----------------------------------------------------------------
++RangeMerged-Issue
++ TEST START : RangeMerged-Issue
++ ITEM Assertion OK : Range.RangeMerged is $F$2:$H$5
++ ITEM Assertion OK : The first address of Range.RangeMerged is $F$2
++END 'RangeMerged-Issue' Symbol
++ TEST OK : RangeMerged-Issue
++Test run finished : 2008ï06ï19 17:14:57
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log 29 Jul 2008 07:22:58 -0000 1.1.2.1
+@@ -0,0 +1,14 @@
++Test run started : 11/20/2007 05:15:30 PM
++BEGIN Replace
++ TEST START : Test Replace function
++ ITEM Assertion OK : common string:aefefdBc
++ ITEM Assertion OK : expression string:aefefdef
++ ITEM Assertion OK : binanary compare:aefefdBc
++ ITEM Assertion OK : text compare:aefefdef
++ ITEM Assertion OK : text compare:aefefdef
++ ITEM Assertion OK : start = 3:cefdBc
++ ITEM Assertion OK : count = 2: aefefdBc
++ ITEM Assertion FAIL : start = 1, count = 0, not support in Unix: aefefdBc
++ TEST OK : Test Replace function
++END Replace
++Test run finished : 11/20/2007 05:15:30 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/stringplusdouble.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/stringplusdouble.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/stringplusdouble.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/stringplusdouble.log 29 Jul 2008 07:22:58 -0000 1.1.2.1
+@@ -0,0 +1,62 @@
++Test run started : 05/29/2008 02:51:22 PM
++BEGIN String Plus Double
++ TEST START : double = string + double
++The next compute raises error: s = null, d = null, r = s + d
++ ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1
++ ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0
++The next compute raises error: s = null, d = 20, r = s + d
++ ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1
++ ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20
++ ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10
++ ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100
++ ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30
++ ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020
++The next compute raises error: s = 'abc', d = null, r = s + d
++ ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1
++The next compute raises error: s = 'abc', d = null, r = s & d
++ ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1
++The next compute raises error: s = 'abc', d = 20, r = s + d
++ ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1
++The next compute raises error: s = 'abc', d = 20, r = s & d
++ ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1
++ TEST OK : double = string + double
++ TEST START : string = string + double
++The next compute raises error: s = null, d = null, r = s + d
++ ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1
++ ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0
++The next compute raises error: s = null, d = 20, r = s + d
++ ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1
++ ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20
++ ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10
++ ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100
++ ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30
++ ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020
++The next compute raises error: s = 'abc', d = null, r = s + d
++ ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1
++ ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: abc0
++The next compute raises error: s = 'abc', d = 20, r = s + d
++ ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1
++ ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: abc20
++ TEST OK : string = string + double
++ TEST START : double = string + string
++The next compute raises error: s = null, d = null, r = s + d
++ ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1
++The next compute raises error: s = null, d = null, r = s & d
++ ITEM Assertion OK : s = null, d = null, r = s & d .The result is: -1
++ ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: 20
++ ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20
++ ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10
++ ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 10
++ ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 1020
++ ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020
++The next compute raises error: s = 'abc', d = null, r = s + d
++ ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1
++The next compute raises error: s = 'abc', d = null, r = s & d
++ ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1
++The next compute raises error: s = 'abc', d = 20, r = s + d
++ ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1
++The next compute raises error: s = 'abc', d = 20, r = s & d
++ ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1
++ TEST OK : double = string + string
++END String Plus Double
++Test run finished : 05/29/2008 02:51:22 PM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log 29 Jul 2008 07:22:58 -0000 1.1.2.1
+@@ -0,0 +1,45 @@
++Test run started : 05/29/2008 02:55:48 PM
++BEGIN Window2
++ TEST START : Test Window.SplitRow
++ ITEM Assertion OK : Test SplitColumn: 2
++ ITEM Assertion FAIL : Test SplitRow: 5
++ ITEM Assertion FAIL : Test SplitVertical: 64.5090003183026
++ ITEM Assertion OK : Test SplitHorizontal: 502.570118758869
++ ITEM Assertion OK : Test SplitVertical: 242.283803521067
++ ITEM Assertion OK : Test SplitRow: 19
++ ITEM Assertion OK : Test SplitHorizontal: 242.283803521067
++ ITEM Assertion OK : Test SplitColumn: 1
++ ITEM Assertion FAIL : Test SplitRow: 8
++ ITEM Assertion OK : Test SplitColumn: 10
++ ITEM Assertion OK : Test SplitColumn: 0
++ ITEM Assertion OK : Test SplitRow: 0
++ TEST OK : Test Window.SplitRow
++TEST ERROR - no test begun: Test Window.SplitRow
++ TEST START : Test Window.DisplayGridlines
++ ITEM Assertion OK : Test gridlines are on
++ ITEM Assertion OK : Test gridlines are off
++ TEST OK : Test Window.DisplayGridlines
++ TEST START : Test Window.DisplayHeadings
++ ITEM Assertion OK : Test Headings are on
++ ITEM Assertion OK : Test Headings are off
++ TEST OK : Test Window.DisplayHeadings
++ TEST START : Test Window.Visibility
++ ITEM Assertion OK : Window is visible
++ TEST FAIL : Test Window.Visibility (hit error handler).
++ TEST START : Test Window.FreezePanes
++ ITEM Assertion OK : Test no panes frozen
++ ITEM Assertion OK : Test panes frozen at center
++ ITEM Assertion OK : Test panes frozen at split
++ TEST OK : Test Window.FreezePanes
++ TEST START : Test Window.View
++ TEST OK : Test Window.View
++ TEST START : Test Window.Zoom
++ ITEM Assertion OK : Test zoom=100%
++ ITEM Assertion OK : Test zoom=150%
++ TEST OK : Test Window.Zoom
++ TEST START : Test Windows.Count
++ ITEM Assertion OK : Windows Count: 1
++ ITEM Assertion OK : Application.Windows Count: 1
++ TEST OK : Test Windows.Count
++END Window2
++Test run finished : 05/29/2008 02:55:48 PM
+cvs diff: Diffing sc/source/ui/vba/testvba/TestDocuments/logs/win
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/AutoFilter.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/AutoFilter.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/AutoFilter.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/AutoFilter.log 29 Jul 2008 07:22:58 -0000 1.1.2.2
+@@ -0,0 +1,20 @@
++Test run started : 16/10/2007 17:42:01
++----------------------------------------------------------------
++TestAddress
++ TEST START : TestAddress
++ ITEM Assertion OK : test1 'starts with' string criteria
++ ITEM Assertion OK : test2 'not equal to' string criteria
++ ITEM Assertion OK : test3 'ends with' string criteria
++ ITEM Assertion OK : test4 field 'all'
++ ITEM Assertion OK : test5 numeric '<15'
++ ITEM Assertion OK : test6 numeric '>=15'
++ ITEM Assertion OK : test7 numeric '<=12'
++Test Results
++============
++
++Tests passed: 7
++Tests failed: 0
++
++END 'TestAddress
++ TEST OK : TestAddress
++Test run finished : 16/10/2007 17:42:02
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/MiscRangeTests.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/MiscRangeTests.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/MiscRangeTests.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/MiscRangeTests.log 29 Jul 2008 07:22:58 -0000 1.1.2.2
+@@ -0,0 +1,45 @@
++Test run started : 17/07/2007 15:08:56
++----------------------------------------------------------------
++MiscRangeTests
++ TEST START : MiscRangeTests
++ ITEM Assertion OK : test 1
++ ITEM Assertion OK : test 2
++ ITEM Assertion OK : test 3
++ ITEM Assertion OK : test 4
++ ITEM Assertion OK : test 5
++ ITEM Assertion OK : test 6
++ ITEM Assertion OK : test 7
++ ITEM Assertion OK : test 8
++ ITEM Assertion OK : test 9
++ ITEM Assertion OK : test 10
++ ITEM Assertion OK : test 11
++ ITEM Assertion OK : test 12
++ ITEM Assertion OK : test 13
++ ITEM Assertion OK : test 14
++ ITEM Assertion OK : test 15
++ ITEM Assertion OK : test 16
++ ITEM Assertion OK : test 17
++ ITEM Assertion OK : test 18
++ ITEM Assertion OK : test 19
++ ITEM Assertion OK : test 20
++ ITEM Assertion OK : test 21
++ ITEM Assertion OK : test 22
++ ITEM Assertion OK : test 23
++ ITEM Assertion OK : test 24
++ ITEM Assertion OK : test 25
++ ITEM Assertion OK : test 26
++ ITEM Assertion OK : test 27
++ ITEM Assertion OK : test 28
++ ITEM Assertion OK : test 29
++ ITEM Assertion OK : test 30
++ ITEM Assertion OK : test 31
++No. tests: 31
++Summary
++=======
++Run: 31
++Passed: 31
++Failed: 0
++
++END 'MiscRangeTests
++ TEST OK : MiscRangeTests
++Test run finished : 17/07/2007 15:08:59
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-2.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-2.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-2.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-2.log 29 Jul 2008 07:22:59 -0000 1.1.2.2
+@@ -0,0 +1,68 @@
++Test run started : 10/07/2007 01:55:47
++----------------------------------------------------------------
++ClearFormtsIssue
++ TEST START : ClearFormtsIssue
++ ITEM Assertion OK : Range.Font.Bold is: True
++ ITEM Assertion OK : Range.Font.Bold is: False
++END 'ClearFormtsIssue' Symbol
++ TEST OK : ClearFormtsIssue
++----------------------------------------------------------------
++VerticalAlignment-Issue
++ TEST START : VerticalAlignment-Issue
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : - Range.VerticalAlignment (get)
++ ITEM Assertion OK : - Range.VerticalAlignment (set)
++ ITEM Assertion OK : Range.VeritcalAlignment is Null
++END 'VerticalAlignment-Issue' Symbol
++ TEST OK : VerticalAlignment-Issue
++----------------------------------------------------------------
++HorizontalAlignment-Issue
++ TEST START : HorizontalAlignment-Issue
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : - Range.HorizontalAlignment (get)
++ ITEM Assertion OK : - Range.HorizontalAlignment (set)
++ ITEM Assertion OK : Range.HorizontalAlignment is Null
++END 'HorizontalAlignment-Issue' Symbol
++ TEST OK : HorizontalAlignment-Issue
++----------------------------------------------------------------
++WrapText-Issue
++ TEST START : WrapText-Issue
++ ITEM Assertion OK : - Range.WrapText (get)
++ ITEM Assertion OK : - Range.WrapText (get)
++ ITEM Assertion OK : Range.WrapText is Null
++END 'WrapText-Issue' Symbol
++ TEST OK : WrapText-Issue
++----------------------------------------------------------------
++FontBorderIssues
++ TEST START : FontBorderIssues
++ ITEM Assertion OK : - = Borders.Color (getColor)
++ ITEM Assertion OK : - = Font.Color (getColor)
++END 'FontBorderIssues' Symbol
++ TEST OK : FontBorderIssues
++----------------------------------------------------------------
++RangeSizeIssues
++ TEST START : RangeSizeIssues
++ ITEM Assertion OK : Range.Left is: 100.5291
++ ITEM Assertion OK : Range.Top is: 95.39775
++ ITEM Assertion OK : Range.Width is: 191.25
++ ITEM Assertion OK : Range.Height is: 271.5
++END 'RangeSizeIssues' Symbol
++ TEST OK : RangeSizeIssues
++----------------------------------------------------------------
++ApplicationIssues
++ TEST START : ApplicationIssues
++ ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1
++END 'ApplicationIssues' Symbol
++ TEST OK : ApplicationIssues
++Test run finished : 10/07/2007 01:55:48
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-3.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-3.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-3.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-3.log 29 Jul 2008 07:22:59 -0000 1.1.2.2
+@@ -0,0 +1,8 @@
++Test run started : 10/07/2007 01:55:51
++----------------------------------------------------------------
++MyGoalseek-Issue
++ TEST START : MyGoalseek-Issue
++ ITEM Assertion OK : Variable Range value: 15
++END 'MyGoalseek-Issue' Symbol
++ TEST OK : MyGoalseek-Issue
++Test run finished : 10/07/2007 01:55:51
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges.log 29 Jul 2008 07:22:59 -0000 1.1.2.2
+@@ -0,0 +1,280 @@
++Test run started : 10/07/2007 01:55:56
++----------------------------------------------------------------
++ApplicationMethods
++ TEST START : ApplicationMethods
++ ITEM Assertion OK : Name of Workbook is: Ranges.xls
++ ITEM Assertion OK : Address of Application.Columns is: $A:$A
++ ITEM Assertion OK : Address of Application.Rows is: $1:$1
++ ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7
++ ITEM Assertion OK : Please check manually: DefaultFilePath is: C:\Documents and Settings\vituosity\My Documents
++ ITEM Assertion OK : Please check manually: Library Path is: C:\Documents and Settings\vituosity\Application Data\OpenOffice.org2\user\basic
++ ITEM Assertion OK : Please check manually: Template Path is: C:\Documents and Settings\vituosity\Application Data\OpenOffice.org2\user\template
++ ITEM Assertion OK : FileSeparator is \
++ ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls
++END 'ApplicationMethods' Symbol
++ TEST OK : ApplicationMethods
++----------------------------------------------------------------
++Insert-Issue
++ TEST START : Insert-Issue
++ ITEM Assertion OK : Insert with xlShiftToRight: 10
++END 'Insert-Issue' Symbol
++ TEST OK : Insert-Issue
++----------------------------------------------------------------
++MergeCells-Issue
++ TEST START : MergeCells-Issue
++ ITEM Assertion OK : Range.MergeCells is True
++ ITEM Assertion FAIL : MergeCells is null: False
++ ITEM Assertion OK : RowCount after Merge: 13
++ ITEM Assertion OK : Range.MergeCells is False
++ ITEM Assertion OK : MergeCells is null: False
++ ITEM Assertion FAIL : MergeCells of Second Area is null : False
++ ITEM Assertion FAIL : MergeCells of Ranges is Null: False
++ ITEM Assertion OK : RowCount after Merge: 7
++ ITEM Assertion OK : Range.MergeCells is False
++ ITEM Assertion OK : MergeCells is null: False
++ ITEM Assertion OK : RowCount after Merge: 7
++END 'MergeCells-Issue' Symbol
++ TEST OK : MergeCells-Issue
++----------------------------------------------------------------
++Areas-Issue
++ TEST START : Areas-Issue
++ ITEM Assertion OK : Range Areas Count is2
++ ITEM Assertion OK : First Range Address is: $E$8:$G$13
++ ITEM Assertion OK : First Row is: 8
++ ITEM Assertion OK : First Column is: 5
++ ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19
++ ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K
++ ITEM Assertion OK : Range Count:53
++END 'Areas-Issue' Symbol
++ TEST OK : Areas-Issue
++----------------------------------------------------------------
++Fill-Methods-Issue
++ TEST START : Fill-Methods-Issue
++ ITEM Assertion OK : Range Value after FillDown: MyFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyRightFillValue
++ ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue
++END 'Fill-Methods-Issue' Symbol
++ TEST OK : Fill-Methods-Issue
++----------------------------------------------------------------
++Range/Item-Method-Issue
++ TEST START : Range/Item-Method-Issue
++ ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C
++ ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7
++ ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D
++ ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10
++ ITEM Assertion OK : Range of several single cells is: $C$5,$E$8
++ ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range of a single Item Cell is: $E$21
++ ITEM Assertion OK : Range of a single Item Cell is: $F$21
++ ITEM Assertion OK : Range of a single Item Cell is: $F$10
++END 'Range/Item-Method-Issue' Symbol
++ TEST OK : Range/Item-Method-Issue
++----------------------------------------------------------------
++R1C1-Formulas-Issue
++ TEST START : R1C1-Formulas-Issue
++ ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"")
++ ITEM Assertion FAIL : Range.Formula is: =IF(OR(J8=0,RC[2]="YES"),"")
++END 'R1C1-Formulas-Issue' Symbol
++ TEST OK : R1C1-Formulas-Issue
++----------------------------------------------------------------
++Verify_Delete
++ TEST START : Verify_Delete
++ ITEM Assertion OK : Ranges are intersecting: $G$13
++ ITEM Assertion OK : Delete with Default: $AJ$4
++ ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4
++ ITEM Assertion OK : Delete with ShiftUp: $M$22
++END 'Verify_Delete' Symbol
++ TEST OK : Verify_Delete
++----------------------------------------------------------------
++Value-Issue
++ TEST START : Value-Issue
++ ITEM Assertion OK : Value of Range is: 12.3
++ ITEM Assertion OK : Text of Range is: 12.3
++ ITEM Assertion OK : Range has Formula: False
++ ITEM Assertion OK : Cell has Formula: False
++ ITEM Assertion FAIL : Text of Range is null: False
++ ITEM Assertion OK : Range has Formula: True
++ ITEM Assertion OK : Cell has Formula: True
++ ITEM Assertion OK : Value of Cell is: 12
++ ITEM Assertion OK : Application.Calculation is : -4135
++ ITEM Assertion OK : Calculation is automated: True
++ ITEM Assertion OK : Range has Formula: True
++ ITEM Assertion OK : Value of Cell is: 16
++ ITEM Assertion OK : Text of Cell is: 16
++ ITEM Assertion OK : Text of Cell is: 16
++ ITEM Assertion OK : Range has Formula after 'ClearContents: False
++ ITEM Assertion OK : Text of Cell is:
++ ITEM Assertion OK : Text of Cell is:
++END 'Value-Issue' Symbol
++ TEST OK : Value-Issue
++----------------------------------------------------------------
++AutoFit issue
++ TEST START : AutoFit issue
++ ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 467
++ ITEM Assertion FAIL : Rows.AutoFit: CurrentHeight is 78
++END 'AutoFit issue' Symbol
++ TEST OK : AutoFit issue
++----------------------------------------------------------------
++Selections
++ TEST START : Selections
++ ITEM Assertion OK : ActiveCell is : $E$8
++ ITEM Assertion OK : Active Cell is : $E$8
++ ITEM Assertion OK : Number of Cells in Range: 52
++ ITEM Assertion OK : Number of Cells in Range: 52
++ ITEM Assertion OK : Number of Cells in Range: 52
++END 'Selections' Symbol
++ TEST OK : Selections
++----------------------------------------------------------------
++Offset-Resize
++ TEST START : Offset-Resize
++ ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21
++ ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18
++ ITEM Assertion OK : Resized Range is : $A$20:$D$23
++END 'Offset-Resize' Symbol
++ TEST OK : Offset-Resize
++----------------------------------------------------------------
++Ranges-Address
++ TEST START : Ranges-Address
++ ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19
++ ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19
++ ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19
++ ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion FAIL : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11
++ ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19
++END 'Ranges-Address' Symbol
++ TEST OK : Ranges-Address
++----------------------------------------------------------------
++Range-Address
++ TEST START : Range-Address
++ ITEM Assertion OK : Range Address is: $E$8:$G$13
++ ITEM Assertion OK : Range Address is: $E8:$G13
++ ITEM Assertion OK : Range Address is: E$8:G$13
++ ITEM Assertion OK : Range Address is: R8C5:R13C7
++ ITEM Assertion FAIL : Range Address is: R8C5:R13C7
++ ITEM Assertion OK : Range Address is: R8C5:R13C7
++ ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13
++END 'Range-Address' Symbol
++ TEST OK : Range-Address
++----------------------------------------------------------------
++Column-Address
++ TEST START : Column-Address
++ ITEM Assertion OK : Range Address is: $F$8:$F$13
++ ITEM Assertion OK : Range Address is: $F8:$F13
++ ITEM Assertion OK : Range Address is: F$8:F$13
++ ITEM Assertion OK : Range Address is: R8C6:R13C6
++ ITEM Assertion FAIL : Range Address is: R8C6:R13C6
++ ITEM Assertion OK : Range Address is: R8C6:R13C6
++ ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13
++END 'Column-Address' Symbol
++ TEST OK : Column-Address
++----------------------------------------------------------------
++Row-Address
++ TEST START : Row-Address
++ ITEM Assertion OK : Range Address is: $E$9:$G$9
++ ITEM Assertion OK : Range Address is: $E9:$G9
++ ITEM Assertion OK : Range Address is: E$9:G$9
++ ITEM Assertion OK : Range Address is: R9C5:R9C7
++ ITEM Assertion FAIL : Range Address is: R9C5:R9C7
++ ITEM Assertion OK : Range Address is: R9C5:R9C7
++ ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9
++END 'Row-Address' Symbol
++ TEST OK : Row-Address
++----------------------------------------------------------------
++SingleCell-Address
++ TEST START : SingleCell-Address
++ ITEM Assertion OK : Range Address is: $F$9
++ ITEM Assertion OK : Range Address is: $F9
++ ITEM Assertion OK : Range Address is: F$9
++ ITEM Assertion OK : Range Address is: R9C6
++ ITEM Assertion FAIL : Range Address is: R9C6
++ ITEM Assertion OK : Range Address is: R9C6
++ ITEM Assertion OK : Range Address is: R[7]C[4]
++ ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9
++END 'SingleCell-Address' Symbol
++ TEST OK : SingleCell-Address
++----------------------------------------------------------------
++Heights and Widths
++ TEST START : Heights and Widths
++ ITEM Assertion OK : Range RowHeight is 40
++ ITEM Assertion OK : Range ColumnWidth is 50
++ ITEM Assertion OK : Range Height is 240
++ ITEM Assertion FAIL : Range Width is 675
++ ITEM Assertion OK : Range RowHeight is 50
++ ITEM Assertion OK : Range ColumnWidth is 50
++ ITEM Assertion OK : Range Height is 300
++ ITEM Assertion FAIL : Range Width is 675
++ ITEM Assertion FAIL : RowHeight is null: False
++ ITEM Assertion OK : ColumnWidth is null: True
++END 'Heights and Widths' Symbol
++ TEST OK : Heights and Widths
++----------------------------------------------------------------
++RangeRowColumn-Issue
++ TEST START : RangeRowColumn-Issue
++ ITEM Assertion OK : Row is: 8
++ ITEM Assertion OK : Column is: 5
++ ITEM Assertion OK : EntireRow.Columns.Count = 256
++ ITEM Assertion OK : EntireColumn.Rows.Count = 131072
++END 'RangeRowColumn-Issue' Symbol
++ TEST OK : RangeRowColumn-Issue
++----------------------------------------------------------------
++Replace-Issue
++ TEST START : Replace-Issue
++ ITEM Assertion OK : Value after Replace: YourValue
++ ITEM Assertion OK : Value after Replace: YourValue
++ ITEM Assertion OK : Value after Replace: ReplaceValue
++ ITEM Assertion OK : Value after Replace: New ReplaceValue
++ ITEM Assertion OK : Value after Replace: New ReplaceValue
++ ITEM Assertion OK : Value after Replace: New Replace
++ ITEM Assertion OK : Value after Replace:
++END 'Replace-Issue' Symbol
++ TEST OK : Replace-Issue
++----------------------------------------------------------------
++Hidden-Issue
++ TEST START : Hidden-Issue
++ ITEM Assertion OK : - Range.Rows.Hidden (set)
++ ITEM Assertion OK : - Range.Rows.Hidden (get)
++ ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set)
++ ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get)
++ ITEM Assertion OK : - Range.Columns.Hidden (set)
++ ITEM Assertion OK : - Range.Columns.Hidden (get)
++ ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set)
++ ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get)
++END 'Hidden-Issue' Symbol
++ TEST OK : Hidden-Issue
++----------------------------------------------------------------
++End issue
++ TEST START : End issue
++ ITEM Assertion OK : - = $E$48
++ ITEM Assertion OK : - = $E$1
++ ITEM Assertion OK : - = $E$3
++ ITEM Assertion OK : - = $A$8
++ ITEM Assertion OK : - = $B$8
++ ITEM Assertion OK : - = $IV$8
++ ITEM Assertion OK : - = $Z$8
++END 'End issue' Symbol
++ TEST OK : End issue
++----------------------------------------------------------------
++Outline issue
++ TEST START : Outline issue
++ ITEM Assertion OK : - Range.clearOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++END 'Outline issue' Symbol
++ TEST OK : Outline issue
++----------------------------------------------------------------
++Validation
++ TEST START : Validation
++ ITEM Assertion OK : Validation Input Message is : Attention!
++ ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten
++ ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten
++ ITEM Assertion OK : Validation Error Message is : An Error occured
++ ITEM Assertion OK : Validation Error Title is : Microsoft Excel
++END 'Validation' Symbol
++ TEST OK : Validation
++Test run finished : 10/07/2007 01:56:04
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/Shapes.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/Shapes.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/Shapes.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/Shapes.log 29 Jul 2008 07:22:59 -0000 1.1.2.2
+@@ -0,0 +1,77 @@
++Test run started : 16/10/2007 17:46:03
++BEGIN Shapes_Collection_Behaviour
++ TEST START : Shapes_Collection_Behaviour
++ ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape1'
++ ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape2'
++ TEST Success. : Shapes_Collection_Behaviour
++END Shapes_Collection_Behaviour
++BEGIN Shapes_Select_Item
++ TEST START : Shapes_Select_Item
++ ITEM Assertion OK : Correctly selected shape through Range
++ ITEM Assertion OK : Correctly selected shape through Item
++ ITEM Assertion OK : Needs to be visually checked. Is there a line on the document?
++ ITEM Assertion OK : Needs to be visually checked. Are All Shapes Selected?
++ TEST Success. : Shapes_Select_Item
++END Shapes_Select_Item
++BEGIN Shapes_Fill
++ TEST START : Shapes_Fill
++ ITEM Assertion OK : correctly set visibility of shape fill
++ ITEM Assertion OK : correctly set transparency of shape line
++ ITEM Assertion OK : correctly set forecolor of shape fill
++ ITEM Assertion FAIL : correctly set backcolor of shape fill
++ ITEM Assertion OK : the success of the TwoColorGradient method needs to be verified visually!
++ ITEM Assertion OK : correctly set forecolor of shape fill
++ ITEM Assertion FAIL : correctly set forecolor of shape fill
++ TEST Success. : Shapes_Fill
++END Shapes_Fill
++BEGIN Shapes_Line
++ TEST START : Shapes_Line
++ ITEM Assertion FAIL : correctly set weight of shape line
++ ITEM Assertion OK : correctly set visibility of shape line
++ ITEM Assertion OK : correctly set transparency of shape line
++ ITEM Assertion OK : correctly set dash style of shape line
++ ITEM Assertion OK : correctly set dash style of shape line
++ ITEM Assertion OK : correctly set forecolor of shape line
++ ITEM Assertion FAIL : correctly set backcolor of shape line
++ TEST Success. : Shapes_Line
++END Shapes_Line
++BEGIN Shapes_TextFrame
++ TEST START : Shapes_TextFrame
++ ITEM Assertion OK : correctly set Autosize of Shape TextFrame
++ TEST Success. : Shapes_TextFrame
++END Shapes_TextFrame
++BEGIN Shapes_SimpleGeometry
++ TEST START : Shapes_SimpleGeometery
++ ITEM Assertion OK : shape height should be 49.4519655148368 and got 49.4078709034412
++ ITEM Assertion OK : shape width should be 101.467710269751 and got 101.423615658355
++ ITEM Assertion OK : shape left should be 68.5574761223637 and got 68.5417279658754
++ ITEM Assertion OK : shape top should be 44.1511784471699 and got 44.1354302906816
++ ITEM Assertion OK : shape rotation should be 0 and got 0
++ ITEM Assertion OK : shape rotation should be 25 and got 25
++ ITEM Assertion OK : shape incrementrotation should be 50 and got 50
++ ITEM Assertion OK : shape incrementleft should be 69.7480272284707 and got 69.7322790719824
++ ITEM Assertion OK : shape incrementtop should be 93.8141674447769 and got 93.7984192882885
++ TEST Success. : Shapes_SimpleGeometery
++END Shapes_SimpleGeometry
++BEGIN Shapes_Range
++ TEST START : Shapes_Range
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to contain 1 element, it contains 1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to return Sheet2Shape1 got Sheet2Shape1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to contain 1 element, it contains 1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to return Sheet2Shape3 got Sheet2Shape3
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to contain 2 elements, it contains 2
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to return concated element/shape names Sheet2Shape3Sheet2Shape1 and got Sheet2Shape3Sheet2Shape1
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to contain 3 elements, it contains 3
++ ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to return concated element/shape names Sheet2Shape3Sheet2Shape1Sheet2Shape2 and got Sheet2Shape3Sheet2Shape1Sheet2Shape2
++ TEST Success. : Shapes_Range
++END Shapes_Range
++BEGIN Shapes_ShapeRange
++ TEST START : Shapes_ShapeRange
++ ITEM Assertion OK : ShapeRange.IncrementLeft shp1.left should be 89.7322790719824 and got 89.7165297816359
++ ITEM Assertion OK : ShapeRange.IncrementLeft shp2.left should be 240.02518299054 and got 240.009433700193
++ ITEM Assertion OK : ShapeRange.IncrementTop shp1.Top should be 113.798419288289 and got 113.782669997942
++ ITEM Assertion OK : ShapeRange.IncrementTop shp2.Top should be 67.4519655148368 and got 67.4362162244903
++ ITEM Assertion OK : ShapeRange.IncrementRotation shp1.Rotation should be 70 and got 70
++ ITEM Assertion OK : ShapeRange.IncrementRotation shp2.Rotation should be 20 and got 20
++END Shapes_ShapeRange
++Test run finished : 16/10/2007 17:46:04
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/TestAddress.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/TestAddress.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/TestAddress.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/TestAddress.log 29 Jul 2008 07:22:59 -0000 1.1.2.2
+@@ -0,0 +1,62 @@
++Test run started : 17/07/2007 15:26:54
++----------------------------------------------------------------
++TestAddress
++ TEST START : TestAddress
++ ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing
++ ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing
++ ITEM Assertion OK : test3 Range ('e:f') A1 style addressing
++ ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing
++ ITEM Assertion OK : test5 Columns A1 style addressing
++ ITEM Assertion OK : test6 Columns R1C1 style addressing
++ ITEM Assertion OK : test7 Columns(3) A1 style addressing
++ ITEM Assertion OK : test8 Columns(3) R1C1 style addressing
++ ITEM Assertion OK : test9 Columns('e') A1 style addressing
++ ITEM Assertion OK : test10 Columns('e') R1C1 style addressing
++ ITEM Assertion OK : test11 Columns('b:d') A1 style addressing
++ ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing
++ ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing
++ ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing
++ ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing
++ ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing
++ ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing
++ ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing
++ ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing
++ ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing
++ ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing
++ ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing
++ ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing
++ ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing
++ ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing
++ ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false
++ ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false
++ ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing
++ ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing
++ ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing
++ ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing
++ ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing
++ ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing
++ ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing
++ ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing
++ ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing
++ ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing
++ ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing
++ ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing
++ ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing
++ ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing
++ ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c')
++ ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f')
++ ITEM Assertion OK : test44 Range('g20:h40').Columns(-1)
++ ITEM Assertion OK : test45 Range('c4:g10').Rows(-1)
++ ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1')
++ ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2')
++ ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2')
++ ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3')
++Test Results
++============
++
++Tests passed: 49
++Tests failed: 0
++
++END 'TestAddress
++ TEST OK : TestAddress
++Test run finished : 17/07/2007 15:26:56
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest.log 29 Jul 2008 07:22:59 -0000 1.1.2.2
+@@ -0,0 +1,60 @@
++Test run started : 10/07/2007 01:56:07
++BEGIN TestCalc
++ TEST START : RangeTest2
++ ITEM Assertion OK : - Range("D15").Row
++ ITEM Assertion OK : - WorkSheet("D15").Range.Row
++ ITEM Assertion OK : - Range("D15").Column
++ ITEM Assertion OK : - Worksheet.Range("D15").Column
++ ITEM Assertion OK : - Range("D1").EntireRow.Valuer
++ ITEM Assertion OK : - Range("D1").EntireRow.Valuer
++ ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count
++ ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count
++ ITEM Assertion OK : - Range("D15").ClearContent
++ ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get)
++ ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set)
++ ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get)
++ ITEM Assertion OK : - Range("B38").Orientation (get)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical)
++ ITEM Assertion OK : - Range("B38").Orientation (set)
++ ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical)
++ ITEM Assertion OK : - Range("B39").WrapText (get)
++ ITEM Assertion OK : - Range("B39").WrapText (set)
++ ITEM Assertion OK : - Range("B39").WrapText (set)
++ ITEM Assertion OK : - Range("E39").MergeCells (get)
++ ITEM Assertion OK : - Range("F39").MergeCells (get)
++ ITEM Assertion OK : - Range("E39").MergeCells (set)
++ ITEM Assertion FAIL : - Range("F39").MergeCells (set)
++ ITEM Assertion OK : - Range("E39").MergeCells (set)
++ ITEM Assertion OK : - Range("F39").MergeCells (set)
++ ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True
++ ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True
++ ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (get)
++ ITEM Assertion OK : - Range("B39").VerticalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (get)
++ ITEM Assertion OK : - Range("B39").HorizontalAlignment (set)
++ ITEM FAIL (RangeTest2)
++ TEST Not succesfully completed : RangeTest2
++END TestCalc
++Test run finished : 10/07/2007 01:56:12
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest2.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest2.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest2.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest2.log 29 Jul 2008 07:22:59 -0000 1.1.2.2
+@@ -0,0 +1,65 @@
++Test run started : 10/07/2007 01:56:15
++BEGIN TestCalc
++ TEST START : RangeTest3
++ ITEM Assertion FAIL : - setFormulaR1C1
++ ITEM Assertion OK : - getFormulaR1C1
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy(Range("I10"))
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas
++ ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats
++ ITEM Assertion OK : PasteSpecial
++ ITEM Assertion OK : PasteSpecial SkipBlanks:=True
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply
++ ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide
++ ITEM Assertion OK : PasteSpecial Transpose:=True
++ ITEM Assertion FAIL : ActiveWorkbook.FileFormat
++ ITEM Assertion OK : ActiveWorkbook.Name
++ ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path
++ ITEM Assertion FAIL : - = ActiveWorkbook.Colors(3) set
++ ITEM Assertion OK : - = ActiveWorkbook.ResetColors
++ ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get
++ ITEM Assertion OK : - = Range("K22").End (xlDown)
++ ITEM Assertion OK : - = Range("K22").End (xlUo)
++ ITEM Assertion OK : - = Range("K22").End (xlToLeft)
++ ITEM Assertion OK : - = Range("K22").End (xlRight)
++ ITEM Assertion OK : - ActiveSpreadsheet.Next
++ ITEM Assertion OK : - ActiveSpreadsheet.Next
++ ITEM Assertion OK : - ActiveSpreadsheet.Previous
++ ITEM Assertion OK : - ActiveSpreadsheet.Previous
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x"
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>"
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="="
++ ITEM Assertion OK : - Range("J4:J11").AutoFilter
++ ITEM Assertion OK : - ActiveSheet.Resize.Select
++ ITEM Assertion OK : - Application.GoTo Reference:="R8C2"
++ ITEM Assertion FAIL : - Application.GoTo Reference:="R[8]C[2]"
++ ITEM Assertion OK : - Application.GoTo Reference:="R8C2"
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Ungroup- please check visually
++ ITEM Assertion OK : - Range.Ungroup - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.Group - please check visually
++ ITEM Assertion OK : - Range.clearOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - Range.AutoOutline - please check visually
++ ITEM Assertion OK : - ActiveSheet.UsedRange.Select
++ ITEM Assertion OK : - Range("A13").AddIndent
++ ITEM Assertion OK : - Range("A13").IndentLevel set
++ ITEM Assertion OK : - Range("A13").IndentLevel get
++ ITEM Assertion OK : - Range("A13").IndentLevel get
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial()
++ ITEM Assertion OK : - Range.Calculate
++ ITEM Assertion OK : Worksheet.Calculate
++ ITEM Assertion OK : - Application.Calculate
++ ITEM Assertion OK : Global.Calculate
++ ITEM Assertion OK : Calculation set
++ ITEM FAIL (RangeTest3)
++ TEST Not succesfully completed : RangeTest3
++END TestCalc
++Test run finished : 10/07/2007 01:56:23
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/pagesetup.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/pagesetup.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/pagesetup.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/pagesetup.log 29 Jul 2008 07:23:00 -0000 1.1.2.1
+@@ -0,0 +1,87 @@
++Test run started : 7/21/2008 10:37:24 AM
++BEGIN PageSetup
++ TEST START : Sheet_PrintArea
++ ITEM Assertion OK : PrintArea has changed as expected
++ TEST OK : Sheet_PrintArea
++ TEST START : Test margins (no headers)
++ ITEM Assertion OK : PageSetup.LeftMargin set/get
++ ITEM Assertion OK : PageSetup.RightMargin set/get
++ ITEM Assertion OK : PageSetup.TopMargin set/get
++ ITEM Assertion OK : PageSetup.BottomMargin set/get
++Verify that page margins on sheet 1 are all 0.5inch
++ TEST OK : Test margins (no headers)
++ TEST START : Test margins (headers)
++ ITEM Assertion OK : PageSetup.HeaderMargin set/get
++ ITEM Assertion OK : PageSetup.FooterMargin set/get
++ ITEM Assertion OK : PageSetup.LeftMargin set/get
++ ITEM Assertion OK : PageSetup.LeftMargin set/get
++Verify that top/bottom/header/footer page margins on sheet 2 are all 0.5inch
++ TEST OK : Test margins (headers)
++ TEST START : Test header/footer text
++ ITEM Assertion OK : PageSetup.LeftHeader set
++ ITEM Assertion OK : PageSetup.LeftHeader set/get
++ ITEM Assertion OK : PageSetup.CenterHeader set
++ ITEM Assertion OK : PageSetup.CenterHeader set/get
++ ITEM Assertion OK : PageSetup.RightHeader set
++ ITEM Assertion OK : PageSetup.RightHeader set/get
++ ITEM Assertion OK : PageSetup.LeftFooter set
++ ITEM Assertion OK : PageSetup.LeftFooter set/get
++ ITEM Assertion OK : PageSetup.CenterFooter set
++ ITEM Assertion OK : PageSetup.CenterFooter set/get
++ ITEM Assertion OK : PageSetup.RightFooter set
++ ITEM Assertion OK : PageSetup.RightFooter set/get
++Verify that headers on sheet 2 are Ready,to,go
++Verify that footers on sheet 2 are This,now,Works
++ TEST OK : Test header/footer text
++ TEST START : Test zoom
++ ITEM Assertion OK : PageSetup.Zoom set
++ ITEM Assertion OK : PageSetup.Zoom set/get
++Verify that sheet 1 zoom is 10%
++ TEST OK : Test zoom
++ TEST START : Test orientation
++ ITEM Assertion OK : PageSetup.Zoom set
++ ITEM Assertion OK : PageSetup.Orientation set/get
++Verify that sheet 1 orientation is now landscape
++ TEST OK : Test orientation
++ TEST START : Test paper size
++ ITEM Assertion OK : PageSetup.PaperSize get
++ ITEM Assertion OK : PageSetup.PaperSize set/get
++Verify that paper size on sheet 1 is now Letter
++ TEST OK : Test paper size
++ TEST START : Test order
++ ITEM Assertion OK : PageSetup.Order get
++ ITEM Assertion OK : PageSetup.Order set/get
++Verify that order on sheet 1 is now over, then down.
++ TEST OK : Test order
++ TEST START : Test first page number
++ ITEM Assertion OK : PageSetup.FirstPageNumber get
++ ITEM Assertion OK : PageSetup.FirstPageNumber set/get
++Verify that first page number on sheet 1 is now 2.
++ TEST OK : Test first page number
++ TEST START : Test center vertically
++ ITEM Assertion OK : PageSetup.CenterVertically get
++ ITEM Assertion OK : PageSetup.CenterVertically set/get
++Verify that CenterVertically on sheet 1 is now true.
++ TEST OK : Test center vertically
++ TEST START : Test center horizontally
++ ITEM Assertion OK : PageSetup.CenterHorizontally get
++ ITEM Assertion OK : PageSetup.CenterHorizontally set/get
++Verify that CenterHorizontally on sheet 1 is now true.
++ TEST OK : Test center horizontally
++ TEST START : Test FitToPagesTall
++ ITEM Assertion OK : PageSetup.FitToPagesTall set/get
++ TEST OK : Test FitToPagesTall
++ TEST START : Test FitToPagesWide
++ ITEM Assertion OK : PageSetup.FitToPagesWide set/get
++ TEST OK : Test FitToPagesWide
++ TEST START : Test PrintHeadings
++ ITEM Assertion OK : PageSetup.PrintHeadings set/get
++ ITEM Assertion OK : PageSetup.PrintHeadings set/get
++ TEST OK : Test PrintHeadings
++ TEST START : Test PrintTitleRows
++ ITEM Assertion OK : PageSetup.PrintTitleRows get
++ ITEM Assertion OK : PageSetup.PrintTitleRows set range/get
++ ITEM Assertion OK : PageSetup.PrintTitleRows set false/get
++ TEST OK : Test PrintTitleRows
++END PageSetup
++Test run finished : 7/21/2008 10:37:32 AM
+Index: sc/source/ui/vba/testvba/TestDocuments/logs/win/replace.log
+===================================================================
+RCS file: sc/source/ui/vba/testvba/TestDocuments/logs/win/replace.log
+diff -N sc/source/ui/vba/testvba/TestDocuments/logs/win/replace.log
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/testvba/TestDocuments/logs/win/replace.log 29 Jul 2008 07:23:00 -0000 1.1.2.1
+@@ -0,0 +1,14 @@
++Test run started : 2007-11-21 11:24:04
++BEGIN Replace
++ TEST START : Test Replace function
++ ITEM Assertion OK : common string:aefefdBc
++ ITEM Assertion OK : expression string:aefefdef
++ ITEM Assertion OK : binanary compare:aefefdBc
++ ITEM Assertion OK : text compare:aefefdef
++ ITEM Assertion OK : text compare:aefefdef
++ ITEM Assertion OK : start = 3:cefdBc
++ ITEM Assertion OK : count = 2: aefefdBc
++ ITEM Assertion OK : start = 1, count = 0, not support in Unix: abcbcdBc
++ TEST OK : Test Replace function
++END Replace
++Test run finished : 2007-11-21 11:24:04
+cvs diff: Diffing sc/source/ui/view
+cvs diff: Diffing sc/uiconfig
+cvs diff: Diffing sc/uiconfig/scalc
+cvs diff: Diffing sc/uiconfig/scalc/accelerator
+cvs diff: Diffing sc/uiconfig/scalc/accelerator/de
+cvs diff: Diffing sc/uiconfig/scalc/accelerator/en-GB
+cvs diff: Diffing sc/uiconfig/scalc/accelerator/en-US
+cvs diff: Diffing sc/uiconfig/scalc/accelerator/es
+cvs diff: Diffing sc/uiconfig/scalc/accelerator/fr
+cvs diff: Diffing sc/uiconfig/scalc/menubar
+cvs diff: Diffing sc/uiconfig/scalc/statusbar
+cvs diff: Diffing sc/uiconfig/scalc/toolbar
+cvs diff: Diffing sc/util
+cvs diff: Diffing sc/util/defs
+cvs diff: Diffing sc/workben
+cvs diff: Diffing sc/workben/celltrans
+cvs diff: Diffing sc/xml
+cvs diff: Diffing oovbaapi
+cvs diff: Diffing oovbaapi/genconstidl
+cvs diff: Diffing oovbaapi/org
+cvs diff: Diffing oovbaapi/org/openoffice
+cvs diff: Diffing oovbaapi/org/openoffice/constants
+cvs diff: Diffing oovbaapi/org/openoffice/excel
+Index: oovbaapi/org/openoffice/excel/Hyperlink.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/excel/Hyperlink.idl
+diff -N oovbaapi/org/openoffice/excel/Hyperlink.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/excel/Hyperlink.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,54 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++
++#ifndef __org_openoffice_excel_Hyperlink_idl__
++#define __org_openoffice_excel_Hyperlink_idl__
++
++#ifndef __org_openoffice_excel_XHyperlink_idl__
++#include <org/openoffice/excel/XHyperlink.idl>
++#endif
++
++#include <com/sun/star/uno/XComponentContext.idl>
++#include <com/sun/star/frame/XModel.idl>
++
++module org { module openoffice { module excel {
++service Hyperlink : XHyperlink
++{
++ createHyperlink( [in] ::org::openoffice::vba::XHelperInterface Parent, [in] ::com::sun::star::frame::XModel xModel );
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/excel/Window.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/excel/Window.idl
+diff -N oovbaapi/org/openoffice/excel/Window.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/excel/Window.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,54 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++
++#ifndef __org_openoffice_excel_Window_idl__
++#define __org_openoffice_excel_Window_idl__
++
++#ifndef __org_openoffice_excel_XWindow_idl__
++#include <org/openoffice/excel/XWindow.idl>
++#endif
++
++#include <com/sun/star/uno/XComponentContext.idl>
++#include <com/sun/star/frame/XModel.idl>
++
++module org { module openoffice { module excel {
++service Window : XWindow
++{
++ createWindow( [in] ::org::openoffice::vba::XHelperInterface Parent, [in] ::com::sun::star::frame::XModel xModel );
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/excel/XApplication.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/excel/XApplication.idl,v
+retrieving revision 1.4
+retrieving revision 1.3.4.3
+diff -u -p -b -w -B -r1.4 -r1.3.4.3
+--- oovbaapi/org/openoffice/excel/XApplication.idl 11 Apr 2008 09:46:23 -0000 1.4
++++ oovbaapi/org/openoffice/excel/XApplication.idl 29 Jul 2008 06:27:52 -0000 1.3.4.3
+@@ -38,6 +38,14 @@
+ #include <org/openoffice/vba/XHelperInterface.idl>
+ #endif
+
++#ifndef __org_openoffice_vba_XAssistant_idl__
++#include <org/openoffice/vba/XAssistant.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XCommandBars_idl__
++#include <org/openoffice/vba/XCommandBars.idl>
++#endif
++
+ module org { module openoffice { module excel {
+
+ interface XRange;
+@@ -58,6 +66,7 @@ interface XApplication
+ [attribute, readonly] XRange ActiveCell;
+ [attribute, readonly] XWindow ActiveWindow;
+ [attribute, readonly] XWorksheet ActiveSheet;
++ [attribute, readonly] org::openoffice::vba::XAssistant Assistant;
+ [attribute] long Calculation;
+ //#TODO #FIXME this is more of a placeholder, will return
+ // the value of activeworkbook, in xl 'ThisWorkbook' should return the
+@@ -81,6 +90,7 @@ interface XApplication
+ string LibraryPath() raises(com::sun::star::script::BasicErrorException);
+ string TemplatesPath() raises(com::sun::star::script::BasicErrorException);
+ string PathSeparator() raises(com::sun::star::script::BasicErrorException);
++ any CommandBars( [in] any aIndex );
+ any Workbooks( [in] any aIndex );
+ any Worksheets( [in] any aIndex );
+ any Windows( [in] any aIndex );
+@@ -88,7 +98,7 @@ interface XApplication
+ any Evaluate( [in] string Name );
+ any Dialogs( [in] any DialogIndex );
+ any Range( [in] any Cell1, [in] any Cell2 );
+- any Names();
++ any Names( [in] any Index );
+ void GoTo( [in] any Reference, [in] any Scroll );
+ // #FIXME #TODO up to 30 args needed
+ double CountA( [in] any arg1 );
+@@ -96,6 +106,8 @@ interface XApplication
+ void Calculate() raises(com::sun::star::script::BasicErrorException);
+ XRange Intersect([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any Arg3, [in] /*Optional*/ any Arg4, [in] /*Optional*/ any Arg5, [in] /*Optional*/ any Arg6, [in] /*Optional*/ any Arg7, [in] /*Optional*/ any Arg8, [in] /*Optional*/ any Arg9, [in] /*Optional*/ any Arg10, [in] /*Optional*/ any Arg11, [in] /*Optional*/ any Arg12, [in] /*Optional*/ any Arg13, [in] /*Optional*/ any Arg14, [in] /*Optional*/ any Arg15, [in] /*Optional*/ any Arg16, [in] /*Optional*/ any Arg17, [in] /*Optional*/ any Arg18, [in] /*Optional*/ any Arg19, [in] /*Optional*/ any Arg20, [in] /*Optional*/ any Arg21, [in] /*Optional*/ any Arg22, [in] /*Optional*/ any Arg23, [in] /*Optional*/ any Arg24, [in] /*Optional*/ any Arg25, [in] /*Optional*/ any Arg26, [in] /*Optional*/ any Arg27, [in] /*Optional*/ any Arg28, [in] /*Optional*/ any Arg29, [in] /*Optional*/ any Arg30)
+ raises(com::sun::star::script::BasicErrorException);
++ XRange Union([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any Arg3, [in] /*Optional*/ any Arg4, [in] /*Optional*/ any Arg5, [in] /*Optional*/ any Arg6, [in] /*Optional*/ any Arg7, [in] /*Optional*/ any Arg8, [in] /*Optional*/ any Arg9, [in] /*Optional*/ any Arg10, [in] /*Optional*/ any Arg11, [in] /*Optional*/ any Arg12, [in] /*Optional*/ any Arg13, [in] /*Optional*/ any Arg14, [in] /*Optional*/ any Arg15, [in] /*Optional*/ any Arg16, [in] /*Optional*/ any Arg17, [in] /*Optional*/ any Arg18, [in] /*Optional*/ any Arg19, [in] /*Optional*/ any Arg20, [in] /*Optional*/ any Arg21, [in] /*Optional*/ any Arg22, [in] /*Optional*/ any Arg23, [in] /*Optional*/ any Arg24, [in] /*Optional*/ any Arg25, [in] /*Optional*/ any Arg26, [in] /*Optional*/ any Arg27, [in] /*Optional*/ any Arg28, [in] /*Optional*/ any Arg29, [in] /*Optional*/ any Arg30)
++ raises(com::sun::star::script::BasicErrorException);
+ void Volatile([in] any Volatile);
+ void DoEvents();
+ };
+Index: oovbaapi/org/openoffice/excel/XHPageBreak.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/excel/XHPageBreak.idl
+diff -N oovbaapi/org/openoffice/excel/XHPageBreak.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/excel/XHPageBreak.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,55 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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 __org_openoffice_excel_XHPageBreak_idl__
++#define __org_openoffice_excel_XHPageBreak_idl__
++
++#ifndef __org_openoffice_excel_XPageBreak_idl__
++#include <org/openoffice/excel/XPageBreak.idl>
++#endif
++
++
++//=============================================================================
++
++module org { module openoffice { module excel {
++
++//=============================================================================
++
++interface XHPageBreak
++{
++ interface ::org::openoffice::excel::XPageBreak;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/excel/XHPageBreaks.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/excel/XHPageBreaks.idl
+diff -N oovbaapi/org/openoffice/excel/XHPageBreaks.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/excel/XHPageBreaks.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,70 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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 __org_openoffice_excel_XHPageBreaks_idl__
++#define __org_openoffice_excel_XHPageBreaks_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++
++#ifndef __com_sun_star_helper_script_BasicErrorException_idl__
++#include <com/sun/star/script/BasicErrorException.idl>
++#endif
++#ifndef __org_openoffice_vba_XCollection_idl__
++#include <org/openoffice/vba/XCollection.idl>
++#endif
++
++//=============================================================================
++
++module org { module openoffice { module excel {
++
++//=============================================================================
++
++interface XHPageBreak;
++
++interface XHPageBreaks
++{
++
++ interface org::openoffice::vba::XCollection;
++ //Methods
++ any Add([in] any Before) raises(com::sun::star::script::BasicErrorException);
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/excel/XHyperlink.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/excel/XHyperlink.idl
+diff -N oovbaapi/org/openoffice/excel/XHyperlink.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/excel/XHyperlink.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,65 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_excel_XHyperlink_idl__
++#define __org_openoffice_excel_XHyperlink_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++
++//=============================================================================
++
++module org { module openoffice { module excel {
++
++//=============================================================================
++interface XRange;
++interface XHyperlink
++{
++ interface ::org::openoffice::vba::XHelperInterface;
++
++ [attribute] string Address;
++ [attribute] string Name;
++ [attribute] string TextToDisplay;
++
++ XRange Range();
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/excel/XInterior.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/excel/XInterior.idl,v
+retrieving revision 1.4
+retrieving revision 1.4.6.1
+diff -u -p -b -w -B -r1.4 -r1.4.6.1
+--- oovbaapi/org/openoffice/excel/XInterior.idl 11 Apr 2008 09:52:54 -0000 1.4
++++ oovbaapi/org/openoffice/excel/XInterior.idl 29 Jul 2008 06:27:52 -0000 1.4.6.1
+@@ -51,6 +51,9 @@ interface XInterior
+
+ [attribute] any Color;
+ [attribute] any ColorIndex;
++ [attribute] any Pattern;
++ [attribute] any PatternColor;
++ [attribute] any PatternColorIndex;
+ };
+
+ //=============================================================================
+Index: oovbaapi/org/openoffice/excel/XPageBreak.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/excel/XPageBreak.idl
+diff -N oovbaapi/org/openoffice/excel/XPageBreak.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/excel/XPageBreak.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,73 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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 __org_openoffice_excel_XPageBreak_idl__
++#define __org_openoffice_excel_XPageBreak_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++
++#ifndef __com_sun_star_helper_script_BasicErrorException_idl__
++#include <com/sun/star/script/BasicErrorException.idl>
++#endif
++
++//=============================================================================
++
++module org { module openoffice { module excel {
++
++//=============================================================================
++
++interface XRange;
++
++interface XPageBreak
++{
++
++ interface ::org::openoffice::vba::XHelperInterface;
++
++ // Attributes
++ [attribute] long Type;
++
++ //Methods
++ void Delete() raises(com::sun::star::script::BasicErrorException);
++ XRange Location()raises(com::sun::star::script::BasicErrorException);
++
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/excel/XPageSetup.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/excel/XPageSetup.idl
+diff -N oovbaapi/org/openoffice/excel/XPageSetup.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/excel/XPageSetup.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,85 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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 __org_openoffice_excel_XPageSetup_idl__
++#define __org_openoffice_excel_XPageSetup_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++
++//=============================================================================
++
++module org { module openoffice { module excel {
++
++//=============================================================================
++
++
++interface XPageSetup
++{
++
++ interface ::org::openoffice::vba::XHelperInterface;
++
++ //Attributes
++ [attribute] string PrintArea;
++ [attribute] double TopMargin;
++ [attribute] double BottomMargin;
++ [attribute] double RightMargin;
++ [attribute] double LeftMargin;
++ [attribute] double HeaderMargin;
++ [attribute] double FooterMargin;
++ [attribute] long Orientation;
++ [attribute] any FitToPagesTall;
++ [attribute] any FitToPagesWide;
++ [attribute] any Zoom;
++ [attribute] string LeftHeader;
++ [attribute] string CenterHeader;
++ [attribute] string RightHeader;
++ [attribute] string LeftFooter;
++ [attribute] string CenterFooter;
++ [attribute] string RightFooter;
++ [attribute] long Order;
++ [attribute] long FirstPageNumber;
++ [attribute] boolean CenterVertically;
++ [attribute] boolean CenterHorizontally;
++ [attribute] boolean PrintHeadings;
++
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/excel/XRange.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/excel/XRange.idl,v
+retrieving revision 1.4
+retrieving revision 1.4.6.1
+diff -u -p -b -w -B -r1.4 -r1.4.6.1
+--- oovbaapi/org/openoffice/excel/XRange.idl 11 Apr 2008 09:55:48 -0000 1.4
++++ oovbaapi/org/openoffice/excel/XRange.idl 29 Jul 2008 06:27:52 -0000 1.4.6.1
+@@ -103,6 +103,7 @@ interface XRange
+ [attribute, readonly] XValidation Validation;
+ [attribute] any Style;
+ [attribute] any AddIndent;
++ [attribute] any ShowDetail;
+
+ XComment AddComment( [in] any Text );
+ void Clear();
+@@ -134,6 +135,7 @@ interface XRange
+ any getCellRange();
+ void PasteSpecial([in] any Paste, [in] any Operation,[in] any SkipBlanks, [in] any Transpose);
+ boolean Replace( [in] string What, [in] string Replacement, [in] any LookAt, [in] any SearchOrder, [in] any MatchCase, [in] any MatchByte, [in] any SearchFormat, [in] any ReplaceFormat );
++ XRange Find( [in] any What, [in] any After, [in] any LookIn, [in] any LookAt, [in] any SearchOrder, [in] any SearchDirection, [in] any MatchCase, [in] any MatchByte, [in] any SearchFormat );
+
+ void Sort( [in] any Key1, [in] any Order1, [in] any Key2, [in] any Type,
+ [in] any Order2, [in] any Key3, [in] any Order3,
+@@ -164,6 +166,7 @@ interface XRange
+ XRange SpecialCells( [in] any Type, [in] /*Optional*/ any Value ) raises ( com::sun::star::script::BasicErrorException );
+ void RemoveSubtotal() raises ( com::sun::star::script::BasicErrorException );
+ void Subtotal( [in] long GroupBy, [in] long Function, [in] /*Optional*/ sequence<long> TotalList, [in] /*Optional*/ any Replace, [in] /*Optional*/ any PageBreaks, [in] any SummaryBelowData ) raises ( com::sun::star::script::BasicErrorException );
++ XRange MergeArea( ) raises ( com::sun::star::script::BasicErrorException );
+
+ };
+
+Index: oovbaapi/org/openoffice/excel/XWindow.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/excel/XWindow.idl,v
+retrieving revision 1.4
+retrieving revision 1.3.4.2
+diff -u -p -b -w -B -r1.4 -r1.3.4.2
+--- oovbaapi/org/openoffice/excel/XWindow.idl 11 Apr 2008 09:57:44 -0000 1.4
++++ oovbaapi/org/openoffice/excel/XWindow.idl 6 Jul 2008 15:37:37 -0000 1.3.4.2
+@@ -44,6 +44,8 @@ module org { module openoffice { modul
+
+ //=============================================================================
+ interface XRange;
++interface XWorksheet;
++interface XPane;
+ interface XWindow
+ {
+ interface ::org::openoffice::vba::XHelperInterface;
+@@ -56,6 +58,8 @@ interface XWindow
+ [attribute] boolean DisplayVerticalScrollBar;
+ [attribute] boolean DisplayWorkbookTabs;
+ [attribute] boolean FreezePanes;
++ [attribute] long Height;
++ [attribute] long Left;
+ [attribute] boolean Split;
+ [attribute] long SplitColumn;
+ [attribute] double SplitHorizontal;
+@@ -63,6 +67,10 @@ interface XWindow
+ [attribute] double SplitVertical;
+ [attribute] any ScrollColumn;
+ [attribute] any ScrollRow;
++ [attribute] long Top;
++ [attribute] any View;
++ [attribute] boolean Visible;
++ [attribute] long Width;
+ [attribute] any WindowState;
+ [attribute] any Zoom;
+ any SelectedSheets( [in] any aIndex );
+@@ -73,7 +81,21 @@ interface XWindow
+ void Close([in] any SaveChanges, [in] any FileName, [in] any RouteWorkBook);
+ XRange ActiveCell() raises(com::sun::star::script::BasicErrorException);
+ any Selection() raises(com::sun::star::script::BasicErrorException);
++ long PointsToScreenPixelsX([in] long Points) raises(com::sun::star::script::BasicErrorException);
++ long PointsToScreenPixelsY([in] long Points) raises(com::sun::star::script::BasicErrorException);
++ void PrintOut([in] /*optional short*/ any From,
++ [in] /*optional short*/ any To,
++ [in] /*optional short*/ any Copies,
++ [in] /*optional boolean*/ any Preview,
++ [in] /*optional string*/ any ActivePrinter,
++ [in] /*optional boolean*/ any PrintToFile,
++ [in] /*optional boolean*/ any Collate,
++ [in] /*optional string*/ any PrToFileName
++ ) raises(com::sun::star::script::BasicErrorException);
++ void PrintPreview( [in] /*Optional*/ any EnableChanges ) raises ( com::sun::star::script::BasicErrorException );
+
++ XWorksheet ActiveSheet() raises(com::sun::star::script::BasicErrorException);
++ XPane ActivePane() raises(com::sun::star::script::BasicErrorException);
+ };
+
+ //=============================================================================
+Index: oovbaapi/org/openoffice/excel/XWorkbook.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/excel/XWorkbook.idl,v
+retrieving revision 1.4
+retrieving revision 1.3.4.2
+diff -u -p -b -w -B -r1.4 -r1.3.4.2
+--- oovbaapi/org/openoffice/excel/XWorkbook.idl 11 Apr 2008 09:58:14 -0000 1.4
++++ oovbaapi/org/openoffice/excel/XWorkbook.idl 6 Jul 2008 15:37:43 -0000 1.3.4.2
+@@ -71,7 +71,7 @@ interface XWorkbook
+ void Activate();
+ void ResetColors() raises (com::sun::star::script::BasicErrorException);
+
+- any Names();
++ any Names( [in] any Index );
+
+ any Colors([in] any Index) raises (com::sun::star::script::BasicErrorException);
+ long FileFormat() raises (com::sun::star::script::BasicErrorException);
+Index: oovbaapi/org/openoffice/excel/XWorksheet.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/excel/XWorksheet.idl,v
+retrieving revision 1.4
+retrieving revision 1.3.4.3
+diff -u -p -b -w -B -r1.4 -r1.3.4.3
+--- oovbaapi/org/openoffice/excel/XWorksheet.idl 11 Apr 2008 09:58:44 -0000 1.4
++++ oovbaapi/org/openoffice/excel/XWorksheet.idl 29 Jul 2008 06:27:52 -0000 1.3.4.3
+@@ -51,6 +51,8 @@ module org { module openoffice { modul
+ interface XComments;
+ interface XRange;
+ interface XOutline;
++interface XPageSetup;
++interface XHPageBreaks;
+ interface XWorksheet
+ {
+ interface ::org::openoffice::vba::XHelperInterface;
+@@ -67,6 +69,7 @@ interface XWorksheet
+ [attribute, readonly] XWorksheet Next;
+ [attribute, readonly] XWorksheet Previous;
+ [attribute, readonly] string CodeName;
++ [attribute, readonly] short Index;
+
+ void Activate();
+ void Calculate( );
+@@ -83,6 +86,8 @@ interface XWorksheet
+ any PivotTables([in] any Index);
+ any Comments([in] any Index);
+ XOutline Outline();
++ XPageSetup PageSetup();
++ any HPageBreaks([in] any Index);
+ any OLEObjects([in] any Index);
+ void ShowDataForm();
+ any Shapes([in] any Index);
+@@ -98,6 +103,7 @@ interface XWorksheet
+
+ void setEnableCalculation([in] boolean EnableCalculation) raises(com::sun::star::script::BasicErrorException);
+ boolean getEnableCalculation() raises(com::sun::star::script::BasicErrorException);
++ void PrintOut( [in] any From, [in] any To, [in] any Copies, [in] any Preview, [in] any ActivePrinter, [in] any PrintToFile, [in] any Collate, [in] any PrToFileName, [in] any IgnorePrintAreas );
+
+
+ };
+Index: oovbaapi/org/openoffice/excel/makefile.mk
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/excel/makefile.mk,v
+retrieving revision 1.4
+retrieving revision 1.4.6.1
+diff -u -p -b -w -B -r1.4 -r1.4.6.1
+--- oovbaapi/org/openoffice/excel/makefile.mk 11 Apr 2008 09:59:47 -0000 1.4
++++ oovbaapi/org/openoffice/excel/makefile.mk 29 Jul 2008 06:27:52 -0000 1.4.6.1
+@@ -96,6 +96,13 @@ IDLFILES= XApplication.idl\
+ XNames.idl \
+ Workbook.idl \
+ Worksheet.idl \
++ Window.idl \
++ XHyperlink.idl \
++ Hyperlink.idl \
++ XPageSetup.idl \
++ XPageBreak.idl \
++ XHPageBreak.idl \
++ XHPageBreaks.idl \
+
+
+ # ------------------------------------------------------------------
+cvs diff: Diffing oovbaapi/org/openoffice/msforms
+Index: oovbaapi/org/openoffice/msforms/XComboBox.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/msforms/XComboBox.idl,v
+retrieving revision 1.3
+retrieving revision 1.2.8.2
+diff -u -p -b -w -B -r1.3 -r1.2.8.2
+--- oovbaapi/org/openoffice/msforms/XComboBox.idl 11 Apr 2008 10:00:49 -0000 1.3
++++ oovbaapi/org/openoffice/msforms/XComboBox.idl 6 Jul 2008 15:37:49 -0000 1.2.8.2
+@@ -44,6 +44,7 @@ module org { module openoffice { modul
+ interface XComboBox: ::com::sun::star::uno::XInterface
+ {
+ [attribute] any Value;
++ [attribute] any ListIndex;
+ [attribute] string Text;
+ void AddItem( [in] any pvargItem, [in] any pvargIndex );
+ void Clear();
+Index: oovbaapi/org/openoffice/msforms/XControl.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/msforms/XControl.idl,v
+retrieving revision 1.3
+retrieving revision 1.2.4.2
+diff -u -p -b -w -B -r1.3 -r1.2.4.2
+--- oovbaapi/org/openoffice/msforms/XControl.idl 11 Apr 2008 10:01:02 -0000 1.3
++++ oovbaapi/org/openoffice/msforms/XControl.idl 6 Jul 2008 15:37:58 -0000 1.2.4.2
+@@ -37,12 +37,17 @@
+
+ //=============================================================================
+
+-module org { module openoffice { module msforms {
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
+
++module org { module openoffice { module msforms {
+
+ //=============================================================================
+-interface XControl: com::sun::star::uno::XInterface
++interface XControl
+ {
++ interface ::org::openoffice::vba::XHelperInterface;
++ void SetFocus();
+ [attribute] boolean Enabled;
+ [attribute] boolean Visible;
+ //Size. there are some defferent between Mso and OOo.
+Index: oovbaapi/org/openoffice/msforms/XGroupBox.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XGroupBox.idl
+diff -N oovbaapi/org/openoffice/msforms/XGroupBox.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XGroupBox.idl 22 Apr 2008 19:50:59 -0000 1.1.2.1
+@@ -0,0 +1,56 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XGroupBox_idl__
++#define __org_openoffice_msforms_XGroupBox_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module msforms {
++//=============================================================================
++interface XGroupBox
++{
++ [attribute] string Caption;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XLabel.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/msforms/XLabel.idl,v
+retrieving revision 1.3
+retrieving revision 1.2.4.2
+diff -u -p -b -w -B -r1.3 -r1.2.4.2
+--- oovbaapi/org/openoffice/msforms/XLabel.idl 11 Apr 2008 10:01:32 -0000 1.3
++++ oovbaapi/org/openoffice/msforms/XLabel.idl 6 Jul 2008 15:38:07 -0000 1.2.4.2
+@@ -41,6 +41,7 @@ module org { module openoffice { modul
+ interface XLabel: com::sun::star::uno::XInterface
+ {
+ [attribute] string Caption;
++ [attribute] any Value;
+ };
+
+ //=============================================================================
+Index: oovbaapi/org/openoffice/msforms/XListBox.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/msforms/XListBox.idl,v
+retrieving revision 1.3
+retrieving revision 1.2.4.3
+diff -u -p -b -w -B -r1.3 -r1.2.4.3
+--- oovbaapi/org/openoffice/msforms/XListBox.idl 11 Apr 2008 10:02:04 -0000 1.3
++++ oovbaapi/org/openoffice/msforms/XListBox.idl 29 Jul 2008 06:27:52 -0000 1.2.4.3
+@@ -44,8 +44,10 @@ interface XListBox: com::sun::star::uno:
+ [attribute] any Value;
+ [attribute] string Text;
+ [attribute] boolean MultiSelect;
++ [attribute] any ListIndex;
+ //[attribute] sequence< boolean > Selected;
+ void AddItem( [in] any pvargItem, [in] any pvargIndex );
++ void removeItem( [in] any index );
+ void Clear();
+ any Selected( [in] long index );
+ };
+Index: oovbaapi/org/openoffice/msforms/XMultiPage.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XMultiPage.idl
+diff -N oovbaapi/org/openoffice/msforms/XMultiPage.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XMultiPage.idl 22 Apr 2008 19:50:59 -0000 1.1.2.1
+@@ -0,0 +1,58 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XMultiPage_idl__
++#define __org_openoffice_msforms_XMultiPage_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module msforms {
++
++//=============================================================================
++interface XMultiPage: com::sun::star::uno::XInterface
++{
++ [attribute] long Value;
++ any Pages( [in] any index );
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XPages.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XPages.idl
+diff -N oovbaapi/org/openoffice/msforms/XPages.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XPages.idl 22 Apr 2008 19:50:59 -0000 1.1.2.1
+@@ -0,0 +1,61 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XPage_idl__
++#define __org_openoffice_msforms_XPage_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++#ifndef __org_openoffice_vba_XCollection_idl__
++#include <org/openoffice/vba/XCollection.idl>
++#endif
++
++//=============================================================================
++
++module org { module openoffice { module msforms {
++
++//=============================================================================
++interface XPages
++{
++ interface org::openoffice::vba::XCollection;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XProgressBar.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XProgressBar.idl
+diff -N oovbaapi/org/openoffice/msforms/XProgressBar.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XProgressBar.idl 22 Apr 2008 19:51:00 -0000 1.1.2.1
+@@ -0,0 +1,57 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XProgressBar_idl__
++#define __org_openoffice_msforms_XProgressBar_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module msforms {
++
++//=============================================================================
++interface XProgressBar: com::sun::star::uno::XInterface
++{
++ [attribute] any Value;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XRadioButton.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/msforms/XRadioButton.idl,v
+retrieving revision 1.3
+retrieving revision 1.2.4.2
+diff -u -p -b -w -B -r1.3 -r1.2.4.2
+--- oovbaapi/org/openoffice/msforms/XRadioButton.idl 11 Apr 2008 10:02:36 -0000 1.3
++++ oovbaapi/org/openoffice/msforms/XRadioButton.idl 6 Jul 2008 15:38:04 -0000 1.2.4.2
+@@ -41,7 +41,7 @@ module org { module openoffice { modul
+ interface XRadioButton: com::sun::star::uno::XInterface
+ {
+ [attribute] string Caption;
+- [attribute] boolean Value;
++ [attribute] any Value;
+ };
+
+ //=============================================================================
+Index: oovbaapi/org/openoffice/msforms/XScrollBar.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XScrollBar.idl
+diff -N oovbaapi/org/openoffice/msforms/XScrollBar.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XScrollBar.idl 29 Jul 2008 06:27:52 -0000 1.1.2.2
+@@ -0,0 +1,61 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XScrollBar_idl__
++#define __org_openoffice_msforms_XScrollBar_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module msforms {
++
++//=============================================================================
++interface XScrollBar: com::sun::star::uno::XInterface
++{
++ [attribute] long Max;
++ [attribute] long Min;
++ [attribute] any Value;
++ [attribute] long LargeChange;
++ [attribute] long SmallChange;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XSpinButton.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XSpinButton.idl
+diff -N oovbaapi/org/openoffice/msforms/XSpinButton.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XSpinButton.idl 29 Jul 2008 06:27:52 -0000 1.1.2.1
+@@ -0,0 +1,59 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XSpinButton_idl__
++#define __org_openoffice_msforms_XSpinButton_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module msforms {
++
++//=============================================================================
++interface XSpinButton: com::sun::star::uno::XInterface
++{
++ [attribute] long Max;
++ [attribute] long Min;
++ [attribute] any Value;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XTextBox.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/msforms/XTextBox.idl,v
+retrieving revision 1.3
+retrieving revision 1.2.4.2
+diff -u -p -b -w -B -r1.3 -r1.2.4.2
+--- oovbaapi/org/openoffice/msforms/XTextBox.idl 11 Apr 2008 10:03:37 -0000 1.3
++++ oovbaapi/org/openoffice/msforms/XTextBox.idl 6 Jul 2008 15:38:01 -0000 1.2.4.2
+@@ -41,7 +41,7 @@ module org { module openoffice { modul
+ interface XTextBox: com::sun::star::uno::XInterface
+ {
+ [attribute] string Text;
+-// [attribute] any Value;
++ [attribute] any Value;
+ [attribute] long MaxLength;
+ [attribute] boolean Multiline;
+ };
+Index: oovbaapi/org/openoffice/msforms/XTextBoxShape.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XTextBoxShape.idl
+diff -N oovbaapi/org/openoffice/msforms/XTextBoxShape.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XTextBoxShape.idl 14 Feb 2008 15:29:05 -0000 1.1.2.2
+@@ -0,0 +1,61 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XTextBoxShape_idl__
++#define __org_openoffice_msforms_XTextBoxShape_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++#ifndef __org_openoffice_excel_XCharacters_idl
++#include <org/openoffice/excel/XCharacters.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module msforms {
++
++//=============================================================================
++interface XTextBoxShape: com::sun::star::uno::XInterface
++{
++ [attribute] string Text;
++ ::org::openoffice::excel::XCharacters characters([in] any Start, [in] any Length);
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XToggleButton.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XToggleButton.idl
+diff -N oovbaapi/org/openoffice/msforms/XToggleButton.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XToggleButton.idl 22 Apr 2008 19:51:00 -0000 1.1.2.1
+@@ -0,0 +1,60 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XToggleButton_idl__
++#define __org_openoffice_msforms_XToggleButton_idl__
++
++#ifndef __org_openoffice_msforms_XButton_idl__
++#include <org/openoffice/msforms/XButton.idl>
++#endif
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module msforms {
++//=============================================================================
++interface XToggleButton
++{
++ interface XButton;
++ [attribute] any Value;
++};
++
++//=============================================================================
++
++}; }; };
++
++#endif
++
++
+Index: oovbaapi/org/openoffice/msforms/XUserForm.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/msforms/XUserForm.idl
+diff -N oovbaapi/org/openoffice/msforms/XUserForm.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/msforms/XUserForm.idl 22 Apr 2008 19:51:00 -0000 1.1.2.1
+@@ -0,0 +1,57 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_msforms_XUserForm_idl__
++#define __org_openoffice_msforms_XUserForm_idl__
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++#ifndef __com_sun_star_script_XInvocation_idl__
++#include <com/sun/star/script/XInvocation.idl>
++#endif
++module org { module openoffice { module msforms {
++interface XUserForm
++{
++ //interface ::org::openoffice::vba::XHelperInterface;
++ interface ::com::sun::star::script::XInvocation;
++ [attribute] string Caption;
++ void Show();
++ void Hide();
++ void RePaint();
++ void UnloadObject();
++};
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/msforms/makefile.mk
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/msforms/makefile.mk,v
+retrieving revision 1.4
+retrieving revision 1.3.4.4
+diff -u -p -b -w -B -r1.4 -r1.3.4.4
+--- oovbaapi/org/openoffice/msforms/makefile.mk 11 Apr 2008 10:03:53 -0000 1.4
++++ oovbaapi/org/openoffice/msforms/makefile.mk 29 Jul 2008 06:27:52 -0000 1.3.4.4
+@@ -60,7 +60,15 @@ IDLFILES=\
+ XFillFormat.idl \
+ XPictureFormat.idl \
+ XShapeRange.idl \
+- XListBox.idl
++ XTextBoxShape.idl \
++ XUserForm.idl \
++ XListBox.idl \
++ XToggleButton.idl \
++ XScrollBar.idl \
++ XProgressBar.idl \
++ XMultiPage.idl \
++ XPages.idl \
++ XSpinButton.idl \
+
+ # ------------------------------------------------------------------
+
+cvs diff: Diffing oovbaapi/org/openoffice/vba
+Index: oovbaapi/org/openoffice/vba/XAssistant.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/vba/XAssistant.idl
+diff -N oovbaapi/org/openoffice/vba/XAssistant.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/vba/XAssistant.idl 18 Jan 2008 19:28:17 -0000 1.1.2.1
+@@ -0,0 +1,65 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_XAssistant_idl__
++#define __org_openoffice_vba_XAssistant_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module vba {
++//=============================================================================
++
++interface XAssistant
++{
++ interface ::org::openoffice::vba::XHelperInterface;
++
++ [attribute] boolean On;
++ [attribute] boolean Visible;
++ [attribute] long Top;
++ [attribute] long Left;
++ [attribute] long Animation;
++
++ string Name() raises ( com::sun::star::script::BasicErrorException );
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/vba/XCommandBar.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/vba/XCommandBar.idl
+diff -N oovbaapi/org/openoffice/vba/XCommandBar.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/vba/XCommandBar.idl 29 Jul 2008 06:27:53 -0000 1.1.2.1
+@@ -0,0 +1,64 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_XCommandBar_idl__
++#define __org_openoffice_vba_XCommandBar_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module vba {
++//=============================================================================
++interface XCommandBarControls;
++
++interface XCommandBar
++{
++ interface XHelperInterface;
++
++ [attribute] string Name;
++ [attribute] boolean Visible;
++
++ void Delete() raises ( com::sun::star::script::BasicErrorException );
++ any Controls( [in] any Index ) raises ( com::sun::star::script::BasicErrorException );
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/vba/XCommandBarControl.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/vba/XCommandBarControl.idl
+diff -N oovbaapi/org/openoffice/vba/XCommandBarControl.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/vba/XCommandBarControl.idl 29 Jul 2008 06:27:53 -0000 1.1.2.1
+@@ -0,0 +1,64 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_XCommandBarControl_idl__
++#define __org_openoffice_vba_XCommandBarControl_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XHelperInterface_idl__
++#include <org/openoffice/vba/XHelperInterface.idl>
++#endif
++//=============================================================================
++
++module org { module openoffice { module vba {
++//=============================================================================
++
++interface XCommandBarControl
++{
++ interface XHelperInterface;
++
++ [attribute] string Caption;
++ [attribute] string OnAction;
++ [attribute] boolean Visible;
++
++ void Delete() raises ( com::sun::star::script::BasicErrorException );
++ any Controls( [in] any Index ) raises ( com::sun::star::script::BasicErrorException );
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/vba/XCommandBarControls.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/vba/XCommandBarControls.idl
+diff -N oovbaapi/org/openoffice/vba/XCommandBarControls.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/vba/XCommandBarControls.idl 29 Jul 2008 06:27:53 -0000 1.1.2.1
+@@ -0,0 +1,61 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_XCommandBarControls_idl__
++#define __org_openoffice_vba_XCommandBarControls_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XCollection_idl__
++#include <org/openoffice/vba/XCollection.idl>
++#endif
++
++//=============================================================================
++
++module org { module openoffice { module vba {
++//=============================================================================
++interface XCommandBarControl;
++
++interface XCommandBarControls
++{
++ interface XCollection;
++
++ XCommandBarControl Add( [in] any Type, [in] any Id, [in] any Parameter, [in] any Before, [in] any Temporary ) raises ( com::sun::star::script::BasicErrorException );
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/vba/XCommandBars.idl
+===================================================================
+RCS file: oovbaapi/org/openoffice/vba/XCommandBars.idl
+diff -N oovbaapi/org/openoffice/vba/XCommandBars.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ oovbaapi/org/openoffice/vba/XCommandBars.idl 29 Jul 2008 06:27:53 -0000 1.1.2.1
+@@ -0,0 +1,61 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_XCommandBars_idl__
++#define __org_openoffice_vba_XCommandBars_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __org_openoffice_vba_XCollection_idl__
++#include <org/openoffice/vba/XCollection.idl>
++#endif
++
++//=============================================================================
++
++module org { module openoffice { module vba {
++//=============================================================================
++interface XCommandBar;
++
++interface XCommandBars
++{
++ interface XCollection;
++
++ XCommandBar Add( [in] any Name, [in] any Position, [in] any MenuBar, [in] any Temporary ) raises ( com::sun::star::script::BasicErrorException );
++};
++
++}; }; };
++
++#endif
+Index: oovbaapi/org/openoffice/vba/XGlobals.idl
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/vba/XGlobals.idl,v
+retrieving revision 1.4
+retrieving revision 1.3.4.2
+diff -u -p -b -w -B -r1.4 -r1.3.4.2
+--- oovbaapi/org/openoffice/vba/XGlobals.idl 11 Apr 2008 10:05:01 -0000 1.4
++++ oovbaapi/org/openoffice/vba/XGlobals.idl 6 Jul 2008 15:37:34 -0000 1.3.4.2
+@@ -57,7 +57,7 @@ interface XGlobals: com::sun::star::uno:
+ any WorkBooks( [in] any aIndex );
+ any Sheets( [in] any aIndex );
+ any Range( [in] any Cell1, [in] any Cell2 );
+- any Names( );
++ any Names( [in] any Index );
+ };
+
+ }; }; };
+Index: oovbaapi/org/openoffice/vba/makefile.mk
+===================================================================
+RCS file: /cvs/api/oovbaapi/org/openoffice/vba/makefile.mk,v
+retrieving revision 1.4
+retrieving revision 1.3.4.3
+diff -u -p -b -w -B -r1.4 -r1.3.4.3
+--- oovbaapi/org/openoffice/vba/makefile.mk 11 Apr 2008 10:06:09 -0000 1.4
++++ oovbaapi/org/openoffice/vba/makefile.mk 29 Jul 2008 06:27:53 -0000 1.3.4.3
+@@ -52,6 +52,11 @@ IDLFILES=\
+ XVBAToOOEventDescGen.idl\
+ XPropValue.idl\
+ XHelperInterface.idl\
++ XAssistant.idl\
++ XCommandBarControl.idl\
++ XCommandBarControls.idl\
++ XCommandBar.idl\
++ XCommandBars.idl\
+ Globals.idl\
+
+ # ------------------------------------------------------------------
+cvs diff: Diffing oovbaapi/prj
+cvs diff: Diffing oovbaapi/util
Modified: trunk/patches/dev300/cws-npower11.diff
==============================================================================
--- trunk/patches/dev300/cws-npower11.diff (original)
+++ trunk/patches/dev300/cws-npower11.diff Fri Aug 1 08:35:30 2008
@@ -9,11 +9,30 @@
===================================================================
RCS file: /cvs/sc/sc/inc/document.hxx,v
retrieving revision 1.115
-retrieving revision 1.115.22.1
-diff -u -p -b -w -B -r1.115 -r1.115.22.1
+retrieving revision 1.115.22.2
+diff -u -p -b -w -B -r1.115 -r1.115.22.2
--- sc/inc/document.hxx 8 Jul 2008 07:19:13 -0000 1.115
-+++ sc/inc/document.hxx 29 Jul 2008 06:35:39 -0000 1.115.22.1
-@@ -703,7 +703,7 @@ SC_DLLPUBLIC ScDBCollection* GetDBCollec
++++ sc/inc/document.hxx 1 Aug 2008 03:32:42 -0000 1.115.22.2
+@@ -150,6 +150,9 @@ namespace com { namespace sun { namespac
+ }
+ } } }
+
++namespace com { namespace sun { namespace star { namespace document {
++ class XVbaEventsHelper;
++} } } }
+ #include <svtools/zforlist.hxx>
+ /*
+ #ifdef _ZFORLIST_DECLARE_TABLE
+@@ -307,6 +310,8 @@ private:
+
+ Timer aTrackTimer;
+
++ com::sun::star::uno::Reference< com::sun::star::document::XVbaEventsHelper > mxVbaEventsHelper;
++
+ public:
+ ScTabOpList aTableOpList; // list of ScInterpreterTableOpParams currently in use
+ ScInterpreterTableOpParams aLastTableOpParams; // remember last params
+@@ -703,7 +708,7 @@ SC_DLLPUBLIC ScDBCollection* GetDBCollec
BOOL HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect );
BOOL HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect );
@@ -22,6 +41,48 @@
BOOL SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline );
void DoAutoOutline( SCCOL nStartCol, SCROW nStartRow,
+@@ -1709,6 +1714,8 @@ public:
+ void GetSortParam( ScSortParam& rParam, SCTAB nTab );
+ void SetSortParam( ScSortParam& rParam, SCTAB nTab );
+
++ com::sun::star::uno::Reference< com::sun::star::document::XVbaEventsHelper > GetVbaEventsHelper();
++
+ /** Should only be GRAM_PODF or GRAM_ODFF. */
+ void SetStorageGrammar( ScGrammar::Grammar eGrammar );
+ ScGrammar::Grammar GetStorageGrammar() const
+Index: sc/inc/docuno.hxx
+===================================================================
+RCS file: /cvs/sc/sc/inc/docuno.hxx,v
+retrieving revision 1.27
+retrieving revision 1.27.96.1
+diff -u -p -b -w -B -r1.27 -r1.27.96.1
+--- sc/inc/docuno.hxx 10 Apr 2008 18:26:48 -0000 1.27
++++ sc/inc/docuno.hxx 1 Aug 2008 03:32:42 -0000 1.27.96.1
+@@ -55,6 +55,7 @@
+ #include <com/sun/star/sheet/XSheetAnnotations.hpp>
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <com/sun/star/sheet/XCellRangesAccess.hpp>
++#include <com/sun/star/document/XDocumentEventCompatibleHelper.hpp>
+ #include <cppuhelper/implbase2.hxx>
+ #include <cppuhelper/implbase3.hxx>
+ #include <cppuhelper/implbase4.hxx>
+@@ -86,6 +87,7 @@ class SC_DLLPUBLIC ScModelObj : public S
+ public com::sun::star::view::XRenderable,
+ public com::sun::star::document::XLinkTargetSupplier,
+ public com::sun::star::beans::XPropertySet,
++ public com::sun::star::document::XDocumentEventCompatibleHelper,
+ public SvxFmMSFactory, // derived from XMultiServiceFactory
+ public com::sun::star::lang::XServiceInfo
+ {
+@@ -298,6 +300,8 @@ public:
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
+ throw(::com::sun::star::uno::RuntimeException);
++ // XVbaEventHelper
++ virtual sal_Bool SAL_CALL processCompatibleEvent( sal_Int16 nEventId ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+
Index: sc/inc/olinetab.hxx
===================================================================
RCS file: /cvs/sc/sc/inc/olinetab.hxx,v
@@ -58,6 +119,113 @@
cvs diff: Diffing sc/source
cvs diff: Diffing sc/source/core
cvs diff: Diffing sc/source/core/data
+Index: sc/source/core/data/documen2.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/documen2.cxx,v
+retrieving revision 1.74
+retrieving revision 1.74.22.1
+diff -u -p -b -w -B -r1.74 -r1.74.22.1
+--- sc/source/core/data/documen2.cxx 7 Jul 2008 07:39:38 -0000 1.74
++++ sc/source/core/data/documen2.cxx 1 Aug 2008 03:32:42 -0000 1.74.22.1
+@@ -93,6 +93,7 @@
+ #include "listenercalls.hxx"
+ #include "recursionhelper.hxx"
+ #include "lookupcache.hxx"
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
+
+ // pImpl because including lookupcache.hxx in document.hxx isn't wanted, and
+ // dtor plus helpers are convenient.
+@@ -1874,3 +1875,26 @@ void ScDocument::ClearLookupCaches()
+ {
+ pLookupCacheMapImpl->clear();
+ }
++
++using namespace com::sun::star;
++uno::Reference< document::XVbaEventsHelper >
++ScDocument::GetVbaEventsHelper()
++{
++ if( !mxVbaEventsHelper.is() )
++ {
++ try
++ {
++ uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
++ uno::Reference< frame::XModel > xModel( pShell ? pShell->GetModel() : NULL, uno::UNO_QUERY );
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] = uno::Any( xModel );
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.VbaEventsHelper" ) ), aArgs ), uno::UNO_QUERY );
++ // helper will always be created successfully.
++ mxVbaEventsHelper.set( xVbaEventsHelper, uno::UNO_QUERY );
++ }
++ catch( uno::Exception& e )
++ {
++ }
++ }
++ return mxVbaEventsHelper;
++}
+Index: sc/source/core/data/documen7.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/documen7.cxx,v
+retrieving revision 1.12
+retrieving revision 1.12.96.1
+diff -u -p -b -w -B -r1.12 -r1.12.96.1
+--- sc/source/core/data/documen7.cxx 10 Apr 2008 19:23:56 -0000 1.12
++++ sc/source/core/data/documen7.cxx 1 Aug 2008 03:32:42 -0000 1.12.96.1
+@@ -59,7 +59,15 @@
+
+
+ #include "globstr.hrc"
++#include <algorithm>
++#include <vector>
+
++
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
++#include <com/sun/star/document/VbaEventId.hpp>
++
++using namespace com::sun::star;
++using namespace com::sun::star::document::VbaEventId;
+ extern const ScFormulaCell* pLastFormulaTreeTop; // cellform.cxx Err527 WorkAround
+
+ // STATIC DATA -----------------------------------------------------------
+@@ -449,6 +457,7 @@ void ScDocument::TrackFormulas( ULONG nH
+ ScFormulaCell* pTrack;
+ ScFormulaCell* pNext;
+ pTrack = pFormulaTrack;
++ ::std::vector<SCTAB> aTabs;
+ do
+ {
+ ScHint aHint( nHintId, pTrack->aPos, pTrack );
+@@ -458,6 +467,12 @@ void ScDocument::TrackFormulas( ULONG nH
+ // Repaint fuer bedingte Formate mit relativen Referenzen:
+ if ( pCondFormList )
+ pCondFormList->SourceChanged( pTrack->aPos );
++ ::std::vector<SCTAB>::iterator result;
++ result = ::std::find( aTabs.begin(), aTabs.end(), pTrack->aPos.Tab() );
++ if( result == aTabs.end() )
++ {
++ aTabs.push_back( pTrack->aPos.Tab() );
++ }
+ pTrack = pTrack->GetNextTrack();
+ } while ( pTrack );
+ pTrack = pFormulaTrack;
+@@ -480,6 +495,18 @@ void ScDocument::TrackFormulas( ULONG nH
+ else
+ SetForcedFormulaPending( TRUE );
+ }
++
++ ::std::vector<SCTAB>::iterator iter;
++ for( iter = aTabs.begin(); iter != aTabs.end(); iter++ )
++ {
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( GetVbaEventsHelper(), uno::UNO_QUERY );
++ if( xVbaEventsHelper.is() )
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] <<= *iter;
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_CALCULATE, aArgs );
++ }
++ }
+ }
+ DBG_ASSERT( nFormulaTrackCount==0, "TrackFormulas: nFormulaTrackCount!=0" );
+ }
cvs diff: Diffing sc/source/core/inc
cvs diff: Diffing sc/source/core/src
cvs diff: Diffing sc/source/core/tool
@@ -80,9 +248,202 @@
cvs diff: Diffing sc/source/ui/cctrl
cvs diff: Diffing sc/source/ui/dbgui
cvs diff: Diffing sc/source/ui/docshell
+Index: sc/source/ui/docshell/docsh.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/docshell/docsh.cxx,v
+retrieving revision 1.103
+retrieving revision 1.103.22.1
+diff -u -p -b -w -B -r1.103 -r1.103.22.1
+--- sc/source/ui/docshell/docsh.cxx 8 Jul 2008 09:43:20 -0000 1.103
++++ sc/source/ui/docshell/docsh.cxx 1 Aug 2008 03:32:43 -0000 1.103.22.1
+@@ -132,6 +132,13 @@
+ #include <rtl/logfile.hxx>
+
+ #include <comphelper/processfactory.hxx>
++#include "uiitems.hxx"
++#include "cellsuno.hxx"
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
++#include <com/sun/star/document/VbaEventId.hpp>
++
++using namespace com::sun::star;
++using namespace com::sun::star::document::VbaEventId;
+
+ using namespace com::sun::star;
+
+@@ -515,6 +522,10 @@ sal_uInt16 ScDocShell::GetHiddenInformat
+ void ScDocShell::BeforeXMLLoading()
+ {
+ aDocument.DisableIdle( TRUE );
++ // suppress VBA events when loading the xml
++ uno::Reference< document::XVbaEventsHelper > xEvt( aDocument.GetVbaEventsHelper() );
++ if ( xEvt.is() )
++ xEvt->setIgnoreEvents( sal_True );
+
+ // prevent unnecessary broadcasts and updates
+ DBG_ASSERT(pModificator == NULL, "The Modificator should not exist");
+@@ -600,6 +611,10 @@ void ScDocShell::AfterXMLLoading(sal_Boo
+ else
+ aDocument.SetInsertingFromOtherDoc( FALSE );
+
++ // suppress VBA events when loading the xml
++ uno::Reference< document::XVbaEventsHelper > xEvt( aDocument.GetVbaEventsHelper() );
++ if ( xEvt.is() )
++ xEvt->setIgnoreEvents( sal_False );
+ aDocument.SetImportingXML( FALSE );
+ aDocument.EnableUndo( TRUE );
+ bIsEmpty = FALSE;
+@@ -720,9 +735,71 @@ BOOL __EXPORT ScDocShell::Load( SfxMediu
+ return bRet;
+ }
+
++void lcl_processCompatibleSfxHint( uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper, const SfxHint& rHint )
++{
++ if (rHint.ISA(ScTablesHint) )
++ {
++ USHORT nId = ((ScTablesHint&)rHint).GetId();
++ SCTAB nTab = ((ScTablesHint&)rHint).GetTab1();
++ if( nId == SC_TAB_INSERTED )
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] <<= nTab;
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_NEWSHEET, aArgs );
++ }
++ }
++ else if ( rHint.ISA( SfxEventHint ) )
++ {
++ ULONG nEventId = ((SfxEventHint&)rHint).GetEventId();
++ switch ( nEventId )
++ {
++ case SFX_EVENT_ACTIVATEDOC:
++ {
++ uno::Sequence< uno::Any > aArgs;
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_ACTIVATE, aArgs );
++ }
++ break;
++ case SFX_EVENT_DEACTIVATEDOC:
++ {
++ uno::Sequence< uno::Any > aArgs;
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_DEACTIVATE, aArgs );
++ }
++ break;
++ /*case SFX_EVENT_CLOSEDOC :
++ {
++ uno::Sequence< uno::Any > aArgs;
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_CLOSE, aArgs );
++ }
++ break;
++ case SFX_EVENT_CLOSEVIEW :
++ {
++ uno::Sequence< uno::Any > aArgs;
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_WINDOWCOLSE, aArgs );
++ }
++ break;
++ */
++ case SFX_EVENT_OPENDOC:
++ {
++ // some later than workbook activate.
++ uno::Sequence< uno::Any > aArgs;
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_OPEN, aArgs );
++ }
++ break;
++ default:
++ {
++ }
++ break;
++ }
++ }
++}
+
+ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
+ {
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( aDocument.GetVbaEventsHelper(), uno::UNO_QUERY );
++ if ( xVbaEventsHelper.is() )
++ {
++ lcl_processCompatibleSfxHint( xVbaEventsHelper, rHint );
++ }
+ if (rHint.ISA(SfxSimpleHint)) // ohne Parameter
+ {
+ ULONG nSlot = ((const SfxSimpleHint&)rHint).GetId();
+@@ -2268,6 +2345,16 @@ USHORT __EXPORT ScDocShell::PrepareClose
+
+ DoEnterHandler();
+
++ // start handler for possible veto from DocBefore_Close
++ uno::Sequence< uno::Any > aArgs;
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( aDocument.GetVbaEventsHelper(), uno::UNO_QUERY );
++ if ( !IsInPrepareClose() && xVbaEventsHelper.is() )
++ {
++ if ( xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFORECLOSE, aArgs ) )
++ return sal_False;
++ }
++ // end handler code
++
+ USHORT nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
+ if (nRet == TRUE) // TRUE = schliessen
+ aDocument.DisableIdle(TRUE); // nicht mehr drin rumpfuschen !!!
+@@ -2477,6 +2564,34 @@ void ScDocShell::SetModified( BOOL bModi
+ }
+ }
+
++void ScDocShell::PostContentChanged( const ScRange& rRange )
++{
++ ScRangeList aList;
++ aList.Append(rRange);
++ PostContentChanged(aList);
++}
++
++void ScDocShell::PostContentChanged( const ScRangeList& rList )
++{
++ ScCellRangesBase* pObj = NULL;
++ const ScRange& rRange = *(rList.GetObject(0));
++ if( rList.Count() == 1 )
++ {
++ if (rRange.aStart == rRange.aEnd)
++ pObj = new ScCellObj( this, rRange.aStart );
++ else
++ pObj = new ScCellRangeObj( this, rRange );
++ }
++ else
++ pObj = new ScCellRangesObj( this, rList );
++
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] = uno::makeAny(uno::Reference<uno::XInterface>(static_cast<cppu::OWeakObject*>(pObj)));
++
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper( aDocument.GetVbaEventsHelper(), uno::UNO_QUERY );
++ if ( xVbaEventsHelper.is() )
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_CHANGE, aArgs );
++}
+
+ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
+ {
cvs diff: Diffing sc/source/ui/drawfunc
cvs diff: Diffing sc/source/ui/formdlg
cvs diff: Diffing sc/source/ui/inc
+Index: sc/source/ui/inc/docsh.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/inc/docsh.hxx,v
+retrieving revision 1.50
+retrieving revision 1.50.96.1
+diff -u -p -b -w -B -r1.50 -r1.50.96.1
+--- sc/source/ui/inc/docsh.hxx 15 Apr 2008 14:34:04 -0000 1.50
++++ sc/source/ui/inc/docsh.hxx 1 Aug 2008 03:32:43 -0000 1.50.96.1
+@@ -47,6 +47,7 @@
+ #include "refreshtimer.hxx"
+
+ #include <hash_map>
++#include <cppuhelper/implbase1.hxx>
+
+ class ScEditEngineDefaulter;
+ class FontList;
+@@ -326,6 +327,8 @@ public:
+ void PostPaintExtras();
+
+ void PostDataChanged();
++ void PostContentChanged( const ScRange& rRange ); // for worsheet/workbook changed event
++ void PostContentChanged( const ScRangeList& rList );
+
+ void UpdatePaintExt( USHORT& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
+ SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab );
cvs diff: Diffing sc/source/ui/miscdlgs
cvs diff: Diffing sc/source/ui/namedlg
cvs diff: Diffing sc/source/ui/navipi
@@ -91,16 +452,440 @@
cvs diff: Diffing sc/source/ui/src
cvs diff: Diffing sc/source/ui/styleui
cvs diff: Diffing sc/source/ui/undo
+Index: sc/source/ui/undo/undoblk.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/undo/undoblk.cxx,v
+retrieving revision 1.27
+retrieving revision 1.27.96.1
+diff -u -p -b -w -B -r1.27 -r1.27.96.1
+--- sc/source/ui/undo/undoblk.cxx 11 Apr 2008 00:24:23 -0000 1.27
++++ sc/source/ui/undo/undoblk.cxx 1 Aug 2008 03:32:43 -0000 1.27.96.1
+@@ -125,6 +125,7 @@ ScUndoInsertCells::ScUndoInsertCells( Sc
+ }
+
+ SetChangeTrack();
++ pDocShell->PostContentChanged( aEffRange );
+ }
+
+ __EXPORT ScUndoInsertCells::~ScUndoInsertCells()
+@@ -271,6 +272,7 @@ void __EXPORT ScUndoInsertCells::Undo()
+ BeginUndo();
+ DoChange( TRUE );
+ EndUndo();
++ pDocShell->PostContentChanged( aEffRange );
+ }
+
+ void __EXPORT ScUndoInsertCells::Redo()
+@@ -279,6 +281,7 @@ void __EXPORT ScUndoInsertCells::Redo()
+ BeginRedo();
+ DoChange( FALSE );
+ EndRedo();
++ pDocShell->PostContentChanged( aEffRange );
+
+ if ( pPasteUndo )
+ pPasteUndo->Redo(); // redo paste last
+@@ -333,6 +336,7 @@ ScUndoDeleteCells::ScUndoDeleteCells( Sc
+ }
+
+ SetChangeTrack();
++ pDocShell->PostContentChanged( aEffRange );
+ }
+
+ __EXPORT ScUndoDeleteCells::~ScUndoDeleteCells()
+@@ -474,6 +478,7 @@ void __EXPORT ScUndoDeleteCells::Undo()
+ BeginUndo();
+ DoChange( TRUE );
+ EndUndo();
++ pDocShell->PostContentChanged( aEffRange );
+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+
+ // Markierung erst nach EndUndo
+@@ -488,6 +493,7 @@ void __EXPORT ScUndoDeleteCells::Redo()
+ BeginRedo();
+ DoChange( FALSE);
+ EndRedo();
++ pDocShell->PostContentChanged( aEffRange );
+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+@@ -714,6 +720,7 @@ ScUndoCut::ScUndoCut( ScDocShell* pNewDo
+ aExtendedRange( aRange )
+ {
+ SetChangeTrack();
++ pDocShell->PostContentChanged( aExtendedRange );
+ }
+
+ __EXPORT ScUndoCut::~ScUndoCut()
+@@ -778,6 +785,7 @@ void __EXPORT ScUndoCut::Undo()
+ BeginUndo();
+ DoChange( TRUE );
+ EndUndo();
++ pDocShell->PostContentChanged( aExtendedRange );
+ }
+
+ void __EXPORT ScUndoCut::Redo()
+@@ -788,6 +796,7 @@ void __EXPORT ScUndoCut::Redo()
+ DoChange( FALSE );
+ EnableDrawAdjust( pDoc, TRUE ); //! include in ScBlockUndo?
+ EndRedo();
++ pDocShell->PostContentChanged( aExtendedRange );
+ }
+
+ void __EXPORT ScUndoCut::Repeat(SfxRepeatTarget& rTarget)
+@@ -839,6 +848,7 @@ ScUndoPaste::ScUndoPaste( ScDocShell* pN
+ aPasteOptions = *pOptions; // used only for Repeat
+
+ SetChangeTrack();
++ pDocShell->PostContentChanged( aBlockRange );
+ }
+
+ __EXPORT ScUndoPaste::~ScUndoPaste()
+@@ -1020,6 +1030,7 @@ void __EXPORT ScUndoPaste::Undo()
+ DoChange( TRUE );
+ ShowTable( aBlockRange );
+ EndUndo();
++ pDocShell->PostContentChanged( aBlockRange );
+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+ }
+
+@@ -1031,6 +1042,7 @@ void __EXPORT ScUndoPaste::Redo()
+ DoChange( FALSE );
+ EnableDrawAdjust( pDoc, TRUE ); //! include in ScBlockUndo?
+ EndRedo();
++ pDocShell->PostContentChanged( aBlockRange );
+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+ }
+
+Index: sc/source/ui/undo/undoblk3.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/undo/undoblk3.cxx,v
+retrieving revision 1.22
+retrieving revision 1.22.96.1
+diff -u -p -b -w -B -r1.22 -r1.22.96.1
+--- sc/source/ui/undo/undoblk3.cxx 11 Apr 2008 00:24:52 -0000 1.22
++++ sc/source/ui/undo/undoblk3.cxx 1 Aug 2008 03:32:43 -0000 1.22.96.1
+@@ -78,7 +78,17 @@ TYPEINIT1(ScUndoInsertAreaLink, SfxUndo
+ TYPEINIT1(ScUndoRemoveAreaLink, SfxUndoAction);
+ TYPEINIT1(ScUndoUpdateAreaLink, SfxUndoAction);
+
+-
++void lcl_PostContentChanged( ScDocShell* pDocShell, const ScMarkData& rMark, const ScRange& rRange )
++{
++ if (rMark.IsMarked() || rMark.IsMultiMarked())
++ {
++ ScRangeList aList;
++ rMark.FillRangeListWithMarks(&aList, false);
++ pDocShell->PostContentChanged(aList);
++ }
++ else
++ pDocShell->PostContentChanged( rRange );
++}
+ // To Do:
+ /*A*/ // SetOptimalHeight auf Dokument, wenn keine View
+
+@@ -112,6 +122,8 @@ ScUndoDeleteContents::ScUndoDeleteConten
+ aMarkData.SetMarkArea( aRange ); // Zelle unter Cursor markieren
+
+ SetChangeTrack();
++
++ lcl_PostContentChanged( pDocShell, aMarkData, aRange );
+ }
+
+
+@@ -212,6 +224,7 @@ void __EXPORT ScUndoDeleteContents::Undo
+ BeginUndo();
+ DoChange( TRUE );
+ EndUndo();
++ lcl_PostContentChanged( pDocShell, aMarkData, aRange );
+ }
+
+
+@@ -222,6 +235,7 @@ void __EXPORT ScUndoDeleteContents::Redo
+ BeginRedo();
+ DoChange( FALSE );
+ EndRedo();
++ lcl_PostContentChanged( pDocShell, aMarkData, aRange );
+ }
+
+
+Index: sc/source/ui/undo/undocell.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/undo/undocell.cxx,v
+retrieving revision 1.15
+retrieving revision 1.15.96.1
+diff -u -p -b -w -B -r1.15 -r1.15.96.1
+--- sc/source/ui/undo/undocell.cxx 11 Apr 2008 00:25:08 -0000 1.15
++++ sc/source/ui/undo/undocell.cxx 1 Aug 2008 03:32:44 -0000 1.15.96.1
+@@ -198,6 +198,7 @@ ScUndoEnterData::ScUndoEnterData( ScDocS
+ nCount( nNewCount )
+ {
+ SetChangeTrack();
++ pDocShell->PostContentChanged( ScRange( ScAddress( nCol, nRow, nTab ) ) );
+ }
+
+ __EXPORT ScUndoEnterData::~ScUndoEnterData()
+@@ -303,6 +304,7 @@ void __EXPORT ScUndoEnterData::Undo()
+
+ DoChange();
+ EndUndo();
++ pDocShell->PostContentChanged( ScRange( ScAddress( nCol, nRow, nTab ) ) );
+ }
+
+ void __EXPORT ScUndoEnterData::Redo()
+@@ -324,6 +326,7 @@ void __EXPORT ScUndoEnterData::Redo()
+
+ DoChange();
+ EndRedo();
++ pDocShell->PostContentChanged( ScRange( ScAddress( nCol, nRow, nTab ) ) );
+ }
+
+ void __EXPORT ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
+@@ -355,6 +358,7 @@ ScUndoEnterValue::ScUndoEnterValue( ScDo
+ bNeedHeight ( bHeight )
+ {
+ SetChangeTrack();
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ }
+
+ __EXPORT ScUndoEnterValue::~ScUndoEnterValue()
+@@ -409,6 +413,7 @@ void __EXPORT ScUndoEnterValue::Undo()
+ pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
+
+ EndUndo();
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ }
+
+ void __EXPORT ScUndoEnterValue::Redo()
+@@ -422,6 +427,7 @@ void __EXPORT ScUndoEnterValue::Redo()
+ SetChangeTrack();
+
+ EndRedo();
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ }
+
+ void __EXPORT ScUndoEnterValue::Repeat(SfxRepeatTarget& /* rTarget */)
+@@ -449,6 +455,7 @@ ScUndoPutCell::ScUndoPutCell( ScDocShell
+ bNeedHeight ( bHeight )
+ {
+ SetChangeTrack();
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ }
+
+ __EXPORT ScUndoPutCell::~ScUndoPutCell()
+@@ -505,6 +512,7 @@ void __EXPORT ScUndoPutCell::Undo()
+ pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
+
+ EndUndo();
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ }
+
+ void __EXPORT ScUndoPutCell::Redo()
+@@ -533,6 +541,7 @@ void __EXPORT ScUndoPutCell::Redo()
+ SetChangeTrack();
+
+ EndRedo();
++ pDocShell->PostContentChanged( ScRange( aPos ) );
+ }
+
+ void __EXPORT ScUndoPutCell::Repeat(SfxRepeatTarget& /* rTarget */)
cvs diff: Diffing sc/source/ui/unoobj
+Index: sc/source/ui/unoobj/docuno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/docuno.cxx,v
+retrieving revision 1.68
+retrieving revision 1.68.38.1
+diff -u -p -b -w -B -r1.68 -r1.68.38.1
+--- sc/source/ui/unoobj/docuno.cxx 1 Jul 2008 16:26:56 -0000 1.68
++++ sc/source/ui/unoobj/docuno.cxx 1 Aug 2008 03:32:44 -0000 1.68.38.1
+@@ -96,7 +96,10 @@
+ #include <svx/unoshape.hxx>
+ #endif
+
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
++#include <com/sun/star/document/VbaEventId.hpp>
+ using namespace com::sun::star;
++using namespace com::sun::star::document::VbaEventId;
+
+ //------------------------------------------------------------------------
+
+@@ -331,6 +334,7 @@ uno::Any SAL_CALL ScModelObj::queryInter
+ SC_QUERYINTERFACE( view::XRenderable )
+ SC_QUERYINTERFACE( document::XLinkTargetSupplier )
+ SC_QUERYINTERFACE( beans::XPropertySet )
++ SC_QUERYINTERFACE( document::XDocumentEventCompatibleHelper)
+ SC_QUERYINTERFACE( lang::XMultiServiceFactory )
+ SC_QUERYINTERFACE( lang::XServiceInfo )
+
+@@ -1726,6 +1730,39 @@ uno::Sequence<rtl::OUString> SAL_CALL Sc
+ return concatServiceNames( aMyServices, aDrawServices );
+ }
+
++// XVbaEventHelper
++// For Vba Event
++sal_Bool SAL_CALL
++ScModelObj::processCompatibleEvent( sal_Int16 nSlotId ) throw( ::com::sun::star::uno::RuntimeException )
++{
++ USHORT nId = (USHORT)nSlotId;
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper( GetDocument()->GetVbaEventsHelper(), uno::UNO_QUERY );
++ if( xVbaEventsHelper.is() )
++ {
++ switch( nId )
++ {
++ case SID_SAVEDOC:
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] <<= sal_False;
++ return xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFORESAVE, aArgs );
++ }
++ case SID_SAVEASDOC:
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] <<= sal_True;
++ return xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFORESAVE, aArgs );
++ }
++ case SID_PRINTDOC:
++ case SID_PRINTDOCDIRECT:
++ {
++ uno::Sequence< uno::Any > aArgs;
++ return xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFOREPRINT, aArgs );
++ }
++ }
++ }
++ return sal_False;
++}
+ // XServiceInfo
+
+ rtl::OUString SAL_CALL ScModelObj::getImplementationName() throw(uno::RuntimeException)
+Index: sc/source/ui/unoobj/viewuno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/viewuno.cxx,v
+retrieving revision 1.38
+retrieving revision 1.38.38.1
+diff -u -p -b -w -B -r1.38 -r1.38.38.1
+--- sc/source/ui/unoobj/viewuno.cxx 1 Jul 2008 16:27:14 -0000 1.38
++++ sc/source/ui/unoobj/viewuno.cxx 1 Aug 2008 03:32:44 -0000 1.38.38.1
+@@ -71,8 +71,12 @@
+ #include "gridwin.hxx"
+ #include <com/sun/star/view/DocumentZoomType.hpp>
+ #include "AccessibilityHints.hxx"
++#include <com/sun/star/awt/MouseButton.hpp>
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
++#include <com/sun/star/document/VbaEventId.hpp>
+
+ using namespace com::sun::star;
++using namespace com::sun::star::document::VbaEventId;
+
+ //------------------------------------------------------------------------
+
+@@ -458,6 +462,78 @@ void SAL_CALL ScViewPaneObj::release() t
+ OWeakObject::release();
+ }
+
++// To process sheet compatibile event
++typedef ::cppu::WeakImplHelper2< awt::XEnhancedMouseClickHandler, view::XSelectionChangeListener > TabViewEventListener_BASE;
++class ScTabViewEventListener: public TabViewEventListener_BASE
++{
++private:
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper;
++ ScTabViewObj* pViewObj;
++
++public:
++ ScTabViewEventListener( ScTabViewObj* pObj, uno::Reference< document::XVbaEventsHelper >& rVbaEventsHelper);
++ ~ScTabViewEventListener();
++ // XEnhancedMouseClickHandler
++ virtual sal_Bool SAL_CALL mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
++ virtual sal_Bool SAL_CALL mouseReleased( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
++
++ // XSelectionChangeListener
++ virtual void SAL_CALL selectionChanged( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
++ // XEventListener
++ virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
++};
++
++ScTabViewEventListener::ScTabViewEventListener(ScTabViewObj* pObj, uno::Reference< document::XVbaEventsHelper >& rVbaEventsHelper):
++ pViewObj( pObj ),xVbaEventsHelper( rVbaEventsHelper )
++{
++}
++
++ScTabViewEventListener::~ScTabViewEventListener()
++{
++}
++
++void SAL_CALL ScTabViewEventListener::disposing( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
++{
++}
++
++sal_Bool SAL_CALL ScTabViewEventListener::mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException)
++{
++ sal_Bool result = sal_False;
++ // process BeforeDoubleClick and BeforeRightClick events
++ if( e.ClickCount == 2 || e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT )
++ {
++ // ensure the target is a cell
++ uno::Reference< table::XCell > xCell( e.Target, uno::UNO_QUERY );
++ if( xCell.is() && xVbaEventsHelper.is() && pViewObj)
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] = pViewObj->getSelection();
++ sal_Int32 nEventId = VBAEVENT_WORKSHEET_BEFORERIGHTCLICK;
++ if( e.ClickCount == 2 )
++ nEventId = VBAEVENT_WORKSHEET_BEFOREDOUBLECLICK;
++
++ result = xVbaEventsHelper->ProcessCompatibleVbaEvent( nEventId, aArgs );
++ // TODO: process Cancel argument
++ }
++ }
++ return result;
++}
++
++sal_Bool SAL_CALL ScTabViewEventListener::mouseReleased( const awt::EnhancedMouseEvent&/*e*/) throw (uno::RuntimeException)
++{
++ return sal_False;
++}
++
++void SAL_CALL ScTabViewEventListener::selectionChanged( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
++{
++ if ( xVbaEventsHelper.is() && pViewObj)
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] = pViewObj->getSelection();
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_SELECTIONCHANGE, aArgs );
++ }
++}
++
+ //------------------------------------------------------------------------
+
+ // Default-ctor wird fuer SMART_REFLECTION_IMPLEMENTATION gebraucht
+@@ -480,7 +556,19 @@ ScTabViewObj::ScTabViewObj( ScTabViewShe
+ aActivationListeners( 0 ),
+ bDrawSelModeSet(sal_False)
+ {
+- //! Listening oder so
++ if( pViewSh )
++ {
++ ScViewData* pViewData = pViewSh->GetViewData();
++ if( pViewData )
++ {
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper (pViewData->GetDocument()->GetVbaEventsHelper(), uno::UNO_QUERY );
++ ScTabViewEventListener* pEventListener = new ScTabViewEventListener( this, xVbaEventsHelper );
++ uno::Reference< awt::XEnhancedMouseClickHandler > aMouseClickHandler( *pEventListener, uno::UNO_QUERY );
++ addEnhancedMouseClickHandler( aMouseClickHandler );
++ uno::Reference< view::XSelectionChangeListener > aSelectionChangeListener( *pEventListener, uno::UNO_QUERY );
++ addSelectionChangeListener( aSelectionChangeListener );
++ }
++ }
+ }
+
+ ScTabViewObj::~ScTabViewObj()
cvs diff: Diffing sc/source/ui/vba
Index: sc/source/ui/vba/makefile.mk
===================================================================
RCS file: /cvs/sc/sc/source/ui/vba/makefile.mk,v
retrieving revision 1.6
-retrieving revision 1.5.42.5
-diff -u -p -b -w -B -r1.6 -r1.5.42.5
+retrieving revision 1.5.42.6
+diff -u -p -b -w -B -r1.6 -r1.5.42.6
--- sc/source/ui/vba/makefile.mk 11 Apr 2008 00:46:57 -0000 1.6
-+++ sc/source/ui/vba/makefile.mk 29 Jul 2008 06:35:39 -0000 1.5.42.5
++++ sc/source/ui/vba/makefile.mk 1 Aug 2008 03:32:44 -0000 1.5.42.6
@@ -88,6 +88,7 @@ SLOFILES= \
$(SLO)$/vbabutton.obj \
$(SLO)$/vbalabel.obj \
@@ -109,10 +894,12 @@
$(SLO)$/vbaradiobutton.obj \
$(SLO)$/vbalistbox.obj \
$(SLO)$/vbapropvalue.obj \
-@@ -111,6 +112,24 @@ SLOFILES= \
+@@ -111,8 +112,30 @@ SLOFILES= \
$(SLO)$/vbaformatconditions.obj \
$(SLO)$/vbastyle.obj \
$(SLO)$/vbastyles.obj \
+- $(SLO)$/service.obj \
+-
+ $(SLO)$/vbaassistant.obj \
+ $(SLO)$/vbauserform.obj \
+ $(SLO)$/vbacheckbox.obj \
@@ -131,18 +918,24 @@
+ $(SLO)$/vbapagebreak.obj \
+ $(SLO)$/vbapagebreaks.obj \
+ $(SLO)$/vbaspinbutton.obj \
- $(SLO)$/service.obj \
-
++ $(SLO)$/service.obj
++
++.IF "$(VBA_OOBUILD_HACK)" != ""
++SLOFILES += \
++ $(SLO)$/vbaeventshelper.obj
++.ENDIF
+
+ # --- Targets ------------------------------------------------------
Index: sc/source/ui/vba/service.cxx
===================================================================
RCS file: /cvs/sc/sc/source/ui/vba/service.cxx,v
retrieving revision 1.4
-retrieving revision 1.3.42.3
-diff -u -p -b -w -B -r1.4 -r1.3.42.3
+retrieving revision 1.3.42.4
+diff -u -p -b -w -B -r1.4 -r1.3.42.4
--- sc/source/ui/vba/service.cxx 11 Apr 2008 00:47:11 -0000 1.4
-+++ sc/source/ui/vba/service.cxx 29 Jul 2008 06:35:39 -0000 1.3.42.3
-@@ -53,11 +53,22 @@ namespace worksheet
++++ sc/source/ui/vba/service.cxx 1 Aug 2008 03:32:44 -0000 1.3.42.4
+@@ -53,12 +53,28 @@ namespace worksheet
{
extern sdecl::ServiceDecl const serviceDecl;
}
@@ -155,6 +948,7 @@
extern sdecl::ServiceDecl const serviceDecl;
}
-
+-
+namespace userform
+{
+extern sdecl::ServiceDecl const serviceDecl;
@@ -163,24 +957,40 @@
+{
+extern sdecl::ServiceDecl const serviceDecl;
+}
-
++#ifdef VBA_OOBUILD_HACK
++namespace vbaeventshelper
++{
++extern sdecl::ServiceDecl const serviceDecl;
++}
++#endif
extern "C"
-@@ -76,7 +87,7 @@ extern "C"
+ {
+@@ -75,8 +91,13 @@ extern "C"
+ OSL_TRACE("In component_writeInfo");
// Component registration
++#ifdef VBA_OOBUILD_HACK
++ if ( component_writeInfoHelper( pServiceManager, pRegistryKey,
++ range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl ) )
++#else
if ( component_writeInfoHelper( pServiceManager, pRegistryKey,
- range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl ) )
+ range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ) )
++#endif
{
// Singleton registration
try
-@@ -104,7 +115,7 @@ extern "C"
+@@ -104,7 +125,11 @@ extern "C"
{
OSL_TRACE("In component_getFactory for %s", pImplName );
void* pRet = component_getFactoryHelper(
- pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl );
+ pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl );
++#ifdef VBA_OOBUILD_HACK
++ if( !pRet )
++ pRet = component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl );
++#endif
OSL_TRACE("Ret is 0x%x", pRet);
return pRet;
}
@@ -3260,10 +4070,1173 @@
};
#endif//SC_VBA_CONTROL_HXX
-Index: sc/source/ui/vba/vbaframe.cxx
+Index: sc/source/ui/vba/vbaeventshelper.cxx
===================================================================
-RCS file: sc/source/ui/vba/vbaframe.cxx
-diff -N sc/source/ui/vba/vbaframe.cxx
+RCS file: sc/source/ui/vba/vbaeventshelper.cxx
+diff -N sc/source/ui/vba/vbaeventshelper.cxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaeventshelper.cxx 1 Aug 2008 03:32:45 -0000 1.1.2.1
+@@ -0,0 +1,1066 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#include "vbaeventshelper.hxx"
++#include "helperdecl.hxx"
++#include <sfx2/objsh.hxx>
++#include <basic/basmgr.hxx>
++#include <basic/sbmod.hxx>
++#include <basic/sbmeth.hxx>
++#include <basic/sbx.hxx>
++#include "scextopt.hxx"
++#include <sfx2/evntconf.hxx>
++#include <sfx2/event.hxx>
++#include <sfx2/sfx.hrc>
++#include <toolkit/unohlp.hxx>
++#include <comphelper/processfactory.hxx>
++#include <cppuhelper/implbase1.hxx>
++#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
++#include <com/sun/star/document/XEventsSupplier.hpp>
++#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
++#include <com/sun/star/table/XCell.hpp>
++#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
++#include <com/sun/star/sheet/XSpreadsheet.hpp>
++#include <com/sun/star/container/XNamed.hpp>
++#include <com/sun/star/awt/XWindowListener.hpp>
++#include <com/sun/star/awt/WindowEvent.hpp>
++#include <com/sun/star/lang/EventObject.hpp>
++#include <com/sun/star/util/XCloseListener.hpp>
++#include <com/sun/star/util/XCloseBroadcaster.hpp>
++#include <com/sun/star/frame/XControllerBorder.hpp>
++#include <com/sun/star/frame/XBorderResizeListener.hpp>
++#include "cellsuno.hxx"
++
++#include <map>
++
++using namespace std;
++using namespace com::sun::star;
++using namespace org::openoffice;
++using namespace com::sun::star::document::VbaEventId;
++
++const static String sLibrary( RTL_CONSTASCII_USTRINGPARAM("Standard"));
++
++const static rtl::OUString sUrlPart0 = rtl::OUString::createFromAscii( "vnd.sun.star.script:");
++const static rtl::OUString sUrlPart1 = rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.");
++const static rtl::OUString sUrlPart2 = rtl::OUString::createFromAscii( "?language=Basic&location=document");
++
++
++typedef ::cppu::WeakImplHelper3< awt::XWindowListener, util::XCloseListener, frame::XBorderResizeListener > WindowListener_BASE;
++
++// This class is to process Workbook window related event
++class VbaEventsListener : public WindowListener_BASE
++{
++ ScVbaEventsHelper* pVbaEventsHelper;
++ uno::Reference< frame::XModel > m_xModel;
++ sal_Bool m_bPrepare;
++ sal_Bool m_bWindowResized;
++ sal_Bool m_bBorderChanged;
++protected :
++ uno::Reference< awt::XWindow > GetContainerWindow();
++ uno::Reference< frame::XFrame > GetFrame();
++ sal_Bool IsMouseReleased();
++ DECL_LINK( fireResizeMacro, Timer* );
++ void processWindowResizeMacro();
++public :
++ VbaEventsListener( ScVbaEventsHelper* pHelper );
++ void startEventsLinstener();
++ void stopEventsLinstener();
++ // XWindowListener
++ virtual void SAL_CALL windowResized( const awt::WindowEvent& aEvent ) throw ( uno::RuntimeException );
++ virtual void SAL_CALL windowMoved( const awt::WindowEvent& aEvent ) throw ( uno::RuntimeException );
++ virtual void SAL_CALL windowShown( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
++ virtual void SAL_CALL windowHidden( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
++ virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
++ // XCloseListener
++ virtual void SAL_CALL queryClosing( const lang::EventObject& Source, ::sal_Bool GetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException);
++ virtual void SAL_CALL notifyClosing( const lang::EventObject& Source ) throw (uno::RuntimeException);
++ // XBorderResizeListener
++ virtual void SAL_CALL borderWidthsChanged( const uno::Reference< uno::XInterface >& aObject, const frame::BorderWidths& aNewSize ) throw (uno::RuntimeException);
++};
++VbaEventsListener::VbaEventsListener( ScVbaEventsHelper* pHelper ) : pVbaEventsHelper( pHelper )
++{
++ m_xModel.set( pVbaEventsHelper->getDocument()->GetDocumentShell()->GetModel(), uno::UNO_QUERY );
++ m_bPrepare = sal_False;
++ m_bWindowResized = sal_False;
++ m_bBorderChanged = sal_False;
++}
++uno::Reference< frame::XFrame >
++VbaEventsListener::GetFrame()
++{
++ try
++ {
++ if( pVbaEventsHelper )
++ {
++ if( m_xModel.is() )
++ {
++ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY );
++ if( xController.is() )
++ {
++ uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_QUERY );
++ if( xFrame.is() )
++ {
++ return xFrame;
++ }
++ }
++ }
++ }
++ }
++ catch( uno::Exception& /*e*/ )
++ {
++ }
++ return uno::Reference< frame::XFrame >();
++}
++uno::Reference< awt::XWindow >
++VbaEventsListener::GetContainerWindow()
++{
++ try
++ {
++ uno::Reference< frame::XFrame > xFrame( GetFrame(), uno::UNO_QUERY );
++ if( xFrame.is() )
++ {
++ uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_QUERY );
++ if( xWindow.is() )
++ return xWindow;
++ }
++ }
++ catch( uno::Exception& /*e*/ )
++ {
++ }
++ return uno::Reference< awt::XWindow >();
++}
++sal_Bool
++VbaEventsListener::IsMouseReleased()
++{
++ Window* pWindow = (VCLUnoHelper::GetWindow( GetContainerWindow() ) );
++ if( pWindow )
++ {
++ Window::PointerState aPointerState = pWindow->GetPointerState();
++ if( !aPointerState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) )
++ return sal_True;
++ }
++ return sal_False;
++}
++void
++VbaEventsListener::startEventsLinstener()
++{
++ if( m_xModel.is() )
++ {
++ // add window listener
++ uno::Reference< awt::XWindow > xWindow( GetContainerWindow(), uno::UNO_QUERY );
++ if( xWindow.is() )
++ xWindow->addWindowListener( this );
++ // add close listener
++ //uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( GetFrame(), uno::UNO_QUERY );
++ uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xModel, uno::UNO_QUERY );
++ if( xCloseBroadcaster.is() )
++ {
++ xCloseBroadcaster->addCloseListener( this );
++ }
++ // add Border resize listener
++ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY );
++ if( xController.is() )
++ {
++ uno::Reference< frame::XControllerBorder > xControllerBorder( xController, uno::UNO_QUERY );
++ if( xControllerBorder.is() )
++ {
++ xControllerBorder->addBorderResizeListener( this );
++ }
++ }
++ }
++}
++void
++VbaEventsListener::stopEventsLinstener()
++{
++ if( m_xModel.is() )
++ {
++ uno::Reference< awt::XWindow > xWindow( GetContainerWindow(), uno::UNO_QUERY );
++ if( xWindow.is() )
++ {
++ xWindow->removeWindowListener( this );
++ }
++ //uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( GetFrame(), uno::UNO_QUERY );
++ uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xModel, uno::UNO_QUERY );
++ if( xCloseBroadcaster.is() )
++ {
++ xCloseBroadcaster->removeCloseListener( this );
++ }
++ uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY );
++ if( xController.is() )
++ {
++ uno::Reference< frame::XControllerBorder > xControllerBorder( xController, uno::UNO_QUERY );
++ if( xControllerBorder.is() )
++ {
++ xControllerBorder->removeBorderResizeListener( this );
++ }
++ }
++ pVbaEventsHelper = NULL;
++ }
++}
++void
++VbaEventsListener::processWindowResizeMacro()
++{
++ if( pVbaEventsHelper )
++ pVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() );
++}
++IMPL_LINK( VbaEventsListener, fireResizeMacro, Timer*, pTimer )
++{
++ if( pVbaEventsHelper && m_bPrepare && pTimer )
++ {
++ if( IsMouseReleased() )
++ {
++ pTimer->Stop();
++ delete pTimer;
++ pTimer = 0;
++ m_bPrepare = sal_False;
++ processWindowResizeMacro();
++ }
++ }
++ return 0;
++}
++void SAL_CALL
++VbaEventsListener::windowResized( const awt::WindowEvent& /*aEvent*/ ) throw ( uno::RuntimeException )
++{
++ // Workbook_window_resize event
++ OSL_TRACE("VbaEventsListener::windowResized");
++ m_bWindowResized = sal_True;
++ Window* pWindow = (VCLUnoHelper::GetWindow( GetContainerWindow() ) );
++ if( pWindow && !m_bPrepare && m_bBorderChanged )
++ {
++ m_bPrepare = sal_True;
++ m_bBorderChanged = m_bWindowResized = sal_False;
++ AutoTimer* pTimer = new AutoTimer();
++ pTimer->SetTimeoutHdl( LINK( this, VbaEventsListener, fireResizeMacro ) );
++ pTimer->Start();
++ }
++}
++void SAL_CALL
++VbaEventsListener::windowMoved( const awt::WindowEvent& /*aEvent*/ ) throw ( uno::RuntimeException )
++{
++ // not interest this time
++}
++void SAL_CALL
++VbaEventsListener::windowShown( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
++{
++ // not interest this time
++}
++void SAL_CALL
++VbaEventsListener::windowHidden( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
++{
++ // not interest this time
++}
++void SAL_CALL
++VbaEventsListener::disposing( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
++{
++ pVbaEventsHelper = NULL;
++}
++void SAL_CALL
++VbaEventsListener::queryClosing( const lang::EventObject& Source, ::sal_Bool GetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException)
++{
++ // it can cancel the close, but need to throw a CloseVetoException, and it will be transmit to caller.
++}
++void SAL_CALL
++VbaEventsListener::notifyClosing( const lang::EventObject& Source ) throw (uno::RuntimeException)
++{
++ OSL_TRACE("VbaEventsListener::notifyClosing");
++ stopEventsLinstener();
++}
++void SAL_CALL
++VbaEventsListener::borderWidthsChanged( const uno::Reference< uno::XInterface >& aObject, const frame::BorderWidths& aNewSize ) throw (uno::RuntimeException)
++{
++ // work with WindowResized event to guard Window Resize event.
++ OSL_TRACE("VbaEventsListener::borderWidthsChanged");
++ m_bBorderChanged = sal_True;
++ Window* pWindow = (VCLUnoHelper::GetWindow( GetContainerWindow() ) );
++ if( pWindow && !m_bPrepare && m_bWindowResized )
++ {
++ m_bPrepare = sal_True;
++ m_bWindowResized = m_bBorderChanged = sal_False;
++ AutoTimer* pTimer = new AutoTimer();
++ pTimer->SetTimeoutHdl( LINK( this, VbaEventsListener, fireResizeMacro ) );
++ pTimer->Start();
++ }
++}
++
++class ImplVbaEventNameInfo
++{
++private:
++ map< sal_Int32, rtl::OUString > m_aEventNameMap;
++
++protected:
++ static ImplVbaEventNameInfo* pImplVbaEventNameInfo;
++ ImplVbaEventNameInfo() { InitImplVbaEventNameInfo(); }
++private:
++ void insert( const sal_Int32 nId, const rtl::OUString sEventName )
++ {
++ m_aEventNameMap.insert( make_pair( nId, sEventName ) );
++ }
++ void InitImplVbaEventNameInfo();
++public:
++ virtual ~ImplVbaEventNameInfo();
++ rtl::OUString getEventName( const sal_Int32 nId )
++ {
++ map< sal_Int32, rtl::OUString >::iterator iter = m_aEventNameMap.find( nId );
++ if( iter != m_aEventNameMap.end() )
++ return iter->second;
++ return rtl::OUString();
++ }
++ static ImplVbaEventNameInfo* GetImplVbaEventNameInfo();
++};
++ImplVbaEventNameInfo* ImplVbaEventNameInfo::pImplVbaEventNameInfo = NULL;
++
++ImplVbaEventNameInfo::~ImplVbaEventNameInfo()
++{
++ if( pImplVbaEventNameInfo )
++ {
++ delete pImplVbaEventNameInfo;
++ pImplVbaEventNameInfo = NULL;
++ }
++}
++
++ImplVbaEventNameInfo*
++ImplVbaEventNameInfo::GetImplVbaEventNameInfo()
++{
++ if( !pImplVbaEventNameInfo )
++ {
++ pImplVbaEventNameInfo = new ImplVbaEventNameInfo;
++ }
++ return pImplVbaEventNameInfo;
++}
++
++#define CREATEOUSTRING(asciistr) rtl::OUString::createFromAscii(asciistr)
++
++#define INSERT_EVENT_INFO( Object, Event, ObjectName, EventName ) \
++ insert( VBAEVENT_##Object##_##Event, ObjectName + CREATEOUSTRING( EventName ) )
++
++#define INSERT_WORKSHEET_EVENT_INFO( Event, EventName ) \
++ INSERT_EVENT_INFO( WORKSHEET, Event,CREATEOUSTRING("Worksheet_"), EventName ); \
++ INSERT_EVENT_INFO( WORKBOOK_SHEET, Event, CREATEOUSTRING("Workbook_Sheet"), EventName )
++
++#define INSERT_WORKBOOK_EVENT_INFO( Event, EventName ) \
++ INSERT_EVENT_INFO( WORKBOOK, Event, CREATEOUSTRING("Workbook_"), EventName )
++
++void ImplVbaEventNameInfo::InitImplVbaEventNameInfo()
++{
++ INSERT_WORKSHEET_EVENT_INFO( ACTIVATE, "Activate");
++ INSERT_WORKSHEET_EVENT_INFO( BEFOREDOUBLECLICK, "BeforeDoubleClick" );
++ INSERT_WORKSHEET_EVENT_INFO( BEFORERIGHTCLICK, "BeforeRightClick" );
++ INSERT_WORKSHEET_EVENT_INFO( CALCULATE, "Calculate" );
++ INSERT_WORKSHEET_EVENT_INFO( CHANGE, "Change" );
++ INSERT_WORKSHEET_EVENT_INFO( DEACTIVATE, "Deactivate" );
++ INSERT_WORKSHEET_EVENT_INFO( FOLLOWHYPERLINK, "FollowHyperlink" );
++ INSERT_WORKSHEET_EVENT_INFO( PIVOTTABLEUPDATE, "PivotTableUpdate" );
++ INSERT_WORKSHEET_EVENT_INFO( SELECTIONCHANGE, "SelectionChange" );
++
++ // Workbook
++ INSERT_WORKBOOK_EVENT_INFO( ACTIVATE, "Activate" );
++ INSERT_WORKBOOK_EVENT_INFO( DEACTIVATE, "Deactivate" );
++ INSERT_WORKBOOK_EVENT_INFO( OPEN, "Open" );
++ // AUTOOPEN doesn't be used. TODO, this should be "auto_open"
++ INSERT_WORKBOOK_EVENT_INFO( BEFORECLOSE, "BeforeClose" );
++ INSERT_WORKBOOK_EVENT_INFO( BEFOREPRINT, "BeforePrint" );
++ INSERT_WORKBOOK_EVENT_INFO( BEFORESAVE, "BeforeSave" );
++ INSERT_WORKBOOK_EVENT_INFO( NEWSHEET, "NewSheet" );
++ INSERT_WORKBOOK_EVENT_INFO( WINDOWACTIVATE, "WindowActivate" );
++ INSERT_WORKBOOK_EVENT_INFO( WINDOWDEACTIVATE, "WindowDeactivate" );
++ INSERT_WORKBOOK_EVENT_INFO( WINDOWRESIZE, "WindowResize" );
++}
++
++ScVbaEventsHelper::ScVbaEventsHelper( uno::Sequence< css::uno::Any > const& aArgs, uno::Reference< uno::XComponentContext > const& xContext )
++ : m_xContext( xContext ), mpVbaEventsListener( NULL ), mbOpened( sal_False ), mbIgnoreEvents( sal_False )
++{
++ uno::Reference< frame::XModel > xModel ( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ), uno::UNO_QUERY );
++ ScDocShell* pDocShell = getDocShell( xModel );
++ pDoc = pDocShell->GetDocument();
++}
++
++ScVbaEventsHelper::~ScVbaEventsHelper()
++{
++ if( mpVbaEventsListener )
++ {
++ mpVbaEventsListener = NULL;
++ }
++}
++
++rtl::OUString
++ScVbaEventsHelper::getEventName( const sal_Int32 nId )
++{
++ rtl::OUString sEventName;
++ ImplVbaEventNameInfo* pEventInfo = ImplVbaEventNameInfo::GetImplVbaEventNameInfo();
++ if( pEventInfo )
++ sEventName = pEventInfo->getEventName( nId );
++ return sEventName;
++}
++
++// Treat the args as possible inouts ( convertion at bottom of method )
++sal_Bool ScVbaEventsHelper::executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Sequence< uno::Any >& aArgs, uno::Any& aRet )
++{
++ // until ObjectModules ( and persisting of codenames ) is supported, if this is a
++ // document saved from XL then we won't be able to determine the codename for the Workbook
++ // Module, so... we have no choice but to search all modules for the moment, thus the macro
++ // passed in should be the fully specified name.
++ rtl::OUString sUrl = sUrlPart0.concat( sMacroName ).concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".") ) ).concat( sUrlPart2 ) ;
++ uno::Sequence< sal_Int16 > aOutArgsIndex;
++ uno::Sequence< uno::Any > aOutArgs;
++ ErrCode nErr = pShell->CallXScript( sUrl, aArgs, aRet,
++ aOutArgsIndex, aOutArgs, sal_False );
++
++ // Script Executed?
++ if ( nErr != ERRCODE_NONE )
++ return sal_False;
++
++ sal_Int32 nLen = aOutArgs.getLength();
++ // convert any out params to seem like they were inouts
++ if ( nLen )
++ {
++ for ( sal_Int32 index=0; index < nLen; ++index )
++ {
++ sal_Int32 nOutIndex = aOutArgsIndex[ index ];
++ aArgs[ nOutIndex ] = aOutArgs[ index ];
++ }
++
++ }
++ return sal_True;
++}
++String ScVbaEventsHelper::workbookMacroExists( SfxObjectShell* pShell, const String& sMod, const String& sMacro )
++{
++ String sFullName;
++ // would use the script provider to see if the macro exists but
++ // called at this stage tdoc content handler stuff is not set up
++ // so it fails
++
++ BasicManager* pBasicMgr = pShell-> GetBasicManager();
++ if ( pBasicMgr )
++ {
++ StarBASIC* pBasic = pBasicMgr->GetLib( sLibrary );
++ if ( !pBasic )
++ {
++ USHORT nId = pBasicMgr->GetLibId( sLibrary );
++ pBasicMgr->LoadLib( nId );
++ pBasic = pBasicMgr->GetLib( sLibrary );
++ }
++ if ( pBasic )
++ {
++ if ( sMod.Len() ) // we wish to find the macro is a specific module
++ {
++ SbModule* pModule = pBasic->FindModule( sMod );
++ if ( pModule )
++ {
++ SbxArray* pMethods = pModule->GetMethods();
++ if ( pMethods )
++ {
++ SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( sMacro, SbxCLASS_METHOD ) );
++ if ( pMethod )
++ {
++ sFullName = sMacro;
++ sFullName.Insert( '.', 0 ).Insert( sMod, 0 ).Insert( '.', 0 ).Insert( sLibrary, 0 );
++ }
++ }
++ }
++ }
++ else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
++ {
++ if( SbModule* pModule = pMethod->GetModule() )
++ {
++ sFullName = sMacro;
++ sFullName.Insert( '.', 0 ).Insert( pModule->GetName(), 0).Insert( '.', 0 ).Insert( sLibrary, 0 );
++ }
++ }
++
++ }
++ }
++ return sFullName;
++}
++
++uno::Any ScVbaEventsHelper::createWorkSheet( SfxObjectShell* pShell, SCTAB nTab )
++{
++ uno::Any aRet;
++ try
++ {
++ uno::Reference< lang::XMultiComponentFactory > xSMgr( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
++ uno::Reference< beans::XPropertySet > xProps( xSMgr, uno::UNO_QUERY_THROW );
++ uno::Reference<uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
++ // Eventually we will be able to pull the Workbook/Worksheet objects
++ // directly from basic and register them as listeners
++
++ // create Workbook
++ uno::Sequence< uno::Any > aArgs(2);
++ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() );
++ aArgs[1] = uno::Any( pShell->GetModel() );
++ uno::Reference< uno::XInterface > xWorkbook( xSMgr->createInstanceWithArgumentsAndContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Workbook") ), aArgs, xCtx ), uno::UNO_QUERY );
++
++ // create WorkSheet
++ String sSheetName;
++ pDoc->GetName( nTab, sSheetName );
++ aArgs = uno::Sequence< uno::Any >(3);
++ aArgs[ 0 ] <<= xWorkbook;
++ aArgs[ 1 ] <<= pShell->GetModel();
++ aArgs[ 2 ] = uno::makeAny( rtl::OUString( sSheetName ) );
++ aRet <<= xSMgr->createInstanceWithArgumentsAndContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Worksheet") ), aArgs, xCtx );
++ }
++ catch( uno::Exception& e )
++ {
++ }
++ return aRet;
++}
++
++uno::Any ScVbaEventsHelper::createRange( const uno::Any& aRange )
++{
++ uno::Any aRet;
++ try
++ {
++ uno::Reference< sheet::XSheetCellRangeContainer > xRanges( aRange, uno::UNO_QUERY );
++ uno::Reference< table::XCellRange > xRange( aRange, uno::UNO_QUERY );
++ uno::Reference< lang::XMultiComponentFactory > xSMgr( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
++ uno::Reference< beans::XPropertySet > xProps( xSMgr, uno::UNO_QUERY_THROW );
++ if ( xRanges.is() || xRange.is() )
++ {
++ uno::Reference<uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
++ uno::Sequence< uno::Any > aArgs(2);
++ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() ); // dummy parent
++ if ( xRanges.is() )
++ {
++ aArgs[1] <<= xRanges;
++ }
++ else if ( xRange.is() )
++ {
++ aArgs[1] <<= xRange;
++ }
++ else
++ {
++ throw uno::RuntimeException(); //
++ }
++ aRet <<= xSMgr->createInstanceWithArgumentsAndContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Range") ), aArgs, xCtx );
++ }
++ }
++ catch( uno::Exception& e )
++ {
++ }
++ return aRet;
++}
++
++uno::Any ScVbaEventsHelper::createHyperlink( const uno::Any& rCell )
++{
++ uno::Any aRet;
++ try
++ {
++ uno::Reference< lang::XMultiComponentFactory > xSMgr( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
++ uno::Reference< beans::XPropertySet > xProps( xSMgr, uno::UNO_QUERY_THROW );
++ uno::Reference< table::XCell > xCell( rCell, uno::UNO_QUERY );
++ if( xCell.is() )
++ {
++ uno::Reference<uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
++ uno::Sequence< uno::Any > aArgs(2);
++ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() ); // dummy parent
++ aArgs[1] <<= rCell;
++
++ aRet <<= xSMgr->createInstanceWithArgumentsAndContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Hyperlink") ), aArgs, xCtx );
++ }
++ else
++ {
++ throw uno::RuntimeException(); //
++ }
++ }
++ catch( uno::Exception& e )
++ {
++ }
++ return aRet;
++}
++
++uno::Any ScVbaEventsHelper::createWindow( SfxObjectShell* pShell )
++{
++ try
++ {
++ uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
++ uno::Reference< frame::XModel > xModel( pShell->GetModel(), uno::UNO_QUERY );
++ uno::Sequence< uno::Any > aWindowArgs(2);
++ aWindowArgs[0] = uno::Any( uno::Reference< uno::XInterface > () );
++ aWindowArgs[1] = uno::Any( xModel );
++ uno::Reference< uno::XInterface > xWindow( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Window" ) ), aWindowArgs ), uno::UNO_QUERY );
++ if( xWindow.is() )
++ return uno::makeAny( xWindow );
++ }
++ catch( uno::Exception& e )
++ {
++ }
++ return uno::Any();
++}
++
++String ScVbaEventsHelper::getSheetModuleName( SCTAB nTab )
++{
++ ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions();
++ String aCodeName;
++ pDoc->GetName( nTab, aCodeName);
++ // Use code name if that exists
++ if ( pExtOptions )
++ aCodeName = pExtOptions->GetCodeName( nTab );
++ return aCodeName;
++}
++
++rtl::OUString
++ScVbaEventsHelper::getMacroPath( const sal_Int32 nEventId, const SCTAB nTab )
++{
++ SfxObjectShell* pShell = pDoc->GetDocumentShell();
++ rtl::OUString sMacroPath;
++ rtl::OUString sMacroName = getEventName( nEventId );
++ switch( nEventId )
++ {
++ // Worksheet
++ case VBAEVENT_WORKSHEET_ACTIVATE :
++ case VBAEVENT_WORKSHEET_BEFOREDOUBLECLICK :
++ case VBAEVENT_WORKSHEET_BEFORERIGHTCLICK :
++ case VBAEVENT_WORKSHEET_CALCULATE :
++ case VBAEVENT_WORKSHEET_CHANGE :
++ case VBAEVENT_WORKSHEET_DEACTIVATE :
++ case VBAEVENT_WORKSHEET_FOLLOWHYPERLINK :
++ case VBAEVENT_WORKSHEET_PIVOTTABLEUPDATE :
++ case VBAEVENT_WORKSHEET_SELECTIONCHANGE :
++ {
++ rtl::OUString aSheetModuleName = getSheetModuleName( nTab );
++ sMacroPath = workbookMacroExists( pShell, aSheetModuleName, sMacroName );
++ break;
++ }
++ // Workbook
++ case VBAEVENT_WORKBOOK_ACTIVATE :
++ case VBAEVENT_WORKBOOK_DEACTIVATE :
++ case VBAEVENT_WORKBOOK_OPEN :
++ case VBAEVENT_WORKBOOK_AUTOOPEN :
++ case VBAEVENT_WORKBOOK_BEFORECLOSE :
++ case VBAEVENT_WORKBOOK_BEFOREPRINT :
++ case VBAEVENT_WORKBOOK_BEFORESAVE :
++ case VBAEVENT_WORKBOOK_NEWSHEET :
++ case VBAEVENT_WORKBOOK_WINDOWACTIVATE :
++ case VBAEVENT_WORKBOOK_WINDOWDEACTIVATE :
++ case VBAEVENT_WORKBOOK_WINDOWRESIZE :
++ // Workbook_sheet
++ case VBAEVENT_WORKBOOK_SHEET_ACTIVATE :
++ case VBAEVENT_WORKBOOK_SHEET_BEFOREDOUBLECLICK :
++ case VBAEVENT_WORKBOOK_SHEET_BEFORERIGHTCLICK :
++ case VBAEVENT_WORKBOOK_SHEET_CALCULATE :
++ case VBAEVENT_WORKBOOK_SHEET_CHANGE :
++ case VBAEVENT_WORKBOOK_SHEET_DEACTIVATE :
++ case VBAEVENT_WORKBOOK_SHEET_FOLLOWHYPERLINK :
++ case VBAEVENT_WORKBOOK_SHEET_PIVOTTABLEUPDATE :
++ case VBAEVENT_WORKBOOK_SHEET_SELECTIONCHANGE :
++ {
++ ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions();
++ String sWorkbookModuleName = pDoc->GetCodeName();
++ if( pExtOptions )
++ {
++ ScExtDocSettings aExtDocSettings = pExtOptions->GetDocSettings();
++ sWorkbookModuleName = aExtDocSettings.maGlobCodeName;
++ }
++
++ sMacroPath = workbookMacroExists( pShell, sWorkbookModuleName, sMacroName );
++ break;
++ }
++ default:
++ break;
++ }
++ return sMacroPath;
++}
++
++sal_Bool ScVbaEventsHelper::processVbaEvent( const sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs, const SCTAB nTab )
++{
++ SfxObjectShell* pShell = pDoc->GetDocumentShell();
++
++ sal_Bool result = sal_False;
++ sal_Bool bCancel = sal_False;
++ uno::Sequence< uno::Any > aArgs;
++ uno::Any aRet;
++
++ // For most cases, there is no corresponsible event macro in the document.
++ // It is better fo check if the event macro exists before process the arguments to improve performance.
++ rtl::OUString sMacroPath = getMacroPath( nEventId, nTab );
++ if( sMacroPath.getLength() )
++ {
++ switch( nEventId )
++ {
++ case VBAEVENT_WORKSHEET_ACTIVATE:
++ case VBAEVENT_WORKSHEET_CALCULATE:
++ case VBAEVENT_WORKSHEET_DEACTIVATE:
++ case VBAEVENT_WORKBOOK_ACTIVATE:
++ case VBAEVENT_WORKBOOK_DEACTIVATE:
++ case VBAEVENT_WORKBOOK_OPEN:
++ {
++ // no arguments
++ break;
++ }
++ case VBAEVENT_WORKBOOK_SHEET_DEACTIVATE:
++ case VBAEVENT_WORKBOOK_SHEET_CALCULATE:
++ case VBAEVENT_WORKBOOK_SHEET_ACTIVATE:
++ case VBAEVENT_WORKBOOK_NEWSHEET:
++ {
++ aArgs = uno::Sequence< uno::Any >(1);
++ aArgs[0] = createWorkSheet( pShell, nTab );
++ break;
++ }
++ case VBAEVENT_WORKSHEET_CHANGE:
++ case VBAEVENT_WORKSHEET_SELECTIONCHANGE:
++ {
++ // one argument: range
++ uno::Any aRange = createRange( rArgs[0] );
++ aArgs = uno::Sequence< uno::Any >(1);
++ aArgs[0] = aRange;
++ break;
++ }
++ case VBAEVENT_WORKBOOK_SHEET_CHANGE:
++ case VBAEVENT_WORKBOOK_SHEET_SELECTIONCHANGE:
++ {
++ uno::Any aRange = createRange( rArgs[0] );
++ aArgs = uno::Sequence< uno::Any >(2);
++ aArgs[0] = createWorkSheet( pShell, nTab );
++ aArgs[1] = aRange;
++ break;
++ }
++ case VBAEVENT_WORKSHEET_BEFOREDOUBLECLICK:
++ case VBAEVENT_WORKSHEET_BEFORERIGHTCLICK:
++ {
++ // two aruments: range and cancel
++ uno::Any aRange = createRange( rArgs[0] );
++ aArgs = uno::Sequence< uno::Any >(2);
++ aArgs[0] = aRange;
++ aArgs[1] <<= bCancel;
++ // TODO: process "cancel" action
++ break;
++ }
++ case VBAEVENT_WORKBOOK_SHEET_BEFOREDOUBLECLICK:
++ case VBAEVENT_WORKBOOK_SHEET_BEFORERIGHTCLICK:
++ {
++ uno::Any aRange = createRange( rArgs[0] );
++ aArgs = uno::Sequence< uno::Any >(3);
++ aArgs[0] = createWorkSheet( pShell, nTab );
++ aArgs[1] = aRange;
++ aArgs[2] <<= bCancel;
++ // TODO: process "cancel" action
++ break;
++ }
++ case VBAEVENT_WORKSHEET_FOLLOWHYPERLINK:
++ {
++ // one argument: hyperlink
++ uno::Any aHyperlink = createHyperlink( rArgs[0] );
++ aArgs = uno::Sequence< uno::Any >(1);
++ aArgs[0] = aHyperlink;
++ break;
++ }
++ case VBAEVENT_WORKBOOK_SHEET_FOLLOWHYPERLINK:
++ {
++ uno::Any aHyperlink = createHyperlink( rArgs[0] );
++ aArgs = uno::Sequence< uno::Any >(2);
++ aArgs[0] = createWorkSheet( pShell, nTab );
++ aArgs[1] = aHyperlink;
++ break;
++ }
++ case VBAEVENT_WORKSHEET_PIVOTTABLEUPDATE:
++ case VBAEVENT_WORKBOOK_SHEET_PIVOTTABLEUPDATE:
++ {
++ // one argument: pivottable
++ // TODO: not support yet
++ return result;
++ }
++ case VBAEVENT_WORKBOOK_BEFORECLOSE:
++ case VBAEVENT_WORKBOOK_BEFOREPRINT:
++ {
++ // process Cancel argument
++ aArgs = uno::Sequence< uno::Any >(1);
++ aArgs[0] <<= bCancel;
++ executeMacro( pShell, sMacroPath, aArgs, aRet );
++ aArgs[0] >>= bCancel;
++ return bCancel;
++ }
++ case VBAEVENT_WORKBOOK_BEFORESAVE:
++ {
++ // two arguments: SaveAs and Cancel
++ aArgs = uno::Sequence< uno::Any >(2);
++ aArgs[0] = rArgs[0];
++ aArgs[1] <<= bCancel;
++ executeMacro( pShell, sMacroPath, aArgs, aRet );
++ aArgs[1] >>= bCancel;
++ return bCancel;
++ }
++ case VBAEVENT_WORKBOOK_WINDOWACTIVATE:
++ case VBAEVENT_WORKBOOK_WINDOWDEACTIVATE:
++ case VBAEVENT_WORKBOOK_WINDOWRESIZE:
++ {
++ // one argument: windows
++ aArgs = uno::Sequence< uno::Any >(1);
++ aArgs[0] = createWindow( pShell );
++ break;
++ }
++ default:
++ return result;
++ }
++
++ // excute the macro
++ result = executeMacro( pShell, sMacroPath, aArgs, aRet );
++ }
++
++ return result;
++}
++
++SCTAB ScVbaEventsHelper::getTabFromArgs( const uno::Sequence< uno::Any > aArgs, const sal_Int32 nPos )
++{
++ SCTAB nTab = -1;
++ uno::Reference< sheet::XCellRangeAddressable > xCellRangeAddressable( getXSomethingFromArgs< sheet::XCellRangeAddressable >( aArgs, nPos ), uno::UNO_QUERY );
++ if( xCellRangeAddressable.is() )
++ {
++ table::CellRangeAddress aAddress = xCellRangeAddressable->getRangeAddress();
++ nTab = aAddress.Sheet;
++ }
++ return nTab;
++}
++
++sal_Bool SAL_CALL
++ScVbaEventsHelper::ProcessCompatibleVbaEvent( sal_Int32 nEventId, const uno::Sequence< uno::Any >& aArgs ) throw (uno::RuntimeException)
++{
++ SfxObjectShell* pShell = pDoc->GetDocumentShell();
++ if( !pShell )
++ return sal_False;
++
++ // In order to better support "withevents" in the future,
++ // it is better to process a event at a time
++ SCTAB nTab = INVALID_TAB;
++ switch( nEventId )
++ {
++ // Worksheet
++ case VBAEVENT_WORKSHEET_ACTIVATE:
++ {
++ aArgs[0] >>= nTab;
++ if( nTab != INVALID_TAB )
++ {
++ // process the event
++ processVbaEvent( nEventId, aArgs, nTab );
++ // recursive process related workbook sheet event.
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_ACTIVATE, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKSHEET_BEFOREDOUBLECLICK:
++ {
++ nTab = getTabFromArgs( aArgs );
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_BEFOREDOUBLECLICK, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKSHEET_BEFORERIGHTCLICK:
++ {
++ nTab = getTabFromArgs( aArgs );
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_BEFORERIGHTCLICK, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKSHEET_CALCULATE:
++ {
++ aArgs[0] >>= nTab;
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_CALCULATE, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKSHEET_CHANGE:
++ {
++ nTab = getTabFromArgs( aArgs );
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_CHANGE, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKSHEET_DEACTIVATE:
++ {
++ aArgs[0] >>= nTab;
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_DEACTIVATE, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKSHEET_FOLLOWHYPERLINK:
++ {
++ nTab = getTabFromArgs( aArgs );
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_FOLLOWHYPERLINK, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKSHEET_PIVOTTABLEUPDATE:
++ // TODO
++ break;
++ case VBAEVENT_WORKSHEET_SELECTIONCHANGE:
++ {
++ nTab = getTabFromArgs( aArgs );
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_SHEET_SELECTIONCHANGE, aArgs );
++ }
++ break;
++ }
++ // Workbook_sheet
++ case VBAEVENT_WORKBOOK_SHEET_ACTIVATE:
++ case VBAEVENT_WORKBOOK_SHEET_CALCULATE:
++ case VBAEVENT_WORKBOOK_SHEET_DEACTIVATE:
++ {
++ aArgs[0] >>= nTab;
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ }
++ break;
++ }
++ case VBAEVENT_WORKBOOK_SHEET_BEFOREDOUBLECLICK:
++ case VBAEVENT_WORKBOOK_SHEET_BEFORERIGHTCLICK:
++ case VBAEVENT_WORKBOOK_SHEET_CHANGE:
++ case VBAEVENT_WORKBOOK_SHEET_FOLLOWHYPERLINK:
++ case VBAEVENT_WORKBOOK_SHEET_SELECTIONCHANGE:
++ {
++ nTab = getTabFromArgs( aArgs );
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ }
++ break;
++ }
++ case VBAEVENT_WORKBOOK_SHEET_PIVOTTABLEUPDATE:
++ // TODO
++ break;
++ // Workbook
++ case VBAEVENT_WORKBOOK_ACTIVATE:
++ {
++ // if workbook open event do not be fired. fired it before
++ // workbook activate event to compatible with MSO.
++ if( mbOpened )
++ {
++ // process workbook activate event
++ processVbaEvent( nEventId, aArgs );
++ // process workbook window activate event at the same time
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_WINDOWACTIVATE, aArgs );
++ }
++ break;
++ }
++ case VBAEVENT_WORKBOOK_DEACTIVATE:
++ {
++ processVbaEvent( nEventId, aArgs );
++ // same as workbook window deactivate
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_WINDOWDEACTIVATE, aArgs );
++ break;
++ }
++ case VBAEVENT_WORKBOOK_OPEN:
++ {
++ // process workbook open macro
++ // does auto open work here?
++ if( !mbOpened )
++ {
++ processVbaEvent( nEventId, aArgs );
++ mbOpened = sal_True;
++ ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_ACTIVATE, aArgs );
++ }
++ // register the window listener.
++ if( !mpVbaEventsListener )
++ {
++ mpVbaEventsListener = new VbaEventsListener( this );
++ mpVbaEventsListener->startEventsLinstener();
++ }
++ break;
++ }
++ case VBAEVENT_WORKBOOK_AUTOOPEN:
++ // TODO
++ break;
++ case VBAEVENT_WORKBOOK_BEFORECLOSE:
++ {
++ sal_Bool bCancel = processVbaEvent( nEventId, aArgs );
++ if( mpVbaEventsListener && !bCancel )
++ {
++ mpVbaEventsListener->stopEventsLinstener();
++ mpVbaEventsListener = NULL;
++ }
++ return bCancel;
++ }
++ case VBAEVENT_WORKBOOK_BEFOREPRINT:
++ case VBAEVENT_WORKBOOK_BEFORESAVE:
++ case VBAEVENT_WORKBOOK_WINDOWACTIVATE:
++ case VBAEVENT_WORKBOOK_WINDOWDEACTIVATE:
++ case VBAEVENT_WORKBOOK_WINDOWRESIZE:
++ {
++ return processVbaEvent( nEventId, aArgs );
++ }
++ case VBAEVENT_WORKBOOK_NEWSHEET:
++ {
++ aArgs[0] >>= nTab;
++ if( nTab != INVALID_TAB )
++ {
++ processVbaEvent( nEventId, aArgs, nTab );
++ }
++ break;
++ }
++ default:
++ OSL_TRACE( "Invalid Event" );
++ }
++
++ return sal_True;
++}
++
++::sal_Bool SAL_CALL
++ScVbaEventsHelper::getIgnoreEvents() throw (uno::RuntimeException)
++{
++ return mbIgnoreEvents;
++}
++
++void SAL_CALL
++ScVbaEventsHelper::setIgnoreEvents( ::sal_Bool _ignoreevents ) throw (uno::RuntimeException)
++{
++ mbIgnoreEvents = _ignoreevents;
++}
++
++
++namespace vbaeventshelper
++{
++namespace sdecl = comphelper::service_decl;
++sdecl::class_<ScVbaEventsHelper, sdecl::with_args<true> > serviceImpl;
++extern sdecl::ServiceDecl const serviceDecl(
++ serviceImpl,
++ "ScVbaEventsHelper",
++ "com.sun.star.document.VbaEventsHelper" );
++}
+Index: sc/source/ui/vba/vbaeventshelper.hxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaeventshelper.hxx
+diff -N sc/source/ui/vba/vbaeventshelper.hxx
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sc/source/ui/vba/vbaeventshelper.hxx 1 Aug 2008 03:32:45 -0000 1.1.2.1
+@@ -0,0 +1,83 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++
++#ifndef SC_VBAEVENTS_HXX
++#define SC_VBAEVENTS_HXX
++
++#include "document.hxx"
++#include <cppuhelper/implbase1.hxx>
++#include <com/sun/star/document/VbaEventId.hpp>
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
++#include "vbahelper.hxx"
++
++#define INVALID_TAB -1
++
++typedef ::cppu::WeakImplHelper1< com::sun::star::document::XVbaEventsHelper > VBAWorkbookEvent_BASE;
++
++class VbaEventsListener;
++class ScVbaEventsHelper : public VBAWorkbookEvent_BASE
++{
++private:
++ ScDocument* pDoc;
++ css::uno::Reference< css::uno::XComponentContext > m_xContext;
++ VbaEventsListener* mpVbaEventsListener;
++ sal_Bool mbOpened;
++ sal_Bool mbIgnoreEvents;
++
++ String getSheetModuleName( SCTAB nTab );
++ String workbookMacroExists( SfxObjectShell* pShell, const String& sMod, const String& sMacro );
++ css::uno::Any createWorkSheet( SfxObjectShell* pShell, SCTAB nTab );
++ css::uno::Any createRange( const css::uno::Any& aRange );
++ css::uno::Any createHyperlink( const css::uno::Any& rCell );
++ css::uno::Any createWindow( SfxObjectShell* pShell );
++ sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, css::uno::Sequence< css::uno::Any >& aArgs, css::uno::Any& aRet );
++ SCTAB getTabFromArgs( const css::uno::Sequence< css::uno::Any > aArgs, const sal_Int32 nPos = 0 );
++ rtl::OUString getEventName( const sal_Int32 nEventId );
++ rtl::OUString getMacroPath( const sal_Int32 nEventId, const SCTAB nTab = INVALID_TAB );
++ sal_Bool processVbaEvent( const sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs, const SCTAB nTab = INVALID_TAB );
++
++public:
++ ScVbaEventsHelper( ScDocument* pDocument ):pDoc( pDocument ), mpVbaEventsListener( NULL ), mbOpened( sal_False ){};
++ ScVbaEventsHelper( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext );
++ ~ScVbaEventsHelper();
++ ScDocument* getDocument() { return pDoc; };
++ // XVBAWorkbookEventHelper
++ virtual sal_Bool SAL_CALL ProcessCompatibleVbaEvent( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setIgnoreEvents( ::sal_Bool _ignoreevents ) throw (css::uno::RuntimeException);
++ virtual ::sal_Bool SAL_CALL getIgnoreEvents() throw (css::uno::RuntimeException);
++};
++
++#endif
++
+Index: sc/source/ui/vba/vbaframe.cxx
+===================================================================
+RCS file: sc/source/ui/vba/vbaframe.cxx
+diff -N sc/source/ui/vba/vbaframe.cxx
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ sc/source/ui/vba/vbaframe.cxx 22 Apr 2008 19:53:15 -0000 1.1.2.1
@@ -0,0 +1,93 @@
@@ -7089,10 +9062,10 @@
===================================================================
RCS file: /cvs/sc/sc/source/ui/vba/vbarange.cxx,v
retrieving revision 1.9
-retrieving revision 1.5.34.11
-diff -u -p -b -w -B -r1.9 -r1.5.34.11
+retrieving revision 1.5.34.12
+diff -u -p -b -w -B -r1.9 -r1.5.34.12
--- sc/source/ui/vba/vbarange.cxx 14 May 2008 10:03:31 -0000 1.9
-+++ sc/source/ui/vba/vbarange.cxx 29 Jul 2008 09:36:01 -0000 1.5.34.11
++++ sc/source/ui/vba/vbarange.cxx 30 Jul 2008 10:39:13 -0000 1.5.34.12
@@ -115,6 +115,7 @@
#include <org/openoffice/excel/XlCellType.hpp>
#include <org/openoffice/excel/XlSpecialCellsValue.hpp>
@@ -7242,7 +9215,7 @@
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
-@@ -2686,6 +2763,166 @@ ScVbaRange::Replace( const ::rtl::OUStri
+@@ -2686,6 +2763,167 @@ ScVbaRange::Replace( const ::rtl::OUStri
return sal_True; // always
}
@@ -7390,7 +9363,8 @@
+ ScGlobal::SetSearchItem( newOptions );
+
+ uno::Reference< util::XSearchDescriptor > xSearchDescriptor( xDescriptor, uno::UNO_QUERY );
-+ uno::Reference< table::XCellRange > xCellRange( xSearch->findNext( xStartCell, xSearchDescriptor ), uno::UNO_QUERY );
++ uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xSearchDescriptor) : xSearch->findFirst( xSearchDescriptor );
++ uno::Reference< table::XCellRange > xCellRange( xInterface, uno::UNO_QUERY );
+ if ( xCellRange.is() )
+ {
+ uno::Reference< excel::XRange > xResultRange = new ScVbaRange( this, mxContext, xCellRange );
@@ -7409,7 +9383,7 @@
uno::Reference< table::XCellRange > processKey( const uno::Any& Key, uno::Reference< uno::XComponentContext >& xContext, ScDocShell* pDocSh )
{
uno::Reference< excel::XRange > xKeyRange;
-@@ -3116,6 +3353,18 @@ ScVbaRange::hasElements() throw (uno::Ru
+@@ -3116,6 +3354,18 @@ ScVbaRange::hasElements() throw (uno::Ru
uno::Reference< container::XEnumeration > SAL_CALL
ScVbaRange::createEnumeration() throw (uno::RuntimeException)
{
@@ -7428,7 +9402,7 @@
return new CellsEnumeration( mxContext, m_Areas );
}
-@@ -4119,7 +4368,7 @@ ScVbaRange::Autofit() throw (uno::Runtim
+@@ -4119,7 +4369,7 @@ ScVbaRange::Autofit() throw (uno::Runtim
// if the range is a not a row or column range autofit will
// throw an error
@@ -7437,7 +9411,7 @@
DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
ScDocShell* pDocShell = getDocShellFromRange( mxRange );
if ( pDocShell )
-@@ -4298,6 +4547,113 @@ void ScVbaRange::setFormulaHidden(const
+@@ -4298,6 +4548,113 @@ void ScVbaRange::setFormulaHidden(const
xProps->setPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CELLPRO)), uno::makeAny(rCellAttr));
}
@@ -7551,7 +9525,7 @@
void SAL_CALL
ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& ActivePrinter, const uno::Any& PrintToFile, const uno::Any& Collate, const uno::Any& PrToFileName ) throw (uno::RuntimeException)
-@@ -4516,7 +4872,7 @@ ScVbaRange::AutoOutline( ) throw (scrip
+@@ -4516,7 +4873,7 @@ ScVbaRange::AutoOutline( ) throw (scrip
{
// #TODO #FIXME needs to check for summary row/col ( whatever they are )
// not valid for multi Area Addresses
@@ -7560,7 +9534,7 @@
DebugHelper::exception(SbERR_METHOD_FAILED, STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY);
// So needs to either span an entire Row or a just be a single cell
// ( that contains a summary RowColumn )
-@@ -4734,6 +5090,7 @@ ScVbaRange::SpecialCells( const uno::Any
+@@ -4734,6 +5091,7 @@ ScVbaRange::SpecialCells( const uno::Any
case excel::XlCellType::xlCellTypeConstants:
case excel::XlCellType::xlCellTypeFormulas:
case excel::XlCellType::xlCellTypeVisible:
@@ -10314,117 +12288,117 @@
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/AutoFilter.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/AutoFilter.xls
-Binary files /dev/null and /tmp/cvs6sa4KP differ
+Binary files /dev/null and /tmp/cvsChaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/MiscRangeTests.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/MiscRangeTests.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/MiscRangeTests.xls
-Binary files /dev/null and /tmp/cvs7sa4KP differ
+Binary files /dev/null and /tmp/cvsDhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/PageBreaks.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/PageBreaks.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/PageBreaks.xls
-Binary files /dev/null and /tmp/cvs8sa4KP differ
+Binary files /dev/null and /tmp/cvsEhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls
-Binary files /dev/null and /tmp/cvs9sa4KP differ
+Binary files /dev/null and /tmp/cvsFhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/Ranges-2.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/Ranges-2.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/Ranges-2.xls
-Binary files /dev/null and /tmp/cvs.sa4KP differ
+Binary files /dev/null and /tmp/cvsGhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/Ranges-3.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/Ranges-3.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/Ranges-3.xls
-Binary files /dev/null and /tmp/cvs_sa4KP differ
+Binary files /dev/null and /tmp/cvsHhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/Ranges.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/Ranges.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/Ranges.xls
-Binary files /dev/null and /tmp/cvsata4KP differ
+Binary files /dev/null and /tmp/cvsIhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/Shapes.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/Shapes.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/Shapes.xls
-Binary files /dev/null and /tmp/cvsbta4KP differ
+Binary files /dev/null and /tmp/cvsJhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/StrConv-test.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/StrConv-test.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/StrConv-test.xls
-Binary files /dev/null and /tmp/cvscta4KP differ
+Binary files /dev/null and /tmp/cvsKhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/Template.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/Template.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/Template.xls
-Binary files /dev/null and /tmp/cvsdta4KP differ
+Binary files /dev/null and /tmp/cvsLhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls
-Binary files /dev/null and /tmp/cvseta4KP differ
+Binary files /dev/null and /tmp/cvsMhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest.xls
-Binary files /dev/null and /tmp/cvsfta4KP differ
+Binary files /dev/null and /tmp/cvsNhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest2.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest2.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest2.xls
-Binary files /dev/null and /tmp/cvsgta4KP differ
+Binary files /dev/null and /tmp/cvsOhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/Window.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/Window.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/Window.xls
-Binary files /dev/null and /tmp/cvshta4KP differ
+Binary files /dev/null and /tmp/cvsPhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/bytearraystring.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/bytearraystring.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/bytearraystring.xls
-Binary files /dev/null and /tmp/cvsita4KP differ
+Binary files /dev/null and /tmp/cvsQhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/dateserial.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/dateserial.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/dateserial.xls
-Binary files /dev/null and /tmp/cvsjta4KP differ
+Binary files /dev/null and /tmp/cvsRhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/datevalue.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/datevalue.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/datevalue.xls
-Binary files /dev/null and /tmp/cvskta4KP differ
+Binary files /dev/null and /tmp/cvsShaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/format.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/format.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/format.xls
-Binary files /dev/null and /tmp/cvslta4KP differ
+Binary files /dev/null and /tmp/cvsThaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/partition.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/partition.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/partition.xls
-Binary files /dev/null and /tmp/cvsmta4KP differ
+Binary files /dev/null and /tmp/cvsUhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/range-4.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/range-4.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/range-4.xls
-Binary files /dev/null and /tmp/cvsnta4KP differ
+Binary files /dev/null and /tmp/cvsVhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/replace.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/replace.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/replace.xls
-Binary files /dev/null and /tmp/cvsota4KP differ
+Binary files /dev/null and /tmp/cvsWhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/stringplusdouble.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/stringplusdouble.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/stringplusdouble.xls
-Binary files /dev/null and /tmp/cvspta4KP differ
+Binary files /dev/null and /tmp/cvsXhaGPg differ
Index: sc/source/ui/vba/testvba/TestDocuments/window2.xls
===================================================================
RCS file: sc/source/ui/vba/testvba/TestDocuments/window2.xls
diff -N sc/source/ui/vba/testvba/TestDocuments/window2.xls
-Binary files /dev/null and /tmp/cvsqta4KP differ
+Binary files /dev/null and /tmp/cvsYhaGPg differ
cvs diff: Diffing sc/source/ui/vba/testvba/TestDocuments/logs
cvs diff: Diffing sc/source/ui/vba/testvba/TestDocuments/logs/excel
Index: sc/source/ui/vba/testvba/TestDocuments/logs/excel/AutoFilter.log
@@ -13213,6 +15187,181 @@
+END Replace
+Test run finished : 2007-11-21 11:24:04
cvs diff: Diffing sc/source/ui/view
+Index: sc/source/ui/view/gridwin.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/gridwin.cxx,v
+retrieving revision 1.96
+retrieving revision 1.96.36.1
+diff -u -p -b -w -B -r1.96 -r1.96.36.1
+--- sc/source/ui/view/gridwin.cxx 1 Jul 2008 16:27:56 -0000 1.96
++++ sc/source/ui/view/gridwin.cxx 1 Aug 2008 03:32:45 -0000 1.96.36.1
+@@ -148,7 +148,13 @@
+ #include <svx/sdr/overlay/overlaymanager.hxx>
+ #include <vcl/svapp.hxx>
+
++#include "cellsuno.hxx"
++
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
++#include <com/sun/star/document/VbaEventId.hpp>
++
+ using namespace com::sun::star;
++using namespace com::sun::star::document::VbaEventId;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Any;
+
+@@ -396,6 +402,32 @@ void lcl_UnLockComment( SdrView* pView,
+
+ }
+
++sal_Bool lcl_GetHyperlinkCell(ScDocument* pDoc, SCCOL& rPosX, SCROW& rPosY, SCTAB nTab, ScBaseCell*& rpCell )
++{
++ BOOL bFound = FALSE;
++ do
++ {
++ pDoc->GetCell( rPosX, rPosY, nTab, rpCell );
++ if ( !rpCell || rpCell->GetCellType() == CELLTYPE_NOTE )
++ {
++ if ( rPosX <= 0 )
++ return FALSE; // alles leer bis links
++ else
++ --rPosX; // weitersuchen
++ }
++ else if ( rpCell->GetCellType() == CELLTYPE_EDIT)
++ bFound = TRUE;
++ else if (rpCell->GetCellType() == CELLTYPE_FORMULA &&
++ static_cast<ScFormulaCell*>(rpCell)->IsHyperLinkCell())
++ bFound = TRUE;
++ else
++ return FALSE; // andere Zelle
++ }
++ while ( !bFound );
++
++ return bFound;
++}
++
+ //==================================================================
+
+ // WB_DIALOGCONTROL noetig fuer UNO-Controls
+@@ -1424,6 +1456,7 @@ void ScGridWindow::HandleMouseButtonDown
+ SCCOL nOldColFBox = bWasFilterBox ? pFilterBox->GetCol() : 0;
+ SCROW nOldRowFBox = bWasFilterBox ? pFilterBox->GetRow() : 0;
+ #endif
++#include "cellsuno.hxx"
+
+ ClickExtern(); // loescht FilterBox, wenn vorhanden
+
+@@ -2085,6 +2118,26 @@ void __EXPORT ScGridWindow::MouseButtonU
+ {
+ nMouseStatus = SC_GM_NONE; // keinen Doppelklick anfangen
+ ScGlobal::OpenURL( aUrl, aTarget );
++
++ // fire worksheet_followhyperlink event
++ Point aPos = rMEvt.GetPosPixel();
++ SCsCOL nPosX;
++ SCsROW nPosY;
++ SCTAB nTab = pViewData->GetTabNo();
++ pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
++ ScBaseCell* pCell = NULL;
++
++ BOOL bFound = lcl_GetHyperlinkCell( pDoc, nPosX, nPosY, nTab, pCell );
++ if( bFound )
++ {
++ ScAddress aCellPos( nPosX, nPosY, nTab );
++ ScCellObj* pObj = new ScCellObj( pViewData->GetDocShell(), aCellPos );
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] = uno::makeAny(uno::Reference<uno::XInterface>(static_cast<cppu::OWeakObject*>(pObj)));
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( pViewData->GetDocument()->GetVbaEventsHelper(), uno::UNO_QUERY );
++ if( xVbaEventsHelper.is() )
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_FOLLOWHYPERLINK, aArgs );
++ }
+ return;
+ }
+ }
+@@ -4768,26 +4821,9 @@ BOOL ScGridWindow::GetEditUrlOrError( BO
+ ScDocument* pDoc = pDocSh->GetDocument();
+ ScBaseCell* pCell = NULL;
+
+- BOOL bFound = FALSE;
+- do
+- {
+- pDoc->GetCell( nPosX, nPosY, nTab, pCell );
+- if ( !pCell || pCell->GetCellType() == CELLTYPE_NOTE )
+- {
+- if ( nPosX <= 0 )
+- return FALSE; // alles leer bis links
+- else
+- --nPosX; // weitersuchen
+- }
+- else if ( pCell->GetCellType() == CELLTYPE_EDIT)
+- bFound = TRUE;
+- else if (pCell->GetCellType() == CELLTYPE_FORMULA &&
+- static_cast<ScFormulaCell*>(pCell)->IsHyperLinkCell())
+- bFound = TRUE;
+- else
+- return FALSE; // andere Zelle
+- }
+- while ( !bFound );
++ BOOL bFound = lcl_GetHyperlinkCell( pDoc, nPosX, nPosY, nTab, pCell );
++ if( !bFound )
++ return FALSE;
+
+ ScHideTextCursor aHideCursor( pViewData, eWhich ); // before GetEditArea (MapMode is changed)
+
+Index: sc/source/ui/view/tabview3.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/tabview3.cxx,v
+retrieving revision 1.68
+retrieving revision 1.68.36.1
+diff -u -p -b -w -B -r1.68 -r1.68.36.1
+--- sc/source/ui/view/tabview3.cxx 1 Jul 2008 16:28:34 -0000 1.68
++++ sc/source/ui/view/tabview3.cxx 1 Aug 2008 03:32:46 -0000 1.68.36.1
+@@ -81,6 +81,10 @@
+ #include "client.hxx"
+
+ #include <com/sun/star/chart2/data/HighlightedRange.hpp>
++#include <com/sun/star/document/XVbaEventsHelper.hpp>
++#include <com/sun/star/document/VbaEventId.hpp>
++
++using namespace com::sun::star::document::VbaEventId;
+
+ namespace
+ {
+@@ -1643,6 +1647,17 @@ void ScTabView::SetTabNo( SCTAB nTab, BO
+ // nicht InputEnterHandler wegen Referenzeingabe !
+
+ ScDocument* pDoc = aViewData.GetDocument();
++ if( !bNew )
++ {
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( pDoc->GetVbaEventsHelper(), uno::UNO_QUERY );
++ if( xVbaEventsHelper.is() )
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] <<= aViewData.GetTabNo();
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_DEACTIVATE, aArgs );
++ }
++ }
++
+ pDoc->MakeTable( nTab );
+
+ SCTAB nTabCount = pDoc->GetTableCount();
+@@ -1742,6 +1757,17 @@ void ScTabView::SetTabNo( SCTAB nTab, BO
+ pGridWin[i]->UpdateEditViewPos();
+ }
+
++ if( !bNew )
++ {
++ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( pDoc->GetVbaEventsHelper(), uno::UNO_QUERY );
++ if( xVbaEventsHelper.is() )
++ {
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[0] <<= aViewData.GetTabNo();
++ xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_ACTIVATE, aArgs );
++ }
++ }
++
+ TabChanged(); // DrawView
+ aViewData.GetViewShell()->WindowChanged(); // falls das aktive Fenster anders ist
+ if ( !bUnoRefDialog )
cvs diff: Diffing sc/uiconfig
cvs diff: Diffing sc/uiconfig/scalc
cvs diff: Diffing sc/uiconfig/scalc/accelerator
@@ -15109,3 +17258,642 @@
# ------------------------------------------------------------------
cvs diff: Diffing oovbaapi/prj
cvs diff: Diffing oovbaapi/util
+cvs diff: Diffing offapi
+cvs diff: Diffing offapi/com
+cvs diff: Diffing offapi/com/sun
+cvs diff: Diffing offapi/com/sun/star
+cvs diff: Diffing offapi/com/sun/star/accessibility
+cvs diff: Diffing offapi/com/sun/star/animations
+cvs diff: Diffing offapi/com/sun/star/auth
+cvs diff: Diffing offapi/com/sun/star/awt
+cvs diff: Diffing offapi/com/sun/star/awt/tree
+cvs diff: Diffing offapi/com/sun/star/chart
+cvs diff: Diffing offapi/com/sun/star/chart2
+cvs diff: Diffing offapi/com/sun/star/chart2/data
+cvs diff: Diffing offapi/com/sun/star/configuration
+cvs diff: Diffing offapi/com/sun/star/configuration/backend
+cvs diff: Diffing offapi/com/sun/star/configuration/backend/xml
+cvs diff: Diffing offapi/com/sun/star/configuration/bootstrap
+cvs diff: Diffing offapi/com/sun/star/datatransfer
+cvs diff: Diffing offapi/com/sun/star/datatransfer/clipboard
+cvs diff: Diffing offapi/com/sun/star/datatransfer/dnd
+cvs diff: Diffing offapi/com/sun/star/deployment
+cvs diff: Diffing offapi/com/sun/star/deployment/test
+cvs diff: Diffing offapi/com/sun/star/deployment/ui
+cvs diff: Diffing offapi/com/sun/star/document
+Index: offapi/com/sun/star/document/VbaEventId.idl
+===================================================================
+RCS file: offapi/com/sun/star/document/VbaEventId.idl
+diff -N offapi/com/sun/star/document/VbaEventId.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ offapi/com/sun/star/document/VbaEventId.idl 1 Aug 2008 03:13:19 -0000 1.1.2.1
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_VbaEventId_idl__
++#define __org_openoffice_vba_VbaEventId_idl__
++
++//=============================================================================
++
++module com { module sun { module star { module document {
++//=============================================================================
++
++/* VBA compatibility event id */
++constants VbaEventId
++{
++ // Worksheet
++ const long VBAEVENT_WORKSHEET_ACTIVATE = 1;
++ const long VBAEVENT_WORKSHEET_BEFOREDOUBLECLICK = 2;
++ const long VBAEVENT_WORKSHEET_BEFORERIGHTCLICK = 3;
++ const long VBAEVENT_WORKSHEET_CALCULATE = 4;
++ const long VBAEVENT_WORKSHEET_CHANGE = 5;
++ const long VBAEVENT_WORKSHEET_DEACTIVATE = 6;
++ const long VBAEVENT_WORKSHEET_FOLLOWHYPERLINK = 7;
++ const long VBAEVENT_WORKSHEET_PIVOTTABLEUPDATE = 8;
++ const long VBAEVENT_WORKSHEET_SELECTIONCHANGE = 9;
++ // Workbook
++ const long VBAEVENT_WORKBOOK_ACTIVATE = 20;
++ const long VBAEVENT_WORKBOOK_DEACTIVATE = 21;
++ const long VBAEVENT_WORKBOOK_OPEN = 22;
++ const long VBAEVENT_WORKBOOK_AUTOOPEN = 23;
++ const long VBAEVENT_WORKBOOK_BEFORECLOSE = 24;
++ const long VBAEVENT_WORKBOOK_BEFOREPRINT = 25;
++ const long VBAEVENT_WORKBOOK_BEFORESAVE = 26;
++ const long VBAEVENT_WORKBOOK_NEWSHEET = 27;
++ const long VBAEVENT_WORKBOOK_WINDOWACTIVATE = 28;
++ const long VBAEVENT_WORKBOOK_WINDOWDEACTIVATE = 29;
++ const long VBAEVENT_WORKBOOK_WINDOWRESIZE = 30;
++ // Workbook_sheet
++ const long VBAEVENT_WORKBOOK_SHEET_ACTIVATE = 51;
++ const long VBAEVENT_WORKBOOK_SHEET_BEFOREDOUBLECLICK = 52;
++ const long VBAEVENT_WORKBOOK_SHEET_BEFORERIGHTCLICK = 53;
++ const long VBAEVENT_WORKBOOK_SHEET_CALCULATE = 54;
++ const long VBAEVENT_WORKBOOK_SHEET_CHANGE = 55;
++ const long VBAEVENT_WORKBOOK_SHEET_DEACTIVATE = 56;
++ const long VBAEVENT_WORKBOOK_SHEET_FOLLOWHYPERLINK = 57;
++ const long VBAEVENT_WORKBOOK_SHEET_PIVOTTABLEUPDATE = 58;
++ const long VBAEVENT_WORKBOOK_SHEET_SELECTIONCHANGE = 59;
++};
++
++}; }; }; };
++
++#endif
+Index: offapi/com/sun/star/document/VbaEventsHelper.idl
+===================================================================
+RCS file: offapi/com/sun/star/document/VbaEventsHelper.idl
+diff -N offapi/com/sun/star/document/VbaEventsHelper.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ offapi/com/sun/star/document/VbaEventsHelper.idl 1 Aug 2008 03:13:19 -0000 1.1.2.1
+@@ -0,0 +1,55 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_VbaEventsHelper_idl__
++#define __org_openoffice_vba_VbaEventsHelper_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++#include <com/sun/star/frame/XModel.idl>
++#include <com/sun/star/document/XVbaEventsHelper.idl>
++//=============================================================================
++
++module com { module sun { module star { module document {
++//=============================================================================
++
++service VbaEventsHelper : XVbaEventsHelper
++{
++ createVbaEventsHelper( [in] ::com::sun::star::frame::XModel xModel );
++};
++
++}; }; }; };
++
++#endif
+Index: offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl
+===================================================================
+RCS file: offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl
+diff -N offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl 1 Aug 2008 03:13:19 -0000 1.1.2.1
+@@ -0,0 +1,53 @@
++/*************************************************************************
++ *
++ * 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$
++ * $Revision$
++ *
++ * 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 __com_sun_star_document_XDocumentEventCompatibleHelper_idl__
++#define __com_sun_star_document_XDocumentEventCompatibleHelper_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module com { module sun { module star { module document {
++
++//=============================================================================
++interface XDocumentEventCompatibleHelper
++{
++ /* Execute some compatible VBA event related to document, such as document save, document print.
++ nEventId: event id.
++ */
++ boolean processCompatibleEvent( [in] short nEventId );
++};
++
++//=============================================================================
++
++}; }; }; };
++
++#endif
+Index: offapi/com/sun/star/document/XVbaEventsHelper.idl
+===================================================================
+RCS file: offapi/com/sun/star/document/XVbaEventsHelper.idl
+diff -N offapi/com/sun/star/document/XVbaEventsHelper.idl
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ offapi/com/sun/star/document/XVbaEventsHelper.idl 1 Aug 2008 03:13:19 -0000 1.1.2.1
+@@ -0,0 +1,60 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * 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
++ *
++ ************************************************************************/
++#ifndef __org_openoffice_vba_XVbaEventsHelper_idl__
++#define __org_openoffice_vba_XVbaEventsHelper_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++//=============================================================================
++
++module com { module sun { module star { module document {
++//=============================================================================
++
++interface XVbaEventsHelper
++{
++ /**
++ Execute VBA compatible event.
++ VbaEvent: Compatible VBA event id.
++ aArgs: the array of input arguments.
++ return: True if execute successfully, or False.
++ **/
++ boolean ProcessCompatibleVbaEvent( [in] long nEventId, [in] sequence< any > aArgs );
++ [attribute ] boolean IgnoreEvents;
++};
++
++}; }; }; };
++
++#endif
+Index: offapi/com/sun/star/document/makefile.mk
+===================================================================
+RCS file: /cvs/api/offapi/com/sun/star/document/makefile.mk,v
+retrieving revision 1.47
+retrieving revision 1.47.32.1
+diff -u -p -b -w -B -r1.47 -r1.47.32.1
+--- offapi/com/sun/star/document/makefile.mk 1 Jul 2008 12:38:47 -0000 1.47
++++ offapi/com/sun/star/document/makefile.mk 1 Aug 2008 03:13:19 -0000 1.47.32.1
+@@ -108,7 +108,11 @@ IDLFILES=\
+ LinkUpdateModes.idl\
+ XDocumentRevisionListPersistence.idl\
+ DocumentRevisionListPersistence.idl \
+- XDocumentLanguages.idl
++ XDocumentLanguages.idl \
++ XDocumentEventCompatibleHelper.idl \
++ VbaEventId.idl \
++ XVbaEventsHelper.idl \
++ VbaEventsHelper.idl \
+
+ # ------------------------------------------------------------------
+
+cvs diff: Diffing offapi/com/sun/star/drawing
+cvs diff: Diffing offapi/com/sun/star/drawing/framework
+cvs diff: Diffing offapi/com/sun/star/embed
+cvs diff: Diffing offapi/com/sun/star/form
+cvs diff: Diffing offapi/com/sun/star/form/binding
+cvs diff: Diffing offapi/com/sun/star/form/component
+cvs diff: Diffing offapi/com/sun/star/form/control
+cvs diff: Diffing offapi/com/sun/star/form/inspection
+cvs diff: Diffing offapi/com/sun/star/form/runtime
+cvs diff: Diffing offapi/com/sun/star/form/submission
+cvs diff: Diffing offapi/com/sun/star/form/validation
+cvs diff: Diffing offapi/com/sun/star/formula
+cvs diff: Diffing offapi/com/sun/star/frame
+cvs diff: Diffing offapi/com/sun/star/frame/status
+cvs diff: Diffing offapi/com/sun/star/gallery
+cvs diff: Diffing offapi/com/sun/star/geometry
+cvs diff: Diffing offapi/com/sun/star/graphic
+cvs diff: Diffing offapi/com/sun/star/i18n
+cvs diff: Diffing offapi/com/sun/star/image
+cvs diff: Diffing offapi/com/sun/star/inspection
+cvs diff: Diffing offapi/com/sun/star/installation
+cvs diff: Diffing offapi/com/sun/star/ldap
+cvs diff: Diffing offapi/com/sun/star/linguistic2
+cvs diff: Diffing offapi/com/sun/star/logging
+cvs diff: Diffing offapi/com/sun/star/mail
+cvs diff: Diffing offapi/com/sun/star/media
+cvs diff: Diffing offapi/com/sun/star/mozilla
+cvs diff: Diffing offapi/com/sun/star/packages
+cvs diff: Diffing offapi/com/sun/star/packages/manifest
+cvs diff: Diffing offapi/com/sun/star/packages/zip
+cvs diff: Diffing offapi/com/sun/star/plugin
+cvs diff: Diffing offapi/com/sun/star/presentation
+cvs diff: Diffing offapi/com/sun/star/presentation/textfield
+cvs diff: Diffing offapi/com/sun/star/rdf
+cvs diff: Diffing offapi/com/sun/star/rendering
+cvs diff: Diffing offapi/com/sun/star/report
+cvs diff: Diffing offapi/com/sun/star/report/inspection
+cvs diff: Diffing offapi/com/sun/star/resource
+cvs diff: Diffing offapi/com/sun/star/scanner
+cvs diff: Diffing offapi/com/sun/star/script
+cvs diff: Diffing offapi/com/sun/star/script/browse
+cvs diff: Diffing offapi/com/sun/star/script/provider
+cvs diff: Diffing offapi/com/sun/star/sdb
+cvs diff: Diffing offapi/com/sun/star/sdb/application
+cvs diff: Diffing offapi/com/sun/star/sdb/tools
+cvs diff: Diffing offapi/com/sun/star/sdbc
+cvs diff: Diffing offapi/com/sun/star/sdbcx
+cvs diff: Diffing offapi/com/sun/star/security
+cvs diff: Diffing offapi/com/sun/star/setup
+cvs diff: Diffing offapi/com/sun/star/sheet
+cvs diff: Diffing offapi/com/sun/star/smarttags
+cvs diff: Diffing offapi/com/sun/star/style
+cvs diff: Diffing offapi/com/sun/star/svg
+cvs diff: Diffing offapi/com/sun/star/sync
+cvs diff: Diffing offapi/com/sun/star/sync2
+cvs diff: Diffing offapi/com/sun/star/system
+cvs diff: Diffing offapi/com/sun/star/table
+cvs diff: Diffing offapi/com/sun/star/task
+cvs diff: Diffing offapi/com/sun/star/text
+cvs diff: Diffing offapi/com/sun/star/text/fieldmaster
+cvs diff: Diffing offapi/com/sun/star/text/textfield
+cvs diff: Diffing offapi/com/sun/star/text/textfield/docinfo
+cvs diff: Diffing offapi/com/sun/star/ucb
+cvs diff: Diffing offapi/com/sun/star/ucb/smart
+cvs diff: Diffing offapi/com/sun/star/ui
+cvs diff: Diffing offapi/com/sun/star/ui/dialogs
+cvs diff: Diffing offapi/com/sun/star/util
+cvs diff: Diffing offapi/com/sun/star/view
+cvs diff: Diffing offapi/com/sun/star/xforms
+cvs diff: Diffing offapi/com/sun/star/xml
+cvs diff: Diffing offapi/com/sun/star/xml/crypto
+cvs diff: Diffing offapi/com/sun/star/xml/crypto/sax
+cvs diff: Diffing offapi/com/sun/star/xml/csax
+cvs diff: Diffing offapi/com/sun/star/xml/dom
+cvs diff: Diffing offapi/com/sun/star/xml/dom/events
+cvs diff: Diffing offapi/com/sun/star/xml/dom/views
+cvs diff: Diffing offapi/com/sun/star/xml/input
+cvs diff: Diffing offapi/com/sun/star/xml/sax
+cvs diff: Diffing offapi/com/sun/star/xml/wrapper
+cvs diff: Diffing offapi/com/sun/star/xml/xpath
+cvs diff: Diffing offapi/com/sun/star/xsd
+cvs diff: Diffing offapi/drafts
+cvs diff: Diffing offapi/drafts/com
+cvs diff: Diffing offapi/drafts/com/sun
+cvs diff: Diffing offapi/drafts/com/sun/star
+cvs diff: Diffing offapi/drafts/com/sun/star/form
+cvs diff: Diffing offapi/prj
+cvs diff: Diffing offapi/type_reference
+cvs diff: Diffing offapi/util
+cvs diff: Diffing sfx2
+cvs diff: Diffing sfx2/inc
+cvs diff: Diffing sfx2/inc/pch
+cvs diff: Diffing sfx2/inc/sfx2
+Index: sfx2/inc/sfx2/objsh.hxx
+===================================================================
+RCS file: /cvs/framework/sfx2/inc/sfx2/objsh.hxx,v
+retrieving revision 1.14
+retrieving revision 1.14.96.1
+diff -u -p -b -w -B -r1.14 -r1.14.96.1
+--- sfx2/inc/sfx2/objsh.hxx 20 May 2008 18:57:30 -0000 1.14
++++ sfx2/inc/sfx2/objsh.hxx 1 Aug 2008 03:23:55 -0000 1.14.96.1
+@@ -304,6 +304,7 @@ public:
+ void SetNoName();
+ sal_Bool IsInModalMode() const;
+ sal_Bool HasModalViews() const;
++ sal_Bool IsInPrepareClose() const;
+ sal_Bool IsHelpDocument() const;
+
+ sal_Bool IsDocShared() const;
+@@ -403,7 +404,8 @@ public:
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
+ ::com::sun::star::uno::Any& aRet,
+ ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
+- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam
++ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam,
++ bool bRaiseError = true
+ );
+
+ static ErrCode CallXScript(
+@@ -412,7 +414,8 @@ public:
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
+ ::com::sun::star::uno::Any& aRet,
+ ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
+- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam
++ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam,
++ bool bRaiseError = true
+ );
+
+ /** adjusts the internal macro mode, according to the current security settings
+cvs diff: Diffing sfx2/prj
+cvs diff: Diffing sfx2/qa
+cvs diff: Diffing sfx2/qa/complex
+cvs diff: Diffing sfx2/qa/complex/DocHelper
+cvs diff: Diffing sfx2/qa/complex/docinfo
+cvs diff: Diffing sfx2/qa/complex/standalonedocumentinfo
+cvs diff: Diffing sfx2/qa/complex/testdocuments
+cvs diff: Diffing sfx2/qa/unoapi
+cvs diff: Diffing sfx2/qa/unoapi/testdocuments
+cvs diff: Diffing sfx2/sdi
+cvs diff: Diffing sfx2/source
+cvs diff: Diffing sfx2/source/appl
+cvs diff: Diffing sfx2/source/bastyp
+cvs diff: Diffing sfx2/source/config
+cvs diff: Diffing sfx2/source/control
+cvs diff: Diffing sfx2/source/dialog
+cvs diff: Diffing sfx2/source/doc
+Index: sfx2/source/doc/objmisc.cxx
+===================================================================
+RCS file: /cvs/framework/sfx2/source/doc/objmisc.cxx,v
+retrieving revision 1.102
+retrieving revision 1.102.106.1
+diff -u -p -b -w -B -r1.102 -r1.102.106.1
+--- sfx2/source/doc/objmisc.cxx 5 May 2008 16:18:09 -0000 1.102
++++ sfx2/source/doc/objmisc.cxx 1 Aug 2008 03:23:55 -0000 1.102.106.1
+@@ -1591,7 +1591,7 @@ namespace
+ }
+
+ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const ::rtl::OUString& _rScriptURL,
+- const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam )
++ const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError )
+ {
+ OSL_TRACE( "in CallXScript" );
+ ErrCode nErr = ERRCODE_NONE;
+@@ -1632,7 +1632,7 @@ ErrCode SfxObjectShell::CallXScript( con
+ nErr = ERRCODE_BASIC_INTERNAL_ERROR;
+ }
+
+- if ( bCaughtException )
++ if ( bCaughtException && bRaiseError )
+ {
+ ::std::auto_ptr< VclAbstractDialog > pScriptErrDlg;
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+@@ -1656,9 +1656,9 @@ ErrCode SfxObjectShell::CallXScript( con
+ ::com::sun::star::uno::Any& aRet,
+ ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&
+- aOutParam)
++ aOutParam, bool bRaiseError )
+ {
+- return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam );
++ return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError );
+ }
+
+ //-------------------------------------------------------------------------
+Index: sfx2/source/doc/objserv.cxx
+===================================================================
+RCS file: /cvs/framework/sfx2/source/doc/objserv.cxx,v
+retrieving revision 1.106
+retrieving revision 1.106.94.1
+diff -u -p -b -w -B -r1.106 -r1.106.94.1
+--- sfx2/source/doc/objserv.cxx 20 May 2008 18:59:49 -0000 1.106
++++ sfx2/source/doc/objserv.cxx 1 Aug 2008 03:23:55 -0000 1.106.94.1
+@@ -109,6 +109,7 @@
+ #include <com/sun/star/document/XDocumentInfo.hpp>
+ #include <com/sun/star/document/XDocumentInfoSupplier.hpp>
+ #include <com/sun/star/document/XDocumentProperties.hpp>
++#include <com/sun/star/document/XDocumentEventCompatibleHelper.hpp>
+
+ #ifndef _SFX_HELPID_HRC
+ #include "helpid.hrc"
+@@ -522,6 +523,18 @@ void SfxObjectShell::ExecFile_Impl(SfxRe
+ case SID_SAVEASDOC:
+ case SID_SAVEDOC:
+ {
++ if( nId == SID_SAVEDOC || nId == SID_SAVEASDOC )
++ {
++ uno::Reference< document::XDocumentEventCompatibleHelper > xVbaEventHelper( GetModel(), uno::UNO_QUERY );
++ if( xVbaEventHelper.is() )
++ {
++ if( xVbaEventHelper->processCompatibleEvent( nId ) )
++ {
++ rReq.SetReturnValue( SfxBoolItem( 0, sal_True ) );
++ return;
++ }
++ }
++ }
+ //!! detaillierte Auswertung eines Fehlercodes
+ SfxObjectShellRef xLock( this );
+
+Index: sfx2/source/doc/objxtor.cxx
+===================================================================
+RCS file: /cvs/framework/sfx2/source/doc/objxtor.cxx,v
+retrieving revision 1.84
+retrieving revision 1.84.32.1
+diff -u -p -b -w -B -r1.84 -r1.84.32.1
+--- sfx2/source/doc/objxtor.cxx 6 Jun 2008 12:13:32 -0000 1.84
++++ sfx2/source/doc/objxtor.cxx 1 Aug 2008 03:23:55 -0000 1.84.32.1
+@@ -576,6 +576,13 @@ SfxObjectShell* SfxObjectShell::Current(
+ return pFrame ? pFrame->GetObjectShell() : 0;
+ }
+
++//-------------------------------------------------------------------------
++
++sal_Bool SfxObjectShell::IsInPrepareClose() const
++{
++ return pImp->bInPrepareClose;
++}
++
+ //------------------------------------------------------------------------
+
+ struct BoolEnv_Impl
+cvs diff: Diffing sfx2/source/explorer
+cvs diff: Diffing sfx2/source/inc
+cvs diff: Diffing sfx2/source/inet
+cvs diff: Diffing sfx2/source/menu
+cvs diff: Diffing sfx2/source/notify
+cvs diff: Diffing sfx2/source/statbar
+cvs diff: Diffing sfx2/source/toolbox
+cvs diff: Diffing sfx2/source/view
+Index: sfx2/source/view/viewprn.cxx
+===================================================================
+RCS file: /cvs/framework/sfx2/source/view/viewprn.cxx,v
+retrieving revision 1.36
+retrieving revision 1.36.124.1
+diff -u -p -b -w -B -r1.36 -r1.36.124.1
+--- sfx2/source/view/viewprn.cxx 11 Apr 2008 13:42:19 -0000 1.36
++++ sfx2/source/view/viewprn.cxx 1 Aug 2008 03:23:56 -0000 1.36.124.1
+@@ -32,6 +32,7 @@
+ #include "precompiled_sfx2.hxx"
+
+ #include <com/sun/star/document/XDocumentProperties.hpp>
++#include <com/sun/star/document/XDocumentEventCompatibleHelper.hpp>
+ #include <com/sun/star/view/PrintableState.hpp>
+ #include <svtools/itempool.hxx>
+ #ifndef _MSGBOX_HXX //autogen
+@@ -67,6 +68,8 @@
+ #include "view.hrc"
+ #include "helpid.hrc"
+
++using namespace com::sun::star;
++
+ TYPEINIT1(SfxPrintingHint, SfxHint);
+
+ // -----------------------------------------------------------------------
+@@ -405,6 +408,22 @@ void SfxViewShell::ExecPrint_Impl( SfxRe
+ case SID_SETUPPRINTER:
+ case SID_PRINTER_NAME :
+ {
++ if( nId == SID_PRINTDOC )
++ {
++ SfxObjectShell* pDoc = GetObjectShell();
++ if( pDoc )
++ {
++ uno::Reference< document::XDocumentEventCompatibleHelper > xVbaEventHelper( pDoc->GetModel(), uno::UNO_QUERY );
++ if( xVbaEventHelper.is() )
++ {
++ if( xVbaEventHelper->processCompatibleEvent( nId ) )
++ {
++ rReq.SetReturnValue(SfxBoolItem(0,FALSE));
++ return;
++ }
++ }
++ }
++ }
+ // quiet mode (AppEvent, API call)
+ SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, FALSE);
+ bSilent = pSilentItem && pSilentItem->GetValue();
+@@ -714,6 +733,15 @@ void SfxViewShell::ExecPrint_Impl( SfxRe
+ if ( SID_PRINTDOCDIRECT == nId )
+ {
+ SfxObjectShell* pDoc = GetObjectShell();
++ uno::Reference< document::XDocumentEventCompatibleHelper > xVbaEventHelper( pDoc->GetModel(), uno::UNO_QUERY );
++ if( xVbaEventHelper.is() )
++ {
++ if( xVbaEventHelper->processCompatibleEvent( nId ) )
++ {
++ rReq.SetReturnValue(SfxBoolItem(0,FALSE));
++ return;
++ }
++ }
+ bool bDetectHidden = ( !bSilent && pDoc );
+ if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
+ return;
+cvs diff: Diffing sfx2/util
+cvs diff: Diffing sfx2/util/defs
+cvs diff: Diffing sfx2/win
+cvs diff: Diffing sfx2/win/res
Modified: trunk/patches/vba/vbaevents-services-sources.diff
==============================================================================
--- trunk/patches/vba/vbaevents-services-sources.diff (original)
+++ trunk/patches/vba/vbaevents-services-sources.diff Fri Aug 1 08:35:30 2008
@@ -1252,7 +1252,7 @@
diff -rup sc/inc/docuno.hxx sc/inc/docuno.hxx
--- sc/inc/docuno.hxx 2008-03-05 17:29:55.000000000 +0000
+++ sc/inc/docuno.hxx 2008-04-28 17:52:17.000000000 +0100
-@@ -144,6 +144,8 @@ class ScTableSheetObj;
+@@ -74,6 +74,8 @@ class ScTableSheetObj;
class SvxFmDrawPage;
class SvxDrawPage;
@@ -1261,17 +1261,17 @@
class SC_DLLPUBLIC ScModelObj : public SfxBaseModel,
public com::sun::star::sheet::XSpreadsheetDocument,
public com::sun::star::document::XActionLockable,
-@@ -157,6 +159,7 @@ class SC_DLLPUBLIC ScModelObj : public S
+@@ -87,6 +89,7 @@ class SC_DLLPUBLIC ScModelObj : public S
public com::sun::star::view::XRenderable,
public com::sun::star::document::XLinkTargetSupplier,
public com::sun::star::beans::XPropertySet,
-+ public com::sun::star::document::XCodeNameQuery,
++ public com::sun::star::document::XCodeNameQuery,
+ public com::sun::star::document::XDocumentEventCompatibleHelper,
public SvxFmMSFactory, // derived from XMultiServiceFactory
public com::sun::star::lang::XServiceInfo
- {
-@@ -369,6 +372,8 @@ public:
+@@ -349,6 +352,8 @@ public:
throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw(::com::sun::star::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getCodeNameForObject( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& aObj )
+ throw(::com::sun::star::uno::RuntimeException);
@@ -1436,7 +1436,7 @@
diff -rup sc/source/ui/unoobj/docuno.cxx sc/source/ui/unoobj/docuno.cxx
--- sc/source/ui/unoobj/docuno.cxx 2008-03-05 17:33:11.000000000 +0000
+++ sc/source/ui/unoobj/docuno.cxx 2008-04-29 00:10:59.000000000 +0100
-@@ -108,6 +108,7 @@ using namespace com::sun::star;
+@@ -106,6 +106,7 @@ using namespace com::sun::star::document
// alles ohne Which-ID, Map nur fuer PropertySetInfo
//! umbenennen, sind nicht mehr nur Options
@@ -1444,19 +1444,18 @@
const SfxItemPropertyMap* lcl_GetDocOptPropertyMap()
{
static SfxItemPropertyMap aDocOptPropertyMap_Impl[] =
-@@ -336,6 +337,7 @@ uno::Any SAL_CALL ScModelObj::queryInter
+@@ -334,6 +335,7 @@ uno::Any SAL_CALL ScModelObj::queryInter
SC_QUERYINTERFACE( view::XRenderable )
SC_QUERYINTERFACE( document::XLinkTargetSupplier )
SC_QUERYINTERFACE( beans::XPropertySet )
-+ SC_QUERYINTERFACE( document::XCodeNameQuery )
++ SC_QUERYINTERFACE( document::XCodeNameQuery )
+ SC_QUERYINTERFACE( document::XDocumentEventCompatibleHelper)
SC_QUERYINTERFACE( lang::XMultiServiceFactory )
SC_QUERYINTERFACE( lang::XServiceInfo )
-
-@@ -1694,7 +1696,49 @@ uno::Sequence<rtl::OUString> SAL_CALL Sc
-
+@@ -1730,6 +1732,50 @@ uno::Sequence<rtl::OUString> SAL_CALL Sc
return concatServiceNames( aMyServices, aDrawServices );
}
--
+
+// XCodeNameQuery
+rtl::OUString SAL_CALL
+ScModelObj::getCodeNameForObject( const uno::Reference< uno::XInterface >& xIf ) throw( uno::RuntimeException )
@@ -1500,9 +1499,10 @@
+ // Probably should throw here ( if !bMatched )
+ return sCodeName;
+}
- // XServiceInfo
-
- rtl::OUString SAL_CALL ScModelObj::getImplementationName() throw(uno::RuntimeException)
++
+ // XVbaEventHelper
+ // For Vba Event
+ sal_Bool SAL_CALL
diff -rup oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl
--- oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl 2007-04-27 08:32:41.000000000 +0100
+++ oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl 2008-04-28 16:14:51.000000000 +0100
@@ -1519,17 +1519,14 @@
}; }; };
--- /data4/OOOBuildDEVM4-source-only/ooo-build/build/dev300-m4/offapi/com/sun/star/document/makefile.mk 2008-03-07 12:31:01.000000000 +0000
+++ offapi/com/sun/star/document/makefile.mk 2008-04-28 17:25:31.000000000 +0100
-@@ -111,7 +111,9 @@ IDLFILES=\
- LinkUpdateModes.idl\
+@@ -109,6 +109,7 @@ IDLFILES=\
XDocumentRevisionListPersistence.idl\
DocumentRevisionListPersistence.idl \
-- XDocumentLanguages.idl
-+ XDocumentLanguages.idl \
+ XDocumentLanguages.idl \
+ XCodeNameQuery.idl \
-+
-
- # ------------------------------------------------------------------
-
+ XDocumentEventCompatibleHelper.idl \
+ VbaEventId.idl \
+ XVbaEventsHelper.idl \
--- /dev/null 2007-05-04 11:54:36.000000000 +0100
+++ offapi/com/sun/star/document/XCodeNameQuery.idl 2008-04-28 17:39:33.000000000 +0100
@@ -0,0 +1,56 @@
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]