[Libreoffice-commits] libcdr.git: src/lib
Fridrich Å trba
fridrich.strba at bluewin.ch
Wed Feb 27 06:52:21 PST 2013
src/lib/CDRParser.cpp | 41 ++++++-----------------------------------
1 file changed, 6 insertions(+), 35 deletions(-)
New commits:
commit 1a57685d19fe29762b2c56b80fb5e342d7185ee6
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date: Wed Feb 27 15:51:58 2013 +0100
Simplify a bit
diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index ec2045d..cfb035e 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -87,59 +87,30 @@ struct CDRStltRecord
static void processNameForEncoding(WPXString &name, unsigned short &encoding)
{
std::string fontName(name.cstr());
- size_t found;
+ size_t found = std::string::npos;
+
if ((found=fontName.rfind(" CE")) != std::string::npos)
- {
encoding = 0xee;
- fontName.replace(found, 3, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Cyrillic")) != std::string::npos)
- {
encoding = 0xcc;
- fontName.replace(found, 9, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Cyr")) != std::string::npos)
- {
encoding = 0xcc;
- fontName.replace(found, 4, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Baltic")) != std::string::npos)
- {
encoding = 0xba;
- fontName.replace(found, 7, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Greek")) != std::string::npos)
- {
encoding = 0xa1;
- fontName.replace(found, 6, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Tur")) != std::string::npos)
- {
encoding = 0xa2;
- fontName.replace(found, 4, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Hebrew")) != std::string::npos)
- {
encoding = 0xb1;
- fontName.replace(found, 7, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Arabic")) != std::string::npos)
- {
encoding = 0xb2;
- fontName.replace(found, 7, "");
- name = fontName.c_str();
- }
else if ((found=fontName.rfind(" Thai")) != std::string::npos)
- {
encoding = 0xde;
- fontName.replace(found, 5, "");
+
+ if (found != std::string::npos)
+ {
+ fontName.erase(found, std::string::npos);
name = fontName.c_str();
}
return;
More information about the Libreoffice-commits
mailing list