Exemple #1
0
        public GenericEffect(int iDepth, XmlNodeInformation ni, EffectDescriptor td, List<NodeInfo> additionalInfo)
            : base(iDepth)
        {
            m_effectDescriptor = td;
            m_contentType = td.ContentType;

            if (( (td.Reversible) && (ni.GetAttributeValue("val") == "0")) || !td.DefaultPolarity || !td.DeleteNode)
            {
                m_bBlockPolarity = false;
                m_bConsumePolarity = false;
            }

            if (!td.DeleteNodeContent)
            {
                m_bBlockPolarity = false;
                m_bBlocksAtStartDepth = true;
            }

            if (td.AttributeBlockType != AttributeBlockType.None)
            {
                m_attributeBlockType = td.AttributeBlockType;
            }

            this.m_blockType = td.BlockType;

            BuildAdditionalInfo(ni, td, additionalInfo);
        }
        public static ColourData ResolveColour(XmlNodeInformation nodeInfo)
        {
            string tintValue = nodeInfo.GetAttributeValue("tint");
            string colourValue = nodeInfo.GetAttributeValue("indexed");

            if (colourValue.Length > 0)
            {
                return GetColourData(colourValue, tintValue, ColourType.Indexed);
            }

            colourValue = nodeInfo.GetAttributeValue("rgb");
            if (colourValue.Length > 0)
            {
                return GetColourData(colourValue, tintValue, ColourType.RGB);
            }

            colourValue = nodeInfo.GetAttributeValue("theme");
            if (colourValue.Length > 0)
            {
                return GetColourData(colourValue, tintValue, ColourType.Theme);
            }

            colourValue = nodeInfo.GetAttributeValue("auto");
            return GetColourData(colourValue, tintValue, ColourType.Auto);
        }
        //override protected void HandleContent(XmlNodeInformation nodeInfo){}
        override protected void HandleEndElement(XmlNodeInformation nodeInfo)
        {
            if (m_iGraphicFrameDepth > 0 && nodeInfo.Depth <= m_iGraphicFrameDepth)
                m_iGraphicFrameDepth = 0;

            base.HandleEndElement(nodeInfo);
        }
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
            if (nodeInfo.Is(NamespaceId.a, NormalizeString("br")))
                m_stateMachine.AddSeparationSpace();
            else if (nodeInfo.Is(NamespaceId.a, NormalizeString("pPr")))
            {
                if(nodeInfo.GetAttributeValue("eaLnBrk") == "1")
                    m_stateMachine.AddSeparationSpace();
            }
            else if (m_listbGraphicFrameHasOLEObject != null &&
                nodeInfo.Is(NamespaceId.p, NormalizeString("graphicFrame")))
            {
                if (m_iGraphicFrameDepth == 0)
                {
                    m_iGraphicFrameDepth = nodeInfo.Depth;
                    ++m_iGFHOOIndex;
                    m_bPreviousForceBlockStructure = ForceBlockStructure;
                    ForceBlockStructure = ShouldBlockThisGraphicFrame();

                    if (nodeInfo.EmptyElement)
                    {
                        System.Diagnostics.Debug.Assert(false);
// as well as being illogical for the algorithm an empty element would also break the written XML. Unless...
                        ForceBlockStructure = false;
                    }
                }
            }

            base.HandleStartElement(nodeInfo);
        }
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
			m_bLastNodeWasStartATNode = false;
            if (nodeInfo.Is(NamespaceId.p, NormalizeString("sld")))
            {
                string sShow = nodeInfo.GetAttributeValue(NormalizeString("Show"));
                if(sShow == "0")
                    m_bHiddenSlide = true;
            }
            else if (nodeInfo.Is(NamespaceId.p, NormalizeString("sp")))
            {
                if (m_iPostItNoteCommentDepth == 0)
                {
                    m_iPostItNoteCommentDepth = nodeInfo.Depth;
                    m_listbShapeWithPostItNoteComment.Add(false);
                    ++m_iPostItNoteCommentIndex;
                }
            }
            else if (nodeInfo.Is(NamespaceId.p, NormalizeString("cNvPr")) &&
                     nodeInfo.GetAttributeValue("name").StartsWith("Comment "))
            {
                if (m_iPostItNoteCommentDepth > 0)
                    m_listbShapeWithPostItNoteComment[m_iPostItNoteCommentIndex] = true;
            }
			else if (nodeInfo.Is(NamespaceId.a, NormalizeString("t")))
			{
				m_bLastNodeWasStartATNode = true;
			}

            base.HandleStartElement(nodeInfo);
        }
