diff options
author | Noel Power <noel.power@suse.com> | 2013-01-08 10:56:44 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-01-08 11:01:04 +0000 |
commit | 92afb61d8bb1b264a945371065115981ecaed0f1 (patch) | |
tree | 454f19151a53e096740b1d5af032240679dc6bc9 /sc/source/core/data/cell.cxx | |
parent | eb54843c8556cd39efb4ade347652ad118c5de66 (diff) |
support new hyperlink cell attribute
Allows a hyperlink attribute to be set for a cell, allows for import of say a
hyperlink associated with a formula cell. Since this patch does not add
any file format support it is not possible to save such an imported hyperlink
to ods. Note: such a hyperlink would not have been imported in the past so this
should not be an issue
Change-Id: Ieb234bb6e98e4a2630b596a90972a75be12a92d4
Diffstat (limited to 'sc/source/core/data/cell.cxx')
-rw-r--r-- | sc/source/core/data/cell.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index 371897686baa..ce073e2e29eb 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -610,6 +610,16 @@ bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 ) return false; } +EditTextObject* ScBaseCell::CreateURLObjectFromURL( ScDocument& rDoc, const OUString& rURL, const OUString& rText ) +{ + SvxURLField aUrlField( rURL, rText, SVXURLFORMAT_APPDEFAULT); + EditEngine& rEE = rDoc.GetEditEngine(); + rEE.SetText( EMPTY_STRING ); + rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0xFFFF, 0xFFFF ) ); + + return rEE.CreateTextObject(); +} + // ============================================================================ ScNoteCell::ScNoteCell( SvtBroadcaster* pBC ) : @@ -1979,12 +1989,7 @@ EditTextObject* ScFormulaCell::CreateURLObject() rtl::OUString aURL; GetURLResult( aURL, aCellText ); - SvxURLField aUrlField( aURL, aCellText, SVXURLFORMAT_APPDEFAULT); - EditEngine& rEE = pDocument->GetEditEngine(); - rEE.SetText( EMPTY_STRING ); - rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0xFFFF, 0xFFFF ) ); - - return rEE.CreateTextObject(); + return CreateURLObjectFromURL( *pDocument, aURL, aCellText ); } // ============================================================================ |