View | Details | Raw Unified | Return to issue 66550
Collapse All | Expand All

(-)../src680_m217-dr55-applied/xmloff/inc/xmloff/shapeexport.hxx (-5 lines)
Lines 231-241 private: Link Here
231
	const rtl::OUString							msStartShape;
231
	const rtl::OUString							msStartShape;
232
	const rtl::OUString							msEndShape;
232
	const rtl::OUString							msEndShape;
233
	const rtl::OUString							msOnClick;
233
	const rtl::OUString							msOnClick;
234
#ifdef ISSUE66550_HLINK_FOR_SHAPES
235
	const rtl::OUString							msOnAction;
236
	const rtl::OUString							msAction;
237
	const rtl::OUString							msURL;
238
#endif
239
	const rtl::OUString							msEventType;
234
	const rtl::OUString							msEventType;
240
	const rtl::OUString							msPresentation;
235
	const rtl::OUString							msPresentation;
241
	const rtl::OUString							msMacroName;
236
	const rtl::OUString							msMacroName;
(-)../src680_m217-dr55-applied/xmloff/source/draw/eventimp.cxx (-46 lines)
Lines 147-155 public: Link Here
147
147
148
	sal_Bool mbValid;
148
	sal_Bool mbValid;
149
	sal_Bool mbScript;
149
	sal_Bool mbScript;
150
#ifdef ISSUE66550_HLINK_FOR_SHAPES
151
    sal_Bool mbActionEvent;
152
#endif
153
	ClickAction meClickAction;
150
	ClickAction meClickAction;
154
	XMLEffect meEffect;
151
	XMLEffect meEffect;
155
	XMLEffectDirection meDirection;
152
	XMLEffectDirection meDirection;
Lines 161-169 public: Link Here
161
	OUString msMacroName;
158
	OUString msMacroName;
162
	OUString msBookmark;
159
	OUString msBookmark;
163
	OUString msLanguage;
160
	OUString msLanguage;
164
#ifdef ISSUE66550_HLINK_FOR_SHAPES
165
    OUString msHyperURL;
166
#endif
167
};
161
};
168
162
169
///////////////////////////////////////////////////////////////////////
163
///////////////////////////////////////////////////////////////////////
Lines 222-239 TYPEINIT1( SdXMLEventContext, SvXMLImpor Link Here
222
216
223
SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp,  sal_uInt16 nPrfx, const OUString& rLocalName,  const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape )
217
SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp,  sal_uInt16 nPrfx, const OUString& rLocalName,  const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape )
224
:	SvXMLImportContext(rImp, nPrfx, rLocalName),
218
:	SvXMLImportContext(rImp, nPrfx, rLocalName),
225
#ifdef ISSUE66550_HLINK_FOR_SHAPES
226
    mxShape( rxShape ), mbScript( sal_False ), mbActionEvent( sal_False ), meClickAction( ClickAction_NONE ),
227
#else
228
    mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
219
    mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
229
#endif
230
	meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
220
	meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
231
	meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
221
	meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
232
{
222
{
233
    static const OUString sXMLClickName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
223
    static const OUString sXMLClickName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
234
#ifdef ISSUE66550_HLINK_FOR_SHAPES
235
    static const OUString sXMLActionName( RTL_CONSTASCII_USTRINGPARAM( "action" ) );
236
#endif
237
224
238
    if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
225
    if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
239
	{
226
	{
Lines 304-315 SdXMLEventContext::SdXMLEventContext( Sv Link Here
304
				sEventName = sValue;
291
				sEventName = sValue;
305
				sal_uInt16 nScriptPrefix =
292
				sal_uInt16 nScriptPrefix =
306
					GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
293
					GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
307
#ifdef ISSUE66550_HLINK_FOR_SHAPES
308
                mbValid = XML_NAMESPACE_DOM == nScriptPrefix && ( sEventName == sXMLClickName || sEventName == sXMLActionName );
309
                mbActionEvent = mbValid && (sEventName == sXMLActionName);
310
#else
311
                mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == sXMLClickName;
294
                mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == sXMLClickName;
312
#endif
313
			}
295
			}
314
			else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
296
			else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
315
			{
297
			{
Lines 338-349 SdXMLEventContext::SdXMLEventContext( Sv Link Here
338
				{
320
				{
339
					msMacroName = sValue;
321
					msMacroName = sValue;
340
				}
322
				}
341
#ifdef ISSUE66550_HLINK_FOR_SHAPES
342
                else if ( mbActionEvent )
343
                {
344
                    msHyperURL = sValue;
345
                }
346
#endif
347
				else
323
				else
348
				{
324
				{
349
					const rtl::OUString &rTmp =
325
					const rtl::OUString &rTmp =
Lines 389-414 void SdXMLEventContext::EndElement() Link Here
389
        OUString sAPIEventName;
365
        OUString sAPIEventName;
390
        uno::Sequence< beans::PropertyValue > aProperties;
366
        uno::Sequence< beans::PropertyValue > aProperties;
391
367
392
#ifdef ISSUE66550_HLINK_FOR_SHAPES
393
        if( mbActionEvent )
394
        {
395
            sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) );
396
            aProperties.realloc( 2 );
397
            beans::PropertyValue* pProperty = aProperties.getArray();
398
399
            pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
400
            pProperty->Handle = -1;
401
            pProperty->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) );
402
            pProperty->State = beans::PropertyState_DIRECT_VALUE;
403
            ++pProperty;
404
            pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
405
            pProperty->Handle = -1;
406
            pProperty->Value <<= msHyperURL;
407
            pProperty->State = beans::PropertyState_DIRECT_VALUE;
408
        }
409
        else
410
#endif
411
        {
412
            sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
368
            sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
413
369
414
            if( mbScript )
370
            if( mbScript )
Lines 593-600 void SdXMLEventContext::EndElement() Link Here
593
                    break;
549
                    break;
594
                }
550
                }
595
            }
551
            }
596
        }
597
598
        xEvents->replaceByName( sAPIEventName, uno::Any( aProperties ) );
552
        xEvents->replaceByName( sAPIEventName, uno::Any( aProperties ) );
599
553
600
    } while(0);
554
    } while(0);
(-)../src680_m217-dr55-applied/xmloff/source/draw/shapeexport2.cxx (-48 lines)
Lines 371-379 const sal_Int32 FOUND_CLICKEVENTTYPE Link Here
371
const sal_Int32 FOUND_MACRO             = 0x00000100;
371
const sal_Int32 FOUND_MACRO             = 0x00000100;
372
const sal_Int32 FOUND_LIBRARY           = 0x00000200;
372
const sal_Int32 FOUND_LIBRARY           = 0x00000200;
373
const sal_Int32 FOUND_ACTIONEVENTTYPE   = 0x00000400;
373
const sal_Int32 FOUND_ACTIONEVENTTYPE   = 0x00000400;
374
#ifdef ISSUE66550_HLINK_FOR_SHAPES
375
const sal_Int32 FOUND_URL               = 0x00000800;
376
#endif
377
374
378
} // namespace
375
} // namespace
379
376
Lines 463-495 void XMLShapeExport::ImpExportEvents( co Link Here
463
        }
460
        }
464
    }
461
    }
465
462
466
#ifdef ISSUE66550_HLINK_FOR_SHAPES
467
    // extract properties from "OnAction" event -------------------------------
468
469
    OUString aActionEventType;
