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



Author: pflin
Date: Mon Jul  7 06:35:26 2008
New Revision: 13080
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13080&view=rev

Log:
* patches/vba/vba-worksheet-fix-n403974.diff:
  Add to support Worksheet.Index, and fix for n#403974,
* patches/dev300/apply.



Added:
   trunk/patches/vba/vba-worksheet-fix-n403974.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Mon Jul  7 06:35:26 2008
@@ -1545,6 +1545,8 @@
 vba-worksheet-enableselection.diff, n#405312, Fong
 # Add to support Application.Union
 vba-application-union.diff, n#405313, Fong
+# Add to support Worksheet.Index, and fix for n#403974
+vba-worksheet-fix-n403974.diff, n#403974, Fong
 
 [ VBAUntested ]
 SectionOwner => noelpwer

Added: trunk/patches/vba/vba-worksheet-fix-n403974.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-worksheet-fix-n403974.diff	Mon Jul  7 06:35:26 2008
@@ -0,0 +1,90 @@
+--- oovbaapi/org/openoffice/excel/XWorksheet.idl.orig	2008-07-07 10:39:18.000000000 +0800
++++ oovbaapi/org/openoffice/excel/XWorksheet.idl	2008-07-07 10:38:14.000000000 +0800
+@@ -70,6 +70,7 @@ interface XWorksheet
+ 	[attribute, readonly] XWorksheet Previous;
+ 	[attribute, readonly] string CodeName;
+ 	[attribute] long EnableSelection;
++	[attribute, readonly] short Index;
+ 	
+ 	void Activate();
+ 	void Calculate( );
+--- sc/source/ui/vba/vbaworksheet.hxx.orig	2008-07-07 10:41:12.000000000 +0800
++++ sc/source/ui/vba/vbaworksheet.hxx	2008-07-07 10:42:13.000000000 +0800
+@@ -97,6 +97,7 @@ public:
+ 	virtual css::uno::Reference< oo::excel::XWorksheet > SAL_CALL getPrevious() 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_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);
+ 
+     // Methods
+ 	virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
+--- sc/source/ui/vba/vbaworksheet.cxx.orig	2008-07-07 13:35:41.000000000 +0800
++++ sc/source/ui/vba/vbaworksheet.cxx	2008-07-07 12:47:47.000000000 +0800
+@@ -264,8 +264,13 @@ ScVbaWorksheet::getEnableSelection() thr
+         uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
+         ScDocument* pDoc = getDocShell( xModel )->GetDocument();
+         ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+-        sal_Bool bLockedCells   = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+-        sal_Bool bUnlockedCells = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
++		sal_Bool bLockedCells = sal_False;
++		sal_Bool bUnlockedCells = sal_False;
++		if( pProtect )
++		{
++        	bLockedCells   = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
++        	bUnlockedCells = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
++		}
+         if( bLockedCells )
+             return excel::XlEnableSelection::xlNoRestrictions;
+         if( bUnlockedCells )
+@@ -311,8 +316,11 @@ ScVbaWorksheet::setEnableSelection( sal_
+         {
+             bUnlockedCells = sal_True;
+         }
+-        pProtect->setOption( ScTableProtection::SELECT_LOCKED_CELLS, bLockedCells );
+-        pProtect->setOption( ScTableProtection::SELECT_UNLOCKED_CELLS, bUnlockedCells );
++		if( pProtect )
++		{
++        	pProtect->setOption( ScTableProtection::SELECT_LOCKED_CELLS, bLockedCells );
++        	pProtect->setOption( ScTableProtection::SELECT_UNLOCKED_CELLS, bUnlockedCells );
++		}	
+     }
+     else
+ 		throw uno::RuntimeException(::rtl::OUString(
+@@ -321,6 +329,12 @@ ScVbaWorksheet::setEnableSelection( sal_
+ 
+ }
+ 
++sal_Int16
++ScVbaWorksheet::getIndex() throw (uno::RuntimeException)
++{
++	return getSheetID() + 1;
++}
++
+ uno::Reference< excel::XRange > 
+ ScVbaWorksheet::getUsedRange() throw (uno::RuntimeException)
+ {
+@@ -806,13 +820,17 @@ ScVbaWorksheet::getControlShape( const :
+     for( int index = 0; index < nCount; index++ )
+     {
+         uno::Any aUnoObj =  xIndexAccess->getByIndex( index );
+-        uno::Reference< drawing::XControlShape > xControlShape( aUnoObj, uno::UNO_QUERY_THROW );
+-        uno::Reference< container::XNamed > xNamed( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+-        if( sName.equals( xNamed->getName() ))
+-        {
+-            return aUnoObj;
+-        }
+-
++		// It seems there are some drawing objects that can not query into Control shapes?
++        uno::Reference< drawing::XControlShape > xControlShape( aUnoObj, uno::UNO_QUERY );
++		if( xControlShape.is() )
++		{
++    	    uno::Reference< container::XNamed > xNamed( xControlShape->getControl(), uno::UNO_QUERY_THROW );
++		//	OSL_TRACE("Index: %d\t,Object Name:%s",index+1, rtl::OUStringToOString(xNamed->getName(),RTL_TEXTENCODING_UTF8).getStr());
++        	if( sName.equals( xNamed->getName() ))
++        	{
++            	return aUnoObj;
++       		}
++		}
+     }
+     return uno::Any();
+ }



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