Exemple #1
0
        protected void ProcessDrawnObject(HWPFDocument doc,
                                          CharacterRun characterRun, XmlElement block)
        {
            if (GetPicturesManager() == null)
            {
                return;
            }
            // TODO: support headers
            OfficeDrawing officeDrawing = doc.GetOfficeDrawingsMain().GetOfficeDrawingAt(characterRun.StartOffset);

            if (officeDrawing == null)
            {
                logger.Log(POILogger.WARN, "Characters #" + characterRun
                           + " references missing drawn object");
                return;
            }

            byte[] pictureData = officeDrawing.GetPictureData();
            if (pictureData == null)
            {
                // usual shape?
                return;
            }

            PictureType type = PictureType.FindMatchingType(pictureData);
            String      path = GetPicturesManager().SavePicture(pictureData, type,
                                                                "s" + characterRun.StartOffset + "." + type);

            ProcessDrawnObject(doc, characterRun, officeDrawing, path, block);
        }