protected override void PreprocessSpecialParts(PartInfo rel, IPartFilter pf)
        {
            Stream inputData = rel.GetContent();
            pf.PreProcessPart(inputData);

            if (pf is PptxSlidePartFilter)
            {
                CollectPreProcessResultsForSlidePart(rel, pf as PptxSlidePartFilter);
            }
            else if (pf is PptxNotesMasterPartFilter)
            {
                CollectPreProcessResultsForNotesMasterPart(rel, pf as PptxNotesMasterPartFilter);
            }
            else if (pf is PptxHandoutsMasterPartFilter)
            {
                CollectPreProcessResultsForHandoutsMasterPart(rel, pf as PptxHandoutsMasterPartFilter);
            }
            else if (pf is PptxSlideMasterPartFilter)
            {
                CollectPreProcessResultsForSlideMasterPart(rel, pf as PptxSlideMasterPartFilter);
            }
            else if (pf is PptxSlideLayoutPartFilter)
            {
                CollectPreProcessResultsForSlideLayoutPart(rel, pf as PptxSlideLayoutPartFilter);
            }

            base.PreprocessSpecialParts(rel, pf);
        }
Example #2
0
 protected virtual void PreprocessSpecialParts(PartInfo rel, IPartFilter pf)
 {
     Stream inputData = rel.GetContent();
     if (pf is DiagramXmlPartFilter || pf is ThemeXmlPartFilter || pf is DiagramColoursXmlPartFilter)
     {
         pf.PreProcessPart(inputData);
     }
 }
Example #3
0
        private void ProcessPart(PartInfo rel, OPCPackage inputPackage, OPCPackage outputPackage, DocumentProcessingActions action)
        {
            if (rel.External)
            {
                ProcessExternalPart(rel, outputPackage, action);
                return;
            }

            if (m_ProcessedParts.ContainsKey(rel.AbsolutePath()))
            {
                if (outputPackage != null)
                    outputPackage.AddContent(rel, null, m_openXmlFormat);
                return;
            }

            m_ProcessedParts.Add(rel.AbsolutePath(), true);

            IPartFilter pf = GetPartFilter(rel, action);
            Stream inputData = rel.GetContent();
            RelatedPartProvider relPartProv = new RelatedPartProvider(inputPackage, rel);

            Stream modifiedStream = ProcessPartData(pf, inputData, relPartProv, action);

            if (modifiedStream != null)
                outputPackage.AddContent(rel, modifiedStream, m_openXmlFormat);

            if (action != DocumentProcessingActions.PassThrough && pf.IsBlockedFilter)
                return;

            foreach (PartInfo subRel in pf.SortRelatedParts(rel.GetRelatedObjects()))
            {
                ProcessPart(subRel, m_inputPackage, m_outputPackage, action);
            }
        }
 protected override void PreprocessSpecialParts(PartInfo rel, IPartFilter pf)
 {
     Stream inputData = rel.GetContent();
     if (pf is XlsxWorkbookXmlPartFilter ||
         pf is XlsxStyleXmlPartFilter ||
         pf is XlsxPreprocessTablePartFilter)
     {
         pf.PreProcessPart(inputData);
     }
     else if (pf is XlsxPreprocessWorksheetPartFilter)
     {
         foreach (PartInfo subRel in pf.SortRelatedParts(rel.GetRelatedObjects()))
         {
             if (subRel.Type == OpenXmlFactory.Get(m_openXmlFormat).OfficeDocumentRelationshipsTable)
             {
                 PreprocessPart(subRel, DocumentProcessingActions.Discover);
                 m_tablePreprocessed = true;
                 break;
             }
         }
         pf.PreProcessPart(inputData);
     }
     base.PreprocessSpecialParts(rel, pf);
 }