470
    OUString aHyperURL;
471
472
    uno::Sequence< beans::PropertyValue > aActionProperties;
473
    if( xEvents->hasByName( msOnAction ) && (xEvents->getByName( msOnAction ) >>= aActionProperties) )
474
    {
475
        const beans::PropertyValue* pProperty = aActionProperties.getConstArray();
476
        const beans::PropertyValue* pPropertyEnd = pProperty + aActionProperties.getLength();
477
        for( ; pProperty != pPropertyEnd; ++pProperty )
478
        {
479
            if( ( ( nFound & FOUND_ACTIONEVENTTYPE ) == 0 ) && pProperty->Name == msEventType )
480
            {
481
                if( pProperty->Value >>= aActionEventType )
482
                    nFound |= FOUND_ACTIONEVENTTYPE;
483
            }
484
            else if( ( ( nFound & FOUND_URL ) == 0 ) && ( pProperty->Name == msURL  ) )
485
            {
486
                if( pProperty->Value >>= aHyperURL )
487
                    nFound |= FOUND_URL;
488
            }
489
        }
490
    }
491
#endif
492
493
    // create the XML elements
463
    // create the XML elements
494
464
495
    if( aClickEventType == msPresentation )
465
    if( aClickEventType == msPresentation )
Lines 641-655 void XMLShapeExport::ImpExportEvents( co Link Here
641
            SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
611
            SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
642
        }
612
        }
643
    }
613
    }
644
#ifdef ISSUE66550_HLINK_FOR_SHAPES
645
    else if( aClickEventType == msScript || aActionEventType == msAction )
646
    {
647
        if( nFound & ( FOUND_MACRO | FOUND_URL ) )
648
#else
649
    else if( aClickEventType == msScript )
614
    else if( aClickEventType == msScript )
650
    {
615
    {
651
        if( nFound & FOUND_MACRO )
616
        if( nFound & FOUND_MACRO )
652
#endif
653
        {
617
        {
654
            SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
618
            SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
655
            if ( nFound & FOUND_MACRO )
619
            if ( nFound & FOUND_MACRO )
Lines 664-681 void XMLShapeExport::ImpExportEvents( co Link Here
664
628
665
                SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
629
                SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
666
            }
630
            }
667
#ifdef ISSUE66550_HLINK_FOR_SHAPES
668
            if ( nFound & FOUND_URL )
669
            {
670
                OUString aEventQName(
671
                    mrExport.GetNamespaceMap().GetQNameByKey(
672
                            XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "action" ) ) ) );
673
                mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
674
                mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aHyperURL );
675
676
                SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True);
677
            }
678
#endif
679
        }
631
        }
680
    }
632
    }
681
}
633
}
(-)../src680_m217-dr55-applied/xmloff/source/draw/shapeexport.cxx (-5 lines)
Lines 161-171 XMLShapeExport::XMLShapeExport(SvXMLExpo Link Here
161
	msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
161
	msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
162
	msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
162
	msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
163
	msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
163
	msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
164
#ifdef ISSUE66550_HLINK_FOR_SHAPES
165
	msOnAction( RTL_CONSTASCII_USTRINGPARAM("OnAction") ),
166
	msAction( RTL_CONSTASCII_USTRINGPARAM("Action") ),
167
	msURL( RTL_CONSTASCII_USTRINGPARAM("URL") ),
168
#endif
169
	msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
164
	msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
170
	msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
165
	msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
171
	msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
166
	msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
(-)../src680_m217-dr55-applied/sc/inc/sc.hrc (-2 lines)
Lines 583-593 Link Here
583
// #i59082# assign macro to shape
583
// #i59082# assign macro to shape
584
#define SID_ASSIGNMACRO                 (SC_VIEW_START + 95)
584
#define SID_ASSIGNMACRO                 (SC_VIEW_START + 95)
585
585
586
#ifdef ISSUE66550_HLINK_FOR_SHAPES
587
// #i66550# hyperlinks in shapes
586
// #i66550# hyperlinks in shapes
588
#define SID_DRAW_HLINK_EDIT             (SC_VIEW_START + 96)
587
#define SID_DRAW_HLINK_EDIT             (SC_VIEW_START + 96)
589
#define SID_DRAW_HLINK_DELETE           (SC_VIEW_START + 97)
588
#define SID_DRAW_HLINK_DELETE           (SC_VIEW_START + 97)
590
#endif
591
589
592
// NOTE: last valid ID is (SC_VIEW_START + 99)
590
// NOTE: last valid ID is (SC_VIEW_START + 99)
593
591
(-)../src680_m217-dr55-applied/sc/inc/shapeuno.hxx (+2 lines)
Lines 74-79 namespace com { namespace sun { namespac Link Here
74
class SdrObject;
74
class SdrObject;
75
struct SvEventDescription;
75
struct SvEventDescription;
76
class ShapeUnoEventAccessImpl;
76
class ShapeUnoEventAccessImpl;
77
class  ScMacroInfo;
77
78
78
//------------------------------------------------------------------------
79
//------------------------------------------------------------------------
79
80
Lines 89-94 class ScShapeObj : public ::cppu::OWeakO Link Here
89
					public ::com::sun::star::document::XEventsSupplier
90
					public ::com::sun::star::document::XEventsSupplier
90
{
91
{
91
private:
92
private:
93
friend  ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate );
92
	::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg;
94
	::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg;
93
    // cached pointers to avoid repeated queryAggregation calls:
95
    // cached pointers to avoid repeated queryAggregation calls:
94
    ::com::sun::star::beans::XPropertySet*                                  pShapePropertySet;
96
    ::com::sun::star::beans::XPropertySet*                                  pShapePropertySet;
(-)../src680_m217-dr55-applied/sc/inc/unonames.hxx (+2 lines)
Lines 183-188 Link Here
183
#define SC_UNONAME_ANCHOR           "Anchor"
183
#define SC_UNONAME_ANCHOR           "Anchor"
184
#define SC_UNONAME_HORIPOS          "HoriOrientPosition"
184
#define SC_UNONAME_HORIPOS          "HoriOrientPosition"
185
#define SC_UNONAME_VERTPOS          "VertOrientPosition"
185
#define SC_UNONAME_VERTPOS          "VertOrientPosition"
186
//     #i66550 HLINK_FOR_SHAPES
187
#define SC_UNONAME_HYPERLINK        "Hyperlink" 
186
188
187
//	other cell properties
189
//	other cell properties
188
#define SC_UNONAME_CHCOLHDR			"ChartColumnAsLabel"
190
#define SC_UNONAME_CHCOLHDR			"ChartColumnAsLabel"
(-)../src680_m217-dr55-applied/sc/inc/userdat.hxx (-4 lines)
Lines 117-132 public: Link Here
117
    void            SetMacro( const rtl::OUString& rMacro ) { maMacro = rMacro; }
117
    void            SetMacro( const rtl::OUString& rMacro ) { maMacro = rMacro; }
118
    const rtl::OUString& GetMacro() const { return maMacro; }
118
    const rtl::OUString& GetMacro() const { return maMacro; }
119
119
120
#ifdef ISSUE66550_HLINK_FOR_SHAPES
121
    void            SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; }
120
    void            SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; }
122
    const rtl::OUString& GetHlink() const { return maHlink; }
121
    const rtl::OUString& GetHlink() const { return maHlink; }
123
#endif
124
122
125
private:
123
private:
126
    rtl::OUString   maMacro;
124
    rtl::OUString   maMacro;
127
#ifdef ISSUE66550_HLINK_FOR_SHAPES
128
    rtl::OUString   maHlink;
125
    rtl::OUString   maHlink;
129
#endif
130
};
126
};
131
127
132
//-------------------------------------------------------------------------
128
//-------------------------------------------------------------------------
(-)../src680_m217-dr55-applied/sc/source/filter/excel/xiescher.cxx (-6 lines)
Lines 1647-1665 SdrObject* XclImpDffManager::ProcessObj( Link Here
1647
    {
1647
    {
1648
        // macro name and hyperlink for drawing objects and pictures (not for controls and charts)
1648
        // macro name and hyperlink for drawing objects and pictures (not for controls and charts)
1649
        const String& rMacro = xDrawObj->GetMacroName();
1649
        const String& rMacro = xDrawObj->GetMacroName();
1650
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1651
        OUString aHlink = ReadHlinkProperty( rEscherStrm );
1650
        OUString aHlink = ReadHlinkProperty( rEscherStrm );
1652
        if( (rMacro.Len() > 0) || (aHlink.getLength() > 0) )
1651
        if( (rMacro.Len() > 0) || (aHlink.getLength() > 0) )
1653
#else
1654
        if( rMacro.Len() > 0 )
1655
#endif
1656
        {
1652
        {
1657
            if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE ) )
1653
            if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE ) )
1658
            {
1654
            {
1659
                pInfo->SetMacro( XclControlObjHelper::GetScMacroName( rMacro ) );
1655
                pInfo->SetMacro( XclControlObjHelper::GetScMacroName( rMacro ) );
1660
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1661
                pInfo->SetHlink( aHlink );
1656
                pInfo->SetHlink( aHlink );
1662
#endif
1663
            }
1657
            }
1664
        }
