Returns the Document that is currently open in the editor UI. May be null.
@return {?Document}
344302
function getCurrentDocument() {
        var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE);

        if (file) {
            return getOpenDocumentForPath(file.fullPath);
        }

        return null;
    }
109524
function()
		{
			var $ = this.$;

			try
			{
				// In IE, with custom document.domain, it may happen that
				// the iframe is not yet available, resulting in "Access
				// Denied" for the following property access.
				$.contentWindow.document;
			}
			catch ( e )
			{
				// Trick to solve this issue, forcing the iframe to get ready
				// by simply setting its "src" property.
				$.src = $.src;

				// In IE6 though, the above is not enough, so we must pause the
				// execution for a while, giving it time to think.
				if ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 )
				{
					window.showModalDialog(
						'javascript:document.write("' +
							'<script>' +
								'window.setTimeout(' +
									'function(){window.close();}' +
									',50);' +
							'</script>")' );
				}
			}

			return $ && new CKEDITOR.dom.document( $.contentWindow.document );
		}
1115937
function getOpenMenuContainer(el) {
    var res;
    el = (el instanceof angular.element) ? el[0] : el;
    inject(function($document) {
      var container = $document[0].querySelector('.md-open-menu-container');
      if (container && container.style.display == 'none') {
        res = [];
      } else {
        res = angular.element(container);
      }
    });
    return res;
  }
250614
public Document doc() {
        if (doc != null) {
            return doc;
        }
        this.doc = Jsoup.parse(html(), url());
        return doc;
//        try {
//            this.doc = Jsoup.parse(html(), url());
//            return doc;
//        } catch (Exception ex) {
//            LOG.info("Exception", ex);
//            return null;
//        }
    }
91208
function() {
			if (iBaseFontSize == null) {
				var oDocumentRootElement = document.documentElement;
				if (oDocumentRootElement) {
					iBaseFontSize = parseInt(window.getComputedStyle(oDocumentRootElement).fontSize);
				}
			}

			return iBaseFontSize == null ? 16 : iBaseFontSize;
		}
583184
function () {
            var document = this._document;
            var cfg = this.conf;
            var div = document.createElement("div");
            div.style.cssText = "position:absolute;top:-15000px;left:-15000px;";
            document.body.appendChild(div);
            var html = [
                 "<div ",
                 ariaUtilsDelegate.getMarkup(this._delegateId),
                 ' style="position:absolute;top:-15000px;left:-15000px;visibility:hidden;display:block;"'
            ];

            if (cfg.waiAria) {
                var role = cfg.role;
                if (role) {
                    role = ariaUtilsString.escapeForHTML(role, {attr: true});
                    html.push(' role="' + role + '"');
                }

                var labelId = cfg.labelId;
                if (labelId) {
                    labelId = ariaUtilsString.escapeForHTML(labelId, {attr: true});
                    html.push(' aria-labelledby="' + labelId + '"');
                }
            }

            html.push("></div>");
            div.innerHTML = html.join('');

            var domElement = div.firstChild;
            document.body.removeChild(div);
            return this.popupContainer.getContainerElt().appendChild(domElement);
        }
1342378
public static Object getCurrentRowKey() {
		UIContext uic = UIContextHolder.getCurrent();
		if (uic instanceof SubUIContext) {
			return ((SubUIContext) uic).getRowId();
		}
		return null;
	}
21640
function openNewFile() {
                var fileOpenPromise;

                if (FileViewController.getFileSelectionFocus() === FileViewController.PROJECT_MANAGER) {
                    // If selection is in the tree, leave workingset unchanged - even if orig file is in the list
                    fileOpenPromise = FileViewController
                        .openAndSelectDocument(path, FileViewController.PROJECT_MANAGER);
                } else {
                    // If selection is in workingset, replace orig item in place with the new file
                    var info = MainViewManager.findInAllWorkingSets(doc.file.fullPath).shift();

                    // Remove old file from workingset; no redraw yet since there's a pause before the new file is opened
                    MainViewManager._removeView(info.paneId, doc.file, true);

                    // Add new file to workingset, and ensure we now redraw (even if index hasn't changed)
                    fileOpenPromise = handleFileAddToWorkingSetAndOpen({fullPath: path, paneId: info.paneId, index: info.index, forceRedraw: true});
                }

                // always configure editor after file is opened
                fileOpenPromise.always(function () {
                    _configureEditorAndResolve();
                });
            }
