From 3f924c0cbef509879bc3163f3e086f91e5b5a34a Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sun, 5 Aug 2018 07:42:13 +0800 Subject: [PATCH] App::Document: enable saving with binary brep --- src/App/Document.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index a823b9c291..14cc2ed69b 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1625,8 +1625,8 @@ bool Document::saveCopy(const char* file) // Save the document under the name it has been opened bool Document::save (void) { - int compression = App::GetApplication().GetParameterGroupByPath - ("User parameter:BaseApp/Preferences/Document")->GetInt("CompressionLevel",3); + auto hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Document"); + int compression = hGrp->GetInt("CompressionLevel",3); compression = Base::clamp(compression, Z_NO_COMPRESSION, Z_BEST_COMPRESSION); if (*(FileName.getValue()) != '\0') { @@ -1662,6 +1662,9 @@ bool Document::save (void) writer.setLevel(compression); writer.putNextEntry("Document.xml"); + if (hGrp->GetBool("SaveBinaryBrep", false)) + writer.setMode("BinaryBrep"); + Document::Save(writer); // Special handling for Gui document.