1658
        }
1665
    }
1659
    }
(-)../src680_m217-dr55-applied/sc/source/filter/xml/xmlcelli.cxx (-11 / +89 lines)
Lines 164-169 ScMyImportAnnotation::~ScMyImportAnnotat Link Here
164
    delete pOPO;
164
    delete pOPO;
165
}
165
}
166
166
167
//-------------------- #i66550 HLINK_FOR_SHAPES --------------------
168
169
SvXMLImportContext*
170
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 )
171
{
172
	SvXMLImportContext* pContext = NULL;
173
	table::CellAddress aCellPos = rImport.GetTables().GetRealCellPos();
174
	if (xShapes.is())
175
	{
176
		if (aCellPos.Column > MAXCOL)
177
			aCellPos.Column = MAXCOL;
178
		if (aCellPos.Row > MAXROW)
179
			aCellPos.Row = MAXROW;
180
		XMLTableShapeImportHelper* pTableShapeImport = (XMLTableShapeImportHelper*)rImport.GetShapeImport().get();
181
		pTableShapeImport->SetHlink( rHLink );
182
		pTableShapeImport->SetOnTable(sal_False);
183
		pTableShapeImport->SetCell(aCellPos);
184
		pContext = rImport.GetShapeImport()->CreateGroupChildContext(
185
			rImport, nPrfx, rLName, xAttrList, xShapes, sal_False);
186
	}
187
	return pContext;
188
}
189
190
class XMLShapeHyperLinkContext : public SvXMLImportContext
191
{
192
	::rtl::OUString sHLink;
193
	ScXMLImport& rXMLImport;
194
public:
195
	XMLShapeHyperLinkContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, const uno::Reference< xml::sax::XAttributeList>& xAttrList );
196
197
	virtual ~XMLShapeHyperLinkContext(){}
198
	virtual void EndElement(){}
199
200
	SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
201
		const ::rtl::OUString& rLocalName,
202
		const uno::Reference<xml::sax::XAttributeList >& xAttrList );
203
};
204
205
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 )
206
{
207
	// re-use the TableRowCell map ( I don't suppose it's worth implementing a new one )
208
	const SvXMLTokenMap& rTokenMap = rXMLImport.GetShapeHyperlinkTokenMap();
209
	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
210
	for( sal_Int16 i=0; i < nAttrCount; i++ )
211
	{
212
		const OUString& rAttrName = xAttrList->getNameByIndex( i );
213
		const OUString& rValue = xAttrList->getValueByIndex( i );
214
215
		OUString aLocalName;
216
		sal_uInt16 nPrefix = rXMLImport.GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
217
		if ( rTokenMap.Get( nPrefix, aLocalName ) == XML_TOK_SHAPE_ATTR_HREF )
218
		{
219
			sHLink = rXMLImport.GetAbsoluteReference( rValue );
220
			break;
221
		}
222
	}
223
}
224
225
226
SvXMLImportContext*
227
XMLShapeHyperLinkContext::CreateChildContext( sal_uInt16 nPrefix,
228
		const ::rtl::OUString& rLocalName,
229
		const ::com::sun::star::uno::Reference<
230
		::com::sun::star::xml::sax::XAttributeList > & xAttrList )
231
{
232
	SvXMLImportContext* pContext = NULL;
233
	uno::Reference<drawing::XShapes> xShapes ( rXMLImport.GetTables().GetCurrentXShapes());
234
	if ( xShapes.is() )
235
	{
236
		pContext = lcl_processShapeElement( rXMLImport, nPrefix, rLocalName, xAttrList, xShapes, sHLink );
237
		if (pContext)
238
			rXMLImport.ProgressBarIncrement(sal_False);
239
	}
240
	if ( !pContext )
241
		pContext = new SvXMLImportContext( rXMLImport, nPrefix, rLocalName );
242
	return pContext;
243
}
244
167
//------------------------------------------------------------------
245
//------------------------------------------------------------------
168
246
169
ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
247
ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
Lines 589-611 SvXMLImportContext *ScXMLTableRowCellCon Link Here
589
				rXMLImport, nPrefix, rLName, xAttrList, pCellRangeSource );
667
				rXMLImport, nPrefix, rLName, xAttrList, pCellRangeSource );
590
		}
668
		}
591
		break;
669
		break;
670
	// #i66550 HLINK_FOR_SHAPES
671
	case XML_TOK_TABLE_ROW_CELL_DRAW_A:
672
		{
673
			pContext = new XMLShapeHyperLinkContext(
674
				rXMLImport, nPrefix, rLName, xAttrList );
675
		}
676
		break;
592
	}
677
	}
593
594
	if (!pContext && !bTextP)
678
	if (!pContext && !bTextP)
