1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 02:09:35 +02:00

native code cleanup: synchronization with ics branch

This commit is contained in:
Nikolay Pultsin 2013-02-01 15:38:23 +00:00
parent 4bbf4ba990
commit fcafd8120a
3 changed files with 7 additions and 13 deletions

View file

@ -53,6 +53,3 @@ int OleUtil::get1Byte(const char *buffer, unsigned int offset) {
const unsigned char *buf = (const unsigned char*)buffer;
return (int)buf[offset];
}

View file

@ -119,7 +119,7 @@ void TxtReaderCore::readDocument(ZLInputStream &stream) {
}
start = ptr + 1;
myReader.newLineHandler();
} else if (isspace((unsigned char)*ptr)) {
} else if (((*ptr) & 0x80) == 0 && std::isspace((unsigned char)*ptr)) {
if (*ptr != '\t') {
*ptr = ' ';
}
@ -162,7 +162,7 @@ void TxtReaderCoreUtf16::readDocument(ZLInputStream &stream) {
}
start = ptr + 2;
myReader.newLineHandler();
} else if (chr != 0 && isspace(chr)) {
} else if (chr != 0 && ((*ptr) & 0x80) == 0 && std::isspace(chr)) {
if (chr != '\t') {
setAscii(ptr, ' ');
}

View file

@ -24,7 +24,7 @@
class DummyEncodingConverter : public ZLEncodingConverter {
private:
DummyEncodingConverter(const std::string &name);
DummyEncodingConverter();
public:
~DummyEncodingConverter();
@ -33,9 +33,6 @@ public:
void reset();
bool fillTable(int *map);
private:
const std::string myName;
friend class DummyEncodingConverterProvider;
};
@ -43,18 +40,18 @@ bool DummyEncodingConverterProvider::providesConverter(const std::string &encodi
return ZLUnicodeUtil::toLower(encoding) == ZLEncodingConverter::ASCII;
}
shared_ptr<ZLEncodingConverter> DummyEncodingConverterProvider::createConverter(const std::string &name) {
return new DummyEncodingConverter(name);
shared_ptr<ZLEncodingConverter> DummyEncodingConverterProvider::createConverter(const std::string&) {
return new DummyEncodingConverter();
}
DummyEncodingConverter::DummyEncodingConverter(const std::string &name) : myName(name) {
DummyEncodingConverter::DummyEncodingConverter() {
}
DummyEncodingConverter::~DummyEncodingConverter() {
}
std::string DummyEncodingConverter::name() const {
return myName;
return ZLEncodingConverter::ASCII;
}
void DummyEncodingConverter::convert(std::string &dst, const char *srcStart, const char *srcEnd) {