void
UnhandledEngine::handleCharacter(UChar32 c) {
+ if (fHandled == nullptr) {
+ fHandled = new UnicodeSet();
if (fHandled == nullptr) {
- fHandled = new UnicodeSet();
- if (fHandled == nullptr) {
- return;
- }
- }
- if (!fHandled->contains(c)) {
- UErrorCode status = U_ZERO_ERROR;
- // Apply the entire script of the character.
- int32_t script = u_getIntPropertyValue(c, UCHAR_SCRIPT);
- fHandled->applyIntPropertyValue(UCHAR_SCRIPT, script, status);
+ return;
}
+ }
+ if (!fHandled->contains(c)) {
+ UErrorCode status = U_ZERO_ERROR;
+ // Apply the entire script of the character.
+ int32_t script = u_getIntPropertyValue(c, UCHAR_SCRIPT);
+ fHandled->applyIntPropertyValue(UCHAR_SCRIPT, script, status);
+ }
}
/*
* a particular kind of break.</p>
*
* @param c A character which begins a run that the engine might handle
- * @param breakType The type of text break which the caller wants to determine
* @return TRUE if this engine handles the particular character and break
* type.
*/
*/
virtual void setCharacters( const UnicodeSet &set );
- /**
- * <p>Set the break types handled by this engine.</p>
- *
- * @param breakTypes A bitmap of types handled by the engine.
- */
-// virtual void setBreakTypes( uint32_t breakTypes );
-
/**
* <p>Divide up a range of known dictionary characters handled by this break engine.</p>
*