ooo-build r15404 - trunk/patches/vba



Author: noelpwer
Date: Tue Feb 24 11:56:03 2009
New Revision: 15404
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15404&view=rev

Log:
eek, the last commit was of a blank file



Modified:
   trunk/patches/vba/vba-fix-copysheet-toend.diff

Modified: trunk/patches/vba/vba-fix-copysheet-toend.diff
==============================================================================
--- trunk/patches/vba/vba-fix-copysheet-toend.diff	(original)
+++ trunk/patches/vba/vba-fix-copysheet-toend.diff	Tue Feb 24 11:56:03 2009
@@ -0,0 +1,75 @@
+diff --git sc/source/core/data/documen2.cxx sc/source/core/data/documen2.cxx
+index 8f0413b..2ca7f75 100644
+--- sc/source/core/data/documen2.cxx
++++ sc/source/core/data/documen2.cxx
+@@ -846,6 +846,7 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
+ 		if (nNewPos == nMaxTableNumber)
+ 		{
+ 			pTab[nMaxTableNumber] = new ScTable(this, nMaxTableNumber, aName);
++                        pTab[nMaxTableNumber]->SetCodeName( aName );
+ 			++nMaxTableNumber;
+ 		}
+ 		else
+@@ -882,8 +883,9 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
+ 					pTab[i] = pTab[i - 1];
+ 				if (nNewPos <= nOldPos)
+ 					nOldPos++;
+-				pTab[nNewPos] = new ScTable(this, nNewPos, aName);
+-				++nMaxTableNumber;
++					pTab[nNewPos] = new ScTable(this, nNewPos, aName);
++                                        pTab[nNewPos]->SetCodeName( aName );
++					++nMaxTableNumber;
+ 				bValid = TRUE;
+ 				for (i = 0; i <= MAXTAB; i++)
+ 					if (pTab[i] && i != nOldPos && i != nNewPos)
+diff --git sc/source/ui/docshell/docsh5.cxx sc/source/ui/docshell/docsh5.cxx
+index 3b5986c..fe54573 100644
+--- sc/source/ui/docshell/docsh5.cxx
++++ sc/source/ui/docshell/docsh5.cxx
+@@ -69,6 +69,7 @@
+ #include "waitoff.hxx"
+ #include "sizedev.hxx"
+ #include <basic/sbstar.hxx>
++#include <basic/basmgr.hxx>
+ 
+ // defined in docfunc.cxx
+ void lcl_InsertModule( ScDocShell& rDocSh, SCTAB nTab, String& sModuleName, String& sModuleSource );
+@@ -844,17 +845,27 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
+ 			}
+ 			
+ 			StarBASIC* pStarBASIC = GetBasic();
++        		String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
++                        if ( GetBasicManager()->GetName().Len() > 0 )
++			{
++				aLibName = GetBasicManager()->GetName();
++				pStarBASIC = GetBasicManager()->GetLib( aLibName );
++			}
+ 			BOOL bVbaEnabled = pStarBASIC ? pStarBASIC->isVBAEnabled() : FALSE;
++			SCTAB nTabToUse = nDestTab; 
++
++			if ( nDestTab == SC_TAB_APPEND )
++				nTabToUse = aDocument.GetMaxTableNumber() - 1;
++
+ 			if ( bVbaEnabled )
+ 			{
+ 				String sCodeName;
+ 				String sSource;
+-				aDocument.GetCodeName( nDestTab, sCodeName );
++				aDocument.GetCodeName( nTabToUse, sCodeName );
+ 				com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer > xLibContainer = GetBasicContainer();
+ 				com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > xLib;
+     				if( xLibContainer.is() )
+     				{
+-        				String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+         				com::sun::star::uno::Any aLibAny = xLibContainer->getByName( aLibName );
+         				aLibAny >>= xLib;
+     				}
+@@ -867,7 +878,7 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
+ 					xLib->getByName( sModName ) >>= sModuleInfo;
+ 					sSource = sModuleInfo.ModuleSource;
+ 				} 
+-				lcl_InsertModule( *this, nDestTab, sCodeName, sSource );
++				lcl_InsertModule( *this, nTabToUse, sCodeName, sSource );
+ 			}
+ 		}
+ 



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