Exemple #6
0
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
            m_bLastNodeWasStartATNode = false;
            if (m_listbShapeWithPostItNoteComment != null &&
                nodeInfo.Is(NamespaceId.p, NormalizeString("sp")))
            {
                if (m_iPostItNoteCommentDepth == 0)
                {
                    m_iPostItNoteCommentDepth = nodeInfo.Depth;
                    ++m_iPostItNoteCommentIndex;
                    m_bPreviousForceBlockStructure = ForceBlockStructure;
                    ForceBlockStructure = ShouldBlockThisShape();

                    if (nodeInfo.EmptyElement)
                    {
                        System.Diagnostics.Debug.Assert(false);
                        // as well as being illogical for the algorithm an empty element would also break the written XML. Unless...
                        ForceBlockStructure = false;
                    }
                }
            }
            else if (nodeInfo.Is(NamespaceId.a, NormalizeString("t")))
            {
                m_bLastNodeWasStartATNode = true;
            }

            base.HandleStartElement(nodeInfo);
        }
        override protected void HandleEndElement(XmlNodeInformation nodeInfo)
        {
            if (nodeInfo.FullName == "c")
            {
                if (m_inHiddenSheet)
                {
                    m_inHiddenSheet = false;
                    return;
                }
                else if (m_inCleanableFormulaCell)
                {
                    m_inCleanableFormulaCell = false;
                    return;
                }
            }
            else if (nodeInfo.FullName == "calcChain")
            {
                if (m_addSheetIndexToNextValidCellRef)
                {
                    return;
                }
            }

            if(!m_inCleanableFormulaCell)
                base.HandleEndElement(nodeInfo);
        }
        private void  ResolveCellState(XmlNodeInformation nodeInfo)
        {
            string sheetIndex = nodeInfo.GetAttributeValue("i");
            if (!string.IsNullOrEmpty(sheetIndex))
            {
                m_isFirstCellRefForSheet = true;
                m_lastSheetIndex = sheetIndex;

                foreach (string key in m_worksheetLookup.Keys)
                {
                    WorkSheet ws = m_worksheetLookup[key];
                    if (ws.m_sheetId == sheetIndex)
                    {
                        if (ws.m_state == "hidden")
                        {
                            if (nodeInfo.EmptyElement)
                            {
                                return;
                            }

                            m_inHiddenSheet = true;
                            return;
                        }
                        else
                            m_allFormulaAreHidden = false;

                        break;
                    }
                }
            }
        }
Exemple #9
0
 override protected void HandleEndElement(XmlNodeInformation nodeInfo)
 {
     if (nodeInfo.LocalName == "clrScheme")
     {
         m_inColourSchemes = false;
     }
 }
        override protected void HandleEndElement(XmlNodeInformation nodeInfo)
        {
			#region switch (nodeInfo.FullName)
            switch (nodeInfo.FullName)
            {
                case "font":
                    {
                        HandleFontEnd();
                        break;
                    }
                case "cellStyleXfs":
                    {
                        HandleCellStylesEnd();
                        break;
                    }
                case "cellXfs":
                    {
                        HandleCellFormatsEnd();
                        break;
                    }
                case "fill":
                    {
                        HandleFillEnd();
                        break;
                    }
            }
            #endregion

            base.HandleEndElement(nodeInfo);
        }
 private void HandleTableInfo(XmlNodeInformation nodeInfo)
 {
     List<AttribDetails> listOfAttribDetails = (List<AttribDetails>)nodeInfo.GetAttributes();
     foreach (AttribDetails aDetails in listOfAttribDetails)
     {
         if (aDetails.localName == "name")
         {
             m_tableData.Name = aDetails.value;
         }
         else if (aDetails.localName == "ref")
         {
             m_tableData.CellRefs = aDetails.value;
         }
         else if (aDetails.localName == "totalsRowShown" || 
                  aDetails.localName == "totalsRowCount")
         {
             m_tableData.SetShowTotalsRow(aDetails.value);
         }
         else if (aDetails.localName == "id")
         {
             m_tableData.Id = aDetails.value;
         }
         else if (aDetails.localName == "headerRowCount")
         {
             m_tableData.SetShowHeaderRow(aDetails.value);
         }
     }
 }
