| 197 | } |
| 198 | |
| 199 | int CClipboardMimeData::AddFormat(UINT32 id, const char *name) |
| 200 | { |
| 201 | int nRet = 0; |
| 202 | |
| 203 | foreach(auto it, m_Formats) |
| 204 | { |
| 205 | if(it.id == id) |
| 206 | { |
| 207 | qWarning(log) << "Repeat format id:" << id; |
| 208 | return -1; |
| 209 | } |
| 210 | |
| 211 | if(name) |
| 212 | { |
| 213 | if(name == it.name) |
| 214 | { |
| 215 | qWarning(log) << "Repeat format name:" << name; |
| 216 | return -2; |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | _FORMAT f = {id, name, id}; |
| 222 | if(name) |
| 223 | { |
| 224 | f.localId = ClipboardRegisterFormat(m_pClipboard, name); |
| 225 | } |
| 226 | |
| 227 | m_Formats.push_back(f); |
| 228 | |
| 229 | return nRet; |
| 230 | } |
| 231 | |
| 232 | bool CClipboardMimeData::hasFormat(const QString &mimetype) const |
| 233 | { |
nothing calls this directly
no outgoing calls
no test coverage detected