/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
if (address >= 0) {
address = (address << 8) + (c & 0xFF); if (static_cast<MappingType>(CaseMappingValue[address].type) & nMappingType) {
MappingType type = static_cast<MappingType>(CaseMappingValue[address].type); if (type & MappingType::NotValue) { if (CaseMappingValue[address].value == 0) return getConditionalValue(str, pos, len, aLocale, nMappingType); else { for (int map = CaseMappingValue[address].value;
map < CaseMappingValue[address].value + MaxCaseMappingExtras; map++) { if (static_cast<MappingType>(CaseMappingExtra[map].type) & nMappingType) { if (static_cast<MappingType>(CaseMappingExtra[map].type) & MappingType::NotValue) return getConditionalValue(str, pos, len, aLocale, nMappingType); else return CaseMappingExtra[map];
}
} // Should not come here throw RuntimeException();
}
} else
{
dummy.map[0] = CaseMappingValue[address].value; return dummy;
}
}
}
// If the code point is not supported by our case mapping tables, // fallback to ICU functions. // TODO: this does not handle special case mapping as these require // using ustring.h APIs, which work on the whole string not character // by character. // TODO: what is the difference between ToLower and UpperToLower etc.?
sal_uInt32 value = c; switch (nMappingType)
{ case MappingType::ToLower: case MappingType::UpperToLower:
value = u_tolower(c); break; case MappingType::ToUpper: case MappingType::LowerToUpper:
value = u_toupper(c); break; case MappingType::ToTitle:
value = u_totitle(c); break; case MappingType::SimpleFolding: case MappingType::FullFolding:
value = u_foldCase(c, U_FOLD_CASE_DEFAULT); break; default: break;
}
if (moduleLoaded & TransliterationFlags::IGNORE_KANA) { if ((0x3040 <= c && c <= 0x3094) || (0x309d <= c && c <= 0x309f))
c += 0x60;
}
// composition: KA + voice-mark --> GA. see halfwidthToFullwidth.cxx for detail if (moduleLoaded & TransliterationFlags::IGNORE_WIDTH) { static oneToOneMapping& half2fullTable = widthfolding::gethalf2fullTable();
c = half2fullTable[c]; if (0x3040 <= c && c <= 0x30ff && idx < len &&
is_ja_voice_sound_mark(c, half2fullTable[*(str + idx)]))
idx++;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.