595
	{
679
	{
596
		com::sun::star::table::CellAddress aCellPos = rXMLImport.GetTables().GetRealCellPos();
680
		// #i66550 HLINK_FOR_SHAPES
597
		uno::Reference<drawing::XShapes> xShapes (rXMLImport.GetTables().GetCurrentXShapes());
681
		uno::Reference<drawing::XShapes> xShapes (rXMLImport.GetTables().GetCurrentXShapes());
598
		if (xShapes.is())
682
		if (xShapes.is())
599
		{
683
		{
600
			if (aCellPos.Column > MAXCOL)
684
			rtl::OUString sBlank;
601
				aCellPos.Column = MAXCOL;
685
			pContext = lcl_processShapeElement( rXMLImport, nPrefix, rLName, xAttrList, xShapes, sBlank );
602
			if (aCellPos.Row > MAXROW)
686
603
				aCellPos.Row = MAXROW;
604
			XMLTableShapeImportHelper* pTableShapeImport = (XMLTableShapeImportHelper*)rXMLImport.GetShapeImport().get();
605
			pTableShapeImport->SetOnTable(sal_False);
606
			pTableShapeImport->SetCell(aCellPos);
607
			pContext = rXMLImport.GetShapeImport()->CreateGroupChildContext(
608
				rXMLImport, nPrefix, rLName, xAttrList, xShapes);
609
			if (pContext)
687
			if (pContext)
610
			{
688
			{
611
				bIsEmpty = sal_False;
689
				bIsEmpty = sal_False;
(-)../src680_m217-dr55-applied/sc/source/filter/xml/xmlexprt.cxx (+27 lines)
Lines 2665-2671 void ScXMLExport::ExportShape(const uno: Link Here
2665
		}
2665
		}
2666
	}
2666
	}
2667
	if (!bIsChart)
2667
	if (!bIsChart)
2668
	{
2669
		// #i66550 HLINK_FOR_SHAPES
2670
		rtl::OUString sHlink;
2671
		uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
2672
		if ( xProps.is() )
2673
			xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink;
2674
2675
		std::auto_ptr< SvXMLElementExport > pDrawA;
2676
		// enlose shapes with <draw:a> element only if sHlink contains something
2677
		if ( sHlink.getLength() > 0 )
2678
		{
2679
			// need to get delete the attributes that are pre-loaded
2680
			// for the shape export ( otherwise they will become 	
2681
			// attributes of the draw:a element ) This *shouldn't* 
2682
			// affect performance adversely as there are only a 
2683
			// couple of attributes involved
2684
			uno::Reference< xml::sax::XAttributeList > xSaveAttribs( new  SvXMLAttributeList( GetAttrList() ) );
2685
			ClearAttrList();
2686
			// Add Hlink	
2687
			AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
2688
			AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sHlink);
2689
			pDrawA.reset( new SvXMLElementExport( *this, XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ) );
2690
			// Attribute list has been cleared by previous operation
2691
			// re-add pre-loaded attributes
2692
			AddAttributeList( xSaveAttribs );
2693
		}
2668
		GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint);
2694
		GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint);
2695
	}
2669
	IncrementProgressBar(sal_False);
2696
	IncrementProgressBar(sal_False);
2670
}
2697
}
2671
2698
(-)../src680_m217-dr55-applied/sc/source/filter/xml/xmlimprt.cxx (+14 lines)
Lines 274-279 uno::Reference< uno::XInterface > SAL_CA Link Here
274
}
274
}
275
275
276
//----------------------------------------------------------------------------
276
//----------------------------------------------------------------------------
277
// #i66550 HLINK_FOR_SHAPES
278
static  __FAR_DATA SvXMLTokenMapEntry aShapeHyperlinkTokenMap[] =
279
{
280
	{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_SHAPE_ATTR_HREF },
281
};
277
282
278
static __FAR_DATA SvXMLTokenMapEntry aDocTokenMap[] =
283
static __FAR_DATA SvXMLTokenMapEntry aDocTokenMap[] =
279
{
284
{
Lines 485-490 static __FAR_DATA SvXMLTokenMapEntry aTa Link Here
485
	{ XML_NAMESPACE_OFFICE,	XML_ANNOTATION, 		XML_TOK_TABLE_ROW_CELL_ANNOTATION			},
490
	{ XML_NAMESPACE_OFFICE,	XML_ANNOTATION, 		XML_TOK_TABLE_ROW_CELL_ANNOTATION			},
486
	{ XML_NAMESPACE_TABLE,	XML_DETECTIVE,			XML_TOK_TABLE_ROW_CELL_DETECTIVE			},
491
	{ XML_NAMESPACE_TABLE,	XML_DETECTIVE,			XML_TOK_TABLE_ROW_CELL_DETECTIVE			},
487
	{ XML_NAMESPACE_TABLE,	XML_CELL_RANGE_SOURCE,	XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE	},
492
	{ XML_NAMESPACE_TABLE,	XML_CELL_RANGE_SOURCE,	XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE	},
493
	{ XML_NAMESPACE_DRAW, XML_A, XML_TOK_TABLE_ROW_CELL_DRAW_A },
488
	XML_TOKEN_MAP_END
494
	XML_TOKEN_MAP_END
489
};
495
};
490
496
Lines 973-978 SvXMLImportContext *ScXMLDocContext_Impl Link Here
973
979
974
	return pContext;
980
	return pContext;
