! * \internal */
| 211 | * \internal |
| 212 | */ |
| 213 | QByteArray RichStringPrivate::idKey() const |
| 214 | { |
| 215 | if (_dirty) { |
| 216 | RichStringPrivate *rs = const_cast<RichStringPrivate *>(this); |
| 217 | QByteArray bytes; |
| 218 | if (fragmentTexts.size() == 1) { |
| 219 | bytes = fragmentTexts[0].toUtf8(); |
| 220 | } else { |
| 221 | //Generate a hash value base on QByteArray ? |
| 222 | bytes.append("@@QtXlsxRichString="); |
| 223 | for (int i=0; i<fragmentTexts.size(); ++i) { |
| 224 | bytes.append("@Text"); |
| 225 | bytes.append(fragmentTexts[i].toUtf8()); |
| 226 | bytes.append("@Format"); |
| 227 | if (fragmentFormats[i].hasFontData()) |
| 228 | bytes.append(fragmentFormats[i].fontKey()); |
| 229 | } |
| 230 | } |
| 231 | rs->_idKey = bytes; |
| 232 | rs->_dirty = false; |
| 233 | } |
| 234 | |
| 235 | return _idKey; |
| 236 | } |
| 237 | |
| 238 | /*! |
| 239 | Returns true if this string \a rs1 is equal to string \a rs2; |
no test coverage detected