X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Document.cpp;h=4ff65b48c699da6b4d07e62764f267cd22fdebf1;hb=77b93142eb8ba33bfb9a42040c2fd8926ffea5c8;hp=b163538169cef52903f074f3939b2fbce540a132;hpb=2ea3b1b5f12ed40a12a0b653c7846f9d48daf3da;p=modules%2Fshaper.git diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index b16353816..4ff65b48c 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -105,6 +105,7 @@ bool Model_Document::load(const char* theFileName, DocumentPtr theThis) } TCollection_ExtendedString aPath(DocFileName(theFileName, myID)); PCDM_ReaderStatus aStatus = (PCDM_ReaderStatus) -1; + Handle(TDocStd_Document) aLoaded; try { aStatus = anApp->Open(aPath, aLoaded); } catch (Standard_Failure) { @@ -185,7 +186,13 @@ bool Model_Document::load(const char* theFileName, DocumentPtr theThis) aSession->setActiveDocument(Model_Session::get()->moduleDocument(), false); // this is done in Part result "activate", so no needed here. Causes not-blue active part. // aSession->setActiveDocument(anApp->getDocument(myID), true); - } + } else { // open failed, but new documnet was created to work with it: inform the model + static std::shared_ptr aMsg( + new Events_Message(Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED))); + Events_Loop::loop()->send(aMsg); + TDF_LabelList anEmpty; + myObjs->synchronizeFeatures(anEmpty, true, true); + } return !isError; }