diff options
author | Noel Power <noel.power@suse.com> | 2012-12-13 17:32:00 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-12-13 17:34:10 +0000 |
commit | 5deba0e70c9287e6e933df458c21cc3e72f3aa70 (patch) | |
tree | 26c56cdc00e36f9a83d68bb1e0fcf6066c2c56a0 /sc/source/filter/oox/drawingfragment.cxx | |
parent | 64f98aa1f492911c6ce1b76c394bd87abee330a2 (diff) |
fix fdo#58237 import hyperlinks for shapes in xlsx documents
Change-Id: I9c64c0f4d1eb8533b65f35d5e85e1ab4881a2b67
Diffstat (limited to 'sc/source/filter/oox/drawingfragment.cxx')
-rw-r--r-- | sc/source/filter/oox/drawingfragment.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index bb8fe087951b..a301326ab906 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -26,6 +26,9 @@ #include <com/sun/star/script/ScriptEventDescriptor.hpp> #include <com/sun/star/script/XEventAttacherManager.hpp> #include <rtl/strbuf.hxx> +#include <svx/svdobj.hxx> +#include "drwlayer.hxx" +#include "userdat.hxx" #include "oox/drawingml/connectorshapecontext.hxx" #include "oox/drawingml/graphicshapecontext.hxx" #include "oox/helper/attributelist.hxx" @@ -36,11 +39,10 @@ #include "stylesbuffer.hxx" #include "themebuffer.hxx" #include "unitconverter.hxx" - +#include "worksheetbuffer.hxx" namespace oox { namespace xls { -using namespace ::com::sun::star::awt; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::document; @@ -53,6 +55,10 @@ using namespace ::oox::core; using namespace ::oox::drawingml; using namespace ::oox::ole; +using ::com::sun::star::awt::Size; +using ::com::sun::star::awt::Point; +using ::com::sun::star::awt::Rectangle; +using ::com::sun::star::awt::XControlModel; using ::rtl::OStringBuffer; using ::rtl::OUString; using ::rtl::OUStringToOString; @@ -97,12 +103,24 @@ Shape::Shape( const WorksheetHelper& rHelper, const AttributeList& rAttribs, con void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes ) { + rtl::OUString sURL; + getShapeProperties()[ PROP_URL ] >>= sURL; + getWorksheets().convertSheetNameRef( sURL ); if( !maMacroName.isEmpty() && mxShape.is() ) { VbaMacroAttacherRef xAttacher( new ShapeMacroAttacher( maMacroName, mxShape ) ); getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher ); } ::oox::drawingml::Shape::finalizeXShape( rFilter, rxShapes ); + if ( !sURL.isEmpty() ) + { + SdrObject* pObj = SdrObject::getSdrObjectFromXShape( mxShape ); + if ( pObj ) + { + if ( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, sal_True ) ) + pInfo->SetHlink( sURL ); + } + } } // ============================================================================ |