[libreoffice] 01/02: add ww8 pstatus import fix

Rene Engelhard rene at moszumanska.debian.org
Thu Jul 27 19:17:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

rene pushed a commit to tag libreoffice_4.2.8-0ubuntu3
in repository libreoffice.

commit 6c4d93ec289e5cbea8e5d9258ed897a0f9bad934
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Sep 18 14:59:35 2015 +0200

    add ww8 pstatus import fix
---
 changelog                   |  6 +++
 patches/pstatus-vector.diff | 90 +++++++++++++++++++++++++++++++++++++++++++++
 patches/series              |  1 +
 3 files changed, 97 insertions(+)

diff --git a/changelog b/changelog
index d4b5cc4..95a1989 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,9 @@
+libreoffice (1:4.2.8-0ubuntu3~trusty3) trusty; urgency=medium
+
+  * add ww8 pstatus import fix
+
+ -- Bjoern Michaelsen <bjoern.michaelsen at canonical.com>  Fri, 18 Sep 2015 14:58:55 +0200
+
 libreoffice (1:4.2.8-0ubuntu3~trusty2) trusty; urgency=medium
 
   * add fixes for ww8 wrapping and coverity#1266485
diff --git a/patches/pstatus-vector.diff b/patches/pstatus-vector.diff
new file mode 100644
index 0000000..63f6ae1
--- /dev/null
+++ b/patches/pstatus-vector.diff
@@ -0,0 +1,90 @@
+From 181f2ff940aed504064a11727d17e0c32b55639a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Thu, 13 Aug 2015 10:58:06 +0100
+Subject: [PATCH] convert pStatus to vector and use at to check offsets
+
+(cherry picked from commit ea70088895ed45dc60abf18319acc1b4fa3018dd)
+
+Change-Id: I5186f6a65bb9d5ed8a0d1ab1d71f7e2c13865411
+Reviewed-on: https://gerrit.libreoffice.org/17695
+Reviewed-by: David Tardon <dtardon at redhat.com>
+Tested-by: David Tardon <dtardon at redhat.com>
+DebianPatchName: pstatus-vector.diff
+---
+ sw/source/filter/ww8/ww8scan.cxx | 18 +++++++++---------
+ sw/source/filter/ww8/ww8scan.hxx |  4 ++--
+ 2 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
+index a2d17c2..9566f8b 100644
+--- a/sw/source/filter/ww8/ww8scan.cxx
++++ b/sw/source/filter/ww8/ww8scan.cxx
+@@ -3914,7 +3914,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
+ }
+ 
+ WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTblSt, const WW8Fib& rFib)
+-    : WW8PLCFx(rFib.GetFIBVersion(), false), pStatus(0), nIsEnd(0), nBookmarkId(1)
++    : WW8PLCFx(rFib.GetFIBVersion(), false), nIsEnd(0), nBookmarkId(1)
+ {
+     if( !rFib.fcPlcfbkf || !rFib.lcbPlcfbkf || !rFib.fcPlcfbkl ||
+         !rFib.lcbPlcfbkl || !rFib.fcSttbfbkmk || !rFib.lcbSttbfbkmk )
+@@ -3939,14 +3939,12 @@ WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTblSt, const WW8Fib& rFib)
+             nIMax = pBook[0]->GetIMax();
+         if( pBook[1]->GetIMax() < nIMax )
+             nIMax = pBook[1]->GetIMax();
+-        pStatus = new eBookStatus[ nIMax ];
+-        memset( pStatus, 0, nIMax * sizeof( eBookStatus ) );
++        aStatus.resize(nIMax);
+     }
+ }
+ 
+ WW8PLCFx_Book::~WW8PLCFx_Book()
+ {
+-    delete[] pStatus;
+     delete pBook[1];
+     delete pBook[0];
+ }
+@@ -4064,18 +4062,20 @@ long WW8PLCFx_Book::GetLen() const
+     return nNum;
+ }
+ 
+-void WW8PLCFx_Book::SetStatus(sal_uInt16 nIndex, eBookStatus eStat )
++void WW8PLCFx_Book::SetStatus(sal_uInt16 nIndex, eBookStatus eStat)
+ {
+-    OSL_ENSURE(nIndex < nIMax, "set status of non existing bookmark!");
+-    pStatus[nIndex] = (eBookStatus)( pStatus[nIndex] | eStat );
++    SAL_WARN_IF(nIndex >= nIMax, "sw.ww8",
++                "bookmark index " << nIndex << " invalid");
++    eBookStatus eStatus = aStatus.at(nIndex);
++    aStatus[nIndex] = static_cast<eBookStatus>(eStatus | eStat);
+ }
+ 
+ eBookStatus WW8PLCFx_Book::GetStatus() const
+ {
+-    if( !pStatus )
++    if (aStatus.empty())
+         return BOOK_NORMAL;
+     long nEndIdx = GetHandle();
+-    return ( nEndIdx < nIMax ) ? pStatus[nEndIdx] : BOOK_NORMAL;
++    return ( nEndIdx < nIMax ) ? aStatus[nEndIdx] : BOOK_NORMAL;
+ }
+ 
+ long WW8PLCFx_Book::GetHandle() const
+diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
+index e20af3e..54dd9a5 100644
+--- a/sw/source/filter/ww8/ww8scan.hxx
++++ b/sw/source/filter/ww8/ww8scan.hxx
+@@ -717,8 +717,8 @@ class WW8PLCFx_Book : public WW8PLCFx
+ {
+ private:
+     WW8PLCFspecial* pBook[2];           // Start and End Position
+-    ::std::vector<OUString> aBookNames;   // Name
+-    eBookStatus* pStatus;
++    std::vector<OUString> aBookNames;   // Name
++    std::vector<eBookStatus> aStatus;
+     long nIMax;                         // Number of Booknotes
+     sal_uInt16 nIsEnd;
+     sal_Int32 nBookmarkId; // counter incremented by GetUniqueBookmarkName.
+-- 
+1.9.1
+
diff --git a/patches/series b/patches/series
index 5cdf12b..c87d8d9 100644
--- a/patches/series
+++ b/patches/series
@@ -39,3 +39,4 @@ check-if-reads-were-successful.diff
 LinkUpdateMode-is-a-global-setting.diff
 ww8dontwrap.diff
 coverity-1266485.diff
+pstatus-vector.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/libreoffice.git



More information about the Pkg-openoffice-commits mailing list