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:
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;
|
||||
return (int)buf[offset];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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, ' ');
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue