App: Provide temporary document creation flag to Python App.loadDocument.
This commit is contained in:
@@ -597,8 +597,11 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
recomputeCopy = true;
|
||||
clearCopiedObjects();
|
||||
|
||||
auto tmpDoc = App::GetApplication().newDocument(
|
||||
"_tmp_binder", nullptr, false, true);
|
||||
App::DocumentCreateFlags createFlags;
|
||||
createFlags.createView = false;
|
||||
createFlags.temporary = true;
|
||||
|
||||
auto tmpDoc = App::GetApplication().newDocument("_tmp_binder", nullptr, createFlags);
|
||||
tmpDoc->setUndoMode(0);
|
||||
auto objs = tmpDoc->copyObject({ obj }, true, true);
|
||||
if (!objs.empty()) {
|
||||
@@ -618,21 +621,21 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
std::vector<App::Property*> props;
|
||||
getPropertyList(props);
|
||||
// lambda for copying values of copy-on-change properties
|
||||
const auto copyPropertyValues = [this, &recomputeCopy, &props, copied](const bool to_support) {
|
||||
const auto copyPropertyValues = [this, &recomputeCopy, &props, copied](const bool to_support) {
|
||||
for (auto prop : props) {
|
||||
if (!App::LinkBaseExtension::isCopyOnChangeProperty(this, *prop))
|
||||
continue;
|
||||
// we only copy read-only and output properties from support to binder
|
||||
if (!to_support && !(prop->testStatus(App::Property::Output) && prop->testStatus(App::Property::ReadOnly)))
|
||||
continue;
|
||||
// we only copy read-only and output properties from support to binder
|
||||
if (!to_support && !(prop->testStatus(App::Property::Output) && prop->testStatus(App::Property::ReadOnly)))
|
||||
continue;
|
||||
auto p = copied->getPropertyByName(prop->getName());
|
||||
if (p && p->getContainer() == copied
|
||||
&& p->getTypeId() == prop->getTypeId()
|
||||
&& !p->isSame(*prop))
|
||||
{
|
||||
recomputeCopy = true;
|
||||
auto* const from = to_support ? prop : p;
|
||||
auto* const to = to_support ? p : prop;
|
||||
auto* const from = to_support ? prop : p;
|
||||
auto* const to = to_support ? p : prop;
|
||||
|
||||
std::unique_ptr<App::Property> pcopy(from->Copy());
|
||||
to->Paste(*pcopy);
|
||||
|
||||
Reference in New Issue
Block a user