975
}
981
}
982
// #i66550 HLINK_FOR_SHAPES
983
const SvXMLTokenMap& ScXMLImport::GetShapeHyperlinkTokenMap()
984
{
985
	if( !pShapeHyperlinkTokenMap )
986
		pShapeHyperlinkTokenMap = new SvXMLTokenMap( aShapeHyperlinkTokenMap );
987
988
	return *pShapeHyperlinkTokenMap;
989
}
976
990
977
const SvXMLTokenMap& ScXMLImport::GetDocElemTokenMap()
991
const SvXMLTokenMap& ScXMLImport::GetDocElemTokenMap()
978
{
992
{
(-)../src680_m217-dr55-applied/sc/source/filter/xml/xmlimprt.hxx (-1 / +9 lines)
Lines 94-99 class XMLNumberFormatAttributesExportHel Link Here
94
94
95
using namespace rtl;
95
using namespace rtl;
96
96
97
enum ScXMLShapeHlinkTokens // #i66550 HLINK_FOR_SHAPES
98
{
99
	XML_TOK_SHAPE_ATTR_HREF
100
};
101
97
enum ScXMLDocTokens
102
enum ScXMLDocTokens
98
{
103
{
99
	XML_TOK_DOC_FONTDECLS,
104
	XML_TOK_DOC_FONTDECLS,
Lines 281-287 enum ScXMLTableRowCellTokens Link Here
281
	XML_TOK_TABLE_ROW_CELL_TABLE,
286
	XML_TOK_TABLE_ROW_CELL_TABLE,
282
	XML_TOK_TABLE_ROW_CELL_ANNOTATION,
287
	XML_TOK_TABLE_ROW_CELL_ANNOTATION,
283
	XML_TOK_TABLE_ROW_CELL_DETECTIVE,
288
	XML_TOK_TABLE_ROW_CELL_DETECTIVE,
284
	XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE
289
	XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE,
290
	XML_TOK_TABLE_ROW_CELL_DRAW_A,
285
};
291
};
286
292
287
enum ScXMLTableRowCellAttrTokens
293
enum ScXMLTableRowCellAttrTokens
Lines 694-699 class ScXMLImport: public SvXMLImport Link Here
694
700
695
//	SvXMLImportItemMapper	*pParaItemMapper;// paragraph item import
701
//	SvXMLImportItemMapper	*pParaItemMapper;// paragraph item import
696
//	SvI18NMap				*pI18NMap;			// name mapping for I18N
702
//	SvI18NMap				*pI18NMap;			// name mapping for I18N
703
	SvXMLTokenMap			*pShapeHyperlinkTokenMap;
697
	SvXMLTokenMap			*pDocElemTokenMap;
704
	SvXMLTokenMap			*pDocElemTokenMap;
698
	SvXMLTokenMap			*pStylesElemTokenMap;
705
	SvXMLTokenMap			*pStylesElemTokenMap;
699
	SvXMLTokenMap			*pStylesAttrTokenMap;
706
	SvXMLTokenMap			*pStylesAttrTokenMap;
Lines 854-859 public: Link Here
854
//	SvXMLImportContextRef			GetAutoStyles() const { return xAutoStyles; }
861
//	SvXMLImportContextRef			GetAutoStyles() const { return xAutoStyles; }
855
//	SvXMLImportContextRef			GetStyles() const { return xStyles; }
862
//	SvXMLImportContextRef			GetStyles() const { return xStyles; }
856
863
864
	const SvXMLTokenMap& GetShapeHyperlinkTokenMap();
857
	const SvXMLTokenMap& GetDocElemTokenMap();
865
	const SvXMLTokenMap& GetDocElemTokenMap();
858
	const SvXMLTokenMap& GetStylesElemTokenMap();
866
	const SvXMLTokenMap& GetStylesElemTokenMap();
859
	const SvXMLTokenMap& GetStylesAttrTokenMap();
867
	const SvXMLTokenMap& GetStylesAttrTokenMap();
(-)../src680_m217-dr55-applied/sc/source/filter/xml/XMLTableShapeImportHelper.cxx (-1 / +8 lines)
Lines 82-88 Link Here
82
#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_
82
#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_
83
#include <com/sun/star/drawing/XShapes.hpp>
83
#include <com/sun/star/drawing/XShapes.hpp>
84
#endif
84
#endif
85
85
#include "unonames.hxx"
86
#define SC_LAYERID "LayerID"
86
#define SC_LAYERID "LayerID"
87
87
88
using namespace ::com::sun::star;
88
using namespace ::com::sun::star;
Lines 119-124 void XMLTableShapeImportHelper::finishSh Link Here
119
{
119
{
120
	XMLShapeImportHelper::finishShape( rShape, xAttrList, rShapes );
120
	XMLShapeImportHelper::finishShape( rShape, xAttrList, rShapes );
121
	static_cast<ScXMLImport&>(mrImporter).LockSolarMutex();
121
	static_cast<ScXMLImport&>(mrImporter).LockSolarMutex();
122
	// #i66550 HLINK_FOR_SHAPES
123
	if ( rShape.is() && sHlink.getLength() )
124
	{
125
		uno::Reference< beans::XPropertySet > xProp( rShape, uno::UNO_QUERY );
126
		if ( xProp.is() )
127
			xProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ), uno::Any( sHlink ) );
128
	}
122
	if (rShapes == static_cast<ScXMLImport&>(mrImporter).GetTables().GetCurrentXShapes())
129
	if (rShapes == static_cast<ScXMLImport&>(mrImporter).GetTables().GetCurrentXShapes())
123
	{
130
	{
124
        if (!pAnnotationContext)
131
        if (!pAnnotationContext)
(-)../src680_m217-dr55-applied/sc/source/filter/xml/XMLTableShapeImportHelper.hxx (-2 / +3 lines)
Lines 51-56 class XMLTableShapeImportHelper : public Link Here
51
	::com::sun::star::table::CellAddress aStartCell;
51
	::com::sun::star::table::CellAddress aStartCell;
52
    ScXMLAnnotationContext* pAnnotationContext;
52
    ScXMLAnnotationContext* pAnnotationContext;
53
	sal_Bool bOnTable;
53
	sal_Bool bOnTable;
54
	::rtl::OUString sHlink; // #i66550 HLINK_FOR_SHAPES
54
55
55
public:
56
public:
56
57
Lines 61-68 public: Link Here
61
    virtual void finishShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
62
    virtual void finishShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
62
			const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
63
			const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
63
			com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
64
			com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
64
65
	// #i66550 HLINK_FOR_SHAPES
65
66
	void SetHlink( const rtl::OUString& rHlink ) { sHlink = rHlink; }
66
	void SetCell (const ::com::sun::star::table::CellAddress& rAddress) { aStartCell = rAddress; }
67
	void SetCell (const ::com::sun::star::table::CellAddress& rAddress) { aStartCell = rAddress; }
67
	void SetOnTable (const sal_Bool bTempOnTable) { bOnTable = bTempOnTable; }
68
	void SetOnTable (const sal_Bool bTempOnTable) { bOnTable = bTempOnTable; }
68
    void SetAnnotation(ScXMLAnnotationContext* pAnnotation) { pAnnotationContext = pAnnotation; }
69
    void SetAnnotation(ScXMLAnnotationContext* pAnnotation) { pAnnotationContext = pAnnotation; }
(-)../src680_m217-dr55-applied/sc/source/ui/drawfunc/drawsh2.cxx (-4 lines)
Lines 209-232 void ScDrawShell::GetDrawFuncState( SfxI Link Here
209
	BOOL bCanRename = FALSE;
209
	BOOL bCanRename = FALSE;
210
    if ( nMarkCount > 1 )
210
    if ( nMarkCount > 1 )
211
    {
211
    {
212
#ifdef ISSUE66550_HLINK_FOR_SHAPES
213
        // no hypelink options for a selected group
212
        // no hypelink options for a selected group
214
        rSet.DisableItem( SID_DRAW_HLINK_EDIT );
213
        rSet.DisableItem( SID_DRAW_HLINK_EDIT );
215
        rSet.DisableItem( SID_DRAW_HLINK_DELETE );
214
        rSet.DisableItem( SID_DRAW_HLINK_DELETE );
216
        rSet.DisableItem( SID_OPEN_HYPERLINK );
215
        rSet.DisableItem( SID_OPEN_HYPERLINK );
217
#endif
218
    }
216
    }
219
    else if ( nMarkCount == 1 )
217
    else if ( nMarkCount == 1 )
220
	{
218
	{
221
        SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
219
        SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
222
#ifdef ISSUE66550_HLINK_FOR_SHAPES
223
        ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
220
        ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
224
        if ( !pInfo || (pInfo->GetHlink().getLength() == 0) )
221
        if ( !pInfo || (pInfo->GetHlink().getLength() == 0) )
225
        {
222
        {
226
            rSet.DisableItem( SID_DRAW_HLINK_DELETE );
223
            rSet.DisableItem( SID_DRAW_HLINK_DELETE );
227
            rSet.DisableItem( SID_OPEN_HYPERLINK );
224
            rSet.DisableItem( SID_OPEN_HYPERLINK );
228
        }
225
        }
229
#endif
230
        SdrLayerID nLayerID = pObj->GetLayer();
226
        SdrLayerID nLayerID = pObj->GetLayer();
231
        if ( nLayerID != SC_LAYER_INTERN )
227
        if ( nLayerID != SC_LAYER_INTERN )
232
            bCanRename = TRUE;                          // #i51351# anything except internal objects can be renamed
228
            bCanRename = TRUE;                          // #i51351# anything except internal objects can be renamed
(-)../src680_m217-dr55-applied/sc/source/ui/drawfunc/drawsh5.cxx (-4 lines)
Lines 103-116 void ScDrawShell::GetHLinkState( SfxItem Link Here
103
    if ( nMarkCount == 1 )              // URL-Button markiert ?
103
    if ( nMarkCount == 1 )              // URL-Button markiert ?
104
    {
104
    {
105
        SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
105
        SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
106
#ifdef ISSUE66550_HLINK_FOR_SHAPES
107
        ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
106
        ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
108
        if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
107
        if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
109
        {
108
        {
110
            aHLinkItem.SetURL( pInfo->GetHlink() );
109
            aHLinkItem.SetURL( pInfo->GetHlink() );
111
            aHLinkItem.SetInsertMode(HLINK_FIELD);
110
            aHLinkItem.SetInsertMode(HLINK_FIELD);
112
        }
111
        }
113
#endif
114
        SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
112
        SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
115
        if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
113
        if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
116
        {
114
        {
Lines 253-265 void ScDrawShell::ExecuteHLink( SfxReque Link Here
253
                                    bDone = TRUE;
251
                                    bDone = TRUE;
254
                                }
252
                                }
255
                            }
253
                            }
256
#ifdef ISSUE66550_HLINK_FOR_SHAPES
257
                            else
254
                            else
258
                            {
255
                            {
259
                                SetHlinkForObject( pObj, rURL );
256
                                SetHlinkForObject( pObj, rURL );
260
                                bDone = TRUE;
257
                                bDone = TRUE;
261
                            }
258
                            }
262
#endif
263
                        }
259
                        }
264
                    }
260
                    }
265
261
(-)../src680_m217-dr55-applied/sc/source/ui/drawfunc/drawsh.cxx (-4 lines)
Lines 218-224 void ScDrawShell::ExecDrawAttr( SfxReque Link Here
218
			ExecuteTextAttrDlg( rReq );
218
			ExecuteTextAttrDlg( rReq );
219
			break;
219
			break;
220
220
221
#ifdef ISSUE66550_HLINK_FOR_SHAPES
222
        case SID_DRAW_HLINK_EDIT:
221
        case SID_DRAW_HLINK_EDIT:
223
            if ( pSingleSelectedObj )
222
            if ( pSingleSelectedObj )
224
                pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
223
                pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
Lines 246-252 void ScDrawShell::ExecDrawAttr( SfxReque Link Here
246
                    ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() );
245
                    ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() );
247
            }
246
            }
248
            break;
247
            break;
249
#endif
250
248
251
		case SID_ATTR_TRANSFORM:
249
		case SID_ATTR_TRANSFORM:
252
			{
250
			{
Lines 498-504 void ScDrawShell::ExecuteTextAttrDlg( Sf Link Here
498
	delete( pDlg );
496
	delete( pDlg );
499
}
497
}
500
498
501
#ifdef ISSUE66550_HLINK_FOR_SHAPES
502
void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
499
void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
503
{
500
{
504
    if ( pObj )
501
    if ( pObj )
Lines 508-512 void ScDrawShell::SetHlinkForObject( Sdr Link Here
508
        lcl_setModified( GetObjectShell() );
505
        lcl_setModified( GetObjectShell() );
509
    }
506
    }
510
}
507
}
511
#endif
512
508
(-)../src680_m217-dr55-applied/sc/source/ui/drawfunc/fudraw.cxx (-4 lines)
Lines 899-909 void FuDraw::ForcePointer(const MouseEve Link Here
899
			SdrObjMacroHitRec aHitRec;	//! muss da noch irgendwas gesetzt werden ????
899
			SdrObjMacroHitRec aHitRec;	//! muss da noch irgendwas gesetzt werden ????
900
			pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
900
			pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
901
		}
901
		}
902
#ifdef ISSUE66550_HLINK_FOR_SHAPES
903
        else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) )
