Ejemplo n.º 1
0
        private XSSFAnchor GetAnchorFromParent(XmlNode obj)
        {
            XSSFAnchor anchor     = null;
            XmlNode    parentNode = obj.ParentNode;
            XmlNode    fromNode   = parentNode.SelectSingleNode("xdr:from", POIXMLDocumentPart.NamespaceManager);

            if (fromNode == null)
            {
                throw new InvalidDataException("xdr:from node is missing");
            }
            CT_Marker ctFrom = CT_Marker.Parse(fromNode, POIXMLDocumentPart.NamespaceManager);
            XmlNode   toNode = parentNode.SelectSingleNode("xdr:to", POIXMLDocumentPart.NamespaceManager);
            CT_Marker ctTo   = null;

            if (toNode != null)
            {
                ctTo = CT_Marker.Parse(toNode, POIXMLDocumentPart.NamespaceManager);
            }
            anchor = new XSSFClientAnchor(ctFrom, ctTo);
            return(anchor);
        }
Ejemplo n.º 2
0
        private XSSFAnchor GetAnchorFromParent(object obj)
        {
            XSSFAnchor anchor = null;

            //XmlObject parentXbean = null;
            //XmlCursor cursor = obj.newCursor();
            //if (cursor.toParent()) parentXbean = cursor.getObject();
            //cursor.dispose();
            //if (parentXbean != null)
            //{
            //    if (parentXbean is CT_TwoCellAnchor)
            //    {
            //        CT_TwoCellAnchor ct = (CT_TwoCellAnchor)parentXbean;
            //        anchor = new XSSFClientAnchor(ct.getFrom(), ct.getTo());
            //    }
            //    else if (parentXbean is CT_OneCellAnchor)
            //    {
            //        CT_OneCellAnchor ct = (CT_OneCellAnchor)parentXbean;
            //        anchor = new XSSFClientAnchor(ct.getFrom(), CT_Marker.Factory.newInstance());
            //    }
            //}
            return(anchor);
        }