ooo-build r12364 - in trunk: . patches/vba



Author: pflin
Date: Tue Apr 29 07:03:24 2008
New Revision: 12364
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12364&view=rev

Log:
	* patches/vba/vba-hyperlink-service.diff: updated by Noel's  
	  comments.



Modified:
   trunk/ChangeLog
   trunk/patches/vba/vba-hyperlink-service.diff

Modified: trunk/patches/vba/vba-hyperlink-service.diff
==============================================================================
--- trunk/patches/vba/vba-hyperlink-service.diff	(original)
+++ trunk/patches/vba/vba-hyperlink-service.diff	Tue Apr 29 07:03:24 2008
@@ -127,7 +127,6 @@
 +	[attribute] string Address;
 +	[attribute] string Name;
 +	[attribute] string TextToDisplay;
-+	[attribute] string SubAddress;
 +
 +	XRange Range();
 +};
@@ -163,8 +162,8 @@
  
  	// Component registration
          if ( component_writeInfoHelper( pServiceManager, pRegistryKey, 
--		range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl ) )
-+		range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ) )
+-		range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl ) )
++		range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ) )
  		{
  			// Singleton registration
  			try
@@ -172,14 +171,89 @@
      {
  		OSL_TRACE("In component_getFactory for %s", pImplName );
  	void* pRet =  component_getFactoryHelper(
--        	pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl );
-+        	pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl );
+-        	pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl );
++        	pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl );
  	OSL_TRACE("Ret is 0x%x", pRet);
  	return pRet;
      }
 --- /dev/null	2007-09-22 03:12:45.000000000 +0800
-+++ sc/source/ui/vba/vbahyperlink.cxx	2008-04-23 14:41:30.000000000 +0800
-@@ -0,0 +1,167 @@
++++ sc/source/ui/vba/vbahyperlink.hxx	2008-04-29 11:01:18.000000000 +0800
+@@ -0,0 +1,72 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile: vbahyperlink.hxx,v $
++ *
++ *  $Revision: 1.2 $
++ *
++ *  last change: $Author: vg $ $Date: 2007/12/07 10:55:55 $
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++#ifndef SC_VBA_HYPERLINK_HXX
++#define SC_VBA_HYPERLINK_HXX
++
++#include <org/openoffice/excel/XHyperlink.hpp>
++#include <com/sun/star/table/XCell.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
++#include <org/openoffice/excel/XRange.hpp>
++
++#include "vbahelperinterface.hxx"
++
++typedef InheritedHelperInterfaceImpl1< oo::excel::XHyperlink > HyperlinkImpl_BASE;
++
++class ScVbaHyperlink : public HyperlinkImpl_BASE 
++{
++	css::uno::Reference< css::table::XCell > mxCell;
++	css::uno::Reference< css::beans::XPropertySet > mxTextField;
++
++public:
++	ScVbaHyperlink( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext ) throw ( css::lang::IllegalArgumentException );
++	virtual ~ScVbaHyperlink();
++
++	// Attributes
++	virtual ::rtl::OUString SAL_CALL getAddress() throw (css::uno::RuntimeException);
++	virtual void SAL_CALL setAddress( const ::rtl::OUString &rAddress ) throw (css::uno::RuntimeException);
++	virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
++	virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
++	virtual ::rtl::OUString SAL_CALL getTextToDisplay() throw (css::uno::RuntimeException);
++	virtual void SAL_CALL setTextToDisplay( const ::rtl::OUString &rTextToDisplay ) throw (css::uno::RuntimeException);
++	
++	// Methods
++	virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Range() throw (css::uno::RuntimeException);
++
++	// XHelperInterface
++	virtual rtl::OUString& getServiceImplName();
++	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif /* SC_VBA_HYPERLINK_HXX */
++
+--- /dev/null	2007-09-22 03:12:45.000000000 +0800
++++ sc/source/ui/vba/vbahyperlink.cxx	2008-04-29 11:08:20.000000000 +0800
+@@ -0,0 +1,139 @@
 +/*************************************************************************
 + *
 + *  OpenOffice.org - a multi-platform office productivity suite
@@ -230,10 +304,7 @@
 +	mxCell = getXSomethingFromArgs< table::XCell >( args, 1, false );
 +	uno::Reference< text::XTextFieldsSupplier > xTextFields( mxCell, uno::UNO_QUERY_THROW );
 +	uno::Reference< container::XIndexAccess > xIndex( xTextFields->getTextFields(), uno::UNO_QUERY_THROW );
-+	if( xIndex->getCount() > 0 )
-+	{
-+		mxTextField.set( xIndex->getByIndex(0), uno::UNO_QUERY_THROW );
-+	}
++	mxTextField.set( xIndex->getByIndex(0), uno::UNO_QUERY_THROW );
 +}
 +
 +ScVbaHyperlink::~ScVbaHyperlink()
@@ -244,11 +315,8 @@
 +ScVbaHyperlink::getAddress() throw (css::uno::RuntimeException)
 +{
 +	rtl::OUString aAddress;
-+	if( mxTextField.is() )
-+	{
-+		uno::Any aValue = mxTextField->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
-+		aValue >>= aAddress;
-+	}
++	uno::Any aValue = mxTextField->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
++	aValue >>= aAddress;
 +	return aAddress;
 +}
 +
@@ -256,11 +324,8 @@
 +ScVbaHyperlink::setAddress( const ::rtl::OUString & rAddress ) throw (css::uno::RuntimeException)
 +{
 +	uno::Any aValue;
-+	if( mxTextField.is() )
-+	{
-+		aValue <<= rAddress;
-+		mxTextField->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ), aValue );
-+	}
++	aValue <<= rAddress;
++	mxTextField->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ), aValue );
 +}
 +
 +::rtl::OUString
@@ -280,11 +345,8 @@
 +ScVbaHyperlink::getTextToDisplay() throw (css::uno::RuntimeException)
 +{
 +	rtl::OUString aTextToDisplay;
-+	if( mxTextField.is() )
-+	{
-+		uno::Any aValue = mxTextField->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ) );
-+		aValue >>= aTextToDisplay;
-+	}
++	uno::Any aValue = mxTextField->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ) );
++	aValue >>= aTextToDisplay;
 +	return aTextToDisplay;
 +}
 +
@@ -292,31 +354,15 @@
 +ScVbaHyperlink::setTextToDisplay( const ::rtl::OUString & rTextToDisplay ) throw (css::uno::RuntimeException)
 +{
 +	uno::Any aValue;
-+	if( mxTextField.is() )
-+	{
-+		aValue <<= rTextToDisplay;
-+		mxTextField->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ), aValue );
-+	}
-+}
-+
-+::rtl::OUString
-+ScVbaHyperlink::getSubAddress() throw (css::uno::RuntimeException)
-+{
-+	// TODO: need to investigate the behavior of MSO
-+	rtl::OUString aSubAddress;
-+	return aSubAddress;
-+}
-+
-+void
-+ScVbaHyperlink::setSubAddress( const ::rtl::OUString& /*rSubAddress*/ ) throw (css::uno::RuntimeException)
-+{
-+	// TODO: need to investigate the behavior of MSO
++	aValue <<= rTextToDisplay;
++	mxTextField->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ), aValue );
 +}
 +
 +css::uno::Reference< oo::excel::XRange > SAL_CALL ScVbaHyperlink::Range() throw (css::uno::RuntimeException)
 +{
 +	uno::Reference< table::XCellRange > xRange( mxCell,uno::UNO_QUERY_THROW );
-+	return uno::Reference< excel::XRange >( new ScVbaRange( this, mxContext, xRange ) );
++	// FIXME: need to pass current worksheet as the parent of XRange.
++	return uno::Reference< excel::XRange >( new ScVbaRange( uno::Reference< vba::XHelperInterface > (), mxContext, xRange ) );
 +}
 +
 +rtl::OUString&