869593
@Nullable
  private XTextDocument getCurrentDocument(XComponentContext xContext) {
    try {
      XComponent curComp = OfficeTools.getCurrentComponent(xContext);
      if (curComp == null) {
        return null;
      }
      else return UnoRuntime.queryInterface(XTextDocument.class, curComp);
    } catch (Throwable t) {
      MessageHandler.printException(t);     // all Exceptions thrown by UnoRuntime.queryInterface are caught
      return null;           // Return null as method failed
    }
  }
1265436
function editorUpdate() {
    if (editor.binding) {
      if ('hold' === generator.clientUpdateFragmentText(editor.binding, editor.$edit.val())) {
        editor.holding = true;
      }
    }
  }
1121948
function getElementById(id) {
		var el = null;
		try {
			el = doc.getElementById(id);
		}
		catch (e) {}
		return el;
	}
55744
function()
	{
		var doc = null;
		
		if (document.implementation && document.implementation.createDocument)
		{
			doc = document.implementation.createDocument('', '', null);
		}
		else if (window.ActiveXObject)
		{
			doc = new ActiveXObject('Microsoft.XMLDOM');
	 	}
	 	
	 	return doc;
	}
531238
@InterfaceAudience.Public
    public String getDocumentRevisionId() {
        // Get the revision id from either the embedded document contents,
        // or the '_rev' or 'rev' value key:
        String rev = null;
        if (documentRevision != null)
            rev = documentRevision.getRevID();
        if (rev == null) {
            if (value instanceof Map) {
                Map<String, Object> mapValue = (Map<String, Object>) value;
                rev = (String) mapValue.get("_rev");
                if (rev == null) {
                    rev = (String) mapValue.get("rev");
                }
            }
        }
        return rev;
    }
958740
function () {
        var self = this, doc = self.getDoc();

        if (!self.hidden) {
          // Fixed bug where IE has a blinking cursor left from the editor
          if (ie && doc && !self.inline) {
            doc.execCommand('SelectAll');
          }

          // We must save before we hide so Safari doesn't crash
          self.save();

          if (self.inline) {
            self.getBody().contentEditable = false;

            // Make sure the editor gets blurred
            if (self == self.editorManager.focusedEditor) {
              self.editorManager.focusedEditor = null;
            }
          } else {
            DOM.hide(self.getContainer());
            DOM.setStyle(self.id, 'display', self.orgDisplay);
          }

          self.hidden = true;
          self.fire('hide');
        }
      }
922342
function(_document){
                var _osc = _document.onselectionchange;
                if (_osc !== undefined) {
                    try {
                        _document.onselectionchange = 0;
                        return _document.onselectionchange === null;
                    } catch (e) {
                    } finally {
                        _document.onselectionchange = _osc;
                    }
                }
                return false;
            }
1162517
@Nullable
  public Document getDocument (final int nDocID) throws IOException
  {
    _checkClosing ();

    if (LOGGER.isDebugEnabled ())
      LOGGER.debug ("getDocument(" + nDocID + ")");

    final IndexReader aReader = getReader ();
    if (aReader == null)
      return null;
    return aReader.document (nDocID);
  }
507811
function () {
        var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect();
        var width, lineHeight, innerPadding = 0, inputElm = elm.firstChild;

        if (self.statusLevel() && self.statusLevel() !== 'none') {
          innerPadding = (
            parseInt(DomUtils.getRuntimeStyle(inputElm, 'padding-right'), 10) -
            parseInt(DomUtils.getRuntimeStyle(inputElm, 'padding-left'), 10)
          );
        }

        if (openElm) {
          width = rect.w - DomUtils.getSize(openElm).width - 10;
        } else {
          width = rect.w - 10;
        }

        // Detect old IE 7+8 add lineHeight to align caret vertically in the middle
        var doc = document;
        if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
          lineHeight = (self.layoutRect().h - 2) + 'px';
        }

        $(inputElm).css({
          width: width - innerPadding,
          lineHeight: lineHeight
        });

        self._super();

        return self;
      }