diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2001-01-02 13:05:02 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2001-01-02 13:05:02 +0000 |
commit | 79db5ab936dc694c67ab9d8b6a80f81907b7c11f (patch) | |
tree | 534bca9bf793ea978e0bec07315fdd864f467dbf /xmloff/source/text/txtimp.cxx | |
parent | 5ba0fa6e20a85ce5f5a42daee77fc6f7780dd55f (diff) |
- added: events in Hyperlinks
Diffstat (limited to 'xmloff/source/text/txtimp.cxx')
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index eaf868ec3c90..c33231cb8d14 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimp.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: sab $ $Date: 2000-12-21 17:53:29 $ + * last change: $Author: dvo $ $Date: 2001-01-02 14:05:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -179,6 +179,9 @@ #ifndef _XMLOFF_NMSPMAP_HXX #include "nmspmap.hxx" #endif +#ifndef _XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX +#include "XMLEventsImportContext.hxx" +#endif using namespace ::rtl; @@ -495,7 +498,8 @@ XMLTextImportHelper::XMLTextImportHelper( sVisitedCharStyleName(RTL_CONSTASCII_USTRINGPARAM("VisitedCharStyleName")), sTextFrame(RTL_CONSTASCII_USTRINGPARAM("TextFrame")), sPageDescName(RTL_CONSTASCII_USTRINGPARAM("PageDescName")), - sServerMap(RTL_CONSTASCII_USTRINGPARAM("ServerMap")) + sServerMap(RTL_CONSTASCII_USTRINGPARAM("ServerMap")), + sHyperLinkEvents(RTL_CONSTASCII_USTRINGPARAM("HyperLinkEvents")) { Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY ); @@ -884,7 +888,8 @@ void XMLTextImportHelper::SetHyperlink( const OUString& rName, const OUString& rTargetFrameName, const OUString& rStyleName, - const OUString& rVisitedStyleName ) + const OUString& rVisitedStyleName, + XMLEventsImportContext* pEvents) { Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY ); Reference < XPropertySetInfo > xPropSetInfo = @@ -908,6 +913,27 @@ void XMLTextImportHelper::SetHyperlink( xPropSet->setPropertyValue( sHyperLinkTarget, aAny ); } + if ( (pEvents != NULL) && + xPropSetInfo->hasPropertyByName( sHyperLinkEvents )) + { + // The API treats events at hyperlinks differently from most + // other properties: You have to set a name replace with the + // events in it. The easiest way to to this is to 1) get + // events, 2) set new ones, and 3) then put events back. + aAny = xPropSet->getPropertyValue( sHyperLinkEvents ); + Reference<XNameReplace> xReplace; + aAny >>= xReplace; + if (xReplace.is()) + { + // set events + pEvents->SetEvents(xReplace); + + // put events + aAny <<= xReplace; + xPropSet->setPropertyValue( sHyperLinkEvents, aAny ); + } + } + if( xTextStyles.is() ) { if( rStyleName.getLength() && |