Difference between revisions of "Writer/MSInteroperability/HyperLink"

From Apache OpenOffice Wiki
Jump to: navigation, search
(+cat)
 
Line 101: Line 101:
 
| Y
 
| Y
 
|}
 
|}
 +
 +
[[Category:Writer]]

Latest revision as of 14:16, 6 April 2013

Hyperlink in Writer

It is a property of the Text,Frame,Graphic. It can be set by the property dialog or menu "Insert - Hyperlink".

Main Problem

Currently hyperlink importing/exporting work well in ODF. But for WORD 2003/2007 filter, only Text and Graphic with anchor type "As character" can support hyperlink importing/exporting. It is not supported by Frame and Graphic with other anchor type. For example, when you importing/exporting Frame with hyperlink document, the hyperlink property will be lost.

Degree of current supported:

Object Import Export
Text Yes Yes
Graphic (To page, To paragraph, To character, As character, To frame) Only support on "As character" setting Only support on "As character" setting
Frame (To page, To paragraph, To character, As character) Not yet Not yet

Enhancement description

Add support for import/export the hyperlink information of Graphic with anchor type except “As Character” and frame from/into MS Word Binary File.
1. Now you can correctly read the hyperlink info(URL/File location/bookmark, target frame, name) of Graphic with anchor type except “As Character” and frame from MS Word Binary File and display correctly in OOO.
2. Now you can correctly save the hyperlink info(URL/File location/bookmark, target frame, name) of Graphic with anchor type except “As Character” and frame into MS Word Binary File and display correctly in MS Word.

Implementation Details

Data Structure

Hyperlink properties were stored in SwFmtURL structure.

Properties Description
String sTargetFrameName Property contain the name value of target frame
String sURL Property contain the value of URL(include link for bookmark, file location and URL).
String sName Property contain the name value of graphic or frame.

Properties for get/set hyperlink data

Hyperlink data information can be get/set into MS binary file stream with properties in below table.

Action Properties Name
Import DDF_Prop_pihlShape, DDF_Prop_wzName
Export ESCHER_Prop_pihlShape, ESCHER_Prop_wzName

GUID define in MS Binary Format specification

According to GUIDs in below table to locate the position of URL/File location data in MS binary file.

Value Meaning
{0x79EAC9D0, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B} Data field contain a STDHLink.
{0x79EAC9E0, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B} Data field contains a URLMoniker.
{0x00000303, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} Data field contains a FileMoniker.

Unit Test

Below Unit tests have been done on Graphic and Frame.

Doc2Doc Odt2Doc
Bookmark Y Y
File location Y Y
URL Y Y
Target Frame Y Y
Personal tools