From 596e6a3ea8f8edea5fcf617be5cb53c43c115887 Mon Sep 17 00:00:00 2001
From: Sergey Luzyanin <Sergey.Luzyanin@onlyoffice.com>
Date: Mon, 13 Mar 2017 11:51:31 +0300
Subject: [PATCH] fix bug 34317; add InsertWatermark to export

---
 common/Drawings/Format/GroupShape.js | 2 +-
 word/apiBuilder.js                   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/Drawings/Format/GroupShape.js b/common/Drawings/Format/GroupShape.js
index d973147d4..557350981 100644
--- a/common/Drawings/Format/GroupShape.js
+++ b/common/Drawings/Format/GroupShape.js
@@ -243,7 +243,7 @@ AscCommon.extendClass(CGroupShape, AscFormat.CGraphicObjectBase);
         var aSplicedShape = this.spTree.splice(pos, 1);
         History.Add(new AscDFH.CChangesDrawingsContent(this,AscDFH.historyitem_GroupShapeRemoveFromSpTree, pos, aSplicedShape, false));
         this.handleUpdateSpTree();
-        return aSplicedShape;
+        return aSplicedShape[0];
     };
 
     CGroupShape.prototype.handleUpdateSpTree = function()
diff --git a/word/apiBuilder.js b/word/apiBuilder.js
index dad11d100..e6923283d 100644
--- a/word/apiBuilder.js
+++ b/word/apiBuilder.js
@@ -1489,7 +1489,7 @@
     // ApiParagraph
     //
     //------------------------------------------------------------------------------------------------------------------
-    
+
     /**
      * Insert watermark in the header of document
      * @param {?string} } [sText="Watermark"]
@@ -4466,6 +4466,7 @@
     ApiDocument.prototype["InsertContent"]           = ApiDocument.prototype.InsertContent;
 	ApiDocument.prototype["GetCommentsReport"]       = ApiDocument.prototype.GetCommentsReport;
 	ApiDocument.prototype["GetReviewReport"]         = ApiDocument.prototype.GetReviewReport;
+	ApiDocument.prototype["InsertWatermark"]         = ApiDocument.prototype.InsertWatermark;
 
     ApiParagraph.prototype["GetClassType"]           = ApiParagraph.prototype.GetClassType;
     ApiParagraph.prototype["AddText"]                = ApiParagraph.prototype.AddText;
-- 
2.30.9