ooo-build r13739 - in trunk: . patches/dev300 patches/vba scratch/sc-vba/testvba/TestDocuments



Author: pflin
Date: Mon Sep  1 03:22:41 2008
New Revision: 13739
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13739&view=rev

Log:
2008-09-01  Fong Lin  <pflin novell com>
	* patches/vba/vba-worksheet-calculate-event-fix.diff: Updated some
	comments.
	* patches/dev300/controls-with-images-import.diff: Support others
	controls with image.
	* scratch/sc-vba/testvba/TestDocuments/imagecontrols.xls: test file
	for controls with image.



Added:
   trunk/scratch/sc-vba/testvba/TestDocuments/imagecontrols.xls   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/controls-with-images-import.diff
   trunk/patches/vba/vba-worksheet-calculate-event-fix.diff

Modified: trunk/patches/dev300/controls-with-images-import.diff
==============================================================================
--- trunk/patches/dev300/controls-with-images-import.diff	(original)
+++ trunk/patches/dev300/controls-with-images-import.diff	Mon Sep  1 03:22:41 2008
@@ -1,5 +1,5 @@
---- svx/inc/svx/msocximex.hxx.orig	2008-08-15 13:27:08.000000000 +0800
-+++ svx/inc/svx/msocximex.hxx	2008-08-15 16:20:01.000000000 +0800
+--- svx/inc/svx/msocximex.hxx.bak	2008-09-01 10:18:35.000000000 +0800
++++ svx/inc/svx/msocximex.hxx	2008-09-01 10:35:13.000000000 +0800
 @@ -32,6 +32,7 @@
  
  #include <sot/storage.hxx>
@@ -8,6 +8,32 @@
  
  //!! no such defines in global namespaces - it will break other existing code that uses the same define!!
  //#ifndef C2U
+@@ -327,14 +328,13 @@ public:
+     nMultiState(0), nValueLen(0), nCaptionLen(0), nVertPos(1), nHorzPos(7),
+ 	nSpecialEffect(2), nIcon(0), nPicture(0), nAccelerator(0), nGroupNameLen(0),
+ 	pValue(0), pCaption(0), pGroupName(0), nIconLen(0), pIcon(0),
+-    nPictureLen(0), pPicture(0) {}
++    nPictureLen(0) {}
+ 
+ 	~OCX_ModernControl() {
+ 		if (pValue) delete[] pValue;
+ 		if (pCaption) delete[] pCaption;
+ 		if (pGroupName) delete[] pGroupName;
+ 		if (pIcon) delete[] pIcon;
+-		if (pPicture) delete[] pPicture;
+ 	}
+ 	sal_Bool Read(SotStorageStream *pS);
+ 
+@@ -417,7 +417,8 @@ public:
+ 
+ 	sal_uInt8 pPictureHeader[20];
+ 	sal_uInt32 nPictureLen;
+-	sal_uInt8 *pPicture;
++    ::rtl::OUString sImageUrl;
++	com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
+ 
+ };
+ 
 @@ -466,6 +467,7 @@ public:
  
          bool bAutoSize;
@@ -16,10 +42,62 @@
          sal_Bool Read(SotStorageStream *pS);
  
  	using OCX_Control::Import; // to not hide the other two import methods
