summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorJian Hong Cheng <chengjh@apache.org>2012-08-24 02:14:25 +0000
committerXisco Fauli <anistenis@gmail.com>2013-04-07 23:37:38 +0200
commit461c262eb93412b46cc73a28932afdcbaeb34748 (patch)
tree7d910e27ef8732ca7e1d9e66d55ab11e93e97734 /sw/source/filter/ww8
parent67f9ccaebf0f79f9e51717d5365aee1b9bcbd486 (diff)
Fix issue #i120568: Hyperlink of Graphihc with Anchor Type "As Character"
lost after save as doc format * main/sw/source/filter/ww8/wrtww8gr.cxx MS Word Binary compatibility Patch by: Huaidong Qiu,<qiuhuaidong@gmail.com> Found by: Huaidong Qiu,<qiuhuaidong@gmail.com> Review by: Jian Hong Cheng,<chengjh@apache.org> (cherry picked from commit bf1449731638d6432fb9adfef3a8a303ad9bf76b) Conflicts: sw/source/filter/ww8/wrtww8gr.cxx Change-Id: I6a5923a015eefc8aaadeacd897848cf1a2f15362
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 61632d5f20ef..74f46da0b895 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -60,6 +60,9 @@
#include "wrtww8.hxx"
#include "ww8par.hxx"
#include "escher.hxx"
+//Added for i120568
+#include "ww8attributeoutput.hxx"
+#include "fmturl.hxx"
#include "docsh.hxx"
#include <cstdio>
@@ -381,6 +384,16 @@ void WW8Export::OutputLinkedOLE( const OUString& rOleId )
void WW8Export::OutGrf(const sw::Frame &rFrame)
{
+ //Added for i120568,the hyperlink info within a graphic whose anchor type is "As character"
+ //will be exported to ensure the fidelity
+ const SwFmtURL& rURL = rFrame.GetFrmFmt().GetAttrSet().GetURL();
+ bool bURLStarted = false;
+ if( rURL.GetURL().Len() && rFrame.GetWriterType() == sw::Frame::eGraphic)
+ {
+ bURLStarted = true;
+ m_pAttrOutput->StartURL( rURL.GetURL(), rURL.GetTargetFrameName() );
+ }
+
// Store the graphic settings in GrfNode so they may be written-out later
pGrf->Insert(rFrame);
@@ -498,6 +511,10 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
{
OutputField( 0, ww::eINCLUDEPICTURE, String(), WRITEFIELD_CLOSE );
}
+ //Added for i120568,the hyperlink info within a graphic whose anchor type is
+ //"As character" will be exported to ensure the fidelity
+ if( bURLStarted )
+ m_pAttrOutput->EndURL();
}
GraphicDetails& GraphicDetails::operator=(const GraphicDetails &rOther)