App::Document: enable saving with binary brep

This commit is contained in:
Zheng, Lei
2018-08-05 07:42:13 +08:00
committed by wmayer
parent 94940c8471
commit 3f924c0cbe

View File

@@ -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<int>(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.