[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 2 commits - i18npool/source sw/source
Michael Stahl
mstahl at redhat.com
Fri May 22 03:51:23 PDT 2015
i18npool/source/breakiterator/gendict.cxx | 2 +-
sw/source/core/doc/docbm.cxx | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 4d643a78fceb0a208e2aa8b436eda3385d408915
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed May 20 23:04:52 2015 +0200
sw: avoid CrossRefBookmark assertion when importing ooo83574-1.doc
One of the thousands of redlines in the document contains a paragraph
that has a cross-ref bookmark on it. At the end of the import the
redlines get hidden, i.e. copied and deleted from the body.
Because this redline starts in the middle of a paragraph, the
CrossRefBookmark on its last paragraph gets its position corrected
onto the middle of a paragraph, and it becomes unhappy and asserts.
Probably this can only happen in WW8 import, since other imports insert
the redline data into the redline area in the nodes array.
Change-Id: I5bfd94cacf9c2e76fd646728a123b3297b47c255
(cherry picked from commit 27384cdf7df20d6bc46e5d028f27be41b49b0f02)
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 9b9f143..b88bd17 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -632,6 +632,11 @@ namespace sw { namespace mark
if(&pMark->GetMarkPos().nNode.GetNode() == pOldNode)
{
SwPosition aNewPosRel(aNewPos);
+ if (dynamic_cast< ::sw::mark::CrossRefBookmark *>(pMark))
+ {
+ // ensure that cross ref bookmark always starts at 0
+ aNewPosRel.nContent = 0; // HACK for WW8 import
+ }
aNewPosRel.nContent += pMark->GetMarkPos().nContent.GetIndex();
pMark->SetMarkPos(aNewPosRel);
bChangedPos = true;
commit 428e0b4ccb7b2af84da3cd4bbcedcd9cb1a96e1f
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu May 21 23:51:01 2015 +0200
i18npool: ASAN: fix off-by-one in gendict's index2 array
The charArray always contains the size of lenArray *before* it is
extended, i.e., the last valid index.
Change-Id: Id1f4e1f2cb55a88ef5339e9d962a3adf4cde91f9
(cherry picked from commit 2589d545ec099c7b670b185d06fbf9ca841fb748)
diff --git a/i18npool/source/breakiterator/gendict.cxx b/i18npool/source/breakiterator/gendict.cxx
index a779981..8bec7d2 100644
--- a/i18npool/source/breakiterator/gendict.cxx
+++ b/i18npool/source/breakiterator/gendict.cxx
@@ -151,8 +151,8 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa
#endif
}
}
- lenArray.push_back( lenArrayCurr ); // store last ending pointer
charArray[current+1] = lenArray.size();
+ lenArray.push_back( lenArrayCurr ); // store last ending pointer
#ifndef DICT_JA_ZH_IN_DATAFILE
fputs("\n};\n", source_fp);
#endif
More information about the Libreoffice-commits
mailing list