| 379 | } |
| 380 | |
| 381 | std::string DocumentObject::getExportName(bool forced) const |
| 382 | { |
| 383 | if (!isAttachedToDocument()) { |
| 384 | return {}; |
| 385 | } |
| 386 | |
| 387 | if (!forced && !isExporting()) { |
| 388 | return *pcNameInDocument; |
| 389 | } |
| 390 | |
| 391 | // '@' is an invalid character for an internal name, which ensures the |
| 392 | // following returned name will be unique in any document. Saving external |
| 393 | // object like that shall only happens in Document::exportObjects(). We |
| 394 | // shall strip out this '@' and the following document name during restoring. |
| 395 | return *pcNameInDocument + '@' + getDocument()->getName(); |
| 396 | } |
| 397 | |
| 398 | bool DocumentObject::isAttachedToDocument() const |
| 399 | { |
no test coverage detected