[PATCH libreoffice-4-0] CDR: Respect override of encoding information
Fridrich Strba (via Code Review)
gerrit at gerrit.libreoffice.org
Fri Mar 1 05:14:19 PST 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2487
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/87/2487/1
CDR: Respect override of encoding information
Change-Id: Ia2302ee8acdf638bf001f0a2663e09688c21c505
(cherry picked from commit 4b063c0e5b0e04986c98e7dd005a6223d8d9785a)
---
M libcdr/UnpackedTarball_cdr.mk
A libcdr/libcdr-0.0.11-encoding.patch
2 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/libcdr/UnpackedTarball_cdr.mk b/libcdr/UnpackedTarball_cdr.mk
index be1e7d7..b69221e 100644
--- a/libcdr/UnpackedTarball_cdr.mk
+++ b/libcdr/UnpackedTarball_cdr.mk
@@ -11,4 +11,10 @@
$(eval $(call gb_UnpackedTarball_set_tarball,cdr,$(CDR_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,cdr,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,cdr,\
+ libcdr/libcdr-0.0.1q-encoding.patch \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/libcdr/libcdr-0.0.11-encoding.patch b/libcdr/libcdr-0.0.11-encoding.patch
new file mode 100644
index 0000000..73fa58a
--- /dev/null
+++ b/libcdr/libcdr-0.0.11-encoding.patch
@@ -0,0 +1,36 @@
+--- a/src/lib/CDRParser.cpp
++++ b/src/lib/CDRParser.cpp
+@@ -2415,7 +2415,8 @@ void libcdr::CDRParser::readStlt(WPXInputStream *input, unsigned length)
+ }
+ unsigned numFonts = readU32(input);
+ CDR_DEBUG_MSG(("CDRParser::readStlt numFonts 0x%x\n", numFonts));
+- std::map<unsigned,unsigned> fontIds;
++ std::map<unsigned,unsigned short> fontIds;
++ std::map<unsigned,unsigned short> fontEncodings;
+ std::map<unsigned,double> fontSizes;
+ for (i=0; i<numFonts; ++i)
+ {
+@@ -2424,7 +2425,8 @@ void libcdr::CDRParser::readStlt(WPXInputStream *input, unsigned length)
+ input->seek(12, WPX_SEEK_CUR);
+ else
+ input->seek(20, WPX_SEEK_CUR);
+- fontIds[fontStyleId] = readU32(input);
++ fontIds[fontStyleId] = readU16(input);
++ fontEncodings[fontStyleId] = readU16(input);
+ input->seek(8, WPX_SEEK_CUR);
+ fontSizes[fontStyleId] = readCoordinate(input);
+ if (m_version < 1000)
+@@ -2578,9 +2580,12 @@ void libcdr::CDRParser::readStlt(WPXInputStream *input, unsigned length)
+ }
+ if (!fontRecordId)
+ continue;
+- std::map<unsigned, unsigned>::const_iterator iterFontId = fontIds.find(fontRecordId);
++ std::map<unsigned, unsigned short>::const_iterator iterFontId = fontIds.find(fontRecordId);
+ if (iterFontId != fontIds.end())
+ tmpCharStyle.m_fontId = iterFontId->second;
++ std::map<unsigned, unsigned short>::const_iterator iterCharSet = fontEncodings.find(fontRecordId);
++ if (iterCharSet != fontEncodings.end())
++ tmpCharStyle.m_charSet = iterCharSet->second;
+ std::map<unsigned, double>::const_iterator iterFontSize = fontSizes.find(fontRecordId);
+ if (iterFontSize != fontSizes.end())
+ tmpCharStyle.m_fontSize = iterFontSize->second;
--
To view, visit https://gerrit.libreoffice.org/2487
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2302ee8acdf638bf001f0a2663e09688c21c505
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Fridrich Strba <fridrich at documentfoundation.org>
More information about the LibreOffice
mailing list