diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-04 16:02:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-04 16:12:42 +0100 |
commit | 5cfda4f4de8da82485e27b1f0f0d94211d3b4d95 (patch) | |
tree | e54c24ee991d718939560ef235772d3ab93e331d | |
parent | 0be44f7d15009bffd6c03cc3ad81fa54aace40e6 (diff) |
DOC import: fix nested comments
See 2.9.70 (FBKF) in the spec, the ibkl field should be used to find the
position in PlcfBkf.
Previously we assumed that PlcfBkl and PlcfBkf is parallel for
annotations, as but that's not true for nested comments.
Change-Id: I76a6a757b41d2f9b7fe7fe9c9e01a92c251f7b32
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9db79ebd56a1..e978d7668daa 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2175,7 +2175,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) if (nAtnIndex != -1) { WW8_CP nStart = GetAnnotationStart(nAtnIndex); - WW8_CP nEnd = GetAnnotationEnd(nAtnIndex); + WW8_CP nEnd = GetAnnotationEnd(GetAnnotationEndIndex(nAtnIndex)); sal_Int32 nLen = nEnd - nStart; if( nLen ) { @@ -5938,6 +5938,18 @@ int SwWW8ImplReader::GetAnnotationIndex(sal_uInt32 nTag) return -1; } +sal_uInt16 SwWW8ImplReader::GetAnnotationEndIndex(sal_uInt16 nStart) +{ + WW8_CP nStartAkt; + void* p; + if (mpAtnStarts->GetData(nStart, nStartAkt, p) && p) + { + // p is an FBKF, and its first 2 bytes is the ibkl member, which is the end index. + return SVBT16ToShort(*((SVBT16*)p)); + } + return nStart; +} + WW8_CP SwWW8ImplReader::GetAnnotationStart(int nIndex) { if (!mpAtnStarts.get() && pWwFib->lcbPlcfAtnbkf) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index aaf1b445e9f8..c4425cc20819 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1635,6 +1635,8 @@ private: const OUString* GetAnnotationAuthor(sal_uInt16 nIdx); int GetAnnotationIndex(sal_uInt32 nTag); + /// Return the end index based on the start one. + sal_uInt16 GetAnnotationEndIndex(sal_uInt16 nStart); WW8_CP GetAnnotationStart(int nIndex); WW8_CP GetAnnotationEnd(int nIndex); |