902
        else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) )
904
#else
905
        else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) )
906
#endif
907
			pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
903
			pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
908
		else if ( IsDetectiveHit( aPnt ) )
904
		else if ( IsDetectiveHit( aPnt ) )
909
			pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
905
			pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
(-)../src680_m217-dr55-applied/sc/source/ui/drawfunc/fusel.cxx (-4 lines)
Lines 210-216 BOOL __EXPORT FuSelection::MouseButtonDo Link Here
210
                   }
210
                   }
211
211
212
                   ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
212
                   ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
213
#ifdef ISSUE66550_HLINK_FOR_SHAPES
214
                   // For interoperability favour links over macros if both are defined
213
                   // For interoperability favour links over macros if both are defined
215
                   if ( pInfo->GetHlink().getLength() > 0 )
214
                   if ( pInfo->GetHlink().getLength() > 0 )
216
                   {
215
                   {
Lines 218-226 BOOL __EXPORT FuSelection::MouseButtonDo Link Here
218
                       sURL = pInfo->GetHlink();
217
                       sURL = pInfo->GetHlink();
219
                   }
218
                   }
220
                   else if ( pInfo->GetMacro().getLength() > 0 )
219
                   else if ( pInfo->GetMacro().getLength() > 0 )
221
#else
222
                   if ( pInfo->GetMacro().getLength() > 0 )
223
#endif
224
                   {
220
                   {
225
                       SfxObjectShell* pObjSh = SfxObjectShell::Current();
221
                       SfxObjectShell* pObjSh = SfxObjectShell::Current();
226
                       if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
222
                       if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
(-)../src680_m217-dr55-applied/sc/source/ui/drawfunc/objdraw.src (-6 lines)
Lines 190-196 Link Here
190
        ITEM_FORMAT_PARA_DLG\
190
        ITEM_FORMAT_PARA_DLG\
191
    };
191
    };
192
192
193
#ifdef ISSUE66550_HLINK_FOR_SHAPES
194
#define MN_EDITLNK \
193
#define MN_EDITLNK \
195
    MenuItem\
194
    MenuItem\
196
    {\
195
    {\
Lines 206-212 Link Here
206
        HelpID = SID_DRAW_HLINK_DELETE ; \
205
        HelpID = SID_DRAW_HLINK_DELETE ; \
207
        Text [ en-US ] = "~Remove Hyperlink" ; \
206
        Text [ en-US ] = "~Remove Hyperlink" ; \
208
	};
207
	};
209
#endif
210
208
211
#define MN_DRWTXTATTR \
209
#define MN_DRWTXTATTR \
212
    MenuItem\
210
    MenuItem\
Lines 1299-1312 Menu RID_POPUP_DRAW Link Here
1299
		MenuItem { Separator = TRUE ; };
1297
		MenuItem { Separator = TRUE ; };
1300
		 //------------------------------
1298
		 //------------------------------
1301
		ITEM_GROUP_MENU
1299
		ITEM_GROUP_MENU
1302
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1303
		 //------------------------------
1300
		 //------------------------------
1304
		MenuItem { Separator = TRUE ; };
1301
		MenuItem { Separator = TRUE ; };
1305
		 //------------------------------
1302
		 //------------------------------
1306
		MN_EDITLNK
1303
		MN_EDITLNK
1307
		MN_DELLNK
1304
		MN_DELLNK
1308
        MenuItem { ITEM_OPEN_HYPERLINK };
1305
        MenuItem { ITEM_OPEN_HYPERLINK };
1309
#endif
1310
	};
1306
	};
1311
};
1307
};
1312
1308
Lines 1376-1389 Menu RID_POPUP_GRAPHIC Link Here
1376
		MenuItem { Separator = TRUE ; };
1372
		MenuItem { Separator = TRUE ; };
1377
		 //------------------------------
1373
		 //------------------------------
1378
		ITEM_GROUP_MENU
1374
		ITEM_GROUP_MENU
1379
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1380
		 //------------------------------
1375
		 //------------------------------
1381
		MenuItem { Separator = TRUE ; };
1376
		MenuItem { Separator = TRUE ; };
1382
		 //------------------------------
1377
		 //------------------------------
