Skip to content

Commit

Permalink
Add pending upstream fix to remove warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 5, 2021
1 parent 52b9c02 commit 50de3d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
11 changes: 7 additions & 4 deletions external/libdxfrw/intern/drw_textcodec.cpp
Expand Up @@ -57,8 +57,7 @@ void DRW_TextCodec::setCodePage(std::string *c, bool dxfFormat){
if (cp == "ANSI_874")
conv.reset( new DRW_ConvTable(DRW_Table874, CPLENGTHCOMMON) );
else if (cp == "ANSI_932")
conv.reset( new DRW_Conv932Table(DRW_Table932, DRW_LeadTable932,
DRW_DoubleTable932, CPLENGTH932) );
conv.reset( new DRW_Conv932Table() );
else if (cp == "ANSI_936")
conv.reset( new DRW_ConvDBCSTable(DRW_Table936, DRW_LeadTable936,
DRW_DoubleTable936, CPLENGTH936) );
Expand Down Expand Up @@ -345,6 +344,10 @@ std::string DRW_ConvDBCSTable::toUtf8(std::string *s) {
return res;
}

DRW_Conv932Table::DRW_Conv932Table()
:DRW_Converter(DRW_Table932, CPLENGTH932)
{}

std::string DRW_Conv932Table::fromUtf8(std::string *s) {
std::string result;
bool notFound;
Expand All @@ -369,8 +372,8 @@ std::string DRW_Conv932Table::fromUtf8(std::string *s) {
if (notFound && ( code<0xF8 || (code>0x390 && code<0x542) ||
(code>0x200F && code<0x9FA1) || code>0xF928 )) {
for (int k=0; k<cpLength; k++){
if(doubleTable[k][1] == code) {
int data = doubleTable[k][0];
if(DRW_DoubleTable932[k][1] == code) {
int data = DRW_DoubleTable932[k][0];
char d[3];
d[0] = data >> 8;
d[1] = data & 0xFF;
Expand Down
10 changes: 1 addition & 9 deletions external/libdxfrw/intern/drw_textcodec.h
Expand Up @@ -79,17 +79,9 @@ class DRW_ConvDBCSTable : public DRW_Converter {

class DRW_Conv932Table : public DRW_Converter {
public:
DRW_Conv932Table(const int *t, const int *lt, const int dt[][2], int l)
:DRW_Converter(t, l)
,leadTable{lt}
,doubleTable{dt}
{}

DRW_Conv932Table();
virtual std::string fromUtf8(std::string *s);
virtual std::string toUtf8(std::string *s);
private:
const int *leadTable;
const int (*doubleTable)[2];

};

Expand Down

0 comments on commit 50de3d7

Please sign in to comment.