@@ -347,80 +393,3 @@
 +    "ScVbaHyperlink",
 +    "org.openoffice.excel.Hyperlink" );
 +}
---- /dev/null	2007-09-22 03:12:45.000000000 +0800
-+++ sc/source/ui/vba/vbahyperlink.hxx	2008-04-23 14:41:30.000000000 +0800
-@@ -0,0 +1,74 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile: vbahyperlink.hxx,v $
-+ *
-+ *  $Revision: 1.2 $
-+ *
-+ *  last change: $Author: vg $ $Date: 2007/12/07 10:55:55 $
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+#ifndef SC_VBA_HYPERLINK_HXX
-+#define SC_VBA_HYPERLINK_HXX
-+
-+#include <org/openoffice/excel/XHyperlink.hpp>
-+#include <com/sun/star/table/XCell.hpp>
-+#include <com/sun/star/beans/XPropertySet.hpp>
-+#include <org/openoffice/excel/XRange.hpp>
-+
-+#include "vbahelperinterface.hxx"
-+
-+typedef InheritedHelperInterfaceImpl1< oo::excel::XHyperlink > HyperlinkImpl_BASE;
-+
-+class ScVbaHyperlink : public HyperlinkImpl_BASE 
-+{
-+	css::uno::Reference< css::table::XCell > mxCell;
-+	css::uno::Reference< css::beans::XPropertySet > mxTextField;
-+
-+public:
-+	ScVbaHyperlink( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext ) throw ( css::lang::IllegalArgumentException );
-+	virtual ~ScVbaHyperlink();
-+
-+	// Attributes
-+	virtual ::rtl::OUString SAL_CALL getAddress() throw (css::uno::RuntimeException);
-+	virtual void SAL_CALL setAddress( const ::rtl::OUString &rAddress ) throw (css::uno::RuntimeException);
-+	virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
-+	virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
-+	virtual ::rtl::OUString SAL_CALL getTextToDisplay() throw (css::uno::RuntimeException);
-+	virtual void SAL_CALL setTextToDisplay( const ::rtl::OUString &rTextToDisplay ) throw (css::uno::RuntimeException);
-+	virtual ::rtl::OUString SAL_CALL getSubAddress() throw (css::uno::RuntimeException);
-+	virtual void SAL_CALL setSubAddress( const ::rtl::OUString &rSubAddress ) throw (css::uno::RuntimeException);
-+	
-+	// Methods
-+	virtual css::uno::Reference< oo::excel::XRange > SAL_CALL Range() throw (css::uno::RuntimeException);
-+
-+	// XHelperInterface
-+	virtual rtl::OUString& getServiceImplName();
-+	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
-+};
-+#endif /* SC_VBA_HYPERLINK_HXX */
-+



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