summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-04 16:02:49 +0100
committerAndras Timar <andras.timar@collabora.com>2014-07-10 11:11:09 +0200
commitb0e9c366211718f8f5385e81d43a963b775814a7 (patch)
tree4ebf11f0855614fd4d9479eb0f37e556fdc46212 /sw/source
parent283a2ccf0ff65187dee0a888c627a1df93571183 (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 (cherry picked from commit 5cfda4f4de8da82485e27b1f0f0d94211d3b4d95) Reviewed-on: https://gerrit.libreoffice.org/10138 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx14
-rw-r--r--sw/source/filter/ww8/ww8par.hxx2
2 files changed, 15 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 3f80e3c8121f..d2929e0d3028 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2173,7 +2173,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 )
{
@@ -5962,6 +5962,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 772da4c98091..9434c2e4c89e 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);