diff options
Diffstat (limited to 'sc/source/ui/vba')
125 files changed, 2323 insertions, 2359 deletions
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 2c39d7154b4b..5fc1b3c4061e 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -153,7 +153,7 @@ implnCopy( const uno::Reference< frame::XModel>& xModel ) pViewShell->CopyToClip(NULL,false,false,true); } -void +void implnCut( const uno::Reference< frame::XModel>& xModel ) { ScTabViewShell* pViewShell = getBestViewShell( xModel ); @@ -170,18 +170,18 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFl ScTabViewShell* pTabViewShell = getBestViewShell( xModel ); if ( pTabViewShell ) { - ScViewData* pView = pTabViewShell->GetViewData(); + ScViewData* pView = pTabViewShell->GetViewData(); Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL; if ( pView && pWin ) { if ( bAsLink && bOtherDoc ) pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK - else + else { ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); - ScDocument* pDoc = NULL; + ScDocument* pDoc = NULL; if ( pOwnClip ) - pDoc = pOwnClip->GetDocument(); + pDoc = pOwnClip->GetDocument(); pTabViewShell->PasteFromClip( nFlags, pDoc, nFunction, bSkipEmpty, bTranspose, bAsLink, eMoveMode, IDF_NONE, TRUE ); @@ -192,8 +192,8 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFl } -ScDocShell* -getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) +ScDocShell* +getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) { uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW ); ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() ); @@ -204,7 +204,7 @@ getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) } -ScTabViewShell* +ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) { ScDocShell* pDocShell = getDocShell( xModel ); @@ -213,23 +213,23 @@ getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) return NULL; } -ScTabViewShell* +ScTabViewShell* getCurrentBestViewShell( const uno::Reference< uno::XComponentContext >& xContext ) -{ +{ uno::Reference< frame::XModel > xModel = getCurrentExcelDoc( xContext ); return getBestViewShell( xModel ); } -SfxViewFrame* +SfxViewFrame* getViewFrame( const uno::Reference< frame::XModel >& xModel ) { - ScTabViewShell* pViewShell = getBestViewShell( xModel ); + ScTabViewShell* pViewShell = getBestViewShell( xModel ); if ( pViewShell ) return pViewShell->GetViewFrame(); return NULL; } -uno::Reference< XHelperInterface > +uno::Reference< XHelperInterface > getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException ) { uno::Reference< sheet::XSheetCellRange > xSheetRange( xRange, uno::UNO_QUERY_THROW ); @@ -238,15 +238,15 @@ getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CodeName") ) ) >>= sCodeName; // #TODO #FIXME ideally we should 'throw' here if we don't get a valid parent, but... it is possible // to create a module ( and use 'Option VBASupport 1' ) for a calc document, in this scenario there - // are *NO* special document module objects ( of course being able to switch between vba/non vba mode at - // the document in the future could fix this, especially IF the switching of the vba mode takes care to + // are *NO* special document module objects ( of course being able to switch between vba/non vba mode at + // the document in the future could fix this, especially IF the switching of the vba mode takes care to // create the special document module objects if they don't exist. uno::Reference< XHelperInterface > xParent( ov::getUnoDocModule( sCodeName, GetDocShellFromRange( xRange ) ), uno::UNO_QUERY ); return xParent; } -uno::Reference< XHelperInterface > +uno::Reference< XHelperInterface > getUnoSheetModuleObj( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException ) { uno::Reference< container::XEnumerationAccess > xEnumAccess( xRanges, uno::UNO_QUERY_THROW ); @@ -264,5 +264,5 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangesBase* pRangeObj ) } //excel -} //vba -} //ooo +} //vba +} //ooo diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx index da0474e6ceb0..528457a0f6cc 100644 --- a/sc/source/ui/vba/excelvbahelper.hxx +++ b/sc/source/ui/vba/excelvbahelper.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,12 +35,12 @@ class ScCellRangesBase; -namespace ooo +namespace ooo { - namespace vba + namespace vba { namespace excel - { + { // nTabs empty means apply zoom to all sheets void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ); void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel ); diff --git a/sc/source/ui/vba/helperdecl.hxx b/sc/source/ui/vba/helperdecl.hxx index a9969179d52f..585350c16e8c 100644 --- a/sc/source/ui/vba/helperdecl.hxx +++ b/sc/source/ui/vba/helperdecl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl<Impl vba_service_class_() : baseT() {} template <typename PostProcessFuncT> /** Ctor to pass a post processing function/functor. - + @tpl PostProcessDefaultT let your compiler deduce this @param postProcessFunc function/functor that gets the yet unacquired ImplT_ pointer returning a diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk index 4cb7e3eb064b..92bb3fd39db0 100644 --- a/sc/source/ui/vba/makefile.mk +++ b/sc/source/ui/vba/makefile.mk @@ -47,63 +47,63 @@ INCPRE=$(INCCOM)$/$(TARGET) # ------------------------------------------------------------------ SLOFILES= \ - $(SLO)$/vbaglobals.obj \ - $(SLO)$/vbaworkbook.obj \ - $(SLO)$/vbaworksheets.obj \ + $(SLO)$/excelvbahelper.obj \ + $(SLO)$/service.obj \ $(SLO)$/vbaapplication.obj \ - $(SLO)$/vbarange.obj \ - $(SLO)$/vbaname.obj \ - $(SLO)$/vbanames.obj \ - $(SLO)$/vbacomment.obj \ - $(SLO)$/vbacomments.obj \ - $(SLO)$/vbaworkbooks.obj \ - $(SLO)$/vbaworksheet.obj \ - $(SLO)$/vbaoutline.obj \ - $(SLO)$/vbafont.obj\ - $(SLO)$/excelvbahelper.obj\ - $(SLO)$/vbainterior.obj\ - $(SLO)$/vbawsfunction.obj\ - $(SLO)$/vbawindow.obj\ - $(SLO)$/vbachart.obj\ - $(SLO)$/vbachartobject.obj\ - $(SLO)$/vbachartobjects.obj\ - $(SLO)$/vbaseriescollection.obj\ - $(SLO)$/vbadialogs.obj \ - $(SLO)$/vbadialog.obj \ - $(SLO)$/vbapivottable.obj \ - $(SLO)$/vbapivotcache.obj \ - $(SLO)$/vbapivottables.obj \ - $(SLO)$/vbawindows.obj \ - $(SLO)$/vbapalette.obj \ + $(SLO)$/vbaassistant.obj \ + $(SLO)$/vbaaxes.obj \ + $(SLO)$/vbaaxis.obj \ + $(SLO)$/vbaaxistitle.obj \ $(SLO)$/vbaborders.obj \ $(SLO)$/vbacharacters.obj \ - $(SLO)$/vbavalidation.obj \ - $(SLO)$/vbasheetobject.obj \ - $(SLO)$/vbasheetobjects.obj \ - $(SLO)$/vbaoleobject.obj \ - $(SLO)$/vbaoleobjects.obj \ - $(SLO)$/vbatextboxshape.obj \ - $(SLO)$/vbapane.obj \ - $(SLO)$/vbatextframe.obj \ - $(SLO)$/vbacharttitle.obj \ + $(SLO)$/vbachart.obj \ + $(SLO)$/vbachartobject.obj \ + $(SLO)$/vbachartobjects.obj \ $(SLO)$/vbacharts.obj \ - $(SLO)$/vbaaxistitle.obj \ - $(SLO)$/vbaaxes.obj \ - $(SLO)$/vbaaxis.obj \ - $(SLO)$/vbaformat.obj \ + $(SLO)$/vbacharttitle.obj \ + $(SLO)$/vbacomment.obj \ + $(SLO)$/vbacomments.obj \ $(SLO)$/vbacondition.obj \ + $(SLO)$/vbadialog.obj \ + $(SLO)$/vbadialogs.obj \ + $(SLO)$/vbaeventshelper.obj \ + $(SLO)$/vbafont.obj \ + $(SLO)$/vbaformat.obj \ $(SLO)$/vbaformatcondition.obj \ $(SLO)$/vbaformatconditions.obj \ - $(SLO)$/vbastyle.obj \ - $(SLO)$/vbastyles.obj \ - $(SLO)$/vbaassistant.obj \ + $(SLO)$/vbaglobals.obj \ $(SLO)$/vbahyperlink.obj \ $(SLO)$/vbahyperlinks.obj \ - $(SLO)$/vbapagesetup.obj \ + $(SLO)$/vbainterior.obj \ + $(SLO)$/vbaname.obj \ + $(SLO)$/vbanames.obj \ + $(SLO)$/vbaoleobject.obj \ + $(SLO)$/vbaoleobjects.obj \ + $(SLO)$/vbaoutline.obj \ $(SLO)$/vbapagebreak.obj \ $(SLO)$/vbapagebreaks.obj \ - $(SLO)$/vbaeventshelper.obj \ - $(SLO)$/service.obj + $(SLO)$/vbapagesetup.obj \ + $(SLO)$/vbapalette.obj \ + $(SLO)$/vbapane.obj \ + $(SLO)$/vbapivotcache.obj \ + $(SLO)$/vbapivottable.obj \ + $(SLO)$/vbapivottables.obj \ + $(SLO)$/vbarange.obj \ + $(SLO)$/vbaseriescollection.obj \ + $(SLO)$/vbasheetobject.obj \ + $(SLO)$/vbasheetobjects.obj \ + $(SLO)$/vbastyle.obj \ + $(SLO)$/vbastyles.obj \ + $(SLO)$/vbatextboxshape.obj \ + $(SLO)$/vbatextframe.obj \ + $(SLO)$/vbavalidation.obj \ + $(SLO)$/vbawindow.obj \ + $(SLO)$/vbawindows.obj \ + $(SLO)$/vbaworkbook.obj \ + $(SLO)$/vbaworkbooks.obj \ + $(SLO)$/vbaworksheet.obj \ + $(SLO)$/vbaworksheets.obj \ + $(SLO)$/vbawsfunction.obj .ENDIF # --- Targets ------------------------------------------------------ diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx index 2b1f14cf154a..b21b55f6ae9b 100644 --- a/sc/source/ui/vba/service.cxx +++ b/sc/source/ui/vba/service.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ namespace worksheet { extern sdecl::ServiceDecl const serviceDecl; } -namespace window +namespace window { extern sdecl::ServiceDecl const serviceDecl; } @@ -58,11 +58,11 @@ namespace globals { extern sdecl::ServiceDecl const serviceDecl; } -namespace hyperlink +namespace hyperlink { extern sdecl::ServiceDecl const serviceDecl; } -namespace application +namespace application { extern sdecl::ServiceDecl const serviceDecl; } @@ -70,27 +70,27 @@ namespace vbaeventshelper { extern sdecl::ServiceDecl const serviceDecl; } -namespace textframe +namespace textframe { extern sdecl::ServiceDecl const serviceDecl; } extern "C" { - SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( + SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { OSL_TRACE("In component_getImplementationEnv"); *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( + SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) { OSL_TRACE("In component_writeInfo"); #if 0 // Component registration - if ( component_writeInfoHelper( pServiceManager, pRegistryKey, + if ( component_writeInfoHelper( pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl ) ) { // Singleton registration @@ -101,7 +101,7 @@ extern "C" Reference< registry::XRegistryKey >xKey = pKey->createKey( rtl::OUString::createFromAscii( ("ooo.vba.Globals/UNO/SINGLETONS/ooo.vba.theGlobals") ) ); - xKey->setStringValue( ::rtl::OUString::createFromAscii( + xKey->setStringValue( ::rtl::OUString::createFromAscii( ("ooo.vba.Globals") ) ); return sal_True; } @@ -113,13 +113,13 @@ extern "C" return sal_False; #else // Component registration - return component_writeInfoHelper( pServiceManager, pRegistryKey, + return component_writeInfoHelper( pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl, textframe::serviceDecl ); #endif - + } - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) { diff --git a/sc/source/ui/vba/testvba/launchTest.pl b/sc/source/ui/vba/testvba/launchTest.pl index 243798616052..5b64f7522c09 100644 --- a/sc/source/ui/vba/testvba/launchTest.pl +++ b/sc/source/ui/vba/testvba/launchTest.pl @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -31,14 +31,14 @@ my $test_class = shift || die 'must provide a ext name'; my $TESTDOCUMENT = shift || die 'must provide a path to testdocument dirs'; my $OUTPUTDIR = shift || die 'must provide an output path to deposit logs in'; -die "can't access TestClass $test_class/TestVBA.class" unless -f "$test_class/TestVBA.class"; -die "can't access officepath env variable \$OFFICEPATH" unless -d $ENV{OFFICEPATH}; -die "can't access testdocuments" unless -d $TESTDOCUMENT; -die "testdocument not of the correct structure $TESTDOCUMENT/logs/excel" unless -d "$TESTDOCUMENT/logs/excel"; -die "can't access output dir" unless -d $OUTPUTDIR; +die "can't access TestClass $test_class/TestVBA.class" unless -f "$test_class/TestVBA.class"; +die "can't access officepath env variable \$OFFICEPATH" unless -d $ENV{OFFICEPATH}; +die "can't access testdocuments" unless -d $TESTDOCUMENT; +die "testdocument not of the correct structure $TESTDOCUMENT/logs/excel" unless -d "$TESTDOCUMENT/logs/excel"; +die "can't access output dir" unless -d $OUTPUTDIR; -my $officeclasspath = "$ENV{OFFICEPATH}/program/classes/"; +my $officeclasspath = "$ENV{OFFICEPATH}/program/classes/"; my $classpath = "$officeclasspath/jurt.jar:$officeclasspath/unoil.jar:$officeclasspath/juh.jar:$officeclasspath/java_uno.jar:$officeclasspath/ridl.jar:$test_class:$ENV{CLASSPATH}"; $ENV{CLASSPATH}=$classpath; print "classpath $ENV{CLASSPATH}\n"; diff --git a/sc/source/ui/vba/testvba/runTests.pl b/sc/source/ui/vba/testvba/runTests.pl index e686a1d4cb89..70f80329cfeb 100755 --- a/sc/source/ui/vba/testvba/runTests.pl +++ b/sc/source/ui/vba/testvba/runTests.pl @@ -51,7 +51,7 @@ $failed = ( $exit_value || $signal_num || $dumped_core ); print "$failed = ( $exit_value || $signal_num || $dumped_core )\n"; if ( !$failed && open(UNAME, "uname -a|") ) { - $theResult = <UNAME>; + $theResult = <UNAME>; close(UNAME); if ( $theResult =~ /^CYGWIN/ ) { # windows under cygwin @@ -62,7 +62,7 @@ if ( !$failed && open(UNAME, "uname -a|") ) { uri_escape($testDocDir); # hacky windows url construction $testDocDir="file:///$testDocDir"; - + chomp($testDocDir); #print "*** doc dir is $testDocDir\n"; $testLogDir = `cygpath -m "$testLogDir"`; diff --git a/sc/source/ui/vba/testvba/testResult.pl b/sc/source/ui/vba/testvba/testResult.pl index 5f065924d5c4..171be2597ddb 100644 --- a/sc/source/ui/vba/testvba/testResult.pl +++ b/sc/source/ui/vba/testvba/testResult.pl @@ -11,13 +11,13 @@ my $timestampclean= "perl $binDir/timestampsClean.pl"; sub testLog { # 2 No Log to compare against - # 1 Log passed + # 1 Log passed # 0 Log failed my $result = 0; my $testfile = shift; my $dirtocheck = shift; my $filename = basename($testfile); - $filename = "$logdir/$filename"; + $filename = "$logdir/$filename"; print "processing $testfile $filename\n"; if ( -f $filename ) { my $tmpFile; @@ -29,9 +29,9 @@ sub testLog my $info = stat($tmpFile) or die "no $tmpFile: $!"; if ( ($status >>=8) == 0 && ( $info->size == 0) ) { #print "diff worked size is 0\n"; - $result = 1; + $result = 1; } - elsif ( ($status >>=8) == 0 && ( $info->size > 0) ) + elsif ( ($status >>=8) == 0 && ( $info->size > 0) ) { #print "diff worked size > 0\n"; $result = 0; @@ -106,9 +106,9 @@ sub slurp_dir($) while ($fname = readdir ($dirhandle)) { $fname = filter_crud($fname); defined $fname || next; -# if (-d "$dir/$fname") { -# push @files, slurp_dir("$dir/$fname"); -# } else +# if (-d "$dir/$fname") { +# push @files, slurp_dir("$dir/$fname"); +# } else { push @files, "$dir/$fname"; } @@ -136,9 +136,9 @@ print "$testfilepath\n"; for $a (@files) { $filename = $a; if ( "$testfilepath" eq "$filename" ) - { + { $processed++; - my $testcase = $a; + my $testcase = $a; $testcase =~ s/\.log/\.xls/; my $result = testLog( $a, $logdir ); if ( $result == 0 ) { @@ -148,13 +148,13 @@ for $a (@files) { elsif ( $result == 2 ) { #print "skipped $a\n"; push @skippedTests, $testcase; - } + } else { $passed++; push @passedTests, $testcase; - #print "Test document for $a \t \t passed. \n"; - } + #print "Test document for $a \t \t passed. \n"; } + } } my $compared=@passedTests+@failedTests; my $skip = @skippedTests; @@ -163,7 +163,7 @@ 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"; } diff --git a/sc/source/ui/vba/testvba/testResults.pl b/sc/source/ui/vba/testvba/testResults.pl index 39ec26ba38be..6f731327e76b 100755 --- a/sc/source/ui/vba/testvba/testResults.pl +++ b/sc/source/ui/vba/testvba/testResults.pl @@ -11,13 +11,13 @@ my $timestampclean= "perl $binDir/timestampsClean.pl"; sub testLog { # 2 No Log to compare against - # 1 Log passed + # 1 Log passed # 0 Log failed my $result = 0; my $testfile = shift; my $dirtocheck = shift; my $filename = basename($testfile); - $filename = "$logdir/$filename"; + $filename = "$logdir/$filename"; print "processing $testfile $filename\n"; if ( -f $filename ) { my $tmpFile; @@ -29,9 +29,9 @@ sub testLog my $info = stat($tmpFile) or die "no $tmpFile: $!"; if ( ($status >>=8) == 0 && ( $info->size == 0) ) { #print "diff worked size is 0\n"; - $result = 1; + $result = 1; } - elsif ( ($status >>=8) == 0 && ( $info->size > 0) ) + elsif ( ($status >>=8) == 0 && ( $info->size > 0) ) { #print "diff worked size > 0\n"; $result = 0; @@ -106,9 +106,9 @@ sub slurp_dir($) while ($fname = readdir ($dirhandle)) { $fname = filter_crud($fname); defined $fname || next; -# if (-d "$dir/$fname") { -# push @files, slurp_dir("$dir/$fname"); -# } else +# if (-d "$dir/$fname") { +# push @files, slurp_dir("$dir/$fname"); +# } else { push @files, "$dir/$fname"; } @@ -131,7 +131,7 @@ my @failedTests=(); my $failureCmd=""; for $a (@files) { $processed++; - my $testcase = $a; + my $testcase = $a; $testcase =~ s/\.log/\.xls/; my $result = testLog( $a, $logdir ); if ( $result == 0 ) { @@ -141,12 +141,12 @@ for $a (@files) { elsif ( $result == 2 ) { #print "skipped $a\n"; push @skippedTests, $testcase; - } + } else { $passed++; push @passedTests, $testcase; - #print "Test document for $a \t \t passed. \n"; - } + #print "Test document for $a \t \t passed. \n"; + } } my $compared=@passedTests+@failedTests; my $skip = @skippedTests; @@ -155,7 +155,7 @@ 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"; } diff --git a/sc/source/ui/vba/testvba/testvba.cxx b/sc/source/ui/vba/testvba/testvba.cxx index 686b3e47eaa9..990a37aead3f 100644 --- a/sc/source/ui/vba/testvba/testvba.cxx +++ b/sc/source/ui/vba/testvba/testvba.cxx @@ -44,7 +44,7 @@ using ::rtl::OUString; using ::std::auto_ptr; -const OUString EXTN = rtl::OUString::createFromAscii(".xls"); +const OUString EXTN = rtl::OUString::createFromAscii(".xls"); OUString convertToURL( const OUString& rPath ) { @@ -91,16 +91,16 @@ private: 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 ) ) + 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 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 ); @@ -108,7 +108,7 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) 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 ) + 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() ); @@ -120,17 +120,17 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) return sLogLocation; } - void init() + void init() { // blow away previous logs? } - void proccessDocument( const rtl::OUString& sUrl ) + void proccessDocument( const rtl::OUString& sUrl ) { - if ( !mxSFA->isFolder( sUrl ) && sUrl.endsWithIgnoreAsciiCaseAsciiL( ".xls", 4 ) ) - + if ( !mxSFA->isFolder( sUrl ) && sUrl.endsWithIgnoreAsciiCaseAsciiL( ".xls", 4 ) ) + { - try + try { OSL_TRACE( "processing %s", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() ); printf( "processing %s\n", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -141,17 +141,17 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) rtl::OUString sfileUrl = convertToURL( sUrl ); printf( "try to get xDoc %s\n", rtl::OUStringToOString( sfileUrl, RTL_TEXTENCODING_UTF8 ).getStr() ); - Reference< uno::XInterface > xDoc = + 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 ) ) + 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"); @@ -175,9 +175,9 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) Sequence< uno::Any > aArgs; Sequence< sal_Int16 > aOutArgsIndex; Sequence< uno::Any > aOutArgs; - - xScript->invoke(aArgs, aOutArgsIndex, 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 @@ -195,7 +195,7 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) OSL_TRACE("new logfile location is %s ", rtl::OUStringToOString( newLocation, RTL_TEXTENCODING_UTF8 ).getStr() ); printf("moved to new location\n"); } - + } catch ( uno::Exception& e ) { @@ -204,8 +204,8 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) // interface is supported, otherwise use XComponent.dispose Reference< util::XCloseable > xCloseable ( xDoc, uno::UNO_QUERY ); - - if ( xCloseable.is() ) + + if ( xCloseable.is() ) { printf("try to close\n"); // will close application. and only run a test case for 3.0 @@ -215,8 +215,8 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) // so, for run all test cases, it should not close the document at this moment. xCloseable->close(sal_False); printf("closed\n"); - } - else + } + else { printf("try to dispose\n"); Reference< XComponent > xComp( xDoc, uno::UNO_QUERY_THROW ); @@ -225,32 +225,32 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) printf("disposed\n"); } } - catch( uno::Exception& e ) + 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 ) + void traverse( const rtl::OUString& sFileDirectory ) { - rtl::OUString sFileDirectoryURL = convertToURL( sFileDirectory ); - if ( !mxSFA->isFolder( sFileDirectoryURL) ) + 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 ) + for ( sal_Int32 i = 0; i < entries.getLength(); ++i ) { proccessDocument( entries[ i ] ); } - } + } }; void tryDispose( Reference< uno::XInterface > xIF, const char* sComp ) @@ -261,7 +261,7 @@ void tryDispose( Reference< uno::XInterface > xIF, const char* sComp ) 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; @@ -297,8 +297,8 @@ int main( int argv, char** argc ) dTest->traverse( ascii( argc[ 1 ] ) ); } delete dTest; -// tryDispose( xLoader, "desktop" ); -// tryDispose( xCC, "remote context" ); +// tryDispose( xLoader, "desktop" ); +// tryDispose( xCC, "remote context" ); } catch( uno::Exception& e ) diff --git a/sc/source/ui/vba/testvba/timestampsClean.pl b/sc/source/ui/vba/testvba/timestampsClean.pl index dade65c7200f..2c947d0cc6d5 100755 --- a/sc/source/ui/vba/testvba/timestampsClean.pl +++ b/sc/source/ui/vba/testvba/timestampsClean.pl @@ -65,7 +65,7 @@ while (<>) { output_lines(\@lines); # $detectedSomeGuff contains the skipped hunks that contain acceptable diff -# e.g. a timestamp or an OK assertion that contains different content +# e.g. a timestamp or an OK assertion that contains different content # like perhaps a path #print "frag_count = $frag_count fragstocount = $fragstocount detectedSomeGuff = $detectedSomeGuff \n"; if ($frag_count > $detectedSomeGuff) { diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 8f5aba5c4acb..624fb610dfd7 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #include <stdio.h> #include <com/sun/star/sheet/XSpreadsheetView.hpp> @@ -88,18 +88,12 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -// Enable our own join detection for Intersection and Union -// should be more efficient than using ScRangeList::Join ( because -// we already are testing the same things ) - -#define OWN_JOIN 1 - // #TODO is this defined somewhere else? #if ( defined UNX ) || ( defined OS2 ) //unix #define FILE_PATH_SEPERATOR "/" #else // windows #define FILE_PATH_SEPERATOR "\\" -#endif +#endif uno::Any sbxToUnoValue( SbxVariable* pVar ); @@ -107,8 +101,8 @@ class ActiveWorkbook : public ScVbaWorkbook { protected: virtual uno::Reference< frame::XModel > getModel() - { - return getCurrentExcelDoc(mxContext); + { + return getCurrentExcelDoc(mxContext); } public: ActiveWorkbook( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext) : ScVbaWorkbook( xParent, xContext ){} @@ -125,7 +119,7 @@ ScVbaApplication::ScVbaApplication( const uno::Reference<uno::XComponentContext ScVbaApplication::~ScVbaApplication() { } - + SfxObjectShell* ScVbaApplication::GetDocShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { return static_cast< SfxObjectShell* >( excel::getDocShell( xModel ) ); @@ -205,16 +199,16 @@ ScVbaApplication::getActiveWorkbook() throw (uno::RuntimeException) xWrkbk.set( getUnoDocModule( aName, pShell ), uno::UNO_QUERY ); // fallback ( e.g. it's possible a new document was created via the api ) // in that case the document will not have the appropriate Document Modules - // #TODO #FIXME ( needs to be fixes as part of providing support for an overall document + // #TODO #FIXME ( needs to be fixes as part of providing support for an overall document // vba mode etc. ) if ( !xWrkbk.is() ) return new ActiveWorkbook( this, mxContext ); } } - return xWrkbk; + return xWrkbk; } -uno::Reference< excel::XWorkbook > SAL_CALL +uno::Reference< excel::XWorkbook > SAL_CALL ScVbaApplication::getThisWorkbook() throw (uno::RuntimeException) { uno::Reference< excel::XWorkbook > xWrkbk; @@ -228,7 +222,7 @@ ScVbaApplication::getThisWorkbook() throw (uno::RuntimeException) xWrkbk.set( getUnoDocModule( aName, pShell ), uno::UNO_QUERY ); // fallback ( e.g. it's possible a new document was created via the api ) // in that case the document will not have the appropriate Document Modules - // #TODO #FIXME ( needs to be fixes as part of providing support for an overall document + // #TODO #FIXME ( needs to be fixes as part of providing support for an overall document // vba mode etc. ) if ( !xWrkbk.is() ) return new ActiveWorkbook( this, mxContext ); @@ -302,7 +296,8 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException ) sal_Int32 nCursorX = pTabView->GetCurX(); sal_Int32 nCursorY = pTabView->GetCurY(); - return new ScVbaRange( this, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) ); + uno::Reference< XHelperInterface > xParent( excel::getUnoSheetModuleObj( xRange ), uno::UNO_QUERY_THROW ); + return new ScVbaRange( xParent, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) ); } uno::Any SAL_CALL @@ -340,17 +335,17 @@ ScVbaApplication::WorksheetFunction( ) throw (::com::sun::star::uno::RuntimeExce return uno::makeAny( uno::Reference< script::XInvocation >( new ScVbaWSFunction( this, mxContext ) ) ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaApplication::Evaluate( const ::rtl::OUString& Name ) throw (uno::RuntimeException) { // #TODO Evaluate allows other things to be evaluated, e.g. functions // I think ( like SIN(3) etc. ) need to investigate that // named Ranges also? e.g. [MyRange] if so need a list of named ranges uno::Any aVoid; - return uno::Any( getActiveWorkbook()->getActiveSheet()->Range( uno::Any( Name ), aVoid ) ); + return uno::Any( getActiveWorkbook()->getActiveSheet()->Range( uno::Any( Name ), aVoid ) ); } -uno::Any +uno::Any ScVbaApplication::Dialogs( const uno::Any &aIndex ) throw (uno::RuntimeException) { uno::Reference< excel::XDialogs > xDialogs( new ScVbaDialogs( uno::Reference< XHelperInterface >( this ), mxContext, getCurrentDocument() ) ); @@ -359,7 +354,7 @@ ScVbaApplication::Dialogs( const uno::Any &aIndex ) throw (uno::RuntimeException return uno::Any( xDialogs->Item( aIndex ) ); } -uno::Reference< excel::XWindow > SAL_CALL +uno::Reference< excel::XWindow > SAL_CALL ScVbaApplication::getActiveWindow() throw (uno::RuntimeException) { // #FIXME sofar can't determine Parent @@ -369,7 +364,7 @@ ScVbaApplication::getActiveWindow() throw (uno::RuntimeException) return xWin; } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaApplication::getCutCopyMode() throw (uno::RuntimeException) { //# FIXME TODO, implementation @@ -378,7 +373,7 @@ ScVbaApplication::getCutCopyMode() throw (uno::RuntimeException) return result; } -void SAL_CALL +void SAL_CALL ScVbaApplication::setCutCopyMode( const uno::Any& /*_cutcopymode*/ ) throw (uno::RuntimeException) { //# FIXME TODO, implementation @@ -390,7 +385,7 @@ ScVbaApplication::getStatusBar() throw (uno::RuntimeException) return uno::makeAny( !getDisplayStatusBar() ); } -void SAL_CALL +void SAL_CALL ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) throw (uno::RuntimeException) { rtl::OUString sText; @@ -427,7 +422,7 @@ ScVbaApplication::getCalculation() throw (uno::RuntimeException) return excel::XlCalculation::xlCalculationManual; } -void SAL_CALL +void SAL_CALL ScVbaApplication::setCalculation( ::sal_Int32 _calculation ) throw (uno::RuntimeException) { uno::Reference< sheet::XCalculatable > xCalc(getCurrentDocument(), uno::UNO_QUERY_THROW); @@ -443,15 +438,15 @@ ScVbaApplication::setCalculation( ::sal_Int32 _calculation ) throw (uno::Runtime } } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaApplication::Windows( const uno::Any& aIndex ) throw (uno::RuntimeException) { uno::Reference< excel::XWindows > xWindows( new ScVbaWindows( this, mxContext ) ); if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID ) return uno::Any( xWindows ); - return uno::Any( xWindows->Item( aIndex, uno::Any() ) ); + return uno::Any( xWindows->Item( aIndex, uno::Any() ) ); } -void SAL_CALL +void SAL_CALL ScVbaApplication::wait( double time ) throw (uno::RuntimeException) { StarBASIC* pBasic = SFX_APP()->GetBasic(); @@ -461,7 +456,7 @@ ScVbaApplication::wait( double time ) throw (uno::RuntimeException) aRef->PutDouble( time ); aArgs->Put( aRef, 1 ); SbMethod* pMeth = (SbMethod*)pBasic->GetRtl()->Find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WaitUntil") ), SbxCLASS_METHOD ); - + if ( pMeth ) { pMeth->SetParameters( aArgs ); @@ -473,11 +468,11 @@ ScVbaApplication::wait( double time ) throw (uno::RuntimeException) } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaApplication::Range( const uno::Any& Cell1, const uno::Any& Cell2 ) throw (uno::RuntimeException) { - uno::Reference< excel::XRange > xVbRange = ScVbaRange::ApplicationRange( mxContext, Cell1, Cell2 ); - return uno::makeAny( xVbRange ); + uno::Reference< excel::XRange > xVbRange = ScVbaRange::ApplicationRange( mxContext, Cell1, Cell2 ); + return uno::makeAny( xVbRange ); } uno::Any SAL_CALL @@ -495,19 +490,19 @@ ScVbaApplication::Names( const css::uno::Any& aIndex ) throw ( uno::RuntimeExcep } -uno::Reference< excel::XWorksheet > SAL_CALL +uno::Reference< excel::XWorksheet > SAL_CALL ScVbaApplication::getActiveSheet() throw (uno::RuntimeException) { uno::Reference< excel::XWorksheet > result; uno::Reference< excel::XWorkbook > xWorkbook( getActiveWorkbook(), uno::UNO_QUERY ); if ( xWorkbook.is() ) { - uno::Reference< excel::XWorksheet > xWorksheet( + uno::Reference< excel::XWorksheet > xWorksheet( xWorkbook->getActiveSheet(), uno::UNO_QUERY ); if ( xWorksheet.is() ) { result = xWorksheet; - } + } } if ( !result.is() ) @@ -517,26 +512,26 @@ ScVbaApplication::getActiveSheet() throw (uno::RuntimeException) "No activeSheet available" ), uno::Reference< uno::XInterface >() ); } return result; - + } /******************************************************************************* - * In msdn: - * Reference Optional Variant. The destination. Can be a Range + * In msdn: + * Reference Optional Variant. The destination. Can be a Range * object, a string that contains a cell reference in R1C1-style notation, * or a string that contains a Visual Basic procedure name. - * Scroll Optional Variant. True to scrol, False to not scroll through + * Scroll Optional Variant. True to scrol, False to not scroll through * the window. The default is False. * Parser is split to three parts, Range, R1C1 string and procedure name. - * by test excel, it seems Scroll no effect. ??? + * by test excel, it seems Scroll no effect. ??? *******************************************************************************/ -void SAL_CALL +void SAL_CALL ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) throw (uno::RuntimeException) { //test Scroll is a boolean sal_Bool bScroll = sal_False; //R1C1-style string or a string of procedure name. - + if( Scroll.hasValue() ) { sal_Bool aScroll = sal_False; @@ -558,7 +553,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro uno::Reference< sheet::XSpreadsheet > xDoc = xSpreadsheet->getActiveSheet(); ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext ); - ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow(); + ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow(); try { uno::Reference< excel::XRange > xVbaSheetRange = ScVbaRange::getRangeObjectForName( @@ -571,9 +566,9 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro ScSplitPos eWhich = pShell->GetViewData()->GetActivePart(); sal_Int32 nValueX = pShell->GetViewData()->GetPosX(WhichH(eWhich)); sal_Int32 nValueY = pShell->GetViewData()->GetPosY(WhichV(eWhich)); - xWindow->SmallScroll( uno::makeAny( (sal_Int16)(xVbaSheetRange->getRow() - 1) ), + xWindow->SmallScroll( uno::makeAny( (sal_Int16)(xVbaSheetRange->getRow() - 1) ), uno::makeAny( (sal_Int16)nValueY ), - uno::makeAny( (sal_Int16)(xVbaSheetRange->getColumn() - 1) ), + uno::makeAny( (sal_Int16)(xVbaSheetRange->getColumn() - 1) ), uno::makeAny( (sal_Int16)nValueX ) ); gridWindow->GrabFocus(); } @@ -601,7 +596,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro { uno::Reference< excel::XRange > xVbaRange( Reference, uno::UNO_QUERY ); ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext ); - ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow(); + ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow(); if ( xVbaRange.is() ) { //TODO bScroll should be using, In this time, it doesenot have effection @@ -612,9 +607,9 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro ScSplitPos eWhich = pShell->GetViewData()->GetActivePart(); sal_Int32 nValueX = pShell->GetViewData()->GetPosX(WhichH(eWhich)); sal_Int32 nValueY = pShell->GetViewData()->GetPosY(WhichV(eWhich)); - xWindow->SmallScroll( uno::makeAny( (sal_Int16)(xVbaRange->getRow() - 1) ), + xWindow->SmallScroll( uno::makeAny( (sal_Int16)(xVbaRange->getRow() - 1) ), uno::makeAny( (sal_Int16)nValueY ), - uno::makeAny( (sal_Int16)(xVbaRange->getColumn() - 1) ), + uno::makeAny( (sal_Int16)(xVbaRange->getColumn() - 1) ), uno::makeAny( (sal_Int16)nValueX ) ); gridWindow->GrabFocus(); } @@ -650,7 +645,7 @@ ScVbaApplication::getCursor() throw (uno::RuntimeException) } } -void SAL_CALL +void SAL_CALL ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException) { try @@ -679,11 +674,11 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException) break; } default: - throw uno::RuntimeException( rtl::OUString( + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Unknown value for Cursor pointer")), uno::Reference< uno::XInterface >() ); // TODO: isn't this a flaw in the API? It should be allowed to throw an // IllegalArgumentException, or so - } + } } catch( const uno::Exception& ) { @@ -691,7 +686,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException) } } -// #TODO perhaps we should switch the return type depending of the filter +// #TODO perhaps we should switch the return type depending of the filter // type, e.g. return Calc for Calc and Excel if its an imported doc rtl::OUString SAL_CALL ScVbaApplication::getName() throw (uno::RuntimeException) @@ -700,10 +695,10 @@ ScVbaApplication::getName() throw (uno::RuntimeException) return appName; } -// #TODO #FIXME get/setDisplayAlerts are just stub impl +// #TODO #FIXME get/setDisplayAlerts are just stub impl // here just the status of the switch is set -// the function that throws an error message needs to -// evaluate this switch in order to know whether it has to disable the +// the function that throws an error message needs to +// evaluate this switch in order to know whether it has to disable the // error message thrown by OpenOffice void SAL_CALL @@ -760,16 +755,16 @@ rtl::OUString ScVbaApplication::getOfficePath( const rtl::OUString& _sPathType ) // if its a list of paths then use the last one sal_Int32 nIndex = sUrl.lastIndexOf( ';' ) ; if ( nIndex > 0 ) - sUrl = sUrl.copy( nIndex + 1 ); + sUrl = sUrl.copy( nIndex + 1 ); ::osl::File::getSystemPathFromFileURL( sUrl, sRetPath ); } catch (uno::Exception&) { - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); - } + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + } return sRetPath; } -void SAL_CALL +void SAL_CALL ScVbaApplication::setDefaultFilePath( const ::rtl::OUString& DefaultFilePath ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getPathSettingsService( mxContext ); @@ -777,440 +772,317 @@ ScVbaApplication::setDefaultFilePath( const ::rtl::OUString& DefaultFilePath ) t osl::FileBase::getFileURLFromSystemPath( DefaultFilePath, aURL ); xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Work")), uno::makeAny( aURL ) ); - + } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaApplication::getDefaultFilePath( ) throw (script::BasicErrorException, uno::RuntimeException) { return getOfficePath( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Work"))); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaApplication::LibraryPath( ) throw (script::BasicErrorException, uno::RuntimeException) { return getOfficePath( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Basic"))); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaApplication::TemplatesPath( ) throw (script::BasicErrorException, uno::RuntimeException) { return getOfficePath( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Template"))); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaApplication::PathSeparator( ) throw (script::BasicErrorException, uno::RuntimeException) { static rtl::OUString sPathSep( RTL_CONSTASCII_USTRINGPARAM( FILE_PATH_SEPERATOR ) ); return sPathSep; } -typedef std::list< ScRange > Ranges; -typedef std::list< ScRangeList > RangesList; +// ---------------------------------------------------------------------------- +// Helpers for Intersect and Union + +namespace { -void lcl_addRangesToVec( RangesList& vRanges, const uno::Any& aArg ) throw ( script::BasicErrorException, uno::RuntimeException ) +typedef ::std::list< ScRange > ListOfScRange; + +/** Appends all ranges of a VBA Range object in the passed Any to the list of ranges. */ +void lclAddToListOfScRange( ListOfScRange& rList, const uno::Any& rArg ) + throw (script::BasicErrorException, uno::RuntimeException) { - ScRangeList theRanges; - uno::Reference< excel::XRange > xRange( aArg, uno::UNO_QUERY_THROW ); - uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW ); - sal_Int32 nCount = xCol->getCount(); - for( sal_Int32 i = 1; i <= nCount; ++i ) + if( rArg.hasValue() ) { - uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::makeAny( sal_Int32(i) ), uno::Any() ), uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW ); - table::CellRangeAddress addr = xAddressable->getRangeAddress(); - ScRange refRange; - ScUnoConversion::FillScRange( refRange, addr ); - theRanges.Append( refRange ); + uno::Reference< excel::XRange > xRange( rArg, uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW ); + for( sal_Int32 nIdx = 1, nCount = xCol->getCount(); nIdx <= nCount; ++nIdx ) + { + uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::Any( nIdx ), uno::Any() ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW ); + ScRange aScRange; + ScUnoConversion::FillScRange( aScRange, xAddressable->getRangeAddress() ); + rList.push_back( aScRange ); + } } - vRanges.push_back( theRanges ); } -void lcl_addRangeToVec( Ranges& vRanges, const uno::Any& aArg ) throw ( script::BasicErrorException, uno::RuntimeException ) +/** Returns true, if the passed ranges can be expressed by a single range. The + new range will be contained in r1 then, the range r2 can be removed. */ +bool lclTryJoin( ScRange& r1, const ScRange& r2 ) { - uno::Reference< excel::XRange > xRange( aArg, uno::UNO_QUERY_THROW ); - uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW ); - sal_Int32 nCount = xCol->getCount(); - for( sal_Int32 i = 1; i <= nCount; ++i ) + // 1) r2 is completely inside r1 + if( r1.In( r2 ) ) + return true; + + // 2) r1 is completely inside r2 + if( r2.In( r1 ) ) { - uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::makeAny( sal_Int32(i) ), uno::Any() ), uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW ); - table::CellRangeAddress addr = xAddressable->getRangeAddress(); - ScRange refRange; - ScUnoConversion::FillScRange( refRange, addr ); - vRanges.push_back( refRange ); + r1 = r2; + return true; } -} -bool lcl_canJoin( ScRange& r1, ScRange& r2 ) -{ - bool bCanJoin = false; - SCCOL startEndColDiff = r2.aStart.Col() - r1.aEnd.Col(); - SCROW startEndRowDiff = r2.aStart.Row() - r1.aEnd.Row(); - SCCOL startColDiff = r2.aStart.Col() - r1.aStart.Col(); - SCCOL endColDiff = r2.aEnd.Col() - r1.aEnd.Col(); - SCROW startRowDiff = r2.aStart.Row() - r1.aStart.Row(); - SCROW endRowDiff = r2.aEnd.Row() - r1.aEnd.Row(); - if ( ( startRowDiff == endRowDiff ) && startRowDiff == 0 && startColDiff >=0 && endColDiff > 0 && ( startEndColDiff <= 1 && startEndColDiff >= -r1.aEnd.Col() ) ) - bCanJoin = true; - else if ( ( startColDiff == endColDiff ) && startColDiff == 0 && startRowDiff >= 0 && endRowDiff > 0 && ( startEndRowDiff <= 1 && startEndRowDiff >= -r1.aEnd.Row() ) ) - bCanJoin = true; -#ifdef DEBUG - String sr1; - String sr2; - r1.Format( sr1, SCA_VALID ) ; - r2.Format( sr2, SCA_VALID ) ; - OSL_TRACE(" canJoin address %s with %s %s ( startRowDiff(%d), endRowDiff(%d), startColDiff(%d) endColDiff(%d) startEndRowDiff(%d), startEndColDiff(%d) ", - rtl::OUStringToOString( sr1, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( sr2, RTL_TEXTENCODING_UTF8 ).getStr(), bCanJoin ? "true" : "false", startRowDiff, endRowDiff, startColDiff, endColDiff, startEndRowDiff, startEndColDiff ); -#endif - return bCanJoin; -} -// strips out ranges that contain other ranges, also -// if the borders of the intersecting ranges are alligned -// then the the range is extended to the larger -// e.g. Range("A4:D10"), Range("B4:E10") would be combined -// to Range("A4:E10") -void lcl_strip_containedRanges( Ranges& vRanges ) -{ - // get rid of ranges that are surrounded by other ranges - Ranges::iterator it_outer = vRanges.begin(); - while( it_outer != vRanges.end() ) + SCCOL n1L = r1.aStart.Col(); + SCCOL n1R = r1.aEnd.Col(); + SCROW n1T = r1.aStart.Row(); + SCROW n1B = r1.aEnd.Row(); + SCCOL n2L = r2.aStart.Col(); + SCCOL n2R = r2.aEnd.Col(); + SCROW n2T = r2.aStart.Row(); + SCROW n2B = r2.aEnd.Row(); + + // 3) r1 and r2 have equal upper and lower border + if( (n1T == n2T) && (n1B == n2B) ) { - bool it_outer_erased = false; // true = it_outer erased from vRanges - Ranges::iterator it_inner = vRanges.begin(); - /* Exit the inner loop if outer iterator has been erased in its last - iteration (this means it has been joined to last it_inner, or that - the it_inner contains it completely). The inner loop will restart - with next element of the outer loop, and all elements (from the - beginning of the list) will be checked against that new element. */ - while( !it_outer_erased && (it_inner != vRanges.end()) ) + // check that r1 overlaps or touches r2 + if( ((n1L < n2L) && (n2L - 1 <= n1R)) || ((n2L < n1L) && (n1L - 1 <= n2R)) ) { - bool it_inner_erased = false; // true = it_inner erased from vRanges - if ( it_outer != it_inner ) - { -#ifdef DEBUG - String r1; - String r2; - it_outer->Format( r1, SCA_VALID ) ; - it_inner->Format( r2, SCA_VALID ) ; - OSL_TRACE( "try strip/join address %s with %s ", - rtl::OUStringToOString( r1, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( r2, RTL_TEXTENCODING_UTF8 ).getStr() ); -#endif - if ( it_outer->In( *it_inner ) ) - { - it_inner = vRanges.erase( it_inner ); - it_inner_erased = true; - } - else if ( it_inner->In( *it_outer ) ) - { - it_outer = vRanges.erase( it_outer ); - it_outer_erased = true; - } -#ifndef OWN_JOIN - else if ( (*it_inner).aStart.Row() == (*it_outer).aStart.Row() - && (*it_inner).aEnd.Row() == (*it_outer).aEnd.Row() ) - { - it_outer->ExtendTo( *it_inner ); - it_inner = vRanges.erase( it_inner ); - it_inner_erased = true; - } -#else - else if ( lcl_canJoin( *it_outer, *it_inner ) ) - { - it_outer->ExtendTo( *it_inner ); - it_inner = vRanges.erase( it_inner ); - it_inner_erased = true; - } - else if ( lcl_canJoin( *it_inner, *it_outer) ) - { - it_inner->ExtendTo( *it_outer ); - it_outer = vRanges.erase( it_outer ); - it_outer_erased = true; - } -#endif - } - /* If it_inner has not been erased from vRanges, continue inner - loop with next element. Otherwise, it_inner already points to - the next element (return value of list::erase()). */ - if( !it_inner_erased ) - ++it_inner; + r1.aStart.SetCol( ::std::min( n1L, n2L ) ); + r1.aEnd.SetCol( ::std::max( n1R, n2R ) ); + return true; + } + return false; + } + + // 4) r1 and r2 have equal left and right border + if( (n1L == n2L) && (n1R == n2R) ) + { + // check that r1 overlaps or touches r2 + if( ((n1T < n2T) && (n2T + 1 <= n1B)) || ((n2T < n1T) && (n1T + 1 <= n2B)) ) + { + r1.aStart.SetRow( ::std::min( n1T, n2T ) ); + r1.aEnd.SetRow( ::std::max( n1B, n2B ) ); + return true; } - /* If it_outer has not been erased from vRanges, continue outer loop - with next element. Otherwise, it_outer already points to the next - element (return value of list::erase()). */ - if( !it_outer_erased ) - ++it_outer; + return false; } + // 5) cannot join these ranges + return false; } -Ranges -lcl_intersectionImpl( ScRangeList& rl1, ScRangeList& rl2 ) +/** Strips out ranges that are contained by other ranges, joins ranges that can be joined + together (aligned borders, e.g. A4:D10 and B4:E10 would be combined to A4:E10. */ +void lclJoinRanges( ListOfScRange& rList ) { - Ranges intersections; - for ( USHORT x = 0 ; x < rl1.Count(); ++x ) + ListOfScRange::iterator aOuterIt = rList.begin(); + while( aOuterIt != rList.end() ) { - for ( USHORT y = 0 ; y < rl2.Count(); ++y ) + bool bAnyErased = false; // true = any range erased from rList + ListOfScRange::iterator aInnerIt = rList.begin(); + while( aInnerIt != rList.end() ) { -#ifdef DEBUG - String r1; - String r2; - rl1.GetObject( x )->Format( r1, SCA_VALID ) ; - rl2.GetObject( y )->Format( r2, SCA_VALID ) ; - OSL_TRACE( "comparing address %s with %s ", - rtl::OUStringToOString( r1, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( r2, RTL_TEXTENCODING_UTF8 ).getStr() ); -#endif - if( rl1.GetObject( x )->Intersects( *rl2.GetObject( y ) ) ) + bool bInnerErased = false; // true = aInnerIt erased from rList + // do not compare a range with itself + if( (aOuterIt != aInnerIt) && lclTryJoin( *aOuterIt, *aInnerIt ) ) { - ScRange aIntersection = ScRange( Max( rl1.GetObject( x )->aStart.Col(), rl2.GetObject( y )->aStart.Col() ), - Max( rl1.GetObject( x )->aStart.Row(), rl2.GetObject( y )->aStart.Row() ), - Max( rl1.GetObject( x )->aStart.Tab(), rl2.GetObject( y )->aStart.Tab() ), - Min( rl1.GetObject( x )->aEnd.Col(), rl2.GetObject( y )->aEnd.Col() ), - Min( rl1.GetObject( x )->aEnd.Row(), rl2.GetObject( y )->aEnd.Row() ), - Min( rl1.GetObject( x )->aEnd.Tab(), rl2.GetObject( y )->aEnd.Tab() ) ); - intersections.push_back( aIntersection ); + // aOuterIt points to joined range, aInnerIt will be removed + aInnerIt = rList.erase( aInnerIt ); + bInnerErased = bAnyErased = true; } + /* If aInnerIt has been erased from rList, it already points to + the next element (return value of list::erase()). */ + if( !bInnerErased ) + ++aInnerIt; } + // if any range has been erased, repeat outer loop with the same range + if( !bAnyErased ) + ++aOuterIt; } - lcl_strip_containedRanges( intersections ); - return intersections; } -// Intersection of a set of ranges ( where each range is represented by a ScRangeList e.g. -// any range can be a multi-area range ) -// An intersection is performed between each range in the set of ranges. -// The resulting set of intersections is then processed to strip out any -// intersections that contain other intersections ( and also ranges that directly line up -// are joined ) ( see lcl_strip_containedRanges ) -RangesList lcl_intersections( RangesList& vRanges ) +/** Intersects the passed list with all ranges of a VBA Range object in the passed Any. */ +void lclIntersectRanges( ListOfScRange& rList, const uno::Any& rArg ) + throw (script::BasicErrorException, uno::RuntimeException) { - RangesList intersections; - RangesList::iterator it = vRanges.begin(); - while( it != vRanges.end() ) + // extract the ranges from the passed argument, will throw on invalid data + ListOfScRange aList2; + lclAddToListOfScRange( aList2, rArg ); + // do nothing, if the passed list is already empty + if( !rList.empty() && !aList2.empty() ) { - Ranges intermediateList; - for( RangesList::iterator it_inner = vRanges.begin(); it_inner != vRanges.end(); ++it_inner ) + // save original list in a local + ListOfScRange aList1; + aList1.swap( rList ); + // join ranges from passed argument + lclJoinRanges( aList2 ); + // calculate intersection of the ranges in both lists + for( ListOfScRange::const_iterator aOuterIt = aList1.begin(), aOuterEnd = aList1.end(); aOuterIt != aOuterEnd; ++aOuterIt ) { - if ( it != it_inner ) + for( ListOfScRange::const_iterator aInnerIt = aList2.begin(), aInnerEnd = aList2.end(); aInnerIt != aInnerEnd; ++aInnerIt ) { - Ranges ranges = lcl_intersectionImpl( *it, *it_inner ); - for ( Ranges::iterator range_it = ranges.begin(); range_it != ranges.end(); ++range_it ) - intermediateList.push_back( *range_it ); + if( aOuterIt->Intersects( *aInnerIt ) ) + { + ScRange aIsectRange( + Max( aOuterIt->aStart.Col(), aInnerIt->aStart.Col() ), + Max( aOuterIt->aStart.Row(), aInnerIt->aStart.Row() ), + Max( aOuterIt->aStart.Tab(), aInnerIt->aStart.Tab() ), + Min( aOuterIt->aEnd.Col(), aInnerIt->aEnd.Col() ), + Min( aOuterIt->aEnd.Row(), aInnerIt->aEnd.Row() ), + Min( aOuterIt->aEnd.Tab(), aInnerIt->aEnd.Tab() ) ); + rList.push_back( aIsectRange ); + } } } - it = vRanges.erase( it ); // remove it so we don't include it in the next pass. - // 'it' is removed uncontidionally from vRanges, so the while loop will terminate - - ScRangeList argIntersect; - lcl_strip_containedRanges( intermediateList ); - - for( Ranges::iterator it_inter = intermediateList.begin(); it_inter != intermediateList.end(); ++it_inter ) -#ifndef OWN_JOIN - argIntersect.Join( *it_inter ); -#else - argIntersect.Append( *it_inter ); -#endif - - intersections.push_back( argIntersect ); + // again, join the result ranges + lclJoinRanges( rList ); } - return intersections; -} - -uno::Reference< excel::XRange > SAL_CALL -ScVbaApplication::Intersect( 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) -{ - if ( !Arg1.is() || !Arg2.is() ) - DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); - - RangesList vRanges; - lcl_addRangesToVec( vRanges, uno::makeAny( Arg1 ) ); - lcl_addRangesToVec( vRanges, uno::makeAny( Arg2 ) ); - - if ( Arg3.hasValue() ) - lcl_addRangesToVec( vRanges, Arg3 ); - if ( Arg4.hasValue() ) - lcl_addRangesToVec( vRanges, Arg4 ); - if ( Arg5.hasValue() ) - lcl_addRangesToVec( vRanges, Arg5 ); - if ( Arg6.hasValue() ) - lcl_addRangesToVec( vRanges, Arg6 ); - if ( Arg7.hasValue() ) - lcl_addRangesToVec( vRanges, Arg7 ); - if ( Arg8.hasValue() ) - lcl_addRangesToVec( vRanges, Arg8 ); - if ( Arg9.hasValue() ) - lcl_addRangesToVec( vRanges, Arg9 ); - if ( Arg10.hasValue() ) - lcl_addRangesToVec( vRanges, Arg10 ); - if ( Arg11.hasValue() ) - lcl_addRangesToVec( vRanges, Arg11 ); - if ( Arg12.hasValue() ) - lcl_addRangesToVec( vRanges, Arg12 ); - if ( Arg13.hasValue() ) - lcl_addRangesToVec( vRanges, Arg13 ); - if ( Arg14.hasValue() ) - lcl_addRangesToVec( vRanges, Arg14 ); - if ( Arg15.hasValue() ) - lcl_addRangesToVec( vRanges, Arg15 ); - if ( Arg16.hasValue() ) - lcl_addRangesToVec( vRanges, Arg16 ); - if ( Arg17.hasValue() ) - lcl_addRangesToVec( vRanges, Arg17 ); - if ( Arg18.hasValue() ) - lcl_addRangesToVec( vRanges, Arg18 ); - if ( Arg19.hasValue() ) - lcl_addRangesToVec( vRanges, Arg19 ); - if ( Arg20.hasValue() ) - lcl_addRangesToVec( vRanges, Arg20 ); - if ( Arg21.hasValue() ) - lcl_addRangesToVec( vRanges, Arg21 ); - if ( Arg22.hasValue() ) - lcl_addRangesToVec( vRanges, Arg22 ); - if ( Arg23.hasValue() ) - lcl_addRangesToVec( vRanges, Arg23 ); - if ( Arg24.hasValue() ) - lcl_addRangesToVec( vRanges, Arg24 ); - if ( Arg25.hasValue() ) - lcl_addRangesToVec( vRanges, Arg25 ); - if ( Arg26.hasValue() ) - lcl_addRangesToVec( vRanges, Arg26 ); - if ( Arg27.hasValue() ) - lcl_addRangesToVec( vRanges, Arg27 ); - if ( Arg28.hasValue() ) - lcl_addRangesToVec( vRanges, Arg28 ); - if ( Arg29.hasValue() ) - lcl_addRangesToVec( vRanges, Arg29 ); - if ( Arg30.hasValue() ) - lcl_addRangesToVec( vRanges, Arg30 ); - - uno::Reference< excel::XRange > xRefRange; - - ScRangeList aCellRanges; - // first pass - gets the set of all possible interections of Arg1..ArgN - RangesList intersections = lcl_intersections( vRanges ); - // second pass - gets the intersections of the intersections ( don't ask, but this - // is what seems to happen ) - if ( intersections.size() > 1) - intersections = lcl_intersections( intersections ); - for( RangesList::iterator it = intersections.begin(); it != intersections.end(); ++it ) - { - for ( USHORT x = 0 ; x < it->Count(); ++x ) -#ifndef OWN_JOIN - aCellRanges.Join( *it->GetObject(x) ); -#else - aCellRanges.Append( *it->GetObject(x) ); -#endif - } - - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - ScDocShell* pDocShell = excel::getDocShell( xModel ); - if ( aCellRanges.Count() == 1 ) - { - uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() )); - xRefRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), mxContext, xRange ); - } - else if ( aCellRanges.Count() > 1 ) - { - uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) ); - xRefRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ) , mxContext, xRanges ); - - } - 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) +/** Creates a VBA Range object from the passed list of ranges. */ +uno::Reference< excel::XRange > lclCreateVbaRange( + const uno::Reference< uno::XComponentContext >& rxContext, + const uno::Reference< frame::XModel >& rxModel, + const ListOfScRange& rList ) throw (uno::RuntimeException) { - if ( !Arg1.is() || !Arg2.is() ) - DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); - - uno::Reference< excel::XRange > xRange; - Ranges vRanges; - lcl_addRangeToVec( vRanges, uno::makeAny( Arg1 ) ); - lcl_addRangeToVec( vRanges, uno::makeAny( Arg2 ) ); - - if ( Arg3.hasValue() ) - lcl_addRangeToVec( vRanges, Arg3 ); - if ( Arg4.hasValue() ) - lcl_addRangeToVec( vRanges, Arg4 ); - if ( Arg5.hasValue() ) - lcl_addRangeToVec( vRanges, Arg5 ); - if ( Arg6.hasValue() ) - lcl_addRangeToVec( vRanges, Arg6 ); - if ( Arg7.hasValue() ) - lcl_addRangeToVec( vRanges, Arg7 ); - if ( Arg8.hasValue() ) - lcl_addRangeToVec( vRanges, Arg8 ); - if ( Arg9.hasValue() ) - lcl_addRangeToVec( vRanges, Arg9 ); - if ( Arg10.hasValue() ) - lcl_addRangeToVec( vRanges, Arg10 ); - if ( Arg11.hasValue() ) - lcl_addRangeToVec( vRanges, Arg11 ); - if ( Arg12.hasValue() ) - lcl_addRangeToVec( vRanges, Arg12 ); - if ( Arg13.hasValue() ) - lcl_addRangeToVec( vRanges, Arg13 ); - if ( Arg14.hasValue() ) - lcl_addRangeToVec( vRanges, Arg14 ); - if ( Arg15.hasValue() ) - lcl_addRangeToVec( vRanges, Arg15 ); - if ( Arg16.hasValue() ) - lcl_addRangeToVec( vRanges, Arg16 ); - if ( Arg17.hasValue() ) - lcl_addRangeToVec( vRanges, Arg17 ); - if ( Arg18.hasValue() ) - lcl_addRangeToVec( vRanges, Arg18 ); - if ( Arg19.hasValue() ) - lcl_addRangeToVec( vRanges, Arg19 ); - if ( Arg20.hasValue() ) - lcl_addRangeToVec( vRanges, Arg20 ); - if ( Arg21.hasValue() ) - lcl_addRangeToVec( vRanges, Arg21 ); - if ( Arg22.hasValue() ) - lcl_addRangeToVec( vRanges, Arg22 ); - if ( Arg23.hasValue() ) - lcl_addRangeToVec( vRanges, Arg23 ); - if ( Arg24.hasValue() ) - lcl_addRangeToVec( vRanges, Arg24 ); - if ( Arg25.hasValue() ) - lcl_addRangeToVec( vRanges, Arg25 ); - if ( Arg26.hasValue() ) - lcl_addRangeToVec( vRanges, Arg26 ); - if ( Arg27.hasValue() ) - lcl_addRangeToVec( vRanges, Arg27 ); - if ( Arg28.hasValue() ) - lcl_addRangeToVec( vRanges, Arg28 ); - if ( Arg29.hasValue() ) - lcl_addRangeToVec( vRanges, Arg29 ); - if ( Arg30.hasValue() ) - lcl_addRangeToVec( vRanges, Arg30 ); + ScDocShell* pDocShell = excel::getDocShell( rxModel ); + if( !pDocShell ) throw uno::RuntimeException(); ScRangeList aCellRanges; - lcl_strip_containedRanges( vRanges ); + for( ListOfScRange::const_iterator aIt = rList.begin(), aEnd = rList.end(); aIt != aEnd; ++aIt ) + aCellRanges.Append( *aIt ); - for( Ranges::iterator it = vRanges.begin(); it != vRanges.end(); ++it ) - aCellRanges.Append( *it ); - - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - ScDocShell* pDocShell = excel::getDocShell( xModel ); - if ( aCellRanges.Count() == 1 ) + if( aCellRanges.Count() == 1 ) { - // normal range - uno::Reference< table::XCellRange > xCalcRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ) ); - xRange = new ScVbaRange( excel::getUnoSheetModuleObj( xCalcRange ), mxContext, xCalcRange ); + uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ) ); + return new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), rxContext, xRange ); } - else if ( aCellRanges.Count() > 1 ) // Multi-Area + if( aCellRanges.Count() > 1 ) { uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) ); - xRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), mxContext, xRanges ); + return new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), rxContext, xRanges ); } - - // #FIXME need proper (WorkSheet) parent - return xRange; + return 0; +} + +} // namespace + +// ---------------------------------------------------------------------------- + +uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Intersect( + const uno::Reference< excel::XRange >& rArg1, const uno::Reference< excel::XRange >& rArg2, + const uno::Any& rArg3, const uno::Any& rArg4, const uno::Any& rArg5, const uno::Any& rArg6, + const uno::Any& rArg7, const uno::Any& rArg8, const uno::Any& rArg9, const uno::Any& rArg10, + const uno::Any& rArg11, const uno::Any& rArg12, const uno::Any& rArg13, const uno::Any& rArg14, + const uno::Any& rArg15, const uno::Any& rArg16, const uno::Any& rArg17, const uno::Any& rArg18, + const uno::Any& rArg19, const uno::Any& rArg20, const uno::Any& rArg21, const uno::Any& rArg22, + const uno::Any& rArg23, const uno::Any& rArg24, const uno::Any& rArg25, const uno::Any& rArg26, + const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 ) + throw (script::BasicErrorException, uno::RuntimeException) +{ + if( !rArg1.is() || !rArg2.is() ) + DebugHelper::exception( SbERR_BAD_PARAMETER, rtl::OUString() ); + + // initialize the result list with 1st parameter, join its ranges together + ListOfScRange aList; + lclAddToListOfScRange( aList, uno::Any( rArg1 ) ); + lclJoinRanges( aList ); + + // process all other parameters, this updates the list with intersection + lclIntersectRanges( aList, uno::Any( rArg2 ) ); + lclIntersectRanges( aList, rArg3 ); + lclIntersectRanges( aList, rArg4 ); + lclIntersectRanges( aList, rArg5 ); + lclIntersectRanges( aList, rArg6 ); + lclIntersectRanges( aList, rArg7 ); + lclIntersectRanges( aList, rArg8 ); + lclIntersectRanges( aList, rArg9 ); + lclIntersectRanges( aList, rArg10 ); + lclIntersectRanges( aList, rArg11 ); + lclIntersectRanges( aList, rArg12 ); + lclIntersectRanges( aList, rArg13 ); + lclIntersectRanges( aList, rArg14 ); + lclIntersectRanges( aList, rArg15 ); + lclIntersectRanges( aList, rArg16 ); + lclIntersectRanges( aList, rArg17 ); + lclIntersectRanges( aList, rArg18 ); + lclIntersectRanges( aList, rArg19 ); + lclIntersectRanges( aList, rArg20 ); + lclIntersectRanges( aList, rArg21 ); + lclIntersectRanges( aList, rArg22 ); + lclIntersectRanges( aList, rArg23 ); + lclIntersectRanges( aList, rArg24 ); + lclIntersectRanges( aList, rArg25 ); + lclIntersectRanges( aList, rArg26 ); + lclIntersectRanges( aList, rArg27 ); + lclIntersectRanges( aList, rArg28 ); + lclIntersectRanges( aList, rArg29 ); + lclIntersectRanges( aList, rArg30 ); + + // create the VBA Range object + return lclCreateVbaRange( mxContext, getCurrentDocument(), aList ); +} + +uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Union( + const uno::Reference< excel::XRange >& rArg1, const uno::Reference< excel::XRange >& rArg2, + const uno::Any& rArg3, const uno::Any& rArg4, const uno::Any& rArg5, const uno::Any& rArg6, + const uno::Any& rArg7, const uno::Any& rArg8, const uno::Any& rArg9, const uno::Any& rArg10, + const uno::Any& rArg11, const uno::Any& rArg12, const uno::Any& rArg13, const uno::Any& rArg14, + const uno::Any& rArg15, const uno::Any& rArg16, const uno::Any& rArg17, const uno::Any& rArg18, + const uno::Any& rArg19, const uno::Any& rArg20, const uno::Any& rArg21, const uno::Any& rArg22, + const uno::Any& rArg23, const uno::Any& rArg24, const uno::Any& rArg25, const uno::Any& rArg26, + const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 ) + throw (script::BasicErrorException, uno::RuntimeException) +{ + if( !rArg1.is() || !rArg2.is() ) + DebugHelper::exception( SbERR_BAD_PARAMETER, rtl::OUString() ); + + ListOfScRange aList; + lclAddToListOfScRange( aList, uno::Any( rArg1 ) ); + lclAddToListOfScRange( aList, uno::Any( rArg2 ) ); + lclAddToListOfScRange( aList, rArg3 ); + lclAddToListOfScRange( aList, rArg4 ); + lclAddToListOfScRange( aList, rArg5 ); + lclAddToListOfScRange( aList, rArg6 ); + lclAddToListOfScRange( aList, rArg7 ); + lclAddToListOfScRange( aList, rArg8 ); + lclAddToListOfScRange( aList, rArg9 ); + lclAddToListOfScRange( aList, rArg10 ); + lclAddToListOfScRange( aList, rArg11 ); + lclAddToListOfScRange( aList, rArg12 ); + lclAddToListOfScRange( aList, rArg13 ); + lclAddToListOfScRange( aList, rArg14 ); + lclAddToListOfScRange( aList, rArg15 ); + lclAddToListOfScRange( aList, rArg16 ); + lclAddToListOfScRange( aList, rArg17 ); + lclAddToListOfScRange( aList, rArg18 ); + lclAddToListOfScRange( aList, rArg19 ); + lclAddToListOfScRange( aList, rArg20 ); + lclAddToListOfScRange( aList, rArg21 ); + lclAddToListOfScRange( aList, rArg22 ); + lclAddToListOfScRange( aList, rArg23 ); + lclAddToListOfScRange( aList, rArg24 ); + lclAddToListOfScRange( aList, rArg25 ); + lclAddToListOfScRange( aList, rArg26 ); + lclAddToListOfScRange( aList, rArg27 ); + lclAddToListOfScRange( aList, rArg28 ); + lclAddToListOfScRange( aList, rArg29 ); + lclAddToListOfScRange( aList, rArg30 ); + + // simply join together all ranges as much as possible, strip out covered ranges etc. + lclJoinRanges( aList ); + + // create the VBA Range object + return lclCreateVbaRange( mxContext, getCurrentDocument(), aList ); } void @@ -1218,14 +1090,14 @@ ScVbaApplication::Volatile( const uno::Any& aVolatile ) throw ( uno::RuntimeExc { sal_Bool bVolatile = sal_True; aVolatile >>= bVolatile; - return; + return; } void SAL_CALL ScVbaApplication::DoEvents() throw ( uno::RuntimeException ) { } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException ) { sal_Bool bRes = sal_False; @@ -1244,7 +1116,7 @@ ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException ) return bRes; } -void SAL_CALL +void SAL_CALL ScVbaApplication::setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( css::uno::RuntimeException ) { ScTabViewShell* pViewShell = excel::getCurrentBestViewShell( mxContext ); @@ -1254,16 +1126,16 @@ ScVbaApplication::setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( SfxAllItemSet reqList( SFX_APP()->GetPool() ); SfxRequest aReq( FID_TOGGLEINPUTLINE, 0, reqList ); pViewShell->Execute( aReq ); - } + } } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeException ) { StarBASIC* pBasic = SFX_APP()->GetBasic(); SFX_APP()->EnterBasicCall(); SbMethod* pMeth = (SbMethod*)pBasic->GetRtl()->Find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FuncCaller") ), SbxCLASS_METHOD ); - uno::Any aRet; + uno::Any aRet; if ( pMeth ) { SbxVariableRef refTemp = pMeth; @@ -1276,20 +1148,20 @@ ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeExcep return aRet; } -uno::Reference< frame::XModel > +uno::Reference< frame::XModel > ScVbaApplication::getCurrentDocument() throw (css::uno::RuntimeException) { return getCurrentExcelDoc(mxContext); } -rtl::OUString& +rtl::OUString& ScVbaApplication::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaApplication") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaApplication::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx index a7be5feb1d27..e6ebe28a8c10 100644 --- a/sc/source/ui/vba/vbaapplication.hxx +++ b/sc/source/ui/vba/vbaapplication.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,10 +47,10 @@ private: sal_Bool m_bEnableEvents; rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException ); - + protected: virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException); - + public: ScVbaApplication( const css::uno::Reference< css::uno::XComponentContext >& m_xContext ); virtual ~ScVbaApplication(); @@ -74,7 +74,7 @@ public: virtual ::rtl::OUString SAL_CALL getDefaultFilePath( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL LibraryPath( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL TemplatesPath( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - + virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL getDisplayAlerts() throw (css::uno::RuntimeException); virtual void SAL_CALL setDisplayAlerts( sal_Bool displayAlerts ) throw (css::uno::RuntimeException); @@ -93,7 +93,7 @@ public: 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); virtual css::uno::Any SAL_CALL WorksheetFunction( ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& DialogIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getCutCopyMode() throw (css::uno::RuntimeException); virtual void SAL_CALL setCutCopyMode( const css::uno::Any& _cutcopymode ) throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbaassistant.cxx b/sc/source/ui/vba/vbaassistant.cxx index 51105d60b0d4..e2bb5f7aa26f 100644 --- a/sc/source/ui/vba/vbaassistant.cxx +++ b/sc/source/ui/vba/vbaassistant.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,51 +75,51 @@ void SAL_CALL ScVbaAssistant::setOn( sal_Bool bOn ) throw (uno::RuntimeException } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAssistant::getTop() throw (css::uno::RuntimeException) { return m_nPointsTop; } -void SAL_CALL +void SAL_CALL ScVbaAssistant::setTop( ::sal_Int32 _top ) throw (css::uno::RuntimeException) { m_nPointsTop = _top; } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAssistant::getLeft() throw (css::uno::RuntimeException) { return m_nPointsLeft; } -void SAL_CALL +void SAL_CALL ScVbaAssistant::setLeft( ::sal_Int32 _left ) throw (css::uno::RuntimeException) { m_nPointsLeft = _left; } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAssistant::getAnimation() throw (css::uno::RuntimeException) { return m_nAnimation; } -void SAL_CALL +void SAL_CALL ScVbaAssistant::setAnimation( ::sal_Int32 _animation ) throw (css::uno::RuntimeException) { m_nAnimation = _animation; } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaAssistant::Name( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return m_sName; } -rtl::OUString& +rtl::OUString& ScVbaAssistant::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaAssistant") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaAssistant::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaassistant.hxx b/sc/source/ui/vba/vbaassistant.hxx index dbb95af4b689..e6707b7ccf28 100644 --- a/sc/source/ui/vba/vbaassistant.hxx +++ b/sc/source/ui/vba/vbaassistant.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ private: public: ScVbaAssistant( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~ScVbaAssistant(); - // XAssistant + // 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); diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx index d563ba105108..43743e4926a9 100644 --- a/sc/source/ui/vba/vbaaxes.cxx +++ b/sc/source/ui/vba/vbaaxes.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ using namespace ::ooo::vba::excel::XlAxisGroup; // each 'Item' in the Axes collection is indexed via 2 indexes, group and type. // We need to 'flatten' this into a single index in order to be able to wrap // iteration over the set of Axis(s) in a XIndexAccess implementation -// +// typedef ::std::pair<sal_Int32, sal_Int32 > AxesCoordinate; // type and group combination typedef ::std::vector< AxesCoordinate > vecAxesIndices; @@ -70,7 +70,7 @@ public: uno::Reference< excel::XAxis > ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 nType, sal_Int32 nAxisGroup ) throw ( uno::RuntimeException ) { - ScVbaChart* pChart = static_cast< ScVbaChart* >( xChart.get() ); + ScVbaChart* pChart = static_cast< ScVbaChart* >( xChart.get() ); if ( !pChart ) throw uno::RuntimeException( rtl::OUString::createFromAscii( "Object failure, can't access chart implementation" ), uno::Reference< uno::XInterface >() ); @@ -89,18 +89,18 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno: class AxisIndexWrapper : public AxisIndexWrapper_BASE { - // if necessary for better performance we could change this into a map and cache the + // if necessary for better performance we could change this into a map and cache the // indices -> Axis, currently we create a new Axis object // on each getByIndex uno::Reference< uno::XComponentContext > mxContext; vecAxesIndices mCoordinates; uno::Reference< excel::XChart > mxChart; -public: +public: AxisIndexWrapper( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< excel::XChart >& xChart ) : mxContext( xContext ), mxChart( xChart ) { if ( mxChart.is() ) { - ScVbaChart* pChart = static_cast< ScVbaChart* >( mxChart.get() ); + ScVbaChart* pChart = static_cast< ScVbaChart* >( mxChart.get() ); // primary sal_Bool bBool = false; uno::Reference< beans::XPropertySet > xDiagramPropertySet( pChart->xDiagramPropertySet() ); @@ -108,7 +108,7 @@ public: mCoordinates.push_back( AxesCoordinate( xlPrimary, xlCategory ) ); if ( ( xDiagramPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasYAxis" ) ) ) >>= bBool ) && bBool ) mCoordinates.push_back( AxesCoordinate( xlPrimary, xlSeriesAxis ) ); - + if ( pChart->is3D() ) mCoordinates.push_back( AxesCoordinate( xlPrimary, xlValue ) ); @@ -118,7 +118,7 @@ public: if ( ( xDiagramPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryYAxis" ) ) ) >>= bBool ) && bBool ) mCoordinates.push_back( AxesCoordinate( xlSecondary, xlSeriesAxis ) ); } - + } virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException) { return mCoordinates.size(); } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, ::uno::RuntimeException) @@ -147,19 +147,19 @@ ScVbaAxes::ScVbaAxes( const uno::Reference< XHelperInterface >& xParent,const un { } -uno::Type SAL_CALL +uno::Type SAL_CALL ScVbaAxes::getElementType() throw (css::uno::RuntimeException) { - return excel::XAxes::static_type(0); + return excel::XAxes::static_type(0); } -uno::Reference< container::XEnumeration > SAL_CALL +uno::Reference< container::XEnumeration > SAL_CALL ScVbaAxes::createEnumeration() throw (css::uno::RuntimeException) { return new EnumWrapper( m_xIndexAccess ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaAxes::Item( const css::uno::Any& _nType, const css::uno::Any& _oAxisGroup) throw (css::uno::RuntimeException) { // #TODO map the possible index combinations to a container::XIndexAccess wrapper impl @@ -176,20 +176,20 @@ ScVbaAxes::Item( const css::uno::Any& _nType, const css::uno::Any& _oAxisGroup) return uno::makeAny( createAxis( moChartParent, mxContext, nType, nAxisGroup ) ); } -uno::Any +uno::Any ScVbaAxes::createCollectionObject(const css::uno::Any& aSource) { return aSource; // pass through ( it's already an XAxis object } -rtl::OUString& +rtl::OUString& ScVbaAxes::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaAxes") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaAxes::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaaxes.hxx b/sc/source/ui/vba/vbaaxes.hxx index 5b5f88e2b72f..11f266128676 100644 --- a/sc/source/ui/vba/vbaaxes.hxx +++ b/sc/source/ui/vba/vbaaxes.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ public: ScVbaAxes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< ov::excel::XChart >& xChart ); // 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::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& aIndex2 ) throw (css::uno::RuntimeException); virtual css::uno::Any createCollectionObject(const css::uno::Any&); // XHelperInterface diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx index a9c91a4cea31..5ee7607627b3 100644 --- a/sc/source/ui/vba/vbaaxis.cxx +++ b/sc/source/ui/vba/vbaaxis.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ const rtl::OUString ORIGIN( RTL_CONSTASCII_USTRINGPARAM("Origin") ); const rtl::OUString AUTOORIGIN( RTL_CONSTASCII_USTRINGPARAM("AutoOrigin") ); const rtl::OUString VBA_MIN( RTL_CONSTASCII_USTRINGPARAM("Max") ); const rtl::OUString VBA_MAX( RTL_CONSTASCII_USTRINGPARAM("Min") ); -ScVbaChart* +ScVbaChart* ScVbaAxis::getChartPtr() throw( uno::RuntimeException ) { ScVbaChart* pChart = static_cast< ScVbaChart* >( moChartParent.get() ); @@ -50,7 +50,7 @@ ScVbaAxis::getChartPtr() throw( uno::RuntimeException ) return pChart; } -sal_Bool +sal_Bool ScVbaAxis::isValueAxis() throw( script::BasicErrorException ) { if ( getType() == xlCategory ) @@ -60,29 +60,29 @@ ScVbaAxis::isValueAxis() throw( script::BasicErrorException ) return sal_True; } -ScVbaAxis::ScVbaAxis( const uno::Reference< XHelperInterface >& xParent,const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ) : ScVbaAxis_BASE( xParent, xContext ), mxPropertySet( _xPropertySet ), mnType( _nType ), mnGroup( _nGroup ), bCrossesAreCustomized( sal_False ) +ScVbaAxis::ScVbaAxis( const uno::Reference< XHelperInterface >& xParent,const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ) : ScVbaAxis_BASE( xParent, xContext ), mxPropertySet( _xPropertySet ), mnType( _nType ), mnGroup( _nGroup ), bCrossesAreCustomized( sal_False ) { oShapeHelper.reset( new ShapeHelper( uno::Reference< drawing::XShape >( mxPropertySet, uno::UNO_QUERY ) ) ); moChartParent.set( xParent, uno::UNO_QUERY_THROW ); setType(_nType); - setCrosses(xlAxisCrossesAutomatic); + setCrosses(xlAxisCrossesAutomatic); } -void SAL_CALL +void SAL_CALL ScVbaAxis::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< lang::XComponent > xComponent( mxPropertySet, uno::UNO_QUERY_THROW ); xComponent->dispose(); } - uno::Reference< ::ooo::vba::excel::XAxisTitle > SAL_CALL + uno::Reference< ::ooo::vba::excel::XAxisTitle > SAL_CALL ScVbaAxis::getAxisTitle( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< excel::XAxisTitle > xAxisTitle; try { ScVbaChart* pChart = getChartPtr(); - + if (getHasTitle() ) { int nType = getType(); @@ -97,7 +97,7 @@ ScVbaAxis::getAxisTitle( ) throw (script::BasicErrorException, uno::RuntimeExce default: // xlValue: xAxisTitle = new ScVbaAxisTitle(this, mxContext, pChart->xAxisYSupplier->getYAxisTitle()); break; - } + } } } catch (uno::Exception& e) @@ -108,20 +108,20 @@ ScVbaAxis::getAxisTitle( ) throw (script::BasicErrorException, uno::RuntimeExce } -void SAL_CALL +void SAL_CALL ScVbaAxis::setDisplayUnit( ::sal_Int32 /*DisplayUnit*/ ) throw (script::BasicErrorException, uno::RuntimeException) { DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAxis::getDisplayUnit( ) throw (script::BasicErrorException, uno::RuntimeException) { DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); return -1; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setCrosses( ::sal_Int32 _nCrosses ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -129,16 +129,16 @@ ScVbaAxis::setCrosses( ::sal_Int32 _nCrosses ) throw (script::BasicErrorExceptio double fNum = 0.0; switch (_nCrosses) { - case xlAxisCrossesAutomatic: //Microsoft Excel sets the axis crossing point. + case xlAxisCrossesAutomatic: //Microsoft Excel sets the axis crossing point. mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny( sal_True ) ); bCrossesAreCustomized = sal_False; return; - case xlAxisCrossesMinimum: // The axis crosses at the minimum value. + case xlAxisCrossesMinimum: // The axis crosses at the minimum value. mxPropertySet->getPropertyValue(VBA_MIN) >>= fNum; setCrossesAt( fNum ); bCrossesAreCustomized = sal_False; break; - case xlAxisCrossesMaximum: // The axis crosses at the maximum value. + case xlAxisCrossesMaximum: // The axis crosses at the maximum value. mxPropertySet->getPropertyValue(VBA_MAX) >>= fNum; setCrossesAt(fNum); bCrossesAreCustomized = sal_False; @@ -147,14 +147,14 @@ ScVbaAxis::setCrosses( ::sal_Int32 _nCrosses ) throw (script::BasicErrorExceptio bCrossesAreCustomized = sal_True; break; } - mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny(sal_False) ); + mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny(sal_False) ); } catch (uno::Exception& ) { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); } } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAxis::getCrosses( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Int32 nCrosses = xlAxisCrossesCustom; @@ -167,7 +167,7 @@ ScVbaAxis::getCrosses( ) throw (script::BasicErrorException, uno::RuntimeExcept else { if (bCrossesAreCustomized) - nCrosses = xlAxisCrossesCustom; + nCrosses = xlAxisCrossesCustom; else { double forigin = 0.0; @@ -189,7 +189,7 @@ ScVbaAxis::getCrosses( ) throw (script::BasicErrorException, uno::RuntimeExcept return nCrosses; } - void SAL_CALL + void SAL_CALL ScVbaAxis::setCrossesAt( double _fCrossesAt ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -206,7 +206,7 @@ ScVbaAxis::setCrossesAt( double _fCrossesAt ) throw (script::BasicErrorException } } - double SAL_CALL + double SAL_CALL ScVbaAxis::getCrossesAt( ) throw (script::BasicErrorException, uno::RuntimeException) { double fCrosses = 0.0; @@ -221,19 +221,19 @@ ScVbaAxis::getCrossesAt( ) throw (script::BasicErrorException, uno::RuntimeExce return fCrosses; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setType( ::sal_Int32 _nType ) throw (script::BasicErrorException, uno::RuntimeException) { mnType = _nType; } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAxis::getType( ) throw (script::BasicErrorException, uno::RuntimeException) { return mnType; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setHasTitle( ::sal_Bool _bHasTitle ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -250,16 +250,16 @@ ScVbaAxis::setHasTitle( ::sal_Bool _bHasTitle ) throw (script::BasicErrorExcepti break; default: // xlValue: pChart->mxDiagramPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasYAxisTitle")), uno::makeAny(_bHasTitle)); - } + } } catch (uno::Exception& e) { DebugHelper::exception(e); - } + } } - ::sal_Bool SAL_CALL + ::sal_Bool SAL_CALL ScVbaAxis::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Bool bHasTitle = sal_False; @@ -277,7 +277,7 @@ ScVbaAxis::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeExcep break; default: // xlValue: pChart->mxDiagramPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasYAxisTitle")) ) >>= bHasTitle; - } + } } catch (uno::Exception& e) { @@ -286,13 +286,13 @@ ScVbaAxis::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeExcep return bHasTitle; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMinorUnit( double _fMinorUnit ) throw (script::BasicErrorException, uno::RuntimeException) { try { if (isValueAxis()) - mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepHelp") ), uno::makeAny(_fMinorUnit)); + mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepHelp") ), uno::makeAny(_fMinorUnit)); } catch (uno::Exception& ) { @@ -300,7 +300,7 @@ ScVbaAxis::setMinorUnit( double _fMinorUnit ) throw (script::BasicErrorException } } -double SAL_CALL +double SAL_CALL ScVbaAxis::getMinorUnit( ) throw (script::BasicErrorException, uno::RuntimeException) { double fMinor = 1.0; @@ -316,7 +316,7 @@ ScVbaAxis::getMinorUnit( ) throw (script::BasicErrorException, uno::RuntimeExce return fMinor; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMinorUnitIsAuto( ::sal_Bool _bMinorUnitIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -330,7 +330,7 @@ ScVbaAxis::setMinorUnitIsAuto( ::sal_Bool _bMinorUnitIsAuto ) throw (script::Bas } } - ::sal_Bool SAL_CALL + ::sal_Bool SAL_CALL ScVbaAxis::getMinorUnitIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Bool bIsAuto = sal_False; @@ -348,27 +348,27 @@ ScVbaAxis::getMinorUnitIsAuto( ) throw (script::BasicErrorException, uno::Runti return bIsAuto; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setReversePlotOrder( ::sal_Bool /*ReversePlotOrder*/ ) throw (script::BasicErrorException, uno::RuntimeException) { DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaAxis::getReversePlotOrder( ) throw (script::BasicErrorException, uno::RuntimeException) { DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); return sal_False; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMajorUnit( double _fMajorUnit ) throw (script::BasicErrorException, uno::RuntimeException) { try { if (isValueAxis()) { - mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepMain")), uno::makeAny(_fMajorUnit)); + mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepMain")), uno::makeAny(_fMajorUnit)); } } catch (uno::Exception& ) @@ -377,7 +377,7 @@ ScVbaAxis::setMajorUnit( double _fMajorUnit ) throw (script::BasicErrorException } } -double SAL_CALL +double SAL_CALL ScVbaAxis::getMajorUnit( ) throw (script::BasicErrorException, uno::RuntimeException) { double fMax = 1.0; @@ -393,7 +393,7 @@ ScVbaAxis::getMajorUnit( ) throw (script::BasicErrorException, uno::RuntimeExce return fMax; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMajorUnitIsAuto( ::sal_Bool _bMajorUnitIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -409,7 +409,7 @@ ScVbaAxis::setMajorUnitIsAuto( ::sal_Bool _bMajorUnitIsAuto ) throw (script::Bas } } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaAxis::getMajorUnitIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Bool bIsAuto = sal_False; @@ -427,14 +427,14 @@ ScVbaAxis::getMajorUnitIsAuto( ) throw (script::BasicErrorException, uno::Runti return bIsAuto; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMaximumScale( double _fMaximumScale ) throw (script::BasicErrorException, uno::RuntimeException) { try { if ( isValueAxis() ) { - mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Max" ) ), uno::makeAny(_fMaximumScale)); + mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Max" ) ), uno::makeAny(_fMaximumScale)); } } catch ( uno::Exception& ) @@ -443,7 +443,7 @@ ScVbaAxis::setMaximumScale( double _fMaximumScale ) throw (script::BasicErrorExc } } -double SAL_CALL +double SAL_CALL ScVbaAxis::getMaximumScale( ) throw (script::BasicErrorException, uno::RuntimeException) { double fMax = 1.0; @@ -451,7 +451,7 @@ ScVbaAxis::getMaximumScale( ) throw (script::BasicErrorException, uno::RuntimeE { if (isValueAxis()) { - mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Max" ))) >>= fMax; + mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Max" ))) >>= fMax; } } catch (uno::Exception& ) @@ -462,23 +462,23 @@ ScVbaAxis::getMaximumScale( ) throw (script::BasicErrorException, uno::RuntimeE } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMaximumScaleIsAuto( ::sal_Bool _bMaximumScaleIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) { try { if ( isValueAxis() ) mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoMax" ) ), uno::makeAny( _bMaximumScaleIsAuto )); - + } catch ( uno::Exception& ) { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); - } + } } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaAxis::getMaximumScaleIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Bool bIsAuto = sal_False; @@ -494,7 +494,7 @@ ScVbaAxis::getMaximumScaleIsAuto( ) throw (script::BasicErrorException, uno::Ru return bIsAuto; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMinimumScale( double _fMinimumScale ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -508,7 +508,7 @@ ScVbaAxis::setMinimumScale( double _fMinimumScale ) throw (script::BasicErrorExc } } -double SAL_CALL +double SAL_CALL ScVbaAxis::getMinimumScale( ) throw (script::BasicErrorException, uno::RuntimeException) { double fMin = 0.0; @@ -524,7 +524,7 @@ ScVbaAxis::getMinimumScale( ) throw (script::BasicErrorException, uno::RuntimeE return fMin; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setMinimumScaleIsAuto( ::sal_Bool _bMinimumScaleIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -540,7 +540,7 @@ ScVbaAxis::setMinimumScaleIsAuto( ::sal_Bool _bMinimumScaleIsAuto ) throw (scrip } } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaAxis::getMinimumScaleIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Bool bIsAuto = sal_False; @@ -548,7 +548,7 @@ ScVbaAxis::getMinimumScaleIsAuto( ) throw (script::BasicErrorException, uno::Ru { if (isValueAxis()) { - mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoMin")) ) >>= bIsAuto; + mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoMin")) ) >>= bIsAuto; } } catch (uno::Exception& ) @@ -558,13 +558,13 @@ ScVbaAxis::getMinimumScaleIsAuto( ) throw (script::BasicErrorException, uno::Ru return bIsAuto; } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAxis::getAxisGroup( ) throw (uno::RuntimeException) { return mnGroup; } -void SAL_CALL +void SAL_CALL ScVbaAxis::setScaleType( ::sal_Int32 _nScaleType ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -591,10 +591,10 @@ ScVbaAxis::setScaleType( ::sal_Int32 _nScaleType ) throw (script::BasicErrorExce } } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaAxis::getScaleType( ) throw (script::BasicErrorException, uno::RuntimeException) { - sal_Int32 nScaleType = xlScaleLinear; + sal_Int32 nScaleType = xlScaleLinear; try { if (isValueAxis()) @@ -604,7 +604,7 @@ ScVbaAxis::getScaleType( ) throw (script::BasicErrorException, uno::RuntimeExce if (bisLogarithmic) nScaleType = xlScaleLogarithmic; else - nScaleType = xlScaleLinear; + nScaleType = xlScaleLinear; } } catch (uno::Exception& ) @@ -614,7 +614,7 @@ ScVbaAxis::getScaleType( ) throw (script::BasicErrorException, uno::RuntimeExce return nScaleType; } -double SAL_CALL +double SAL_CALL ScVbaAxis::getHeight( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return oShapeHelper->getHeight(); @@ -649,14 +649,14 @@ void SAL_CALL ScVbaAxis::setLeft( double left ) throw (css::script::BasicErrorEx oShapeHelper->setLeft( left ); } -rtl::OUString& +rtl::OUString& ScVbaAxis::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaAxis") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaAxis::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaaxis.hxx b/sc/source/ui/vba/vbaaxis.hxx index 13432b231a27..7638bdc45e5a 100644 --- a/sc/source/ui/vba/vbaaxis.hxx +++ b/sc/source/ui/vba/vbaaxis.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,11 +40,11 @@ class ScVbaAxis : public ScVbaAxis_BASE sal_Int32 mnType; sal_Int32 mnGroup; sal_Int32 mnCrosses; - sal_Bool bCrossesAreCustomized; + sal_Bool bCrossesAreCustomized; ScVbaChart* getChartPtr() throw( css::uno::RuntimeException ); sal_Bool isValueAxis() throw( css::script::BasicErrorException ); std::auto_ptr<ov::ShapeHelper> oShapeHelper; - + public: ScVbaAxis( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ); // Methods diff --git a/sc/source/ui/vba/vbaaxistitle.cxx b/sc/source/ui/vba/vbaaxistitle.cxx index 89b12b6e2870..2184956d876f 100644 --- a/sc/source/ui/vba/vbaaxistitle.cxx +++ b/sc/source/ui/vba/vbaaxistitle.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ ScVbaAxisTitle::getServiceImplName() return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaAxisTitle::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaaxistitle.hxx b/sc/source/ui/vba/vbaaxistitle.hxx index 59ba71d99a87..e53a6daeb3f2 100644 --- a/sc/source/ui/vba/vbaaxistitle.hxx +++ b/sc/source/ui/vba/vbaaxistitle.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index 5424da041f84..5ecdc5f64880 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,7 +61,7 @@ class ScVbaBorder : public ScVbaBorder_Base { private: uno::Reference< beans::XPropertySet > m_xProps; - sal_Int32 m_LineType; + sal_Int32 m_LineType; ScVbaPalette m_Palette; bool setBorderLine( table::BorderLine& rBorderLine ) { @@ -78,7 +78,7 @@ private: aTableBorder.IsTopLineValid = sal_True; aTableBorder.TopLine = rBorderLine; break; - + case XlBordersIndex::xlEdgeBottom: aTableBorder.IsBottomLineValid = sal_True; aTableBorder.BottomLine = rBorderLine; @@ -99,13 +99,13 @@ private: case XlBordersIndex::xlDiagonalUp: // #TODO have to ignore at the momement, would be // nice to investigate what we can do here - break; + break; default: return false; } m_xProps->setPropertyValue( sTableBorder, uno::makeAny(aTableBorder) ); return true; - } + } bool getBorderLine( table::BorderLine& rBorderLine ) { @@ -121,7 +121,7 @@ private: if ( aTableBorder.IsTopLineValid ) rBorderLine = aTableBorder.TopLine; break; - + case XlBordersIndex::xlEdgeBottom: if ( aTableBorder.IsBottomLineValid ) rBorderLine = aTableBorder.BottomLine; @@ -143,18 +143,18 @@ private: case XlBordersIndex::xlDiagonalUp: // #TODO have to ignore at the momement, would be // nice to investigate what we can do here - break; + break; default: return false; } return true; - } + } ScVbaBorder(); // no impl -protected: +protected: virtual rtl::OUString& getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaBorder") ); - return sImplName; + return sImplName; } virtual css::uno::Sequence<rtl::OUString> getServiceNames() { @@ -164,17 +164,17 @@ protected: aServiceNames.realloc( 1 ); aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Border" ) ); } - return aServiceNames; + return aServiceNames; } public: - ScVbaBorder( const uno::Reference< beans::XPropertySet > & xProps, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 lineType, ScVbaPalette& rPalette) : ScVbaBorder_Base( uno::Reference< XHelperInterface >( xProps, uno::UNO_QUERY ), xContext ), m_xProps( xProps ), m_LineType( lineType ), m_Palette( rPalette ) {} + ScVbaBorder( const uno::Reference< beans::XPropertySet > & xProps, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 lineType, ScVbaPalette& rPalette) : ScVbaBorder_Base( uno::Reference< XHelperInterface >( xProps, uno::UNO_QUERY ), xContext ), m_xProps( xProps ), m_LineType( lineType ), m_Palette( rPalette ) {} // XBorder uno::Any SAL_CALL getColor() throw (uno::RuntimeException) { table::BorderLine aBorderLine; if ( getBorderLine( aBorderLine ) ) - return uno::makeAny( OORGBToXLRGB( aBorderLine.Color ) ); + return uno::makeAny( OORGBToXLRGB( aBorderLine.Color ) ); throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No Implementation available" ) ), uno::Reference< uno::XInterface >() ); } void SAL_CALL setColor( const uno::Any& _color ) throw (uno::RuntimeException) @@ -185,7 +185,7 @@ public: if ( getBorderLine( aBorderLine ) ) { aBorderLine.Color = XLRGBToOORGB( nColor ); - setBorderLine( aBorderLine ); + setBorderLine( aBorderLine ); } else throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No Implementation available" ) ), uno::Reference< uno::XInterface >() ); @@ -203,7 +203,7 @@ public: sal_Int32 nPaletteColor = 0; xIndex->getByIndex( count ) >>= nPaletteColor; if ( nPaletteColor == nColor ) - { + { nIndex = count + 1; break; } @@ -226,16 +226,16 @@ public: { switch ( aBorderLine.OuterLineWidth ) { - case 0: // Thin = default OO thickness - case OOLineThin: + case 0: // Thin = default OO thickness + case OOLineThin: return uno::makeAny( XlBorderWeight::xlThin ); - case OOLineMedium: + case OOLineMedium: return uno::makeAny( XlBorderWeight::xlMedium ); - case OOLineThick: + case OOLineThick: return uno::makeAny( XlBorderWeight::xlThick ); - case OOLineHairline: + case OOLineHairline: return uno::makeAny( XlBorderWeight::xlHairline ); - default: + default: break; } } @@ -250,7 +250,7 @@ public: { switch ( nWeight ) { - case XlBorderWeight::xlThin: + case XlBorderWeight::xlThin: aBorderLine.OuterLineWidth = OOLineThin; break; case XlBorderWeight::xlMedium: @@ -262,7 +262,7 @@ public: case XlBorderWeight::xlHairline: aBorderLine.OuterLineWidth = OOLineHairline; break; - default: + default: throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Bad param" ) ), uno::Reference< uno::XInterface >() ); } setBorderLine( aBorderLine ); @@ -276,7 +276,7 @@ public: // always return xlContinuous; return uno::makeAny( XlLineStyle::xlContinuous ); } - void SAL_CALL setLineStyle( const uno::Any& _linestyle ) throw (uno::RuntimeException) + void SAL_CALL setLineStyle( const uno::Any& _linestyle ) throw (uno::RuntimeException) { // Urk no choice but to silently ignore we don't support this attribute // #TODO would be nice to support the excel line styles @@ -329,14 +329,14 @@ public: RangeBorders( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, ScVbaPalette& rPalette ) : m_xRange( xRange ), m_xContext( xContext ), m_Palette( rPalette ) { } - // XIndexAccess + // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { return sizeof( supportedIndexTable ) / sizeof( supportedIndexTable[0] ); } - virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) { - + sal_Int32 nIndex = getTableIndex( Index ); if ( nIndex >= 0 && nIndex < getCount() ) { @@ -355,7 +355,7 @@ public: } }; -uno::Reference< container::XIndexAccess > +uno::Reference< container::XIndexAccess > rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, ScVbaPalette& rPalette ) { return new RangeBorders( xRange, xContext, rPalette ); @@ -380,11 +380,11 @@ public: } }; -ScVbaBorders::ScVbaBorders( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< table::XCellRange >& xRange, ScVbaPalette& rPalette ): ScVbaBorders_BASE( xParent, xContext, rangeToBorderIndexAccess( xRange ,xContext, rPalette ) ), bRangeIsSingleCell( false ) +ScVbaBorders::ScVbaBorders( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< table::XCellRange >& xRange, ScVbaPalette& rPalette ): ScVbaBorders_BASE( xParent, xContext, rangeToBorderIndexAccess( xRange ,xContext, rPalette ) ), bRangeIsSingleCell( false ) { uno::Reference< table::XColumnRowRange > xColumnRowRange(xRange, uno::UNO_QUERY_THROW ); - if ( xColumnRowRange->getRows()->getCount() == 1 && xColumnRowRange->getColumns()->getCount() == 1 ) - bRangeIsSingleCell = true; + if ( xColumnRowRange->getRows()->getCount() == 1 && xColumnRowRange->getColumns()->getCount() == 1 ) + bRangeIsSingleCell = true; m_xProps.set( xRange, uno::UNO_QUERY_THROW ); } @@ -400,7 +400,7 @@ ScVbaBorders::createCollectionObject( const css::uno::Any& aSource ) return aSource; // its already a Border object } -uno::Type +uno::Type ScVbaBorders::getElementType() throw (uno::RuntimeException) { return excel::XBorders::static_type(0); @@ -475,20 +475,20 @@ void SAL_CALL ScVbaBorders::setColorIndex( const uno::Any& _colorindex ) throw ( bool lcl_areAllLineWidthsSame( const table::TableBorder& maTableBorder, bool bIsCell ) { - + bool bRes = false; - if (bIsCell) + if (bIsCell) { - bRes = ((maTableBorder.TopLine.OuterLineWidth == maTableBorder.BottomLine.OuterLineWidth) && + bRes = ((maTableBorder.TopLine.OuterLineWidth == maTableBorder.BottomLine.OuterLineWidth) && (maTableBorder.TopLine.OuterLineWidth == maTableBorder.LeftLine.OuterLineWidth) && (maTableBorder.TopLine.OuterLineWidth == maTableBorder.RightLine.OuterLineWidth)); } else { - bRes = ((maTableBorder.TopLine.OuterLineWidth == maTableBorder.BottomLine.OuterLineWidth) && -(maTableBorder.TopLine.OuterLineWidth == maTableBorder.LeftLine.OuterLineWidth) && -(maTableBorder.TopLine.OuterLineWidth == maTableBorder.HorizontalLine.OuterLineWidth) && -(maTableBorder.TopLine.OuterLineWidth == maTableBorder.VerticalLine.OuterLineWidth) && + bRes = ((maTableBorder.TopLine.OuterLineWidth == maTableBorder.BottomLine.OuterLineWidth) && +(maTableBorder.TopLine.OuterLineWidth == maTableBorder.LeftLine.OuterLineWidth) && +(maTableBorder.TopLine.OuterLineWidth == maTableBorder.HorizontalLine.OuterLineWidth) && +(maTableBorder.TopLine.OuterLineWidth == maTableBorder.VerticalLine.OuterLineWidth) && (maTableBorder.TopLine.OuterLineWidth == maTableBorder.RightLine.OuterLineWidth)); } return bRes; @@ -503,14 +503,14 @@ uno::Any SAL_CALL ScVbaBorders::getLineStyle() throw (uno::RuntimeException) if ( lcl_areAllLineWidthsSame( maTableBorder, bRangeIsSingleCell )) { - if (maTableBorder.TopLine.LineDistance != 0) + if (maTableBorder.TopLine.LineDistance != 0) { aLinestyle = XlLineStyle::xlDouble; - } + } else if ( maTableBorder.TopLine.OuterLineWidth != 0 ) { aLinestyle = XlLineStyle::xlContinuous; - } + } } return uno::makeAny( aLinestyle ); } @@ -543,7 +543,7 @@ uno::Any SAL_CALL ScVbaBorders::getWeight() throw (uno::RuntimeException) } return weight; } -void SAL_CALL ScVbaBorders::setWeight( const uno::Any& _weight ) throw (uno::RuntimeException) +void SAL_CALL ScVbaBorders::setWeight( const uno::Any& _weight ) throw (uno::RuntimeException) { sal_Int32 count = getCount(); for( sal_Int32 i = 0; i < count ; i++ ) @@ -554,14 +554,14 @@ void SAL_CALL ScVbaBorders::setWeight( const uno::Any& _weight ) throw (uno::Run } -rtl::OUString& +rtl::OUString& ScVbaBorders::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaBorders") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaBorders::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaborders.hxx b/sc/source/ui/vba/vbaborders.hxx index a385ad2e7a14..d8308f44d347 100644 --- a/sc/source/ui/vba/vbaborders.hxx +++ b/sc/source/ui/vba/vbaborders.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/beans/XPropertySet.hpp> - + #include <vbahelper/vbacollectionimpl.hxx> typedef CollTestImplHelper< ov::excel::XBorders > ScVbaBorders_BASE; @@ -56,9 +56,9 @@ public: // XBorders - // ScVbaCollectionBaseImpl - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - + // ScVbaCollectionBaseImpl + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException); virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getColorIndex() throw (css::uno::RuntimeException); @@ -67,7 +67,7 @@ public: virtual void SAL_CALL setLineStyle( const css::uno::Any& _linestyle ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getWeight() throw (css::uno::RuntimeException); virtual void SAL_CALL setWeight( const css::uno::Any& ) throw (css::uno::RuntimeException); - // xxxxBASE + // xxxxBASE virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; diff --git a/sc/source/ui/vba/vbacharacters.cxx b/sc/source/ui/vba/vbacharacters.cxx index 6c0079ac7a82..3786598a1800 100644 --- a/sc/source/ui/vba/vbacharacters.cxx +++ b/sc/source/ui/vba/vbacharacters.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ ScVbaCharacters::ScVbaCharacters( const uno::Reference< XHelperInterface >& xPar if ( nStart < 1 ) nStart = 1; // silently correct user error ( as ms ) nStart--; // OOo is 0 based - Length >>=nLength; + Length >>=nLength; uno::Reference< text::XTextCursor > xTextCursor( m_xSimpleText->createTextCursor(), uno::UNO_QUERY_THROW ); xTextCursor->collapseToStart(); if ( nStart ) @@ -57,41 +57,41 @@ ScVbaCharacters::ScVbaCharacters( const uno::Reference< XHelperInterface >& xPar } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaCharacters::getCaption() throw (css::uno::RuntimeException) { return m_xTextRange->getString(); } -void SAL_CALL +void SAL_CALL ScVbaCharacters::setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException) { m_xTextRange->setString( _caption ); } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaCharacters::getCount() throw (css::uno::RuntimeException) { - return getCaption().getLength(); + return getCaption().getLength(); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaCharacters::getText() throw (css::uno::RuntimeException) { return getCaption(); } -void SAL_CALL +void SAL_CALL ScVbaCharacters::setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException) { setCaption( _text ); } -uno::Reference< excel::XFont > SAL_CALL -ScVbaCharacters::getFont() throw (css::uno::RuntimeException) +uno::Reference< excel::XFont > SAL_CALL +ScVbaCharacters::getFont() throw (css::uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xTextRange, uno::UNO_QUERY_THROW ); return uno::Reference< excel::XFont >( new ScVbaFont( this, mxContext, m_aPalette, xProps ) ); } -void SAL_CALL +void SAL_CALL ScVbaCharacters::setFont( const uno::Reference< excel::XFont >& /*_font*/ ) throw (css::uno::RuntimeException) { // #TODO #FIXME needs implementation, or can't be done? @@ -100,29 +100,29 @@ ScVbaCharacters::setFont( const uno::Reference< excel::XFont >& /*_font*/ ) thro // Methods -void SAL_CALL +void SAL_CALL ScVbaCharacters::Insert( const ::rtl::OUString& String ) throw (css::uno::RuntimeException) { m_xSimpleText->insertString( m_xTextRange, String, bReplace ); } -void SAL_CALL +void SAL_CALL ScVbaCharacters::Delete( ) throw (css::uno::RuntimeException) { - // #FIXME #TODO is this a bit suspect?, I wonder should the contents + // #FIXME #TODO is this a bit suspect?, I wonder should the contents // of the cell be deleted from the parent ( range ) - m_xSimpleText->setString(rtl::OUString()); + m_xSimpleText->setString(rtl::OUString()); } -rtl::OUString& +rtl::OUString& ScVbaCharacters::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCharacters") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaCharacters::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbacharacters.hxx b/sc/source/ui/vba/vbacharacters.hxx index 3400ff159d5e..0bc1931229e9 100644 --- a/sc/source/ui/vba/vbacharacters.hxx +++ b/sc/source/ui/vba/vbacharacters.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx index e2f446f93f2b..3824d53dc350 100644 --- a/sc/source/ui/vba/vbachart.cxx +++ b/sc/source/ui/vba/vbachart.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -86,7 +86,7 @@ ScVbaChart::ScVbaChart( const css::uno::Reference< ov::XHelperInterface >& _xPar mxChartPropertySet.set( _xChartComponent, uno::UNO_QUERY_THROW ) ; } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaChart::getName() throw (css::uno::RuntimeException) { rtl::OUString sName; @@ -107,7 +107,7 @@ ScVbaChart::SeriesCollection(const uno::Any&) throw (uno::RuntimeException) return uno::Any(); } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaChart::getChartType() throw ( uno::RuntimeException, script::BasicErrorException) { sal_Int32 nChartType = -1; @@ -135,7 +135,7 @@ ScVbaChart::getChartType() throw ( uno::RuntimeException, script::BasicErrorExce else if (sDiagramType.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart.BarDiagram")))) { sal_Int32 nSolidType = chart::ChartSolidType::RECTANGULAR_SOLID; - if (mxDiagramPropertySet->getPropertySetInfo()->hasPropertyByName(SOLIDTYPE)) + if (mxDiagramPropertySet->getPropertySetInfo()->hasPropertyByName(SOLIDTYPE)) { //in 2D diagrams 'SolidType' may not be set if (is3D()) mxDiagramPropertySet->getPropertyValue(SOLIDTYPE) >>= nSolidType; @@ -226,7 +226,7 @@ ScVbaChart::getChartType() throw ( uno::RuntimeException, script::BasicErrorExce return nChartType; } -void SAL_CALL +void SAL_CALL ScVbaChart::setChartType( ::sal_Int32 _nChartType ) throw ( uno::RuntimeException, script::BasicErrorException) { try @@ -302,7 +302,7 @@ try mxDiagramPropertySet->setPropertyValue( UPDOWN, uno::makeAny(sal_Bool((_nChartType == xlStockOHLC) || (_nChartType == xlStockVOHLC)))); mxDiagramPropertySet->setPropertyValue(VOLUME, uno::makeAny(sal_Bool((_nChartType == xlStockVHLC) || (_nChartType == xlStockVOHLC)))); break; - + case xlPieOfPie: // not possible case xlPieExploded: // SegmentOffset an ChartDataPointProperties ->am XDiagram abholen //wie macht Excel das? case xl3DPieExploded: @@ -311,7 +311,7 @@ try case xlBarOfPie: // not possible (Zoom pie) setDiagram( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart.PieDiagram"))); break; - + case xlRadar: case xlRadarMarkers: case xlRadarFilled: @@ -347,8 +347,8 @@ try default: throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_CONVERSION, rtl::OUString() ); } - - switch (_nChartType) + + switch (_nChartType) { case xlLineMarkers: case xlLineMarkersStacked: @@ -458,7 +458,7 @@ try } break; } - + switch (_nChartType) { case xlColumnStacked: @@ -500,7 +500,7 @@ try mxDiagramPropertySet->setPropertyValue(STACKED, uno::makeAny( sal_False)); break; } - switch (_nChartType) + switch (_nChartType) { case xl3DArea: case xl3DAreaStacked: @@ -567,7 +567,7 @@ ScVbaChart::Activate() throw (script::BasicErrorException, uno::RuntimeException throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no ChartObject as parent" ) ) ); } -void SAL_CALL +void SAL_CALL ScVbaChart::setSourceData( const css::uno::Reference< ::ooo::vba::excel::XRange >& _xCalcRange, const css::uno::Any& _aPlotBy ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { try @@ -635,7 +635,7 @@ ScVbaChart::setSourceData( const css::uno::Reference< ::ooo::vba::excel::XRange } } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaChart::getDefaultSeriesDescriptions( sal_Int32 _nCount ) { uno::Sequence< rtl::OUString > sDescriptions ( _nCount ); @@ -675,10 +675,10 @@ ScVbaChart::setPlotBy( ::sal_Int32 _nPlotBy ) throw (css::script::BasicErrorExce catch (uno::Exception& ) { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); - } + } } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaChart::getPlotBy( ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -697,7 +697,7 @@ ScVbaChart::getPlotBy( ) throw (script::BasicErrorException, uno::RuntimeExcept catch (uno::Exception& ) { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); - } + } } void @@ -718,23 +718,23 @@ ScVbaChart::setDiagram( const rtl::OUString& _sDiagramType ) throw( script::Basi // #TODO find out why we have Location/getLocation ? there is afaiks no // Location property, just a Location function for the Chart object -sal_Int32 SAL_CALL +sal_Int32 SAL_CALL ScVbaChart::Location() throw (css::script::BasicErrorException, css::uno::RuntimeException) { - return getLocation(); + return getLocation(); } -sal_Int32 SAL_CALL +sal_Int32 SAL_CALL ScVbaChart::getLocation() throw (css::script::BasicErrorException, css::uno::RuntimeException) { return -1; } -void SAL_CALL +void SAL_CALL ScVbaChart::setLocation( ::sal_Int32 /*where*/, const css::uno::Any& /*Name*/ ) throw (script::BasicErrorException, uno::RuntimeException) { // Helper api just stubs out the code <shrug> - // #TODO come back and make sense out of this + // #TODO come back and make sense out of this // String sheetName = null; // // if ((name != null) && name instanceof String) { @@ -818,7 +818,7 @@ ScVbaChart::setLocation( ::sal_Int32 /*where*/, const css::uno::Any& /*Name*/ ) } -sal_Bool SAL_CALL +sal_Bool SAL_CALL ScVbaChart::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Bool bHasTitle = sal_False; @@ -833,7 +833,7 @@ ScVbaChart::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeExce return bHasTitle; } -void SAL_CALL +void SAL_CALL ScVbaChart::setHasTitle( ::sal_Bool bTitle ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -844,10 +844,10 @@ ScVbaChart::setHasTitle( ::sal_Bool bTitle ) throw (script::BasicErrorException, { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } - + } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaChart::getHasLegend( ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Bool bHasLegend = sal_False; @@ -862,7 +862,7 @@ ScVbaChart::getHasLegend( ) throw (script::BasicErrorException, uno::RuntimeExc return bHasLegend; } -void SAL_CALL +void SAL_CALL ScVbaChart::setHasLegend( ::sal_Bool bLegend ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -875,15 +875,15 @@ ScVbaChart::setHasLegend( ::sal_Bool bLegend ) throw (script::BasicErrorExceptio } } -uno::Reference< excel::XChartTitle > SAL_CALL +uno::Reference< excel::XChartTitle > SAL_CALL ScVbaChart::getChartTitle( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< drawing::XShape > xTitleShape = mxChartDocument->getTitle(); // #TODO check parent - return new ScVbaChartTitle(this, mxContext, xTitleShape); + return new ScVbaChartTitle(this, mxContext, xTitleShape); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaChart::Axes( const uno::Any& Type, const uno::Any& AxisGroup ) throw (script::BasicErrorException, uno::RuntimeException) { // mmm chart probably is the parent, #TODO check parent @@ -899,7 +899,7 @@ ScVbaChart::is3D() throw ( uno::RuntimeException ) sal_Bool is3d = sal_False; mxDiagramPropertySet->getPropertyValue(DIM3D) >>= is3d; return is3d; -} +} sal_Int32 ScVbaChart::getStackedType( sal_Int32 _nStacked, sal_Int32 _n100PercentStacked, sal_Int32 _nUnStacked ) throw ( uno::RuntimeException ) @@ -934,7 +934,7 @@ ScVbaChart::is100PercentStacked() throw ( uno::RuntimeException ) return b100Percent; } -sal_Int32 +sal_Int32 ScVbaChart::getSolidType(sal_Int32 _nDeep, sal_Int32 _nVertiStacked, sal_Int32 _nVerti100PercentStacked, sal_Int32 _nVertiUnStacked, sal_Int32 _nHoriStacked, sal_Int32 _nHori100PercentStacked, sal_Int32 _nHoriUnStacked) throw ( script::BasicErrorException ) { sal_Bool bIsVertical = true; @@ -967,7 +967,7 @@ ScVbaChart::getSolidType(sal_Int32 _nDeep, sal_Int32 _nVertiStacked, sal_Int32 _ } -sal_Int32 +sal_Int32 ScVbaChart::getStockUpDownValue(sal_Int32 _nUpDown, sal_Int32 _nNotUpDown) throw (script::BasicErrorException) { sal_Bool bUpDown = sal_False; @@ -986,12 +986,12 @@ ScVbaChart::getStockUpDownValue(sal_Int32 _nUpDown, sal_Int32 _nNotUpDown) throw catch (uno::Exception& ) { rtl::OUString aTemp; // temporary needed for g++ 3.3.5 - script::BasicErrorException( aTemp, uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); + script::BasicErrorException( aTemp, uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } return _nNotUpDown; } -bool +bool ScVbaChart::hasMarkers() throw ( script::BasicErrorException ) { bool bHasMarkers = false; @@ -1004,12 +1004,12 @@ ScVbaChart::hasMarkers() throw ( script::BasicErrorException ) catch ( uno::Exception& ) { rtl::OUString aTemp; // temporary needed for g++ 3.3.5 - script::BasicErrorException( aTemp, uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); + script::BasicErrorException( aTemp, uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } return bHasMarkers; } -sal_Int32 +sal_Int32 ScVbaChart::getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( script::BasicErrorException ) { if (hasMarkers()) @@ -1017,7 +1017,7 @@ ScVbaChart::getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) t return _nWithoutMarkers; } -void +void ScVbaChart::assignDiagramAttributes() { xAxisXSupplier.set( mxDiagramPropertySet, uno::UNO_QUERY_THROW ); @@ -1049,8 +1049,8 @@ ScVbaChart::isSeriesIndexValid(sal_Int32 _seriesindex) throw( script::BasicError bret = true; } } - } - catch (uno::Exception& ) + } + catch (uno::Exception& ) { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } @@ -1093,9 +1093,9 @@ ScVbaChart::setSeriesName(sal_Int32 _index, rtl::OUString _sname) throw ( script } } -sal_Int32 +sal_Int32 ScVbaChart::getSeriesCount() throw ( script::BasicErrorException ) -{ +{ uno::Reference< chart::XChartDataArray > xChartDataArray( mxChartDocument->getData(), uno::UNO_QUERY_THROW ); if (getPlotBy() == xlRows) @@ -1118,10 +1118,10 @@ ScVbaChart::getSeriesName(sal_Int32 _index) throw ( script::BasicErrorException sDescriptions = xChartDataArray->getColumnDescriptions(); sName = sDescriptions[_index]; } - return sName; + return sName; } -double +double ScVbaChart::getValue(sal_Int32 _seriesindex, sal_Int32 _valindex) throw ( script::BasicErrorException ) { double result = -1.0; @@ -1135,7 +1135,7 @@ ScVbaChart::getValue(sal_Int32 _seriesindex, sal_Int32 _valindex) throw ( script return result; } -sal_Int32 +sal_Int32 ScVbaChart::getValuesCount(sal_Int32 _seriesIndex) throw ( script::BasicErrorException ) { sal_Int32 nCount = 0; @@ -1148,11 +1148,11 @@ ScVbaChart::getValuesCount(sal_Int32 _seriesIndex) throw ( script::BasicErrorExc else nCount = dblValues.getLength(); } - return nCount; + return nCount; } -uno::Reference< excel::XDataLabels > +uno::Reference< excel::XDataLabels > ScVbaChart::DataLabels( const uno::Reference< ov::excel::XSeries > /*_oSeries*/ ) throw ( css::script::BasicErrorException ) { if ( true ) @@ -1161,7 +1161,7 @@ ScVbaChart::DataLabels( const uno::Reference< ov::excel::XSeries > /*_oSeries*/ return uno::Reference< excel::XDataLabels > (); } -bool +bool ScVbaChart::getHasDataCaption( const uno::Reference< css::beans::XPropertySet >& _xPropertySet )throw ( script::BasicErrorException ) { bool bResult = false; @@ -1170,15 +1170,15 @@ ScVbaChart::getHasDataCaption( const uno::Reference< css::beans::XPropertySet >& sal_Int32 nChartDataCaption = 0; _xPropertySet->getPropertyValue(DATACAPTION) >>= nChartDataCaption; bResult = (nChartDataCaption != chart::ChartDataCaption::NONE); - } - catch (uno::Exception& ) + } + catch (uno::Exception& ) { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } return bResult; } -void +void ScVbaChart::setHasDataCaption( const uno::Reference< beans::XPropertySet >& _xPropertySet, bool _bHasDataLabels )throw ( script::BasicErrorException ) { try @@ -1187,14 +1187,14 @@ ScVbaChart::setHasDataCaption( const uno::Reference< beans::XPropertySet >& _xPr _xPropertySet->setPropertyValue(DATACAPTION, uno::makeAny ( chart::ChartDataCaption::VALUE) ); else _xPropertySet->setPropertyValue(DATACAPTION, uno::makeAny ( chart::ChartDataCaption::NONE) ); - } - catch (uno::Exception& ) + } + catch (uno::Exception& ) { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } } -uno::Reference< beans::XPropertySet > +uno::Reference< beans::XPropertySet > ScVbaChart::getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup) throw ( script::BasicErrorException ) { assignDiagramAttributes(); @@ -1226,7 +1226,7 @@ ScVbaChart::getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup) thro xAxisProps = xTwoAxisYSupplier->getSecondaryYAxis(); break; default: - return xAxisProps; + return xAxisProps; } return xAxisProps; } @@ -1239,7 +1239,7 @@ ScVbaChart::getServiceImplName() return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaChart::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbachart.hxx b/sc/source/ui/vba/vbachart.hxx index d0b53c34421f..98d931c4eb59 100644 --- a/sc/source/ui/vba/vbachart.hxx +++ b/sc/source/ui/vba/vbachart.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ typedef InheritedHelperInterfaceImpl1<ov::excel::XChart > ChartImpl_BASE; class ScVbaChart : public ChartImpl_BASE -{ +{ friend class ScVbaAxis; css::uno::Reference< css::chart::XChartDocument > mxChartDocument; @@ -66,7 +66,7 @@ friend class ScVbaAxis; sal_Int32 getSolidType(sal_Int32 _nDeep, sal_Int32 _nVertiStacked, sal_Int32 _nVerti100PercentStacked, sal_Int32 _nVertiUnStacked, sal_Int32 _nHoriStacked, sal_Int32 _nHori100PercentStacked, sal_Int32 _nHoriUnStacked) throw ( css::script::BasicErrorException ); sal_Int32 getStockUpDownValue(sal_Int32 _nUpDown, sal_Int32 _nNotUpDown) throw (css::script::BasicErrorException); bool hasMarkers() throw ( css::script::BasicErrorException ); - sal_Int32 getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( css::script::BasicErrorException ); + sal_Int32 getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( css::script::BasicErrorException ); void assignDiagramAttributes(); void setDefaultSeriesDescriptionLabels(){} public: @@ -92,7 +92,7 @@ public: virtual css::uno::Any SAL_CALL SeriesCollection(const css::uno::Any&) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getChartType() throw ( css::uno::RuntimeException, css::script::BasicErrorException); virtual void SAL_CALL setChartType( ::sal_Int32 _charttype ) throw ( css::uno::RuntimeException, css::script::BasicErrorException); - virtual void SAL_CALL Activate( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual void SAL_CALL Activate( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL setSourceData( const css::uno::Reference< ::ooo::vba::excel::XRange >& range, const css::uno::Any& PlotBy ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL Location( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getLocation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx index 617a090b6d7a..3d4180266ee6 100644 --- a/sc/source/ui/vba/vbachartobject.cxx +++ b/sc/source/ui/vba/vbachartobject.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ const rtl::OUString PERSIST_NAME( RTL_CONSTASCII_USTRINGPARAM("PersistName") ); ScVbaChartObject::ScVbaChartObject( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableChart >& _xTableChart, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier ) : ChartObjectImpl_BASE( _xParent, _xContext ), xTableChart( _xTableChart ), xDrawPageSupplier( _xDrawPageSupplier ) { - xDrawPage = xDrawPageSupplier->getDrawPage(); + xDrawPage = xDrawPageSupplier->getDrawPage(); xEmbeddedObjectSupplier.set( xTableChart, uno::UNO_QUERY_THROW ); xNamed.set( xTableChart, uno::UNO_QUERY_THROW ); sPersistName = getPersistName(); @@ -57,7 +57,7 @@ rtl::OUString ScVbaChartObject::getPersistName() return sPersistName; } -uno::Reference< drawing::XShape > +uno::Reference< drawing::XShape > ScVbaChartObject::setShape() throw ( script::BasicErrorException ) { try @@ -86,14 +86,14 @@ ScVbaChartObject::setShape() throw ( script::BasicErrorException ) return NULL; } -void SAL_CALL +void SAL_CALL ScVbaChartObject::setName( const rtl::OUString& sName ) throw (css::uno::RuntimeException) { xNamedShape->setName(sName); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaChartObject::getName() throw (css::uno::RuntimeException) { return xNamedShape->getName(); @@ -106,19 +106,19 @@ ScVbaChartObject::Delete() throw ( css::script::BasicErrorException ) uno::Reference< excel::XWorksheet > xParent( getParent(), uno::UNO_QUERY_THROW ); uno::Reference< excel::XChartObjects > xColl( xParent->ChartObjects( uno::Any() ), uno::UNO_QUERY_THROW ); ScVbaChartObjects* pChartObjectsImpl = static_cast< ScVbaChartObjects* >( xColl.get() ); - if (pChartObjectsImpl) + if (pChartObjectsImpl) pChartObjectsImpl->removeByName( getPersistName() ); - else + else throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent is not ChartObjects" ) ) ); } - -void + +void ScVbaChartObject::Activate() throw ( script::BasicErrorException ) { try { // #TODO #FIXME should be ThisWorkbook or equivelant, or in - // fact probably the chart object should be created with + // fact probably the chart object should be created with // the XModel owner //uno::Reference< view::XSelectionSupplier > xSelectionSupplier( getXModel().getCurrentController()); uno::Reference< view::XSelectionSupplier > xSelectionSupplier( getCurrentExcelDoc(mxContext)->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -130,20 +130,20 @@ ScVbaChartObject::Activate() throw ( script::BasicErrorException ) } } -uno::Reference< excel::XChart > SAL_CALL +uno::Reference< excel::XChart > SAL_CALL ScVbaChartObject::getChart() throw (css::uno::RuntimeException) { return new ScVbaChart( this, mxContext, xEmbeddedObjectSupplier->getEmbeddedObject(), xTableChart ); } -rtl::OUString& +rtl::OUString& ScVbaChartObject::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaChartObject") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaChartObject::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -155,56 +155,56 @@ ScVbaChartObject::getServiceNames() return aServiceNames; } -double +double ScVbaChartObject::getHeight() { return oShapeHelper->getHeight(); } -void +void ScVbaChartObject::setHeight(double _fheight) throw ( script::BasicErrorException ) { oShapeHelper->setHeight(_fheight); } - -double + +double ScVbaChartObject::getWidth() { return oShapeHelper->getWidth(); } -void +void ScVbaChartObject::setWidth(double _fWidth) throw ( script::BasicErrorException ) { oShapeHelper->setWidth(_fWidth); } - -double + +double ScVbaChartObject::getLeft() { return oShapeHelper->getLeft(); } -void +void ScVbaChartObject::setLeft(double _fLeft) { oShapeHelper->setLeft(_fLeft); } - -double + +double ScVbaChartObject::getTop() { return oShapeHelper->getTop(); -} +} -void +void ScVbaChartObject::setTop(double _fTop) { oShapeHelper->setTop(_fTop); } -uno::Reference< uno::XInterface > -ScVbaChartObject::getUnoObject() throw (script::BasicErrorException) +uno::Reference< uno::XInterface > +ScVbaChartObject::getUnoObject() throw (script::BasicErrorException) { return uno::Reference< uno::XInterface >( xShape, uno::UNO_QUERY ); } diff --git a/sc/source/ui/vba/vbachartobject.hxx b/sc/source/ui/vba/vbachartobject.hxx index 3c1e224728ee..ff2a80305ec5 100644 --- a/sc/source/ui/vba/vbachartobject.hxx +++ b/sc/source/ui/vba/vbachartobject.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ typedef InheritedHelperInterfaceImpl1<ov::excel::XChartObject > ChartObjectImpl_BASE; class ScVbaChartObject : public ChartObjectImpl_BASE -{ +{ css::uno::Reference< css::table::XTableChart > xTableChart; css::uno::Reference< css::document::XEmbeddedObjectSupplier > xEmbeddedObjectSupplier; @@ -58,8 +58,8 @@ public: virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); virtual void SAL_CALL setName( const ::rtl::OUString& sName ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XChart > SAL_CALL getChart() throw (css::uno::RuntimeException); - virtual void SAL_CALL Delete() throw ( css::script::BasicErrorException ); - virtual void Activate() throw ( css::script::BasicErrorException ); + virtual void SAL_CALL Delete() throw ( css::script::BasicErrorException ); + virtual void Activate() throw ( css::script::BasicErrorException ); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx index 5117cfd75858..cb5a669d945e 100644 --- a/sc/source/ui/vba/vbachartobjects.cxx +++ b/sc/source/ui/vba/vbachartobjects.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,12 +47,12 @@ using namespace ::ooo::vba; class ChartObjectEnumerationImpl : public EnumerationHelperImpl { uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier; - + public: ChartObjectEnumerationImpl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, const uno::Reference< drawing::XDrawPageSupplier >& _xDrawPageSupplier, const uno::Reference< XHelperInterface >& _xParent ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( _xParent, xContext, xEnumeration ), xDrawPageSupplier( _xDrawPageSupplier ) {} - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { uno::Reference< table::XTableChart > xTableChart( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); // parent Object is sheet return uno::makeAny( uno::Reference< excel::XChartObject > ( new ScVbaChartObject( m_xParent, m_xContext, xTableChart, xDrawPageSupplier ) ) ); @@ -83,10 +83,10 @@ ScVbaChartObjects::getChartObjectNames() throw( css::script::BasicErrorException ScDocShell* pDocShell = NULL; if ( !pUno ) throw uno::RuntimeException( rtl::OUString::createFromAscii("Failed to obtain the impl class from the drawpage"), uno::Reference< uno::XInterface >() ); - pDocShell = pUno->GetDocShell(); + pDocShell = pUno->GetDocShell(); if ( !pDocShell ) throw uno::RuntimeException( rtl::OUString::createFromAscii("Failed to obtain the docshell implclass"), uno::Reference< uno::XInterface >() ); - + uno::Reference< sheet::XSpreadsheetDocument > xSpreadsheetDocument( pDocShell->GetModel(), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XSpreadsheets > xSpreadsheets = xSpreadsheetDocument->getSheets(); std::vector< rtl::OUString > aChartNamesVector; @@ -106,8 +106,8 @@ ScVbaChartObjects::getChartObjectNames() throw( css::script::BasicErrorException std::vector< rtl::OUString > ::const_iterator it_end = aChartNamesVector.end(); for ( sal_Int32 index = 0 ; it != it_end; ++it, ++index ) sChartNames[index] = *it; - } - catch (uno::Exception& ) + } + catch (uno::Exception& ) { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } @@ -115,25 +115,25 @@ ScVbaChartObjects::getChartObjectNames() throw( css::script::BasicErrorException } // XChartObjects -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaChartObjects::Add( double _nX, double _nY, double _nWidth, double _nHeight ) throw (script::BasicErrorException) { - try + try { uno::Sequence< table::CellRangeAddress > aCellRangeAddress( 1 ); awt::Rectangle aRectangle; aRectangle.X = Millimeter::getInHundredthsOfOneMillimeter(_nX); aRectangle.Y = Millimeter::getInHundredthsOfOneMillimeter(_nY); aRectangle.Width = Millimeter::getInHundredthsOfOneMillimeter(_nWidth); - aRectangle.Height = Millimeter::getInHundredthsOfOneMillimeter(_nHeight); + aRectangle.Height = Millimeter::getInHundredthsOfOneMillimeter(_nHeight); // Note the space at the end of the stem ("Chart "). In ChartSheets only "Chart" is the stem rtl::OUString sPersistChartName = ContainerUtilities::getUniqueName( getChartObjectNames(), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Chart " ) ) , rtl::OUString(), 1); xTableCharts->addNewByName(sPersistChartName, aRectangle, aCellRangeAddress, true, false ); - uno::Reference< excel::XChartObject > xChartObject( getItemByStringIndex( sPersistChartName ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XChartObject > xChartObject( getItemByStringIndex( sPersistChartName ), uno::UNO_QUERY_THROW ); xChartObject->getChart()->setChartType(excel::XlChartType::xlColumnClustered); return uno::makeAny( xChartObject ); - } - catch ( uno::Exception& ex) + } + catch ( uno::Exception& ex) { OSL_TRACE("AddItem caught exception ->%s", rtl::OUStringToOString( ex.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); } @@ -158,7 +158,7 @@ ScVbaChartObjects::createEnumeration() throw (uno::RuntimeException) // XElementAccess -uno::Type +uno::Type ScVbaChartObjects::getElementType() throw (uno::RuntimeException) { return excel::XChartObject::static_type(0); @@ -167,20 +167,20 @@ ScVbaChartObjects::getElementType() throw (uno::RuntimeException) // ScVbaCollectionBaseImpl uno::Any ScVbaChartObjects::createCollectionObject( const css::uno::Any& aSource ) -{ +{ uno::Reference< table::XTableChart > xTableChart( aSource, uno::UNO_QUERY_THROW ); // correct parent object is sheet return uno::makeAny( uno::Reference< excel::XChartObject > ( new ScVbaChartObject( getParent(), mxContext, xTableChart, xDrawPageSupplier ) ) ); } -rtl::OUString& +rtl::OUString& ScVbaChartObjects::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaChartObjects") ); return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaChartObjects::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbachartobjects.hxx b/sc/source/ui/vba/vbachartobjects.hxx index 80ea038bb15d..2427f6b06331 100644 --- a/sc/source/ui/vba/vbachartobjects.hxx +++ b/sc/source/ui/vba/vbachartobjects.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,14 +39,14 @@ typedef CollTestImplHelper< ov::excel::XChartObjects > ChartObjects_BASE; /* #TODO see if this hash table is 'really' necessary -typedef ::std::hash_map< ::rtl::OUString, +typedef ::std::hash_map< ::rtl::OUString, css::uno::Reference< ov::excel::XChartObject >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > aHashTable; */ class ScVbaChartObjects : public ChartObjects_BASE -{ +{ css::uno::Reference< css::table::XTableCharts > xTableCharts; css::uno::Reference< css::drawing::XDrawPageSupplier > xDrawPageSupplier; @@ -65,8 +65,8 @@ public: virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); // XElementAccess virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); - // ScVbaCollectionBaseImpl - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + // ScVbaCollectionBaseImpl + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); // ChartObjects_BASE virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbacharts.cxx b/sc/source/ui/vba/vbacharts.cxx index da0c7789134b..c11e6786f71b 100644 --- a/sc/source/ui/vba/vbacharts.cxx +++ b/sc/source/ui/vba/vbacharts.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,33 +38,33 @@ ScVbaCharts::ScVbaCharts( const css::uno::Reference< ov::XHelperInterface >& _xP xSpreadsheetDocument.set( xComponent, uno::UNO_QUERY_THROW ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaCharts::Add() throw (css::script::BasicErrorException, css::uno::RuntimeException) { // Not implemented in the helperapi ( see ChartsImpl.java ) if ( true ) - throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() ); + throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() ); return aNULL(); } -uno::Reference< excel::XChart > SAL_CALL +uno::Reference< excel::XChart > SAL_CALL ScVbaCharts::getActiveChart() throw (script::BasicErrorException, uno::RuntimeException) { return xActiveChart; } -uno::Reference< container::XEnumeration > SAL_CALL +uno::Reference< container::XEnumeration > SAL_CALL ScVbaCharts::createEnumeration() throw (uno::RuntimeException) { // #FIXME not implemented if ( true ) - throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() ); + throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() ); return uno::Reference< container::XEnumeration >(); } // #FIXME #TODO this method shouldn't appear in this class directly // a XIndexAccess/XNameAccess wrapper should be passed to the base class instead -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaCharts::getCount() throw (uno::RuntimeException) { sal_Int32 ncount = 0; @@ -87,14 +87,14 @@ ScVbaCharts::getCount() throw (uno::RuntimeException) { throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); } - return ncount; + return ncount; } uno::Any ScVbaCharts::createCollectionObject( const uno::Any& aSource ) { if ( true ) - throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() ); + throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() ); // #TODO implementation please return aSource; } @@ -106,7 +106,7 @@ ScVbaCharts::getServiceImplName() return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaCharts::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbacharts.hxx b/sc/source/ui/vba/vbacharts.hxx index b2ecfe23270f..621c5ad9bff0 100644 --- a/sc/source/ui/vba/vbacharts.hxx +++ b/sc/source/ui/vba/vbacharts.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ typedef CollTestImplHelper< ov::excel::XCharts > Charts_BASE; class ScVbaCharts : public Charts_BASE -{ +{ css::uno::Reference< ov::excel::XChart > xActiveChart; css::uno::Reference< css::sheet::XSpreadsheetDocument > xSpreadsheetDocument; css::uno::Reference< css::lang::XComponent > xComponent; @@ -50,11 +50,11 @@ public: virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); // XElementAccess virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) { return ov::excel::XChart::static_type(0); } - // ScVbaCollectionBaseImpl - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + // ScVbaCollectionBaseImpl + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); // Charts_BASE or HelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; -#endif +#endif diff --git a/sc/source/ui/vba/vbacharttitle.cxx b/sc/source/ui/vba/vbacharttitle.cxx index e797c4a0269e..b6e5f5e5ef1a 100644 --- a/sc/source/ui/vba/vbacharttitle.cxx +++ b/sc/source/ui/vba/vbacharttitle.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ ScVbaChartTitle::getServiceImplName() return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaChartTitle::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbacharttitle.hxx b/sc/source/ui/vba/vbacharttitle.hxx index 4d6ed34a86b6..994fd3fe1199 100644 --- a/sc/source/ui/vba/vbacharttitle.hxx +++ b/sc/source/ui/vba/vbacharttitle.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx index 9c50a25b8b7c..797b0806dadb 100644 --- a/sc/source/ui/vba/vbacomment.cxx +++ b/sc/source/ui/vba/vbacomment.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -92,7 +92,7 @@ ScVbaComment::getAnnotationIndex() throw (uno::RuntimeException) { uno::Reference< sheet::XSheetAnnotation > xAnno( xAnnos->getByIndex( aIndex ), uno::UNO_QUERY_THROW ); table::CellAddress xAddress = xAnno->getPosition(); - + if ( xAddress.Column == aAddress.Column && xAddress.Row == aAddress.Row && xAddress.Sheet == aAddress.Sheet ) { OSL_TRACE("** terminating search, index is %d", aIndex ); @@ -219,14 +219,14 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An return sAnnoText; } -rtl::OUString& +rtl::OUString& ScVbaComment::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaComment") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaComment::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbacomment.hxx b/sc/source/ui/vba/vbacomment.hxx index 4a7d2fab91ef..59d9e45ba719 100644 --- a/sc/source/ui/vba/vbacomment.hxx +++ b/sc/source/ui/vba/vbacomment.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx index 7a6d3d774937..13036e2b2597 100644 --- a/sc/source/ui/vba/vbacomments.cxx +++ b/sc/source/ui/vba/vbacomments.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,7 +59,7 @@ public: {} virtual uno::Any SAL_CALL nextElement() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + { return AnnotationToComment( m_xEnumeration->nextElement(), m_xContext, mxModel ); } @@ -90,20 +90,20 @@ ScVbaComments::createCollectionObject( const css::uno::Any& aSource ) return AnnotationToComment( aSource, mxContext, mxModel ); } -uno::Type +uno::Type ScVbaComments::getElementType() throw (uno::RuntimeException) { return excel::XComment::static_type(0); } -rtl::OUString& +rtl::OUString& ScVbaComments::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaComments") ); return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaComments::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbacomments.hxx b/sc/source/ui/vba/vbacomments.hxx index 2f98e5b71897..b787f10c600c 100644 --- a/sc/source/ui/vba/vbacomments.hxx +++ b/sc/source/ui/vba/vbacomments.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,7 +53,7 @@ public: virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); // ScVbaComments_BASE - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbacondition.cxx b/sc/source/ui/vba/vbacondition.cxx index 590d649ae561..89e892e35368 100644 --- a/sc/source/ui/vba/vbacondition.cxx +++ b/sc/source/ui/vba/vbacondition.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,16 +39,16 @@ const sal_Int32 ISFORMULA = 98765432; template< typename Ifc1 > ScVbaCondition< Ifc1 >::ScVbaCondition( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< sheet::XSheetCondition >& _xSheetCondition ) : ScVbaCondition_BASE( xParent, xContext ), mxSheetCondition( _xSheetCondition ) { - mxAddressable.set( xParent, uno::UNO_QUERY_THROW ); + mxAddressable.set( xParent, uno::UNO_QUERY_THROW ); } template< typename Ifc1 > -sheet::ConditionOperator +sheet::ConditionOperator ScVbaCondition< Ifc1 >::retrieveAPIOperator( const uno::Any& _aOperator) throw ( script::BasicErrorException ) { sheet::ConditionOperator aRetAPIOperator = sheet::ConditionOperator_NONE; sal_Int32 nOperator = 0; - if ( (_aOperator >>= nOperator ) ) + if ( (_aOperator >>= nOperator ) ) { switch(nOperator) { @@ -85,21 +85,21 @@ ScVbaCondition< Ifc1 >::retrieveAPIOperator( const uno::Any& _aOperator) throw ( } template< typename Ifc1 > -rtl::OUString +rtl::OUString ScVbaCondition< Ifc1 >::Formula1( ) throw ( script::BasicErrorException, uno::RuntimeException ) { return mxSheetCondition->getFormula1(); } template< typename Ifc1 > -rtl::OUString +rtl::OUString ScVbaCondition< Ifc1 >::Formula2( ) throw ( script::BasicErrorException, uno::RuntimeException ) { return mxSheetCondition->getFormula2(); } template< typename Ifc1 > -void +void ScVbaCondition< Ifc1 >::setFormula1( const uno::Any& _aFormula1) throw ( script::BasicErrorException ) { rtl::OUString sFormula; @@ -113,18 +113,18 @@ ScVbaCondition< Ifc1 >::setFormula1( const uno::Any& _aFormula1) throw ( script: } template< typename Ifc1 > -void +void ScVbaCondition< Ifc1 >::setFormula2( const uno::Any& _aFormula2) throw ( script::BasicErrorException ) { rtl::OUString sFormula2; - // #TODO surely this can't be right? + // #TODO surely this can't be right? // ( from helperapi/impl/.../calc/ConditionImpl.java if ( (_aFormula2 >>= sFormula2 )) mxSheetCondition->setFormula1(sFormula2); } template< typename Ifc1 > -sal_Int32 +sal_Int32 ScVbaCondition< Ifc1 >::Operator(sal_Bool _bIncludeFormulaValue) throw ( script::BasicErrorException ) { sal_Int32 retvalue = -1; @@ -159,13 +159,13 @@ ScVbaCondition< Ifc1 >::Operator(sal_Bool _bIncludeFormulaValue) throw ( script: if (_bIncludeFormulaValue) { //#FIXME huh what's this all about - // from helperapi/impl/.../calc/ConditionImpl + // from helperapi/impl/.../calc/ConditionImpl retvalue = ISFORMULA; break; } case sheet::ConditionOperator_NONE: default: - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Operator not supported"))); + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Operator not supported"))); break; } return retvalue; diff --git a/sc/source/ui/vba/vbacondition.hxx b/sc/source/ui/vba/vbacondition.hxx index 36052fe217ee..f22cc6a30517 100644 --- a/sc/source/ui/vba/vbacondition.hxx +++ b/sc/source/ui/vba/vbacondition.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -26,8 +26,8 @@ ************************************************************************/ #ifndef SC_VBA_CONDITION_HXX #define SC_VBA_CONDITION_HXX -#include <com/sun/star/sheet/XSheetCondition.hpp> -#include <com/sun/star/sheet/XCellRangeAddressable.hpp> +#include <com/sun/star/sheet/XSheetCondition.hpp> +#include <com/sun/star/sheet/XCellRangeAddressable.hpp> #include <vbahelper/vbahelperinterface.hxx> #include <com/sun/star/sheet/ConditionOperator.hpp> @@ -49,6 +49,6 @@ public: virtual void setFormula2( const css::uno::Any& _aFormula2) throw ( css::script::BasicErrorException ); virtual sal_Int32 Operator(sal_Bool _bIncludeFormulaValue) throw ( css::script::BasicErrorException ); virtual sal_Int32 SAL_CALL Operator() throw ( css::script::BasicErrorException, css::uno::RuntimeException ) = 0; - + }; -#endif +#endif diff --git a/sc/source/ui/vba/vbadialog.cxx b/sc/source/ui/vba/vbadialog.cxx index 3c578a04e5d0..891ac75af4b2 100644 --- a/sc/source/ui/vba/vbadialog.cxx +++ b/sc/source/ui/vba/vbadialog.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,12 +55,12 @@ static const rtl::OUString aStringList[]= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) }; const sal_Int32 nDialogSize = sizeof( aStringList ) / sizeof( aStringList[ 0 ] ); -rtl::OUString +rtl::OUString ScVbaDialog::mapIndexToName( sal_Int32 nIndex ) { if( nIndex < nDialogSize ) @@ -68,14 +68,14 @@ ScVbaDialog::mapIndexToName( sal_Int32 nIndex ) return rtl::OUString(); } -rtl::OUString& +rtl::OUString& ScVbaDialog::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaDialog") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaDialog::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbadialog.hxx b/sc/source/ui/vba/vbadialog.hxx index 40f4a4a83a11..a886fe3cff43 100644 --- a/sc/source/ui/vba/vbadialog.hxx +++ b/sc/source/ui/vba/vbadialog.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbadialogs.cxx b/sc/source/ui/vba/vbadialogs.cxx index 67070879535b..16d3dcba03f1 100644 --- a/sc/source/ui/vba/vbadialogs.cxx +++ b/sc/source/ui/vba/vbadialogs.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,14 +45,14 @@ ScVbaDialogs::Item( const uno::Any &aItem ) throw (uno::RuntimeException) return uno::Any( aDialog ); } -rtl::OUString& +rtl::OUString& ScVbaDialogs::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaDialogs") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaDialogs::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbadialogs.hxx b/sc/source/ui/vba/vbadialogs.hxx index 9aab5daf11fe..20fae2d27118 100644 --- a/sc/source/ui/vba/vbadialogs.hxx +++ b/sc/source/ui/vba/vbadialogs.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ typedef cppu::ImplInheritanceHelper1< VbaDialogsBase, ov::excel::XDialogs > ScVb class ScVbaDialogs : public ScVbaDialogs_BASE { public: - ScVbaDialogs( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): ScVbaDialogs_BASE( xParent, xContext, xModel ) {} + ScVbaDialogs( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): ScVbaDialogs_BASE( xParent, xContext, xModel ) {} virtual ~ScVbaDialogs() {} // XCollection diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index 45667adf2f2c..bd71c9eb3c35 100755 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -383,7 +383,7 @@ ScVbaEventsHelper::ScVbaEventsHelper( const uno::Sequence< uno::Any >& rArgs, co { mpDocShell = dynamic_cast< ScDocShell* >( mpShell ); // mpShell from base class mpDoc = mpDocShell ? mpDocShell->GetDocument() : 0; - + if( !mxModel.is() || !mpDocShell || !mpDoc ) return; @@ -683,7 +683,7 @@ uno::Any ScVbaEventsHelper::createWorksheet( const uno::Sequence< uno::Any >& rA // extract sheet index, will throw, if parameter is invalid SCTAB nTab = getTabFromArgs( rArgs, nIndex ); - + // create Workbook uno::Sequence< uno::Any > aArgs( 2 ); aArgs[ 0 ] <<= uno::Reference< uno::XInterface >(); diff --git a/sc/source/ui/vba/vbaeventshelper.hxx b/sc/source/ui/vba/vbaeventshelper.hxx index a77f5128b3e9..dd704a1415f2 100755 --- a/sc/source/ui/vba/vbaeventshelper.hxx +++ b/sc/source/ui/vba/vbaeventshelper.hxx @@ -49,7 +49,7 @@ public: // XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& rSource ) throw (css::uno::RuntimeException); - + protected: virtual bool implEventsEnabled() throw (css::uno::RuntimeException); virtual bool implPrepareEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::uno::RuntimeException); @@ -73,7 +73,7 @@ private: css::uno::Any createHyperlink( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) const throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); /** Creates a VBA Window object. */ css::uno::Any createWindow() const throw (css::uno::RuntimeException); - + private: mutable css::uno::WeakReference< ov::excel::XApplication > mxApplication; ::rtl::Reference< ScVbaEventsListener > mxListener; diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 5894d3ea8c71..02dbf74bffcd 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,7 +56,7 @@ ScVbaFont::ScVbaFont( { } -SfxItemSet* +SfxItemSet* ScVbaFont::GetDataSet() { return mpRangeObj ? excel::ScVbaCellRangeAccess::GetDataSet( mpRangeObj ) : 0; @@ -77,7 +77,7 @@ uno::Reference< beans::XPropertySet > lcl_TextProperties( uno::Reference< table: void SAL_CALL ScVbaFont::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeException ) { - // #FIXEME create some sort of generic get/set code where + // #FIXEME create some sort of generic get/set code where // you can pass a functor // get/set - Super/sub script code is exactly the same // except for the call applied at each cell position @@ -316,7 +316,7 @@ ScVbaFont::setFontStyle( const uno::Any& aValue ) throw( uno::RuntimeException ) rtl::OUString aToken = aStyles.getToken( 0, ' ', nIndex ); aTokens.push_back( aToken ); }while( nIndex >= 0 ); - + std::vector< rtl::OUString >::iterator it; for( it = aTokens.begin(); it != aTokens.end(); ++it ) { @@ -340,7 +340,7 @@ ScVbaFont::getFontStyle() throw ( uno::RuntimeException ) getBold() >>= bValue; if( bValue ) aStyles.appendAscii("Bold"); - + getItalic() >>= bValue; if( bValue ) { diff --git a/sc/source/ui/vba/vbafont.hxx b/sc/source/ui/vba/vbafont.hxx index 3ef52c6d240f..b800bf338d73 100644 --- a/sc/source/ui/vba/vbafont.hxx +++ b/sc/source/ui/vba/vbafont.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx index d08451af63f4..c9df5c256a00 100644 --- a/sc/source/ui/vba/vbaformat.cxx +++ b/sc/source/ui/vba/vbaformat.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ ScVbaFormat< Ifc1 >::ScVbaFormat( const uno::Reference< XHelperInterface >& xPar mxServiceInfo.set( mxPropertySet, uno::UNO_QUERY_THROW ); if ( !mxModel.is() ) DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XModel Interface could not be retrieved") ) ); - mxNumberFormatsSupplier.set( mxModel, uno::UNO_QUERY_THROW ); + mxNumberFormatsSupplier.set( mxModel, uno::UNO_QUERY_THROW ); } catch (uno::Exception& ) { @@ -74,16 +74,16 @@ ScVbaFormat< Ifc1 >::ScVbaFormat( const uno::Reference< XHelperInterface >& xPar } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setVerticalAlignment( const uno::Any& _oAlignment) throw (script::BasicErrorException, uno::RuntimeException) { - try + try { uno::Any aVal; sal_Int32 nAlignment = 0; if ( !(_oAlignment >>= nAlignment )) throw uno::RuntimeException(); - switch (nAlignment) + switch (nAlignment) { case excel::XlVAlign::xlVAlignBottom : aVal = uno::makeAny( table::CellVertJustify_BOTTOM ); @@ -95,12 +95,12 @@ ScVbaFormat<Ifc1>::setVerticalAlignment( const uno::Any& _oAlignment) throw (s case excel::XlVAlign::xlVAlignJustify: aVal = uno::makeAny( table::CellVertJustify_STANDARD ); break; - + case excel::XlVAlign::xlVAlignTop: aVal = uno::makeAny( table::CellVertJustify_TOP); break; default: - aVal = uno::makeAny( table::CellVertJustify_STANDARD ); + aVal = uno::makeAny( table::CellVertJustify_STANDARD ); break; } mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLVJUS ) ), aVal ); @@ -112,7 +112,7 @@ ScVbaFormat<Ifc1>::setVerticalAlignment( const uno::Any& _oAlignment) throw (s } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getVerticalAlignment( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any aResult = aNULL(); @@ -149,10 +149,10 @@ ScVbaFormat<Ifc1>::getVerticalAlignment( ) throw (script::BasicErrorException, } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setHorizontalAlignment( const uno::Any& HorizontalAlignment ) throw (script::BasicErrorException, uno::RuntimeException) { - try + try { uno::Any aVal; sal_Int32 nAlignment = 0; @@ -189,7 +189,7 @@ ScVbaFormat<Ifc1>::setHorizontalAlignment( const uno::Any& HorizontalAlignment ) } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getHorizontalAlignment( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any NRetAlignment = aNULL(); @@ -199,7 +199,7 @@ ScVbaFormat<Ifc1>::getHorizontalAlignment( ) throw (script::BasicErrorException if (!isAmbiguous(sHoriJust)) { table::CellHoriJustify aAPIAlignment = table::CellHoriJustify_BLOCK; - + if ( mxPropertySet->getPropertyValue(sHoriJust) >>= aAPIAlignment ) { switch( aAPIAlignment ) @@ -230,10 +230,10 @@ ScVbaFormat<Ifc1>::getHorizontalAlignment( ) throw (script::BasicErrorException } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setOrientation( const uno::Any& _aOrientation ) throw (script::BasicErrorException, uno::RuntimeException) { - try + try { sal_Int32 nOrientation = 0; if ( !( _aOrientation >>= nOrientation ) ) @@ -267,11 +267,11 @@ ScVbaFormat<Ifc1>::setOrientation( const uno::Any& _aOrientation ) throw (script } } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getOrientation( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any NRetOrientation = aNULL(); - try + try { if (!isAmbiguous(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLORI ) ))) { @@ -292,7 +292,7 @@ ScVbaFormat<Ifc1>::getOrientation( ) throw (script::BasicErrorException, uno::R break; case table::CellOrientation_STACKED: NRetOrientation = uno::makeAny( excel::XlOrientation::xlVertical ); - break; + break; default: NRetOrientation = uno::makeAny( excel::XlOrientation::xlHorizontal ); } @@ -306,25 +306,25 @@ ScVbaFormat<Ifc1>::getOrientation( ) throw (script::BasicErrorException, uno::R } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setWrapText( const uno::Any& _aWrapText ) throw (script::BasicErrorException, uno::RuntimeException) { - try + try { mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_WRAP ) ), _aWrapText); } catch (uno::Exception& ) { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); - } + } } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getWrapText( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any aWrap = aNULL(); - try + try { rtl::OUString aPropName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_WRAP ) ) ); if (!isAmbiguous( aPropName )) @@ -340,21 +340,21 @@ ScVbaFormat<Ifc1>::getWrapText( ) throw (script::BasicErrorException, uno::Runt } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::Borders( const uno::Any& Index ) throw (script::BasicErrorException, uno::RuntimeException ) { - ScVbaPalette aPalette( excel::getDocShell( mxModel ) ); + ScVbaPalette aPalette( excel::getDocShell( mxModel ) ); uno::Reference< XCollection > xColl = new ScVbaBorders( thisHelperIface(), ScVbaFormat_BASE::mxContext, uno::Reference< table::XCellRange >( mxPropertySet, uno::UNO_QUERY_THROW ), aPalette ); if ( Index.hasValue() ) - { + { return xColl->Item( Index, uno::Any() ); - } + } return uno::makeAny( xColl ); } template< typename Ifc1 > -uno::Reference< excel::XFont > SAL_CALL +uno::Reference< excel::XFont > SAL_CALL ScVbaFormat<Ifc1>::Font( ) throw (script::BasicErrorException, uno::RuntimeException) { ScVbaPalette aPalette( excel::getDocShell( mxModel ) ); @@ -362,33 +362,33 @@ ScVbaFormat<Ifc1>::Font( ) throw (script::BasicErrorException, uno::RuntimeExce } template< typename Ifc1 > -uno::Reference< excel::XInterior > SAL_CALL +uno::Reference< excel::XInterior > SAL_CALL ScVbaFormat<Ifc1>::Interior( ) throw (script::BasicErrorException, uno::RuntimeException) { - return new ScVbaInterior( thisHelperIface(), ScVbaFormat_BASE::mxContext, mxPropertySet ); + return new ScVbaInterior( thisHelperIface(), ScVbaFormat_BASE::mxContext, mxPropertySet ); } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getNumberFormatLocal( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any aRet = uno::makeAny( rtl::OUString() ); - try - { + try + { rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_NUMBERFO ) ); if (!isAmbiguous( sPropName )) { - + initializeNumberFormats(); - + sal_Int32 nFormat = 0; if ( ! (mxPropertySet->getPropertyValue( sPropName ) >>= nFormat ) ) throw uno::RuntimeException(); - + rtl::OUString sFormat; xNumberFormats->getByKey(nFormat)->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( FORMATSTRING ))) >>= sFormat; aRet = uno::makeAny( sFormat.toAsciiLowerCase() ); - + } } catch (uno::Exception& ) @@ -400,7 +400,7 @@ ScVbaFormat<Ifc1>::getNumberFormatLocal( ) throw (script::BasicErrorException, } template< typename Ifc1 > -void +void ScVbaFormat<Ifc1>::setNumberFormat( lang::Locale _aLocale, const rtl::OUString& _sFormatString) throw( script::BasicErrorException ) { try @@ -420,10 +420,10 @@ ScVbaFormat<Ifc1>::setNumberFormat( lang::Locale _aLocale, const rtl::OUString& } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setNumberFormatLocal( const uno::Any& _oLocalFormatString ) throw (script::BasicErrorException, uno::RuntimeException) { - try + try { rtl::OUString sLocalFormatString; sal_Int32 nFormat = -1; @@ -449,15 +449,15 @@ ScVbaFormat<Ifc1>::setNumberFormatLocal( const uno::Any& _oLocalFormatString ) t } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setNumberFormat( const uno::Any& _oFormatString ) throw (script::BasicErrorException, uno::RuntimeException) { - try + try { rtl::OUString sFormatString; if ( !( _oFormatString >>= sFormatString ) ) throw uno::RuntimeException(); - + sFormatString = sFormatString.toAsciiUpperCase(); lang::Locale aDefaultLocale = m_aDefaultLocale; @@ -476,24 +476,24 @@ ScVbaFormat<Ifc1>::setNumberFormat( const uno::Any& _oFormatString ) throw (scri { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); } - + } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setIndentLevel( const uno::Any& _aLevel ) throw (script::BasicErrorException, uno::RuntimeException) { - try + try { sal_Int32 nLevel = 0; if ( !(_aLevel >>= nLevel ) ) throw uno::RuntimeException(); - table::CellHoriJustify aAPIAlignment = table::CellHoriJustify_STANDARD; - + table::CellHoriJustify aAPIAlignment = table::CellHoriJustify_STANDARD; + rtl::OUString sHoriJust( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHJUS ) ); if ( !( mxPropertySet->getPropertyValue(sHoriJust) >>= aAPIAlignment ) ) throw uno::RuntimeException(); - if (aAPIAlignment == table::CellHoriJustify_STANDARD) + if (aAPIAlignment == table::CellHoriJustify_STANDARD) mxPropertySet->setPropertyValue( sHoriJust, uno::makeAny( table::CellHoriJustify_LEFT) ) ; mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_PINDENT ) ), uno::makeAny( sal_Int16(nLevel * 352.8) ) ); } @@ -504,11 +504,11 @@ ScVbaFormat<Ifc1>::setIndentLevel( const uno::Any& _aLevel ) throw (script::Basi } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getIndentLevel( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any NRetIndentLevel = aNULL(); - try + try { rtl::OUString sParaIndent( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_PINDENT ) ); if (!isAmbiguous(sParaIndent)) @@ -516,9 +516,9 @@ ScVbaFormat<Ifc1>::getIndentLevel( ) throw (script::BasicErrorException, uno::R sal_Int16 IndentLevel = 0; if ( ( mxPropertySet->getPropertyValue(sParaIndent) >>= IndentLevel ) ) NRetIndentLevel = uno::makeAny( sal_Int32( rtl::math::round(static_cast<double>( IndentLevel ) / 352.8)) ); - else + else NRetIndentLevel = uno::makeAny( sal_Int32(0) ); - } + } } catch (uno::Exception& ) { @@ -528,7 +528,7 @@ ScVbaFormat<Ifc1>::getIndentLevel( ) throw (script::BasicErrorException, uno::R } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setLocked( const uno::Any& _aLocked ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -549,7 +549,7 @@ ScVbaFormat<Ifc1>::setLocked( const uno::Any& _aLocked ) throw (script::BasicErr } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setFormulaHidden( const uno::Any& FormulaHidden ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -558,25 +558,25 @@ ScVbaFormat<Ifc1>::setFormulaHidden( const uno::Any& FormulaHidden ) throw (scri FormulaHidden >>= bIsFormulaHidden; util::CellProtection aCellProtection; rtl::OUString sCellProt( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLPRO ) ); - mxPropertySet->getPropertyValue(sCellProt) >>= aCellProtection; + mxPropertySet->getPropertyValue(sCellProt) >>= aCellProtection; aCellProtection.IsFormulaHidden = bIsFormulaHidden; mxPropertySet->setPropertyValue(sCellProt,uno::makeAny(aCellProtection)); } catch (uno::Exception& ) { - DebugHelper::exception( SbERR_METHOD_FAILED, rtl::OUString() ); + DebugHelper::exception( SbERR_METHOD_FAILED, rtl::OUString() ); } } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getLocked( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any aCellProtection = aNULL(); - try + try { rtl::OUString sCellProt( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLPRO ) ); - + if (!isAmbiguous(sCellProt)) { SfxItemSet* pDataSet = getCurrentDataSet(); @@ -597,13 +597,13 @@ ScVbaFormat<Ifc1>::getLocked( ) throw (script::BasicErrorException, uno::Runtim } catch (uno::Exception& ) { - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); } return aCellProtection; } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getFormulaHidden( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any aBoolRet = aNULL(); @@ -623,20 +623,20 @@ ScVbaFormat<Ifc1>::getFormulaHidden( ) throw (script::BasicErrorException, uno: else { util::CellProtection aCellProtection; - mxPropertySet->getPropertyValue(sCellProt) >>= aCellProtection; - aBoolRet = uno::makeAny( aCellProtection.IsFormulaHidden ); + mxPropertySet->getPropertyValue(sCellProt) >>= aCellProtection; + aBoolRet = uno::makeAny( aCellProtection.IsFormulaHidden ); } } } catch (uno::Exception e) { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); - } + } return aBoolRet; } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setShrinkToFit( const uno::Any& ShrinkToFit ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -651,7 +651,7 @@ ScVbaFormat<Ifc1>::setShrinkToFit( const uno::Any& ShrinkToFit ) throw (script:: } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getShrinkToFit( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any aRet = aNULL(); @@ -663,13 +663,13 @@ ScVbaFormat<Ifc1>::getShrinkToFit( ) throw (script::BasicErrorException, uno::R } catch (uno::Exception& ) { - DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); + DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); } return aRet; } template< typename Ifc1 > -void SAL_CALL +void SAL_CALL ScVbaFormat<Ifc1>::setReadingOrder( const uno::Any& ReadingOrder ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -687,22 +687,22 @@ ScVbaFormat<Ifc1>::setReadingOrder( const uno::Any& ReadingOrder ) throw (script aVal = uno::makeAny( text::WritingMode_RL_TB ); break; case excel::Constants::xlContext: - DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); + DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); break; default: - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); } mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_WRITING ) ), aVal ); } catch (uno::Exception& ) { - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); } } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat<Ifc1>::getReadingOrder( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any NRetReadingOrder = aNULL(); @@ -712,7 +712,7 @@ ScVbaFormat<Ifc1>::getReadingOrder( ) throw (script::BasicErrorException, uno:: if (!isAmbiguous(sWritingMode)) { text::WritingMode aWritingMode = text::WritingMode_LR_TB; - if ( ( mxPropertySet->getPropertyValue(sWritingMode) ) >>= aWritingMode ) + if ( ( mxPropertySet->getPropertyValue(sWritingMode) ) >>= aWritingMode ) switch (aWritingMode){ case text::WritingMode_LR_TB: NRetReadingOrder = uno::makeAny(excel::Constants::xlLTR); @@ -730,19 +730,19 @@ ScVbaFormat<Ifc1>::getReadingOrder( ) throw (script::BasicErrorException, uno:: DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); } return NRetReadingOrder; - + } template< typename Ifc1 > -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormat< Ifc1 >::getNumberFormat( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Any aFormat = aNULL(); - try + try { sal_Int32 nFormat = -1; rtl::OUString sNumFormat( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_NUMBERFO ) ); - if (!isAmbiguous(sNumFormat) && + if (!isAmbiguous(sNumFormat) && ( mxPropertySet->getPropertyValue(sNumFormat) >>= nFormat) ) { initializeNumberFormats(); @@ -773,24 +773,24 @@ ScVbaFormat<Ifc1>::isAmbiguous(const rtl::OUString& _sPropertyName) throw ( scri catch (uno::Exception& ) { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); - } + } return bResult; } template< typename Ifc1 > -void +void ScVbaFormat<Ifc1>::initializeNumberFormats() throw ( script::BasicErrorException ) { if ( !xNumberFormats.is() ) { - mxNumberFormatsSupplier.set( mxModel, uno::UNO_QUERY_THROW ); + mxNumberFormatsSupplier.set( mxModel, uno::UNO_QUERY_THROW ); xNumberFormats = mxNumberFormatsSupplier->getNumberFormats(); xNumberFormatTypes.set( xNumberFormats, uno::UNO_QUERY ); // _THROW? } } template< typename Ifc1 > -uno::Reference< beans::XPropertyState > +uno::Reference< beans::XPropertyState > ScVbaFormat<Ifc1>::getXPropertyState() throw ( uno::RuntimeException ) { if ( !xPropertyState.is() ) @@ -820,20 +820,20 @@ ScVbaFormat<Ifc1>::getServiceNames() } template< typename Ifc1 > -ScCellRangesBase* +ScCellRangesBase* ScVbaFormat<Ifc1>::getCellRangesBase() throw ( ::uno::RuntimeException ) { return ScCellRangesBase::getImplementation( mxPropertySet ); } template< typename Ifc1 > -SfxItemSet* +SfxItemSet* ScVbaFormat<Ifc1>::getCurrentDataSet( ) throw ( uno::RuntimeException ) { SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( getCellRangesBase() ); if ( !pDataSet ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't access Itemset for XPropertySet" ) ), uno::Reference< uno::XInterface >() ); - return pDataSet; + return pDataSet; } diff --git a/sc/source/ui/vba/vbaformat.hxx b/sc/source/ui/vba/vbaformat.hxx index bfa88d6c7cb8..7b57df42fe02 100644 --- a/sc/source/ui/vba/vbaformat.hxx +++ b/sc/source/ui/vba/vbaformat.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,10 +28,10 @@ #define SC_VBA_FORMAT_HXX #include <ooo/vba/excel/XFormat.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/util/XNumberFormats.hpp> -#include <com/sun/star/util/XNumberFormatTypes.hpp> -#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/util/XNumberFormatTypes.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/Locale.hpp> @@ -68,7 +68,7 @@ protected: public: ScVbaFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet, const css::uno::Reference< css::frame::XModel >& xModel, bool bCheckAmbiguoity ) throw ( css::script::BasicErrorException ); virtual ~ScVbaFormat() {} - virtual css::uno::Reference< ov::XHelperInterface > thisHelperIface() = 0; + virtual css::uno::Reference< ov::XHelperInterface > thisHelperIface() = 0; css::uno::Reference< css::lang::XServiceInfo > getXServiceInfo() { return mxServiceInfo; } void SAL_CALL setAddIndent( const css::uno::Any& _BAddIndent) throw( css::uno::RuntimeException ) { _BAddIndent >>= mbAddIndent; } css::uno::Any SAL_CALL getAddIndent() throw( css::uno::RuntimeException ) { return css::uno::makeAny( mbAddIndent ); } @@ -97,7 +97,7 @@ public: virtual void SAL_CALL setFormulaHidden( const css::uno::Any& FormulaHidden ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getFormulaHidden( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL setMergeCells( const css::uno::Any& MergeCells ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0; - virtual css::uno::Any SAL_CALL getMergeCells( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0; + virtual css::uno::Any SAL_CALL getMergeCells( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0; virtual void SAL_CALL setReadingOrder( const css::uno::Any& ReadingOrder ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getReadingOrder( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); // XHelperInterface @@ -105,4 +105,4 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; -#endif +#endif diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx index 99d8a579956a..a93f86cd577f 100644 --- a/sc/source/ui/vba/vbaformatcondition.cxx +++ b/sc/source/ui/vba/vbaformatcondition.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -ScVbaFormatConditions* +ScVbaFormatConditions* lcl_getScVbaFormatConditionsPtr( const uno::Reference< excel::XFormatConditions >& xFormatConditions ) throw ( script::BasicErrorException ) { ScVbaFormatConditions* pFormatConditions = static_cast< ScVbaFormatConditions* >( xFormatConditions.get() ); @@ -48,7 +48,7 @@ ScVbaFormatCondition::ScVbaFormatCondition( const uno::Reference< XHelperInterf } -void SAL_CALL +void SAL_CALL ScVbaFormatCondition::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) { ScVbaFormatConditions* pFormatConditions = lcl_getScVbaFormatConditionsPtr( moFormatConditions ); @@ -56,7 +56,7 @@ ScVbaFormatCondition::Delete( ) throw (script::BasicErrorException, uno::Runtim notifyRange(); } -void SAL_CALL +void SAL_CALL ScVbaFormatCondition::Modify( ::sal_Int32 _nType, const uno::Any& _aOperator, const uno::Any& _aFormula1, const uno::Any& _aFormula2 ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -71,18 +71,18 @@ ScVbaFormatCondition::Modify( ::sal_Int32 _nType, const uno::Any& _aOperator, co } } -uno::Reference< excel::XInterior > SAL_CALL +uno::Reference< excel::XInterior > SAL_CALL ScVbaFormatCondition::Interior( ) throw (script::BasicErrorException, uno::RuntimeException) { return mxStyle->Interior(); } -uno::Reference< excel::XFont > SAL_CALL +uno::Reference< excel::XFont > SAL_CALL ScVbaFormatCondition::Font( ) throw (script::BasicErrorException, uno::RuntimeException) { return mxStyle->Font(); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaFormatCondition::Borders( const uno::Any& Index ) throw (script::BasicErrorException, uno::RuntimeException) { return mxStyle->Borders( Index ); } @@ -102,11 +102,11 @@ ScVbaFormatCondition::retrieveAPIType(sal_Int32 _nVBAType, const uno::Reference< break; default: DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); - } + } return aAPIType; } -void +void ScVbaFormatCondition::setFormula1( const uno::Any& _aFormula1) throw ( script::BasicErrorException ) { // getA1Formula *SHOULD* detect whether the formula is r1c1 or A1 syntax @@ -120,7 +120,7 @@ ScVbaFormatCondition::setFormula2( const uno::Any& _aFormula2) throw ( script::B ScVbaFormatCondition_BASE::setFormula1( uno::makeAny( lcl_getScVbaFormatConditionsPtr( moFormatConditions )->getA1Formula(_aFormula2)) ); } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaFormatCondition::Type( ) throw ( script::BasicErrorException, uno::RuntimeException ) { sal_Int32 nReturnType = 0; @@ -132,18 +132,18 @@ ScVbaFormatCondition::Type( ) throw ( script::BasicErrorException, uno::Runtime } -::sal_Int32 +::sal_Int32 ScVbaFormatCondition::Operator( sal_Bool bVal ) throw (script::BasicErrorException ) { return ScVbaFormatCondition_BASE::Operator( bVal ); } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaFormatCondition::Operator( ) throw (script::BasicErrorException, uno::RuntimeException) { return ScVbaFormatCondition_BASE::Operator( sal_True ); } -void +void ScVbaFormatCondition::notifyRange() throw ( script::BasicErrorException ) { try @@ -156,14 +156,14 @@ ScVbaFormatCondition::notifyRange() throw ( script::BasicErrorException ) } } -rtl::OUString& +rtl::OUString& ScVbaFormatCondition::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFormatCondition") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaFormatCondition::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaformatcondition.hxx b/sc/source/ui/vba/vbaformatcondition.hxx index 075dbf658203..999156fd145f 100644 --- a/sc/source/ui/vba/vbaformatcondition.hxx +++ b/sc/source/ui/vba/vbaformatcondition.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -29,10 +29,10 @@ #include <ooo/vba/excel/XFormatCondition.hpp> #include <ooo/vba/excel/XFormatConditions.hpp> #include <ooo/vba/excel/XStyle.hpp> -#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/sheet/XSheetConditionalEntries.hpp> #include <com/sun/star/sheet/XSheetConditionalEntry.hpp> -#include <com/sun/star/sheet/XSheetCondition.hpp> +#include <com/sun/star/sheet/XSheetCondition.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include "vbacondition.hxx" @@ -41,8 +41,8 @@ class ScVbaFormatCondition : public ScVbaFormatCondition_BASE { protected: rtl::OUString msStyleName; - css::uno::Reference< css::sheet::XSheetConditionalEntry > mxSheetConditionalEntry; - css::uno::Reference< css::sheet::XSheetConditionalEntries > mxSheetConditionalEntries; + css::uno::Reference< css::sheet::XSheetConditionalEntry > mxSheetConditionalEntry; + css::uno::Reference< css::sheet::XSheetConditionalEntries > mxSheetConditionalEntries; css::uno::Reference< ov::excel::XFormatConditions> moFormatConditions; css::uno::Reference< ov::excel::XStyle > mxStyle; css::uno::Reference< css::beans::XPropertySet > mxParentRangePropertySet; @@ -67,4 +67,4 @@ public: virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; -#endif +#endif diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx index 8dd67843ec00..2bb7db854e71 100644 --- a/sc/source/ui/vba/vbaformatconditions.cxx +++ b/sc/source/ui/vba/vbaformatconditions.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,12 +52,12 @@ ScVbaFormatConditions::ScVbaFormatConditions( const uno::Reference< XHelperInter mxStyles.set( xApp->getThisWorkbook()->Styles( uno::Any() ), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XCellRangeAddressable > xCellRange( mxRangeParent->getCellRange(), uno::UNO_QUERY_THROW ); mxParentRangePropertySet.set( xCellRange, uno::UNO_QUERY_THROW ); - + table::CellRangeAddress rangeAddress = xCellRange->getRangeAddress(); maCellAddress = table::CellAddress( rangeAddress.Sheet, rangeAddress.StartColumn, rangeAddress.StartRow ); } -void SAL_CALL +void SAL_CALL ScVbaFormatConditions::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -70,7 +70,7 @@ ScVbaFormatConditions::Delete( ) throw (script::BasicErrorException, uno::Runti { uno::Reference< sheet::XSheetConditionalEntry > xSheetConditionalEntry( mxSheetConditionalEntries->getByIndex(i), uno::UNO_QUERY_THROW ); pStyles->Delete(xSheetConditionalEntry->getStyleName()); - mxSheetConditionalEntries->removeByIndex(i); + mxSheetConditionalEntries->removeByIndex(i); } notifyRange(); } @@ -80,24 +80,24 @@ ScVbaFormatConditions::Delete( ) throw (script::BasicErrorException, uno::Runti } } -uno::Type SAL_CALL +uno::Type SAL_CALL ScVbaFormatConditions::getElementType() throw (css::uno::RuntimeException) { return excel::XFormatCondition::static_type(0); } -uno::Any xSheetConditionToFormatCondition( const uno::Reference< XHelperInterface >& xRangeParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< excel::XStyles >& xStyles, const uno::Reference< excel::XFormatConditions >& xFormatConditions, const uno::Reference< beans::XPropertySet >& xRangeProps, const uno::Any& aObject ) +uno::Any xSheetConditionToFormatCondition( const uno::Reference< XHelperInterface >& xRangeParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< excel::XStyles >& xStyles, const uno::Reference< excel::XFormatConditions >& xFormatConditions, const uno::Reference< beans::XPropertySet >& xRangeProps, const uno::Any& aObject ) { uno::Reference< sheet::XSheetConditionalEntry > xSheetConditionalEntry; aObject >>= xSheetConditionalEntry; uno::Reference< excel::XStyle > xStyle( xStyles->Item( uno::makeAny( xSheetConditionalEntry->getStyleName() ), uno::Any() ), uno::UNO_QUERY_THROW ); - uno::Reference< excel::XFormatCondition > xCondition = new ScVbaFormatCondition( xRangeParent, xContext, xSheetConditionalEntry, xStyle, xFormatConditions, xRangeProps ); + uno::Reference< excel::XFormatCondition > xCondition = new ScVbaFormatCondition( xRangeParent, xContext, xSheetConditionalEntry, xStyle, xFormatConditions, xRangeProps ); return uno::makeAny( xCondition ); } -uno::Any +uno::Any ScVbaFormatConditions::createCollectionObject(const uno::Any& aObject ) { return xSheetConditionToFormatCondition( uno::Reference< XHelperInterface >( mxRangeParent, uno::UNO_QUERY_THROW ), mxContext, mxStyles, this, mxParentRangePropertySet, aObject ); @@ -128,21 +128,21 @@ public: } }; -uno::Reference< excel::XFormatCondition > SAL_CALL +uno::Reference< excel::XFormatCondition > SAL_CALL ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, const uno::Any& _aFormula1, const uno::Any& _aFormula2 ) throw (script::BasicErrorException, uno::RuntimeException) { return Add( _nType, _aOperator, _aFormula1, _aFormula2, uno::Reference< excel::XStyle >() ); } -uno::Reference< excel::XFormatCondition > +uno::Reference< excel::XFormatCondition > ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, const uno::Any& _aFormula1, const uno::Any& _aFormula2, const css::uno::Reference< excel::XStyle >& _xStyle ) throw (script::BasicErrorException, uno::RuntimeException) { // #TODO - // #FIXME + // #FIXME // This method will NOT handle r1c1 formulas [*]and only assumes that // the formulas are _xlA1 based ( need to hook into calc work ths should // address this ) - // [*] reason: getA1Formula method below is just a hook and just + // [*] reason: getA1Formula method below is just a hook and just // returns whats it gets ( e.g. doesn't convert anything ) uno::Reference< excel::XStyle > xStyle( _xStyle ); uno::Reference< excel::XFormatCondition > xFormatCondition; @@ -150,7 +150,7 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons { rtl::OUString sStyleName; if ( !xStyle.is() ) - { + { sStyleName = getStyleName(); xStyle = mxStyles->Add(sStyleName, uno::Any() ); } @@ -172,12 +172,12 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons aPropertyValueVector.push_back( aProperty ); if ( _aFormula1.hasValue() ) - { + { beans::PropertyValue aProp( FORMULA1, 0, uno::makeAny( getA1Formula( _aFormula1 ) ), beans::PropertyState_DIRECT_VALUE ); aPropertyValueVector.push_back( aProp ); } if ( _aFormula2.hasValue() ) - { + { beans::PropertyValue aProp( FORMULA2, 0, uno::makeAny( getA1Formula( _aFormula2 ) ), beans::PropertyState_DIRECT_VALUE ); aPropertyValueVector.push_back( aProp ); } @@ -211,14 +211,14 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons } -uno::Reference< container::XEnumeration > SAL_CALL +uno::Reference< container::XEnumeration > SAL_CALL ScVbaFormatConditions::createEnumeration() throw (uno::RuntimeException) { return new EnumWrapper( m_xIndexAccess, mxRangeParent, mxContext, mxStyles, this, mxParentRangePropertySet ); } -void +void ScVbaFormatConditions::notifyRange() throw ( script::BasicErrorException ) { try @@ -231,7 +231,7 @@ ScVbaFormatConditions::notifyRange() throw ( script::BasicErrorException ) } } -rtl::OUString +rtl::OUString ScVbaFormatConditions::getA1Formula(const css::uno::Any& _aFormula) throw ( script::BasicErrorException ) { // #TODO, #FIXME hook-in proper formula conversion detection & logic @@ -241,7 +241,7 @@ ScVbaFormatConditions::getA1Formula(const css::uno::Any& _aFormula) throw ( scri return sFormula; } -rtl::OUString +rtl::OUString ScVbaFormatConditions::getStyleName() { ScVbaStyles* pStyles = static_cast< ScVbaStyles* >( mxStyles.get() ); @@ -251,7 +251,7 @@ ScVbaFormatConditions::getStyleName() return ContainerUtilities::getUniqueName(sCellStyleNames, sStyleNamePrefix, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_") )); } -void +void ScVbaFormatConditions::removeFormatCondition( const rtl::OUString& _sStyleName, sal_Bool _bRemoveStyle) throw ( script::BasicErrorException ) { try @@ -280,14 +280,14 @@ ScVbaFormatConditions::removeFormatCondition( const rtl::OUString& _sStyleName, } } -rtl::OUString& +rtl::OUString& ScVbaFormatConditions::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFormatConditions") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaFormatConditions::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaformatconditions.hxx b/sc/source/ui/vba/vbaformatconditions.hxx index 7dfa065ea8b6..dabad8dd41e5 100644 --- a/sc/source/ui/vba/vbaformatconditions.hxx +++ b/sc/source/ui/vba/vbaformatconditions.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ typedef CollTestImplHelper< ov::excel::XFormatConditions > ScVbaFormatConditions_BASE; class ScVbaFormatConditions: public ScVbaFormatConditions_BASE { - css::table::CellAddress maCellAddress; + css::table::CellAddress maCellAddress; css::uno::Reference< css::sheet::XSheetConditionalEntries > mxSheetConditionalEntries; css::uno::Reference< ov::excel::XStyles > mxStyles; css::uno::Reference< ov::excel::XRange > mxRangeParent; @@ -55,7 +55,7 @@ public: virtual css::uno::Reference< ov::excel::XFormatCondition > SAL_CALL Add( ::sal_Int32 Type, const css::uno::Any& Operator, const css::uno::Any& Formula1, const css::uno::Any& Formula2 ) 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::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(); diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 03f3ecd3c50c..adb9b7f9354d 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,7 +59,7 @@ ScVbaGlobals::ScVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Referen aInitArgs[ 0 ].Value = uno::makeAny( getApplication() ); aInitArgs[ 1 ].Name = sDocCtxName; aInitArgs[ 1 ].Value = uno::makeAny( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ) ); - + init( aInitArgs ); } @@ -74,20 +74,29 @@ ScVbaGlobals::~ScVbaGlobals() uno::Reference<excel::XApplication > ScVbaGlobals::getApplication() throw (uno::RuntimeException) { -// OSL_TRACE("In ScVbaGlobals::getApplication"); +// OSL_TRACE("In ScVbaGlobals::getApplication"); if ( !mxApplication.is() ) mxApplication.set( new ScVbaApplication( mxContext) ); - return mxApplication; + return mxApplication; +} + + +uno::Reference<excel::XApplication > SAL_CALL +ScVbaGlobals::getExcel() throw (uno::RuntimeException) +{ + return getApplication(); } -uno::Reference< excel::XWorkbook > SAL_CALL + + +uno::Reference< excel::XWorkbook > SAL_CALL ScVbaGlobals::getActiveWorkbook() throw (uno::RuntimeException) { -// OSL_TRACE("In ScVbaGlobals::getActiveWorkbook"); +// OSL_TRACE("In ScVbaGlobals::getActiveWorkbook"); uno::Reference< excel::XWorkbook > xWorkbook( getApplication()->getActiveWorkbook(), uno::UNO_QUERY); if ( xWorkbook.is() ) { - return xWorkbook; + return xWorkbook; } // FIXME check if this is correct/desired behavior throw uno::RuntimeException( rtl::OUString::createFromAscii( @@ -95,19 +104,19 @@ ScVbaGlobals::getActiveWorkbook() throw (uno::RuntimeException) } -uno::Reference< excel::XWindow > SAL_CALL +uno::Reference< excel::XWindow > SAL_CALL ScVbaGlobals::getActiveWindow() throw (uno::RuntimeException) { return getApplication()->getActiveWindow(); } -uno::Reference< excel::XWorksheet > SAL_CALL +uno::Reference< excel::XWorksheet > SAL_CALL ScVbaGlobals::getActiveSheet() throw (uno::RuntimeException) { return getApplication()->getActiveSheet(); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaGlobals::WorkBooks( const uno::Any& aIndex ) throw (uno::RuntimeException) { return uno::Any( getApplication()->Workbooks(aIndex) ); @@ -124,7 +133,7 @@ ScVbaGlobals::Sheets( const uno::Any& aIndex ) throw (uno::RuntimeException) return WorkSheets( aIndex ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaGlobals::Range( const uno::Any& Cell1, const uno::Any& Cell2 ) throw (uno::RuntimeException) { return getApplication()->Range( Cell1, Cell2 ); @@ -136,97 +145,116 @@ ScVbaGlobals::Names( const css::uno::Any& aIndex ) throw ( uno::RuntimeException return getApplication()->Names( aIndex ); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaGlobals::getActiveCell() throw (uno::RuntimeException) { return getApplication()->getActiveCell(); } -uno::Reference< XAssistant > SAL_CALL +uno::Reference< XAssistant > SAL_CALL ScVbaGlobals::getAssistant() throw (uno::RuntimeException) { return getApplication()->getAssistant(); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaGlobals::getSelection() throw (uno::RuntimeException) { return getApplication()->getSelection(); } -uno::Reference< excel::XWorkbook > SAL_CALL +uno::Reference< excel::XWorkbook > SAL_CALL ScVbaGlobals::getThisWorkbook() throw (uno::RuntimeException) { return getApplication()->getThisWorkbook(); } -void SAL_CALL +void SAL_CALL ScVbaGlobals::Calculate() throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException) { return getApplication()->Calculate(); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaGlobals::Cells( const uno::Any& RowIndex, const uno::Any& ColumnIndex ) throw (uno::RuntimeException) { return getApplication()->getActiveSheet()->Cells( RowIndex, ColumnIndex ); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaGlobals::Columns( const uno::Any& aIndex ) throw (uno::RuntimeException) { return getApplication()->getActiveSheet()->Columns( aIndex ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaGlobals::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException) { uno::Reference< XApplicationBase > xBase( getApplication(), uno::UNO_QUERY_THROW ); return xBase->CommandBars( aIndex ); } -css::uno::Reference< ov::excel::XRange > SAL_CALL +css::uno::Reference< ov::excel::XRange > SAL_CALL ScVbaGlobals::Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::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::BasicErrorException, css::uno::RuntimeException) { return getApplication()->Union( Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30 ); } -css::uno::Reference< ov::excel::XRange > SAL_CALL +css::uno::Reference< ov::excel::XRange > SAL_CALL ScVbaGlobals::Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::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::BasicErrorException, css::uno::RuntimeException) { return getApplication()->Intersect( Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30 ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaGlobals::Evaluate( const ::rtl::OUString& Name ) throw (uno::RuntimeException) { return getApplication()->Evaluate( Name ); } -css::uno::Any SAL_CALL +css::uno::Any SAL_CALL ScVbaGlobals::WorksheetFunction( ) throw (css::uno::RuntimeException) { return getApplication()->WorksheetFunction(); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaGlobals::Windows( const uno::Any& aIndex ) throw (uno::RuntimeException) { return getApplication()->Windows( aIndex ); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaGlobals::Rows( const uno::Any& aIndex ) throw (uno::RuntimeException) { return getApplication()->getActiveSheet()->Rows( aIndex ); + +} + +uno::Any SAL_CALL +ScVbaGlobals::getDebug() throw (uno::RuntimeException) +{ + try // return empty object on error + { + uno::Sequence< uno::Any > aArgs( 1 ); + aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this ); + uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); + uno::Reference< uno::XInterface > xVBADebug = xServiceManager->createInstanceWithArgumentsAndContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.Debug" ) ), aArgs, mxContext ); + return uno::Any( xVBADebug ); + } + catch( uno::Exception& ) + { + } + return uno::Any(); } -uno::Sequence< ::rtl::OUString > SAL_CALL +uno::Sequence< ::rtl::OUString > SAL_CALL ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException) { static bool bInit = false; static uno::Sequence< rtl::OUString > serviceNames( ScVbaGlobals_BASE::getAvailableServiceNames() ); if ( !bInit ) { - rtl::OUString names[] = { + rtl::OUString names[] = { ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Range" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Workbook" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Window" ) ), diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx index ae34d710240f..025cf668e34c 100644 --- a/sc/source/ui/vba/vbaglobals.hxx +++ b/sc/source/ui/vba/vbaglobals.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc ov::excel::XApplication > SAL_CALL getApplication() throw (css::uno::RuntimeException); public: - + ScVbaGlobals( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& rxContext ); //ScVbaGlobals( @@ -82,7 +82,8 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw ( css::uno::RuntimeException ); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::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::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::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::BasicErrorException, css::uno::RuntimeException); - + virtual css::uno::Reference< ov::excel::XApplication > SAL_CALL getExcel() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getDebug() throw (css::uno::RuntimeException); // XMultiServiceFactory @@ -91,4 +92,4 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; -#endif // +#endif // diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index cc76b1e60125..1248b4c734e1 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -173,9 +173,9 @@ void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nS { pDispatcher->Execute( nSlot , nCall ); } - } + } } - + void implnPaste() { @@ -197,7 +197,7 @@ implnCopy() pViewShell->CopyToClip(NULL,false,false,true); } -void +void implnCut() { ScTabViewShell* pViewShell = getCurrentBestViewShell(); @@ -212,23 +212,23 @@ void implnPasteSpecial(USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_B InsCellCmd eMoveMode = INS_NONE; ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell(); - if ( !pTabViewShell ) + if ( !pTabViewShell ) // none active, try next best pTabViewShell = getCurrentBestViewShell(); if ( pTabViewShell ) { - ScViewData* pView = pTabViewShell->GetViewData(); + ScViewData* pView = pTabViewShell->GetViewData(); Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL; if ( pView && pWin ) { if ( bAsLink && bOtherDoc ) pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK - else + else { ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); - ScDocument* pDoc = NULL; + ScDocument* pDoc = NULL; if ( pOwnClip ) - pDoc = pOwnClip->GetDocument(); + pDoc = pOwnClip->GetDocument(); pTabViewShell->PasteFromClip( nFlags, pDoc, nFunction, bSkipEmpty, bTranspose, bAsLink, eMoveMode, IDF_NONE, TRUE ); @@ -239,7 +239,7 @@ void implnPasteSpecial(USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_B } - uno::Reference< frame::XModel > + uno::Reference< frame::XModel > getCurrentDocument() throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel; @@ -249,7 +249,7 @@ getCurrentDocument() throw (uno::RuntimeException) { OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" ); return xModel; - } + } SbxObject* p = pBasic; SbxObject* pParent = p->GetParent(); SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL; @@ -264,7 +264,7 @@ getCurrentDocument() throw (uno::RuntimeException) } - uno::Any aModel; + uno::Any aModel; SbxVariable *pCompVar = basicChosen->Find( UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT ); if ( pCompVar ) @@ -282,7 +282,7 @@ getCurrentDocument() throw (uno::RuntimeException) xModel.set( xDesktop->getCurrentComponent(), uno::UNO_QUERY ); if ( !xModel.is() ) { - throw uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( its obviously not set yet ) therefore don't know the currently selected document") ), uno::Reference< uno::XInterface >() ); } return xModel; @@ -297,8 +297,8 @@ getCurrentDocument() throw (uno::RuntimeException) else { OSL_TRACE("Failed to get ThisComponent"); - throw uno::RuntimeException( - rtl::OUString( + throw uno::RuntimeException( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't determine the currently selected document") ), uno::Reference< uno::XInterface >() ); @@ -306,8 +306,8 @@ getCurrentDocument() throw (uno::RuntimeException) return xModel; } -ScDocShell* -getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) +ScDocShell* +getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) { uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW ); ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() ); @@ -318,7 +318,7 @@ getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) } -ScTabViewShell* +ScTabViewShell* getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel ) { ScDocShell* pDocShell = getDocShell( xModel ); @@ -327,23 +327,23 @@ getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel ) return NULL; } -ScTabViewShell* +ScTabViewShell* getCurrentBestViewShell() -{ +{ uno::Reference< frame::XModel > xModel = getCurrentDocument(); return getBestViewShell( xModel ); } -SfxViewFrame* +SfxViewFrame* getCurrentViewFrame() { - ScTabViewShell* pViewShell = getCurrentBestViewShell(); + ScTabViewShell* pViewShell = getCurrentBestViewShell(); if ( pViewShell ) return pViewShell->GetViewFrame(); return NULL; } -sal_Int32 +sal_Int32 OORGBToXLRGB( sal_Int32 nCol ) { sal_Int32 nRed = nCol; @@ -357,7 +357,7 @@ OORGBToXLRGB( sal_Int32 nCol ) sal_Int32 nRGB = ( (nBlue << 16) | (nGreen << 8) | nRed ); return nRGB; } -sal_Int32 +sal_Int32 XLRGBToOORGB( sal_Int32 nCol ) { sal_Int32 nBlue = nCol; @@ -371,7 +371,7 @@ XLRGBToOORGB( sal_Int32 nCol ) sal_Int32 nRGB = ( (nRed << 16) | (nGreen << 8) | nBlue ); return nRGB; } -uno::Any +uno::Any OORGBToXLRGB( const uno::Any& aCol ) { sal_Int32 nCol=0; @@ -379,7 +379,7 @@ OORGBToXLRGB( const uno::Any& aCol ) nCol = OORGBToXLRGB( nCol ); return uno::makeAny( nCol ); } -uno::Any +uno::Any XLRGBToOORGB( const uno::Any& aCol ) { sal_Int32 nCol=0; @@ -405,7 +405,7 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C rtl::OUString sRange( RTL_CONSTASCII_USTRINGPARAM( "-" ) ); rtl::OUString sFileName; - + if (( nFrom || nTo ) ) { if ( nFrom ) @@ -425,7 +425,7 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C if ( pViewFrame ) { SfxAllItemSet aArgs( SFX_APP()->GetPool() ); - + SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate ); aArgs.Put( sfxCollate, sfxCollate.Which() ); SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies ); @@ -434,7 +434,7 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C { SfxStringItem sfxFileName( SID_FILE_NAME, sFileName); aArgs.Put( sfxFileName, sfxFileName.Which() ); - + } if ( sRange.getLength() ) { @@ -451,7 +451,7 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C { if ( bPreview ) { - if ( !pViewFrame->GetFrame().IsInPlace() ) + if ( !pViewFrame->GetFrame().IsInPlace() ) { SC_MOD()->InputEnterHandler(); pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SFX_CALLMODE_SYNCHRON ); @@ -462,12 +462,12 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C else pDispatcher->Execute( (USHORT)SID_PRINTDOC, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs ); } - + } - + // #FIXME #TODO // 1 ActivePrinter ( how/can we switch a printer via API? ) - // 2 PrintToFile ( ms behaviour if this option is specified but no + // 2 PrintToFile ( ms behaviour if this option is specified but no // filename supplied 'PrToFileName' then the user will be prompted ) // 3 Need to check behaviour of Selected sheets with range ( e.g. From & To // values ) in oOO these options are mutually exclusive @@ -536,13 +536,13 @@ rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeEx } -rtl::OUString +rtl::OUString ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >& _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator) { return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2)); } -rtl::OUString +rtl::OUString ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix) { sal_Int32 a = _nStartSuffix; @@ -552,7 +552,7 @@ ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, if ( nLen == 0 ) return _sElementName; - while (bElementexists == true) + while (bElementexists == true) { for (sal_Int32 i = 0; i < nLen; i++) { @@ -566,17 +566,17 @@ ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, return rtl::OUString(); } -sal_Int32 +sal_Int32 ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString ) { sal_Int32 FieldLen = SearchList.getLength(); sal_Int32 retvalue = -1; - for (sal_Int32 i = 0; i < FieldLen; i++) + for (sal_Int32 i = 0; i < FieldLen; i++) { // I wonder why comparing lexicographically is done // when its a match is whats interesting? - //if (SearchList[i].compareTo(SearchString) == 0) - if ( SearchList[i].equals( SearchString ) ) + //if (SearchList[i].compareTo(SearchString) == 0) + if ( SearchList[i].equals( SearchString ) ) { retvalue = i; break; @@ -601,7 +601,7 @@ rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike ) if ( bForLike ) sResult.append(static_cast<sal_Unicode>('^')); - while (start < end) + while (start < end) { switch (*start) { @@ -678,7 +678,7 @@ double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt: } else { - fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000; + fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000; } return fConvertFactor; } @@ -708,7 +708,7 @@ UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComp double UserFormGeometryHelper::getLeft() { sal_Int32 nLeft = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft; + mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft; return Millimeter::getInPoints( nLeft ); } void UserFormGeometryHelper::setLeft( double nLeft ) @@ -718,32 +718,32 @@ UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComp double UserFormGeometryHelper::getTop() { sal_Int32 nTop = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop; + mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop; return Millimeter::getInPoints( nTop ); } void UserFormGeometryHelper::setTop( double nTop ) { - mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) ); + mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) ); } double UserFormGeometryHelper::getHeight() { sal_Int32 nHeight = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ) ) >>= nHeight; + mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ) ) >>= nHeight; return Millimeter::getInPoints( nHeight ); } void UserFormGeometryHelper::setHeight( double nHeight ) { - mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) ); + mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) ); } double UserFormGeometryHelper::getWidth() { sal_Int32 nWidth = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ) ) >>= nWidth; + mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ) ) >>= nWidth; return Millimeter::getInPoints( nWidth ); } void UserFormGeometryHelper::setWidth( double nWidth) { - mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) ); + mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) ); } SfxItemSet* @@ -751,7 +751,7 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangeObj* pRangeObj ) { SfxItemSet* pDataSet = pRangeObj ? pRangeObj->GetCurrentDataSet( true ) : NULL ; return pDataSet; - + } } // vba diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx index e37df1e118b4..86e7ba27eb2f 100644 --- a/sc/source/ui/vba/vbahyperlink.cxx +++ b/sc/source/ui/vba/vbahyperlink.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,7 +30,7 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/text/XText.hpp> #include <com/sun/star/text/XTextFieldsSupplier.hpp> -#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> #include <ooo/vba/office/MsoHyperlinkType.hpp> #include <ooo/vba/msforms/XShape.hpp> #include "vbarange.hxx" diff --git a/sc/source/ui/vba/vbahyperlink.hxx b/sc/source/ui/vba/vbahyperlink.hxx index e1520b59c15a..055c8cebe7f7 100644 --- a/sc/source/ui/vba/vbahyperlink.hxx +++ b/sc/source/ui/vba/vbahyperlink.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #ifndef SC_VBA_HYPERLINK_HXX #define SC_VBA_HYPERLINK_HXX @@ -37,7 +37,7 @@ typedef InheritedHelperInterfaceImpl1< ov::excel::XHyperlink > HyperlinkImpl_BASE; -class ScVbaHyperlink : public HyperlinkImpl_BASE +class ScVbaHyperlink : public HyperlinkImpl_BASE { public: ScVbaHyperlink( diff --git a/sc/source/ui/vba/vbahyperlinks.cxx b/sc/source/ui/vba/vbahyperlinks.cxx index 89a8109e6aa2..529b9a273104 100755 --- a/sc/source/ui/vba/vbahyperlinks.cxx +++ b/sc/source/ui/vba/vbahyperlinks.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #include "vbahyperlinks.hxx" #include <algorithm> #include <vector> @@ -88,7 +88,7 @@ bool EqualAnchorFunctor::operator()( const uno::Reference< excel::XHyperlink >& sal_Int32 nType = rxHlink->getType(); if( nType != mnType ) return false; - + switch( nType ) { case office::MsoHyperlinkType::msoHyperlinkRange: @@ -125,7 +125,7 @@ public: /** Inserts the passed hyperlink into the collection. Will remove a Hyperlink object with the same anchor as the passed Hyperlink object. */ void insertHyperlink( const uno::Reference< excel::XHyperlink >& rxHlink ) throw (uno::RuntimeException); - + // XIndexAccess virtual sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException); virtual uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException); @@ -133,7 +133,7 @@ public: // XElementAccess virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException); virtual sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException); - + private: typedef ::std::vector< uno::Reference< excel::XHyperlink > > HyperlinkVector; HyperlinkVector maHlinks; @@ -251,7 +251,7 @@ uno::Reference< excel::XHyperlink > SAL_CALL ScVbaHyperlinks::Add( the spreadsheet document. Parent of the Hyperlink is the anchor object. */ uno::Reference< excel::XHyperlink > xHlink( new ScVbaHyperlink( xAnchor, mxContext, rAddress, rSubAddress, rScreenTip, rTextToDisplay ) ); - + /* If creation of the hyperlink did not throw, insert it into the collection. */ mxContainer->insertHyperlink( xHlink ); diff --git a/sc/source/ui/vba/vbahyperlinks.hxx b/sc/source/ui/vba/vbahyperlinks.hxx index ca7d990ad6a8..8ce015101bc4 100755 --- a/sc/source/ui/vba/vbahyperlinks.hxx +++ b/sc/source/ui/vba/vbahyperlinks.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #ifndef SC_VBA_HYPERLINKS_HXX #define SC_VBA_HYPERLINKS_HXX @@ -67,7 +67,7 @@ typedef CollTestImplHelper< ov::excel::XHyperlinks > ScVbaHyperlinks_BASE; Worksheet object, it will always represent the current set of all hyperlinks existing in the sheet. Insertion and deletion of hyperlinks will be reflected by the instance. - + When a Hyperlinks collection object has been constructed from a VBA Range object, it will represent the set of hyperlinks that have existed at its construction time, and that are located completely inside the range(s) @@ -76,9 +76,9 @@ typedef CollTestImplHelper< ov::excel::XHyperlinks > ScVbaHyperlinks_BASE; hyperlinks it has been constructed with, even if they no longer exist. Furthermore, the instance will not offer hyperlinks inserted later, even if the instance itself has been used to insert the new hyperlinks. - + VBA code example: - + With ThisWorkbook.Worksheets(1) Set hlinks = .Hyperlinks ' global Hyperlinks object @@ -131,7 +131,7 @@ public: // XEnumerationAccess virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - + // XElementAccess virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index face47767bdc..431dae683802 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -95,17 +95,17 @@ ScVbaInterior::ScVbaInterior( const uno::Reference< XHelperInterface >& xParent, 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 ); + throw lang::IllegalArgumentException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "properties") ), uno::Reference< uno::XInterface >(), 2 ); } uno::Any -ScVbaInterior::getColor() throw (uno::RuntimeException) +ScVbaInterior::getColor() throw (uno::RuntimeException) { Color aBackColor( GetBackColor() ); return uno::makeAny( OORGBToXLRGB( aBackColor.GetColor() ) ); } - -void + +void ScVbaInterior::setColor( const uno::Any& _color ) throw (uno::RuntimeException) { sal_Int32 nColor = 0; @@ -150,15 +150,15 @@ ScVbaInterior::SetMixedColor() uno::Reference< container::XIndexAccess > ScVbaInterior::getPalette() { - if ( !m_pScDoc ) + if ( !m_pScDoc ) throw uno::RuntimeException(); SfxObjectShell* pShell = m_pScDoc->GetDocumentShell(); - ScVbaPalette aPalette( pShell ); - return aPalette.getPalette(); + ScVbaPalette aPalette( pShell ); + return aPalette.getPalette(); } -void SAL_CALL -ScVbaInterior::setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno::RuntimeException) +void SAL_CALL +ScVbaInterior::setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno::RuntimeException) { sal_Int32 nIndex = 0; _colorindex >>= nIndex; @@ -204,16 +204,16 @@ ScVbaInterior::GetColorIndex( const sal_Int32 nColor ) nIndex = count + 1; // 1 based break; } - } + } return nIndex; } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaInterior::getColorIndex() throw ( css::uno::RuntimeException ) { sal_Int32 nColor = 0; // hackly for excel::XlColorIndex::xlColorIndexNone - uno::Any aColor = m_xProps->getPropertyValue( BACKCOLOR ); + uno::Any aColor = m_xProps->getPropertyValue( BACKCOLOR ); if( ( aColor >>= nColor ) && ( nColor == -1 ) ) { nColor = excel::XlColorIndex::xlColorIndexNone; @@ -221,11 +221,11 @@ ScVbaInterior::getColorIndex() throw ( css::uno::RuntimeException ) } // 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 + // 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; - + XLRGBToOORGB( getColor() ) >>= nColor; + return uno::makeAny( GetColorIndex( nColor ) ); } Color @@ -245,7 +245,7 @@ ScVbaInterior::GetPatternColor( const Color& rPattColor, const Color& rBackColor Color ScVbaInterior::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans ) { - return Color( + return Color( nTrans, GetMixedColorComp( rFore.GetRed(), rBack.GetRed(), nTrans ), GetMixedColorComp( rFore.GetGreen(), rBack.GetGreen(), nTrans ), @@ -304,7 +304,7 @@ ScVbaInterior::SetUserDefinedAttributes( const rtl::OUString& sName, const uno:: } } // OOo do not support below API -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaInterior::getPattern() throw (uno::RuntimeException) { // XlPattern @@ -313,7 +313,7 @@ ScVbaInterior::getPattern() throw (uno::RuntimeException) return uno::makeAny( GetAttributeData( aPattern ) ); return uno::makeAny( excel::XlPattern::xlPatternNone ); } -void SAL_CALL +void SAL_CALL ScVbaInterior::setPattern( const uno::Any& _pattern ) throw (uno::RuntimeException) { if( _pattern >>= m_nPattern ) @@ -329,7 +329,7 @@ ScVbaInterior::GetBackColor() { sal_Int32 nColor = 0; Color aBackColor; - uno::Any aColor = GetUserDefinedAttributes( BACKCOLOR ); + uno::Any aColor = GetUserDefinedAttributes( BACKCOLOR ); if( aColor.hasValue() ) { nColor = GetAttributeData( aColor ); @@ -348,7 +348,7 @@ ScVbaInterior::GetBackColor() } return aBackColor; } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaInterior::getPatternColor() throw (uno::RuntimeException) { // 0 is the default color. no filled. @@ -360,7 +360,7 @@ ScVbaInterior::getPatternColor() throw (uno::RuntimeException) } return uno::makeAny( sal_Int32( 0 ) ); } -void SAL_CALL +void SAL_CALL ScVbaInterior::setPatternColor( const uno::Any& _patterncolor ) throw (uno::RuntimeException) { sal_Int32 nPattColor = 0; @@ -372,15 +372,15 @@ ScVbaInterior::setPatternColor( const uno::Any& _patterncolor ) throw (uno::Runt else throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern Color" ), uno::Reference< uno::XInterface >() ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaInterior::getPatternColorIndex() throw (uno::RuntimeException) { sal_Int32 nColor = 0; - XLRGBToOORGB( getPatternColor() ) >>= nColor; - + XLRGBToOORGB( getPatternColor() ) >>= nColor; + return uno::makeAny( GetIndexColor( nColor ) ); } -void SAL_CALL +void SAL_CALL ScVbaInterior::setPatternColorIndex( const uno::Any& _patterncolorindex ) throw (uno::RuntimeException) { sal_Int32 nColorIndex = 0; @@ -396,14 +396,14 @@ ScVbaInterior::setPatternColorIndex( const uno::Any& _patterncolorindex ) throw throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern Color" ), uno::Reference< uno::XInterface >() ); } -rtl::OUString& +rtl::OUString& ScVbaInterior::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaInterior") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaInterior::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbainterior.hxx b/sc/source/ui/vba/vbainterior.hxx index 027d06040af9..1d2c6eb2e230 100644 --- a/sc/source/ui/vba/vbainterior.hxx +++ b/sc/source/ui/vba/vbainterior.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,9 +47,9 @@ class ScVbaInterior : public ScVbaInterior_BASE css::uno::Reference< css::beans::XPropertySet > m_xProps; ScDocument* m_pScDoc; Color m_aPattColor; - sal_Int32 m_nPattern; + sal_Int32 m_nPattern; - css::uno::Reference< css::container::XIndexAccess > getPalette(); + 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 ); @@ -79,7 +79,7 @@ public: 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); + 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(); diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx index 464b167df250..66381c15ec04 100644 --- a/sc/source/ui/vba/vbaname.cxx +++ b/sc/source/ui/vba/vbaname.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,12 +42,12 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -ScVbaName::ScVbaName(const css::uno::Reference< ov::XHelperInterface >& xParent, +ScVbaName::ScVbaName(const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRange >& xName, const css::uno::Reference< css::sheet::XNamedRanges >& xNames, const css::uno::Reference< css::frame::XModel >& xModel ): - NameImpl_BASE( xParent , xContext ), + NameImpl_BASE( xParent , xContext ), mxModel( xModel ), mxNamedRange( xName ), mxNames( xNames ) @@ -122,7 +122,7 @@ ScVbaName::getValue() throw (css::uno::RuntimeException) { ::rtl::OUString sTmp = sTmpValue.copy( 1 ); sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!")); - sResult += sTmp; + sResult += sTmp; sResult += sNewSegmentation; } nFrom = nTo + 1; @@ -142,7 +142,7 @@ ScVbaName::getValue() throw (css::uno::RuntimeException) return sResult; } -void +void ScVbaName::setValue( const ::rtl::OUString & rValue ) throw (css::uno::RuntimeException) { ::rtl::OUString sSheetName = getWorkSheet()->getName(); @@ -181,25 +181,25 @@ ScVbaName::setValue( const ::rtl::OUString & rValue ) throw (css::uno::RuntimeEx mxNamedRange->setContent(sResult); } -::rtl::OUString +::rtl::OUString ScVbaName::getRefersTo() throw (css::uno::RuntimeException) { return getValue(); } -void +void ScVbaName::setRefersTo( const ::rtl::OUString & rRefersTo ) throw (css::uno::RuntimeException) { setValue( rRefersTo ); } -::rtl::OUString +::rtl::OUString ScVbaName::getRefersToLocal() throw (css::uno::RuntimeException) { return getRefersTo(); } -void +void ScVbaName::setRefersToLocal( const ::rtl::OUString & rRefersTo ) throw (css::uno::RuntimeException) { setRefersTo( rRefersTo ); @@ -217,7 +217,7 @@ ScVbaName::setRefersToR1C1( const ::rtl::OUString & rRefersTo ) throw (css::uno: setRefersTo( rRefersTo ); } -::rtl::OUString +::rtl::OUString ScVbaName::getRefersToR1C1Local() throw (css::uno::RuntimeException) { return getRefersTo(); @@ -245,7 +245,7 @@ ScVbaName::setRefersToRange( const css::uno::Reference< ov::excel::XRange > /*rR void ScVbaName::Delete() throw (css::uno::RuntimeException) { - mxNames->removeByName( mxNamedRange->getName() ); + mxNames->removeByName( mxNamedRange->getName() ); } rtl::OUString& diff --git a/sc/source/ui/vba/vbaname.hxx b/sc/source/ui/vba/vbaname.hxx index 81b2555a4ce1..1378647b843a 100644 --- a/sc/source/ui/vba/vbaname.hxx +++ b/sc/source/ui/vba/vbaname.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,11 +33,11 @@ #include <vbahelper/vbahelperinterface.hxx> -class ScDocument; +class ScDocument; typedef InheritedHelperInterfaceImpl1< ov::excel::XName > NameImpl_BASE; -class ScVbaName : public NameImpl_BASE +class ScVbaName : public NameImpl_BASE { css::uno::Reference< css::frame::XModel > mxModel; css::uno::Reference< css::sheet::XNamedRange > mxNamedRange; diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index 2304874bdb1b..6a3291492f4d 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,11 +59,11 @@ public: }; -ScVbaNames::ScVbaNames(const css::uno::Reference< ov::XHelperInterface >& xParent, +ScVbaNames::ScVbaNames(const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRanges >& xNames, const css::uno::Reference< css::frame::XModel >& xModel ): - ScVbaNames_BASE( xParent , xContext , uno::Reference< container::XIndexAccess >( xNames, uno::UNO_QUERY ) ), + ScVbaNames_BASE( xParent , xContext , uno::Reference< container::XIndexAccess >( xNames, uno::UNO_QUERY ) ), mxModel( xModel ), mxNames( xNames ) { @@ -100,7 +100,7 @@ ScVbaNames::Add( const css::uno::Any& Name , const css::uno::Any& RefersToR1C1, const css::uno::Any& RefersToR1C1Local ) throw (css::uno::RuntimeException) { - + rtl::OUString sName; uno::Reference< excel::XRange > xRange; if ( Name.hasValue() ) @@ -153,7 +153,7 @@ ScVbaNames::Add( const css::uno::Any& Name , sTmp += sRangeAdd; if ( mxNames.is() ) { - RangeType nType = RT_NAME; + RangeType nType = RT_NAME; table::CellAddress aCellAddr( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow ); if ( mxNames->hasByName( sName ) ) mxNames->removeByName(sName); @@ -164,7 +164,7 @@ ScVbaNames::Add( const css::uno::Any& Name , } // XEnumerationAccess -css::uno::Type +css::uno::Type ScVbaNames::getElementType() throw( css::uno::RuntimeException ) { return ov::excel::XName::static_type(0); @@ -173,11 +173,6 @@ ScVbaNames::getElementType() throw( css::uno::RuntimeException ) uno::Reference< container::XEnumeration > ScVbaNames::createEnumeration() throw (uno::RuntimeException) { - if ( mxNames.is() ) - { - uno::Reference< container::XEnumerationAccess > xAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); - return xAccess->createEnumeration(); - } uno::Reference< container::XEnumerationAccess > xEnumAccess( mxNames, uno::UNO_QUERY_THROW ); return new NamesEnumeration( this, mxContext, xEnumAccess->createEnumeration(), mxModel , mxNames ); } @@ -189,14 +184,14 @@ ScVbaNames::createCollectionObject( const uno::Any& aSource ) return uno::makeAny( uno::Reference< excel::XName > ( new ScVbaName( getParent(), mxContext, xName, mxNames , mxModel ) ) ); } -rtl::OUString& +rtl::OUString& ScVbaNames::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaNames") ); return sImplName; -} +} -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaNames::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbanames.hxx b/sc/source/ui/vba/vbanames.hxx index 1997ac6163d7..1e1d06324602 100644 --- a/sc/source/ui/vba/vbanames.hxx +++ b/sc/source/ui/vba/vbanames.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,13 +42,13 @@ class ScVbaNames : public ScVbaNames_BASE { css::uno::Reference< css::frame::XModel > mxModel; css::uno::Reference< css::sheet::XNamedRanges > mxNames; - + protected: virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; } public: ScVbaNames( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRanges >& xNames , const css::uno::Reference< css::frame::XModel >& xModel ); - + ScDocument* getScDocument(); ScDocShell* getScDocShell(); @@ -59,7 +59,7 @@ public: virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); // Methods - virtual css::uno::Any SAL_CALL Add( const css::uno::Any& aName , + virtual css::uno::Any SAL_CALL Add( const css::uno::Any& aName , const css::uno::Any& aRefersTo, const css::uno::Any& aVisible, const css::uno::Any& aMacroType, @@ -70,7 +70,7 @@ public: const css::uno::Any& aCategoryLocal, const css::uno::Any& aRefersToR1C1, const css::uno::Any& aRefersToR1C1Local ) throw (css::uno::RuntimeException); - + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); // ScVbaNames_BASE diff --git a/sc/source/ui/vba/vbaoleobject.cxx b/sc/source/ui/vba/vbaoleobject.cxx index a35ce4b3120f..9ca23d9bd8db 100644 --- a/sc/source/ui/vba/vbaoleobject.cxx +++ b/sc/source/ui/vba/vbaoleobject.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,94 +64,94 @@ ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParen m_xControl.set( xControlProvider->createControl( xControlShape, xModel ) ); } -uno::Reference< uno::XInterface > SAL_CALL +uno::Reference< uno::XInterface > SAL_CALL ScVbaOLEObject::getObject() throw (uno::RuntimeException) { return uno::Reference< uno::XInterface >( m_xControlShape, uno::UNO_QUERY_THROW ); } -sal_Bool SAL_CALL +sal_Bool SAL_CALL ScVbaOLEObject::getEnabled() throw (uno::RuntimeException) { return m_xControl->getEnabled(); } -void SAL_CALL +void SAL_CALL ScVbaOLEObject::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException) { m_xControl->setEnabled( _enabled ); } -sal_Bool SAL_CALL +sal_Bool SAL_CALL ScVbaOLEObject::getVisible() throw (uno::RuntimeException) { OSL_TRACE("OleObject %s returning visible %s", rtl::OUStringToOString( m_xControl->getName(), RTL_TEXTENCODING_UTF8 ).getStr(), m_xControl->getVisible() ? "true" : "false" ); return m_xControl->getVisible(); } -void SAL_CALL +void SAL_CALL ScVbaOLEObject::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) { OSL_TRACE("OleObject %s set visible %s", rtl::OUStringToOString( m_xControl->getName(), RTL_TEXTENCODING_UTF8 ).getStr(), _visible ? "true" : "false" ); m_xControl->setVisible( _visible ); } -double SAL_CALL +double SAL_CALL ScVbaOLEObject::getLeft() throw (uno::RuntimeException) { return m_xControl->getLeft(); } -void SAL_CALL +void SAL_CALL ScVbaOLEObject::setLeft( double _left ) throw (uno::RuntimeException) { m_xControl->setLeft( _left ); } -double SAL_CALL +double SAL_CALL ScVbaOLEObject::getTop() throw (uno::RuntimeException) { return m_xControl->getTop(); } -void SAL_CALL +void SAL_CALL ScVbaOLEObject::setTop( double _top ) throw (uno::RuntimeException) { m_xControl->setTop( _top ); } -double SAL_CALL +double SAL_CALL ScVbaOLEObject::getHeight() throw (uno::RuntimeException) { return m_xControl->getHeight(); } -void SAL_CALL +void SAL_CALL ScVbaOLEObject::setHeight( double _height ) throw (uno::RuntimeException) { m_xControl->setHeight( _height ); } -double SAL_CALL +double SAL_CALL ScVbaOLEObject::getWidth() throw (uno::RuntimeException) { return m_xControl->getWidth(); } -void SAL_CALL +void SAL_CALL ScVbaOLEObject::setWidth( double _width ) throw (uno::RuntimeException) { m_xControl->setWidth( _width ); } -rtl::OUString& +rtl::OUString& ScVbaOLEObject::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaOLEObject") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaOLEObject::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaoleobject.hxx b/sc/source/ui/vba/vbaoleobject.hxx index 008564d71e16..c82bb328a0a3 100644 --- a/sc/source/ui/vba/vbaoleobject.hxx +++ b/sc/source/ui/vba/vbaoleobject.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,7 +61,7 @@ public: virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException); virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException); virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException); - + }; #endif //SC_VBA_OLEOBJECT_HXX diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx index 69ba36cf8279..c097963514b3 100644 --- a/sc/source/ui/vba/vbaoleobjects.cxx +++ b/sc/source/ui/vba/vbaoleobjects.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ class IndexAccessWrapper : public XIndexAccess_BASE typedef std::vector< uno::Reference< drawing::XControlShape > > OLEObjects; OLEObjects vObjects; public: - IndexAccessWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) + IndexAccessWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) { sal_Int32 nLen = xIndexAccess->getCount(); for ( sal_Int32 index = 0; index < nLen; ++index ) @@ -63,7 +63,7 @@ public: { if ( Index < 0 || Index >= getCount() ) throw lang::IndexOutOfBoundsException(); - return uno::makeAny( vObjects[ Index ] ); + return uno::makeAny( vObjects[ Index ] ); } // Methods XElementAcess @@ -165,14 +165,14 @@ ScVbaOLEObjects::getElementType() throw (uno::RuntimeException) { return ooo::vba::excel::XOLEObject::static_type(0); } -rtl::OUString& +rtl::OUString& ScVbaOLEObjects::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaOLEObjects") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaOLEObjects::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaoleobjects.hxx b/sc/source/ui/vba/vbaoleobjects.hxx index ab4ed29d163d..aca72df14209 100644 --- a/sc/source/ui/vba/vbaoleobjects.hxx +++ b/sc/source/ui/vba/vbaoleobjects.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ protected: virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); public: - ScVbaOLEObjects( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, + ScVbaOLEObjects( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ); // XEnumerationAccess @@ -51,7 +51,7 @@ public: // ScVbaCollectionBaseImpl virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - + }; #endif //SC_VBA_OLEOBJECTS_HXX diff --git a/sc/source/ui/vba/vbaoutline.cxx b/sc/source/ui/vba/vbaoutline.cxx index ee4c78c73151..65e29fd83b69 100644 --- a/sc/source/ui/vba/vbaoutline.cxx +++ b/sc/source/ui/vba/vbaoutline.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -29,15 +29,15 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; void -ScVbaOutline::ShowLevels( const uno::Any& RowLevels, const uno::Any& ColumnLevels ) throw (uno::RuntimeException) +ScVbaOutline::ShowLevels( const uno::Any& RowLevels, const uno::Any& ColumnLevels ) throw (uno::RuntimeException) { sal_Int16 nLevel = 0; - if (mxOutline.is()) + if (mxOutline.is()) { if (RowLevels >>= nLevel) { mxOutline->showLevel(nLevel, table::TableOrientation_ROWS); - } + } if (ColumnLevels >>= nLevel) { mxOutline->showLevel(nLevel,table::TableOrientation_COLUMNS); @@ -45,14 +45,14 @@ ScVbaOutline::ShowLevels( const uno::Any& RowLevels, const uno::Any& ColumnLevel } } -rtl::OUString& +rtl::OUString& ScVbaOutline::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaOutline") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaOutline::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaoutline.hxx b/sc/source/ui/vba/vbaoutline.hxx index c954842cf7fd..28632e8302d7 100644 --- a/sc/source/ui/vba/vbaoutline.hxx +++ b/sc/source/ui/vba/vbaoutline.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ typedef InheritedHelperInterfaceImpl1< ov::excel::XOutline > ScVbaOutline_BASE; -class ScVbaOutline : public ScVbaOutline_BASE +class ScVbaOutline : public ScVbaOutline_BASE { css::uno::Reference< css::sheet::XSheetOutline > mxOutline; public: @@ -43,7 +43,7 @@ public: css::uno::Reference<css::sheet::XSheetOutline> outline): ScVbaOutline_BASE( xParent, xContext) , mxOutline(outline) {} virtual ~ScVbaOutline(){} - + virtual void SAL_CALL ShowLevels( const css::uno::Any& RowLevels, const css::uno::Any& ColumnLevels ) throw (css::uno::RuntimeException) ; // XHelperInterface virtual rtl::OUString& getServiceImplName(); diff --git a/sc/source/ui/vba/vbapagebreak.cxx b/sc/source/ui/vba/vbapagebreak.cxx index 1103c10f54c8..44bbd595464f 100644 --- a/sc/source/ui/vba/vbapagebreak.cxx +++ b/sc/source/ui/vba/vbapagebreak.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; template< typename Ifc1 > -ScVbaPageBreak<Ifc1>::ScVbaPageBreak( const uno::Reference< XHelperInterface >& xParent, +ScVbaPageBreak<Ifc1>::ScVbaPageBreak( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< beans::XPropertySet >& xProps, sheet::TablePageBreakData aTablePageBreakData) throw (uno::RuntimeException): @@ -42,7 +42,7 @@ ScVbaPageBreak<Ifc1>::ScVbaPageBreak( const uno::Reference< XHelperInterface >& } template< typename Ifc1 > -sal_Int32 ScVbaPageBreak<Ifc1>::getType() throw (uno::RuntimeException) +sal_Int32 ScVbaPageBreak<Ifc1>::getType() throw (uno::RuntimeException) { uno::Any aValue = mxRowColPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" ))); sal_Bool hasPageBreak = sal_False; @@ -50,17 +50,17 @@ sal_Int32 ScVbaPageBreak<Ifc1>::getType() throw (uno::RuntimeException) 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) +void ScVbaPageBreak<Ifc1>::setType(sal_Int32 type) throw (uno::RuntimeException) { - if( (type != excel::XlPageBreak::xlPageBreakNone) && + if( (type != excel::XlPageBreak::xlPageBreakNone) && (type != excel::XlPageBreak::xlPageBreakManual) && (type != excel::XlPageBreak::xlPageBreakAutomatic) ) { @@ -94,7 +94,7 @@ uno::Reference< excel::XRange> ScVbaPageBreak<Ifc1>::Location() throw ( script:: } template< typename Ifc1 > -rtl::OUString& +rtl::OUString& ScVbaPageBreak<Ifc1>::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPageBreak") ); @@ -102,7 +102,7 @@ ScVbaPageBreak<Ifc1>::getServiceImplName() } template< typename Ifc1 > -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaPageBreak<Ifc1>::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -117,14 +117,14 @@ ScVbaPageBreak<Ifc1>::getServiceNames() template class ScVbaPageBreak< excel::XHPageBreak >; /* class ScVbaHPageBreak */ -rtl::OUString& +rtl::OUString& ScVbaHPageBreak::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaHPageBreak") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaHPageBreak::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -139,26 +139,26 @@ ScVbaHPageBreak::getServiceNames() template class ScVbaPageBreak< excel::XVPageBreak >; /* class ScVbaVPageBreak */ -ScVbaVPageBreak::ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, +ScVbaVPageBreak::ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData ) throw ( css::uno::RuntimeException ) : ScVbaVPageBreak_BASE( xParent, xContext, xProps, aTablePageBreakData ) { } - + ScVbaVPageBreak::~ScVbaVPageBreak() { } -rtl::OUString& +rtl::OUString& ScVbaVPageBreak::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaVPageBreak") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaVPageBreak::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbapagebreak.hxx b/sc/source/ui/vba/vbapagebreak.hxx index 4832464c1296..dd30bb533c50 100644 --- a/sc/source/ui/vba/vbapagebreak.hxx +++ b/sc/source/ui/vba/vbapagebreak.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,12 +46,12 @@ protected: css::uno::Reference< css::beans::XPropertySet > mxRowColPropertySet; css::sheet::TablePageBreakData maTablePageBreakData; public: - ScVbaPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, + ScVbaPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException); virtual ~ScVbaPageBreak(){} - + virtual sal_Int32 SAL_CALL getType( ) throw (css::uno::RuntimeException); virtual void SAL_CALL setType(sal_Int32 type) throw (css::uno::RuntimeException); @@ -69,14 +69,14 @@ typedef ScVbaPageBreak < ov::excel::XHPageBreak > ScVbaHPageBreak_BASE; class ScVbaHPageBreak : public ScVbaHPageBreak_BASE { public: - ScVbaHPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, + ScVbaHPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException): ScVbaHPageBreak_BASE( xParent,xContext,xProps,aTablePageBreakData ){} - + virtual ~ScVbaHPageBreak(){} - + // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); @@ -88,13 +88,13 @@ typedef ScVbaPageBreak < ov::excel::XVPageBreak > ScVbaVPageBreak_BASE; class ScVbaVPageBreak : public ScVbaVPageBreak_BASE { public: - ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, + ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException); - + virtual ~ScVbaVPageBreak(); - + // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx index 25ccbb0f4cdc..ebb5a0d9cfc9 100644 --- a/sc/source/ui/vba/vbapagebreaks.cxx +++ b/sc/source/ui/vba/vbapagebreaks.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -101,7 +101,7 @@ public: * 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; @@ -209,10 +209,10 @@ public: } }; -ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< XHelperInterface >& xParent, +ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< 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 )), + ScVbaHPageBreaks_BASE( xParent,xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_False )), mxSheetPageBreak( xSheetPageBreak ) { } @@ -239,20 +239,20 @@ ScVbaHPageBreaks::createCollectionObject( const css::uno::Any& aSource ) return aSource; // its already a pagebreak object } -uno::Type +uno::Type ScVbaHPageBreaks::getElementType() throw (uno::RuntimeException) { return excel::XHPageBreak::static_type(0); } -rtl::OUString& +rtl::OUString& ScVbaHPageBreaks::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaHPageBreaks") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaHPageBreaks::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -265,10 +265,10 @@ ScVbaHPageBreaks::getServiceNames() } //VPageBreak -ScVbaVPageBreaks::ScVbaVPageBreaks( const uno::Reference< XHelperInterface >& xParent, +ScVbaVPageBreaks::ScVbaVPageBreaks( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( uno::RuntimeException ) -: ScVbaVPageBreaks_BASE( xParent, xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_True ) ), +: ScVbaVPageBreaks_BASE( xParent, xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_True ) ), mxSheetPageBreak( xSheetPageBreak ) { } @@ -277,7 +277,7 @@ ScVbaVPageBreaks::~ScVbaVPageBreaks() { } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaVPageBreaks::Add( const uno::Any& Before ) throw ( script::BasicErrorException, uno::RuntimeException ) { RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() ); @@ -300,20 +300,20 @@ ScVbaVPageBreaks::createCollectionObject( const css::uno::Any& aSource ) return aSource; // its already a pagebreak object } -uno::Type +uno::Type ScVbaVPageBreaks::getElementType() throw ( uno::RuntimeException ) { return excel::XVPageBreak::static_type( 0 ); } -rtl::OUString& +rtl::OUString& ScVbaVPageBreaks::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "ScVbaVPageBreaks" ) ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaVPageBreaks::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbapagebreaks.hxx b/sc/source/ui/vba/vbapagebreaks.hxx index de6174191e95..8060e11622c7 100644 --- a/sc/source/ui/vba/vbapagebreaks.hxx +++ b/sc/source/ui/vba/vbapagebreaks.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,17 +49,17 @@ class ScVbaHPageBreaks : public ScVbaHPageBreaks_BASE { css::uno::Reference< css::sheet::XSheetPageBreak > mxSheetPageBreak; public: - ScVbaHPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent, + ScVbaHPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak) throw (css::uno::RuntimeException); virtual ~ScVbaHPageBreaks(){} - // XHPageBreaks + // 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::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); virtual css::uno::Any createCollectionObject(const css::uno::Any&); // XHelperInterface @@ -75,18 +75,18 @@ class ScVbaVPageBreaks : public ScVbaVPageBreaks_BASE css::uno::Reference< css::sheet::XSheetPageBreak > mxSheetPageBreak; public: - ScVbaVPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent, + ScVbaVPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( css::uno::RuntimeException ); virtual ~ScVbaVPageBreaks(); - // XVPageBreaks + // XVPageBreaks virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Before ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ); // XEnumerationAccess virtual css::uno::Type SAL_CALL getElementType() throw ( css::uno::RuntimeException ); - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw ( css::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw ( css::uno::RuntimeException ); virtual css::uno::Any createCollectionObject( const css::uno::Any& ); // XHelperInterface diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx index d660ddbbfd77..eeba5be387d8 100644 --- a/sc/source/ui/vba/vbapagesetup.cxx +++ b/sc/source/ui/vba/vbapagesetup.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,7 +46,7 @@ using namespace ::ooo::vba; bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, ScRange& refRange, ScRangeList& aCellRanges, formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1 ) throw ( uno::RuntimeException ); -ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent, +ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSpreadsheet >& xSheet, const uno::Reference< frame::XModel >& xModel) throw (uno::RuntimeException): @@ -65,7 +65,7 @@ ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent mxPageProps.set( xPageStyle->getByName(aStyleName), uno::UNO_QUERY_THROW ); mnOrientLandscape = excel::XlPageOrientation::xlLandscape; mnOrientPortrait = excel::XlPageOrientation::xlPortrait; -} +} rtl::OUString SAL_CALL ScVbaPageSetup::getPrintArea() throw (css::uno::RuntimeException) { @@ -88,7 +88,7 @@ rtl::OUString SAL_CALL ScVbaPageSetup::getPrintArea() throw (css::uno::RuntimeEx ScDocument* pDoc = excel::getDocShell( mxModel )->GetDocument(); aRangeList.Format( aPrintArea, nFlags, pDoc, formula::FormulaGrammar::CONV_XL_A1, ',' ); } - + return aPrintArea; } @@ -106,7 +106,7 @@ void SAL_CALL ScVbaPageSetup::setPrintArea( const rtl::OUString& rAreas ) throw { ScRangeList aCellRanges; ScRange aRange; - if( getScRangeListForAddress( rAreas, excel::getDocShell( mxModel ) , aRange, aCellRanges ) ) + if( getScRangeListForAddress( rAreas, excel::getDocShell( mxModel ) , aRange, aCellRanges ) ) { uno::Sequence< table::CellRangeAddress > aSeq( aCellRanges.Count() ); USHORT i=0; @@ -263,7 +263,7 @@ void SAL_CALL ScVbaPageSetup::setLeftHeader( const rtl::OUString& leftHeader) th { uno::Reference< text::XText > xText = xHeaderContent->getLeftText(); xText->setString( leftHeader ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) ); + mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) ); } } catch( uno::Exception& ) @@ -299,7 +299,7 @@ void SAL_CALL ScVbaPageSetup::setCenterHeader( const rtl::OUString& centerHeader { uno::Reference< text::XText > xText = xHeaderContent->getCenterText(); xText->setString( centerHeader ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) ); + mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) ); } } catch( uno::Exception& ) @@ -335,7 +335,7 @@ void SAL_CALL ScVbaPageSetup::setRightHeader( const rtl::OUString& rightHeader) { uno::Reference< text::XText > xText = xHeaderContent->getRightText(); xText->setString( rightHeader ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) ); + mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageHeaderContent")), uno::makeAny(xHeaderContent) ); } } catch( uno::Exception& ) @@ -371,7 +371,7 @@ void SAL_CALL ScVbaPageSetup::setLeftFooter( const rtl::OUString& leftFooter) th { uno::Reference< text::XText > xText = xFooterContent->getLeftText(); xText->setString( leftFooter ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) ); + mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) ); } } catch( uno::Exception& ) @@ -407,7 +407,7 @@ void SAL_CALL ScVbaPageSetup::setCenterFooter( const rtl::OUString& centerFooter { uno::Reference< text::XText > xText = xFooterContent->getCenterText(); xText->setString( centerFooter ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) ); + mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) ); } } catch( uno::Exception& ) @@ -444,7 +444,7 @@ void SAL_CALL ScVbaPageSetup::setRightFooter( const rtl::OUString& rightFooter) { uno::Reference< text::XText > xText = xFooterContent->getRightText(); xText->setString( rightFooter ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) ); + mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightPageFooterContent")), uno::makeAny(xFooterContent) ); } } catch( uno::Exception& ) @@ -606,14 +606,14 @@ void SAL_CALL ScVbaPageSetup::setPrintHeadings( sal_Bool printHeadings) throw (c } } -rtl::OUString& +rtl::OUString& ScVbaPageSetup::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPageSetup") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaPageSetup::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbapagesetup.hxx b/sc/source/ui/vba/vbapagesetup.hxx index d2c001b225cf..09a996c865d2 100644 --- a/sc/source/ui/vba/vbapagesetup.hxx +++ b/sc/source/ui/vba/vbapagesetup.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,16 +37,16 @@ typedef cppu::ImplInheritanceHelper1< VbaPageSetupBase, ov::excel::XPageSetup > ScVbaPageSetup_BASE; -class ScVbaPageSetup : public ScVbaPageSetup_BASE +class ScVbaPageSetup : public ScVbaPageSetup_BASE { css::uno::Reference< css::sheet::XSpreadsheet > mxSheet; public: - ScVbaPageSetup( const css::uno::Reference< ov::XHelperInterface >& xParent, + ScVbaPageSetup( const css::uno::Reference< ov::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 >& xModel) throw (css::uno::RuntimeException); + const css::uno::Reference< css::frame::XModel >& xModel) 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); diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx index c6ae5c488a20..92b33dec816c 100644 --- a/sc/source/ui/vba/vbapalette.cxx +++ b/sc/source/ui/vba/vbapalette.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #include "vbapalette.hxx" #include <cppuhelper/implbase1.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -100,12 +100,12 @@ ScVbaPalette::getPalette() const { uno::Reference< container::XIndexAccess > xIndex; uno::Reference< beans::XPropertySet > xProps; - if ( m_pShell ) + if ( m_pShell ) xProps.set( m_pShell->GetModel(), uno::UNO_QUERY_THROW ); else throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract palette, no doc shell" ) ), uno::Reference< uno::XInterface >() ); xIndex.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ColorPalette") ) ), uno::UNO_QUERY ); if ( !xIndex.is() ) return new DefaultPalette(); - return xIndex; + return xIndex; } diff --git a/sc/source/ui/vba/vbapalette.hxx b/sc/source/ui/vba/vbapalette.hxx index b51483772674..937935a5d714 100644 --- a/sc/source/ui/vba/vbapalette.hxx +++ b/sc/source/ui/vba/vbapalette.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #ifndef SC_VBAPALETTE_HXX #define SC_VBAPALETTE_HXX diff --git a/sc/source/ui/vba/vbapane.cxx b/sc/source/ui/vba/vbapane.cxx index 29d7a286b402..28795cf1165e 100644 --- a/sc/source/ui/vba/vbapane.cxx +++ b/sc/source/ui/vba/vbapane.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #include "vbapane.hxx" #include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> @@ -45,13 +45,13 @@ ScVbaPane::ScVbaPane( { } -sal_Int32 SAL_CALL +sal_Int32 SAL_CALL ScVbaPane::getScrollColumn() throw (uno::RuntimeException) { return ( m_xViewPane->getFirstVisibleColumn() + 1 ); } -void SAL_CALL +void SAL_CALL ScVbaPane::setScrollColumn( sal_Int32 _scrollcolumn ) throw (uno::RuntimeException) { if( _scrollcolumn < 1 ) @@ -62,13 +62,13 @@ ScVbaPane::setScrollColumn( sal_Int32 _scrollcolumn ) throw (uno::RuntimeExcepti m_xViewPane->setFirstVisibleColumn( _scrollcolumn - 1 ); } -sal_Int32 SAL_CALL +sal_Int32 SAL_CALL ScVbaPane::getScrollRow() throw (uno::RuntimeException) { return ( m_xViewPane->getFirstVisibleRow() + 1 ); } -void SAL_CALL +void SAL_CALL ScVbaPane::setScrollRow( sal_Int32 _scrollrow ) throw (uno::RuntimeException) { if( _scrollrow < 1 ) @@ -93,7 +93,7 @@ ScVbaPane::getVisibleRange() throw (uno::RuntimeException) } //Method -void SAL_CALL +void SAL_CALL ScVbaPane::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any& ToRight, const uno::Any& ToLeft ) throw (uno::RuntimeException) { rtl::OUString messageBuffer; @@ -136,7 +136,7 @@ ScVbaPane::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any if( messageBuffer.getLength() > 0 ) throw(uno::RuntimeException( messageBuffer, uno::Reference< uno::XInterface >() ) ); - sal_Int32 newStartRow = visibleRange.StartRow + downRows; + sal_Int32 newStartRow = visibleRange.StartRow + downRows; if( newStartRow < 0 ) newStartRow = 0; sal_Int32 newStartCol = visibleRange.StartColumn + rightCols; @@ -146,7 +146,7 @@ ScVbaPane::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any m_xViewPane->setFirstVisibleColumn( newStartCol ); } -void SAL_CALL +void SAL_CALL ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any& ToRight, const uno::Any& ToLeft ) throw (uno::RuntimeException) { rtl::OUString messageBuffer; @@ -168,7 +168,7 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any { sal_Int32 up = 0; if( Up >>= up ) - downPages -= up; + downPages -= up; else messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: Up\n" ); } diff --git a/sc/source/ui/vba/vbapane.hxx b/sc/source/ui/vba/vbapane.hxx index ff87a9966d80..eb8eb403214e 100644 --- a/sc/source/ui/vba/vbapane.hxx +++ b/sc/source/ui/vba/vbapane.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbapivotcache.cxx b/sc/source/ui/vba/vbapivotcache.cxx index 322b42368b48..1ca3ca3c9d3c 100644 --- a/sc/source/ui/vba/vbapivotcache.cxx +++ b/sc/source/ui/vba/vbapivotcache.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,19 +34,19 @@ ScVbaPivotCache::ScVbaPivotCache( const uno::Reference< XHelperInterface >& xPar { } -void SAL_CALL +void SAL_CALL ScVbaPivotCache::Refresh() throw (css::uno::RuntimeException) { m_xTable->refresh(); } -rtl::OUString& +rtl::OUString& ScVbaPivotCache::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPivotCache") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaPivotCache::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbapivotcache.hxx b/sc/source/ui/vba/vbapivotcache.hxx index dea3e35d18bd..682c6409a398 100644 --- a/sc/source/ui/vba/vbapivotcache.hxx +++ b/sc/source/ui/vba/vbapivotcache.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ typedef InheritedHelperInterfaceImpl1<ov::excel::XPivotCache > PivotCacheImpl_BASE; class ScVbaPivotCache : public PivotCacheImpl_BASE -{ +{ css::uno::Reference< css::sheet::XDataPilotTable > m_xTable; public: ScVbaPivotCache( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XDataPilotTable >& xTable ); diff --git a/sc/source/ui/vba/vbapivottable.cxx b/sc/source/ui/vba/vbapivottable.cxx index e5d78602dcdd..d006c73a5939 100644 --- a/sc/source/ui/vba/vbapivottable.cxx +++ b/sc/source/ui/vba/vbapivottable.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,18 +39,18 @@ uno::Reference< excel::XPivotCache > ScVbaPivotTable::PivotCache() throw (uno::RuntimeException) { // #FIXME with a quick example failed to determine what the parent - // should be, leaving as null at the moment + // should be, leaving as null at the moment return new ScVbaPivotCache( uno::Reference< XHelperInterface >(), mxContext, m_xTable ); } -rtl::OUString& +rtl::OUString& ScVbaPivotTable::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPivotTable") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaPivotTable::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbapivottable.hxx b/sc/source/ui/vba/vbapivottable.hxx index e6e341830489..c702dd73af00 100644 --- a/sc/source/ui/vba/vbapivottable.hxx +++ b/sc/source/ui/vba/vbapivottable.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ typedef InheritedHelperInterfaceImpl1< ov::excel::XPivotTable > PivotTableImpl_BASE; class ScVbaPivotTable : public PivotTableImpl_BASE -{ +{ css::uno::Reference< css::sheet::XDataPilotTable > m_xTable; public: ScVbaPivotTable( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XDataPilotTable >& xTable ); diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx index fcbf347a3cd4..f9014a42de3e 100644 --- a/sc/source/ui/vba/vbapivottables.cxx +++ b/sc/source/ui/vba/vbapivottables.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,14 +44,14 @@ class PivotTableEnumeration : public EnumerationHelperImpl public: PivotTableEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xParent, xContext, xEnumeration ) {} - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { return DataPilotToPivotTable( m_xEnumeration->nextElement(), m_xContext ); } }; -ScVbaPivotTables::ScVbaPivotTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaPivotTables_BASE( xParent, xContext, xIndexAccess ) +ScVbaPivotTables::ScVbaPivotTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaPivotTables_BASE( xParent, xContext, xIndexAccess ) { } @@ -68,20 +68,20 @@ ScVbaPivotTables::createCollectionObject( const css::uno::Any& aSource ) return DataPilotToPivotTable( aSource, mxContext ); } -uno::Type +uno::Type ScVbaPivotTables::getElementType() throw (uno::RuntimeException) { return excel::XPivotTable::static_type(0); } -rtl::OUString& +rtl::OUString& ScVbaPivotTables::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPivotTables") ); return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaPivotTables::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbapivottables.hxx b/sc/source/ui/vba/vbapivottables.hxx index 3354d8a82953..38af1e6cec58 100644 --- a/sc/source/ui/vba/vbapivottables.hxx +++ b/sc/source/ui/vba/vbapivottables.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ #include <ooo/vba/excel/XPivotTables.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/uno/XComponentContext.hpp> - + #include "excelvbahelper.hxx" #include <vbahelper/vbahelperinterface.hxx> #include <vbahelper/vbacollectionimpl.hxx> @@ -56,8 +56,8 @@ public: // XPivotTables // ScVbaPivotTables_BASE - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); }; diff --git a/sc/source/ui/vba/vbapropvalue.cxx b/sc/source/ui/vba/vbapropvalue.cxx index ff821d17f479..0290179a6a7c 100644 --- a/sc/source/ui/vba/vbapropvalue.cxx +++ b/sc/source/ui/vba/vbapropvalue.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -27,18 +27,18 @@ #include "vbapropvalue.hxx" using namespace com::sun::star; - + ScVbaPropValue::ScVbaPropValue( PropListener* pListener ) : m_pListener( pListener ) { } -css::uno::Any SAL_CALL +css::uno::Any SAL_CALL ScVbaPropValue::getValue() throw (css::uno::RuntimeException) { return m_pListener->getValueEvent(); } -void SAL_CALL +void SAL_CALL ScVbaPropValue::setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException) { m_pListener->setValueEvent( _value ); diff --git a/sc/source/ui/vba/vbapropvalue.hxx b/sc/source/ui/vba/vbapropvalue.hxx index af748dae5585..1080c3268f44 100644 --- a/sc/source/ui/vba/vbapropvalue.hxx +++ b/sc/source/ui/vba/vbapropvalue.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,15 +33,15 @@ typedef ::cppu::WeakImplHelper1< ov::XPropValue > PropValueImpl_BASE; -class PropListener +class PropListener { public: virtual void setValueEvent( const css::uno::Any& value ) = 0; - virtual css::uno::Any getValueEvent() = 0; + virtual css::uno::Any getValueEvent() = 0; }; -class ScVbaPropValue : public PropValueImpl_BASE +class ScVbaPropValue : public PropValueImpl_BASE { PropListener* m_pListener; public: diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index b50199f025d0..82f6f44f3518 100755 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -179,16 +179,16 @@ double lcl_hmmToPoints( double nVal ) { return ( (double)((nVal /1000 ) * 567 ) static const sal_Int16 supportedIndexTable[] = { excel::XlBordersIndex::xlEdgeLeft, excel::XlBordersIndex::xlEdgeTop, excel::XlBordersIndex::xlEdgeBottom, excel::XlBordersIndex::xlEdgeRight, excel::XlBordersIndex::xlDiagonalDown, excel::XlBordersIndex::xlDiagonalUp, excel::XlBordersIndex::xlInsideVertical, excel::XlBordersIndex::xlInsideHorizontal }; -USHORT lcl_pointsToTwips( double nVal ) -{ +USHORT lcl_pointsToTwips( double nVal ) +{ nVal = nVal * static_cast<double>(20); short nTwips = static_cast<short>(nVal); return nTwips; } -double lcl_TwipsToPoints( USHORT nVal ) -{ +double lcl_TwipsToPoints( USHORT nVal ) +{ double nPoints = nVal; - return nPoints / 20; + return nPoints / 20; } double lcl_Round2DecPlaces( double nVal ) @@ -215,7 +215,7 @@ uno::Reference< excel::XRange > lcl_makeXRangeFromSheetCellRanges( const uno::Re ScRangeList aCellRanges; sal_Int32 nLen = sAddresses.getLength(); if ( nLen ) - { + { for ( sal_Int32 index = 0; index < nLen; ++index ) { ScRange refRange; @@ -274,7 +274,7 @@ public: SingleRangeEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext >& xContext, const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xRange( xRange ), mxContext( xContext ), bHasMore( true ) { } virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) { return bHasMore; } - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { if ( !bHasMore ) throw container::NoSuchElementException(); @@ -299,14 +299,14 @@ public: // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount() throw (::uno::RuntimeException) { return 1; } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) - { + { if ( Index != 0 ) throw lang::IndexOutOfBoundsException(); - return uno::makeAny( m_xRange ); + return uno::makeAny( m_xRange ); } // XElementAccess virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException){ return table::XCellRange::static_type(0); } - + virtual ::sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException) { return sal_True; } // XEnumerationAccess virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration() throw (uno::RuntimeException) { return new SingleRangeEnumeration( mxParent, mxContext, m_xRange ); } @@ -322,8 +322,8 @@ class RangesEnumerationImpl : public EnumerationHelperImpl public: RangesEnumerationImpl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, bool bIsRows, bool bIsColumns ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xParent, xContext, xEnumeration ), mbIsRows( bIsRows ), mbIsColumns( bIsColumns ) {} - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { return lcl_makeRange( m_xParent, m_xContext, m_xEnumeration->nextElement(), mbIsRows, mbIsColumns ); } }; @@ -346,11 +346,11 @@ public: virtual rtl::OUString& getServiceImplName() { static rtl::OUString sDummy; return sDummy; } - virtual uno::Sequence< rtl::OUString > getServiceNames() { return uno::Sequence< rtl::OUString >(); } + virtual uno::Sequence< rtl::OUString > getServiceNames() { return uno::Sequence< rtl::OUString >(); } -}; +}; -uno::Reference< container::XEnumeration > SAL_CALL +uno::Reference< container::XEnumeration > SAL_CALL ScVbaRangeAreas::createEnumeration() throw (uno::RuntimeException) { uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); @@ -424,7 +424,7 @@ ScVbaRange::getScDocument() throw (uno::RuntimeException) return getDocumentFromRange( mxRange ); } -ScDocShell* +ScDocShell* ScVbaRange::getScDocShell() throw (uno::RuntimeException) { if ( mxRanges.is() ) @@ -491,7 +491,7 @@ public: if ( mxFormats.is() ) return mxFormats->getByKey( nIndexKey ); - return uno::Reference< beans::XPropertySet > (); + return uno::Reference< beans::XPropertySet > (); } bool isBooleanType() @@ -519,7 +519,7 @@ public: if ( pUnoCellRange ) { - SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( pUnoCellRange ); + SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( pUnoCellRange ); SfxItemState eState = pDataSet->GetItemState( ATTR_VALUE_FORMAT, TRUE, NULL); // one of the cells in the range is not like the other ;-) // so return a zero length format to indicate that @@ -716,7 +716,7 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab case uno::TypeClass_BOOLEAN: { sal_Bool bState = sal_False; - if ( aValue >>= bState ) + if ( aValue >>= bState ) { uno::Reference< table::XCellRange > xRange( xCell, uno::UNO_QUERY_THROW ); if ( bState ) @@ -1083,7 +1083,7 @@ public: uno::Reference< sheet::XSheetCellCursor > getSheetCellCursor() throw ( uno::RuntimeException ) { - return uno::Reference< sheet::XSheetCellCursor >( getSpreadSheet()->createCursorByRange( getSheetCellRange() ), uno::UNO_QUERY_THROW ); + return uno::Reference< sheet::XSheetCellCursor >( getSpreadSheet()->createCursorByRange( getSheetCellRange() ), uno::UNO_QUERY_THROW ); } static uno::Reference< excel::XRange > createRangeFromRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference<uno::XComponentContext >& xContext, @@ -1103,7 +1103,7 @@ public: bool getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv ) { - + ScDocument* pDoc = NULL; if ( pDocSh ) { @@ -1116,20 +1116,20 @@ getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDoc { return true; } - } + } return false; -} +} bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, ScRange& refRange, ScRangeList& aCellRanges, formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1 ) throw ( uno::RuntimeException ) { // see if there is a match with a named range uno::Reference< beans::XPropertySet > xProps( pDocSh->GetModel(), uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xNameAccess( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NamedRanges") ) ), uno::UNO_QUERY_THROW ); - // Strangly enough you can have Range( "namedRange1, namedRange2, etc," ) + // Strangly enough you can have Range( "namedRange1, namedRange2, etc," ) // loop around each ',' seperated name std::vector< rtl::OUString > vNames; sal_Int32 nIndex = 0; - do + do { rtl::OUString aToken = sName.getToken( 0, ',', nIndex ); vNames.push_back( aToken ); @@ -1138,12 +1138,12 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S if ( !vNames.size() ) vNames.push_back( sName ); - std::vector< rtl::OUString >::iterator it = vNames.begin(); - std::vector< rtl::OUString >::iterator it_end = vNames.end(); + std::vector< rtl::OUString >::iterator it = vNames.begin(); + std::vector< rtl::OUString >::iterator it_end = vNames.end(); for ( ; it != it_end; ++it ) { - - formula::FormulaGrammar::AddressConvention eConv = aConv; + + formula::FormulaGrammar::AddressConvention eConv = aConv; // spaces are illegal ( but the user of course can enter them ) rtl::OUString sAddress = (*it).trim(); if ( xNameAccess->hasByName( sAddress ) ) @@ -1153,12 +1153,12 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S // As the address comes from OOO, the addressing // style is may not be XL_A1 eConv = pDocSh->GetDocument()->GetAddressConvention(); - } + } USHORT nFlags = 0; if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv ) ) return false; - + bool bTabFromReferrer = !( nFlags & SCA_TAB_3D ); for ( ScRange* pRange = aCellRanges.First() ; pRange; pRange = aCellRanges.Next() ) @@ -1181,7 +1181,7 @@ getRangeForName( const uno::Reference< uno::XComponentContext >& xContext, const ScRangeList aCellRanges; ScRange refRange; ScUnoConversion::FillScRange( refRange, pAddr ); - if ( !getScRangeListForAddress ( sName, pDocSh, refRange, aCellRanges, eConv ) ) + if ( !getScRangeListForAddress ( sName, pDocSh, refRange, aCellRanges, eConv ) ) throw uno::RuntimeException(); // Single range if ( aCellRanges.First() == aCellRanges.Last() ) @@ -1192,7 +1192,7 @@ getRangeForName( const uno::Reference< uno::XComponentContext >& xContext, const } uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocSh, aCellRanges ) ); - uno::Reference< XHelperInterface > xFixThisParent = excel::getUnoSheetModuleObj( xRanges ); + uno::Reference< XHelperInterface > xFixThisParent = excel::getUnoSheetModuleObj( xRanges ); return new ScVbaRange( xFixThisParent, xContext, xRanges ); } @@ -1206,6 +1206,14 @@ inline table::CellRangeAddress lclGetRangeAddress( const uno::Reference< RangeTy return uno::Reference< sheet::XCellRangeAddressable >( rxCellRange, uno::UNO_QUERY_THROW )->getRangeAddress(); } +void lclClearRange( const uno::Reference< table::XCellRange >& rxCellRange ) throw (uno::RuntimeException) +{ + using namespace ::com::sun::star::sheet::CellFlags; + sal_Int32 nFlags = VALUE | DATETIME | STRING | ANNOTATION | FORMULA | HARDATTR | STYLES | EDITATTR | FORMATTED; + uno::Reference< sheet::XSheetOperation > xSheetOperation( rxCellRange, uno::UNO_QUERY_THROW ); + xSheetOperation->clearContents( nFlags ); +} + uno::Reference< sheet::XSheetCellRange > lclExpandToMerged( const uno::Reference< table::XCellRange >& rxCellRange, bool bRecursive ) throw (uno::RuntimeException) { uno::Reference< sheet::XSheetCellRange > xNewCellRange( rxCellRange, uno::UNO_QUERY_THROW ); @@ -1251,15 +1259,27 @@ void lclExpandAndMerge( const uno::Reference< table::XCellRange >& rxCellRange, // Calc cannot merge over merged ranges, always unmerge first xMerge->merge( sal_False ); if( bMerge ) + { + // clear all contents of the covered cells (not the top-left cell) + table::CellRangeAddress aRangeAddr = lclGetRangeAddress( rxCellRange ); + sal_Int32 nLastColIdx = aRangeAddr.EndColumn - aRangeAddr.StartColumn; + sal_Int32 nLastRowIdx = aRangeAddr.EndRow - aRangeAddr.StartRow; + // clear cells of top row, right of top-left cell + if( nLastColIdx > 0 ) + lclClearRange( rxCellRange->getCellRangeByPosition( 1, 0, nLastColIdx, 0 ) ); + // clear all rows below top row + if( nLastRowIdx > 0 ) + lclClearRange( rxCellRange->getCellRangeByPosition( 0, 1, nLastColIdx, nLastRowIdx ) ); + // merge the range xMerge->merge( sal_True ); - // FIXME need to check whether all the cell contents are retained or lost by popping up a dialog + } } util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxCellRange ) throw (uno::RuntimeException) { /* 1) Check if range is completely inside one single merged range. To do this, try to extend from top-left cell only (not from entire range). - This will excude cases where this range consists of several merged + This will exclude cases where this range consists of several merged ranges (or parts of them). */ table::CellRangeAddress aRangeAddr = lclGetRangeAddress( rxCellRange ); uno::Reference< table::XCellRange > xTopLeft( rxCellRange->getCellRangeByPosition( 0, 0, 0, 0 ), uno::UNO_SET_THROW ); @@ -1305,7 +1325,7 @@ table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, aParam >>= rString; ScRangeList aCellRanges; ScRange refRange; - if ( getScRangeListForAddress ( rString, pDocSh, refRange, aCellRanges, aConv ) ) + if ( getScRangeListForAddress ( rString, pDocSh, refRange, aCellRanges, aConv ) ) { if ( aCellRanges.First() == aCellRanges.Last() ) { @@ -1332,7 +1352,7 @@ table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, uno::Reference< XCollection > lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno::Reference<uno::XComponentContext>& xContext, const uno::Reference< table::XCellRange >& xRange ) throw( uno::RuntimeException ) { - uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW ); + uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW ); ScDocument* pDoc = getDocumentFromRange(xRange); if ( !pDoc ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() ); @@ -1378,7 +1398,7 @@ ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const { uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW ); - m_Areas = new ScVbaRangeAreas( xParent, mxContext, xIndex, mbIsRows, mbIsColumns ); + m_Areas = new ScVbaRangeAreas( xParent, mxContext, xIndex, mbIsRows, mbIsColumns ); } @@ -1415,7 +1435,7 @@ ScVbaRange::visitArray( ArrayVisitor& visitor ) -uno::Any +uno::Any ScVbaRange::getValue( ValueGetter& valueGetter) throw (uno::RuntimeException) { uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY_THROW ); @@ -1452,7 +1472,7 @@ ScVbaRange::getValue() throw (uno::RuntimeException) } -void +void ScVbaRange::setValue( const uno::Any &aValue, ValueSetter& valueSetter ) throw (uno::RuntimeException) { uno::TypeClass aClass = aValue.getValueTypeClass(); @@ -1462,8 +1482,8 @@ ScVbaRange::setValue( const uno::Any &aValue, ValueSetter& valueSetter ) thro uno::Any aConverted; try { - // test for single dimension, could do - // with a better test than this + // test for single dimension, could do + // with a better test than this if ( aValue.getValueTypeName().indexOf('[') == aValue.getValueTypeName().lastIndexOf('[') ) { aConverted = xConverter->convertTo( aValue, getCppuType((uno::Sequence< uno::Any >*)0) ); @@ -1479,7 +1499,7 @@ ScVbaRange::setValue( const uno::Any &aValue, ValueSetter& valueSetter ) thro } catch ( uno::Exception& e ) { - OSL_TRACE("Bahhh, caught exception %s", + OSL_TRACE("Bahhh, caught exception %s", rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); } @@ -1497,10 +1517,10 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException) if ( m_Areas->getCount() > 1 ) { AreasVisitor aVisitor( m_Areas ); - RangeValueProcessor valueProcessor( aValue ); + RangeValueProcessor valueProcessor( aValue ); aVisitor.visit( valueProcessor ); return; - } + } CellValueSetter valueSetter( aValue ); setValue( aValue, valueSetter ); } @@ -1508,7 +1528,8 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException) void ScVbaRange::Clear() throw (uno::RuntimeException) { - sal_Int32 nFlags = sheet::CellFlags::VALUE | sheet::CellFlags::STRING | sheet::CellFlags::HARDATTR | sheet::CellFlags::FORMATTED | sheet::CellFlags::EDITATTR | sheet::CellFlags::FORMULA; + using namespace ::com::sun::star::sheet::CellFlags; + sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED; ClearContents( nFlags ); } @@ -1528,7 +1549,7 @@ ScVbaRange::ClearContents( sal_Int32 nFlags ) throw (uno::RuntimeException) uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); ScVbaRange* pRange = getImplementation( xRange ); if ( pRange ) - pRange->ClearContents( nFlags ); + pRange->ClearContents( nFlags ); } return; } @@ -1547,7 +1568,7 @@ void ScVbaRange::ClearContents() throw (uno::RuntimeException) { sal_Int32 nClearFlags = ( sheet::CellFlags::VALUE | - sheet::CellFlags::STRING | sheet::CellFlags::DATETIME | + sheet::CellFlags::STRING | sheet::CellFlags::DATETIME | sheet::CellFlags::FORMULA ); ClearContents( nClearFlags ); } @@ -1567,15 +1588,15 @@ ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar:: if ( m_Areas->getCount() > 1 ) { AreasVisitor aVisitor( m_Areas ); - RangeFormulaProcessor valueProcessor( rFormula ); + RangeFormulaProcessor valueProcessor( rFormula ); aVisitor.visit( valueProcessor ); return; - } + } CellFormulaValueSetter formulaValueSetter( rFormula, getScDocument(), eGram ); setValue( rFormula, formulaValueSetter ); } -uno::Any +uno::Any ScVbaRange::getFormulaValue( formula::FormulaGrammar::Grammar eGram ) throw (uno::RuntimeException) { // #TODO code within the test below "if ( m_Areas.... " can be removed @@ -1589,13 +1610,13 @@ ScVbaRange::getFormulaValue( formula::FormulaGrammar::Grammar eGram ) throw (uno } CellFormulaValueGetter valueGetter( getScDocument(), eGram ); return getValue( valueGetter ); - + } void ScVbaRange::setFormula(const uno::Any &rFormula ) throw (uno::RuntimeException) { - // #FIXME converting "=$a$1" e.g. CONV_XL_A1 -> CONV_OOO // results in "=$a$1:a1", temporalily disable conversion + // #FIXME converting "=$a$1" e.g. CONV_XL_A1 -> CONV_OOO // results in "=$a$1:a1", temporalily disable conversion setFormulaValue( rFormula,formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );; } @@ -1617,7 +1638,7 @@ ScVbaRange::getFormula() throw (::com::sun::star::uno::RuntimeException) return getFormulaValue( formula::FormulaGrammar::GRAM_NATIVE_XL_A1 ); } -sal_Int32 +sal_Int32 ScVbaRange::getCount() throw (uno::RuntimeException) { // If this is a multiple selection apply setValue over all areas @@ -1627,7 +1648,7 @@ ScVbaRange::getCount() throw (uno::RuntimeException) RangeCountProcessor valueProcessor; aVisitor.visit( valueProcessor ); return valueProcessor.value(); - } + } sal_Int32 rowCount = 0; sal_Int32 colCount = 0; uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY_THROW ); @@ -1635,13 +1656,13 @@ ScVbaRange::getCount() throw (uno::RuntimeException) colCount = xColumnRowRange->getColumns()->getCount(); if( IsRows() ) - return rowCount; + return rowCount; if( IsColumns() ) return colCount; return rowCount * colCount; } -sal_Int32 +sal_Int32 ScVbaRange::getRow() throw (uno::RuntimeException) { // #TODO code within the test below "if ( m_Areas.... " can be removed @@ -1654,10 +1675,10 @@ ScVbaRange::getRow() throw (uno::RuntimeException) return xRange->getRow(); } uno::Reference< sheet::XCellAddressable > xCellAddressable(mxRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); - return xCellAddressable->getCellAddress().Row + 1; // Zero value indexing -} - -sal_Int32 + return xCellAddressable->getCellAddress().Row + 1; // Zero value indexing +} + +sal_Int32 ScVbaRange::getColumn() throw (uno::RuntimeException) { // #TODO code within the test below "if ( m_Areas.... " can be removed @@ -1688,8 +1709,8 @@ ScVbaRange::HasFormula() throw (uno::RuntimeException) if ( index > 1 ) if ( aResult != xRange->HasFormula() ) return aNULL(); - aResult = xRange->HasFormula(); - if ( aNULL() == aResult ) + aResult = xRange->HasFormula(); + if ( aNULL() == aResult ) return aNULL(); } return aResult; @@ -1701,13 +1722,13 @@ ScVbaRange::HasFormula() throw (uno::RuntimeException) uno::Reference<uno::XInterface> xRanges( pThisRanges->queryFormulaCells( ( sheet::FormulaResult::ERROR | sheet::FormulaResult::VALUE | sheet::FormulaResult::STRING ) ), uno::UNO_QUERY_THROW ); ScCellRangesBase* pFormulaRanges = dynamic_cast< ScCellRangesBase * > ( xRanges.get() ); // check if there are no formula cell, return false - if ( pFormulaRanges->GetRangeList().Count() == 0 ) + if ( pFormulaRanges->GetRangeList().Count() == 0 ) return uno::makeAny(sal_False); - + // chech if there are holes (where some cells are not formulas) - // or returned range is not equal to this range - if ( ( pFormulaRanges->GetRangeList().Count() > 1 ) - || ( pFormulaRanges->GetRangeList().GetObject(0)->aStart != pThisRanges->GetRangeList().GetObject(0)->aStart ) + // or returned range is not equal to this range + if ( ( pFormulaRanges->GetRangeList().Count() > 1 ) + || ( pFormulaRanges->GetRangeList().GetObject(0)->aStart != pThisRanges->GetRangeList().GetObject(0)->aStart ) || ( pFormulaRanges->GetRangeList().GetObject(0)->aEnd != pThisRanges->GetRangeList().GetObject(0)->aEnd ) ) return aNULL(); // should return aNULL; } @@ -1725,40 +1746,40 @@ ScVbaRange::fillSeries( sheet::FillDirection nFillDirection, sheet::FillMode nFi uno::Reference< excel::XRange > xRange( xCollection->Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); ScVbaRange* pThisRange = getImplementation( xRange ); pThisRange->fillSeries( nFillDirection, nFillMode, nFillDateMode, fStep, fEndValue ); - + } - return; + return; } - + uno::Reference< sheet::XCellSeries > xCellSeries(mxRange, uno::UNO_QUERY_THROW ); xCellSeries->fillSeries( nFillDirection, nFillMode, nFillDateMode, fStep, fEndValue ); } -void +void ScVbaRange::FillLeft() throw (uno::RuntimeException) { - fillSeries(sheet::FillDirection_TO_LEFT, + fillSeries(sheet::FillDirection_TO_LEFT, sheet::FillMode_SIMPLE, sheet::FillDateMode_FILL_DATE_DAY, 0, 0x7FFFFFFF); } -void +void ScVbaRange::FillRight() throw (uno::RuntimeException) { - fillSeries(sheet::FillDirection_TO_RIGHT, + fillSeries(sheet::FillDirection_TO_RIGHT, sheet::FillMode_SIMPLE, sheet::FillDateMode_FILL_DATE_DAY, 0, 0x7FFFFFFF); } -void +void ScVbaRange::FillUp() throw (uno::RuntimeException) { - fillSeries(sheet::FillDirection_TO_TOP, + fillSeries(sheet::FillDirection_TO_TOP, sheet::FillMode_SIMPLE, sheet::FillDateMode_FILL_DATE_DAY, 0, 0x7FFFFFFF); } -void +void ScVbaRange::FillDown() throw (uno::RuntimeException) { - fillSeries(sheet::FillDirection_TO_BOTTOM, + fillSeries(sheet::FillDirection_TO_BOTTOM, sheet::FillMode_SIMPLE, sheet::FillDateMode_FILL_DATE_DAY, 0, 0x7FFFFFFF); } @@ -1788,7 +1809,7 @@ ScVbaRange::Offset( const ::uno::Any &nRowOff, const uno::Any &nColOff ) throw ( ScCellRangesBase* pUnoRangesBase = getCellRangesBase(); ScRangeList aCellRanges = pUnoRangesBase->GetRangeList(); - + for ( ScRange* pRange = aCellRanges.First() ; pRange; pRange = aCellRanges.Next() ) { @@ -1826,13 +1847,13 @@ ScVbaRange::CurrentRegion() throw (uno::RuntimeException) uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); return xRange->CurrentRegion(); } - + RangeHelper helper( mxRange ); - uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = + uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor(); xSheetCellCursor->collapseToCurrentRegion(); uno::Reference< sheet::XCellRangeAddressable > xCellRangeAddressable(xSheetCellCursor, uno::UNO_QUERY_THROW); - return RangeHelper::createRangeFromRange( mxParent, mxContext, helper.getCellRangeFromSheet(), xCellRangeAddressable ); + return RangeHelper::createRangeFromRange( mxParent, mxContext, helper.getCellRangeFromSheet(), xCellRangeAddressable ); } uno::Reference< excel::XRange > @@ -1848,11 +1869,11 @@ ScVbaRange::CurrentArray() throw (uno::RuntimeException) return xRange->CurrentArray(); } RangeHelper helper( mxRange ); - uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = + uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor(); xSheetCellCursor->collapseToCurrentArray(); uno::Reference< sheet::XCellRangeAddressable > xCellRangeAddressable(xSheetCellCursor, uno::UNO_QUERY_THROW); - return RangeHelper::createRangeFromRange( mxParent, mxContext, helper.getCellRangeFromSheet(), xCellRangeAddressable ); + return RangeHelper::createRangeFromRange( mxParent, mxContext, helper.getCellRangeFromSheet(), xCellRangeAddressable ); } uno::Any @@ -1867,7 +1888,7 @@ ScVbaRange::getFormulaArray() throw (uno::RuntimeException) uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); return xRange->getFormulaArray(); } - + uno::Reference< sheet::XCellRangeFormula> xCellRangeFormula( mxRange, uno::UNO_QUERY_THROW ); uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); uno::Any aMatrix; @@ -1875,7 +1896,7 @@ ScVbaRange::getFormulaArray() throw (uno::RuntimeException) return aMatrix; } -void +void ScVbaRange::setFormulaArray(const uno::Any& rFormula) throw (uno::RuntimeException) { // #TODO code within the test below "if ( m_Areas.... " can be removed @@ -1941,8 +1962,8 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut } sAddress += xRange->Address( RowAbsolute, ColumnAbsolute, ReferenceStyle, aExternalCopy, RelativeTo ); } - return sAddress; - + return sAddress; + } ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 ); if ( ReferenceStyle.hasValue() ) @@ -1956,7 +1977,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut ScDocShell* pDocShell = getScDocShell(); ScDocument* pDoc = pDocShell->GetDocument(); - RangeHelper thisRange( mxRange ); + RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) ); String sRange; @@ -1988,11 +2009,11 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut if ( RelativeTo.hasValue() ) { // #TODO should I throw an error if R1C1 is not set? - + table::CellRangeAddress refAddress = getCellRangeAddressForVBARange( RelativeTo, pDocShell ); dDetails = ScAddress::Details( formula::FormulaGrammar::CONV_XL_R1C1, static_cast< SCROW >( refAddress.StartRow ), static_cast< SCCOL >( refAddress.StartColumn ) ); } - aRange.Format( sRange, nFlags, pDoc, dDetails ); + aRange.Format( sRange, nFlags, pDoc, dDetails ); return sRange; } @@ -2008,18 +2029,18 @@ ScVbaRange::Font() throw ( script::BasicErrorException, uno::RuntimeException) if ( !pDoc ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() ); - ScVbaPalette aPalette( pDoc->GetDocumentShell() ); + ScVbaPalette aPalette( pDoc->GetDocumentShell() ); ScCellRangeObj* pRangeObj = NULL; try { pRangeObj = getCellRangeObj(); } - catch( uno::Exception& ) + catch( uno::Exception& ) { } return new ScVbaFont( this, mxContext, aPalette, xProps, pRangeObj ); } - + uno::Reference< excel::XRange > ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) throw(uno::RuntimeException) { @@ -2064,7 +2085,7 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr } catch( uno::Exception& ) {} // silence any errors } - + RangeHelper thisRange( mxRange ); table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); uno::Reference< table::XCellRange > xSheetRange = thisRange.getCellRangeFromSheet(); @@ -2087,7 +2108,7 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr else --nColumn; nRow = nRow + thisRangeAddress.StartRow; - nColumn = nColumn + thisRangeAddress.StartColumn; + nColumn = nColumn + thisRangeAddress.StartColumn; return new ScVbaRange( mxParent, mxContext, xSheetRange->getCellRangeByPosition( nColumn, nRow, nColumn, nRow ) ); } @@ -2117,7 +2138,7 @@ ScVbaRange::Select() throw (uno::RuntimeException) } catch( uno::Exception& ) { - } + } } } @@ -2157,14 +2178,14 @@ ScVbaRange::Activate() throw (uno::RuntimeException) RangeHelper thisRange( xCellRange ); uno::Reference< sheet::XCellRangeAddressable > xThisRangeAddress = thisRange.getCellRangeAddressable(); table::CellRangeAddress thisRangeAddress = xThisRangeAddress->getRangeAddress(); - uno::Reference< frame::XModel > xModel; + uno::Reference< frame::XModel > xModel; ScDocShell* pShell = getScDocShell(); if ( pShell ) xModel = pShell->GetModel(); if ( !xModel.is() ) - throw uno::RuntimeException(); + throw uno::RuntimeException(); // get current selection uno::Reference< sheet::XCellRangeAddressable > xRange( xModel->getCurrentSelection(), ::uno::UNO_QUERY); @@ -2181,9 +2202,9 @@ ScVbaRange::Activate() throw (uno::RuntimeException) setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), xModel ); return; } - + } - } + } if ( xRange.is() && cellInRange( xRange->getRangeAddress(), thisRangeAddress.StartColumn, thisRangeAddress.StartRow ) ) setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), xModel ); @@ -2191,7 +2212,7 @@ ScVbaRange::Activate() throw (uno::RuntimeException) { // if this range is multi cell select the range other // wise just position the cell at this single range position - if ( isSingleCellRange() ) + if ( isSingleCellRange() ) // This top-leftmost cell of this Range is not in the current // selection so just select this range setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), xModel, false ); @@ -2221,8 +2242,8 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException) aRange.aStart.SetRow( aRange.aStart.Row() + --nValue ); aRange.aEnd.SetRow( aRange.aStart.Row() ); } - - else if ( aIndex >>= sAddress ) + + else if ( aIndex >>= sAddress ) { ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 ); ScRange tmpRange; @@ -2235,7 +2256,7 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException) } else throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Illegal param" ) ), uno::Reference< uno::XInterface >() ); - + if ( aRange.aStart.Row() < 0 || aRange.aEnd.Row() < 0 ) throw uno::RuntimeException( rtl::OUString::createFromAscii("Internal failure, illegal param"), uno::Reference< uno::XInterface >() ); // return a normal range ( even for multi-selection @@ -2246,7 +2267,7 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException) if ( m_Areas->getCount() > 1 ) return new ScVbaRange( mxParent, mxContext, mxRanges, true ); return new ScVbaRange( mxParent, mxContext, mxRange, true ); -} +} uno::Reference< excel::XRange > ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException) @@ -2268,8 +2289,8 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException) aRange.aStart.SetCol( aRange.aStart.Col() + static_cast< SCCOL > ( --nValue ) ); aRange.aEnd.SetCol( aRange.aStart.Col() ); } - - else if ( aIndex >>= sAddress ) + + else if ( aIndex >>= sAddress ) { ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 ); ScRange tmpRange; @@ -2282,20 +2303,19 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException) } else throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Illegal param" ) ), uno::Reference< uno::XInterface >() ); - + if ( aRange.aStart.Col() < 0 || aRange.aEnd.Col() < 0 ) throw uno::RuntimeException( rtl::OUString::createFromAscii("Internal failure, illegal param"), uno::Reference< uno::XInterface >() ); } // Columns() - no params uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), aRange ) ); return new ScVbaRange( mxParent, mxContext, xRange, false, true ); -} +} void ScVbaRange::setMergeCells( const uno::Any& aIsMerged ) throw (script::BasicErrorException, uno::RuntimeException) { - bool bMerge = false; - aIsMerged >>= bMerge; + bool bMerge = extractBoolFromAny( aIsMerged ); if( mxRanges.is() ) { @@ -2325,7 +2345,7 @@ ScVbaRange::setMergeCells( const uno::Any& aIsMerged ) throw (script::BasicError // otherwise, merge single range lclExpandAndMerge( mxRange, bMerge ); } - + uno::Any ScVbaRange::getMergeCells() throw (script::BasicErrorException, uno::RuntimeException) { @@ -2354,7 +2374,7 @@ ScVbaRange::getMergeCells() throw (script::BasicErrorException, uno::RuntimeExce default: return aNULL(); } } - + void ScVbaRange::Copy(const ::uno::Any& Destination) throw (uno::RuntimeException) { @@ -2407,7 +2427,7 @@ ScVbaRange::Cut(const ::uno::Any& Destination) throw (uno::RuntimeException) excel::implnCut( xModel ); } } - + void ScVbaRange::setNumberFormat( const uno::Any& aFormat ) throw ( script::BasicErrorException, uno::RuntimeException) { @@ -2419,14 +2439,14 @@ ScVbaRange::setNumberFormat( const uno::Any& aFormat ) throw ( script::BasicErro for ( sal_Int32 index=1; index <= nItems; ++index ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - xRange->setNumberFormat( aFormat ); + xRange->setNumberFormat( aFormat ); } return; } NumFormatHelper numFormat( mxRange ); numFormat.setNumberFormat( sFormat ); } - + uno::Any ScVbaRange::getNumberFormat() throw ( script::BasicErrorException, uno::RuntimeException) { @@ -2443,8 +2463,8 @@ ScVbaRange::getNumberFormat() throw ( script::BasicErrorException, uno::RuntimeE if ( index > 1 ) if ( aResult != xRange->getNumberFormat() ) return aNULL(); - aResult = xRange->getNumberFormat(); - if ( aNULL() == aResult ) + aResult = xRange->getNumberFormat(); + if ( aNULL() == aResult ) return aNULL(); } return aResult; @@ -2479,7 +2499,7 @@ ScVbaRange::Resize( const uno::Any &RowSize, const uno::Any &ColumnSize ) throw xCellRangeAddressable->getRangeAddress().EndColumn, xCellRangeAddressable->getRangeAddress().EndRow ) ); } - + void ScVbaRange::setWrapText( const uno::Any& aIsWrapped ) throw (script::BasicErrorException, uno::RuntimeException) { @@ -2490,15 +2510,16 @@ ScVbaRange::setWrapText( const uno::Any& aIsWrapped ) throw (script::BasicErrorE for ( sal_Int32 index=1; index <= nItems; ++index ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - xRange->setWrapText( aIsWrapped ); + xRange->setWrapText( aIsWrapped ); } return; } uno::Reference< beans::XPropertySet > xProps(mxRange, ::uno::UNO_QUERY_THROW ); - xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTextWrapped" ) ), aIsWrapped ); + bool bIsWrapped = extractBoolFromAny( aIsWrapped ); + xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTextWrapped" ) ), uno::Any( bIsWrapped ) ); } - + uno::Any ScVbaRange::getWrapText() throw (script::BasicErrorException, uno::RuntimeException) { @@ -2512,17 +2533,17 @@ ScVbaRange::getWrapText() throw (script::BasicErrorException, uno::RuntimeExcept if ( index > 1 ) if ( aResult != xRange->getWrapText() ) return aNULL(); - aResult = xRange->getWrapText(); + aResult = xRange->getWrapText(); } return aResult; } SfxItemSet* pDataSet = getCurrentDataSet(); - + SfxItemState eState = pDataSet->GetItemState( ATTR_LINEBREAK, TRUE, NULL); if ( eState == SFX_ITEM_DONTCARE ) return aNULL(); - + uno::Reference< beans::XPropertySet > xProps(mxRange, ::uno::UNO_QUERY_THROW ); uno::Any aValue = xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTextWrapped" ) ) ); return aValue; @@ -2532,7 +2553,7 @@ uno::Reference< excel::XInterior > ScVbaRange::Interior( ) throw ( script::Basic { uno::Reference< beans::XPropertySet > xProps( mxRange, uno::UNO_QUERY_THROW ); return new ScVbaInterior ( this, mxContext, xProps, getScDocument() ); -} +} uno::Reference< excel::XRange > ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2 ) throw (uno::RuntimeException) { @@ -2556,11 +2577,11 @@ ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2, bool bForceUseI uno::Reference< table::XCellRange > xRanges = thisRange.getCellRangeFromSheet(); uno::Reference< sheet::XCellRangeAddressable > xAddressable( xRanges, uno::UNO_QUERY_THROW ); - uno::Reference< table::XCellRange > xReferrer = - xRanges->getCellRangeByPosition( getColumn()-1, getRow()-1, - xAddressable->getRangeAddress().EndColumn, + uno::Reference< table::XCellRange > xReferrer = + xRanges->getCellRangeByPosition( getColumn()-1, getRow()-1, + xAddressable->getRangeAddress().EndColumn, xAddressable->getRangeAddress().EndRow ); - // xAddressable now for this range + // xAddressable now for this range xAddressable.set( xReferrer, uno::UNO_QUERY_THROW ); if( !Cell1.hasValue() ) @@ -2577,20 +2598,20 @@ ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2, bool bForceUseI { rtl::OUString sName; Cell1 >>= sName; - RangeHelper referRange( xReferrer ); + RangeHelper referRange( xReferrer ); table::CellRangeAddress referAddress = referRange.getCellRangeAddressable()->getRangeAddress(); return getRangeForName( mxContext, sName, getScDocShell(), referAddress ); - + } else { table::CellRangeAddress cell1, cell2; - cell1 = getCellRangeAddressForVBARange( Cell1, getScDocShell() ); + cell1 = getCellRangeAddressForVBARange( Cell1, getScDocShell() ); // Cell1 & Cell2 defined // Excel seems to combine the range as the range defined by // the combination of Cell1 & Cell2 - - cell2 = getCellRangeAddressForVBARange( Cell2, getScDocShell() ); + + cell2 = getCellRangeAddressForVBARange( Cell2, getScDocShell() ); resultAddress.StartColumn = ( cell1.StartColumn < cell2.StartColumn ) ? cell1.StartColumn : cell2.StartColumn; resultAddress.StartRow = ( cell1.StartRow < cell2.StartRow ) ? cell1.StartRow : cell2.StartRow; @@ -2610,8 +2631,8 @@ ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2, bool bForceUseI // this is not a call from Application.Range( x,y ) // if a different sheet from this range is specified it's // an error - if ( parentRangeAddress.Sheet != cell1.Sheet - || parentRangeAddress.Sheet != cell2.Sheet + if ( parentRangeAddress.Sheet != cell1.Sheet + || parentRangeAddress.Sheet != cell2.Sheet ) throw uno::RuntimeException(); @@ -2619,7 +2640,7 @@ ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2, bool bForceUseI ScUnoConversion::FillScRange( aRange, resultAddress ); } ScRange parentAddress; - ScUnoConversion::FillScRange( parentAddress, parentRangeAddress); + ScUnoConversion::FillScRange( parentAddress, parentRangeAddress); if ( aRange.aStart.Col() >= 0 && aRange.aStart.Row() >= 0 && aRange.aEnd.Col() >= 0 && aRange.aEnd.Row() >= 0 ) { sal_Int32 nStartX = parentAddress.aStart.Col() + aRange.aStart.Col(); @@ -2635,13 +2656,13 @@ ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2, bool bForceUseI xCellRange = new ScCellRangeObj( getScDocShell(), aNew ); } } - + return new ScVbaRange( mxParent, mxContext, xCellRange ); } // Allow access to underlying openoffice uno api ( useful for debugging -// with openoffice basic ) +// with openoffice basic ) uno::Any SAL_CALL ScVbaRange::getCellRange( ) throw (uno::RuntimeException) { uno::Any aAny; @@ -2659,19 +2680,19 @@ uno::Any SAL_CALL ScVbaRange::getCellRange( ) throw (uno::RuntimeException) throw uno::RuntimeException(); } -static USHORT +static USHORT getPasteFlags (sal_Int32 Paste) { - USHORT nFlags = IDF_NONE; + USHORT nFlags = IDF_NONE; switch (Paste) { - case excel::XlPasteType::xlPasteComments: + case excel::XlPasteType::xlPasteComments: nFlags = IDF_NOTE;break; - case excel::XlPasteType::xlPasteFormats: + case excel::XlPasteType::xlPasteFormats: nFlags = IDF_ATTRIB;break; - case excel::XlPasteType::xlPasteFormulas: + case excel::XlPasteType::xlPasteFormulas: nFlags = IDF_FORMULA;break; - case excel::XlPasteType::xlPasteFormulasAndNumberFormats : - case excel::XlPasteType::xlPasteValues: + case excel::XlPasteType::xlPasteFormulasAndNumberFormats : + case excel::XlPasteType::xlPasteValues: #ifdef VBA_OOBUILD_HACK nFlags = ( IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_SPECIAL_BOOLEAN ); break; #else @@ -2680,52 +2701,52 @@ getPasteFlags (sal_Int32 Paste) case excel::XlPasteType::xlPasteValuesAndNumberFormats: nFlags = IDF_VALUE | IDF_ATTRIB; break; case excel::XlPasteType::xlPasteColumnWidths: - case excel::XlPasteType::xlPasteValidation: + case excel::XlPasteType::xlPasteValidation: nFlags = IDF_NONE;break; - case excel::XlPasteType::xlPasteAll: - case excel::XlPasteType::xlPasteAllExceptBorders: + case excel::XlPasteType::xlPasteAll: + case excel::XlPasteType::xlPasteAllExceptBorders: default: nFlags = IDF_ALL;break; }; return nFlags; } -static USHORT +static USHORT getPasteFormulaBits( sal_Int32 Operation) { USHORT nFormulaBits = PASTE_NOFUNC ; switch (Operation) { - case excel::XlPasteSpecialOperation::xlPasteSpecialOperationAdd: + case excel::XlPasteSpecialOperation::xlPasteSpecialOperationAdd: nFormulaBits = PASTE_ADD;break; - case excel::XlPasteSpecialOperation::xlPasteSpecialOperationSubtract: + case excel::XlPasteSpecialOperation::xlPasteSpecialOperationSubtract: nFormulaBits = PASTE_SUB;break; - case excel::XlPasteSpecialOperation::xlPasteSpecialOperationMultiply: + case excel::XlPasteSpecialOperation::xlPasteSpecialOperationMultiply: nFormulaBits = PASTE_MUL;break; case excel::XlPasteSpecialOperation::xlPasteSpecialOperationDivide: nFormulaBits = PASTE_DIV;break; - case excel::XlPasteSpecialOperation::xlPasteSpecialOperationNone: + case excel::XlPasteSpecialOperation::xlPasteSpecialOperationNone: default: nFormulaBits = PASTE_NOFUNC; break; }; - + return nFormulaBits; } -void SAL_CALL -ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, const uno::Any& SkipBlanks, const uno::Any& Transpose ) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL +ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, const uno::Any& SkipBlanks, const uno::Any& Transpose ) throw (::com::sun::star::uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("That command cannot be used on multiple selections" ) ), uno::Reference< uno::XInterface >() ); - ScDocShell* pShell = getScDocShell(); - + ScDocShell* pShell = getScDocShell(); + uno::Reference< frame::XModel > xModel( ( pShell ? pShell->GetModel() : NULL ), uno::UNO_QUERY_THROW ); uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); // save old selection uno::Reference< uno::XInterface > xSel( xModel->getCurrentSelection() ); // select this range xSelection->select( uno::makeAny( mxRange ) ); - // set up defaults + // set up defaults sal_Int32 nPaste = excel::XlPasteType::xlPasteAll; sal_Int32 nOperation = excel::XlPasteSpecialOperation::xlPasteSpecialOperationNone; sal_Bool bTranspose = sal_False; @@ -2747,20 +2768,20 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons xSelection->select( uno::makeAny( xSel ) ); } -uno::Reference< excel::XRange > +uno::Reference< excel::XRange > ScVbaRange::getEntireColumnOrRow( bool bColumn ) throw (uno::RuntimeException) { ScCellRangesBase* pUnoRangesBase = getCellRangesBase(); // copy the range list - ScRangeList aCellRanges = pUnoRangesBase->GetRangeList(); + ScRangeList aCellRanges = pUnoRangesBase->GetRangeList(); for ( ScRange* pRange = aCellRanges.First() ; pRange; pRange = aCellRanges.Next() ) { - if ( bColumn ) + if ( bColumn ) { pRange->aStart.SetRow( 0 ); pRange->aEnd.SetRow( MAXROW ); - } + } else { pRange->aStart.SetCol( 0 ); @@ -2770,32 +2791,32 @@ ScVbaRange::getEntireColumnOrRow( bool bColumn ) throw (uno::RuntimeException) if ( aCellRanges.Count() > 1 ) // Multi-Area { uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pUnoRangesBase->GetDocShell(), aCellRanges ) ); - + return new ScVbaRange( mxParent, mxContext, xRanges, !bColumn, bColumn ); } uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), *aCellRanges.First() ) ); return new ScVbaRange( mxParent, mxContext, xRange, !bColumn, bColumn ); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaRange::getEntireRow() throw (uno::RuntimeException) { return getEntireColumnOrRow(false); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaRange::getEntireColumn() throw (uno::RuntimeException) { return getEntireColumnOrRow(); } -uno::Reference< excel::XComment > SAL_CALL +uno::Reference< excel::XComment > SAL_CALL ScVbaRange::AddComment( const uno::Any& Text ) throw (uno::RuntimeException) { // if there is already a comment in the top-left cell then throw if( getComment().is() ) throw uno::RuntimeException(); - + // workaround: Excel allows to create empty comment, Calc does not ::rtl::OUString aNoteText; if( Text.hasValue() && !(Text >>= aNoteText) ) @@ -2822,7 +2843,7 @@ ScVbaRange::getComment() throw (uno::RuntimeException) if ( !xComment->Text( uno::Any(), uno::Any(), uno::Any() ).getLength() ) return NULL; return xComment; - + } uno::Reference< beans::XPropertySet > @@ -2834,18 +2855,18 @@ getRowOrColumnProps( const uno::Reference< table::XCellRange >& xCellRange, bool xProps.set( xColRow->getRows(), uno::UNO_QUERY_THROW ); else xProps.set( xColRow->getColumns(), uno::UNO_QUERY_THROW ); - return xProps; + return xProps; } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getHidden() throw (uno::RuntimeException) { - // if multi-area result is the result of the + // if multi-area result is the result of the // first area if ( m_Areas->getCount() > 1 ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(sal_Int32(1)), uno::Any() ), uno::UNO_QUERY_THROW ); - return xRange->getHidden(); + return xRange->getHidden(); } bool bIsVisible = false; try @@ -2858,10 +2879,10 @@ ScVbaRange::getHidden() throw (uno::RuntimeException) { throw uno::RuntimeException( e.Message, uno::Reference< uno::XInterface >() ); } - return uno::makeAny( !bIsVisible ); + return uno::makeAny( !bIsVisible ); } -void SAL_CALL +void SAL_CALL ScVbaRange::setHidden( const uno::Any& _hidden ) throw (uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -2870,23 +2891,21 @@ ScVbaRange::setHidden( const uno::Any& _hidden ) throw (uno::RuntimeException) for ( sal_Int32 index=1; index <= nItems; ++index ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - xRange->setHidden( _hidden ); + xRange->setHidden( _hidden ); } return; } - sal_Bool bHidden = sal_False; - _hidden >>= bHidden; - + bool bHidden = extractBoolFromAny( _hidden ); try { uno::Reference< beans::XPropertySet > xProps = getRowOrColumnProps( mxRange, mbIsRows ); - xProps->setPropertyValue( ISVISIBLE, uno::makeAny( !bHidden ) ); + xProps->setPropertyValue( ISVISIBLE, uno::Any( !bHidden ) ); } catch( uno::Exception& e ) { throw uno::RuntimeException( e.Message, uno::Reference< uno::XInterface >() ); - } + } } ::sal_Bool SAL_CALL @@ -2899,8 +2918,8 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); xRange->Replace( What, Replacement, LookAt, SearchOrder, MatchCase, MatchByte, SearchFormat, ReplaceFormat ); } - return sal_True; // seems to return true always ( or at least I haven't found the trick of - } + return sal_True; // seems to return true always ( or at least I haven't found the trick of + } // sanity check required params if ( !What.getLength() /*|| !Replacement.getLength()*/ ) @@ -2911,7 +2930,7 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace const SvxSearchItem& globalSearchOptions = ScGlobal::GetSearchItem(); SvxSearchItem newOptions( globalSearchOptions ); - sal_Int16 nLook = globalSearchOptions.GetWordOnly() ? excel::XlLookAt::xlPart : excel::XlLookAt::xlWhole; + sal_Int16 nLook = globalSearchOptions.GetWordOnly() ? excel::XlLookAt::xlPart : excel::XlLookAt::xlWhole; sal_Int16 nSearchOrder = globalSearchOptions.GetRowDirection() ? excel::XlSearchOrder::xlByRows : excel::XlSearchOrder::xlByColumns; sal_Bool bMatchCase = sal_False; @@ -2920,10 +2939,10 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace { uno::Reference< util::XReplaceDescriptor > xDescriptor = xReplace->createReplaceDescriptor(); - - xDescriptor->setSearchString( sWhat); - xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHREGEXP ) ), uno::makeAny( sal_True ) ); - xDescriptor->setReplaceString( Replacement); + + xDescriptor->setSearchString( sWhat); + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHREGEXP ) ), uno::makeAny( sal_True ) ); + xDescriptor->setReplaceString( Replacement); if ( LookAt.hasValue() ) { // sets SearchWords ( true is Cell match ) @@ -2938,7 +2957,7 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace // set global search props ( affects the find dialog // and of course the defaults for this method newOptions.SetWordOnly( bSearchWords ); - xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHWORDS ) ), uno::makeAny( bSearchWords ) ); + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHWORDS ) ), uno::makeAny( bSearchWords ) ); } // sets SearchByRow ( true for Rows ) if ( SearchOrder.hasValue() ) @@ -2951,18 +2970,18 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace 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 ) ); - } + + newOptions.SetRowDirection( bSearchByRow ); + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHBYROW ) ), uno::makeAny( bSearchByRow ) ); + } if ( MatchCase.hasValue() ) { // SearchCaseSensitive - MatchCase >>= bMatchCase; - xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHCASE ) ), uno::makeAny( bMatchCase ) ); - } + MatchCase >>= bMatchCase; + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHCASE ) ), uno::makeAny( bMatchCase ) ); + } - ScGlobal::SetSearchItem( newOptions ); + ScGlobal::SetSearchItem( newOptions ); // ignore MatchByte for the moment, its not supported in // OOo.org afaik @@ -2972,14 +2991,14 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace return sal_True; // always } -uno::Reference< excel::XRange > SAL_CALL +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 = 0; - float fWhat = 0.0; - + double fWhat = 0.0; + // string. if( What >>= sWhat ) { @@ -3002,7 +3021,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L const SvxSearchItem& globalSearchOptions = ScGlobal::GetSearchItem(); SvxSearchItem newOptions( globalSearchOptions ); - sal_Int16 nLookAt = globalSearchOptions.GetWordOnly() ? excel::XlLookAt::xlPart : excel::XlLookAt::xlWhole; + 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 ); @@ -3010,6 +3029,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L { uno::Reference< util::XSearchDescriptor > xDescriptor = xSearch->createSearchDescriptor(); xDescriptor->setSearchString( sSearch ); + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHREGEXP ) ), uno::Any( true ) ); uno::Reference< excel::XRange > xAfterRange; uno::Reference< table::XCellRange > xStartCell; @@ -3030,7 +3050,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L sal_Int32 nLookIn = 0; if( LookIn >>= nLookIn ) { - sal_Int16 nSearchType = 0; + sal_Int16 nSearchType = 0; switch( nLookIn ) { case excel::XlFindLookIn::xlComments : @@ -3062,7 +3082,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L 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 ) ); + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHWORDS ) ), uno::makeAny( bSearchWords ) ); } // SearchOrder @@ -3076,10 +3096,10 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L 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 ) ); - } + + newOptions.SetRowDirection( bSearchByRow ); + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHBYROW ) ), uno::makeAny( bSearchByRow ) ); + } // SearchDirection if ( SearchDirection.hasValue() ) @@ -3089,7 +3109,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L { sal_Bool bSearchBackwards = sal_False; if ( nSearchDirection == excel::XlSearchDirection::xlNext ) - bSearchBackwards = sal_False; + bSearchBackwards = sal_False; else if( nSearchDirection == excel::XlSearchDirection::xlPrevious ) bSearchBackwards = sal_True; else @@ -3106,8 +3126,8 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L // 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 ) ); + } + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHCASE ) ), uno::makeAny( bMatchCase ) ); // MatchByte // SearchFormat @@ -3115,8 +3135,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L ScGlobal::SetSearchItem( newOptions ); - uno::Reference< util::XSearchDescriptor > xSearchDescriptor( xDescriptor, uno::UNO_QUERY ); - uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xSearchDescriptor) : xSearch->findFirst( xSearchDescriptor ); + uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xDescriptor) : xSearch->findFirst( xDescriptor ); uno::Reference< table::XCellRange > xCellRange( xInterface, uno::UNO_QUERY ); if ( xCellRange.is() ) { @@ -3141,7 +3160,7 @@ uno::Reference< table::XCellRange > processKey( const uno::Any& Key, uno::Refere xKeyRange.set( Key, uno::UNO_QUERY_THROW ); } else if ( Key.getValueType() == ::getCppuType( static_cast< const rtl::OUString* >(0) ) ) - + { rtl::OUString sRangeName = ::comphelper::getString( Key ); table::CellRangeAddress aRefAddr; @@ -3174,11 +3193,11 @@ const rtl::OUString& sPropName ) throw( uno::RuntimeException ) // helper method for Sort void updateTableSortField( const uno::Reference< table::XCellRange >& xParentRange, - const uno::Reference< table::XCellRange >& xColRowKey, sal_Int16 nOrder, + const uno::Reference< table::XCellRange >& xColRowKey, sal_Int16 nOrder, table::TableSortField& aTableField, sal_Bool bIsSortColumn, sal_Bool bMatchCase ) throw ( uno::RuntimeException ) { - RangeHelper parentRange( xParentRange ); - RangeHelper colRowRange( xColRowKey ); + RangeHelper parentRange( xParentRange ); + RangeHelper colRowRange( xColRowKey ); table::CellRangeAddress parentRangeAddress = parentRange.getCellRangeAddressable()->getRangeAddress(); @@ -3187,27 +3206,27 @@ void updateTableSortField( const uno::Reference< table::XCellRange >& xParentRan // make sure that upper left poing of key range is within the // parent range if ( ( !bIsSortColumn && colRowKeyAddress.StartColumn >= parentRangeAddress.StartColumn && - colRowKeyAddress.StartColumn <= parentRangeAddress.EndColumn ) || ( bIsSortColumn && + colRowKeyAddress.StartColumn <= parentRangeAddress.EndColumn ) || ( bIsSortColumn && colRowKeyAddress.StartRow >= parentRangeAddress.StartRow && colRowKeyAddress.StartRow <= parentRangeAddress.EndRow ) ) { //determine col/row index if ( bIsSortColumn ) - aTableField.Field = colRowKeyAddress.StartRow - parentRangeAddress.StartRow; + aTableField.Field = colRowKeyAddress.StartRow - parentRangeAddress.StartRow; else - aTableField.Field = colRowKeyAddress.StartColumn - parentRangeAddress.StartColumn; + aTableField.Field = colRowKeyAddress.StartColumn - parentRangeAddress.StartColumn; aTableField.IsCaseSensitive = bMatchCase; - if ( nOrder == excel::XlSortOrder::xlAscending ) - aTableField.IsAscending = sal_True; - else - aTableField.IsAscending = sal_False; + if ( nOrder == excel::XlSortOrder::xlAscending ) + aTableField.IsAscending = sal_True; + else + aTableField.IsAscending = sal_False; } else throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Illegal Key param" ) ), uno::Reference< uno::XInterface >() ); - -} + +} void SAL_CALL ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& Key2, const uno::Any& /*Type*/, const uno::Any& Order2, const uno::Any& Key3, const uno::Any& Order3, const uno::Any& Header, const uno::Any& OrderCustom, const uno::Any& MatchCase, const uno::Any& Orientation, const uno::Any& SortMethod, const uno::Any& DataOption1, const uno::Any& DataOption2, const uno::Any& DataOption3 ) throw (uno::RuntimeException) @@ -3240,14 +3259,14 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& // 1) #TODO #FIXME need to process DataOption[1..3] not used currently // 2) #TODO #FIXME need to refactor this ( below ) into a IsSingleCell() method uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY_THROW ); - + // 'Fraid I don't remember what I was trying to achieve here ??? -/* +/* if ( isSingleCellRange() ) { uno::Reference< XRange > xCurrent = CurrentRegion(); xCurrent->Sort( Key1, Order1, Key2, Type, Order2, Key3, Order3, Header, OrderCustom, MatchCase, Orientation, SortMethod, DataOption1, DataOption2, DataOption3 ); - return; + return; } */ // set up defaults @@ -3265,8 +3284,8 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& if ( Orientation.hasValue() ) { - // Documentation says xlSortRows is default but that doesn't appear to be - // the case. Also it appears that xlSortColumns is the default which + // Documentation says xlSortRows is default but that doesn't appear to be + // the case. Also it appears that xlSortColumns is the default which // strangely enought sorts by Row nOrientation = ::comphelper::getINT16( Orientation ); // persist new option to be next calls default @@ -3293,17 +3312,17 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& #ifdef VBA_OOBUILD_HACK aSortParam.nCompatHeader = nHeader; #endif - } + } if ( nHeader == excel::XlYesNoGuess::xlGuess ) { bool bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), static_cast< SCCOL >( thisRangeAddress.EndColumn ), static_cast< SCROW >( thisRangeAddress.EndRow ), static_cast< SCTAB >( thisRangeAddress.Sheet )); bool bHasRowHeader = pDoc->HasRowHeader( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), static_cast< SCCOL >( thisRangeAddress.EndColumn ), static_cast< SCROW >( thisRangeAddress.EndRow ), static_cast< SCTAB >( thisRangeAddress.Sheet ) ); if ( bHasColHeader || bHasRowHeader ) - nHeader = excel::XlYesNoGuess::xlYes; + nHeader = excel::XlYesNoGuess::xlYes; else - nHeader = excel::XlYesNoGuess::xlNo; -#ifdef VBA_OOBUILD_HACK + nHeader = excel::XlYesNoGuess::xlNo; +#ifdef VBA_OOBUILD_HACK aSortParam.nCompatHeader = nHeader; #endif } @@ -3315,7 +3334,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& { nSortMethod = ::comphelper::getINT16( SortMethod ); } - + if ( OrderCustom.hasValue() ) { OrderCustom >>= nCustom; @@ -3332,7 +3351,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& if ( Order1.hasValue() ) { nOrder1 = ::comphelper::getINT16(Order1); - if ( nOrder1 == excel::XlSortOrder::xlAscending ) + if ( nOrder1 == excel::XlSortOrder::xlAscending ) aSortParam.bAscending[0] = TRUE; else aSortParam.bAscending[0] = FALSE; @@ -3341,7 +3360,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& if ( Order2.hasValue() ) { nOrder2 = ::comphelper::getINT16(Order2); - if ( nOrder2 == excel::XlSortOrder::xlAscending ) + if ( nOrder2 == excel::XlSortOrder::xlAscending ) aSortParam.bAscending[1] = TRUE; else aSortParam.bAscending[1] = FALSE; @@ -3349,15 +3368,15 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& if ( Order3.hasValue() ) { nOrder3 = ::comphelper::getINT16(Order3); - if ( nOrder3 == excel::XlSortOrder::xlAscending ) + if ( nOrder3 == excel::XlSortOrder::xlAscending ) aSortParam.bAscending[2] = TRUE; else aSortParam.bAscending[2] = FALSE; } - uno::Reference< table::XCellRange > xKey1; - uno::Reference< table::XCellRange > xKey2; - uno::Reference< table::XCellRange > xKey3; + uno::Reference< table::XCellRange > xKey1; + uno::Reference< table::XCellRange > xKey2; + uno::Reference< table::XCellRange > xKey3; ScDocShell* pDocShell = getScDocShell(); xKey1 = processKey( Key1, mxContext, pDocShell ); if ( !xKey1.is() ) @@ -3376,22 +3395,22 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& sal_Int32 nTableIndex = 0; updateTableSortField( mxRange, xKey1, nOrder1, sTableFields[ nTableIndex++ ], bIsSortColumns, bMatchCase ); - if ( xKey2.is() ) + if ( xKey2.is() ) { sTableFields.realloc( sTableFields.getLength() + 1 ); updateTableSortField( mxRange, xKey2, nOrder2, sTableFields[ nTableIndex++ ], bIsSortColumns, bMatchCase ); } - if ( xKey3.is() ) + if ( xKey3.is() ) { sTableFields.realloc( sTableFields.getLength() + 1 ); updateTableSortField( mxRange, xKey3, nOrder3, sTableFields[ nTableIndex++ ], bIsSortColumns, bMatchCase ); } sortDescriptor[ nTableSortFieldIndex ].Value <<= sTableFields; - sal_Int32 nIndex = findSortPropertyIndex( sortDescriptor, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsSortColumns")) ); + sal_Int32 nIndex = findSortPropertyIndex( sortDescriptor, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsSortColumns")) ); sortDescriptor[ nIndex ].Value <<= bIsSortColumns; - nIndex = findSortPropertyIndex( sortDescriptor, CONTS_HEADER ); + nIndex = findSortPropertyIndex( sortDescriptor, CONTS_HEADER ); sortDescriptor[ nIndex ].Value <<= bContainsHeader; pDoc->SetSortParam( aSortParam, nTab ); @@ -3402,7 +3421,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any& } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -3411,15 +3430,15 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) return xRange->End( Direction ); } - + // #FIXME #TODO - // euch! found my orig implementation sucked, so + // euch! found my orig implementation sucked, so // trying this even suckier one ( really need to use/expose code in // around ScTabView::MoveCursorArea(), thats the bit that calcutes - // where the cursor should go ) + // where the cursor should go ) // Main problem with this method is the ultra hacky attempt to preserve // the ActiveCell, there should be no need to go to these extreems - + // Save ActiveCell pos ( to restore later ) uno::Any aDft; uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); @@ -3441,7 +3460,7 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher(); USHORT nSID = 0; - + switch( Direction ) { case excel::XlDirection::xlDown: @@ -3457,7 +3476,7 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) nSID = SID_CURSORBLKRIGHT; break; default: - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": Invalid ColumnIndex" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": Invalid ColumnIndex" ) ), uno::Reference< uno::XInterface >() ); } if ( pDispatcher ) { @@ -3465,21 +3484,21 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) } } - // result is the ActiveCell - rtl::OUString sMoved = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); + // result is the ActiveCell + rtl::OUString sMoved = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); - // restore old ActiveCell + // restore old ActiveCell uno::Any aVoid; uno::Reference< excel::XRange > xOldActiveCell( xApplication->getActiveSheet()->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_QUERY_THROW ); xOldActiveCell->Select(); uno::Reference< excel::XRange > resultCell; - + resultCell.set( xApplication->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_QUERY_THROW ); // return result - + return resultCell; } @@ -3492,7 +3511,7 @@ ScVbaRange::isSingleCellRange() return false; } -uno::Reference< excel::XCharacters > SAL_CALL +uno::Reference< excel::XCharacters > SAL_CALL ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (uno::RuntimeException) { if ( !isSingleCellRange() ) @@ -3506,7 +3525,7 @@ ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (u return new ScVbaCharacters( this, mxContext, aPalette, xSimple, Start, Length ); } - void SAL_CALL + void SAL_CALL ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -3515,14 +3534,14 @@ ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException) for ( sal_Int32 index=1; index <= nItems; ++index ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - xRange->Delete( Shift ); + xRange->Delete( Shift ); } return; } - sheet::CellDeleteMode mode = sheet::CellDeleteMode_NONE ; + sheet::CellDeleteMode mode = sheet::CellDeleteMode_NONE ; RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); - if ( Shift.hasValue() ) + if ( Shift.hasValue() ) { sal_Int32 nShift = 0; Shift >>= nShift; @@ -3549,12 +3568,12 @@ ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException) mode = sheet::CellDeleteMode_LEFT; } uno::Reference< sheet::XCellRangeMovement > xCellRangeMove( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); - xCellRangeMove->removeRange( thisAddress, mode ); - + xCellRangeMove->removeRange( thisAddress, mode ); + } //XElementAccess -sal_Bool SAL_CALL +sal_Bool SAL_CALL ScVbaRange::hasElements() throw (uno::RuntimeException) { uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY ); @@ -3566,7 +3585,7 @@ ScVbaRange::hasElements() throw (uno::RuntimeException) } // XEnumerationAccess -uno::Reference< container::XEnumeration > SAL_CALL +uno::Reference< container::XEnumeration > SAL_CALL ScVbaRange::createEnumeration() throw (uno::RuntimeException) { if ( mbIsColumns || mbIsRows ) @@ -3574,17 +3593,17 @@ ScVbaRange::createEnumeration() throw (uno::RuntimeException) 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 ) + if ( mbIsColumns ) nElems = xColumnRowRange->getColumns()->getCount(); else nElems = xColumnRowRange->getRows()->getCount(); return new ColumnsRowEnumeration( mxContext, xRange, nElems ); - + } return new CellsEnumeration( mxParent, mxContext, m_Areas ); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaRange::getDefaultMethodName( ) throw (uno::RuntimeException) { const static rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM("Item") ); @@ -3592,7 +3611,7 @@ ScVbaRange::getDefaultMethodName( ) throw (uno::RuntimeException) } -uno::Reference< awt::XDevice > +uno::Reference< awt::XDevice > getDeviceFromDoc( const uno::Reference< frame::XModel >& xModel ) throw( uno::RuntimeException ) { uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -3602,7 +3621,7 @@ getDeviceFromDoc( const uno::Reference< frame::XModel >& xModel ) throw( uno::Ru } // returns calc internal col. width ( in points ) -double +double ScVbaRange::getCalcColWidth( const table::CellRangeAddress& rAddress) throw (uno::RuntimeException) { ScDocument* pDoc = getScDocument(); @@ -3619,15 +3638,15 @@ ScVbaRange::getCalcRowHeight( const table::CellRangeAddress& rAddress ) throw (u USHORT nWidth = pDoc->GetOriginalHeight( rAddress.StartRow, rAddress.Sheet ); double nPoints = lcl_TwipsToPoints( nWidth ); nPoints = lcl_Round2DecPlaces( nPoints ); - return nPoints; + return nPoints; } // return Char Width in points double getDefaultCharWidth( const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) { - const static rtl::OUString sDflt( RTL_CONSTASCII_USTRINGPARAM("Default")); - const static rtl::OUString sCharFontName( RTL_CONSTASCII_USTRINGPARAM("CharFontName")); - const static rtl::OUString sPageStyles( RTL_CONSTASCII_USTRINGPARAM("PageStyles")); + const static rtl::OUString sDflt( RTL_CONSTASCII_USTRINGPARAM("Default")); + const static rtl::OUString sCharFontName( RTL_CONSTASCII_USTRINGPARAM("CharFontName")); + const static rtl::OUString sPageStyles( RTL_CONSTASCII_USTRINGPARAM("PageStyles")); // get the font from the default style uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( xModel, uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xNameAccess( xStyleSupplier->getStyleFamilies(), uno::UNO_QUERY_THROW ); @@ -3640,32 +3659,32 @@ double getDefaultCharWidth( const uno::Reference< frame::XModel >& xModel ) thro awt::FontDescriptor aDesc; aDesc.Name = sFontName; uno::Reference< awt::XFont > xFont( xDevice->getFont( aDesc ), uno::UNO_QUERY_THROW ); - double nCharPixelWidth = xFont->getCharWidth( (sal_Int8)'0' ); + double nCharPixelWidth = xFont->getCharWidth( (sal_Int8)'0' ); double nPixelsPerMeter = xDevice->getInfo().PixelPerMeterX; double nCharWidth = nCharPixelWidth / nPixelsPerMeter; nCharWidth = nCharWidth * (double)56700;// in twips - return lcl_TwipsToPoints( (USHORT)nCharWidth ); + return lcl_TwipsToPoints( (USHORT)nCharWidth ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getColumnWidth() throw (uno::RuntimeException) { sal_Int32 nLen = m_Areas->getCount(); - if ( nLen > 1 ) + if ( nLen > 1 ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( sal_Int32(1) ), uno::Any() ), uno::UNO_QUERY_THROW ); return xRange->getColumnWidth(); } - double nColWidth = 0; + double nColWidth = 0; ScDocShell* pShell = getScDocShell(); if ( pShell ) { uno::Reference< frame::XModel > xModel = pShell->GetModel(); double defaultCharWidth = getDefaultCharWidth( xModel ); RangeHelper thisRange( mxRange ); - table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); + table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); sal_Int32 nStartCol = thisAddress.StartColumn; sal_Int32 nEndCol = thisAddress.EndColumn; USHORT nColTwips = 0; @@ -3673,7 +3692,7 @@ ScVbaRange::getColumnWidth() throw (uno::RuntimeException) { thisAddress.StartColumn = nCol; USHORT nCurTwips = pShell->GetDocument()->GetOriginalWidth( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCTAB >( thisAddress.Sheet ) ); - if ( nCol == nStartCol ) + if ( nCol == nStartCol ) nColTwips = nCurTwips; if ( nColTwips != nCurTwips ) return aNULL(); @@ -3686,11 +3705,11 @@ ScVbaRange::getColumnWidth() throw (uno::RuntimeException) return uno::makeAny( nColWidth ); } -void SAL_CALL +void SAL_CALL ScVbaRange::setColumnWidth( const uno::Any& _columnwidth ) throw (uno::RuntimeException) { sal_Int32 nLen = m_Areas->getCount(); - if ( nLen > 1 ) + if ( nLen > 1 ) { for ( sal_Int32 index = 1; index != nLen; ++index ) { @@ -3710,48 +3729,48 @@ ScVbaRange::setColumnWidth( const uno::Any& _columnwidth ) throw (uno::RuntimeEx { nColWidth = ( nColWidth * getDefaultCharWidth( xModel ) ); - RangeHelper thisRange( mxRange ); + RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); USHORT nTwips = lcl_pointsToTwips( nColWidth ); - + ScDocFunc aFunc(*pDocShell); SCCOLROW nColArr[2]; nColArr[0] = thisAddress.StartColumn; nColArr[1] = thisAddress.EndColumn; aFunc.SetWidthOrHeight( TRUE, 1, nColArr, thisAddress.Sheet, SC_SIZE_ORIGINAL, - nTwips, TRUE, TRUE ); - + nTwips, TRUE, TRUE ); + } } } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getWidth() throw (uno::RuntimeException) { - if ( m_Areas->getCount() > 1 ) + if ( m_Areas->getCount() > 1 ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( sal_Int32(1) ), uno::Any() ), uno::UNO_QUERY_THROW ); return xRange->getWidth(); } - uno::Reference< table::XColumnRowRange > xColRowRange( mxRange, uno::UNO_QUERY_THROW ); - uno::Reference< container::XIndexAccess > xIndexAccess( xColRowRange->getColumns(), uno::UNO_QUERY_THROW ); - sal_Int32 nElems = xIndexAccess->getCount(); + uno::Reference< table::XColumnRowRange > xColRowRange( mxRange, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( xColRowRange->getColumns(), uno::UNO_QUERY_THROW ); + sal_Int32 nElems = xIndexAccess->getCount(); double nWidth = 0; for ( sal_Int32 index=0; index<nElems; ++index ) { - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); double nTmpWidth = getCalcColWidth( xAddressable->getRangeAddress() ); nWidth += nTmpWidth; } return uno::makeAny( nWidth ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::Areas( const uno::Any& item) throw (uno::RuntimeException) { if ( !item.hasValue() ) return uno::makeAny( m_Areas ); - return m_Areas->Item( item, uno::Any() ); + return m_Areas->Item( item, uno::Any() ); } uno::Reference< excel::XRange > @@ -3818,28 +3837,28 @@ ScVbaRange::BorderAround( const css::uno::Any& LineStyle, const css::uno::Any& W return uno::makeAny( sal_True ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getRowHeight() throw (uno::RuntimeException) { sal_Int32 nLen = m_Areas->getCount(); - if ( nLen > 1 ) + if ( nLen > 1 ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( sal_Int32(1) ), uno::Any() ), uno::UNO_QUERY_THROW ); return xRange->getRowHeight(); - } + } - // if any row's RowHeight in the + // if any row's RowHeight in the // range is different from any other then return NULL - RangeHelper thisRange( mxRange ); + RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); - + sal_Int32 nStartRow = thisAddress.StartRow; sal_Int32 nEndRow = thisAddress.EndRow; USHORT nRowTwips = 0; // #TODO probably possible to use the SfxItemSet ( and see if // SFX_ITEM_DONTCARE is set ) to improve performance // #CHECKME looks like this is general behaviour not just row Range specific -// if ( mbIsRows ) +// if ( mbIsRows ) ScDocShell* pShell = getScDocShell(); if ( pShell ) { @@ -3857,11 +3876,11 @@ ScVbaRange::getRowHeight() throw (uno::RuntimeException) return uno::makeAny( nHeight ); } -void SAL_CALL +void SAL_CALL ScVbaRange::setRowHeight( const uno::Any& _rowheight) throw (uno::RuntimeException) { sal_Int32 nLen = m_Areas->getCount(); - if ( nLen > 1 ) + if ( nLen > 1 ) { for ( sal_Int32 index = 1; index != nLen; ++index ) { @@ -3873,20 +3892,20 @@ ScVbaRange::setRowHeight( const uno::Any& _rowheight) throw (uno::RuntimeExcepti double nHeight = 0; // Incomming height is in points _rowheight >>= nHeight; nHeight = lcl_Round2DecPlaces( nHeight ); - RangeHelper thisRange( mxRange ); + RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); USHORT nTwips = lcl_pointsToTwips( nHeight ); - + ScDocShell* pDocShell = getDocShellFromRange( mxRange ); ScDocFunc aFunc(*pDocShell); SCCOLROW nRowArr[2]; nRowArr[0] = thisAddress.StartRow; nRowArr[1] = thisAddress.EndRow; aFunc.SetWidthOrHeight( FALSE, 1, nRowArr, thisAddress.Sheet, SC_SIZE_ORIGINAL, - nTwips, TRUE, TRUE ); + nTwips, TRUE, TRUE ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getPageBreak() throw (uno::RuntimeException) { sal_Int32 nPageBreak = excel::XlPageBreak::xlPageBreakNone; @@ -3896,38 +3915,38 @@ ScVbaRange::getPageBreak() throw (uno::RuntimeException) RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); BOOL bColumn = FALSE; - + if (thisAddress.StartRow==0) bColumn = TRUE; - + uno::Reference< frame::XModel > xModel = pShell->GetModel(); if ( xModel.is() ) { ScDocument* pDoc = getDocumentFromRange( mxRange ); - + ScBreakType nBreak = BREAK_NONE; if ( !bColumn ) nBreak = pDoc->HasRowBreak(thisAddress.StartRow, thisAddress.Sheet); else nBreak = pDoc->HasColBreak(thisAddress.StartColumn, thisAddress.Sheet); - + if (nBreak & BREAK_PAGE) nPageBreak = excel::XlPageBreak::xlPageBreakAutomatic; - + if (nBreak & BREAK_MANUAL) nPageBreak = excel::XlPageBreak::xlPageBreakManual; - } + } } return uno::makeAny( nPageBreak ); } -void SAL_CALL +void SAL_CALL ScVbaRange::setPageBreak( const uno::Any& _pagebreak) throw (uno::RuntimeException) { - sal_Int32 nPageBreak = 0; + sal_Int32 nPageBreak = 0; _pagebreak >>= nPageBreak; - + ScDocShell* pShell = getDocShellFromRange( mxRange ); if ( pShell ) { @@ -3936,11 +3955,11 @@ ScVbaRange::setPageBreak( const uno::Any& _pagebreak) throw (uno::RuntimeExcepti if ((thisAddress.StartColumn==0) && (thisAddress.StartRow==0)) return; BOOL bColumn = FALSE; - + if (thisAddress.StartRow==0) bColumn = TRUE; - - ScAddress aAddr( static_cast<SCCOL>(thisAddress.StartColumn), thisAddress.StartRow, thisAddress.Sheet ); + + ScAddress aAddr( static_cast<SCCOL>(thisAddress.StartColumn), thisAddress.StartRow, thisAddress.Sheet ); uno::Reference< frame::XModel > xModel = pShell->GetModel(); if ( xModel.is() ) { @@ -3953,28 +3972,28 @@ ScVbaRange::setPageBreak( const uno::Any& _pagebreak) throw (uno::RuntimeExcepti } } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getHeight() throw (uno::RuntimeException) { - if ( m_Areas->getCount() > 1 ) + if ( m_Areas->getCount() > 1 ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( sal_Int32(1) ), uno::Any() ), uno::UNO_QUERY_THROW ); return xRange->getHeight(); } - - uno::Reference< table::XColumnRowRange > xColRowRange( mxRange, uno::UNO_QUERY_THROW ); - uno::Reference< container::XIndexAccess > xIndexAccess( xColRowRange->getRows(), uno::UNO_QUERY_THROW ); + + uno::Reference< table::XColumnRowRange > xColRowRange( mxRange, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( xColRowRange->getRows(), uno::UNO_QUERY_THROW ); sal_Int32 nElems = xIndexAccess->getCount(); double nHeight = 0; for ( sal_Int32 index=0; index<nElems; ++index ) { - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); nHeight += getCalcRowHeight(xAddressable->getRangeAddress() ); } return uno::makeAny( nHeight ); } -awt::Point +awt::Point ScVbaRange::getPosition() throw ( uno::RuntimeException ) { awt::Point aPoint; @@ -3986,7 +4005,7 @@ ScVbaRange::getPosition() throw ( uno::RuntimeException ) xProps->getPropertyValue(POSITION) >>= aPoint; return aPoint; } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getLeft() throw (uno::RuntimeException) { // helperapi returns the first ranges left ( and top below ) @@ -3997,9 +4016,9 @@ ScVbaRange::getLeft() throw (uno::RuntimeException) } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getTop() throw (uno::RuntimeException) -{ +{ // helperapi returns the first ranges top if ( m_Areas->getCount() > 1 ) return getArea( 0 )->getTop(); @@ -4026,7 +4045,7 @@ ScVbaRange::getWorksheet() throw (uno::RuntimeException) RangeHelper rHelper(xRange); // parent should be Thisworkbook xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) ); - } + } return xSheet; } @@ -4035,11 +4054,11 @@ ScVbaRange::getWorksheet() throw (uno::RuntimeException) uno::Reference< excel::XRange > ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xContext, const css::uno::Any &Cell1, const css::uno::Any &Cell2 ) throw (css::uno::RuntimeException) { - // Althought the documentation seems clear that Range without a + // Althought the documentation seems clear that Range without a // qualifier then its a shortcut for ActiveSheet.Range - // however, similarly Application.Range is apparently also a + // however, similarly Application.Range is apparently also a // shortcut for ActiveSheet.Range - // The is however a subtle behavioural difference I've come across + // The is however a subtle behavioural difference I've come across // wrt to named ranges. // If a named range "test" exists { Sheet1!$A1 } and the active sheet // is Sheet2 then the following will fail @@ -4049,14 +4068,14 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC // msgbox Range("test").Address ' works // msgbox Application.Range("test").Address ' works - // Single param Range + // Single param Range rtl::OUString sRangeName; Cell1 >>= sRangeName; if ( Cell1.hasValue() && !Cell2.hasValue() && sRangeName.getLength() ) { const static rtl::OUString sNamedRanges( RTL_CONSTASCII_USTRINGPARAM("NamedRanges")); uno::Reference< beans::XPropertySet > xPropSet( getCurrentExcelDoc(xContext), uno::UNO_QUERY_THROW ); - + uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( sNamedRanges ), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XCellRangeReferrer > xReferrer; try @@ -4078,13 +4097,13 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC } } uno::Reference< sheet::XSpreadsheetView > xView( getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY ); - uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW ); ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange ); uno::Reference< excel::XRange > xVbSheetRange( pRange ); - return pRange->Range( Cell1, Cell2, true ); + return pRange->Range( Cell1, Cell2, true ); } -uno::Reference< sheet::XDatabaseRanges > +uno::Reference< sheet::XDatabaseRanges > lcl_GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) { uno::Reference< frame::XModel > xModel; @@ -4092,11 +4111,11 @@ lcl_GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW ); uno::Reference< sheet::XDatabaseRanges > xDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges") ) ), uno::UNO_QUERY_THROW ); - return xDBRanges; + return xDBRanges; } // returns the XDatabaseRange for the autofilter on sheet (nSheet) // also populates sName with the name of range -uno::Reference< sheet::XDatabaseRange > +uno::Reference< sheet::XDatabaseRange > lcl_GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) { uno::Reference< container::XIndexAccess > xIndexAccess( lcl_GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); @@ -4105,8 +4124,8 @@ lcl_GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index ) { uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); - uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW ); - // autofilters work weirdly with openoffice, unnamed is the default + uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW ); + // autofilters work weirdly with openoffice, unnamed is the default // named range which is used to create an autofilter, but // its also possible that another name could be used // this also causes problems when an autofilter is created on @@ -4120,14 +4139,14 @@ lcl_GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto; if ( bHasAuto ) { - sName = xNamed->getName(); + sName = xNamed->getName(); xDataBaseRange=xDBRange; break; } } } return xDataBaseRange; -} +} // Helper functions for AutoFilter ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) @@ -4153,7 +4172,7 @@ ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam ) { if ( pDocShell ) - { + { ScViewData* pViewData = pDocShell->GetViewData(); if ( pViewData ) { @@ -4165,8 +4184,8 @@ void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam ) ScQueryParam lcl_GetQueryParam( ScDocShell* pDocShell, sal_Int16 nSheet ) { - ScDBData* pDBData = lcl_GetDBData_Impl( pDocShell, nSheet ); - ScQueryParam aParam; + ScDBData* pDBData = lcl_GetDBData_Impl( pDocShell, nSheet ); + ScQueryParam aParam; if (pDBData) { pDBData->GetQueryParam( aParam ); @@ -4205,7 +4224,7 @@ void lcl_SetAllQueryForField( ScDocShell* pDocShell, SCCOLROW nField, sal_Int16 // Modifies sCriteria, and nOp depending on the value of sCriteria void lcl_setTableFieldsFromCriteria( rtl::OUString& sCriteria1, uno::Reference< beans::XPropertySet >& xDescProps, sheet::TableFilterField2& rFilterField ) { - // #TODO make this more efficient and cycle through + // #TODO make this more efficient and cycle through // sCriteria1 character by character to pick up <,<>,=, * etc. // right now I am more concerned with just getting it to work right @@ -4228,28 +4247,28 @@ void lcl_setTableFieldsFromCriteria( rtl::OUString& sCriteria1, uno::Reference< { rFilterField.Operator = sheet::FilterOperator2::EQUAL; sCriteria1 = sCriteria1.copy( EQUALS.getLength() ); - sCriteria1 = VBAToRegexp( sCriteria1 ); - // UseRegularExpressions + sCriteria1 = VBAToRegexp( sCriteria1 ); + // UseRegularExpressions if ( xDescProps.is() ) xDescProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseRegularExpressions" ) ), uno::Any( sal_True ) ); } } - else if ( ( nPos = sCriteria1.indexOf( NOTEQUALS ) ) == 0 ) + else if ( ( nPos = sCriteria1.indexOf( NOTEQUALS ) ) == 0 ) { if ( sCriteria1.getLength() == NOTEQUALS.getLength() ) - rFilterField.Operator = sheet::FilterOperator2::NOT_EMPTY; + rFilterField.Operator = sheet::FilterOperator2::NOT_EMPTY; else { rFilterField.Operator = sheet::FilterOperator2::NOT_EQUAL; sCriteria1 = sCriteria1.copy( NOTEQUALS.getLength() ); - sCriteria1 = VBAToRegexp( sCriteria1 ); - // UseRegularExpressions + sCriteria1 = VBAToRegexp( sCriteria1 ); + // UseRegularExpressions if ( xDescProps.is() ) xDescProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseRegularExpressions" ) ), uno::Any( sal_True ) ); } - } - else if ( ( nPos = sCriteria1.indexOf( GREATERTHAN ) ) == 0 ) + } + else if ( ( nPos = sCriteria1.indexOf( GREATERTHAN ) ) == 0 ) { bIsNumeric = true; if ( ( nPos = sCriteria1.indexOf( GREATERTHANEQUALS ) ) == 0 ) @@ -4264,7 +4283,7 @@ void lcl_setTableFieldsFromCriteria( rtl::OUString& sCriteria1, uno::Reference< } } - else if ( ( nPos = sCriteria1.indexOf( LESSTHAN ) ) == 0 ) + else if ( ( nPos = sCriteria1.indexOf( LESSTHAN ) ) == 0 ) { bIsNumeric = true; if ( ( nPos = sCriteria1.indexOf( LESSTHANEQUALS ) ) == 0 ) @@ -4287,22 +4306,22 @@ void lcl_setTableFieldsFromCriteria( rtl::OUString& sCriteria1, uno::Reference< rFilterField.IsNumeric= sal_True; rFilterField.NumericValue = sCriteria1.toDouble(); } - rFilterField.StringValue = sCriteria1; + rFilterField.StringValue = sCriteria1; } -void SAL_CALL +void SAL_CALL ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const uno::Any& Operator, const uno::Any& Criteria2, const uno::Any& VisibleDropDown ) throw (uno::RuntimeException) { - // Is there an existing autofilter - RangeHelper thisRange( mxRange ); + // Is there an existing autofilter + RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); sal_Int16 nSheet = thisAddress.Sheet; ScDocShell* pShell = getScDocShell(); - sal_Bool bHasAuto = sal_False; + sal_Bool bHasAuto = sal_False; rtl::OUString sAutofiltRangeName; uno::Reference< sheet::XDatabaseRange > xDataBaseRange = lcl_GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName ); if ( xDataBaseRange.is() ) - bHasAuto = true; + bHasAuto = true; uno::Reference< table::XCellRange > xFilterRange; if ( !bHasAuto ) @@ -4310,7 +4329,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const if ( m_Areas->getCount() > 1 ) throw uno::RuntimeException( STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY, uno::Reference< uno::XInterface >() ); - table::CellRangeAddress autoFiltAddress; + table::CellRangeAddress autoFiltAddress; //CurrentRegion() if ( isSingleCellRange() ) { @@ -4326,7 +4345,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const autoFiltAddress = currentRegion.getCellRangeAddressable()->getRangeAddress(); } } - } + } else // multi-cell range { RangeHelper multiCellRange( mxRange ); @@ -4345,25 +4364,25 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const xDataBaseRange.set( xDBRanges->getByName( sGenName ), uno::UNO_QUERY_THROW ); } if ( !xDataBaseRange.is() ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Failed to find the autofilter placeholder range" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Failed to find the autofilter placeholder range" ) ), uno::Reference< uno::XInterface >() ); uno::Reference< beans::XPropertySet > xDBRangeProps( xDataBaseRange, uno::UNO_QUERY_THROW ); // set autofilt - xDBRangeProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ), uno::Any(sal_True) ); + xDBRangeProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ), uno::Any(sal_True) ); // set header uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW ); sal_Bool bHasColHeader = sal_False; ScDocument* pDoc = pShell ? pShell->GetDocument() : NULL; - + bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) ) ? sal_True : sal_False; - xFiltProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ContainsHeader") ), uno::Any( bHasColHeader ) ); + xFiltProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ContainsHeader") ), uno::Any( bHasColHeader ) ); } sal_Int32 nField = 0; // *IS* 1 based rtl::OUString sCriteria1; sal_Int32 nOperator = excel::XlAutoFilterOperator::xlAnd; - + sal_Bool bVisible = sal_True; bool bChangeDropDown = false; VisibleDropDown >>= bVisible; @@ -4372,8 +4391,8 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const // required bVisible = sal_False; else - bChangeDropDown = true; - sheet::FilterConnection nConn = sheet::FilterConnection_AND; + bChangeDropDown = true; + sheet::FilterConnection nConn = sheet::FilterConnection_AND; double nCriteria1 = 0; bool bHasCritValue = Criteria1.hasValue(); @@ -4381,11 +4400,11 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const if ( bHasCritValue ) bCritHasNumericValue = ( Criteria1 >>= nCriteria1 ); - if ( !Field.hasValue() && ( Criteria1.hasValue() || Operator.hasValue() || Criteria2.hasValue() ) ) + if ( !Field.hasValue() && ( Criteria1.hasValue() || Operator.hasValue() || Criteria2.hasValue() ) ) throw uno::RuntimeException(); // Use the normal uno api, sometimes e.g. when you want to use ALL as the filter // we can't use refresh as the uno interface doesn't have a concept of ALL - // in this case we just call the core calc functionality - + // in this case we just call the core calc functionality - bool bAll = false;; if ( ( Field >>= nField ) ) { @@ -4396,11 +4415,11 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const uno::Sequence< sheet::TableFilterField2 > sTabFilts; uno::Reference< beans::XPropertySet > xDescProps( xDesc, uno::UNO_QUERY_THROW ); if ( Criteria1.hasValue() ) - { + { sTabFilts.realloc( 1 ); sTabFilts[0].Operator = sheet::FilterOperator2::EQUAL;// sensible default if ( !bCritHasNumericValue ) - { + { Criteria1 >>= sCriteria1; sTabFilts[0].IsNumeric = bCritHasNumericValue; if ( bHasCritValue && sCriteria1.getLength() ) @@ -4417,15 +4436,15 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const else // no value specified bAll = true; // not sure what the relationship between Criteria1 and Operator is, - // e.g. can you have a Operator without a Criteria ? in openoffice it + // e.g. can you have a Operator without a Criteria ? in openoffice it if ( Operator.hasValue() && ( Operator >>= nOperator ) ) { // if its a bottom/top Ten(Percent/Value) and there // is no value specified for critera1 set it to 10 if ( !bCritHasNumericValue && !sCriteria1.getLength() && ( nOperator != excel::XlAutoFilterOperator::xlOr ) && ( nOperator != excel::XlAutoFilterOperator::xlAnd ) ) { - sTabFilts[0].IsNumeric = sal_True; - sTabFilts[0].NumericValue = 10; + sTabFilts[0].IsNumeric = sal_True; + sTabFilts[0].NumericValue = 10; bAll = false; } switch ( nOperator ) @@ -4450,21 +4469,21 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const break; default: throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UnknownOption") ), uno::Reference< uno::XInterface >() ); + + } - } - - } + } if ( !bAll ) { - sTabFilts[0].Connection = sheet::FilterConnection_AND; - sTabFilts[0].Field = (nField - 1); + sTabFilts[0].Connection = sheet::FilterConnection_AND; + sTabFilts[0].Field = (nField - 1); rtl::OUString sCriteria2; if ( Criteria2.hasValue() ) // there is a Criteria2 { sTabFilts.realloc(2); sTabFilts[1].Field = sTabFilts[0].Field; - sTabFilts[1].Connection = nConn; + sTabFilts[1].Connection = nConn; if ( Criteria2 >>= sCriteria2 ) { @@ -4490,16 +4509,16 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const xDataBaseRange->refresh(); } else - // was 0 based now seems to be 1 + // was 0 based now seems to be 1 lcl_SetAllQueryForField( pShell, nField, nSheet ); } } - else + else { - // this is just to toggle autofilter on and off ( not to be confused with - // a VisibleDropDown option combined with a field, in that case just the + // this is just to toggle autofilter on and off ( not to be confused with + // a VisibleDropDown option combined with a field, in that case just the // button should be disabled ) - currently we don't support that - bChangeDropDown = true; + bChangeDropDown = true; uno::Reference< beans::XPropertySet > xDBRangeProps( xDataBaseRange, uno::UNO_QUERY_THROW ); if ( bHasAuto ) { @@ -4523,7 +4542,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const } } -void SAL_CALL +void SAL_CALL ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (uno::RuntimeException) { sal_Bool bCopyOrigin = sal_True; @@ -4534,7 +4553,7 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (u // #TODO investigate resultant behaviour using these constants // currently just processing Shift - sheet::CellInsertMode mode = sheet::CellInsertMode_NONE; + sheet::CellInsertMode mode = sheet::CellInsertMode_NONE; if ( Shift.hasValue() ) { sal_Int32 nShift = 0; @@ -4551,7 +4570,7 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (u throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ("Illegal paramater ") ), uno::Reference< uno::XInterface >() ); } } - else + else { if ( getRow() >= getColumn() ) mode = sheet::CellInsertMode_DOWN; @@ -4559,15 +4578,15 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (u mode = sheet::CellInsertMode_RIGHT; } RangeHelper thisRange( mxRange ); - table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); - uno::Reference< sheet::XCellRangeMovement > xCellRangeMove( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); + table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); + uno::Reference< sheet::XCellRangeMovement > xCellRangeMove( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); xCellRangeMove->insertCells( thisAddress, mode ); if ( bCopyOrigin ) { // After the insert ( this range ) actually has moved ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) ); uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getDocShellFromRange( mxRange ) , aRange ) ); - uno::Reference< excel::XRange > xVbaRange( new ScVbaRange( mxParent, mxContext, xRange, mbIsRows, mbIsColumns ) ); + uno::Reference< excel::XRange > xVbaRange( new ScVbaRange( mxParent, mxContext, xRange, mbIsRows, mbIsColumns ) ); xVbaRange->PasteSpecial( uno::Any(), uno::Any(), uno::Any(), uno::Any() ); } } @@ -4576,7 +4595,7 @@ void SAL_CALL ScVbaRange::Autofit() throw (uno::RuntimeException) { sal_Int32 nLen = m_Areas->getCount(); - if ( nLen > 1 ) + if ( nLen > 1 ) { for ( sal_Int32 index = 1; index != nLen; ++index ) { @@ -4589,13 +4608,13 @@ ScVbaRange::Autofit() throw (uno::RuntimeException) // throw an error if ( !( mbIsColumns || mbIsRows ) ) - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); ScDocShell* pDocShell = getDocShellFromRange( mxRange ); if ( pDocShell ) { - RangeHelper thisRange( mxRange ); + RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); - + ScDocFunc aFunc(*pDocShell); SCCOLROW nColArr[2]; nColArr[0] = thisAddress.StartColumn; @@ -4608,16 +4627,16 @@ ScVbaRange::Autofit() throw (uno::RuntimeException) nColArr[1] = thisAddress.EndRow; } aFunc.SetWidthOrHeight( bDirection, 1, nColArr, thisAddress.Sheet, SC_SIZE_OPTIMAL, - 0, TRUE, TRUE ); - - } + 0, TRUE, TRUE ); + + } } /*************************************************************************************** - * interface for text: + * interface for text: * com.sun.star.text.XText, com.sun.star.table.XCell, com.sun.star.container.XEnumerationAccess - * com.sun.star.text.XTextRange, - * the main problem is to recognize the numeric and date, which assosiate with DecimalSeparator, ThousandsSeparator, + * com.sun.star.text.XTextRange, + * the main problem is to recognize the numeric and date, which assosiate with DecimalSeparator, ThousandsSeparator, * TrailingMinusNumbers and FieldInfo. ***************************************************************************************/ void SAL_CALL @@ -4651,7 +4670,7 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any } sal_Bool bDilimited = ( xlTextParsingType == excel::XlTextParsingType::xlDelimited ); - sal_Int16 xlTextQualifier = excel::XlTextQualifier::xlTextQualifierDoubleQuote; + sal_Int16 xlTextQualifier = excel::XlTextQualifier::xlTextQualifierDoubleQuote; if( TextQualifier.hasValue() ) { if( !( TextQualifier >>= xlTextQualifier )) @@ -4745,7 +4764,7 @@ ScVbaRange::Hyperlinks( const uno::Any& aIndex ) throw (uno::RuntimeException) /* The range object always returns a new Hyperlinks object containing a fixed list of existing hyperlinks in the range. See vbahyperlinks.hxx for more details. */ - + // get the global hyperlink object of the sheet (sheet should always be the parent of a Range object) uno::Reference< excel::XWorksheet > xWorksheet( getParent(), uno::UNO_QUERY_THROW ); uno::Reference< excel::XHyperlinks > xSheetHlinks( xWorksheet->Hyperlinks( uno::Any() ), uno::UNO_QUERY_THROW ); @@ -4763,7 +4782,7 @@ ScVbaRange::Hyperlinks( const uno::Any& aIndex ) throw (uno::RuntimeException) css::uno::Reference< excel::XValidation > SAL_CALL ScVbaRange::getValidation() throw (css::uno::RuntimeException) { - if ( !m_xValidation.is() ) + if ( !m_xValidation.is() ) m_xValidation = new ScVbaValidation( this, mxContext, mxRange ); return m_xValidation; } @@ -4846,12 +4865,12 @@ uno::Any SAL_CALL ScVbaRange::getPrefixCharacter() throw (uno::RuntimeException) character, if the cell is right-aligned; a circumflex character, if the cell is centered; a backslash character, if the cell is set to filled; or an empty string, if nothing of the above. - + If a range or a list of ranges contains texts with leading apostroph character as well as other cells, this function returns an empty string. */ - + if( mxRange.is() ) return lclGetPrefixVariant( lclGetPrefixChar( mxRange ) ); if( mxRanges.is() ) @@ -4866,7 +4885,7 @@ uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException) // 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 ); @@ -4880,7 +4899,7 @@ uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException) 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; + 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(); @@ -4909,9 +4928,8 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru // 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; + + bool bShowDetail = extractBoolFromAny( aShowDetail ); RangeHelper helper( mxRange ); uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor(); @@ -4923,9 +4941,9 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru 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 + { + // #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 ); @@ -4938,7 +4956,7 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru } } -uno::Reference< excel::XRange > SAL_CALL +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); @@ -4957,7 +4975,7 @@ ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeExceptio } else { - ScRange refRange( static_cast< SCCOL >( aCellAddress.StartColumn ), static_cast< SCROW >( aCellAddress.StartRow ), static_cast< SCTAB >( aCellAddress.Sheet ), + ScRange refRange( static_cast< SCCOL >( aCellAddress.StartColumn ), static_cast< SCROW >( aCellAddress.StartRow ), static_cast< SCTAB >( aCellAddress.Sheet ), static_cast< SCCOL >( aCellAddress.EndColumn ), static_cast< SCROW >( aCellAddress.EndRow ), static_cast< SCTAB >( aCellAddress.Sheet ) ); uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell() , refRange ) ); return new ScVbaRange( mxParent, mxContext,xRange ); @@ -4967,13 +4985,13 @@ ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeExceptio return new ScVbaRange( mxParent, mxContext, mxRange ); } -void SAL_CALL +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) { ScDocShell* pShell = NULL; sal_Int32 nItems = m_Areas->getCount(); - uno::Sequence< table::CellRangeAddress > printAreas( nItems ); + uno::Sequence< table::CellRangeAddress > printAreas( nItems ); uno::Reference< sheet::XPrintAreas > xPrintAreas; for ( sal_Int32 index=1; index <= nItems; ++index ) { @@ -5002,25 +5020,25 @@ ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& } void SAL_CALL -ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const uno::Any& Type ) throw (uno::RuntimeException) +ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const uno::Any& Type ) throw (uno::RuntimeException) { uno::Reference< excel::XRange > xDest( Destination, uno::UNO_QUERY_THROW ); ScVbaRange* pRange = getImplementation( xDest ); RangeHelper destRangeHelper( pRange->mxRange ); - table::CellRangeAddress destAddress = destRangeHelper.getCellRangeAddressable()->getRangeAddress(); - + table::CellRangeAddress destAddress = destRangeHelper.getCellRangeAddressable()->getRangeAddress(); + RangeHelper thisRange( mxRange ); - table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); + table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); ScRange sourceRange; ScRange destRange; - ScUnoConversion::FillScRange( destRange, destAddress ); + ScUnoConversion::FillScRange( destRange, destAddress ); ScUnoConversion::FillScRange( sourceRange, thisAddress ); - - + + // source is valid -// if ( !sourceRange.In( destRange ) ) -// throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "source not in destination" ) ), uno::Reference< uno::XInterface >() ); +// if ( !sourceRange.In( destRange ) ) +// throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "source not in destination" ) ), uno::Reference< uno::XInterface >() ); FillDir eDir = FILL_TO_BOTTOM; double fStep = 1.0; @@ -5030,7 +5048,7 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const // default to include the number of Rows in the source range; SCCOLROW nSourceCount = ( sourceRange.aEnd.Row() - sourceRange.aStart.Row() ) + 1; - SCCOLROW nCount = 0; + SCCOLROW nCount = 0; if ( sourceRange != destRange ) { @@ -5041,7 +5059,7 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const { nSourceCount = ( sourceRange.aEnd.Col() - sourceRange.aStart.Col() + 1 ); aSourceRange.aEnd.SetCol( static_cast<SCCOL>( aSourceRange.aStart.Col() + nSourceCount - 1 ) ); - eDir = FILL_TO_RIGHT; + eDir = FILL_TO_RIGHT; nCount = aRange.aEnd.Col() - aSourceRange.aEnd.Col(); } else if ( sourceRange.aEnd.Col() == destRange.aEnd.Col() ) @@ -5052,13 +5070,13 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const } } - else if ( aSourceRange.aEnd == destRange.aEnd ) + else if ( aSourceRange.aEnd == destRange.aEnd ) { if ( sourceRange.aStart.Col() == destRange.aStart.Col() ) { aSourceRange.aStart.SetRow( static_cast<SCROW>( aSourceRange.aEnd.Row() - nSourceCount + 1 ) ); nCount = aSourceRange.aStart.Row() - aRange.aStart.Row(); - eDir = FILL_TO_TOP; + eDir = FILL_TO_TOP; fStep = -fStep; } else if ( sourceRange.aStart.Row() == destRange.aStart.Row() ) @@ -5066,15 +5084,15 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const nSourceCount = ( sourceRange.aEnd.Col() - sourceRange.aStart.Col() ) + 1; aSourceRange.aStart.SetCol( static_cast<SCCOL>( aSourceRange.aEnd.Col() - nSourceCount + 1 ) ); nCount = aSourceRange.aStart.Col() - aRange.aStart.Col(); - eDir = FILL_TO_LEFT; + eDir = FILL_TO_LEFT; fStep = -fStep; } } - } + } ScDocShell* pDocSh= getDocShellFromRange( mxRange ); FillCmd eCmd = FILL_AUTO; - FillDateCmd eDateCmd = FILL_DAY; + FillDateCmd eDateCmd = FILL_DAY; #ifdef VBA_OOBUILD_HACK double fEndValue = MAXDOUBLE; @@ -5082,12 +5100,12 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const if ( Type.hasValue() ) { - sal_Int16 nFillType = excel::XlAutoFillType::xlFillDefault; + sal_Int16 nFillType = excel::XlAutoFillType::xlFillDefault; Type >>= nFillType; switch ( nFillType ) { case excel::XlAutoFillType::xlFillCopy: - eCmd = FILL_SIMPLE; + eCmd = FILL_SIMPLE; fStep = 0.0; break; case excel::XlAutoFillType::xlFillDays: @@ -5117,9 +5135,9 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const break; case excel::XlAutoFillType::xlFillDefault: default: - eCmd = FILL_AUTO; + eCmd = FILL_AUTO; break; - } + } } ScDocFunc aFunc(*pDocSh); #ifdef VBA_OOBUILD_HACK @@ -5144,7 +5162,7 @@ ScVbaRange::GoalSeek( const uno::Any& Goal, const uno::Reference< excel::XRange table::CellAddress changingCell( changingCellAddr.Sheet, changingCellAddr.StartColumn, changingCellAddr.StartRow ); sheet::GoalResult res = xGoalSeek->seekGoal( thisCell, changingCell, sGoal ); ChangingCell->setValue( uno::makeAny( res.Result ) ); - + // openoffice behaves differently, result is 0 if the divergence is too great // but... if it detects 0 is the value it requires then it will use that // e.g. divergence & result both = 0.0 does NOT mean there is an error @@ -5162,7 +5180,7 @@ ScVbaRange::Calculate( ) throw (script::BasicErrorException, uno::RuntimeExcept getWorksheet()->Calculate(); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaRange::Item( const uno::Any& row, const uno::Any& column ) throw (script::BasicErrorException, uno::RuntimeException) { if ( mbIsRows || mbIsColumns ) @@ -5176,7 +5194,7 @@ ScVbaRange::Item( const uno::Any& row, const uno::Any& column ) throw (script::B xRange = Rows( row ); return xRange; } - return Cells( row, column ); + return Cells( row, column ); } void @@ -5185,11 +5203,11 @@ ScVbaRange::AutoOutline( ) throw (script::BasicErrorException, uno::RuntimeExce // #TODO #FIXME needs to check for summary row/col ( whatever they are ) // not valid for multi Area Addresses 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 + 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 ) - // also the Single cell cause doesn't seem to be handled specially in - // this code ( ported from the helperapi RangeImpl.java, + // also the Single cell cause doesn't seem to be handled specially in + // this code ( ported from the helperapi RangeImpl.java, // RangeRowsImpl.java, RangesImpl.java, RangeSingleCellImpl.java RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); @@ -5197,7 +5215,7 @@ ScVbaRange::AutoOutline( ) throw (script::BasicErrorException, uno::RuntimeExce if ( isSingleCellRange() || mbIsRows ) { uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); - xSheetOutline->autoOutline( thisAddress ); + xSheetOutline->autoOutline( thisAddress ); } else DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); @@ -5212,17 +5230,17 @@ ScVbaRange:: ClearOutline( ) throw (script::BasicErrorException, uno::RuntimeEx for ( sal_Int32 index=1; index <= nItems; ++index ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - xRange->ClearOutline(); + xRange->ClearOutline(); } return; } RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); - xSheetOutline->clearOutline(); + xSheetOutline->clearOutline(); } -void +void ScVbaRange::groupUnGroup( bool bUnGroup ) throw ( script::BasicErrorException, uno::RuntimeException ) { if ( m_Areas->getCount() > 1 ) @@ -5239,23 +5257,23 @@ ScVbaRange::groupUnGroup( bool bUnGroup ) throw ( script::BasicErrorException, u xSheetOutline->group( thisAddress, nOrient ); } -void SAL_CALL +void SAL_CALL ScVbaRange::Group( ) throw (script::BasicErrorException, uno::RuntimeException) { - groupUnGroup(); + groupUnGroup(); } -void SAL_CALL +void SAL_CALL ScVbaRange::Ungroup( ) throw (script::BasicErrorException, uno::RuntimeException) { - groupUnGroup(true); + groupUnGroup(true); } void lcl_mergeCellsOfRange( const uno::Reference< table::XCellRange >& xCellRange, sal_Bool _bMerge = sal_True ) throw ( uno::RuntimeException ) { uno::Reference< util::XMergeable > xMergeable( xCellRange, uno::UNO_QUERY_THROW ); - xMergeable->merge(_bMerge); + xMergeable->merge(_bMerge); } -void SAL_CALL +void SAL_CALL ScVbaRange::Merge( const uno::Any& Across ) throw (script::BasicErrorException, uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -5264,11 +5282,11 @@ ScVbaRange::Merge( const uno::Any& Across ) throw (script::BasicErrorException, for ( sal_Int32 index=1; index <= nItems; ++index ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - xRange->Merge(Across); + xRange->Merge(Across); } return; } - uno::Reference< table::XCellRange > oCellRange; + uno::Reference< table::XCellRange > oCellRange; sal_Bool bAcross = sal_False; Across >>= bAcross; if ( !bAcross ) @@ -5284,7 +5302,7 @@ ScVbaRange::Merge( const uno::Any& Across ) throw (script::BasicErrorException, } } -void SAL_CALL +void SAL_CALL ScVbaRange::UnMerge( ) throw (script::BasicErrorException, uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -5293,14 +5311,14 @@ ScVbaRange::UnMerge( ) throw (script::BasicErrorException, uno::RuntimeExceptio for ( sal_Int32 index=1; index <= nItems; ++index ) { uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - xRange->UnMerge(); + xRange->UnMerge(); } return; } lcl_mergeCellsOfRange( mxRange, sal_False); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaRange::getStyle() throw (uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -5312,11 +5330,11 @@ ScVbaRange::getStyle() throw (uno::RuntimeException) rtl::OUString sStyleName; xProps->getPropertyValue(CELLSTYLE) >>= sStyleName; ScDocShell* pShell = getScDocShell(); - uno::Reference< frame::XModel > xModel( pShell->GetModel() ); + uno::Reference< frame::XModel > xModel( pShell->GetModel() ); uno::Reference< excel::XStyle > xStyle = new ScVbaStyle( this, mxContext, sStyleName, xModel ); return uno::makeAny( xStyle ); } -void SAL_CALL +void SAL_CALL ScVbaRange::setStyle( const uno::Any& _style ) throw (uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -5333,11 +5351,11 @@ ScVbaRange::setStyle( const uno::Any& _style ) throw (uno::RuntimeException) uno::Reference< excel::XRange > ScVbaRange::PreviousNext( bool bIsPrevious ) -{ +{ ScMarkData markedRange; - ScRange refRange; + ScRange refRange; RangeHelper thisRange( mxRange ); - + ScUnoConversion::FillScRange( refRange, thisRange.getCellRangeAddressable()->getRangeAddress()); markedRange. SetMarkArea( refRange ); short nMove = bIsPrevious ? -1 : 1; @@ -5346,8 +5364,8 @@ ScVbaRange::PreviousNext( bool bIsPrevious ) SCROW nNewY = refRange.aStart.Row(); SCTAB nTab = refRange.aStart.Tab(); - ScDocument* pDoc = getScDocument(); - pDoc->GetNextPos( nNewX,nNewY, nTab, nMove,0, TRUE,TRUE, markedRange ); + ScDocument* pDoc = getScDocument(); + pDoc->GetNextPos( nNewX,nNewY, nTab, nMove,0, TRUE,TRUE, markedRange ); refRange.aStart.SetCol( nNewX ); refRange.aStart.SetRow( nNewY ); refRange.aStart.SetTab( nTab ); @@ -5356,11 +5374,11 @@ ScVbaRange::PreviousNext( bool bIsPrevious ) refRange.aEnd.SetTab( nTab ); uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell() , refRange ) ); - + return new ScVbaRange( mxParent, mxContext, xRange ); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaRange::Next() throw (script::BasicErrorException, uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -5371,7 +5389,7 @@ ScVbaRange::Next() throw (script::BasicErrorException, uno::RuntimeException) return PreviousNext( false ); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaRange::Previous() throw (script::BasicErrorException, uno::RuntimeException) { if ( m_Areas->getCount() > 1 ) @@ -5385,7 +5403,7 @@ ScVbaRange::Previous() throw (script::BasicErrorException, uno::RuntimeException uno::Reference< excel::XRange > SAL_CALL ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw ( script::BasicErrorException ) { - bool bIsSingleCell = isSingleCellRange(); + bool bIsSingleCell = isSingleCellRange(); bool bIsMultiArea = ( m_Areas->getCount() > 1 ); ScVbaRange* pRangeToUse = this; sal_Int32 nType = 0; @@ -5396,7 +5414,7 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw case excel::XlCellType::xlCellTypeSameFormatConditions: case excel::XlCellType::xlCellTypeAllValidation: case excel::XlCellType::xlCellTypeSameValidation: - DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); + DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); break; case excel::XlCellType::xlCellTypeBlanks: case excel::XlCellType::xlCellTypeComments: @@ -5424,9 +5442,9 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw uno::Reference< excel::XRange > xTmpRange( m_Areas->Item( uno::makeAny( nArea ), uno::Any() ), uno::UNO_QUERY_THROW ); RangeHelper rHelper( xTmpRange->getCellRange() ); rangeResults.push_back( rHelper.getCellRangeAddressable()->getRangeAddress() ); - } + } } - } + } ScRangeList aCellRanges; std::vector< table::CellRangeAddress >::iterator it = rangeResults.begin(); std::vector< table::CellRangeAddress >::iterator it_end = rangeResults.end(); @@ -5443,24 +5461,24 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw return new ScVbaRange( mxParent, mxContext, xRange ); } uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( getScDocShell(), aCellRanges ) ); - + return new ScVbaRange( mxParent, mxContext, xRanges ); } else if ( bIsSingleCell ) { uno::Reference< excel::XRange > xUsedRange = getWorksheet()->getUsedRange(); - pRangeToUse = static_cast< ScVbaRange* >( xUsedRange.get() ); + pRangeToUse = static_cast< ScVbaRange* >( xUsedRange.get() ); } - + break; - } + } default: DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); break; } if ( !pRangeToUse ) DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); - return pRangeToUse->SpecialCellsImpl( nType, _oValue ); + return pRangeToUse->SpecialCellsImpl( nType, _oValue ); } sal_Int32 lcl_getFormulaResultFlags(const uno::Any& aType) throw ( script::BasicErrorException ) @@ -5473,7 +5491,7 @@ sal_Int32 lcl_getFormulaResultFlags(const uno::Any& aType) throw ( script::Basic { case excel::XlSpecialCellsValue::xlErrors: nRes= sheet::FormulaResult::ERROR; - break; + break; case excel::XlSpecialCellsValue::xlLogical: //TODO bc93774: ask NN if this is really an appropriate substitute nRes = sheet::FormulaResult::VALUE; @@ -5490,7 +5508,7 @@ sal_Int32 lcl_getFormulaResultFlags(const uno::Any& aType) throw ( script::Basic return nRes; } -uno::Reference< excel::XRange > +uno::Reference< excel::XRange > ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue) throw ( script::BasicErrorException ) { uno::Reference< excel::XRange > xRange; @@ -5505,9 +5523,9 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue) throw ( case excel::XlCellType::xlCellTypeSameFormatConditions: case excel::XlCellType::xlCellTypeAllValidation: case excel::XlCellType::xlCellTypeSameValidation: - // Shouldn't get here ( should be filtered out by + // Shouldn't get here ( should be filtered out by // ScVbaRange::SpecialCells() - DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); + DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); break; case excel::XlCellType::xlCellTypeBlanks: xLocSheetCellRanges = xQuery->queryEmptyCells(); @@ -5516,7 +5534,7 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue) throw ( xLocSheetCellRanges = xQuery->queryContentCells(sheet::CellFlags::ANNOTATION); break; case excel::XlCellType::xlCellTypeConstants: - xLocSheetCellRanges = xQuery->queryContentCells(23); + xLocSheetCellRanges = xQuery->queryContentCells(23); break; case excel::XlCellType::xlCellTypeFormulas: { @@ -5527,7 +5545,7 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue) throw ( case excel::XlCellType::xlCellTypeLastCell: xRange = Cells( uno::makeAny( getCount() ), uno::Any() ); case excel::XlCellType::xlCellTypeVisible: - xLocSheetCellRanges = xQuery->queryVisibleCells(); + xLocSheetCellRanges = xQuery->queryVisibleCells(); break; default: DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); @@ -5540,19 +5558,19 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue) throw ( } catch (uno::Exception& ) { - DebugHelper::exception(SbERR_METHOD_FAILED, STR_ERRORMESSAGE_NOCELLSWEREFOUND); + DebugHelper::exception(SbERR_METHOD_FAILED, STR_ERRORMESSAGE_NOCELLSWEREFOUND); } return xRange; } -void SAL_CALL +void SAL_CALL ScVbaRange::RemoveSubtotal( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< sheet::XSubTotalCalculatable > xSub( mxRange, uno::UNO_QUERY_THROW ); - xSub->removeSubTotals(); + xSub->removeSubTotals(); } -void SAL_CALL +void SAL_CALL ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno::Sequence< ::sal_Int32 >& _nTotalList, const uno::Any& aReplace, const uno::Any& PageBreaks, const uno::Any& /*SummaryBelowData*/ ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -5623,14 +5641,14 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno:: } } -rtl::OUString& +rtl::OUString& ScVbaRange::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaRange") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaRange::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx index e7488e434f30..14f0bde9e803 100644 --- a/sc/source/ui/vba/vbarange.hxx +++ b/sc/source/ui/vba/vbarange.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -69,7 +69,7 @@ class ArrayVisitor { public: virtual void visitNode( sal_Int32 x, sal_Int32 y, const css::uno::Reference< css::table::XCell >& xCell ) = 0; - virtual ~ArrayVisitor(){} + virtual ~ArrayVisitor(){} }; class ValueSetter : public ArrayVisitor @@ -82,7 +82,7 @@ public: class ValueGetter : public ArrayVisitor { - + public: virtual void processValue( sal_Int32 x, sal_Int32 y, const css::uno::Any& aValue ) = 0; virtual const css::uno::Any& getValue() const = 0; @@ -105,7 +105,7 @@ class ScVbaRange : public ScVbaRange_BASE css::uno::Reference< ov::excel::XRange > getEntireColumnOrRow( bool bColumn = true ) throw( css::uno::RuntimeException ); - void fillSeries( css::sheet::FillDirection nFillDirection, css::sheet::FillMode nFillMode, css::sheet::FillDateMode nFillDateMode, double fStep, double fEndValue ) throw( css::uno::RuntimeException ); + void fillSeries( css::sheet::FillDirection nFillDirection, css::sheet::FillMode nFillMode, css::sheet::FillDateMode nFillDateMode, double fStep, double fEndValue ) throw( css::uno::RuntimeException ); void ClearContents( sal_Int32 nFlags ) throw (css::uno::RuntimeException); virtual void setValue( const css::uno::Any& aValue, ValueSetter& setter) throw ( css::uno::RuntimeException); @@ -142,7 +142,7 @@ public: virtual ~ScVbaRange(); virtual css::uno::Reference< ov::XHelperInterface > thisHelperIface() { return this; } - bool isSingleCellRange(); + bool isSingleCellRange(); static css::uno::Reference< ov::excel::XRange > getRangeObjectForName( const css::uno::Reference< css::uno::XComponentContext >& xContext, @@ -182,14 +182,14 @@ public: virtual css::uno::Any SAL_CALL getHeight() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getTop() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getLeft() throw (css::uno::RuntimeException); - + virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getWorksheet() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getPageBreak() throw (css::uno::RuntimeException); virtual void SAL_CALL setPageBreak( const css::uno::Any& _pagebreak ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XValidation > SAL_CALL getValidation() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getPrefixCharacter() throw (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); + 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; } @@ -203,16 +203,16 @@ public: virtual void SAL_CALL FillRight() throw (css::uno::RuntimeException); virtual void SAL_CALL FillUp() throw (css::uno::RuntimeException); virtual void SAL_CALL FillDown() throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Offset( const css::uno::Any &nRowOffset, const css::uno::Any &nColOffset ) + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Offset( const css::uno::Any &nRowOffset, const css::uno::Any &nColOffset ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL CurrentRegion() throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL CurrentArray() throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL Characters( const css::uno::Any& nIndex, const css::uno::Any& nCount ) + virtual ::rtl::OUString SAL_CALL Characters( const css::uno::Any& nIndex, const css::uno::Any& nCount ) throw (css::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL Address( const css::uno::Any& RowAbsolute, const css::uno::Any& ColumnAbsolute, const css::uno::Any& ReferenceStyle, const css::uno::Any& External, const css::uno::Any& RelativeTo ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells( const css::uno::Any &nRow, const css::uno::Any &nCol ) + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells( const css::uno::Any &nRow, const css::uno::Any &nCol ) throw (css::uno::RuntimeException); virtual void SAL_CALL Select() throw (css::uno::RuntimeException); virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); @@ -220,7 +220,7 @@ public: virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns( const css::uno::Any &nIndex ) throw (css::uno::RuntimeException); virtual void SAL_CALL Copy( const css::uno::Any& Destination ) throw (css::uno::RuntimeException); virtual void SAL_CALL Cut( const css::uno::Any& Destination ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Resize( const css::uno::Any& RowSize, const css::uno::Any& ColumnSize ) + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Resize( const css::uno::Any& RowSize, const css::uno::Any& ColumnSize ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XFont > SAL_CALL Font() throw ( css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XInterior > SAL_CALL Interior( ) throw ( css::script::BasicErrorException, css::uno::RuntimeException) ; @@ -237,10 +237,10 @@ public: virtual void SAL_CALL Delete( const css::uno::Any& Shift ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Areas( const css::uno::Any& ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& ) throw ( css::script::BasicErrorException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL BorderAround( const css::uno::Any& LineStyle, + virtual css::uno::Any SAL_CALL BorderAround( const css::uno::Any& LineStyle, const css::uno::Any& Weight, const css::uno::Any& ColorIndex, const css::uno::Any& Color ) throw (css::uno::RuntimeException); virtual void SAL_CALL TextToColumns( const css::uno::Any& Destination, const css::uno::Any& DataType, const css::uno::Any& TextQualifier, - const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma, + const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma, const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& FieldInfo, const css::uno::Any& DecimalSeparator, const css::uno::Any& ThousandsSeparator, const css::uno::Any& TrailingMinusNumbers ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); @@ -250,7 +250,7 @@ public: virtual void SAL_CALL Autofit() 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 ) throw (css::uno::RuntimeException); virtual void SAL_CALL AutoFill( const css::uno::Reference< ov::excel::XRange >& Destination, const css::uno::Any& Type ) throw (css::uno::RuntimeException) ; - void SAL_CALL Calculate( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + void SAL_CALL Calculate( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL AutoOutline( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Item( const ::css::uno::Any& row, const css::uno::Any& column ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL ClearOutline( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); @@ -282,14 +282,14 @@ public: // #TODO completely rewrite ScVbaRange, its become a hackfest // it needs to be closer to ScCellRangeBase in that the underlying -// object model should probably be a ScRangelst. +// object model should probably be a ScRangelst. // * would be nice to be able to construct a range from an addres only // * or a list of address ( multi-area ) // * object should be a lightweight as possible // * we shouldn't need hacks like this below static css::uno::Reference< ov::excel::XRange > ApplicationRange( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Any &Cell1, const css::uno::Any &Cell2 ) throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL GoalSeek( const css::uno::Any& Goal, const css::uno::Reference< ov::excel::XRange >& ChangingCell ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL SpecialCells( const css::uno::Any& _oType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException ); + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL SpecialCells( const css::uno::Any& _oType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException ); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbaseriescollection.cxx b/sc/source/ui/vba/vbaseriescollection.cxx index 8caa746beff0..c1e08e1c72a0 100644 --- a/sc/source/ui/vba/vbaseriescollection.cxx +++ b/sc/source/ui/vba/vbaseriescollection.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; -ScVbaSeriesCollection::ScVbaSeriesCollection( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : SeriesCollection_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ) +ScVbaSeriesCollection::ScVbaSeriesCollection( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : SeriesCollection_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ) { } @@ -47,26 +47,26 @@ ScVbaSeriesCollection::createEnumeration() throw (uno::RuntimeException) // XElementAccess -uno::Type +uno::Type ScVbaSeriesCollection::getElementType() throw (uno::RuntimeException) { return excel::XSeries::static_type(0); } -uno::Any +uno::Any ScVbaSeriesCollection::createCollectionObject( const css::uno::Any& rSource ) { return rSource; } -rtl::OUString& +rtl::OUString& ScVbaSeriesCollection::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaSeriesCollection") ); return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaSeriesCollection::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbaseriescollection.hxx b/sc/source/ui/vba/vbaseriescollection.hxx index f61720102919..419691bb4af8 100644 --- a/sc/source/ui/vba/vbaseriescollection.hxx +++ b/sc/source/ui/vba/vbaseriescollection.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ typedef CollTestImplHelper< ov::excel::XSeriesCollection > SeriesCollection_BASE; class ScVbaSeriesCollection : public SeriesCollection_BASE -{ +{ css::uno::Reference< css::uno::XComponentContext > m_xContext; public: @@ -46,7 +46,7 @@ public: virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); // SeriesCollection_BASE - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx index 4bd0f1d60547..215a62cec364 100755 --- a/sc/source/ui/vba/vbasheetobject.cxx +++ b/sc/source/ui/vba/vbasheetobject.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -485,7 +485,7 @@ sal_Int32 SAL_CALL ScVbaButton::getOrientation() throw (uno::RuntimeException) // not supported return excel::XlOrientation::xlHorizontal; } - + void SAL_CALL ScVbaButton::setOrientation( sal_Int32 /*nOrientation*/ ) throw (uno::RuntimeException) { // not supported diff --git a/sc/source/ui/vba/vbasheetobject.hxx b/sc/source/ui/vba/vbasheetobject.hxx index b2546ca09c93..a7af03630d1f 100755 --- a/sc/source/ui/vba/vbasheetobject.hxx +++ b/sc/source/ui/vba/vbasheetobject.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -169,7 +169,7 @@ public: protected: sal_Int32 getModelIndexInForm() const throw (css::uno::RuntimeException); - + protected: css::uno::Reference< css::container::XIndexContainer > mxFormIC; css::uno::Reference< css::beans::XPropertySet > mxControlProps; @@ -206,7 +206,7 @@ public: // XButton methods css::uno::Reference< ov::excel::XCharacters > SAL_CALL Characters( const css::uno::Any& rStart, const css::uno::Any& rLength ) throw (css::uno::RuntimeException); - + // XHelperInterface VBAHELPER_DECL_XHELPERINTERFACE diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index ced94db5ba76..ba0d62b4c734 100755 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -375,7 +375,7 @@ public: protected: uno::Reference< container::XIndexContainer > createForm() throw (uno::RuntimeException); - + virtual bool implPickShape( const uno::Reference< drawing::XShape >& rxShape ) const; virtual OUString implGetShapeServiceName() const; virtual bool implCheckProperties( const uno::Reference< beans::XPropertySet >& rxModelProps ) const; diff --git a/sc/source/ui/vba/vbasheetobjects.hxx b/sc/source/ui/vba/vbasheetobjects.hxx index fd69d4927a20..ba6eb8c5fb25 100755 --- a/sc/source/ui/vba/vbasheetobjects.hxx +++ b/sc/source/ui/vba/vbasheetobjects.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -58,7 +58,7 @@ public: /** Updates the collection by fetching all shapes from the draw page. */ void collectShapes() throw (css::uno::RuntimeException); - + // XEnumerationAccess virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx index b99b2e783101..c3bcb5a74f32 100644 --- a/sc/source/ui/vba/vbastyle.cxx +++ b/sc/source/ui/vba/vbastyle.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ static rtl::OUString DISPLAYNAME( RTL_CONSTASCII_USTRINGPARAM("DisplayName") ); -uno::Reference< container::XNameAccess > +uno::Reference< container::XNameAccess > ScVbaStyle::getStylesNameContainer( const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) { uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( xModel, uno::UNO_QUERY_THROW); @@ -43,26 +43,26 @@ ScVbaStyle::getStylesNameContainer( const uno::Reference< frame::XModel >& xMode return xStylesAccess; } -uno::Reference< beans::XPropertySet > +uno::Reference< beans::XPropertySet > lcl_getStyleProps( const rtl::OUString& sStyleName, const uno::Reference< frame::XModel >& xModel ) throw ( script::BasicErrorException, uno::RuntimeException ) { - - uno::Reference< beans::XPropertySet > xStyleProps( ScVbaStyle::getStylesNameContainer( xModel )->getByName( sStyleName ), uno::UNO_QUERY_THROW ); + + uno::Reference< beans::XPropertySet > xStyleProps( ScVbaStyle::getStylesNameContainer( xModel )->getByName( sStyleName ), uno::UNO_QUERY_THROW ); return xStyleProps; } void ScVbaStyle::initialise() throw ( uno::RuntimeException ) { - if (!mxModel.is() ) - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XModel Interface could not be retrieved")) ); + if (!mxModel.is() ) + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XModel Interface could not be retrieved")) ); uno::Reference< lang::XServiceInfo > xServiceInfo( mxPropertySet, uno::UNO_QUERY_THROW ); if ( !xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.CellStyle" ) ) ) ) { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); } mxStyle.set( mxPropertySet, uno::UNO_QUERY_THROW ); - + uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxModel, uno::UNO_QUERY_THROW ); mxStyleFamilyNameContainer.set( ScVbaStyle::getStylesNameContainer( mxModel ), uno::UNO_QUERY_THROW ); @@ -93,25 +93,25 @@ ScVbaStyle::ScVbaStyle( const uno::Reference< XHelperInterface >& xParent, const } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaStyle::BuiltIn() throw (script::BasicErrorException, uno::RuntimeException) { return !mxStyle->isUserDefined(); } -void SAL_CALL +void SAL_CALL ScVbaStyle::setName( const ::rtl::OUString& Name ) throw (script::BasicErrorException, uno::RuntimeException) { mxStyle->setName(Name); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaStyle::getName() throw (script::BasicErrorException, uno::RuntimeException) { return mxStyle->getName(); } -void SAL_CALL +void SAL_CALL ScVbaStyle::setNameLocal( const ::rtl::OUString& NameLocal ) throw (script::BasicErrorException, uno::RuntimeException) { try @@ -124,7 +124,7 @@ ScVbaStyle::setNameLocal( const ::rtl::OUString& NameLocal ) throw (script::Basi } } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaStyle::getNameLocal() throw (script::BasicErrorException, uno::RuntimeException) { rtl::OUString sName; @@ -139,7 +139,7 @@ ScVbaStyle::getNameLocal() throw (script::BasicErrorException, uno::RuntimeExcep return sName; } -void SAL_CALL +void SAL_CALL ScVbaStyle::Delete() throw (script::BasicErrorException, uno::RuntimeException) { try @@ -152,13 +152,13 @@ ScVbaStyle::Delete() throw (script::BasicErrorException, uno::RuntimeException) } } -void SAL_CALL +void SAL_CALL ScVbaStyle::setMergeCells( const uno::Any& /*MergeCells*/ ) throw (script::BasicErrorException, uno::RuntimeException) { DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaStyle::getMergeCells( ) throw (script::BasicErrorException, uno::RuntimeException) { DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); diff --git a/sc/source/ui/vba/vbastyle.hxx b/sc/source/ui/vba/vbastyle.hxx index d5bb232dabc2..d0b888a55a90 100644 --- a/sc/source/ui/vba/vbastyle.hxx +++ b/sc/source/ui/vba/vbastyle.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -82,12 +82,12 @@ public: virtual void SAL_CALL setLocked( const css::uno::Any& Locked ) 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 setFormulaHidden( const css::uno::Any& FormulaHidden ) throw (css::script::BasicErrorException, css::uno::RuntimeException);; -/ virtual css::uno::Any SAL_CALL getFormulaHidden( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);; +/ virtual css::uno::Any SAL_CALL getFormulaHidden( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);; virtual void SAL_CALL setMergeCells( const css::uno::Any& MergeCells ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0; - virtual css::uno::Any SAL_CALL getMergeCells( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0; + virtual css::uno::Any SAL_CALL getMergeCells( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0; virtual void SAL_CALL setReadingOrder( const css::uno::Any& ReadingOrder ) throw (css::script::BasicErrorException, css::uno::RuntimeException);; virtual css::uno::Any SAL_CALL getReadingOrder( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);; -*/ +*/ // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index c323e2b3f6f6..2536195aa41a 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ css::uno::Any lcl_createAPIStyleToVBAObject( const css::uno::Any& aObject, const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) { uno::Reference< beans::XPropertySet > xStyleProps( aObject, uno::UNO_QUERY_THROW ); - uno::Reference< excel::XStyle > xStyle( new ScVbaStyle( xParent, xContext, xStyleProps, xModel ) ); + uno::Reference< excel::XStyle > xStyle( new ScVbaStyle( xParent, xContext, xStyleProps, xModel ) ); return uno::makeAny( xStyle ); } @@ -44,30 +44,30 @@ lcl_createAPIStyleToVBAObject( const css::uno::Any& aObject, const uno::Referenc ScVbaStyles::ScVbaStyles( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) throw ( script::BasicErrorException ) : ScVbaStyles_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( ScVbaStyle::getStylesNameContainer( xModel ), uno::UNO_QUERY_THROW ) ), mxModel( xModel ), mxParent( xParent ) { try - { + { mxMSF.set( mxModel, uno::UNO_QUERY_THROW ); mxNameContainerCellStyles.set( m_xNameAccess, uno::UNO_QUERY_THROW ); } - catch (uno::Exception& ) + catch (uno::Exception& ) { DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); } } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaStyles::getStyleNames() throw ( uno::RuntimeException ) { return mxNameContainerCellStyles->getElementNames(); } -uno::Any +uno::Any ScVbaStyles::createCollectionObject(const uno::Any& aObject) { return lcl_createAPIStyleToVBAObject( aObject, mxParent, mxContext, mxModel ); } -uno::Type SAL_CALL +uno::Type SAL_CALL ScVbaStyles::getElementType() throw (uno::RuntimeException) { return excel::XStyle::static_type(0); @@ -95,13 +95,13 @@ public: } }; -uno::Reference< container::XEnumeration > SAL_CALL +uno::Reference< container::XEnumeration > SAL_CALL ScVbaStyles::createEnumeration() throw (uno::RuntimeException) { return new EnumWrapper( m_xIndexAccess, mxParent, mxContext, mxModel ); } -uno::Reference< excel::XStyle > SAL_CALL +uno::Reference< excel::XStyle > SAL_CALL ScVbaStyles::Add( const ::rtl::OUString& _sName, const uno::Any& _aBasedOn ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< excel::XStyle > aRet; @@ -148,7 +148,7 @@ ScVbaStyles::Add( const ::rtl::OUString& _sName, const uno::Any& _aBasedOn ) thr return aRet; } -void +void ScVbaStyles::Delete(const rtl::OUString _sStyleName) throw ( script::BasicErrorException ) { try diff --git a/sc/source/ui/vba/vbastyles.hxx b/sc/source/ui/vba/vbastyles.hxx index 300596d6b3fe..088b2acda0ce 100644 --- a/sc/source/ui/vba/vbastyles.hxx +++ b/sc/source/ui/vba/vbastyles.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ typedef CollTestImplHelper< ov::excel::XStyles > ScVbaStyles_BASE; class ScVbaStyles: public ScVbaStyles_BASE { css::uno::Reference< css::frame::XModel > mxModel; - // hard ref to parent ( perhaps we should try this in the + // hard ref to parent ( perhaps we should try this in the // XHelperInterface itself css::uno::Reference< ov::XHelperInterface > mxParent; css::uno::Reference< css::lang::XMultiServiceFactory > mxMSF; @@ -47,11 +47,11 @@ public: virtual css::uno::Reference< ov::excel::XStyle > SAL_CALL Add( const ::rtl::OUString& Name, const css::uno::Any& BasedOn ) 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::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 +#endif diff --git a/sc/source/ui/vba/vbatextboxshape.cxx b/sc/source/ui/vba/vbatextboxshape.cxx index 0ef9e0f7393b..fef39600f1ba 100644 --- a/sc/source/ui/vba/vbatextboxshape.cxx +++ b/sc/source/ui/vba/vbatextboxshape.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,19 +39,19 @@ ScVbaTextBoxShape::ScVbaTextBoxShape( const uno::Reference< uno::XComponentConte m_xModel.set( xModel ); } -rtl::OUString SAL_CALL +rtl::OUString SAL_CALL ScVbaTextBoxShape::getText() throw (css::uno::RuntimeException) { return m_xTextRange->getString(); } -void SAL_CALL +void SAL_CALL ScVbaTextBoxShape::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException) { m_xTextRange->setString( _text ); } -uno::Reference< excel::XCharacters > SAL_CALL +uno::Reference< excel::XCharacters > SAL_CALL ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) throw (uno::RuntimeException) { ScDocShell* pDocShell = excel::getDocShell( m_xModel ); diff --git a/sc/source/ui/vba/vbatextboxshape.hxx b/sc/source/ui/vba/vbatextboxshape.hxx index c08a576b7155..f2e2905e0828 100644 --- a/sc/source/ui/vba/vbatextboxshape.hxx +++ b/sc/source/ui/vba/vbatextboxshape.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ class ScVbaTextBoxShape : public TextBoxShapeImpl_BASE 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); diff --git a/sc/source/ui/vba/vbatextframe.cxx b/sc/source/ui/vba/vbatextframe.cxx index b06777526c1f..cee807612cbb 100644 --- a/sc/source/ui/vba/vbatextframe.cxx +++ b/sc/source/ui/vba/vbatextframe.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ ScVbaTextFrame::ScVbaTextFrame( uno::Sequence< uno::Any> const & args, uno::Refe } // Methods -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaTextFrame::Characters() throw (uno::RuntimeException) { uno::Reference< text::XSimpleText > xSimpleText( m_xShape, uno::UNO_QUERY_THROW ); @@ -67,7 +67,7 @@ ScVbaTextFrame::getServiceNames() return aServiceNames; } -namespace textframe +namespace textframe { namespace sdecl = comphelper::service_decl; sdecl::vba_service_class_<ScVbaTextFrame, sdecl::with_args<true> > serviceImpl; diff --git a/sc/source/ui/vba/vbatextframe.hxx b/sc/source/ui/vba/vbatextframe.hxx index b48cd8752ef9..d465553fc718 100644 --- a/sc/source/ui/vba/vbatextframe.hxx +++ b/sc/source/ui/vba/vbatextframe.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/sc/source/ui/vba/vbatitle.hxx b/sc/source/ui/vba/vbatitle.hxx index fb97f3f20f0c..7eaf740b85fe 100644 --- a/sc/source/ui/vba/vbatitle.hxx +++ b/sc/source/ui/vba/vbatitle.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ class TitleImpl : public InheritedHelperInterfaceImpl< Ifc1 > { typedef InheritedHelperInterfaceImpl< Ifc1 > BaseClass; -protected: +protected: css::uno::Reference< css::drawing::XShape > xTitleShape; css::uno::Reference< css::beans::XPropertySet > xShapePropertySet; std::auto_ptr<ov::ShapeHelper> oShapeHelper; @@ -100,7 +100,7 @@ public: // #FIXME #TODO the helperapi Characters implementation doesn't // seem to do very much, need to know how the existing Characters // impl ( that we use for Range ) can be reused - return css::uno::Reference< ov::excel::XCharacters > (); + return css::uno::Reference< ov::excel::XCharacters > (); } void SAL_CALL setTop( double Top ) throw (css::script::BasicErrorException, css::uno::RuntimeException) @@ -140,9 +140,9 @@ public: catch (css::uno::Exception& ) { throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); - } + } return static_cast< sal_Int32 >(nSOOrientation / 100) ; - } + } // XHelperInterface rtl::OUString& getServiceImplName() { diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index e2a768549e11..f76794e3ef7c 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,7 +66,7 @@ lcl_getValidationProps( const uno::Reference< table::XCellRange >& xRange ) return xValProps; } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaValidation::getIgnoreBlank() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); @@ -75,74 +75,74 @@ ScVbaValidation::getIgnoreBlank() throw (uno::RuntimeException) return bBlank; } -void SAL_CALL +void SAL_CALL ScVbaValidation::setIgnoreBlank( ::sal_Bool _ignoreblank ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); - xProps->setPropertyValue( IGNOREBLANK, uno::makeAny( _ignoreblank ) ); - lcl_setValidationProps( m_xRange, xProps ); + xProps->setPropertyValue( IGNOREBLANK, uno::makeAny( _ignoreblank ) ); + lcl_setValidationProps( m_xRange, xProps ); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaValidation::getInCellDropdown() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange ); sal_Int32 nShowList = 0; - xProps->getPropertyValue( SHOWLIST ) >>= nShowList; + xProps->getPropertyValue( SHOWLIST ) >>= nShowList; return ( nShowList ? sal_True : sal_False ); } -void SAL_CALL +void SAL_CALL ScVbaValidation::setInCellDropdown( ::sal_Bool _incelldropdown ) throw (uno::RuntimeException) { sal_Int32 nDropDown = sal_False; if ( _incelldropdown ) nDropDown = 1; uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps(m_xRange) ); - xProps->setPropertyValue( SHOWLIST, uno::makeAny( nDropDown ) ); + xProps->setPropertyValue( SHOWLIST, uno::makeAny( nDropDown ) ); lcl_setValidationProps( m_xRange, xProps ); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaValidation::getShowInput() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange ); sal_Bool bShowInput = sal_False; - xProps->getPropertyValue( SHOWINPUT ) >>= bShowInput; + xProps->getPropertyValue( SHOWINPUT ) >>= bShowInput; return bShowInput; } -void SAL_CALL +void SAL_CALL ScVbaValidation:: setShowInput( ::sal_Bool _showinput ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps(m_xRange) ); - xProps->setPropertyValue( IGNOREBLANK, uno::makeAny( _showinput ) ); + xProps->setPropertyValue( IGNOREBLANK, uno::makeAny( _showinput ) ); lcl_setValidationProps( m_xRange, xProps ); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaValidation::getShowError() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange ); sal_Bool bShowError = sal_False; - xProps->getPropertyValue( SHOWERROR ) >>= bShowError; + xProps->getPropertyValue( SHOWERROR ) >>= bShowError; return bShowError; } -void SAL_CALL +void SAL_CALL ScVbaValidation::setShowError( ::sal_Bool _showerror ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); - xProps->setPropertyValue( SHOWERROR, uno::makeAny( _showerror ) ); + xProps->setPropertyValue( SHOWERROR, uno::makeAny( _showerror ) ); lcl_setValidationProps( m_xRange, xProps ); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaValidation::getErrorTitle() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange ); rtl::OUString sErrorTitle; - xProps->getPropertyValue( ERRORTITLE ) >>= sErrorTitle; + xProps->getPropertyValue( ERRORTITLE ) >>= sErrorTitle; return sErrorTitle; } @@ -150,63 +150,63 @@ void ScVbaValidation::setErrorTitle( const rtl::OUString& _errormessage ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); - xProps->setPropertyValue( ERRORTITLE, uno::makeAny( _errormessage ) ); + xProps->setPropertyValue( ERRORTITLE, uno::makeAny( _errormessage ) ); lcl_setValidationProps( m_xRange, xProps ); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaValidation::getInputMessage() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange ); rtl::OUString sMsg; - xProps->getPropertyValue( INPUTMESS ) >>= sMsg; + xProps->getPropertyValue( INPUTMESS ) >>= sMsg; return sMsg; } -void SAL_CALL +void SAL_CALL ScVbaValidation::setInputMessage( const ::rtl::OUString& _inputmessage ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); - xProps->setPropertyValue( INPUTMESS, uno::makeAny( _inputmessage ) ); + xProps->setPropertyValue( INPUTMESS, uno::makeAny( _inputmessage ) ); lcl_setValidationProps( m_xRange, xProps ); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaValidation::getInputTitle() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange ); rtl::OUString sString; - xProps->getPropertyValue( INPUTTITLE ) >>= sString; + xProps->getPropertyValue( INPUTTITLE ) >>= sString; return sString; } -void SAL_CALL +void SAL_CALL ScVbaValidation::setInputTitle( const ::rtl::OUString& _inputtitle ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); - xProps->setPropertyValue( INPUTTITLE, uno::makeAny( _inputtitle ) ); + xProps->setPropertyValue( INPUTTITLE, uno::makeAny( _inputtitle ) ); lcl_setValidationProps( m_xRange, xProps ); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaValidation::getErrorMessage() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange ); rtl::OUString sString; - xProps->getPropertyValue( ERRORMESS ) >>= sString; + xProps->getPropertyValue( ERRORMESS ) >>= sString; return sString; } -void SAL_CALL +void SAL_CALL ScVbaValidation::setErrorMessage( const ::rtl::OUString& _errormessage ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); - xProps->setPropertyValue( ERRORMESS, uno::makeAny( _errormessage ) ); + xProps->setPropertyValue( ERRORMESS, uno::makeAny( _errormessage ) ); lcl_setValidationProps( m_xRange, xProps ); } -void SAL_CALL +void SAL_CALL ScVbaValidation::Delete( ) throw (uno::RuntimeException) { rtl::OUString sBlank; @@ -218,19 +218,19 @@ ScVbaValidation::Delete( ) throw (uno::RuntimeException) xProps->setPropertyValue( ERRORTITLE, uno::makeAny( sBlank ) ); xProps->setPropertyValue( INPUTMESS, uno::makeAny( sBlank) ); xProps->setPropertyValue( ALERTSTYLE, uno::makeAny( sheet::ValidationAlertStyle_STOP) ); - xProps->setPropertyValue( STYPE, uno::makeAny( sheet::ValidationType_ANY ) ); + xProps->setPropertyValue( STYPE, uno::makeAny( sheet::ValidationType_ANY ) ); xCond->setFormula1( sBlank ); xCond->setFormula2( sBlank ); xCond->setOperator( sheet::ConditionOperator_NONE ); lcl_setValidationProps( m_xRange, xProps ); } -void SAL_CALL +void SAL_CALL ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& /*Operator*/, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); uno::Reference< sheet::XSheetCondition > xCond( xProps, uno::UNO_QUERY_THROW ); - + sheet::ValidationType nValType = sheet::ValidationType_ANY; xProps->getPropertyValue( STYPE ) >>= nValType; if ( nValType != sheet::ValidationType_ANY ) @@ -239,7 +239,7 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un if ( !Type.hasValue() || !( Type >>= nType ) ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "missing required param" ) ), uno::Reference< uno::XInterface >() ); - Delete(); // set up defaults + Delete(); // set up defaults rtl::OUString sFormula1; Formula1 >>= sFormula1; rtl::OUString sFormula2; @@ -248,25 +248,25 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un { case excel::XlDVType::xlValidateList: { - // for validate list + // for validate list // at least formula1 is required if ( !Formula1.hasValue() ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "missing param" ) ), uno::Reference< uno::XInterface >() ); nValType = sheet::ValidationType_LIST; - xProps->setPropertyValue( STYPE, uno::makeAny(nValType )); + xProps->setPropertyValue( STYPE, uno::makeAny(nValType )); // #TODO validate required params // #TODO need to correct the ';' delimited formula on get/set break; } case excel::XlDVType::xlValidateWholeNumber: nValType = sheet::ValidationType_WHOLE; - xProps->setPropertyValue( STYPE, uno::makeAny(nValType )); - break; + xProps->setPropertyValue( STYPE, uno::makeAny(nValType )); + break; default: throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "unsupported operation..." ) ), uno::Reference< uno::XInterface >() ); } - sheet::ValidationAlertStyle eStyle = sheet::ValidationAlertStyle_STOP; + sheet::ValidationAlertStyle eStyle = sheet::ValidationAlertStyle_STOP; sal_Int32 nVbaAlertStyle = excel::XlDVAlertStyle::xlValidAlertStop; if ( AlertStyle.hasValue() && ( AlertStyle >>= nVbaAlertStyle ) ) { @@ -275,18 +275,18 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un case excel::XlDVAlertStyle::xlValidAlertStop: // yes I know it's already defaulted but safer to assume // someone propbably could change the code above - eStyle = sheet::ValidationAlertStyle_STOP; - break; + eStyle = sheet::ValidationAlertStyle_STOP; + break; case excel::XlDVAlertStyle::xlValidAlertWarning: - eStyle = sheet::ValidationAlertStyle_WARNING; - break; + eStyle = sheet::ValidationAlertStyle_WARNING; + break; case excel::XlDVAlertStyle::xlValidAlertInformation: - eStyle = sheet::ValidationAlertStyle_INFO; - break; + eStyle = sheet::ValidationAlertStyle_INFO; + break; default: throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "bad param..." ) ), uno::Reference< uno::XInterface >() ); - } + } } xProps->setPropertyValue( ALERTSTYLE, uno::makeAny( eStyle ) ); @@ -295,32 +295,32 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un xCond->setFormula1( sFormula1 ); if ( sFormula2.getLength() ) xCond->setFormula2( sFormula2 ); - - lcl_setValidationProps( m_xRange, xProps ); + + lcl_setValidationProps( m_xRange, xProps ); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaValidation::getFormula1() throw (uno::RuntimeException) { uno::Reference< sheet::XSheetCondition > xCond( lcl_getValidationProps( m_xRange ), uno::UNO_QUERY_THROW ); return xCond->getFormula1(); } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaValidation::getFormula2() throw (uno::RuntimeException) { uno::Reference< sheet::XSheetCondition > xCond( lcl_getValidationProps( m_xRange ), uno::UNO_QUERY_THROW ); return xCond->getFormula2(); } -rtl::OUString& +rtl::OUString& ScVbaValidation::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaValidation") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaValidation::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbavalidation.hxx b/sc/source/ui/vba/vbavalidation.hxx index 563ee1d003b6..18c6a9f7467f 100644 --- a/sc/source/ui/vba/vbavalidation.hxx +++ b/sc/source/ui/vba/vbavalidation.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,9 +35,9 @@ typedef InheritedHelperInterfaceImpl1<ov::excel::XValidation > ValidationImpl_BASE; class ScVbaValidation : public ValidationImpl_BASE -{ +{ css::uno::Reference< css::table::XCellRange > m_xRange; - + public: ScVbaValidation( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::table::XCellRange >& xRange ) : ValidationImpl_BASE( xParent, xContext ), m_xRange( xRange) {} // Attributes @@ -68,4 +68,4 @@ public: }; -#endif +#endif diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index 10dad39341b7..079ec5282187 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ typedef ::cppu::WeakImplHelper1< container::XEnumeration > Enumeration_BASE; -typedef ::cppu::WeakImplHelper3< container::XEnumerationAccess +typedef ::cppu::WeakImplHelper3< container::XEnumerationAccess , com::sun::star::container::XIndexAccess , com::sun::star::container::XNameAccess > SelectedSheets_BASE; @@ -84,12 +84,12 @@ public: m_it = m_sheets.begin(); } // XEnumeration - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { return m_it != m_sheets.end(); } - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { if ( !hasMoreElements() ) { throw container::NoSuchElementException(); @@ -106,7 +106,7 @@ class SelectedSheetsEnumAccess : public SelectedSheets_BASE uno::Reference< uno::XComponentContext > m_xContext; NameIndexHash namesToIndices; Sheets sheets; - uno::Reference< frame::XModel > m_xModel; + uno::Reference< frame::XModel > m_xModel; public: SelectedSheetsEnumAccess( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ):m_xContext( xContext ), m_xModel( xModel ) { @@ -119,7 +119,7 @@ public: ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( !pViewShell ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cannot obtain view shell" ) ), uno::Reference< uno::XInterface >() ); - + SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); uno::Sequence<sal_Int32> aSheets( nTabCount ); SCTAB nIndex = 0; @@ -139,60 +139,60 @@ public: } } - + //XEnumerationAccess virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) { - return new SelectedSheetsEnum( m_xContext, sheets, m_xModel ); + return new SelectedSheetsEnum( m_xContext, sheets, m_xModel ); } // XIndexAccess - virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) - { + virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { return sheets.size(); } - virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw ( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw ( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + { if ( Index < 0 - || static_cast< Sheets::size_type >( Index ) >= sheets.size() ) + || static_cast< Sheets::size_type >( Index ) >= sheets.size() ) throw lang::IndexOutOfBoundsException(); - + return uno::makeAny( sheets[ Index ] ); } //XElementAccess virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) - { - return excel::XWorksheet::static_type(0); + { + return excel::XWorksheet::static_type(0); } - virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) - { + virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) + { return (sheets.size() > 0); } //XNameAccess - virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { NameIndexHash::const_iterator it = namesToIndices.find( aName ); if ( it == namesToIndices.end() ) throw container::NoSuchElementException(); return uno::makeAny( sheets[ it->second ] ); - + } - virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) - { + virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) + { uno::Sequence< ::rtl::OUString > names( namesToIndices.size() ); ::rtl::OUString* pString = names.getArray(); NameIndexHash::const_iterator it = namesToIndices.begin(); NameIndexHash::const_iterator it_end = namesToIndices.end(); for ( ; it != it_end; ++it, ++pString ) - *pString = it->first; - return names; + *pString = it->first; + return names; } - virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) - { + virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) + { NameIndexHash::const_iterator it = namesToIndices.find( aName ); return (it != namesToIndices.end()); } @@ -238,19 +238,19 @@ ScVbaWindow::Scroll( const uno::Any& Down, const uno::Any& Up, const uno::Any& T m_xPane->SmallScroll( Down, Up, ToRight, ToLeft ); } -void SAL_CALL +void SAL_CALL ScVbaWindow::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any& ToRight, const uno::Any& ToLeft ) throw (uno::RuntimeException) { Scroll( Down, Up, ToRight, ToLeft ); } -void SAL_CALL +void SAL_CALL ScVbaWindow::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any& ToRight, const uno::Any& ToLeft ) throw (uno::RuntimeException) { Scroll( Down, Up, ToRight, ToLeft, true ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWindow::SelectedSheets( const uno::Any& aIndex ) throw (uno::RuntimeException) { uno::Reference< container::XEnumerationAccess > xEnumAccess( new SelectedSheetsEnumAccess( mxContext, m_xModel ) ); @@ -259,12 +259,12 @@ ScVbaWindow::SelectedSheets( const uno::Any& aIndex ) throw (uno::RuntimeExcepti if ( aIndex.hasValue() ) { uno::Reference< XCollection > xColl( xSheets, uno::UNO_QUERY_THROW ); - return xColl->Item( aIndex, uno::Any() ); + return xColl->Item( aIndex, uno::Any() ); } - return uno::makeAny( xSheets ); + return uno::makeAny( xSheets ); } -void SAL_CALL +void SAL_CALL ScVbaWindow::ScrollWorkbookTabs( const uno::Any& /*Sheets*/, const uno::Any& /*Position*/ ) throw (uno::RuntimeException) { // #TODO #FIXME need some implementation to scroll through the tabs @@ -272,7 +272,7 @@ ScVbaWindow::ScrollWorkbookTabs( const uno::Any& /*Sheets*/, const uno::Any& /*P /* sal_Int32 nSheets = 0; sal_Int32 nPosition = 0; - throw uno::RuntimeException( rtl::OUString::createFromAscii("No Implemented" ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString::createFromAscii("No Implemented" ), uno::Reference< uno::XInterface >() ); sal_Bool bSheets = ( Sheets >>= nSheets ); sal_Bool bPosition = ( Position >>= nPosition ); if ( bSheets || bPosition ) // at least one param specified @@ -289,12 +289,12 @@ getPropsFromModel( const uno::Reference< frame::XModel >& xModel ) uno::Reference< frame::XController > xController = xModel->getCurrentController(); if ( !xController.is() ) throw uno::RuntimeException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM ("No controller for model") ), uno::Reference< uno::XInterface >() ); + RTL_CONSTASCII_USTRINGPARAM ("No controller for model") ), uno::Reference< uno::XInterface >() ); return uno::Reference< beans::XPropertySet >( xController->getFrame(), uno::UNO_QUERY ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWindow::getCaption() throw (uno::RuntimeException) { static rtl::OUString sCrud(RTL_CONSTASCII_USTRINGPARAM(" - OpenOffice.org Calc" ) ); @@ -302,8 +302,8 @@ ScVbaWindow::getCaption() throw (uno::RuntimeException) uno::Reference< beans::XPropertySet > xProps = getPropsFromModel( m_xModel ); rtl::OUString sTitle; - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SC_UNONAME_TITLE ) ) ) >>= sTitle; - sal_Int32 nCrudIndex = sTitle.indexOf( sCrud ); + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SC_UNONAME_TITLE ) ) ) >>= sTitle; + sal_Int32 nCrudIndex = sTitle.indexOf( sCrud ); // adjust title ( by removing crud ) // sCrud string present if ( nCrudIndex != -1 ) @@ -318,8 +318,8 @@ ScVbaWindow::getCaption() throw (uno::RuntimeException) // is like XL // if the adjusted title == workbook name, use name // if the adjusted title != workbook name but ... - // name == title + extension ( .csv, ,odt, .xls ) - // etc. then also use the name + // name == title + extension ( .csv, ,odt, .xls ) + // etc. then also use the name if ( !sTitle.equals( sName ) ) { @@ -331,40 +331,40 @@ ScVbaWindow::getCaption() throw (uno::RuntimeException) sTitle = sName; } } - } + } return uno::makeAny( sTitle ); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setCaption( const uno::Any& _caption ) throw (uno::RuntimeException) { - + uno::Reference< beans::XPropertySet > xProps = getPropsFromModel( m_xModel ); xProps->setPropertyValue( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM ( SC_UNONAME_TITLE ) ) , _caption ); + RTL_CONSTASCII_USTRINGPARAM ( SC_UNONAME_TITLE ) ) , _caption ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWindow::getScrollRow() throw (uno::RuntimeException) -{ +{ sal_Int32 nValue = 0; - ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart(); nValue = pViewShell->GetViewData()->GetPosY(WhichV(eWhich)); } - + return uno::makeAny( nValue + 1); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setScrollRow( const uno::Any& _scrollrow ) throw (uno::RuntimeException) { - ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { - sal_Int32 scrollRow = 0; + sal_Int32 scrollRow = 0; _scrollrow >>= scrollRow; ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart(); sal_Int32 nOldValue = pViewShell->GetViewData()->GetPosY(WhichV(eWhich)) + 1; @@ -372,27 +372,27 @@ ScVbaWindow::setScrollRow( const uno::Any& _scrollrow ) throw (uno::RuntimeExcep } } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWindow::getScrollColumn() throw (uno::RuntimeException) -{ +{ sal_Int32 nValue = 0; - ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart(); nValue = pViewShell->GetViewData()->GetPosX(WhichH(eWhich)); } - + return uno::makeAny( nValue + 1); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setScrollColumn( const uno::Any& _scrollcolumn ) throw (uno::RuntimeException) { - ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { - sal_Int32 scrollColumn = 0; + sal_Int32 scrollColumn = 0; _scrollcolumn >>= scrollColumn; ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart(); sal_Int32 nOldValue = pViewShell->GetViewData()->GetPosX(WhichH(eWhich)) + 1; @@ -400,11 +400,11 @@ ScVbaWindow::setScrollColumn( const uno::Any& _scrollcolumn ) throw (uno::Runtim } } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWindow::getWindowState() throw (uno::RuntimeException) -{ +{ sal_Int32 nwindowState = xlNormal; - ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame(); WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow(); if ( pWork ) @@ -417,12 +417,12 @@ ScVbaWindow::getWindowState() throw (uno::RuntimeException) return uno::makeAny( nwindowState ); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setWindowState( const uno::Any& _windowstate ) throw (uno::RuntimeException) { sal_Int32 nwindowState = xlMaximized; _windowstate >>= nwindowState; - ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame(); WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow(); if ( pWork ) @@ -454,19 +454,19 @@ ScVbaWindow::Close( const uno::Any& SaveChanges, const uno::Any& FileName, const } uno::Reference< excel::XPane > SAL_CALL -ScVbaWindow::ActivePane() throw (script::BasicErrorException, uno::RuntimeException) -{ +ScVbaWindow::ActivePane() throw (script::BasicErrorException, uno::RuntimeException) +{ return new ScVbaPane( this, mxContext, m_xModel, m_xViewPane ); } -uno::Reference< excel::XRange > SAL_CALL +uno::Reference< excel::XRange > SAL_CALL ScVbaWindow::ActiveCell( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); return xApplication->getActiveCell(); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWindow::Selection( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); @@ -488,11 +488,11 @@ ScVbaWindow::getDisplayGridlines() throw (uno::RuntimeException) rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SHOWGRID ) ); sal_Bool bGrid = sal_True; xProps->getPropertyValue( sName ) >>= bGrid; - return bGrid; + return bGrid; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setDisplayGridlines( ::sal_Bool _displaygridlines ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -500,17 +500,17 @@ ScVbaWindow::setDisplayGridlines( ::sal_Bool _displaygridlines ) throw (uno::Run xProps->setPropertyValue( sName, uno::makeAny( _displaygridlines )); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWindow::getDisplayHeadings() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_COLROWHDR ) ); sal_Bool bHeading = sal_True; xProps->getPropertyValue( sName ) >>= bHeading; - return bHeading; + return bHeading; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setDisplayHeadings( ::sal_Bool _bDisplayHeadings ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -518,17 +518,17 @@ ScVbaWindow::setDisplayHeadings( ::sal_Bool _bDisplayHeadings ) throw (uno::Runt xProps->setPropertyValue( sName, uno::makeAny( _bDisplayHeadings )); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWindow::getDisplayHorizontalScrollBar() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_HORSCROLL ) ); sal_Bool bHorizontalScrollBar = sal_True; xProps->getPropertyValue( sName ) >>= bHorizontalScrollBar; - return bHorizontalScrollBar; + return bHorizontalScrollBar; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setDisplayHorizontalScrollBar( ::sal_Bool _bDisplayHorizontalScrollBar ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -536,17 +536,17 @@ ScVbaWindow::setDisplayHorizontalScrollBar( ::sal_Bool _bDisplayHorizontalScroll xProps->setPropertyValue( sName, uno::makeAny( _bDisplayHorizontalScrollBar )); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWindow::getDisplayOutline() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_OUTLSYMB ) ); sal_Bool bOutline = sal_True; xProps->getPropertyValue( sName ) >>= bOutline; - return bOutline; + return bOutline; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setDisplayOutline( ::sal_Bool _bDisplayOutline ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -554,17 +554,17 @@ ScVbaWindow::setDisplayOutline( ::sal_Bool _bDisplayOutline ) throw (uno::Runtim xProps->setPropertyValue( sName, uno::makeAny( _bDisplayOutline )); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWindow::getDisplayVerticalScrollBar() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_VERTSCROLL ) ); sal_Bool bVerticalScrollBar = sal_True; xProps->getPropertyValue( sName ) >>= bVerticalScrollBar; - return bVerticalScrollBar; + return bVerticalScrollBar; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setDisplayVerticalScrollBar( ::sal_Bool _bDisplayVerticalScrollBar ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -572,17 +572,17 @@ ScVbaWindow::setDisplayVerticalScrollBar( ::sal_Bool _bDisplayVerticalScrollBar xProps->setPropertyValue( sName, uno::makeAny( _bDisplayVerticalScrollBar )); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWindow::getDisplayWorkbookTabs() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SHEETTABS ) ); sal_Bool bWorkbookTabs = sal_True; xProps->getPropertyValue( sName ) >>= bWorkbookTabs; - return bWorkbookTabs; + return bWorkbookTabs; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setDisplayWorkbookTabs( ::sal_Bool _bDisplayWorkbookTabs ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -590,13 +590,13 @@ ScVbaWindow::setDisplayWorkbookTabs( ::sal_Bool _bDisplayWorkbookTabs ) throw (u xProps->setPropertyValue( sName, uno::makeAny( _bDisplayWorkbookTabs )); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWindow::getFreezePanes() throw (uno::RuntimeException) { - return m_xViewFreezable->hasFrozenPanes(); + return m_xViewFreezable->hasFrozenPanes(); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setFreezePanes( ::sal_Bool /*_bFreezePanes*/ ) throw (uno::RuntimeException) { if( m_xViewSplitable->getIsWindowSplit() ) @@ -608,21 +608,21 @@ ScVbaWindow::setFreezePanes( ::sal_Bool /*_bFreezePanes*/ ) throw (uno::RuntimeE } else { - // otherwise we freeze in the center of the visible sheet + // otherwise we freeze in the center of the visible sheet table::CellRangeAddress aCellRangeAddress = m_xViewPane->getVisibleRange(); sal_Int32 nColumn = aCellRangeAddress.StartColumn + (( aCellRangeAddress.EndColumn - aCellRangeAddress.StartColumn )/2 ); sal_Int32 nRow = aCellRangeAddress.StartRow + (( aCellRangeAddress.EndRow - aCellRangeAddress.StartRow )/2 ); - m_xViewFreezable->freezeAtPosition( nColumn, nRow ); + m_xViewFreezable->freezeAtPosition( nColumn, nRow ); } } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWindow::getSplit() throw (uno::RuntimeException) { - return m_xViewSplitable->getIsWindowSplit(); + return m_xViewSplitable->getIsWindowSplit(); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setSplit( ::sal_Bool _bSplit ) throw (uno::RuntimeException) { if( !_bSplit ) @@ -639,13 +639,13 @@ ScVbaWindow::setSplit( ::sal_Bool _bSplit ) throw (uno::RuntimeException) } } -sal_Int32 SAL_CALL +sal_Int32 SAL_CALL ScVbaWindow::getSplitColumn() throw (uno::RuntimeException) { - return m_xViewSplitable->getSplitColumn(); + return m_xViewSplitable->getSplitColumn(); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setSplitColumn( sal_Int32 _splitcolumn ) throw (uno::RuntimeException) { if( getSplitColumn() != _splitcolumn ) @@ -657,7 +657,7 @@ ScVbaWindow::setSplitColumn( sal_Int32 _splitcolumn ) throw (uno::RuntimeExcepti } } -double SAL_CALL +double SAL_CALL ScVbaWindow::getSplitHorizontal() throw (uno::RuntimeException) { double fSplitHorizontal = m_xViewSplitable->getSplitHorizontal(); @@ -665,21 +665,21 @@ ScVbaWindow::getSplitHorizontal() throw (uno::RuntimeException) return fHoriPoints; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setSplitHorizontal( double _splithorizontal ) throw (uno::RuntimeException) { double fHoriPixels = PointsToPixels( m_xDevice, _splithorizontal, sal_True ); - m_xViewSplitable->splitAtPosition( static_cast<sal_Int32>( fHoriPixels ), 0 ); + m_xViewSplitable->splitAtPosition( static_cast<sal_Int32>( fHoriPixels ), 0 ); } -sal_Int32 SAL_CALL +sal_Int32 SAL_CALL ScVbaWindow::getSplitRow() throw (uno::RuntimeException) { sal_Int32 nValue = m_xViewSplitable->getSplitRow(); - return nValue ? nValue - 1 : nValue; + return nValue ? nValue - 1 : nValue; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setSplitRow( sal_Int32 _splitrow ) throw (uno::RuntimeException) { if( getSplitRow() != _splitrow ) @@ -691,15 +691,15 @@ ScVbaWindow::setSplitRow( sal_Int32 _splitrow ) throw (uno::RuntimeException) } } -double SAL_CALL +double SAL_CALL ScVbaWindow::getSplitVertical() throw (uno::RuntimeException) { double fSplitVertical = m_xViewSplitable->getSplitVertical(); - double fVertiPoints = PixelsToPoints( m_xDevice, fSplitVertical, sal_False ); + double fVertiPoints = PixelsToPoints( m_xDevice, fSplitVertical, sal_False ); return fVertiPoints; } -void SAL_CALL +void SAL_CALL ScVbaWindow::setSplitVertical(double _splitvertical ) throw (uno::RuntimeException) { double fVertiPixels = PointsToPixels( m_xDevice, _splitvertical, sal_False ); @@ -717,9 +717,9 @@ void ScVbaWindow::SplitAtDefinedPosition(sal_Bool _bUnFreezePane) m_xViewSplitable->splitAtPosition(nHoriSplit, nVertSplit); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWindow::getZoom() throw (uno::RuntimeException) -{ +{ uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_ZOOMTYPE ) ); sal_Int16 nZoomType = view::DocumentZoomType::PAGE_WIDTH; @@ -738,7 +738,7 @@ ScVbaWindow::getZoom() throw (uno::RuntimeException) return uno::Any(); } -void SAL_CALL +void SAL_CALL ScVbaWindow::setZoom( const uno::Any& _zoom ) throw (uno::RuntimeException) { sal_Int16 nZoom = 100; @@ -753,7 +753,7 @@ ScVbaWindow::setZoom( const uno::Any& _zoom ) throw (uno::RuntimeException) excel::implSetZoom( m_xModel, nZoom, vTabs ); } -uno::Reference< excel::XWorksheet > SAL_CALL +uno::Reference< excel::XWorksheet > SAL_CALL ScVbaWindow::ActiveSheet( ) throw (script::BasicErrorException, uno::RuntimeException) { uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); @@ -763,9 +763,9 @@ ScVbaWindow::ActiveSheet( ) throw (script::BasicErrorException, uno::RuntimeExc uno::Any SAL_CALL ScVbaWindow::getView() throw (uno::RuntimeException) { - // not supported now - sal_Int32 nWindowView = excel::XlWindowView::xlNormalView; - return uno::makeAny( nWindowView ); + // not supported now + sal_Int32 nWindowView = excel::XlWindowView::xlNormalView; + return uno::makeAny( nWindowView ); } void SAL_CALL @@ -807,7 +807,7 @@ ScVbaWindow::PointsToScreenPixelsX(sal_Int32 _points) throw (css::script::BasicE return static_cast<sal_Int32>(fConvertFactor * nHundredthsofOneMillimeters ); } -sal_Int32 SAL_CALL +sal_Int32 SAL_CALL ScVbaWindow::PointsToScreenPixelsY(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException) { sal_Int32 nHundredthsofOneMillimeters = Millimeter::getInHundredthsOfOneMillimeter( _points ); @@ -815,28 +815,28 @@ ScVbaWindow::PointsToScreenPixelsY(sal_Int32 _points) throw (css::script::BasicE return static_cast<sal_Int32>(fConvertFactor * nHundredthsofOneMillimeters ); } -void SAL_CALL +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 + // need test, print current active sheet PrintOutHelper( excel::getBestViewShell( m_xModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, sal_True ); } -void SAL_CALL +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, excel::getBestViewShell( m_xModel ) ); + // need test, print preview current active sheet + PrintPreviewHelper( EnableChanges, excel::getBestViewShell( m_xModel ) ); } -rtl::OUString& +rtl::OUString& ScVbaWindow::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWindow") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaWindow::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbawindow.hxx b/sc/source/ui/vba/vbawindow.hxx index d58d2a07cb4b..a0cf30dda27e 100644 --- a/sc/source/ui/vba/vbawindow.hxx +++ b/sc/source/ui/vba/vbawindow.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,8 +44,8 @@ typedef cppu::ImplInheritanceHelper1< VbaWindowBase, ov::excel::XWindow > WindowImpl_BASE; class ScVbaWindow : public WindowImpl_BASE -{ -private: +{ +private: css::uno::Reference< css::sheet::XViewPane > m_xViewPane; css::uno::Reference< css::sheet::XViewFreezable > m_xViewFreezable; css::uno::Reference< css::sheet::XViewSplitable > m_xViewSplitable; @@ -54,16 +54,16 @@ private: 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: + 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< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ); ScVbaWindow( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext ); // XWindow - virtual css::uno::Reference< ov::excel::XRange > SAL_CALL ActiveCell( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL ActiveCell( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XPane > SAL_CALL ActivePane() throw (css::script::BasicErrorException, css::uno::RuntimeException); - virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL ActiveSheet( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual css::uno::Reference< ov::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); @@ -105,7 +105,7 @@ public: // Methods virtual void SAL_CALL SmallScroll( const css::uno::Any& Down, const css::uno::Any& Up, const css::uno::Any& ToRight, const css::uno::Any& ToLeft ) throw (css::uno::RuntimeException); virtual void SAL_CALL LargeScroll( const css::uno::Any& Down, const css::uno::Any& Up, const css::uno::Any& ToRight, const css::uno::Any& ToLeft ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL SelectedSheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL SelectedSheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 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); diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index 3ddc5f5b3b45..91760ad4f946 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -195,11 +195,11 @@ public: NameIndexHash::const_iterator it_end = namesToIndices.end(); for ( ; it != it_end; ++it, ++pString ) *pString = it->first; - return names; + return names; } - virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) - { + virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) + { NameIndexHash::const_iterator it = namesToIndices.find( aName ); return (it != namesToIndices.end()); } @@ -207,7 +207,7 @@ public: }; -ScVbaWindows::ScVbaWindows( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaWindows_BASE( xParent, xContext, xIndexAccess ) +ScVbaWindows::ScVbaWindows( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaWindows_BASE( xParent, xContext, xIndexAccess ) { } @@ -226,28 +226,28 @@ ScVbaWindows::createCollectionObject( const css::uno::Any& aSource ) return ComponentToWindow( aSource, mxContext, Application() ); } -uno::Type +uno::Type ScVbaWindows::getElementType() throw (uno::RuntimeException) { return excel::XWindows::static_type(0); } -void SAL_CALL +void SAL_CALL ScVbaWindows::Arrange( ::sal_Int32 /*ArrangeStyle*/, const uno::Any& /*ActiveWorkbook*/, const uno::Any& /*SyncHorizontal*/, const uno::Any& /*SyncVertical*/ ) throw (uno::RuntimeException) { //#TODO #FIXME see what can be done for an implementation here } -rtl::OUString& +rtl::OUString& ScVbaWindows::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWindows") ); return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaWindows::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbawindows.hxx b/sc/source/ui/vba/vbawindows.hxx index 3441b6ccbac4..0ee01e69801e 100644 --- a/sc/source/ui/vba/vbawindows.hxx +++ b/sc/source/ui/vba/vbawindows.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #include <ooo/vba/excel/XWindows.hpp> #include <com/sun/star/uno/XComponentContext.hpp> - + #include "excelvbahelper.hxx" #include <vbahelper/vbacollectionimpl.hxx> @@ -52,8 +52,8 @@ public: // XWindows virtual void SAL_CALL Arrange( ::sal_Int32 ArrangeStyle, const css::uno::Any& ActiveWorkbook, const css::uno::Any& SyncHorizontal, const css::uno::Any& SyncVertical ) throw (::com::sun::star::uno::RuntimeException); - // ScVbaCollectionBaseImpl - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + // ScVbaCollectionBaseImpl + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); // XHelperInterface virtual rtl::OUString& getServiceImplName(); diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index 365c8b35a00c..60fe76580b17 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,6 +50,7 @@ #include "vbanames.hxx" // Amelia Wang #include "nameuno.hxx" #include "docoptio.hxx" +#include "unonames.hxx" // Much of the impl. for the equivalend UNO module is // sc/source/ui/unoobj/docuno.cxx, viewuno.cxx @@ -61,11 +62,11 @@ class ActiveSheet : public ScVbaWorksheet { protected: virtual uno::Reference< frame::XModel > getModel() - { - return getCurrentExcelDoc( mxContext ); + { + return getCurrentExcelDoc( mxContext ); } virtual uno::Reference< sheet::XSpreadsheet > getSheet() - { + { uno::Reference< frame::XModel > xModel = getModel(); uno::Reference< sheet::XSpreadsheet > xSheet; if ( xModel.is() ) @@ -73,13 +74,13 @@ protected: uno::Reference< sheet::XSpreadsheetView > xSpreadsheet( xModel->getCurrentController(), uno::UNO_QUERY ); if ( xSpreadsheet.is() ) - xSheet = xSpreadsheet->getActiveSheet(); + xSheet = xSpreadsheet->getActiveSheet(); } return xSheet; } public: ActiveSheet( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : ScVbaWorksheet( xParent, xContext ) {} - + }; uno::Sequence< sal_Int32 > ScVbaWorkbook::ColorData; @@ -94,13 +95,13 @@ void ScVbaWorkbook::initColorData( const uno::Sequence< sal_Int32 >& sColors ) } -void SAL_CALL +void SAL_CALL ScVbaWorkbook::ResetColors( ) throw (::script::BasicErrorException, ::uno::RuntimeException) { uno::Reference< container::XIndexAccess > xIndexAccess( ScVbaPalette::getDefaultPalette(), uno::UNO_QUERY_THROW ); sal_Int32 nLen = xIndexAccess->getCount(); ColorData.realloc( nLen ); - + uno::Sequence< sal_Int32 > dDefaultColors( nLen ); sal_Int32* pDest = dDefaultColors.getArray(); for ( sal_Int32 index=0; index < nLen; ++pDest, ++index ) @@ -108,7 +109,7 @@ ScVbaWorkbook::ResetColors( ) throw (::script::BasicErrorException, ::uno::Runt initColorData( dDefaultColors ); } -::uno::Any SAL_CALL +::uno::Any SAL_CALL ScVbaWorkbook::Colors( const ::uno::Any& Index ) throw (::script::BasicErrorException, ::uno::RuntimeException) { uno::Any aRet; @@ -116,14 +117,14 @@ ScVbaWorkbook::Colors( const ::uno::Any& Index ) throw (::script::BasicErrorExce { sal_Int32 nIndex = 0; Index >>= nIndex; - aRet = uno::makeAny( XLRGBToOORGB( ColorData[ --nIndex ] ) ); + aRet = uno::makeAny( XLRGBToOORGB( ColorData[ --nIndex ] ) ); } else aRet = uno::makeAny( ColorData ); return aRet; } -::sal_Int32 SAL_CALL +::sal_Int32 SAL_CALL ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::RuntimeException) { sal_Int32 aFileFormat = 0; @@ -184,13 +185,13 @@ ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::Runti return aFileFormat; } -void +void ScVbaWorkbook::init() { if ( !ColorData.getLength() ) ResetColors(); } -ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext) :ScVbaWorkbook_BASE( xParent, xContext ) +ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext) :ScVbaWorkbook_BASE( xParent, xContext ) { //#FIXME this persists the color data per office instance and // not per workbook instance, need to hook the data into XModel @@ -201,14 +202,13 @@ ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface init(); } -ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::frame::XModel > xModel ) : ScVbaWorkbook_BASE( xParent, xContext, xModel ) -{ +ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::frame::XModel > xModel ) : ScVbaWorkbook_BASE( xParent, xContext, xModel ) +{ init(); } ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args, uno::Reference< uno::XComponentContext> const & xContext ) : ScVbaWorkbook_BASE( args, xContext ) - { init(); } @@ -216,31 +216,34 @@ ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args, uno::Reference< excel::XWorksheet > ScVbaWorkbook::getActiveSheet() throw (uno::RuntimeException) { - uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ) ); - uno::Reference< sheet::XSpreadsheet > xSheet; + uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ), uno::UNO_SET_THROW ); uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - if ( xView.is() ) - xSheet = xView->getActiveSheet(); - return new ScVbaWorksheet( this, mxContext, xSheet, xModel ); + uno::Reference< beans::XPropertySet > xSheetProps( xView->getActiveSheet(), uno::UNO_QUERY_THROW ); + // #162503# return the original document module wrapper object, instead of a new instance + ::rtl::OUString aCodeName; + xSheetProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_CODENAME ) ) ) >>= aCodeName; + ScDocShell* pShell = excel::getDocShell( xModel ); + if( !pShell ) + throw uno::RuntimeException(); + return uno::Reference< excel::XWorksheet >( getUnoDocModule( aCodeName, pShell ), uno::UNO_QUERY_THROW ); } + uno::Any SAL_CALL ScVbaWorkbook::Sheets( const uno::Any& aIndex ) throw (uno::RuntimeException) { return Worksheets( aIndex ); } - - uno::Any SAL_CALL ScVbaWorkbook::Worksheets( const uno::Any& aIndex ) throw (uno::RuntimeException) { - uno::Reference< frame::XModel > xModel( getModel() ); + uno::Reference< frame::XModel > xModel( getModel() ); uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xModel, uno::UNO_QUERY_THROW ); uno::Reference<container::XIndexAccess > xSheets( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW ); uno::Reference< XCollection > xWorkSheets( new ScVbaWorksheets( this, mxContext, xSheets, xModel ) ); if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID ) { - return uno::Any( xWorkSheets ); + return uno::Any( xWorkSheets ); } // pass on to collection return uno::Any( xWorkSheets->Item( aIndex, uno::Any() ) ); @@ -296,12 +299,12 @@ ScVbaWorkbook::SaveCopyAs( const rtl::OUString& sFileName ) throw ( uno::Runtime xStor->storeToURL( aURL, storeProps ); } -css::uno::Any SAL_CALL +css::uno::Any SAL_CALL ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException) { // quick look and Styles object doesn't seem to have a valid parent - // or a least the object browser just shows an object that has no - // variables ( therefore... leave as NULL for now ) + // or a least the object browser just shows an object that has no + // variables ( therefore... leave as NULL for now ) uno::Reference< XCollection > dStyles = new ScVbaStyles( uno::Reference< XHelperInterface >(), mxContext, getModel() ); if ( Item.hasValue() ) return dStyles->Item( Item, uno::Any() ); @@ -323,14 +326,14 @@ ScVbaWorkbook::Names( const css::uno::Any& aIndex ) throw (uno::RuntimeException return uno::Any( xNames->Item( aIndex, uno::Any() ) ); } -rtl::OUString& +rtl::OUString& ScVbaWorkbook::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWorkbook") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaWorkbook::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbaworkbook.hxx b/sc/source/ui/vba/vbaworkbook.hxx index 4aff58078403..36ce6ed468c6 100644 --- a/sc/source/ui/vba/vbaworkbook.hxx +++ b/sc/source/ui/vba/vbaworkbook.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,11 +43,11 @@ class ScVbaWorkbook : public ScVbaWorkbook_BASE void init(); protected: - ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext); + ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext); public: - ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, + ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::frame::XModel > xModel ); - ScVbaWorkbook( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ); + ScVbaWorkbook( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ); virtual ~ScVbaWorkbook() {} // Attributes diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx index 5298f60e0943..5316c58c0c6f 100644 --- a/sc/source/ui/vba/vbaworkbooks.cxx +++ b/sc/source/ui/vba/vbaworkbooks.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -76,18 +76,18 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& uno::Reference<script::XLibraryContainer> xLibContainer = pShell->GetBasicContainer(); uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY_THROW ); xVBACompat->setVBACompatibilityMode( sal_True ); - String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "VBAProject" ) ); + String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); pShell->GetBasicManager()->SetName( aPrjName ); if( xLibContainer.is() ) { if( !xLibContainer->hasByName( aPrjName ) ) - xLibContainer->createLibrary( aPrjName ); + xLibContainer->createLibrary( aPrjName ); uno::Any aLibAny = xLibContainer->getByName( aPrjName ); uno::Reference< container::XNameContainer > xLib; aLibAny >>= xLib; if( xLib.is() ) - { + { uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY_THROW ); uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY_THROW); // bootstrap vbaglobals @@ -119,7 +119,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& for ( std::vector<rtl::OUString>::iterator it = sDocModuleNames.begin(); it != it_end; ++it ) { script::ModuleInfo sModuleInfo; - + sModuleInfo.ModuleObject.set( xVBACodeNamedObjectAccess->getByName( *it ), uno::UNO_QUERY ); sModuleInfo.ModuleType = script::ModuleType::DOCUMENT; xVBAModuleInfo->insertModuleInfo( *it, sModuleInfo ); @@ -129,7 +129,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& xLib->insertByName( *it, uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Option VBASupport 1\n" ) ) ) ); } } - } + } } } @@ -140,7 +140,7 @@ getWorkbook( uno::Reference< uno::XComponentContext >& xContext, const uno::Refe uno::Reference< frame::XModel > xModel( xDoc, uno::UNO_QUERY ); if( !xModel.is() ) return uno::Any(); - + ScDocShell* pShell = excel::getDocShell( xModel ); if ( pShell ) { @@ -163,8 +163,8 @@ class WorkBookEnumImpl : public EnumerationHelperImpl public: WorkBookEnumImpl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, const uno::Any& aApplication ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xParent, xContext, xEnumeration ), m_aApplication( aApplication ) {} - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { uno::Reference< sheet::XSpreadsheetDocument > xDoc( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); return getWorkbook( m_xContext, xDoc, m_xParent ); } @@ -184,7 +184,7 @@ uno::Reference< container::XEnumeration > ScVbaWorkbooks::createEnumeration() throw (uno::RuntimeException) { // #FIXME its possible the WorkBookEnumImpl here doens't reflect - // the state of this object ( although it should ) would be + // the state of this object ( although it should ) would be // safer to create an enumeration based on this objects state // rather than one effectively based of the desktop component uno::Reference< container::XEnumerationAccess > xEnumerationAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); @@ -204,7 +204,7 @@ ScVbaWorkbooks::Add() throw (uno::RuntimeException) { uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( VbaDocumentsBase::Add() , uno::UNO_QUERY_THROW ); - // need to set up the document modules ( and vba mode ) here + // need to set up the document modules ( and vba mode ) here setUpDocumentModules( xSpreadDoc ); if( xSpreadDoc.is() ) return getWorkbook( mxContext, xSpreadDoc, mxParent ); @@ -217,13 +217,13 @@ ScVbaWorkbooks::Close() throw (uno::RuntimeException) VbaDocumentsBase::Close(); } -bool +bool ScVbaWorkbooks::isTextFile( const rtl::OUString& sType ) { // will return true if the file is // a) a variant of a text file // b) a csv file - // c) unknown + // c) unknown // returning true basically means treat this like a csv file const static rtl::OUString txtType( RTL_CONSTASCII_USTRINGPARAM("writer_Text" ) ); const static rtl::OUString csvType( RTL_CONSTASCII_USTRINGPARAM("calc_Text_txt_csv_StarCalc" ) ); @@ -231,18 +231,18 @@ ScVbaWorkbooks::isTextFile( const rtl::OUString& sType ) return sType.equals( txtType ) || sType.equals( csvType ) || ( sType.getLength() == 0 ) || sType.equals( encodedTxtType ); } -bool +bool ScVbaWorkbooks::isSpreadSheetFile( const rtl::OUString& sType ) { // include calc_QPro etc. ? ( not for the moment anyway ) - if ( sType.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("calc_MS"))) == 0 - || sType.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("calc8"))) == 0 + if ( sType.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("calc_MS"))) == 0 + || sType.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("calc8"))) == 0 || sType.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("calc_StarOffice"))) == 0 ) return true; return false; } -rtl::OUString +rtl::OUString ScVbaWorkbooks::getFileFilterType( const rtl::OUString& rFileName ) { uno::Reference< document::XTypeDetection > xTypeDetect( mxContext->getServiceManager()->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection"), mxContext), uno::UNO_QUERY_THROW ); @@ -269,10 +269,10 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi uno::Sequence< beans::PropertyValue > sProps(0); sal_Int32 nIndex = 0; - + rtl::OUString sType = getFileFilterType( aURL ); - // A text file means it needs to be processed as a csv file - if ( isTextFile( sType ) ) + // A text file means it needs to be processed as a csv file + if ( isTextFile( sType ) ) { // Values for format // 1 Tabs @@ -284,24 +284,24 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi // no format means use the current delimiter sProps.realloc( 3 ); sProps[ nIndex ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterOptions" ) ); - sal_Int16 delims[] = { 0 /*default not used*/, 9/*tab*/, 44/*comma*/, 32/*space*/, 59/*semicolon*/ }; + sal_Int16 delims[] = { 0 /*default not used*/, 9/*tab*/, 44/*comma*/, 32/*space*/, 59/*semicolon*/ }; static rtl::OUString sRestOfFormat( RTL_CONSTASCII_USTRINGPARAM(",34,0,1" ) ); - + rtl::OUString sFormat; sal_Int16 nFormat = 0; // default indicator if ( Format.hasValue() ) { - Format >>= nFormat; // val of nFormat overwritten if extracted - // validate param + Format >>= nFormat; // val of nFormat overwritten if extracted + // validate param if ( nFormat < 1 || nFormat > 6 ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Illegal value for Format" ) ), uno::Reference< uno::XInterface >() ); } sal_Int16 nDelim = getCurrentDelim(); - if ( nFormat > 0 && nFormat < CUSTOM_CHAR ) + if ( nFormat > 0 && nFormat < CUSTOM_CHAR ) { nDelim = delims[ nFormat ]; } @@ -332,7 +332,7 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi } else if ( !isSpreadSheetFile( sType ) ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Bad Format")), uno::Reference< uno::XInterface >() ); - + uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( VbaDocumentsBase::Open( rFileName, ReadOnly, sProps ), uno::UNO_QUERY_THROW ); uno::Any aRet = getWorkbook( mxContext, xSpreadDoc, mxParent ); uno::Reference< excel::XWorkbook > xWBook( aRet, uno::UNO_QUERY ); @@ -347,14 +347,14 @@ ScVbaWorkbooks::Open( const rtl::OUString& Filename, const uno::Any& ReadOnly, c return VbaDocumentsBase::Open( Filename, ReadOnly, rProps ); } -rtl::OUString& +rtl::OUString& ScVbaWorkbooks::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWorkbooks") ); return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaWorkbooks::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbaworkbooks.hxx b/sc/source/ui/vba/vbaworkbooks.hxx index 5d6210244d80..1ec89217c3f6 100644 --- a/sc/source/ui/vba/vbaworkbooks.hxx +++ b/sc/source/ui/vba/vbaworkbooks.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,9 +42,9 @@ typedef cppu::ImplInheritanceHelper1< VbaDocumentsBase, ov::excel::XWorkbooks > class ScVbaWorkbooks : public ScVbaWorkbooks_BASE { private: - rtl::OUString getFileFilterType( const rtl::OUString& rString ); - bool isTextFile( const rtl::OUString& rString ); - bool isSpreadSheetFile( const rtl::OUString& rString ); + rtl::OUString getFileFilterType( const rtl::OUString& rString ); + bool isTextFile( const rtl::OUString& rString ); + bool isSpreadSheetFile( const rtl::OUString& rString ); static sal_Int16& getCurrentDelim(){ static sal_Int16 nDelim = 44; return nDelim; } public: ScVbaWorkbooks( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ); @@ -55,7 +55,7 @@ public: virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); // ScVbaWorkbooks_BASE - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 4eab79813474..71e4faebb910 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,6 +40,7 @@ #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/sheet/XCalculatable.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> +#include <com/sun/star/sheet/XCellRangeReferrer.hpp> #include <com/sun/star/sheet/XSheetCellRange.hpp> #include <com/sun/star/sheet/XSheetCellCursor.hpp> #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp> @@ -183,7 +184,7 @@ ScVbaWorksheet::ScVbaWorksheet( const uno::Reference< XHelperInterface >& xParen } ScVbaWorksheet::ScVbaWorksheet(const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, - const uno::Reference< sheet::XSpreadsheet >& xSheet, + const uno::Reference< sheet::XSpreadsheet >& xSheet, const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : WorksheetImpl_BASE( xParent, xContext ), mxSheet( xSheet ), mxModel(xModel) { } @@ -198,7 +199,7 @@ ScVbaWorksheet::ScVbaWorksheet( uno::Sequence< uno::Any> const & args, args[2] >>= sSheetName; uno::Reference< sheet::XSpreadsheetDocument > xSpreadDoc( mxModel, uno::UNO_QUERY_THROW ); - uno::Reference< container::XNameAccess > xNameAccess( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > xNameAccess( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW ); mxSheet.set( xNameAccess->getByName( sSheetName ), uno::UNO_QUERY_THROW ); } @@ -267,14 +268,14 @@ ScVbaWorksheet::getEnableSelection() throw (uno::RuntimeException) return excel::XlEnableSelection::xlNoRestrictions; if( bUnlockedCells ) return excel::XlEnableSelection::xlUnlockedCells; - return excel::XlEnableSelection::xlNoSelection; + return excel::XlEnableSelection::xlNoSelection; } else throw uno::RuntimeException(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Sheet Name does not exist. ") ), uno::Reference< XInterface >() ); return excel::XlEnableSelection::xlNoSelection; -} +} void @@ -310,7 +311,7 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeEx { pProtect->setOption( ScTableProtection::SELECT_LOCKED_CELLS, bLockedCells ); pProtect->setOption( ScTableProtection::SELECT_UNLOCKED_CELLS, bUnlockedCells ); - } + } } else throw uno::RuntimeException(::rtl::OUString( @@ -319,6 +320,40 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeEx } +uno::Reference< beans::XPropertySet > ScVbaWorksheet::getFirstDBRangeProperties() throw (uno::RuntimeException) +{ + uno::Reference< beans::XPropertySet > xModelProps( mxModel, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xDBRangesIA( xModelProps->getPropertyValue( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DatabaseRanges" ) ) ), uno::UNO_QUERY_THROW ); + + for( sal_Int32 nIndex = 0, nCount = xDBRangesIA->getCount(); nIndex < nCount; ++nIndex ) + { + uno::Reference< sheet::XCellRangeReferrer > xDBRange( xDBRangesIA->getByIndex( nIndex ), uno::UNO_QUERY_THROW ); + // check if the database area is on this sheet + uno::Reference< sheet::XCellRangeAddressable > xRangeAddr( xDBRange->getReferredCells(), uno::UNO_QUERY_THROW ); + if( getSheetID() == xRangeAddr->getRangeAddress().Sheet ) + return uno::Reference< beans::XPropertySet >( xDBRange, uno::UNO_QUERY_THROW ); + } + return uno::Reference< beans::XPropertySet >(); +} + +sal_Bool SAL_CALL ScVbaWorksheet::getAutoFilterMode() throw (uno::RuntimeException) +{ + uno::Reference< beans::XPropertySet > xDBRangeProps = getFirstDBRangeProperties(); + sal_Bool bAutoFilterMode = sal_False; + return + xDBRangeProps.is() && + (xDBRangeProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoFilter" ) ) ) >>= bAutoFilterMode) && + bAutoFilterMode; +} + +void SAL_CALL ScVbaWorksheet::setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (uno::RuntimeException) +{ + uno::Reference< beans::XPropertySet > xDBRangeProps = getFirstDBRangeProperties(); + if( xDBRangeProps.is() ) + xDBRangeProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoFilter" ) ), uno::Any( bAutoFilterMode ) ); +} + uno::Reference< excel::XRange > ScVbaWorksheet::getUsedRange() throw (uno::RuntimeException) { @@ -348,9 +383,9 @@ 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)); + uno::Reference< excel::XHPageBreaks > xHPageBreaks( new ScVbaHPageBreaks( this, mxContext, xSheetPageBreak)); if ( aIndex.hasValue() ) - return xHPageBreaks->Item( aIndex, uno::Any()); + return xHPageBreaks->Item( aIndex, uno::Any()); return uno::makeAny( xHPageBreaks ); } @@ -358,41 +393,47 @@ uno::Any ScVbaWorksheet::VPageBreaks( const uno::Any& aIndex ) throw ( uno::RuntimeException ) { uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak( getSheet(), uno::UNO_QUERY_THROW ); - uno::Reference< excel::XVPageBreaks > xVPageBreaks( new ScVbaVPageBreaks( this, mxContext, xSheetPageBreak ) ); + uno::Reference< excel::XVPageBreaks > xVPageBreaks( new ScVbaVPageBreaks( this, mxContext, xSheetPageBreak ) ); if( aIndex.hasValue() ) - return xVPageBreaks->Item( aIndex, uno::Any()); + return xVPageBreaks->Item( aIndex, uno::Any()); return uno::makeAny( xVPageBreaks ); } -sal_Int32 +sal_Int32 ScVbaWorksheet::getStandardWidth() throw (uno::RuntimeException) { return STANDARDWIDTH ; } -sal_Int32 +sal_Int32 ScVbaWorksheet::getStandardHeight() throw (uno::RuntimeException) { return STANDARDHEIGHT; } -sal_Bool -ScVbaWorksheet::getProtectionMode() throw (uno::RuntimeException) +sal_Bool +ScVbaWorksheet::getProtectionMode() throw (uno::RuntimeException) { - return false; + return sal_False; } sal_Bool -ScVbaWorksheet::getProtectContents()throw (uno::RuntimeException) +ScVbaWorksheet::getProtectContents()throw (uno::RuntimeException) { uno::Reference<util::XProtectable > xProtectable(getSheet(), uno::UNO_QUERY_THROW); return xProtectable->isProtected(); } +sal_Bool +ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException) +{ + return sal_False; +} + sal_Bool -ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException) +ScVbaWorksheet::getProtectScenarios() throw (uno::RuntimeException) { - return false; + return sal_False; } void @@ -400,7 +441,7 @@ ScVbaWorksheet::Activate() throw (uno::RuntimeException) { uno::Reference< sheet::XSpreadsheetView > xSpreadsheet( getModel()->getCurrentController(), uno::UNO_QUERY_THROW ); - xSpreadsheet->setActiveSheet(getSheet()); + xSpreadsheet->setActiveSheet(getSheet()); } void @@ -409,8 +450,8 @@ ScVbaWorksheet::Select() throw (uno::RuntimeException) Activate(); } -void -ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) throw (uno::RuntimeException) +void +ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) throw (uno::RuntimeException) { uno::Reference<excel::XWorksheet> xSheet; rtl::OUString aCurrSheetName = getName(); @@ -426,7 +467,7 @@ ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) throw (uno xRange->Select(); excel::implnCopy(mxModel); uno::Reference<frame::XModel> xModel = openNewDoc(aCurrSheetName); - if (xModel.is()) + if (xModel.is()) { excel::implnPaste(xModel); Delete(); @@ -439,15 +480,15 @@ ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) throw (uno if ( ScVbaWorksheets::nameExists (xSpreadDoc, xSheet->getName(), nDest) ) { sal_Bool bAfter = After.hasValue(); - if (bAfter) + if (bAfter) nDest++; uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets(); xSheets->moveByName(aCurrSheetName,nDest); } } -void -ScVbaWorksheet::Copy( const uno::Any& Before, const uno::Any& After ) throw (uno::RuntimeException) +void +ScVbaWorksheet::Copy( const uno::Any& Before, const uno::Any& After ) throw (uno::RuntimeException) { uno::Reference<excel::XWorksheet> xSheet; rtl::OUString aCurrSheetName =getName(); @@ -483,7 +524,7 @@ ScVbaWorksheet::Copy( const uno::Any& Before, const uno::Any& After ) throw (uno } -void +void ScVbaWorksheet::Paste( const uno::Any& Destination, const uno::Any& /*Link*/ ) throw (uno::RuntimeException) { // #TODO# #FIXME# Link is not used @@ -493,7 +534,7 @@ ScVbaWorksheet::Paste( const uno::Any& Destination, const uno::Any& /*Link*/ ) t excel::implnPaste( mxModel ); } -void +void ScVbaWorksheet::Delete() throw (uno::RuntimeException) { uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW ); @@ -521,7 +562,7 @@ ScVbaWorksheet::getSheetAtOffset(SCTAB offset) throw (uno::RuntimeException) SCTAB nIdx = 0; if ( !ScVbaWorksheets::nameExists (xSpreadDoc, getName(), nIdx ) ) - return uno::Reference< excel::XWorksheet >(); + return uno::Reference< excel::XWorksheet >(); nIdx = nIdx + offset; uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(nIdx), uno::UNO_QUERY_THROW); // parent will be the parent of 'this' worksheet @@ -552,7 +593,7 @@ ScVbaWorksheet::Protect( const uno::Any& Password, const uno::Any& /*DrawingObje xProtectable->protect( aPasswd ); } -void +void ScVbaWorksheet::Unprotect( const uno::Any& Password ) throw (uno::RuntimeException) { uno::Reference<util::XProtectable > xProtectable(getSheet(), uno::UNO_QUERY_THROW); @@ -561,7 +602,7 @@ ScVbaWorksheet::Unprotect( const uno::Any& Password ) throw (uno::RuntimeExcepti xProtectable->unprotect( aPasswd ); } -void +void ScVbaWorksheet::Calculate() throw (uno::RuntimeException) { uno::Reference <sheet::XCalculatable> xReCalculate(getModel(), uno::UNO_QUERY_THROW); @@ -571,7 +612,7 @@ ScVbaWorksheet::Calculate() throw (uno::RuntimeException) uno::Reference< excel::XRange > ScVbaWorksheet::Range( const ::uno::Any& Cell1, const ::uno::Any& Cell2 ) throw (uno::RuntimeException) { - uno::Reference< excel::XRange > xSheetRange( new ScVbaRange( this, mxContext + uno::Reference< excel::XRange > xSheetRange( new ScVbaRange( this, mxContext , uno::Reference< table::XCellRange >( getSheet(), uno::UNO_QUERY_THROW ) ) ); return xSheetRange->Range( Cell1, Cell2 ); } @@ -585,7 +626,7 @@ ScVbaWorksheet::CheckSpelling( const uno::Any& /*CustomDictionary*/,const uno::A dispatchRequests(xModel,url); } -uno::Reference< excel::XRange > +uno::Reference< excel::XRange > ScVbaWorksheet::getSheetRange() throw (uno::RuntimeException) { uno::Reference< table::XCellRange > xRange( getSheet(),uno::UNO_QUERY_THROW ); @@ -594,7 +635,7 @@ ScVbaWorksheet::getSheetRange() throw (uno::RuntimeException) // These are hacks - we prolly (somehow) need to inherit // the vbarange functionality here ... -uno::Reference< excel::XRange > +uno::Reference< excel::XRange > ScVbaWorksheet::Cells( const ::uno::Any &nRow, const ::uno::Any &nCol ) throw (uno::RuntimeException) { @@ -620,7 +661,7 @@ ScVbaWorksheet::ChartObjects( const uno::Any& Index ) throw (uno::RuntimeExcepti { uno::Reference< table::XTableChartsSupplier > xChartSupplier( getSheet(), uno::UNO_QUERY_THROW ); uno::Reference< table::XTableCharts > xTableCharts = xChartSupplier->getCharts(); - + uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxSheet, uno::UNO_QUERY_THROW ); mxCharts = new ScVbaChartObjects( this, mxContext, xTableCharts, xDrawPageSupplier ); } @@ -631,10 +672,10 @@ ScVbaWorksheet::ChartObjects( const uno::Any& Index ) throw (uno::RuntimeExcepti } else return uno::makeAny( mxCharts ); - + } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWorksheet::PivotTables( const uno::Any& Index ) throw (uno::RuntimeException) { uno::Reference< css::sheet::XSpreadsheet > xSheet = getSheet(); @@ -703,7 +744,7 @@ ScVbaWorksheet::Shapes( const uno::Any& aIndex ) throw (uno::RuntimeException) uno::Reference< msforms::XShapes> xVbaShapes( new ScVbaShapes( this, mxContext, xIndexAccess, getModel() ) ); if ( aIndex.hasValue() ) - return xVbaShapes->Item( aIndex, uno::Any() ); + return xVbaShapes->Item( aIndex, uno::Any() ); return uno::makeAny( xVbaShapes ); } @@ -770,7 +811,7 @@ ScVbaWorksheet::Spinners( const uno::Any& /*rIndex*/ ) throw (uno::RuntimeExcept void SAL_CALL ScVbaWorksheet::ShowDataForm( ) throw (uno::RuntimeException) { -#ifdef VBA_OOBUILD_HACK +#ifdef VBA_OOBUILD_HACK uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); ScTabViewShell* pTabViewShell = excel::getBestViewShell( xModel ); @@ -786,55 +827,55 @@ ScVbaWorksheet::ShowDataForm( ) throw (uno::RuntimeException) #endif } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWorksheet::Evaluate( const ::rtl::OUString& Name ) throw (uno::RuntimeException) { // #TODO Evaluate allows other things to be evaluated, e.g. functions // I think ( like SIN(3) etc. ) need to investigate that // named Ranges also? e.g. [MyRange] if so need a list of named ranges uno::Any aVoid; - return uno::Any( Range( uno::Any( Name ), aVoid ) ); + return uno::Any( Range( uno::Any( Name ), aVoid ) ); } -uno::Reference< beans::XIntrospectionAccess > SAL_CALL +uno::Reference< beans::XIntrospectionAccess > SAL_CALL ScVbaWorksheet::getIntrospection( ) throw (uno::RuntimeException) { return uno::Reference< beans::XIntrospectionAccess >(); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWorksheet::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) { OSL_TRACE("** ScVbaWorksheet::invoke( %s ), will barf", rtl::OUStringToOString( aFunctionName, RTL_TEXTENCODING_UTF8 ).getStr() ); - + throw uno::RuntimeException(); // unsupported operation } -void SAL_CALL +void SAL_CALL ScVbaWorksheet::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) { setDefaultPropByIntrospection( uno::makeAny( getValue( aPropertyName ) ), aValue ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWorksheet::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException) { uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW ); - + uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), mxContext ), uno::UNO_QUERY_THROW ); uno::Reference< msforms::XControl > xControl( xControlProvider->createControl( xControlShape, getModel() ) ); return uno::makeAny( xControl ); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWorksheet::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException) { return sal_False; } -uno::Reference< container::XNameAccess > +uno::Reference< container::XNameAccess > ScVbaWorksheet::getFormControls() { uno::Reference< container::XNameAccess > xFormControls; @@ -844,11 +885,11 @@ ScVbaWorksheet::getFormControls() 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 + // 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& ) { @@ -856,7 +897,7 @@ ScVbaWorksheet::getFormControls() return xFormControls; } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWorksheet::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException) { uno::Reference< container::XNameAccess > xFormControls( getFormControls() ); @@ -869,12 +910,12 @@ uno::Any ScVbaWorksheet::getControlShape( const ::rtl::OUString& sName ) { // ideally we would get an XControl object but it appears an XControl - // implementation only exists for a Control implementation optained from the + // 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 + // 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 ); @@ -899,26 +940,26 @@ ScVbaWorksheet::getControlShape( const ::rtl::OUString& sName ) } -rtl::OUString& +rtl::OUString& ScVbaWorksheet::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWorksheet") ); return sImplName; } -void SAL_CALL +void SAL_CALL ScVbaWorksheet::setEnableCalculation( ::sal_Bool bEnableCalculation ) throw ( script::BasicErrorException, uno::RuntimeException) { uno::Reference <sheet::XCalculatable> xCalculatable(getModel(), uno::UNO_QUERY_THROW); - xCalculatable->enableAutomaticCalculation( bEnableCalculation); + xCalculatable->enableAutomaticCalculation( bEnableCalculation); } -::sal_Bool SAL_CALL +::sal_Bool SAL_CALL ScVbaWorksheet::getEnableCalculation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { uno::Reference <sheet::XCalculatable> xCalculatable(getModel(), uno::UNO_QUERY_THROW); return xCalculatable->isAutomaticCalculationEnabled(); } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaWorksheet::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -944,7 +985,7 @@ ScVbaWorksheet::getSheetID() throw (uno::RuntimeException) return xAddressable->getRangeAddress().Sheet; } -void SAL_CALL +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; @@ -963,7 +1004,7 @@ ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::A if ( !( nFrom || nTo ) ) bSelection = sal_True; - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); PrintOutHelper( excel::getBestViewShell( xModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, bSelection ); } diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx index 196a195258d7..eaa9fdf0f00c 100644 --- a/sc/source/ui/vba/vbaworksheet.hxx +++ b/sc/source/ui/vba/vbaworksheet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -68,13 +68,16 @@ class ScVbaWorksheet : public WorksheetImpl_BASE css::uno::Reference< css::container::XNameAccess > getFormControls(); css::uno::Any getControlShape( const rtl::OUString& sName ); + + css::uno::Reference< css::beans::XPropertySet > getFirstDBRangeProperties() throw (css::uno::RuntimeException); + protected: ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ); public: ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet, + const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet, const css::uno::Reference< css::frame::XModel >& xModel )throw (css::uno::RuntimeException) ; ScVbaWorksheet( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException ); @@ -95,6 +98,7 @@ public: virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getProtectContents() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getProtectDrawingObjects() throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getProtectScenarios() throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::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< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException); @@ -106,6 +110,8 @@ public: virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getEnableSelection() throw (css::uno::RuntimeException); virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getAutoFilterMode() throw (css::uno::RuntimeException); + virtual void SAL_CALL setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (css::uno::RuntimeException); // Methods virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); @@ -125,7 +131,7 @@ public: virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Rows(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL PivotTables( const css::uno::Any& Index ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Comments( const css::uno::Any& Index ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); @@ -145,7 +151,7 @@ public: virtual css::uno::Any SAL_CALL Spinners( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException); virtual void SAL_CALL setEnableCalculation( ::sal_Bool EnableCalculation ) throw ( css::script::BasicErrorException, css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL getEnableCalculation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getEnableCalculation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL ShowDataForm( ) throw (css::uno::RuntimeException); // XInvocation virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException); @@ -161,7 +167,7 @@ public: 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(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SC_VBA_WORKSHEET_HXX */ diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 5344e6b3a9be..8e764d10edf6 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,7 +52,7 @@ #include "vbaglobals.hxx" #include "vbaworksheet.hxx" #include "vbaworkbook.hxx" -#include <unonames.hxx> +#include "unonames.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -60,7 +60,7 @@ using namespace ::com::sun::star; typedef ::cppu::WeakImplHelper1< container::XEnumeration > SheetEnumeration_BASE; typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > SheetCollectionHelper_BASE; -// a map ( or hashmap ) wont do as we need also to preserve the order +// a map ( or hashmap ) wont do as we need also to preserve the order // (as added ) of the items typedef std::vector< uno::Reference< sheet::XSpreadsheet > > SheetMap; @@ -68,7 +68,7 @@ typedef std::vector< uno::Reference< sheet::XSpreadsheet > > SheetMap; // #FIXME #TODO the implementation of the Sheets collections sucks, // e.g. there is no support for tracking sheets added/removed from the collection -uno::Reference< uno::XInterface > +uno::Reference< uno::XInterface > lcl_getModulAsUnoObject( const uno::Reference< sheet::XSpreadsheet >& xSheet, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) { uno::Reference< uno::XInterface > xRet; @@ -79,7 +79,7 @@ lcl_getModulAsUnoObject( const uno::Reference< sheet::XSpreadsheet >& xSheet, co xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_CODENAME ) ) ) >>= sName; ScDocShell* pShell = excel::getDocShell( xModel ); - + if ( pShell ) xRet = getUnoDocModule( sName, pShell ); return xRet; @@ -113,7 +113,7 @@ public: // XElementAccess virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return sheet::XSpreadsheet::static_type(0); } virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return ( mSheetMap.size() > 0 ); } - // XNameAcess + // XNameAcess virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { if ( !hasByName(aName) ) @@ -129,7 +129,7 @@ public: for ( ; it != it_end; ++it, ++pString ) { - uno::Reference< container::XNamed > xName( *it, uno::UNO_QUERY_THROW ); + uno::Reference< container::XNamed > xName( *it, uno::UNO_QUERY_THROW ); *pString = xName->getName(); } return sNames; @@ -140,7 +140,7 @@ public: SheetMap::iterator it_end = mSheetMap.end(); for ( ; cachePos != it_end; ++cachePos ) { - uno::Reference< container::XNamed > xName( *cachePos, uno::UNO_QUERY_THROW ); + uno::Reference< container::XNamed > xName( *cachePos, uno::UNO_QUERY_THROW ); if ( aName.equals( xName->getName() ) ) break; } @@ -148,12 +148,12 @@ public: } // XElementAccess - virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { return mSheetMap.size(); } + virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { return mSheetMap.size(); } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { if ( Index < 0 || Index >= getCount() ) throw lang::IndexOutOfBoundsException(); - + return uno::makeAny( mSheetMap[ Index ] ); } @@ -170,35 +170,35 @@ class SheetsEnumeration : public EnumerationHelperImpl public: SheetsEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xParent, xContext, xEnumeration ), m_xModel( xModel ) {} - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { uno::Reference< sheet::XSpreadsheet > xSheet( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); uno::Reference< uno::XInterface > xIf = lcl_getModulAsUnoObject( xSheet, m_xModel ); uno::Any aRet; if ( !xIf.is() ) { - // if the Sheet is in a document created by the api unfortunately ( at the + // if the Sheet is in a document created by the api unfortunately ( at the // moment, it actually wont have the special Document modules uno::Reference< excel::XWorksheet > xNewSheet( new ScVbaWorksheet( m_xParent, m_xContext, xSheet, m_xModel ) ); - aRet <<= xNewSheet; + aRet <<= xNewSheet; } else - aRet <<= xIf; + aRet <<= xIf; return aRet; } }; -ScVbaWorksheets::ScVbaWorksheets( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xSheets, const uno::Reference< frame::XModel >& xModel ): ScVbaWorksheets_BASE( xParent, xContext, xSheets ), mxModel( xModel ), m_xSheets( uno::Reference< sheet::XSpreadsheets >( xSheets, uno::UNO_QUERY ) ) +ScVbaWorksheets::ScVbaWorksheets( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xSheets, const uno::Reference< frame::XModel >& xModel ): ScVbaWorksheets_BASE( xParent, xContext, xSheets ), mxModel( xModel ), m_xSheets( uno::Reference< sheet::XSpreadsheets >( xSheets, uno::UNO_QUERY ) ) { } -ScVbaWorksheets::ScVbaWorksheets( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext, const uno::Reference< container::XEnumerationAccess >& xEnumAccess, const uno::Reference< frame::XModel >& xModel ): ScVbaWorksheets_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xEnumAccess, uno::UNO_QUERY ) ), mxModel(xModel) +ScVbaWorksheets::ScVbaWorksheets( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext, const uno::Reference< container::XEnumerationAccess >& xEnumAccess, const uno::Reference< frame::XModel >& xModel ): ScVbaWorksheets_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xEnumAccess, uno::UNO_QUERY ) ), mxModel(xModel) { } // XEnumerationAccess -uno::Type +uno::Type ScVbaWorksheets::getElementType() throw (uno::RuntimeException) { return excel::XWorksheet::static_type(0); @@ -210,7 +210,7 @@ ScVbaWorksheets::createEnumeration() throw (uno::RuntimeException) if ( !m_xSheets.is() ) { uno::Reference< container::XEnumerationAccess > xAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); - return xAccess->createEnumeration(); + return xAccess->createEnumeration(); } uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xSheets, uno::UNO_QUERY_THROW ); return new SheetsEnumeration( this, mxContext, xEnumAccess->createEnumeration(), mxModel ); @@ -224,7 +224,7 @@ ScVbaWorksheets::createCollectionObject( const uno::Any& aSource ) uno::Any aRet; if ( !xIf.is() ) { - // if the Sheet is in a document created by the api unfortunately ( at the + // if the Sheet is in a document created by the api unfortunately ( at the // moment, it actually wont have the special Document modules uno::Reference< excel::XWorksheet > xNewSheet( new ScVbaWorksheet( getParent(), mxContext, xSheet, mxModel ) ); aRet <<= xNewSheet; @@ -241,7 +241,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, { if ( isSelectedSheets() ) return uno::Any(); // or should we throw? - + rtl::OUString aStringSheet; sal_Bool bBefore(sal_True); SCTAB nSheetIndex = 0; @@ -290,7 +290,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, nSheetIndex++; SCTAB nSheetName = nCount + 1L; - String aStringBase( RTL_CONSTASCII_USTRINGPARAM("Sheet") ); + String aStringBase( RTL_CONSTASCII_USTRINGPARAM("Sheet") ); uno::Any result; for (SCTAB i=0; i < nNewSheets; i++, nSheetName++) { @@ -307,7 +307,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, } uno::Reference< excel::XWorksheet > xNewSheet( result, uno::UNO_QUERY ); if ( xNewSheet.is() ) - xNewSheet->Activate(); + xNewSheet->Activate(); return result; } @@ -332,7 +332,7 @@ ScVbaWorksheets::isSelectedSheets() return !m_xSheets.is(); } -void SAL_CALL +void SAL_CALL ScVbaWorksheets::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) { sal_Int32 nTo = 0; @@ -353,7 +353,7 @@ ScVbaWorksheets::PrintOut( const uno::Any& From, const uno::Any& To, const uno:: PrintOutHelper( excel::getBestViewShell( mxModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, bSelection ); } -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWorksheets::getVisible() throw (uno::RuntimeException) { sal_Bool bVisible = sal_True; @@ -370,7 +370,7 @@ ScVbaWorksheets::getVisible() throw (uno::RuntimeException) return uno::makeAny( bVisible ); } -void SAL_CALL +void SAL_CALL ScVbaWorksheets::setVisible( const uno::Any& _visible ) throw (uno::RuntimeException) { sal_Bool bState = sal_False; @@ -384,24 +384,24 @@ ScVbaWorksheets::setVisible( const uno::Any& _visible ) throw (uno::RuntimeExcep } } else - throw uno::RuntimeException( rtl::OUString( + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible property doesn't support non boolean #FIXME" ) ), uno::Reference< uno::XInterface >() ); } -void SAL_CALL +void SAL_CALL ScVbaWorksheets::Select( const uno::Any& Replace ) throw (uno::RuntimeException) { ScTabViewShell* pViewShell = excel::getBestViewShell( mxModel ); if ( !pViewShell ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cannot obtain view shell" ) ), uno::Reference< uno::XInterface >() ); - + ScMarkData& rMarkData = pViewShell->GetViewData()->GetMarkData(); sal_Bool bReplace = sal_True; Replace >>= bReplace; - // Replace is defaulted to True, meanining this current collection + // Replace is defaulted to True, meanining this current collection // becomes the Selection, if it were false then the current selection would // be extended - bool bSelectSingle = bReplace; + bool bSelectSingle = bReplace; sal_Int32 nElems = getCount(); for ( sal_Int32 nItem = 1; nItem <= nElems; ++nItem ) { @@ -416,15 +416,15 @@ ScVbaWorksheets::Select( const uno::Any& Replace ) throw (uno::RuntimeException) } else rMarkData.SelectTable( static_cast< SCTAB >( pSheet->getSheetID() ), TRUE ); - + } } - + } //ScVbaCollectionBaseImpl -uno::Any SAL_CALL +uno::Any SAL_CALL ScVbaWorksheets::Item( const uno::Any& Index, const uno::Any& Index2 ) throw (uno::RuntimeException) { if ( Index.getValueTypeClass() == uno::TypeClass_SEQUENCE ) @@ -446,28 +446,28 @@ ScVbaWorksheets::Item( const uno::Any& Index, const uno::Any& Index2 ) throw (u uno::Reference< container::XNamed > xName( xSheet, uno::UNO_QUERY_THROW ); mSheets.push_back( xSheet ); } - } + } uno::Reference< container::XIndexAccess > xIndexAccess = new SheetCollectionHelper( mSheets ); uno::Reference< XCollection > xSelectedSheets( new ScVbaWorksheets( this->getParent(), mxContext, xIndexAccess, mxModel ) ); return uno::makeAny( xSelectedSheets ); } - return ScVbaWorksheets_BASE::Item( Index, Index2 ); + return ScVbaWorksheets_BASE::Item( Index, Index2 ); } -uno::Any +uno::Any ScVbaWorksheets::getItemByStringIndex( const rtl::OUString& sIndex ) throw (uno::RuntimeException) { return ScVbaWorksheets_BASE::getItemByStringIndex( sIndex ); } -rtl::OUString& +rtl::OUString& ScVbaWorksheets::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWorksheets") ); return sImplName; } -css::uno::Sequence<rtl::OUString> +css::uno::Sequence<rtl::OUString> ScVbaWorksheets::getServiceNames() { static uno::Sequence< rtl::OUString > sNames; diff --git a/sc/source/ui/vba/vbaworksheets.hxx b/sc/source/ui/vba/vbaworksheets.hxx index 2ced68bc9e27..1c4d3c34590a 100644 --- a/sc/source/ui/vba/vbaworksheets.hxx +++ b/sc/source/ui/vba/vbaworksheets.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/uno/XComponentContext.hpp> - + #include <vbahelper/vbacollectionimpl.hxx> #include "address.hxx" @@ -69,7 +69,7 @@ public: virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Before, const css::uno::Any& After, const css::uno::Any& Count, const css::uno::Any& Type ) throw (css::uno::RuntimeException); virtual void SAL_CALL Delete( ) 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 ) throw (css::uno::RuntimeException); - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException); // ScVbaWorksheets_BASE virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ) throw diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx index 60daa7303f2e..008b969508ea 100644 --- a/sc/source/ui/vba/vbawsfunction.cxx +++ b/sc/source/ui/vba/vbawsfunction.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -174,7 +174,7 @@ ScVbaWSFunction::invoke(const rtl::OUString& FunctionName, const uno::Sequence< // MATCH function should alwayse return a double value, but currently if the first argument is XCellRange, MATCH function returns an array instead of a double value. Don't know why? // To fix this issue in safe, current solution is to convert this array to a double value just for MATCH function. String aUpper( FunctionName ); - ScCompiler aCompiler( NULL, ScAddress() ); + ScCompiler aCompiler( NULL, ScAddress() ); OpCode eOp = aCompiler.GetEnglishOpCode( aUpper.ToUpperAscii() ); if( eOp == ocMatch ) { @@ -208,12 +208,12 @@ sal_Bool SAL_CALL ScVbaWSFunction::hasMethod(const rtl::OUString& Name) throw(uno::RuntimeException) { sal_Bool bIsFound = sal_False; - try + try { // the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized. // but the function name used in WorksheetFunction is a programmatic name (seems English). // So m_xNameAccess->hasByName( Name ) may fail to find name when a function name has a localized name. - ScCompiler aCompiler( NULL, ScAddress() ); + ScCompiler aCompiler( NULL, ScAddress() ); if( aCompiler.IsEnglishSymbol( Name ) ) bIsFound = sal_True; } @@ -230,23 +230,23 @@ ScVbaWSFunction::hasProperty(const rtl::OUString& /*Name*/) throw(uno::RuntimeE return sal_False; } -::rtl::OUString SAL_CALL +::rtl::OUString SAL_CALL ScVbaWSFunction::getExactName( const ::rtl::OUString& aApproximateName ) throw (css::uno::RuntimeException) { rtl::OUString sName = aApproximateName.toAsciiUpperCase(); if ( !hasMethod( sName ) ) return rtl::OUString(); - return sName; + return sName; } -rtl::OUString& +rtl::OUString& ScVbaWSFunction::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWSFunction") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > ScVbaWSFunction::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; diff --git a/sc/source/ui/vba/vbawsfunction.hxx b/sc/source/ui/vba/vbawsfunction.hxx index ffd33849afe5..52664c1654fd 100644 --- a/sc/source/ui/vba/vbawsfunction.hxx +++ b/sc/source/ui/vba/vbawsfunction.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,7 @@ public: virtual css::uno::Any SAL_CALL getValue(const rtl::OUString& PropertyName) throw(css::beans::UnknownPropertyException, css::uno::RuntimeException); virtual sal_Bool SAL_CALL hasMethod(const rtl::OUString& Name) throw(css::uno::RuntimeException); virtual sal_Bool SAL_CALL hasProperty(const rtl::OUString& Name) throw(css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getExactName( const ::rtl::OUString& aApproximateName ) throw (css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getExactName( const ::rtl::OUString& aApproximateName ) throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); |