From b676fb8aa7cb6ec267d87f4356c10336916bc9b2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 16 Oct 2017 10:39:51 +0200 Subject: [PATCH] on project save go through all mdi views until one handles the GetCamera message --- src/Gui/Document.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 759ca50c3a..3519770198 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -915,15 +915,19 @@ void Document::SaveDocFile (Base::Writer &writer) const // set camera settings QString viewPos; - if (d->_pcAppWnd->sendHasMsgToActiveView("GetCamera")) { - const char* ppReturn=0; - d->_pcAppWnd->sendMsgToActiveView("GetCamera",&ppReturn); - - // remove the first line because it's a comment like '#Inventor V2.1 ascii' - QStringList lines = QString(QString::fromLatin1(ppReturn)).split(QLatin1String("\n")); - if (lines.size() > 1) { - lines.pop_front(); - viewPos = lines.join(QLatin1String(" ")); + std::list mdi = getMDIViews(); + for (std::list::iterator it = mdi.begin(); it != mdi.end(); ++it) { + if ((*it)->onHasMsg("GetCamera")) { + const char* ppReturn=0; + (*it)->onMsg("GetCamera",&ppReturn); + + // remove the first line because it's a comment like '#Inventor V2.1 ascii' + QStringList lines = QString(QString::fromLatin1(ppReturn)).split(QLatin1String("\n")); + if (lines.size() > 1) { + lines.pop_front(); + viewPos = lines.join(QLatin1String(" ")); + break; + } } }