ooo-build r13371 - in branches/ooo-build-2-4-1: . patches/src680 patches/vba



Author: pmladek
Date: Wed Jul 23 18:05:16 2008
New Revision: 13371
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13371&view=rev

Log:
2008-07-23  Petr Mladek <pmladek suse cz>

	* patches/src680/apply: apply
	  sc-vbaimport-override-controlname.diff (bnc#359933)
	  vba-range-find.diff (bnc#405304)
	  vba-listbox-removeitem.diff (bnc#405306)
	  vba-spin-button.diff (bnc#405308)
	  bug-406675-fix.diff (bnc#406675)

	* patches/vba/vba-register-macro-fix.diff, patches/src680/apply:
	  fail to return the main menu; regression caused by
	  sc-vbaimport-override-controlname.diff (bnc#408263)

	* patches/vba/vba-pagesetup-orientation.diff, patches/src680/apply: 
	  add support for Pagesetup.Orientation (bnc#405310)



Added:
   branches/ooo-build-2-4-1/patches/vba/vba-pagesetup-orientation.diff
   branches/ooo-build-2-4-1/patches/vba/vba-register-macro-fix.diff
Modified:
   branches/ooo-build-2-4-1/ChangeLog
   branches/ooo-build-2-4-1/patches/src680/apply

Modified: branches/ooo-build-2-4-1/patches/src680/apply
==============================================================================
--- branches/ooo-build-2-4-1/patches/src680/apply	(original)
+++ branches/ooo-build-2-4-1/patches/src680/apply	Wed Jul 23 18:05:16 2008
@@ -1582,6 +1582,16 @@
 # export of hlink bindings for shapes
 sc-export-shape-hlink-bindings.diff, n#304739, noelpwer
 
+# attributes present in the vba streams can override the default shape name
+# used for the control in the binary format
+sc-vbaimport-override-controlname.diff, n#359933, noelpwer
+# fail to return the main menu
+# regression caused by sc-vbaimport-override-controlname.diff 
+vba-register-macro-fix.diff, n#408263, Fong
+
+# crash when click "Appen Row" button
+bug-406675-fix.diff, n#406675, noelpwer
+
 # Application.Caller
 api-application-caller.diff, n#339941, noelpwer
 default-autotext-and-form-name.diff, n#353687
@@ -1609,6 +1619,14 @@
 vba-always-set-defaultprop.diff, n#388049, noelpwer
 # fix for n#390080, add PageSetup.PrintArea method
 vba-pagesetup-object.diff, n#390080, Fong
+# Range.Find
+vba-range-find.diff, n#405304, Jianhua
+# ListBox.removeItem
+vba-listbox-removeitem.diff, n#405306, Jianhua
+# For SpinButton
+vba-spin-button.diff, n#405308, Jianhua
+# Pagesetup.Orientation
+vba-pagesetup-orientation.diff, n#405310, Fong
 [ VBAUntested ]
 SectionOwner => noelpwer
 basic-source-classes-eventatt-cxx.diff, #no-upstream

Added: branches/ooo-build-2-4-1/patches/vba/vba-pagesetup-orientation.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4-1/patches/vba/vba-pagesetup-orientation.diff	Wed Jul 23 18:05:16 2008
@@ -0,0 +1,226 @@
+--- oovbaapi/org/openoffice/excel.bk/XPageSetup.idl	2008-07-10 10:54:50.000000000 +0800
++++ oovbaapi/org/openoffice/excel/XPageSetup.idl	2008-07-10 11:04:12.000000000 +0800
+@@ -52,6 +52,7 @@ interface XPageSetup
+ 
+ 	//Attributes
+     [attribute] string PrintArea;
++    [attribute] long Orientation;
+ 
+ };
+ 
+--- sc/source/ui/vba.bk/vbaworksheet.cxx	2008-07-10 10:55:13.000000000 +0800
++++ sc/source/ui/vba/vbaworksheet.cxx	2008-07-10 11:13:13.000000000 +0800
+@@ -275,8 +275,7 @@ ScVbaWorksheet::Outline( ) throw (uno::R
+ uno::Reference< excel::XPageSetup >
+ ScVbaWorksheet::PageSetup( ) throw (uno::RuntimeException)
+ {
+-	uno::Reference<sheet::XPrintAreas> xPrintAreas(getSheet(),uno::UNO_QUERY_THROW);
+-	return new ScVbaPageSetup( this, mxContext, xPrintAreas, getModel());
++    return new ScVbaPageSetup( this, mxContext, getSheet(), getModel() );
+ }
+ 
+ sal_Int32 
+--- sc/source/ui/vba.bk/vbapagesetup.hxx	2008-07-10 10:55:13.000000000 +0800
++++ sc/source/ui/vba/vbapagesetup.hxx	2008-07-10 11:08:59.000000000 +0800
+@@ -30,28 +30,32 @@
+ #ifndef SC_VBA_PAGESETUP_HXX
+ #define SC_VBA_PAGESETUP_HXX
+ 
+-#include <com/sun/star/sheet/XPrintAreas.hpp>
+ #include <cppuhelper/implbase1.hxx>
+ #include <org/openoffice/excel/XPageSetup.hpp>
+ #include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/sheet/XSpreadsheet.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
+ #include "vbahelperinterface.hxx"
+ 
+ typedef InheritedHelperInterfaceImpl1< oo::excel::XPageSetup > ScVbaPageSetup_BASE;
+ 
+ class ScVbaPageSetup :  public ScVbaPageSetup_BASE 
+ {
+-	css::uno::Reference< css::sheet::XPrintAreas > mxPrintAreas;
+-	css::uno::Reference< css::frame::XModel > mxModel;
++    css::uno::Reference< css::sheet::XSpreadsheet > mxSheet;
++    css::uno::Reference< css::beans::XPropertySet > mxPageProps;
++    css::uno::Reference< css::frame::XModel > mxModel;
+ public:
+ 	ScVbaPageSetup( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, 
+-					const css::uno::Reference< css::uno::XComponentContext >& xContext, 
+-					const css::uno::Reference< css::sheet::XPrintAreas >& xPrintareas, 
+-					const css::uno::Reference< css::frame::XModel >& xModel) throw (css::uno::RuntimeException);
++                    const css::uno::Reference< css::uno::XComponentContext >& xContext,
++		            const css::uno::Reference< css::sheet::XSpreadsheet>& xSheet,
++                    const css::uno::Reference< css::frame::XModel >& xModlel) throw (css::uno::RuntimeException); 
+ 	virtual ~ScVbaPageSetup(){}
+     
+     // Attribute
+ 	virtual rtl::OUString SAL_CALL getPrintArea() throw (css::uno::RuntimeException);
+ 	virtual void SAL_CALL setPrintArea( const rtl::OUString& rAreas ) throw (css::uno::RuntimeException);
++	virtual sal_Int32 SAL_CALL getOrientation() throw (css::uno::RuntimeException);
++	virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException);
+ 
+ 	// XHelperInterface
+ 	virtual rtl::OUString& getServiceImplName();
+--- sc/source/ui/vba.bk/vbapagesetup.cxx	2008-07-10 10:55:13.000000000 +0800
++++ sc/source/ui/vba/vbapagesetup.cxx	2008-07-10 11:11:49.000000000 +0800
+@@ -31,6 +31,15 @@
+ #include "cellsuno.hxx"
+ #include "convuno.hxx"
+ #include "rangelst.hxx"
++#include <com/sun/star/sheet/XPrintAreas.hpp>
++#include <com/sun/star/sheet/XHeaderFooterContent.hpp>
++#include <com/sun/star/text/XText.hpp>
++#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
++#include <com/sun/star/container/XNameAccess.hpp>
++#include <org/openoffice/excel/XlPageOrientation.hpp>
++#include <org/openoffice/excel/XlOrder.hpp>
++#include <org/openoffice/excel/Constants.hpp>
++
+ using namespace ::com::sun::star;
+ using namespace ::org::openoffice;
+ 
+@@ -38,17 +47,28 @@ bool getScRangeListForAddress( const rtl
+ 
+ ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< vba::XHelperInterface >& xParent, 
+ 				const uno::Reference< uno::XComponentContext >& xContext,
+-				const uno::Reference< sheet::XPrintAreas >& xPrintareas,
++				const uno::Reference< sheet::XSpreadsheet >& xSheet,
+ 				const uno::Reference< frame::XModel >& xModel) throw (uno::RuntimeException):
+ 	   	ScVbaPageSetup_BASE( xParent, xContext ),
+-		mxPrintAreas( xPrintareas ), mxModel( xModel )
++		mxSheet( xSheet ), mxModel( xModel )
+ {
++    // query for current page style
++    uno::Reference< beans::XPropertySet > xSheetProps( mxSheet, uno::UNO_QUERY_THROW );
++    uno::Any aValue = xSheetProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageStyle" )));
++    rtl::OUString aStyleName;
++    aValue >>= aStyleName;
++
++    uno::Reference< style::XStyleFamiliesSupplier > xStyleFamiliesSup( mxModel, uno::UNO_QUERY_THROW );
++    uno::Reference< container::XNameAccess > xStyleFamilies = xStyleFamiliesSup->getStyleFamilies();
++    uno::Reference< container::XNameAccess > xPageStyle( xStyleFamilies->getByName(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyles"))), uno::UNO_QUERY_THROW );
++    mxPageProps.set( xPageStyle->getByName(aStyleName), uno::UNO_QUERY_THROW );
+ }		
+ 
+ rtl::OUString SAL_CALL ScVbaPageSetup::getPrintArea() throw (css::uno::RuntimeException)
+ {
+     String aPrintArea;
+-    uno::Sequence< table::CellRangeAddress > aSeq = mxPrintAreas->getPrintAreas();
++    uno::Reference< sheet::XPrintAreas > xPrintAreas( mxSheet, uno::UNO_QUERY_THROW );
++    uno::Sequence< table::CellRangeAddress > aSeq = xPrintAreas->getPrintAreas();
+     sal_Int32 nCount = aSeq.getLength();
+     if( nCount )
+     {
+@@ -71,30 +91,92 @@ rtl::OUString SAL_CALL ScVbaPageSetup::g
+ 
+ void SAL_CALL ScVbaPageSetup::setPrintArea( const rtl::OUString& rAreas ) throw (css::uno::RuntimeException)
+ {
+-        if( rAreas.getLength() == 0 ||
+-            rAreas.equalsIgnoreAsciiCase ( rtl::OUString::createFromAscii("FALSE") ) )
++    uno::Reference< sheet::XPrintAreas > xPrintAreas( mxSheet, uno::UNO_QUERY_THROW );
++    if( rAreas.getLength() == 0 ||
++        rAreas.equalsIgnoreAsciiCase ( rtl::OUString::createFromAscii("FALSE") ) )
++    {
++        // print the whole sheet
++        uno::Sequence< table::CellRangeAddress > aSeq;
++        xPrintAreas->setPrintAreas( aSeq );
++    }
++    else
++    {
++		ScRangeList aCellRanges;
++		ScRange aRange;
++		if( getScRangeListForAddress( rAreas, getDocShell( mxModel ) , aRange, aCellRanges ) ) 
++		{
++			uno::Sequence< table::CellRangeAddress > aSeq( aCellRanges.Count() );
++			USHORT i=0;
++			for( ScRange* pRange = aCellRanges.First(); pRange; pRange = aCellRanges.Next() )
++			{
++				table::CellRangeAddress aRangeAddress;
++				ScUnoConversion::FillApiRange( aRangeAddress, *pRange );
++				aSeq[ i++ ] = aRangeAddress;
++			}
++			xPrintAreas->setPrintAreas( aSeq );
++		}
++    }
++}
++
++sal_Int32 SAL_CALL ScVbaPageSetup::getOrientation() throw (css::uno::RuntimeException)
++{
++    sal_Int32 orientation = excel::XlPageOrientation::xlPortrait;
++    try
++    {
++        sal_Bool isLandscape = sal_False;
++        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
++        aValue >>= isLandscape;
++
++        if( isLandscape )
++        {
++            orientation = excel::XlPageOrientation::xlLandscape;
++        }
++    }
++    catch( uno::Exception& )
++    {
++    }
++    return orientation;
++}
++
++void SAL_CALL ScVbaPageSetup::setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException)
++{
++    if( ( orientation != excel::XlPageOrientation::xlPortrait ) &&
++        ( orientation != excel::XlPageOrientation::xlLandscape ) )
++    {
++        DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
++    }
++
++    try
++    {
++        sal_Bool isLandscape = sal_False;
++        uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")));
++        aValue >>= isLandscape;
++
++        sal_Bool switchOrientation = sal_False;
++        if(( isLandscape && orientation != excel::XlPageOrientation::xlLandscape ) || 
++            ( !isLandscape && orientation != excel::XlPageOrientation::xlPortrait ))
++        {
++            switchOrientation = sal_True;
++        }
++
++        if( switchOrientation )
+         {
+-            // print the whole sheet
+-            uno::Sequence< table::CellRangeAddress > aSeq;
+-            mxPrintAreas->setPrintAreas( aSeq );
++            aValue <<= !isLandscape;
++            uno::Any aHeight = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")));
++            uno::Any aWidth = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")));
++            mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")), aValue );
++            mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")),  aHeight );
++            mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")), aWidth );
+         }
+-        else
++
++        if( isLandscape )
+         {
+-			ScRangeList aCellRanges;
+-			ScRange aRange;
+-			if( getScRangeListForAddress( rAreas, getDocShell( mxModel ) , aRange, aCellRanges ) ) 
+-			{
+-				uno::Sequence< table::CellRangeAddress > aSeq( aCellRanges.Count() );
+-				USHORT i=0;
+-				for( ScRange* pRange = aCellRanges.First(); pRange; pRange = aCellRanges.Next() )
+-				{
+-					table::CellRangeAddress aRangeAddress;
+-					ScUnoConversion::FillApiRange( aRangeAddress, *pRange );
+-					aSeq[ i++ ] = aRangeAddress;
+-				}
+-				mxPrintAreas->setPrintAreas( aSeq );
+-			}
++            orientation = excel::XlPageOrientation::xlLandscape;
+         }
++    }
++    catch( uno::Exception& )
++    {
++    }
+ }
+ 
+ rtl::OUString& 

Added: branches/ooo-build-2-4-1/patches/vba/vba-register-macro-fix.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4-1/patches/vba/vba-register-macro-fix.diff	Wed Jul 23 18:05:16 2008
@@ -0,0 +1,28 @@
+--- sc/source/filter/excel/xlocx.cxx.orig	2008-07-11 16:17:23.000000000 +0800
++++ sc/source/filter/excel/xlocx.cxx	2008-07-11 16:19:20.000000000 +0800
+@@ -363,7 +363,13 @@ void XclImpOcxConverter::RegisterOleMacr
+     if ( rxModel.is() )
+     {
+         // Need to search basic for macro's named e.g. ControlButton1_Click
+-        OUString sSearchString = rOcxCtrlObj.GetObjectName();
++        String sObjectName = rOcxCtrlObj.GetObjectName();
++        const XclImpRoot& rRoot = rOcxCtrlObj;
++        XclImpObjectManager& rObjectManager = rRoot.GetObjectManager();
++        String sOverRide( rObjectManager.GetOleNameOverride( rOcxCtrlObj.GetObjId() ) );
++        if ( sOverRide.Len() > 0 )
++            sObjectName = sOverRide;
++        OUString sSearchString = sObjectName;
+         sSearchString += OUString::createFromAscii("_");
+         ScfPropertySet aPropSet( rxModel );
+  
+@@ -413,8 +419,8 @@ void XclImpOcxConverter::RegisterOleMacr
+                             if ( nSearchIndex == 0  )
+                             {
+                                 Sequence< OUString > sHandlerExtns(1);
+-                                sHandlerExtns[ 0 ] = sMeth.copy( rOcxCtrlObj.GetObjectName().Len() );
+-                                OUString sMacroName = sMeth.copy( 0, rOcxCtrlObj.GetObjectName().Len() );
++                                sHandlerExtns[ 0 ] = sMeth.copy( sObjectName.Len() );
++                                OUString sMacroName = sMeth.copy( 0, sObjectName.Len() );
+                                 Sequence< ScriptEventDescriptor > aDescs( xEvtDescGen->getEventDescriptions( xCntrl, sLibModName, sHandlerExtns ) );
+                                 if ( aDescs.getLength() )
+                                 {



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