mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
native code cleanup: synchronization with ics branch
This commit is contained in:
parent
4bbf4ba990
commit
fcafd8120a
3 changed files with 7 additions and 13 deletions
|
@ -53,6 +53,3 @@ int OleUtil::get1Byte(const char *buffer, unsigned int offset) {
|
||||||
const unsigned char *buf = (const unsigned char*)buffer;
|
const unsigned char *buf = (const unsigned char*)buffer;
|
||||||
return (int)buf[offset];
|
return (int)buf[offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ void TxtReaderCore::readDocument(ZLInputStream &stream) {
|
||||||
}
|
}
|
||||||
start = ptr + 1;
|
start = ptr + 1;
|
||||||
myReader.newLineHandler();
|
myReader.newLineHandler();
|
||||||
} else if (isspace((unsigned char)*ptr)) {
|
} else if (((*ptr) & 0x80) == 0 && std::isspace((unsigned char)*ptr)) {
|
||||||
if (*ptr != '\t') {
|
if (*ptr != '\t') {
|
||||||
*ptr = ' ';
|
*ptr = ' ';
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ void TxtReaderCoreUtf16::readDocument(ZLInputStream &stream) {
|
||||||
}
|
}
|
||||||
start = ptr + 2;
|
start = ptr + 2;
|
||||||
myReader.newLineHandler();
|
myReader.newLineHandler();
|
||||||
} else if (chr != 0 && isspace(chr)) {
|
} else if (chr != 0 && ((*ptr) & 0x80) == 0 && std::isspace(chr)) {
|
||||||
if (chr != '\t') {
|
if (chr != '\t') {
|
||||||
setAscii(ptr, ' ');
|
setAscii(ptr, ' ');
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
class DummyEncodingConverter : public ZLEncodingConverter {
|
class DummyEncodingConverter : public ZLEncodingConverter {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DummyEncodingConverter(const std::string &name);
|
DummyEncodingConverter();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~DummyEncodingConverter();
|
~DummyEncodingConverter();
|
||||||
|
@ -33,9 +33,6 @@ public:
|
||||||
void reset();
|
void reset();
|
||||||
bool fillTable(int *map);
|
bool fillTable(int *map);
|
||||||
|
|
||||||
private:
|
|
||||||
const std::string myName;
|
|
||||||
|
|
||||||
friend class DummyEncodingConverterProvider;
|
friend class DummyEncodingConverterProvider;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,18 +40,18 @@ bool DummyEncodingConverterProvider::providesConverter(const std::string &encodi
|
||||||
return ZLUnicodeUtil::toLower(encoding) == ZLEncodingConverter::ASCII;
|
return ZLUnicodeUtil::toLower(encoding) == ZLEncodingConverter::ASCII;
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<ZLEncodingConverter> DummyEncodingConverterProvider::createConverter(const std::string &name) {
|
shared_ptr<ZLEncodingConverter> DummyEncodingConverterProvider::createConverter(const std::string&) {
|
||||||
return new DummyEncodingConverter(name);
|
return new DummyEncodingConverter();
|
||||||
}
|
}
|
||||||
|
|
||||||
DummyEncodingConverter::DummyEncodingConverter(const std::string &name) : myName(name) {
|
DummyEncodingConverter::DummyEncodingConverter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
DummyEncodingConverter::~DummyEncodingConverter() {
|
DummyEncodingConverter::~DummyEncodingConverter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string DummyEncodingConverter::name() const {
|
std::string DummyEncodingConverter::name() const {
|
||||||
return myName;
|
return ZLEncodingConverter::ASCII;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DummyEncodingConverter::convert(std::string &dst, const char *srcStart, const char *srcEnd) {
|
void DummyEncodingConverter::convert(std::string &dst, const char *srcStart, const char *srcEnd) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue