~ubuntu-branches/debian/sid/libwps/sid

« back to all changes in this revision

Viewing changes to src/lib/libwps_internal.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Rene Engelhard
  • Date: 2011-05-04 22:02:18 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110504220218-va9i1xbysfsh3p94
Tags: 0.2.2-1
* New upstream release
* remove unused variables in WPS4.cpp and WPS8.cpp (closes: #625387)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include "libwps_internal.h"
23
23
#include <string>
 
24
#include <stdlib.h>
24
25
#include <locale.h>
25
26
 
26
27
uint8_t readU8(WPXInputStream *input)
58
59
        {
59
60
                std::bitset<8> b(s[i]); 
60
61
                r.append(b.to_string<char,std::char_traits<char>,std::allocator<char> >());
61
 
                char buf[10];
 
62
                char buf[20];
62
63
                sprintf(buf, "(%02u,0x%02x)  ", (uint8_t)s[i],(uint8_t)s[i]);
63
64
                r.append(buf);
64
65
        }
65
66
        return r;
66
67
}
67
68
#endif
 
69
 
 
70
/* Not troubling ourselves with extra dependencies */
 
71
/* TODO: extend */
 
72
 
 
73
static const struct _lange
 
74
{
 
75
        uint32_t id;
 
76
        const char *name;
 
77
} s_lang_table[] = {
 
78
        {0x409,"en-US"},
 
79
        {0x419,"ru-RU"}
 
80
};
 
81
 
 
82
std::string getLangFromLCID(uint32_t lcid)
 
83
{
 
84
        unsigned i = 0;
 
85
        
 
86
        for (i=0; i < sizeof(s_lang_table)/sizeof(s_lang_table[0]); i++)
 
87
        {
 
88
                if (s_lang_table[i].id == lcid)
 
89
                        return s_lang_table[i].name;
 
90
        }
 
91
        return "-none-";
 
92
}
 
93
 
 
94