summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-10-12 10:11:30 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-10-12 10:22:26 +0200
commit89552d9228c89721353578d38a9a81e954cc9a60 (patch)
tree24f2418e4642ff62751f14a43b8da0739ec25108 /sw
parent7051c834c6c1e98d9e44cc828701477730113448 (diff)
OLE Links roundtrip fixed for links as pictures
n#628098
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par.hxx1
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx9
3 files changed, 13 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 434dd1a05c81..10a632908310 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -368,6 +368,7 @@ class FieldEntry
public:
sw::hack::Position maStartPos;
sal_uInt16 mnFieldId;
+ ULONG mnObjLocFc;
FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw();
FieldEntry(const FieldEntry &rOther) throw();
FieldEntry &operator=(const FieldEntry &rOther) throw();
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 4cdcdbc1a851..5d8e89bd30ad 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -762,11 +762,11 @@ sal_uInt16 SwWW8ImplReader::End_Field()
rtl::OUString::createFromAscii( ODF_CODE_PARAM ),
uno::makeAny( aCode ) ) );
- if ( nObjLocFc > 0 )
+ if ( maFieldStack.back().mnObjLocFc > 0 )
{
// Store the OLE object as an internal link
String sOleId = '_';
- sOleId += String::CreateFromInt32( nObjLocFc );
+ sOleId += String::CreateFromInt32( maFieldStack.back().mnObjLocFc );
SvStorageRef xSrc0 = pStg->OpenSotStorage(CREATE_CONST_ASC(SL::aObjectPool));
SvStorageRef xSrc1 = xSrc0->OpenSotStorage( sOleId, STREAM_READ );
@@ -830,12 +830,12 @@ bool AcceptableNestedField(sal_uInt16 nFieldCode)
}
FieldEntry::FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw()
- : maStartPos(rPos), mnFieldId(nFieldId)
+ : maStartPos(rPos), mnFieldId(nFieldId), mnObjLocFc(0)
{
}
FieldEntry::FieldEntry(const FieldEntry &rOther) throw()
- : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId)
+ : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId), mnObjLocFc(rOther.mnObjLocFc)
{
}
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 21b6b05d547a..782c5e678a0b 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2827,7 +2827,14 @@ void SwWW8ImplReader::Read_Obj(USHORT , const BYTE* pData, short nLen)
bObj = 0 != *pData;
if( bObj && nPicLocFc && bEmbeddObj )
- nObjLocFc = nPicLocFc;
+ {
+ if ( maFieldStack.back().mnFieldId == 56 ) {
+ // For LINK fields, store the nObjLocFc value in the field entry
+ maFieldStack.back().mnObjLocFc = nPicLocFc;
+ } else {
+ nObjLocFc = nPicLocFc;
+ }
+ }
}
}