22 #include <com/sun/star/xml/sax/XFastContextHandler.hpp>
28 #include <oox/token/namespaces.hxx>
29 #include <oox/token/properties.hxx>
30 #include <oox/token/tokens.hxx>
45 OUString aRelId = rAttribs.
getString( R_TOKEN(
id ) ).
get();
46 if ( !aRelId.isEmpty() )
49 if( !sHref.isEmpty() )
59 OUString sTooltip = rAttribs.
getString( R_TOKEN( tooltip ) ).
get();
60 if ( !sTooltip.isEmpty() )
63 if( !sFrame.isEmpty() )
65 OUString aAction = rAttribs.
getString( XML_action ).
get();
66 if ( !aAction.isEmpty() )
82 static const OUStringLiteral sPPAction(
u"ppaction://" );
83 if ( aAction.matchIgnoreAsciiCase( sPPAction ) )
85 OUString aPPAct( aAction.copy( sPPAction.getLength() ) );
86 sal_Int32
nIndex = aPPAct.indexOf(
'?' );
87 OUString aPPAction( nIndex > 0 ? aPPAct.copy( 0, nIndex ) : aPPAct );
89 if ( aPPAction.match(
"hlinkshowjump" ) )
91 static const OUStringLiteral sJump(
u"jump=" );
92 if ( aPPAct.match( sJump, nIndex + 1 ) )
94 std::u16string_view aDestination( aPPAct.subView( nIndex + 1 + sJump.getLength() ) );
95 sURL += OUString::Concat(
"#action?jump=") + aDestination;
98 else if ( aPPAction.match(
"hlinksldjump" ) )
102 sal_Int32 nIndex2 = 0;
103 while ( nIndex2 < sHref.getLength() )
106 if ( ( nChar >=
'0' ) && ( nChar <=
'9' ) )
110 if ( nIndex2 && ( nIndex2 != sHref.getLength() ) )
113 while( ( nIndex2 + nLength ) < sHref.getLength() )
116 if ( ( nChar <
'0' ) || ( nChar >
'9' ) )
120 sal_Int32 nPageNumber =
o3tl::toInt32(sHref.subView( nIndex2, nLength ));
123 const OUString aSlideType( sHref.copy( 0, nIndex2 ) );
124 if ( aSlideType.match(
"slide" ) )
125 sURL =
"#Slide " + OUString::number( nPageNumber );
126 else if ( aSlideType.match(
"notesSlide" ) )
127 sURL =
"#Notes " + OUString::number( nPageNumber );
134 if ( !sURL.isEmpty() )
153 case A_TOKEN( extLst ):
OUString getInternalTargetFromRelId(const OUString &rRelId) const
Returns the internal target of the relation with the passed relation identifier.
PropertyMap & maProperties
A helper that maps property identifiers to property values.
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
virtual ~HyperLinkContext() override
constexpr OUStringLiteral sFrame
OUString getExternalTargetFromRelId(const OUString &rRelId) const
Returns the external target of the relation with the passed relation identifier.
bool setProperty(sal_Int32 nPropId, Type &&rValue)
Sets the specified property to the passed value.
OptValue< OUString > getString(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute.
SvGenericNameContainerMapImpl maProperties
const Relations & getRelations() const
Returns the relations of the current fragment.
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
Provides access to attribute values of an element.
XmlFilterBase & getFilter() const
Returns the filter instance.
HyperLinkContext(::oox::core::ContextHandler2Helper const &rParent, const ::oox::AttributeList &rAttribs, PropertyMap &aProperties)
OUString getAbsoluteUrl(const OUString &rUrl) const
Returns an absolute URL for the passed relative or absolute URL.
Helper class that provides a context stack.