1383
		MN_EDITLNK
1378
		MN_EDITLNK
1384
		MN_DELLNK
1379
		MN_DELLNK
1385
        MenuItem { ITEM_OPEN_HYPERLINK };
1380
        MenuItem { ITEM_OPEN_HYPERLINK };
1386
#endif
1387
	};
1381
	};
1388
};
1382
};
1389
1383
(-)../src680_m217-dr55-applied/sc/source/ui/inc/drawsh.hxx (-2 lines)
Lines 62-70 class ScDrawShell : public SfxShell Link Here
62
62
63
    DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
63
    DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
64
64
65
#ifdef ISSUE66550_HLINK_FOR_SHAPES
66
    void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk );
65
    void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk );
67
#endif
68
66
69
protected:
67
protected:
70
	ScViewData*	GetViewData()	{ return pViewData; }
68
	ScViewData*	GetViewData()	{ return pViewData; }
(-)../src680_m217-dr55-applied/sc/source/ui/unoobj/shapeuno.cxx (-39 / +25 lines)
Lines 77-82 const SfxItemPropertyMap* lcl_GetShapeMa Link Here
77
        {MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
77
        {MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
78
		{MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP),	0, &getCppuType((uno::Reference<container::XIndexContainer>*)0), 0, 0 },
78
		{MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP),	0, &getCppuType((uno::Reference<container::XIndexContainer>*)0), 0, 0 },
79
		{MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
79
		{MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
80
		// #i66550 HLINK_FOR_SHAPES
81
		{MAP_CHAR_LEN(SC_UNONAME_HYPERLINK), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
80
        {0,0,0,0,0,0}
82
        {0,0,0,0,0,0}
81
	};
83
	};
82
	return aShapeMap_Impl;
84
	return aShapeMap_Impl;
Lines 91-96 const SvEventDescription* ScShapeObj::Ge Link Here
91
	};
93
	};
92
	return aMacroDescriptionsImpl;
94
	return aMacroDescriptionsImpl;
93
}
95
}
96
// #i66550 HLINK_FOR_SHAPES
97
ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate = FALSE )
98
{
99
        if( pShape )
100
            if( SdrObject* pObj = pShape->GetSdrObject() )
101
                return ScDrawLayer::GetMacroInfo( pObj, bCreate );
102
        return 0;
103
}
94
104
95
//------------------------------------------------------------------------
105
//------------------------------------------------------------------------
96
106
Lines 639-644 void SAL_CALL ScShapeObj::setPropertyVal Link Here
639
            }
649
            }
640
        }
650
        }
641
    }
651
    }
652
	else if  ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) )
653
	{
654
                rtl::OUString sHlink;
655
        	ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, TRUE);
656
        	if ( ( aValue >>= sHlink ) && pInfo )
657
			pInfo->SetHlink( sHlink );
658
	}
642
	else
659
	else
643
	{
660
	{
644
        GetShapePropertySet();
661
        GetShapePropertySet();
Lines 820-825 uno::Any SAL_CALL ScShapeObj::getPropert Link Here
820
            }
837
            }
821
        }
838
        }
822
    }
839
    }
840
	else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) )
841
	{
842
		rtl::OUString sHlink;
843
		if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) )
844
			sHlink = pInfo->GetHlink();
845
		aAny <<= sHlink;
846
	}
823
	else
847
	else
824
	{
848
	{
825
        GetShapePropertySet();
849
        GetShapePropertySet();
Lines 1332-1342 SdrObject* ScShapeObj::GetSdrObject() co Link Here
1332
}
1356
}
1333
1357
1334
#define SC_EVENTACC_ONCLICK     ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) )
1358
#define SC_EVENTACC_ONCLICK     ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) )
1335
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1336
#define SC_EVENTACC_ONACTION    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) )
1337
#define SC_EVENTACC_URL         ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) )
1338
#define SC_EVENTACC_ACTION      ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) )
1339
#endif
1340
#define SC_EVENTACC_SCRIPT      ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) )
1359
#define SC_EVENTACC_SCRIPT      ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) )
1341
#define SC_EVENTACC_EVENTTYPE   ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) )
1360
#define SC_EVENTACC_EVENTTYPE   ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) )
1342
1361
Lines 1348-1357 private: Link Here
1348
1367
1349
    ScMacroInfo* getInfo( BOOL bCreate = FALSE )
1368
    ScMacroInfo* getInfo( BOOL bCreate = FALSE )
1350
	{
1369
	{
1351
        if( mpShape )
1370
		return lcl_getShapeHyperMacroInfo( mpShape, bCreate );
1352
            if( SdrObject* pObj = mpShape->GetSdrObject() )
1353
                return ScDrawLayer::GetMacroInfo( pObj, bCreate );
1354
        return 0;
1355
	}
1371
	}
1356
1372
1357
public:
1373
public:
Lines 1377-1387 public: Link Here
1377
				isEventType = true;
1393
				isEventType = true;
1378
				continue;
1394
				continue;
1379
			}
1395
			}
1380
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1381
            if ( isEventType && ((pProperties->Name == SC_EVENTACC_SCRIPT) || (pProperties->Name == SC_EVENTACC_URL)) )
1382
#else
1383
            if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) )
1396
            if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) )
1384
#endif
1385
			{
1397
			{
1386
                rtl::OUString sValue;
1398
                rtl::OUString sValue;
1387
                if ( pProperties->Value >>= sValue )
1399
                if ( pProperties->Value >>= sValue )
Lines 1392-1401 public: Link Here
1392
                        break;
1404
                        break;
1393
                    if ( pProperties->Name == SC_EVENTACC_SCRIPT )
1405
                    if ( pProperties->Name == SC_EVENTACC_SCRIPT )
1394
                        pInfo->SetMacro( sValue );
1406
                        pInfo->SetMacro( sValue );
1395
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1396
                    else
1407
                    else
1397
                        pInfo->SetHlink( sValue );
1408
                        pInfo->SetHlink( sValue );
1398
#endif
1399
                }
1409
                }
1400
			}
1410
			}
1401
		}
1411
		}
Lines 1418-1436 public: Link Here
1418
                aProperties[ 1 ].Value <<= pInfo->GetMacro();
1428
                aProperties[ 1 ].Value <<= pInfo->GetMacro();
1419
            }
1429
            }
1420
        }
1430
        }
1421
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1422
        else if( aName == SC_EVENTACC_ONACTION )
1423
        {
1424
            if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
1425
            {
1426
                aProperties.realloc( 2 );
1427
                aProperties[ 0 ].Name = SC_EVENTACC_EVENTTYPE;
1428
                aProperties[ 0 ].Value <<= SC_EVENTACC_ACTION;
1429
                aProperties[ 1 ].Name = SC_EVENTACC_URL;
1430
                aProperties[ 1 ].Value <<= pInfo->GetHlink();
1431
            }
1432
        }
1433
#endif
1434
        else
1431
        else
1435
        {
1432
        {
1436
            throw container::NoSuchElementException();
1433
            throw container::NoSuchElementException();
Lines 1441-1465 public: Link Here
1441
1438
1442
    virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException)
1439
    virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException)