Exemple #12
0
        public virtual Effect ConstructEffect(int iDepth, XmlNodeInformation ni, EffectDescriptor ed)
        {
            var result = new GenericEffect(iDepth, ni, ed, GetAdditionalInfo());

            return result;

        }
 override protected void HandleStartElement(XmlNodeInformation nodeInfo)
 {
     if (nodeInfo.NodeName == "rcc")
     {
         //m_inRevisionText = true;
         m_currentrId = nodeInfo.GetAttributeValue("rId");
         m_currentsId = nodeInfo.GetAttributeValue("sId");
     }
     else if (nodeInfo.NodeName == "rm" && nodeInfo.EmptyElement)
     {
         base.HandleStartElement(nodeInfo);
         PostProcessMovedTrackChangeElement();
         return;
     }
     else if (nodeInfo.NodeName == "rrc")
     { 
         SetRowColRevisionTypeType(nodeInfo.GetAttributeValue("action"));
         if (nodeInfo.EmptyElement)
         {
             base.HandleStartElement(nodeInfo);
             PostProcessRowColTrackChangeElement();
             m_currentRevisionType = RowColRevisionType.none;
             return;
         }
     }
     base.HandleStartElement(nodeInfo);
 }
 private void HandleOleLinkEnd(XmlNodeInformation nodeInfo)
 {
     TextType links = GetTextType(ContentType.Links, false);
     if (links != null)
         HandleOleLinks(links);
     base.HandleEndElement(nodeInfo);
 }
 override protected void HandleContent(XmlNodeInformation nodeInfo)
 {
     if (m_inDefinedName)
     {
         HandleDefinedNameContent(nodeInfo.ContentValue);
     }
 }
        private void HandleDefinedName(XmlNodeInformation nodeInfo)
        {
            m_currentDefinedName = new DefinedName();
            m_currentDefinedName.m_name = nodeInfo.GetAttributeValue("name");
            m_currentDefinedName.m_state = nodeInfo.GetAttributeValue("hidden");
            m_currentDefinedName.m_localSheetId = nodeInfo.GetAttributeValue("localSheetId");
            if (!string.IsNullOrEmpty(m_currentDefinedName.m_localSheetId))//get this with some external links - so we will extract the sheet name later
            {
                int sheetId = Int32.Parse(m_currentDefinedName.m_localSheetId);

                int i = 0;
                foreach (KeyValuePair<string, WorkSheet> kvp in m_worksheets)
                {
                    if (i == sheetId)
                    {
                        m_currentDefinedName.m_sheetId = kvp.Value.m_sheetId;
                        break;
                    }
                    i++;
                }
            }
            else
            {
                m_currentDefinedName.m_sheetId = "";
            }
        }
        private void ProcessNode(XmlNodeInformation xni)
        {
            if (xni.NodeType == NodeType.content)
            {
                if (inInstruction && !passedInstruction)
                    instructionText.Append(xni.ContentValue);

                if (passedInstruction && !inInstruction)
                    resultText.Append(xni.ContentValue);

                return;
            }

            if (!xni.IsInNamespace(NamespaceId.w))
                return; // not interested

            if (xni.Is(NamespaceId.w, "instrText"))
            {
                inInstruction = xni.NodeType == NodeType.start;
            }

            if (xni.Is(NamespaceId.w, "fldChar"))
            {
                ProcessFldChar(xni.GetAttributeValue("fldCharType"));
                passedInstruction = true;
            }
        }
