[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/source
Caolán McNamara
caolanm at redhat.com
Thu Jul 23 23:34:32 PDT 2015
sw/source/filter/ww8/types.hxx | 1 +
sw/source/filter/ww8/ww8scan.cxx | 16 ++++------------
2 files changed, 5 insertions(+), 12 deletions(-)
New commits:
commit c39242b8bb8079d917f5d99b84add827dab4e9a9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jul 22 14:52:58 2015 +0100
read block in one swoop, rather than char by char
(cherry picked from commit a64c48f523d148cd4750bc9bd26d2349fc8a3c7c)
Change-Id: Ic879c096c6b3167a123cee352361da6c39e57de2
Reviewed-on: https://gerrit.libreoffice.org/17295
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/sw/source/filter/ww8/types.hxx b/sw/source/filter/ww8/types.hxx
index a57b99b..4d0a49a 100644
--- a/sw/source/filter/ww8/types.hxx
+++ b/sw/source/filter/ww8/types.hxx
@@ -28,6 +28,7 @@ namespace ww
{
public:
const sal_uInt8* data() const { return empty() ? 0 : &front(); }
+ sal_uInt8* data() { return empty() ? 0 : &front(); }
};
enum WordVersion {eWW1 = 1, eWW2 = 2, eWW6 = 6, eWW7 = 7, eWW8 = 8};
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8c3d979..5fae570 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -3897,12 +3897,8 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
if (pExtraArray)
{
ww::bytes extraData;
- for (sal_uInt16 j = 0; j < nExtraLen; ++j)
- {
- sal_uInt8 iTmp(0);
- rStrm.ReadUChar( iTmp );
- extraData.push_back(iTmp);
- }
+ extraData.resize(nExtraLen);
+ rStrm.Read(extraData.data(), nExtraLen);
pExtraArray->push_back(extraData);
}
else
@@ -3958,12 +3954,8 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
if (pExtraArray)
{
ww::bytes extraData;
- for (sal_uInt16 i=0;i < nExtraLen;++i)
- {
- sal_uInt8 iTmp(0);
- rStrm.ReadUChar( iTmp );
- extraData.push_back(iTmp);
- }
+ extraData.resize(nExtraLen);
+ rStrm.Read(extraData.data(), nExtraLen);
pExtraArray->push_back(extraData);
}
else
More information about the Libreoffice-commits
mailing list