ooo-build r12981 - in trunk: . patches/dev300



Author: noelpwer
Date: Fri Jun 27 06:39:30 2008
New Revision: 12981
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12981&view=rev

Log:
2008-06-27  Noel Power  <noel power novell com>

        * patches/dev300/apply: backport cws-impress146 to wrt #i66550
        * patches/dev300/cws-impress146.diff:
        * patches/dev300/vba-sc-autoshapes-hyperlinks.diff: adjust patch
        to work with underlying support for draw:a element enclosing shapes 
        added above



Added:
   trunk/patches/dev300/cws-impress146.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply
   trunk/patches/dev300/vba-sc-autoshapes-hyperlinks.diff

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Fri Jun 27 06:39:30 2008
@@ -326,6 +326,8 @@
 
 cws-cmcfixes47-sw.diff, i#90306
 
+cws-impress146.diff
+
 [ WebDAV ]
 # don't lock for infinite, instead set timeout to 3 minutes, and refresh 30
 # sec before expiration

Added: trunk/patches/dev300/cws-impress146.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/cws-impress146.diff	Fri Jun 27 06:39:30 2008
@@ -0,0 +1,399 @@
+Index: xmloff/inc/xmloff/shapeimport.hxx
+===================================================================
+RCS file: /cvs/xml/xmloff/inc/xmloff/shapeimport.hxx,v
+retrieving revision 1.4
+retrieving revision 1.4.54.1
+diff -u -p -u -p -b -w -B -r1.4 -r1.4.54.1
+--- xmloff/inc/xmloff/shapeimport.hxx	10 Apr 2008 21:06:45 -0000	1.4
++++ xmloff/inc/xmloff/shapeimport.hxx	25 Jun 2008 14:08:11 -0000	1.4.54.1
+@@ -83,6 +83,8 @@ enum SdXMLGroupShapeElemTokenMap
+ 
+ 	XML_TOK_GROUP_ANNOTATION,
+ 
++	XML_TOK_GROUP_A,
++
+ 	XML_TOK_GROUP_LAST
+ };
+ 
+@@ -259,6 +261,7 @@ class SvXMLShapeContext : public SvXMLIm
+ protected:
+ 	com::sun::star::uno::Reference< com::sun::star::drawing::XShape >	mxShape;
+     sal_Bool                                                            mbTemporaryShape;
++	rtl::OUString														msHyperlink;
+ 
+ public:
+ 	SvXMLShapeContext( SvXMLImport& rImp, USHORT nPrfx,
+@@ -267,6 +270,8 @@ public:
+ 	TYPEINFO();
+ 
+ 	const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; }
++
++	void setHyperlink( const ::rtl::OUString& rHyperlink );
+ };
+ 
+ //////////////////////////////////////////////////////////////////////////////
+Index: xmloff/source/draw/makefile.mk
+===================================================================
+RCS file: /cvs/xml/xmloff/source/draw/makefile.mk,v
+retrieving revision 1.23
+retrieving revision 1.23.54.1
+diff -u -p -u -p -b -w -B -r1.23 -r1.23.54.1
+--- xmloff/source/draw/makefile.mk	10 Apr 2008 21:47:29 -0000	1.23
++++ xmloff/source/draw/makefile.mk	25 Jun 2008 14:09:12 -0000	1.23.54.1
+@@ -80,7 +80,8 @@ SLOFILES =	\
+ 		$(SLO)$/ximpcustomshape.obj \
+ 		$(SLO)$/EnhancedCustomShapeToken.obj \
+ 		$(SLO)$/XMLReplacementImageContext.obj \
+-		$(SLO)$/descriptionimp.obj
++		$(SLO)$/descriptionimp.obj \
++		$(SLO)$/ximplink.obj
+ 
+ # --- Targets --------------------------------------------------------------
+ 
+Index: xmloff/source/draw/shapeimport.cxx
+===================================================================
+RCS file: /cvs/xml/xmloff/source/draw/shapeimport.cxx,v
+retrieving revision 1.67
+retrieving revision 1.67.54.1
+diff -u -p -u -p -b -w -B -r1.67 -r1.67.54.1
+--- xmloff/source/draw/shapeimport.cxx	10 Apr 2008 21:51:45 -0000	1.67
++++ xmloff/source/draw/shapeimport.cxx	25 Jun 2008 14:09:12 -0000	1.67.54.1
+@@ -30,10 +30,14 @@
+ 
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_xmloff.hxx"
+-#include "unointerfacetouniqueidentifiermapper.hxx"
++
+ #include <tools/debug.hxx>
++
++#include <com/sun/star/text/PositionLayoutDir.hpp>
+ #include <com/sun/star/chart/XChartDocument.hpp>
+ 
++#include "unointerfacetouniqueidentifiermapper.hxx"
++
+ #include <list>
+ 
+ #ifndef _XMLOFF_SHAPEIMPORT_HXX
+@@ -49,9 +53,7 @@
+ #include "ximp3dscene.hxx"
+ #include "ximp3dobject.hxx"
+ #include "ximpgrp.hxx"
+-// --> OD 2004-10-28 #i28749#, #i36248#
+-#include <com/sun/star/text/PositionLayoutDir.hpp>
+-// <--
++#include "ximplink.hxx"
+ 
+ #include <map>
+ #include <vector>
+@@ -296,6 +298,7 @@ static __FAR_DATA SvXMLTokenMapEntry aGr
+ 
+ 	{ XML_NAMESPACE_DRAW,			XML_CUSTOM_SHAPE,	XML_TOK_GROUP_CUSTOM_SHAPE	},
+ 	{ XML_NAMESPACE_OFFICE,			XML_ANNOTATION,		XML_TOK_GROUP_ANNOTATION	},
++	{ XML_NAMESPACE_DRAW,			XML_A,				XML_TOK_GROUP_A				},
+     
+     XML_TOKEN_MAP_END
+ };
+@@ -826,12 +829,10 @@ SvXMLShapeContext* XMLShapeImportHelper:
+ 			pContext = new SdXMLCustomShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, sal_False );
+ 			break;
+ 		}
+-// 		case XML_TOK_GROUP_CUSTOM_SHAPE:
+-// 		{
+-// 			// draw:customshape
+-// 			pContext = new SdXMLCustomShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes );
+-// 			break;
+-// 		}
++ 		case XML_TOK_GROUP_A:
++ 		{
++ 			return new SdXMLShapeLinkContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes );
++ 		}
+ 		// add other shapes here...
+ 		default:
+ 			return new SvXMLShapeContext( rImport, p_nPrefix, rLocalName, bTemporaryShape );
+@@ -1385,3 +1386,8 @@ const rtl::Reference< XMLTableImport >& 
+ 
+ 	return mxShapeTableImport;
+ }
++
++void SvXMLShapeContext::setHyperlink( const OUString& rHyperlink )
++{
++	msHyperlink = rHyperlink;
++}
+\ No newline at end of file
+Index: xmloff/source/draw/ximplink.cxx
+===================================================================
+RCS file: xmloff/source/draw/ximplink.cxx
+diff -N xmloff/source/draw/ximplink.cxx
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ xmloff/source/draw/ximplink.cxx	25 Jun 2008 14:09:30 -0000	1.1.2.1
+@@ -0,0 +1,105 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ * $Revision$
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org 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 version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_xmloff.hxx"
++#include"xmlnmspe.hxx"
++#include "ximplink.hxx"
++#include <xmloff/xmltoken.hxx>
++
++using ::rtl::OUString;
++using ::rtl::OUStringBuffer;
++
++using namespace ::com::sun::star;
++using namespace ::xmloff::token;
++
++//////////////////////////////////////////////////////////////////////////////
++
++TYPEINIT1( SdXMLShapeLinkContext, SvXMLImportContext );
++
++SdXMLShapeLinkContext::SdXMLShapeLinkContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes) 
++: SvXMLShapeContext( rImport, nPrfx, rLocalName, false )
++, mxParent( rShapes )
++{
++	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
++
++	for(sal_Int16 i=0; i < nAttrCount; i++)
++	{
++		OUString sAttrName = xAttrList->getNameByIndex( i );
++		OUString aLocalName;
++		USHORT nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
++		if( (nPrefix == XML_NAMESPACE_XLINK) && IsXMLToken( aLocalName, XML_HREF ) )
++		{
++			msHyperlink = xAttrList->getValueByIndex( i );
++			break;
++		}
++	}
++}
++
++//////////////////////////////////////////////////////////////////////////////
++
++SdXMLShapeLinkContext::~SdXMLShapeLinkContext()
++{
++}
++
++//////////////////////////////////////////////////////////////////////////////
++
++SvXMLImportContext* SdXMLShapeLinkContext::CreateChildContext( USHORT nPrefix,
++	const OUString& rLocalName,
++	const uno::Reference< xml::sax::XAttributeList>& xAttrList )
++{
++	SvXMLShapeContext* pContext = GetImport().GetShapeImport()->CreateGroupChildContext( GetImport(), nPrefix, rLocalName, xAttrList, mxParent);
++
++	if( pContext )
++	{
++		pContext->setHyperlink( msHyperlink );
++		return pContext;
++	}
++
++	// call parent when no own context was created
++	return SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList);
++
++}
++
++//////////////////////////////////////////////////////////////////////////////
++
++void SdXMLShapeLinkContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttr )
++{
++	SvXMLImportContext::StartElement( xAttr );
++}
++
++//////////////////////////////////////////////////////////////////////////////
++
++void SdXMLShapeLinkContext::EndElement()
++{
++	SvXMLImportContext::EndElement();
++}
++
++
+Index: xmloff/source/draw/ximplink.hxx
+===================================================================
+RCS file: xmloff/source/draw/ximplink.hxx
+diff -N xmloff/source/draw/ximplink.hxx
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ xmloff/source/draw/ximplink.hxx	25 Jun 2008 14:09:40 -0000	1.1.2.1
+@@ -0,0 +1,69 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ * $Revision$
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org 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 version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef _XIMPLINK_HXX
++#define _XIMPLINK_HXX
++
++#include <xmloff/xmlictxt.hxx>
++#include "sdxmlimp_impl.hxx"
++#include <xmloff/nmspmap.hxx>
++#include <com/sun/star/drawing/XShapes.hpp>
++#include <tools/rtti.hxx>
++#include "ximpshap.hxx"
++
++//////////////////////////////////////////////////////////////////////////////
++// draw:a context
++
++// this should have been a SvXMLImportContext but CreateGroupChildContext() returns
++// an unneeded derivation. Should be changed sometime during refactoring.
++
++class SdXMLShapeLinkContext : public SvXMLShapeContext
++{
++	// the parent shape group this link is placed in
++	com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxParent;
++	rtl::OUString msHyperlink;
++
++public:
++	TYPEINFO();
++
++	SdXMLShapeLinkContext( SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLocalName,
++		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
++		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
++	virtual ~SdXMLShapeLinkContext();
++
++	virtual SvXMLImportContext *CreateChildContext( 
++		USHORT nPrefix, const rtl::OUString& rLocalName,
++		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
++	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
++	virtual void EndElement();
++};
++
++
++#endif	//  _XIMPLINK_HXX
+Index: xmloff/source/draw/ximpshap.cxx
+===================================================================
+RCS file: /cvs/xml/xmloff/source/draw/ximpshap.cxx,v
+retrieving revision 1.126
+retrieving revision 1.126.54.1
+diff -u -p -u -p -b -w -B -r1.126 -r1.126.54.1
+--- xmloff/source/draw/ximpshap.cxx	10 Apr 2008 21:56:35 -0000	1.126
++++ xmloff/source/draw/ximpshap.cxx	25 Jun 2008 14:09:12 -0000	1.126.54.1
+@@ -34,6 +34,9 @@
+ 
+ 
+ #include <tools/debug.hxx>
++#include <com/sun/star/document/XEventsSupplier.hpp>
++#include <com/sun/star/container/XNameReplace.hpp>
++#include <com/sun/star/presentation/ClickAction.hpp>
+ #include <com/sun/star/drawing/FillStyle.hpp>
+ #include <com/sun/star/drawing/LineStyle.hpp>
+ #include "unointerfacetouniqueidentifiermapper.hxx"
+@@ -99,6 +102,7 @@ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::drawing;
+ using namespace ::com::sun::star::style;
+ using namespace ::com::sun::star::container;
++using namespace ::com::sun::star::document;
+ using namespace ::xmloff::token;
+ using namespace ::xmloff::EnhancedCustomShapeToken;
+ 
+@@ -372,6 +376,35 @@ void SdXMLShapeContext::EndElement()
+         GetImport().GetTextImport()->_SetListItem( mxOldListItem );
+     }
+ 
++	if( msHyperlink.getLength() != 0 ) try
++	{
++        Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW );
++        Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
++
++        uno::Sequence< beans::PropertyValue > aProperties( 3 );
++		aProperties[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
++		aProperties[0].Handle = -1;
++		aProperties[0].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
++		aProperties[0].State = beans::PropertyState_DIRECT_VALUE;
++
++		aProperties[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ClickAction" ) );
++		aProperties[1].Handle = -1;
++		aProperties[1].Value <<= ::com::sun::star::presentation::ClickAction_DOCUMENT;
++		aProperties[1].State = beans::PropertyState_DIRECT_VALUE;
++
++		aProperties[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Bookmark" ) );
++		aProperties[2].Handle = -1;
++		aProperties[2].Value <<= msHyperlink;
++		aProperties[2].State = beans::PropertyState_DIRECT_VALUE;
++
++        const OUString sAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
++		xEvents->replaceByName( sAPIEventName, Any( aProperties ) );
++	}
++	catch( Exception& )
++	{
++		DBG_ERROR("xmloff::SdXMLShapeContext::EndElement(), exception caught!");
++	}
++
+ 	if( mxLockable.is() )
+ 		mxLockable->removeActionLock();
+ }
+Index: sd/source/core/drawdoc4.cxx
+===================================================================
+RCS file: /cvs/graphics/sd/source/core/drawdoc4.cxx,v
+retrieving revision 1.57
+retrieving revision 1.57.18.1
+diff -u -p -u -p -b -w -B -r1.57 -r1.57.18.1
+--- sd/source/core/drawdoc4.cxx	6 Jun 2008 11:56:59 -0000	1.57
++++ sd/source/core/drawdoc4.cxx	24 Jun 2008 11:18:01 -0000	1.57.18.1
+@@ -561,7 +561,9 @@ static Any implMakeSolidCellStyle( SdSty
+ 
+ static void implCreateTableTemplate( const Reference< XNameContainer >& xTableFamily, const OUString& rName, const Any& rBody, const Any& rHeading, const Any& rBanding )
+ {
+-	try
++	if( xTableFamily.is() ) try
++	{
++        if( !xTableFamily->hasByName( OUString( rName ) ) )
+ 	{
+ 		Reference< XSingleServiceFactory > xFactory( xTableFamily, UNO_QUERY_THROW );
+ 		Reference< XNameReplace > xDefaultTableStyle( xFactory->createInstance(), UNO_QUERY_THROW );
+@@ -575,6 +577,7 @@ static void implCreateTableTemplate( con
+ 		xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("last-row") ), rHeading );
+ 		xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("last-column") ), rHeading );
+ 	}
++	}
+ 	catch( Exception& )
+ 	{
+ 		DBG_ERROR("sd::implCreateTableTemplate(), exception caught!");

Modified: trunk/patches/dev300/vba-sc-autoshapes-hyperlinks.diff
==============================================================================
--- trunk/patches/dev300/vba-sc-autoshapes-hyperlinks.diff	(original)
+++ trunk/patches/dev300/vba-sc-autoshapes-hyperlinks.diff	Fri Jun 27 06:39:30 2008
@@ -305,129 +305,6 @@
              }
          }
      }