-
-
---- svx/source/msfilter/msocximex.cxx.orig	2008-08-21 14:55:02.000000000 +0800
-+++ svx/source/msfilter/msocximex.cxx	2008-08-21 15:05:53.000000000 +0800
+@@ -817,7 +819,6 @@ public:
+ 	{
+ 		delete[] pCaption;
+ 		delete[] pIcon;
+-		delete[] pPicture;
+ 	}
+ 
+ 	virtual sal_Bool Read(SvStorageStream *pS);
+@@ -881,7 +882,8 @@ public:
+ 
+ 	sal_uInt8 pPictureHeader[20];
+ 	sal_uInt32  nPictureLen;
+-	sal_uInt8 *pPicture;
++    ::rtl::OUString sImageUrl;
++	com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
+ private:
+         com::sun::star::uno::Reference<
+                 com::sun::star::uno::XComponentContext> mxCtx;
+@@ -1076,7 +1078,7 @@ public:
+ 	fEnabled(1), fLocked(0), fBackStyle(1), fWordWrap(0), fAutoSize(0),
+         nCaptionLen(0), nVertPos(1), nHorzPos(7), nMousePointer(0), nPicture(0),
+         nAccelerator(0), nIcon(0), pCaption(0), nIconLen(0), pIcon(0), nPictureLen(0),
+-        pPicture(0), mbTakeFocus( true )
++        mbTakeFocus( true )
+ 	{
+ 	        msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.CommandButton");
+ 	        msDialogType = rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlButtonModel");
+@@ -1087,7 +1089,6 @@ public:
+ 	~OCX_CommandButton() {
+ 		if (pCaption) delete[] pCaption;
+ 		if (pIcon) delete[] pIcon;
+-		if (pPicture) delete[] pPicture;
+ 	}
+ 	sal_Bool Read(SotStorageStream *pS);
+ 
+@@ -1130,7 +1131,8 @@ public:
+ 
+ 	sal_uInt8 pPictureHeader[20];
+ 	sal_uInt32  nPictureLen;
+-	sal_uInt8 *pPicture;
++    ::rtl::OUString sImageUrl;
++	com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
+ 
+     bool        mbTakeFocus;
+ 
+@@ -1248,7 +1250,7 @@ public:
+ 
+ 	sal_uInt8 pPictureHeader[20];
+ 	sal_uInt32  nPictureLen;
+-	sal_uInt8 *pPicture;
++ 	sal_uInt8 *pPicture;
+ 
+ 	static OCX_Control *Create() { return new OCX_Label;}
+ 
+--- svx/source/msfilter/msocximex.cxx.bak	2008-09-01 10:18:35.000000000 +0800
++++ svx/source/msfilter/msocximex.cxx	2008-09-01 10:54:52.000000000 +0800
 @@ -83,6 +83,12 @@
  
  #include <algorithm>
@@ -202,7 +280,130 @@
  
  long WriteAlign(SvStorageStream *pS, int nAmount)
  {
-@@ -5292,12 +5221,6 @@ sal_Bool OCX_TabStrip::ReadFontData(SotS
+@@ -1397,6 +1326,12 @@ sal_Bool OCX_CommandButton::Import( com:
+     rPropSet->setPropertyValue( WW8_ASCII2STR( "FocusOnClick" ), aTmp );
+ 
+ 	aFontData.Import(rPropSet);
++
++    if ( sImageUrl.getLength() )
++    {
++        aTmp <<= sImageUrl;
++        rPropSet->setPropertyValue( WW8_ASCII2STR("ImageURL"), aTmp);
++    }
+ 	return sal_True;
+ }
+ 
+@@ -1780,6 +1715,12 @@ sal_Bool OCX_OptionButton::Import(com::s
+ 	uno::Reference< frame::XModel > xModel ( pDocSh ? pDocSh->GetModel() : NULL );
+ 	lcl_ApplyListSourceAndBindableStuff( xModel, rPropSet, msCtrlSource, msRowSource );
+ 	aFontData.Import(rPropSet);
++
++    if ( sImageUrl.getLength() )
++    {
++        aTmp <<= sImageUrl;
++        rPropSet->setPropertyValue( WW8_ASCII2STR("ImageURL"), aTmp);
++    }
+ 	return sal_True;
+ }
+ 
+@@ -2414,6 +2355,12 @@ sal_Bool OCX_ToggleButton::Import(com::s
+ 	}
+ 
+ 	aFontData.Import(rPropSet);
++	
++    if ( sImageUrl.getLength() )
++    {
++        aTmp <<= sImageUrl;
++        rPropSet->setPropertyValue( WW8_ASCII2STR("ImageURL"), aTmp);
++    }
+ 	return sal_True;
+ }
+ 
+@@ -3271,8 +3218,15 @@ sal_Bool OCX_ModernControl::Read(SvStora
+ 	{
+ 		pS->Read(pPictureHeader,20);
+ 		*pS >> nPictureLen;
+-		pPicture = new sal_uInt8[nPictureLen];
+-		pS->Read(pPicture,nPictureLen);
++		long imagePos = pS->Tell();
++		mxGrfObj = lcl_readGraphicObject( pS );
++		if( mxGrfObj.is() )
++		{
++			sImageUrl = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( GRAPHOBJ_URLPREFIX ) );
++			sImageUrl = sImageUrl + mxGrfObj->getUniqueID();
++		}
++		// make sure the stream position should be pointing after the image
++		pS->Seek( imagePos + nPictureLen );
+ 	}
+ 
+ 	return sal_True;
+@@ -3362,8 +3316,15 @@ sal_Bool OCX_CommandButton::Read(SvStora
+ 	{
+ 		pS->Read(pPictureHeader,20);
+ 		*pS >> nPictureLen;
+-		pPicture = new sal_uInt8[nPictureLen];
+-		pS->Read(pPicture,nPictureLen);
++		long imagePos = pS->Tell();
++		mxGrfObj = lcl_readGraphicObject( pS );
++		if( mxGrfObj.is() )
++		{
++			sImageUrl = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( GRAPHOBJ_URLPREFIX ) );
++			sImageUrl = sImageUrl + mxGrfObj->getUniqueID();
++		}
++		// make sure the stream position should be pointing after the image
++		pS->Seek( imagePos + nPictureLen );
+ 	}
+ 
+ 	return sal_True;
+@@ -4140,8 +4101,7 @@ OCX_UserForm::OCX_UserForm( SotStorageRe
+ 		nKeepScrollBarsVisible(3), nCycle(0), nBorderStyle(0), nSpecialEffect(0),
+ 		nPicture(0), nPictureAlignment(2), nPictureSizeMode(0),
+ 		bPictureTiling(FALSE), nAccelerator(0), nIcon(0), pCaption(0),
+-		nScrollWidth(0), nScrollHeight(0), nScrollLeft(0), nScrollTop(0), nIconLen(0), pIcon(0), nPictureLen(0),
+-		pPicture(0)
++		nScrollWidth(0), nScrollHeight(0), nScrollLeft(0), nScrollTop(0), nIconLen(0), pIcon(0), nPictureLen(0)
+ 	{
+             mnForeColor = 0x80000012;
+ 		    mnBackColor = 0x8000000F;
+@@ -4275,8 +4235,15 @@ sal_Bool OCX_UserForm::Read(SvStorageStr
+ 	{
+ 		pS->Read(pPictureHeader,20);
+ 		*pS >> nPictureLen;
+-		pPicture = new sal_uInt8[nPictureLen];
+-		pS->Read(pPicture,nPictureLen);
++		long imagePos = pS->Tell();
++		mxGrfObj = lcl_readGraphicObject( pS );
++		if( mxGrfObj.is() )
++		{
++			sImageUrl = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( GRAPHOBJ_URLPREFIX ) );
++			sImageUrl = sImageUrl + mxGrfObj->getUniqueID();
++		}
++		// make sure the stream position should be pointing after the image
++		pS->Seek( imagePos + nPictureLen );
+ 	}
+ 
+     ReadAlign( pS, pS->Tell() - nStart, 4);
+@@ -4338,6 +4305,19 @@ sal_Bool OCX_UserForm::Import(
+         rLib->replaceByName(sName, aSourceAny);
+     else
+         rLib->insertByName(sName, aSourceAny);
++
++    if ( sImageUrl.getLength() )
++    {
++        aTmp <<= sImageUrl;
++		try
++		{
++        	xDialogPropSet->setPropertyValue( WW8_ASCII2STR("ImageURL"), aTmp);
++		}
++		catch( uno::Exception& )
++		{
++			OSL_TRACE("OCX_UserForm::Import, Image fails to import");
++		}
++    }
+     return sal_True;
+ }
+ 
+@@ -5276,12 +5256,6 @@ sal_Bool OCX_TabStrip::ReadFontData(SotS
  
  sal_Bool OCX_Image::Read(SotStorageStream *pS)
  {
@@ -215,10 +416,11 @@
      ULONG nStart = pS->Tell();
  	*pS >> nIdentifier;
  	DBG_ASSERT(nStandardId==nIdentifier,
-@@ -5389,15 +5312,14 @@ sal_Bool OCX_Image::Read(SotStorageStrea
+@@ -5372,16 +5346,14 @@ sal_Bool OCX_Image::Read(SotStorageStrea
+ 
          long imagePos = pS->Tell();
  
-         pS->Seek( imagePos );
+-        pS->Seek( imagePos );
 -
 -        sImageUrl =  C2U("vnd.sun.star.expand:${$BRAND_BASE_DIR/program/") + C2U( SAL_CONFIGFILE( "bootstrap" ) ) + C2U("::UserInstallation}/user/temp/") + sName;
 -

Modified: trunk/patches/vba/vba-worksheet-calculate-event-fix.diff
==============================================================================
--- trunk/patches/vba/vba-worksheet-calculate-event-fix.diff	(original)
+++ trunk/patches/vba/vba-worksheet-calculate-event-fix.diff	Mon Sep  1 03:22:41 2008
@@ -74,17 +74,17 @@
 +	iter = ::std::find( maTabs.begin(), maTabs.end(), nTab );
 +	if( iter != maTabs.end() )
 +	{
++		// make sure fire worksheet calculate event only once for each sheet 
++		// regardless of how many formula cells are calculated.
++		maTabs.erase(iter);
+ 
 +		uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( GetVbaEventsHelper(), uno::UNO_QUERY );
 +		if( xVbaEventsHelper.is() )
 +		{
 +			uno::Sequence< uno::Any > aArgs(1);
-+			aArgs[0] <<= *iter;
++			aArgs[0] <<= nTab;
 +			bSuccess = xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_CALCULATE, aArgs );
 +		}
- 
-+		// make sure fire worksheet calculate event only once for each sheet 
-+		// regardless of how much formula cell are calculated.
-+		maTabs.erase(iter);
 +	}	
 +	return bSuccess;
 +}
@@ -156,7 +156,7 @@
 +void ScFormulaCell::SetDirtyVar()
 +{
 +	bDirty = TRUE;
-+	// mark this cell should be calculate
++	// mark the sheet of this cell to be calculated
 +	pDocument->AddCalculateTable( aPos.Tab() );
 +}
 +

Added: trunk/scratch/sc-vba/testvba/TestDocuments/imagecontrols.xls
==============================================================================
Binary file. No diff available.



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