OUStringBuffer aBuf(nSize);
aBuf.setLength(nSize); for (sal_Int32 i = 0, j = 0; i < rTxt.getLength() && j < nSize; ++i) if (!IsControlChar(rTxt[i]))
aBuf[j++] = rTxt[i];
rTxt = aBuf.makeStringAndClear();
DBG_ASSERT(rTxt.getLength() == nSize, "GetNumControlChars returned a different number of control characters than were actually removed.");
returntrue;
}
bool ReplaceControlChars(OUString &rTxt)
{ // non breaking field character staticconstchar CH_TXTATR_INWORD = static_cast<char>(0x02);
// the resulting string looks like this: // 1. non breaking field characters get removed // 2. remaining control characters will be replaced by ' '
if (GetNumControlChars(rTxt) == 0) returnfalse;
sal_Int32 n = rTxt.getLength();
OUStringBuffer aBuf(n);
aBuf.setLength(n);
sal_Int32 j = 0; for (sal_Int32 i = 0; i < n && j < n; ++i)
{ if (CH_TXTATR_INWORD == rTxt[i]) continue;
OUString GetThesaurusReplaceText(const OUString &rText)
{ // The strings for synonyms returned by the thesaurus sometimes have some // explanation text put in between '(' and ')' or a trailing '*'. // These parts should not be put in the ReplaceEdit Text that may get // inserted into the document. Thus we strip them from the text.
// remove any possible remaining ' ' that may confuse the thesaurus // when it gets called with the text return comphelper::string::strip(aText, ' ');
}
} // namespace linguistic
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.