-diff -rup ../src680_m217-dr55-applied/sc/source/filter/xml/xmlcelli.cxx sc/source/filter/xml/xmlcelli.cxx
---- ../src680_m217-dr55-applied/sc/source/filter/xml/xmlcelli.cxx	2007-02-27 12:49:18.000000000 +0000
-+++ sc/source/filter/xml/xmlcelli.cxx	2007-07-04 11:55:03.000000000 +0100
-@@ -164,6 +164,84 @@ ScMyImportAnnotation::~ScMyImportAnnotat
-     delete pOPO;
- }
- 
-+//-------------------- #i66550 HLINK_FOR_SHAPES --------------------
-+
-+SvXMLImportContext*
-+lcl_processShapeElement(  ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& xShapes, rtl::OUString& rHLink )
-+{
-+	SvXMLImportContext* pContext = NULL;
-+	table::CellAddress aCellPos = rImport.GetTables().GetRealCellPos();
-+	if (xShapes.is())
-+	{
-+		if (aCellPos.Column > MAXCOL)
-+			aCellPos.Column = MAXCOL;
-+		if (aCellPos.Row > MAXROW)
-+			aCellPos.Row = MAXROW;
-+		XMLTableShapeImportHelper* pTableShapeImport = (XMLTableShapeImportHelper*)rImport.GetShapeImport().get();
-+		pTableShapeImport->SetHlink( rHLink );
-+		pTableShapeImport->SetOnTable(sal_False);
-+		pTableShapeImport->SetCell(aCellPos);
-+		pContext = rImport.GetShapeImport()->CreateGroupChildContext(
-+			rImport, nPrfx, rLName, xAttrList, xShapes, sal_False);
-+	}
-+	return pContext;
-+}
-+
-+class XMLShapeHyperLinkContext : public SvXMLImportContext
-+{
-+	::rtl::OUString sHLink;
-+	ScXMLImport& rXMLImport;
-+public:
-+	XMLShapeHyperLinkContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, const uno::Reference< xml::sax::XAttributeList>& xAttrList );
-+
-+	virtual ~XMLShapeHyperLinkContext(){}
-+	virtual void EndElement(){}
-+
-+	SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
-+		const ::rtl::OUString& rLocalName,
-+		const uno::Reference<xml::sax::XAttributeList >& xAttrList );
-+};
-+
-+XMLShapeHyperLinkContext::XMLShapeHyperLinkContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< xml::sax::XAttributeList>& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ), rXMLImport( rImport )
-+{
-+	// re-use the TableRowCell map ( I don't suppose it's worth implementing a new one )
-+	const SvXMLTokenMap& rTokenMap = rXMLImport.GetShapeHyperlinkTokenMap();
-+	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-+	for( sal_Int16 i=0; i < nAttrCount; i++ )
-+	{
-+		const OUString& rAttrName = xAttrList->getNameByIndex( i );
-+		const OUString& rValue = xAttrList->getValueByIndex( i );
-+
-+		OUString aLocalName;
-+		sal_uInt16 nPrefix = rXMLImport.GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
-+		if ( rTokenMap.Get( nPrefix, aLocalName ) == XML_TOK_SHAPE_ATTR_HREF )
-+		{
-+			sHLink = rXMLImport.GetAbsoluteReference( rValue );
-+			break;
-+		}
-+	}
-+}
-+
-+
-+SvXMLImportContext*
-+XMLShapeHyperLinkContext::CreateChildContext( sal_uInt16 nPrefix,
-+		const ::rtl::OUString& rLocalName,
-+		const ::com::sun::star::uno::Reference<
-+		::com::sun::star::xml::sax::XAttributeList > & xAttrList )
-+{
-+	SvXMLImportContext* pContext = NULL;
-+	uno::Reference<drawing::XShapes> xShapes ( rXMLImport.GetTables().GetCurrentXShapes());
-+	if ( xShapes.is() )
-+	{
-+		pContext = lcl_processShapeElement( rXMLImport, nPrefix, rLocalName, xAttrList, xShapes, sHLink );
-+		if (pContext)
-+			rXMLImport.ProgressBarIncrement(sal_False);
-+	}
-+	if ( !pContext )
-+		pContext = new SvXMLImportContext( rXMLImport, nPrefix, rLocalName );
-+	return pContext;
-+}
-+
- //------------------------------------------------------------------
- 
- ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
-@@ -589,23 +667,23 @@ SvXMLImportContext *ScXMLTableRowCellCon
- 				rXMLImport, nPrefix, rLName, xAttrList, pCellRangeSource );
- 		}
- 		break;
-+	// #i66550 HLINK_FOR_SHAPES
-+	case XML_TOK_TABLE_ROW_CELL_DRAW_A:
-+		{
-+			pContext = new XMLShapeHyperLinkContext(
-+				rXMLImport, nPrefix, rLName, xAttrList );
-+		}
-+		break;
- 	}
--
- 	if (!pContext && !bTextP)
- 	{
--		com::sun::star::table::CellAddress aCellPos = rXMLImport.GetTables().GetRealCellPos();
-+		// #i66550 HLINK_FOR_SHAPES
- 		uno::Reference<drawing::XShapes> xShapes (rXMLImport.GetTables().GetCurrentXShapes());
- 		if (xShapes.is())
- 		{
--			if (aCellPos.Column > MAXCOL)
--				aCellPos.Column = MAXCOL;
--			if (aCellPos.Row > MAXROW)
--				aCellPos.Row = MAXROW;
--			XMLTableShapeImportHelper* pTableShapeImport = (XMLTableShapeImportHelper*)rXMLImport.GetShapeImport().get();
--			pTableShapeImport->SetOnTable(sal_False);
--			pTableShapeImport->SetCell(aCellPos);
--			pContext = rXMLImport.GetShapeImport()->CreateGroupChildContext(
--				rXMLImport, nPrefix, rLName, xAttrList, xShapes);
-+			rtl::OUString sBlank;
-+			pContext = lcl_processShapeElement( rXMLImport, nPrefix, rLName, xAttrList, xShapes, sBlank );
-+
- 			if (pContext)
- 			{
- 				bIsEmpty = sal_False;
 diff -rup ../src680_m217-dr55-applied/sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
 --- ../src680_m217-dr55-applied/sc/source/filter/xml/xmlexprt.cxx	2007-07-03 11:16:23.000000000 +0100
 +++ sc/source/filter/xml/xmlexprt.cxx	2007-07-04 10:22:36.000000000 +0100
@@ -466,148 +343,6 @@
  	IncrementProgressBar(sal_False);
  }
  
-diff -rup ../src680_m217-dr55-applied/sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx
---- ../src680_m217-dr55-applied/sc/source/filter/xml/xmlimprt.cxx	2007-07-03 11:16:23.000000000 +0100
-+++ sc/source/filter/xml/xmlimprt.cxx	2007-07-04 11:50:18.000000000 +0100
-@@ -274,6 +274,11 @@ uno::Reference< uno::XInterface > SAL_CA
- }
- 
- //----------------------------------------------------------------------------
-+// #i66550 HLINK_FOR_SHAPES
-+static  __FAR_DATA SvXMLTokenMapEntry aShapeHyperlinkTokenMap[] =
-+{
-+	{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_SHAPE_ATTR_HREF },
-+};
- 
- static __FAR_DATA SvXMLTokenMapEntry aDocTokenMap[] =
- {
-@@ -485,6 +490,7 @@ static __FAR_DATA SvXMLTokenMapEntry aTa
- 	{ XML_NAMESPACE_OFFICE,	XML_ANNOTATION, 		XML_TOK_TABLE_ROW_CELL_ANNOTATION			},
- 	{ XML_NAMESPACE_TABLE,	XML_DETECTIVE,			XML_TOK_TABLE_ROW_CELL_DETECTIVE			},
- 	{ XML_NAMESPACE_TABLE,	XML_CELL_RANGE_SOURCE,	XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE	},
-+	{ XML_NAMESPACE_DRAW, XML_A, XML_TOK_TABLE_ROW_CELL_DRAW_A },
- 	XML_TOKEN_MAP_END
- };
- 
-@@ -973,6 +979,14 @@ SvXMLImportContext *ScXMLDocContext_Impl
- 
- 	return pContext;
- }
-+// #i66550 HLINK_FOR_SHAPES
-+const SvXMLTokenMap& ScXMLImport::GetShapeHyperlinkTokenMap()
-+{
-+	if( !pShapeHyperlinkTokenMap )
-+		pShapeHyperlinkTokenMap = new SvXMLTokenMap( aShapeHyperlinkTokenMap );
-+
-+	return *pShapeHyperlinkTokenMap;
-+}
- 
- const SvXMLTokenMap& ScXMLImport::GetDocElemTokenMap()
- {
-@@ -1485,6 +1485,7 @@ ScXMLImport::ScXMLImport(
- //	pScAutoStylePool(new SvXMLAutoStylePoolP),
- //	pParaItemMapper( 0 ),
- //	pI18NMap( new SvI18NMap ),
-+	pShapeHyperlinkTokenMap( 0 ),
- 	pDocElemTokenMap( 0 ),
- 	pStylesElemTokenMap( 0 ),
- 	pStylesAttrTokenMap( 0 ),
-@@ -1592,6 +1593,7 @@ ScXMLImport::~ScXMLImport() throw()
- //	RemoveUnusedNumRules();
- 
- //	delete pI18NMap;
-+	delete pShapeHyperlinkTokenMap;
- 	delete pDocElemTokenMap;
- 	delete pStylesElemTokenMap;
- 	delete pStylesAttrTokenMap;
-diff -rup ../src680_m217-dr55-applied/sc/source/filter/xml/xmlimprt.hxx sc/source/filter/xml/xmlimprt.hxx
---- ../src680_m217-dr55-applied/sc/source/filter/xml/xmlimprt.hxx	2006-04-20 14:26:00.000000000 +0100
-+++ sc/source/filter/xml/xmlimprt.hxx	2007-07-04 11:57:00.000000000 +0100
-@@ -94,6 +94,11 @@ class XMLNumberFormatAttributesExportHel
- 
- using namespace rtl;
- 
-+enum ScXMLShapeHlinkTokens // #i66550 HLINK_FOR_SHAPES
-+{
-+	XML_TOK_SHAPE_ATTR_HREF
-+};
-+
- enum ScXMLDocTokens
- {
- 	XML_TOK_DOC_FONTDECLS,
-@@ -281,7 +286,8 @@ enum ScXMLTableRowCellTokens
- 	XML_TOK_TABLE_ROW_CELL_TABLE,
- 	XML_TOK_TABLE_ROW_CELL_ANNOTATION,
- 	XML_TOK_TABLE_ROW_CELL_DETECTIVE,
--	XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE
-+	XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE,
-+	XML_TOK_TABLE_ROW_CELL_DRAW_A,
- };
- 
- enum ScXMLTableRowCellAttrTokens
-@@ -694,6 +700,7 @@ class ScXMLImport: public SvXMLImport
- 
- //	SvXMLImportItemMapper	*pParaItemMapper;// paragraph item import
- //	SvI18NMap				*pI18NMap;			// name mapping for I18N
-+	SvXMLTokenMap			*pShapeHyperlinkTokenMap;
- 	SvXMLTokenMap			*pDocElemTokenMap;
- 	SvXMLTokenMap			*pStylesElemTokenMap;
- 	SvXMLTokenMap			*pStylesAttrTokenMap;
-@@ -854,6 +861,7 @@ public:
- //	SvXMLImportContextRef			GetAutoStyles() const { return xAutoStyles; }
- //	SvXMLImportContextRef			GetStyles() const { return xStyles; }
- 
-+	const SvXMLTokenMap& GetShapeHyperlinkTokenMap();
- 	const SvXMLTokenMap& GetDocElemTokenMap();
- 	const SvXMLTokenMap& GetStylesElemTokenMap();
- 	const SvXMLTokenMap& GetStylesAttrTokenMap();
-diff -rup ../src680_m217-dr55-applied/sc/source/filter/xml/XMLTableShapeImportHelper.cxx sc/source/filter/xml/XMLTableShapeImportHelper.cxx
---- ../src680_m217-dr55-applied/sc/source/filter/xml/XMLTableShapeImportHelper.cxx	2007-05-22 21:03:11.000000000 +0100
-+++ sc/source/filter/xml/XMLTableShapeImportHelper.cxx	2007-07-04 10:07:38.000000000 +0100
-@@ -36,6 +36,7 @@
- #include "drwlayer.hxx"
- #include "xmlannoi.hxx"
- #include "rangeutl.hxx"
-+#include "unonames.hxx"
- #include <xmloff/nmspmap.hxx>
- #include <xmloff/xmlnmspe.hxx>
- #include <xmloff/xmluconv.hxx>
-@@ -119,6 +119,13 @@ void XMLTableShapeImportHelper::finishSh
- {
- 	XMLShapeImportHelper::finishShape( rShape, xAttrList, rShapes );
- 	static_cast<ScXMLImport&>(mrImporter).LockSolarMutex();
-+	// #i66550 HLINK_FOR_SHAPES
-+	if ( rShape.is() && sHlink.getLength() )
-+	{
-+		uno::Reference< beans::XPropertySet > xProp( rShape, uno::UNO_QUERY );
-+		if ( xProp.is() )
-+			xProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ), uno::Any( sHlink ) );
-+	}
- 	if (rShapes == static_cast<ScXMLImport&>(mrImporter).GetTables().GetCurrentXShapes())
- 	{
-         if (!pAnnotationContext)
-diff -rup ../src680_m217-dr55-applied/sc/source/filter/xml/XMLTableShapeImportHelper.hxx sc/source/filter/xml/XMLTableShapeImportHelper.hxx
---- ../src680_m217-dr55-applied/sc/source/filter/xml/XMLTableShapeImportHelper.hxx	2005-09-08 20:59:29.000000000 +0100
-+++ sc/source/filter/xml/XMLTableShapeImportHelper.hxx	2007-07-04 11:51:42.000000000 +0100
-@@ -51,6 +51,7 @@ class XMLTableShapeImportHelper : public
- 	::com::sun::star::table::CellAddress aStartCell;
-     ScXMLAnnotationContext* pAnnotationContext;
- 	sal_Bool bOnTable;
-+	::rtl::OUString sHlink; // #i66550 HLINK_FOR_SHAPES
- 
- public:
- 
-@@ -61,8 +62,8 @@ public:
-     virtual void finishShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
- 			const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
- 			com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
--
--
-+	// #i66550 HLINK_FOR_SHAPES
-+	void SetHlink( const rtl::OUString& rHlink ) { sHlink = rHlink; }
- 	void SetCell (const ::com::sun::star::table::CellAddress& rAddress) { aStartCell = rAddress; }
- 	void SetOnTable (const sal_Bool bTempOnTable) { bOnTable = bTempOnTable; }
-     void SetAnnotation(ScXMLAnnotationContext* pAnnotation) { pAnnotationContext = pAnnotation; }
 diff -rup ../src680_m217-dr55-applied/sc/source/ui/drawfunc/drawsh2.cxx sc/source/ui/drawfunc/drawsh2.cxx
 --- ../src680_m217-dr55-applied/sc/source/ui/drawfunc/drawsh2.cxx	2007-07-03 11:16:23.000000000 +0100
 +++ sc/source/ui/drawfunc/drawsh2.cxx	2007-07-04 09:42:48.000000000 +0100
@@ -1103,3 +838,35 @@
  };
  
  //=============================================================================
+--- xmloff/source/draw/ximpshap.cxx	2008-06-26 20:29:00.000000000 +0100
++++ xmloff/source/draw/ximpshap.cxx	2008-06-26 21:02:45.000000000 +0100
+@@ -378,6 +378,11 @@ void SdXMLShapeContext::EndElement()
+ 
+ 	if( msHyperlink.getLength() != 0 ) try
+ 	{
++		uno::Reference< beans::XPropertySet > xProp( mxShape, uno::UNO_QUERY );
++
++		rtl::OUString sLink( RTL_CONSTASCII_USTRINGPARAM( "Hyperlink" ) );
++		if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( sLink ) )
++			xProp->setPropertyValue( sLink, uno::Any( msHyperlink ) );
+         Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW );
+         Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
+ 
+@@ -3201,9 +3206,16 @@ SvXMLImportContext *SdXMLFrameShapeConte
+ 
+ 	if( !mxImplContext.Is() )
+ 	{
+-		pContext = GetImport().GetShapeImport()->CreateFrameChildContext(
++
++		SvXMLShapeContext* pShapeContext= GetImport().GetShapeImport()->CreateFrameChildContext(
+ 						GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList );
+ 
++		pContext = pShapeContext;
++
++		// propagate the hyperlink to child context
++		if ( msHyperlink.getLength() > 0 )
++			pShapeContext->setHyperlink( msHyperlink );
++ 
+ 		mxImplContext = pContext;
+ 		mbSupportsReplacement = IsXMLToken( rLocalName, XML_OBJECT ) ||
+ 								IsXMLToken( rLocalName, XML_OBJECT_OLE );



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