Skip to content

Commit 72ffb2e

Browse files
author
Friedrich W. H. Kossebau
committed
Inline modifyAnnotations in OdfCanvas for simpler code
1 parent 55e856e commit 72ffb2e

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

webodf/lib/odf/OdfCanvas.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,23 +1046,14 @@
10461046
zoomHelper.setZoomableElement(sizer);
10471047
}
10481048

1049-
/**
1050-
* Wraps all annotations and renders them using the Annotation View Manager.
1051-
* @param {!Element} odffragment
1052-
* @return {undefined}
1053-
*/
1054-
function modifyAnnotations(odffragment) {
1055-
var annotationNodes = /**@type{!Array.<!odf.AnnotationElement>}*/(domUtils.getElementsByTagNameNS(odffragment, officens, 'annotation'));
1056-
1057-
annotationViewManager.addAnnotations(annotationNodes);
1058-
}
1059-
10601049
/**
10611050
* This should create an annotations pane if non existent, and then populate it with annotations
10621051
* If annotations are disallowed, it should remove the pane and all annotations
10631052
* @param {!odf.ODFDocumentElement} odfnode
10641053
*/
10651054
function handleAnnotations(odfnode) {
1055+
var annotationNodes;
1056+
10661057
if (allowAnnotations) {
10671058
if (!annotationsPane.parentNode) {
10681059
sizer.appendChild(annotationsPane);
@@ -1071,7 +1062,9 @@
10711062
annotationViewManager.forgetAnnotations();
10721063
}
10731064
annotationViewManager = new gui.AnnotationViewManager(self, odfnode.body, annotationsPane, showAnnotationRemoveButton);
1074-
modifyAnnotations(odfnode.body);
1065+
annotationNodes = /**@type{!Array.<!odf.AnnotationElement>}*/(domUtils.getElementsByTagNameNS(odfnode.body, officens, 'annotation'));
1066+
annotationViewManager.addAnnotations(annotationNodes);
1067+
10751068
fixContainerSize();
10761069
} else {
10771070
if (annotationsPane.parentNode) {

0 commit comments

Comments
 (0)