Exemple #18
0
        protected override void HandleStartElement(XmlNodeInformation nodeInfo)
        {
            if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("style")))
            {
                Style newStyle = new Style(nodeInfo);
                newStyle.StyleType = nodeInfo.GetAttributeValue(NormalizedVersion("type"));
                m_styles.Add(newStyle.Id, newStyle);
                m_activeStyle = newStyle;
                m_bSendAllToActiveStyle = false;
            }
            else if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("basedOn")))
            {
                m_activeStyle.BasedOn = nodeInfo.GetAttributeValue(NormalizedVersion("val"));
            }
            else if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("name")))
            {
                m_activeStyle.Name = nodeInfo.GetAttributeValue(NormalizedVersion("val"));
            }
            else if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("rPr")))
            {
                m_bSendAllToActiveStyle = true;
            }
            else if (m_bSendAllToActiveStyle)
            {
                if (m_activeStyle != null)
                {
                    nodeInfo.GetAttributes(); // force them to be loaded
                    m_activeStyle.AddProperty(nodeInfo);
                }

            }

        }
        override protected void HandleContent(XmlNodeInformation nodeInfo)
        {
            if (m_inHiddenSheet || m_inCleanableFormulaCell)
                return;

            base.HandleContent(nodeInfo);
        }
        public override Effect ConstructEffect(int iDepth, XmlNodeInformation ni, EffectDescriptor ed)
        {
            var result = base.ConstructEffect(iDepth, ni, ed);
            if (GetInstructionType() == "HYPERLINK")
                result.ContentType = ContentType.Hyperlink;

            return result;
        }
 override protected void HandleEndElement(XmlNodeInformation nodeInfo)
 {
     if (nodeInfo.FullName == "oleLink")
     {
         HandleOleLinkEnd(nodeInfo);
     }
     base.HandleEndElement(nodeInfo);
 }
 override protected void HandleEndElement(XmlNodeInformation nodeInfo)
 {
     if (nodeInfo.FullName == "table")
     {
         m_tableData.ResolveSpecialRowColumnRefs();
         m_processingDictionaries.AddToTableData(m_tableData);
     }
 }
Exemple #23
0
        private bool ShouldRemoveThisSlideFromSlideList(XmlNodeInformation nodeInfo)
        {
            if (m_dictRelatedSlideIsHidden == null)
                return false;

            string rId = nodeInfo.GetAttributeValue(NamespaceId.r, "id");
			bool shouldRemove;
			return (m_dictRelatedSlideIsHidden.TryGetValue(rId, out shouldRemove) && shouldRemove);
        }
        public List<TriggeringNodeDefinition> WhatDoesThisNodeTrigger(XmlNodeInformation NodeInfo, IEnumerable<XmlNodeInformation> lookaheadEnum, XmlFilterBase filter)
        {
            List<TriggeringNodeDefinition> subSet = LookupSubset(NodeInfo.NodeName);

            if (subSet == null)
                return null;

            return ExtractFiredTriggersFromTriggerList(NodeInfo, lookaheadEnum, subSet, filter);
        }
 override protected void HandleStartElement(XmlNodeInformation nodeInfo)
 {
     //if (nodeInfo.Is(NamespaceId.p, "sldId"))
     //{
     //    string srId = nodeInfo.GetAttributeValue(NamespaceId.r, "id");
     //    m_listSlideRelsInOrder.Add(srId);
     //}
     base.HandleStartElement(nodeInfo);
 }
        //override protected void HandleContent(XmlNodeInformation nodeInfo){}
        override protected void HandleEndElement(XmlNodeInformation nodeInfo)
        {
			m_bLastNodeWasStartATNode = false;

            if (m_iPostItNoteCommentDepth > 0 && nodeInfo.Depth <= m_iPostItNoteCommentDepth)
                m_iPostItNoteCommentDepth = 0;

            base.HandleEndElement(nodeInfo);
        }
 override protected void HandleStartElement(XmlNodeInformation nodeInfo)
 {
     if (nodeInfo.Is(NamespaceId.p, NormalizeString("sldId")))
     {
         string srId = nodeInfo.GetAttributeValue(NamespaceId.r, NormalizeString("id"));
         m_listSlideRelsInOrder.Add(srId);
     }
     base.HandleStartElement(nodeInfo);
 }
 protected override void HandleEndElement(XmlNodeInformation nodeInfo)
 {
     if ((!this.IsCleaning) || (nodeInfo.FullName != "Company"))
         base.HandleEndElement(nodeInfo);
     else
     {
         m_bSeenCompany = false;
         Write(nodeInfo);
     }
 }
 override protected void HandleStartElement(XmlNodeInformation nodeInfo)
 {
     m_bSeenCompany = false;
     if ((!this.IsCleaning) || (nodeInfo.FullName != "Company") || (m_triggers.WhatDoesThisNodeTrigger(nodeInfo, this) == null))
         base.HandleStartElement(nodeInfo);
     else
     {
         m_bSeenCompany = true;
         Write(nodeInfo);
     }
 }
 override protected void HandleContent(XmlNodeInformation nodeInfo)
 {
     if ((!this.IsCleaning) || !m_bSeenCompany)
         base.HandleContent(nodeInfo);
     else
     {
         XmlNodeInformation emptyNode = new XmlNodeInformation(string.Empty, nodeInfo.Depth, m_CommonNamespaces);
         m_stateMachine.OnContent(emptyNode.ContentValue);
         Write(emptyNode);
     }
 }