+ suppress warnings when copying an object

This commit is contained in:
wmayer 2016-02-09 16:01:23 +01:00
parent fe8be472a9
commit 02578c4e6b
3 changed files with 6 additions and 0 deletions

View File

@ -2205,6 +2205,8 @@ DocumentObject* Document::copyObject(DocumentObject* obj, bool recursive)
objs.push_back(obj);
MergeDocuments md(this);
// if not copying recursively then suppress possible warnings
md.setVerbose(recursive);
if (recursive) {
objs = obj->getDocument()->getDependencyList(objs);
}

View File

@ -127,6 +127,7 @@ MergeDocuments::importObjects(std::istream& input)
this->nameMap.clear();
this->stream = new zipios::ZipInputStream(input);
XMLMergeReader reader(this->nameMap,"<memory>", *stream);
reader.setVerbose(isVerbose());
std::vector<App::DocumentObject*> objs = appdoc->importObjects(reader);
delete this->stream;

View File

@ -39,6 +39,8 @@ class AppExport MergeDocuments : public Base::Persistence
public:
MergeDocuments(App::Document* doc);
~MergeDocuments();
bool isVerbose() const { return verbose; }
void setVerbose(bool on) { verbose = on; }
unsigned int getMemSize (void) const;
std::vector<App::DocumentObject*> importObjects(std::istream&);
void importObject(const std::vector<App::DocumentObject*>& o, Base::XMLReader & r);
@ -50,6 +52,7 @@ public:
private:
bool guiup;
bool verbose;
zipios::ZipInputStream* stream;
App::Document* appdoc;
std::vector<App::DocumentObject*> objects;