1443
	{
1440
	{
1444
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1445
        uno::Sequence< rtl::OUString > aSeq( 2 );
1446
#else
1447
        uno::Sequence< rtl::OUString > aSeq( 1 );
1441
        uno::Sequence< rtl::OUString > aSeq( 1 );
1448
#endif
1449
        aSeq[ 0 ] = SC_EVENTACC_ONCLICK;
1442
        aSeq[ 0 ] = SC_EVENTACC_ONCLICK;
1450
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1451
        aSeq[ 1 ] = SC_EVENTACC_ONACTION;
1452
#endif
1453
        return aSeq;
1443
        return aSeq;
1454
	}
1444
	}
1455
1445
1456
	virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
1446
	virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
1457
	{
1447
	{
1458
#ifdef ISSUE66550_HLINK_FOR_SHAPES
1459
        return (aName == SC_EVENTACC_ONCLICK) || (aName == SC_EVENTACC_ONACTION);
1460
#else
1461
        return aName == SC_EVENTACC_ONCLICK;
1448
        return aName == SC_EVENTACC_ONCLICK;
1462
#endif
1463
	}
1449
	}
1464
1450
1465
	// XElementAccess
1451
	// XElementAccess
(-)../src680_m217-dr55-applied/sc/source/ui/view/gridwin5.cxx (-2 lines)
Lines 359-372 void ScGridWindow::RequestHelp(const Hel Link Here
359
                                    if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
359
                                    if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
360
                                        pObj = pHit;
360
                                        pObj = pHit;
361
                            }
361
                            }
362
#ifdef ISSUE66550_HLINK_FOR_SHAPES
363
                            ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
362
                            ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
364
                            if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
363
                            if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
365
                            {
364
                            {
366
                                aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
365
                                aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
367
                                aHelpText = pInfo->GetHlink();
366
                                aHelpText = pInfo->GetHlink();
368
                            }
367
                            }
369
#endif
370
                        }
368
                        }
371
                    }
369
                    }
372
                }
370
                }
(-)../src680_m217-dr55-applied/sc/sdi/drawsh.sdi (-3 / +3 lines)
Lines 233-241 interface TableDraw Link Here
233
    SID_FONTWORK_CHARACTER_SPACING_DIALOG	[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
233
    SID_FONTWORK_CHARACTER_SPACING_DIALOG	[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
234
234
235
// ISSUE66550_HLINK_FOR_SHAPES
235
// ISSUE66550_HLINK_FOR_SHAPES
236
//    SID_DRAW_HLINK_EDIT             [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
236
    SID_DRAW_HLINK_EDIT             [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
237
//    SID_DRAW_HLINK_DELETE           [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
237
    SID_DRAW_HLINK_DELETE           [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
238
//    SID_OPEN_HYPERLINK              [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
238
    SID_OPEN_HYPERLINK              [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
239
}
239
}
240
240
241
241
(-)../src680_m217-dr55-applied/sc/sdi/scalc.sdi (-45 / +45 lines)
Lines 6327-6381 SfxVoidItem StandardFonts SID_STANDARD_F Link Here
6327
6327
6328
//--------------------------------------------------------------------------
6328
//--------------------------------------------------------------------------
6329
// ISSUE66550_HLINK_FOR_SHAPES
6329
// ISSUE66550_HLINK_FOR_SHAPES
6330
//SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT
6330
SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT
6331
//()
6331
()
6332
//[
6332
[
6333
//   /* flags: */
6333
   /* flags: */
6334
//   AutoUpdate = FALSE,
6334
   AutoUpdate = FALSE,
6335
//   Cachable = Cachable,
6335
   Cachable = Cachable,
6336
//   FastCall = TRUE,
6336
   FastCall = TRUE,
6337
//   HasCoreId = FALSE,
6337
   HasCoreId = FALSE,
6338
//   HasDialog = TRUE,
6338
   HasDialog = TRUE,
6339
//   ReadOnlyDoc = TRUE,
6339
   ReadOnlyDoc = TRUE,
6340
//   Toggle = FALSE,
6340
   Toggle = FALSE,
6341
//   Container = FALSE,
6341
   Container = FALSE,
6342
//   RecordAbsolute = FALSE,
6342
   RecordAbsolute = FALSE,
6343
//   RecordPerSet;
6343
   RecordPerSet;
6344
//   Synchron;
6344
   Synchron;
6345
//
6345
6346
//   /* config: */
6346
//   /* config: */
6347
//   AccelConfig = TRUE,
6347
   AccelConfig = TRUE,
6348
//   MenuConfig = FALSE,
6348
   MenuConfig = FALSE,
6349
//   StatusBarConfig = FALSE,
6349
   StatusBarConfig = FALSE,
6350
//   ToolBoxConfig = FALSE,
6350
   ToolBoxConfig = FALSE,
6351
//   GroupId = GID_DRAWING;
6351
   GroupId = GID_DRAWING;
6352
//]
6352
]
6353
6353
6354
//--------------------------------------------------------------------------
6354
//--------------------------------------------------------------------------
6355
// ISSUE66550_HLINK_FOR_SHAPES
6355
// ISSUE66550_HLINK_FOR_SHAPES
6356
//SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE
6356
SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE
6357
//()
6357
()
6358
//[
6358
[
6359
//   /* flags: */
6359
   /* flags: */
6360
//   AutoUpdate = TRUE,
6360
   AutoUpdate = TRUE,
6361
//   Cachable = Cachable,
6361
   Cachable = Cachable,
6362
//   FastCall = TRUE,
6362
   FastCall = TRUE,
6363
//   HasCoreId = FALSE,
6363
   HasCoreId = FALSE,
6364
//   HasDialog = FALSE,
6364
   HasDialog = FALSE,
6365
//   ReadOnlyDoc = TRUE,
6365
   ReadOnlyDoc = TRUE,
6366
//   Toggle = FALSE,
6366
   Toggle = FALSE,
6367
//   Container = FALSE,
6367
   Container = FALSE,
6368
//   RecordAbsolute = FALSE,
6368
   RecordAbsolute = FALSE,
6369
//   RecordPerSet;
6369
   RecordPerSet;
6370
//   Synchron;
6370
   Synchron;
6371
//
6371
6372
//   /* config: */
6372
   /* config: */
6373
//   AccelConfig = TRUE,
6373
   AccelConfig = TRUE,
6374
//   MenuConfig = FALSE,
6374
   MenuConfig = FALSE,
6375
//   StatusBarConfig = FALSE,
6375
   StatusBarConfig = FALSE,
6376
//   ToolBoxConfig = FALSE,
6376
   ToolBoxConfig = FALSE,
6377
//   GroupId = GID_DRAWING;
6377
   GroupId = GID_DRAWING;
6378
//]
6378
]
6379
6379
6380
//--------------------------------------------------------------------------
6380
//--------------------------------------------------------------------------
6381
SfxVoidItem StandardTextAttributes SID_TEXT_STANDARD
6381
SfxVoidItem StandardTextAttributes SID_TEXT_STANDARD
(-)../src680_m217-dr55-applied/offapi/com/sun/star/drawing/Shape.idl (+3 lines)
Lines 193-198 published service Shape Link Here
193
	*/
193
	*/
194
	[optional, property] com::sun::star::container::XNameContainer ShapeUserDefinedAttributes;
194
	[optional, property] com::sun::star::container::XNameContainer ShapeUserDefinedAttributes;
195
};
195
};
196
	/** this property lets you get and set a hyperlink for this shape.
197
	 */
198
	[optional, property] string Hyperlink;
196
199
197
//=============================================================================
200
//=============================================================================
198
201

Return to issue 66550