LibreOffice Module sc (master)  1
Public Member Functions | Private Attributes | List of all members
ScVbaHyperlinks Class Reference

Represents a collection of hyperlinks of a worksheet or of a range. More...

#include <vbahyperlinks.hxx>

Inheritance diagram for ScVbaHyperlinks:
[legend]
Collaboration diagram for ScVbaHyperlinks:
[legend]

Public Member Functions

 ScVbaHyperlinks (const css::uno::Reference< ov::XHelperInterface > &rxParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
 
 ScVbaHyperlinks (const css::uno::Reference< ov::XHelperInterface > &rxParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const ScVbaHyperlinksRef &rxSheetHlinks, const ScRangeList &rScRanges)
 
virtual ~ScVbaHyperlinks () override
 
virtual css::uno::Reference< ov::excel::XHyperlink > SAL_CALL Add (const css::uno::Any &rAnchor, const css::uno::Any &rAddress, const css::uno::Any &rSubAddress, const css::uno::Any &rScreenTip, const css::uno::Any &rTextToDisplay) override
 
virtual void SAL_CALL Delete () override
 
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration () override
 
virtual css::uno::Type SAL_CALL getElementType () override
 
virtual css::uno::Any createCollectionObject (const css::uno::Any &rSource) override
 
- Public Member Functions inherited from CollTestImplHelper< Ifc >
 CollTestImplHelper (const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::container::XIndexAccess > &xIndexAccess, bool bIgnoreCase=false)
 
- Public Member Functions inherited from ScVbaCollectionBase< ::cppu::WeakImplHelper< Ifc... > >
 ScVbaCollectionBase (const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::container::XIndexAccess > &xIndexAccess, bool bIgnoreCase=false)
 
virtual ::sal_Int32 SAL_CALL getCount () override
 
virtual css::uno::Any SAL_CALL Item (const css::uno::Any &Index1, const css::uno::Any &) override
 
OUString SAL_CALL getDefaultMethodName () override
 
virtual sal_Bool SAL_CALL hasElements () override
 
- Public Member Functions inherited from InheritedHelperInterfaceImpl< Ifc... >
 InheritedHelperInterfaceImpl (const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext)
 
virtual OUString getServiceImplName ()=0
 
virtual css::uno::Sequence< OUString > getServiceNames ()=0
 
virtual ::sal_Int32 SAL_CALL getCreator () override
 
virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent () override
 
virtual css::uno::Any SAL_CALL Application () override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 

Private Attributes

ScVbaHyperlinksRef mxSheetHlinks
 
- Private Attributes inherited from detail::ScVbaHlinkContainerMember
ScVbaHlinkContainerRef mxContainer
 

Additional Inherited Members

- Protected Member Functions inherited from ScVbaCollectionBase< ::cppu::WeakImplHelper< Ifc... > >
virtual css::uno::Any getItemByStringIndex (const OUString &sIndex)
 
virtual css::uno::Any getItemByIntIndex (const sal_Int32 nIndex)
 
void UpdateCollectionIndex (const css::uno::Reference< css::container::XIndexAccess > &xIndexAccess)
 
- Protected Attributes inherited from ScVbaCollectionBase< ::cppu::WeakImplHelper< Ifc... > >
css::uno::Reference< css::container::XIndexAccess > m_xIndexAccess
 
css::uno::Reference< css::container::XNameAccess > m_xNameAccess
 
bool mbIgnoreCase
 
- Protected Attributes inherited from InheritedHelperInterfaceImpl< Ifc... >
css::uno::WeakReference< ov::XHelperInterface > mxParent
 
css::uno::Reference< css::uno::XComponentContext > mxContext
 
- Private Member Functions inherited from detail::ScVbaHlinkContainerMember
 ScVbaHlinkContainerMember (ScVbaHlinkContainer *pContainer)
 
 ~ScVbaHlinkContainerMember ()
 

Detailed Description

Represents a collection of hyperlinks of a worksheet or of a range.

When a Hyperlinks collection object has been constructed from a VBA Worksheet object, it will always represent the current set of all hyperlinks existing in the sheet. Insertion and deletion of hyperlinks will be reflected by the instance.

When a Hyperlinks collection object has been constructed from a VBA Range object, it will represent the set of hyperlinks that have existed at its construction time, and that are located completely inside the range(s) represented by the Range object. Insertion and deletion of hyperlinks will not* be reflected by that instance. The instance will always offer all hyperlinks it has been constructed with, even if they no longer exist. Furthermore, the instance will not offer hyperlinks inserted later, even if the instance itself has been used to insert the new hyperlinks.

VBA code example:

With ThisWorkbook.Worksheets(1)

Set hlinks = .Hyperlinks                ' global Hyperlinks object
Set myrange = .Range("A1:C3")
Set rangelinks1 = myrange.Hyperlinks    ' hyperlinks of range A1:C3

MsgBox hlinks.Count                     ' 0
MsgBox rangelinks1.Count                ' 0

hlinks.Add .Range("A1"), "http://example.com"
' a new hyperlink has been added in cell A1

MsgBox hlinks.Count                     ' 1
MsgBox rangelinks1.Count                ' still 0!
Set rangelinks2 = myrange.Hyperlinks    ' hyperlinks of range A1:C3
MsgBox rangelinks2.Count                ' 1 (constructed after Add)

rangelinks1.Add .Range("A2"), "http://example.com"
' a new hyperlink has been constructed via the rangelinks1 object
' but this addition has been done by the worksheet Hyperlinks object

MsgBox hlinks.Count                     ' 2
MsgBox rangelinks1.Count                ' still 0!!!
MsgBox rangelinks2.Count                ' still 1!!!
MsgBox myrange.Hyperlinks.Count         ' 2 (constructed after Add)

End With

Definition at line 98 of file vbahyperlinks.hxx.

Constructor & Destructor Documentation

ScVbaHyperlinks::ScVbaHyperlinks ( const css::uno::Reference< ov::XHelperInterface > &  rxParent,
const css::uno::Reference< css::uno::XComponentContext > &  rxContext 
)
explicit
Exceptions
css::uno::RuntimeException
ScVbaHyperlinks::ScVbaHyperlinks ( const css::uno::Reference< ov::XHelperInterface > &  rxParent,
const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const ScVbaHyperlinksRef rxSheetHlinks,
const ScRangeList rScRanges 
)
explicit
Exceptions
css::uno::RuntimeException
ScVbaHyperlinks::~ScVbaHyperlinks ( )
overridevirtual

Definition at line 212 of file vbahyperlinks.cxx.

Member Function Documentation

uno::Reference< excel::XHyperlink > SAL_CALL ScVbaHyperlinks::Add ( const css::uno::Any &  rAnchor,
const css::uno::Any &  rAddress,
const css::uno::Any &  rSubAddress,
const css::uno::Any &  rScreenTip,
const css::uno::Any &  rTextToDisplay 
)
overridevirtual

Definition at line 218 of file vbahyperlinks.cxx.

References mxContainer, and mxContext.

uno::Any ScVbaHyperlinks::createCollectionObject ( const css::uno::Any &  rSource)
overridevirtual
uno::Reference< container::XEnumeration > SAL_CALL ScVbaHyperlinks::createEnumeration ( )
overridevirtual
void SAL_CALL ScVbaHyperlinks::Delete ( )
overridevirtual

Definition at line 245 of file vbahyperlinks.cxx.

uno::Type SAL_CALL ScVbaHyperlinks::getElementType ( )
overridevirtual

Member Data Documentation

ScVbaHyperlinksRef ScVbaHyperlinks::mxSheetHlinks
private

Definition at line 134 of file vbahyperlinks.hxx.


The documentation for this class was generated from the following files: