From 6453bd97d84f420ec66560aaf8dcacfd2db8a9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 19 Nov 2007 15:07:00 +0000 Subject: [PATCH] * src/ParagraphMetrics::computeRowSignature(): - Fix crc computing (wrt multibyte chars) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@21679 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ParagraphMetrics.cpp | 6 +++--- status.15x | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ParagraphMetrics.cpp b/src/ParagraphMetrics.cpp index e213da6851..15fb8e2f4d 100644 --- a/src/ParagraphMetrics.cpp +++ b/src/ParagraphMetrics.cpp @@ -94,15 +94,15 @@ size_type ParagraphMetrics::calculateRowSignature(Row const & row, boost::crc_32_type crc; for (pos_type i = row.pos(); i < row.endpos(); ++i) { char_type const b[] = { par_->getChar(i) }; - crc.process_bytes(b, 1); + crc.process_bytes(b, sizeof(char_type)); if (bparams.trackChanges) { Change change = par_->lookupChange(i); char_type const b[] = { change.type }; crc.process_bytes(b, 1); } } - char_type const b[] = { row.width(), row.ascent(), row.descent()}; - crc.process_bytes(b, 3); + int const b[] = { row.width(), row.ascent(), row.descent()}; + crc.process_bytes(b, 3 * sizeof(int)); return crc.checksum(); } diff --git a/status.15x b/status.15x index f1554779ae..b3fb651a6b 100644 --- a/status.15x +++ b/status.15x @@ -162,6 +162,8 @@ What's new - Disallow paragraph breaks in optional arguments (aka short title) (bug 4359). +- Fix calculation of row metrics with multibyte characters. + * DOCUMENTATION