Exemplo n.º 1
0
// Analysis routine
void Crawler::analyse_image(const bfs::path& path) 
{
    std::ostringstream msg;
    msg << "Running image analysis on " << path;
	logger->message(msg.str(), traceLevel);

    // Construct and segment picture
    std::auto_ptr<ImageAnalyst> \
        analyst(new ImageAnalyst(bfs::absolute(path.filename()), 
            analyst_settings));
	analyst->segment();
	
	// Get centroids and dump to file if required 
	if (settings.output) {   
	    std::ostringstream msg; 
        msg << "Dumping segment centroids to " << settings.outputfile;
        logger->message(msg.str(), traceLevel);
        
        // Get segmentation window size
        blitz::TinyVector<int, 4> wsize = analyst->get_window_size();
        
        // Open dumpfile as stream, add path, altered path and image and 
        // window sizes  
        std::fstream dumpFileStream;
        dumpFileStream.open(settings.outputfile.string().c_str(), 
            std::fstream::out | std::fstream::app); 
        dumpFileStream << "{'original_file': '" << path.string()
                       << "', 'segmented_file': '" 
                       << path.stem() << "_segments" << bfs::extension(path) 
                       << "', 'image_size': (" 
                       << analyst->columns() << ", " << analyst->rows() 
                       << "), 'window_size': (" << wsize[0] << ", " 
                       << wsize[1] << ", " << wsize[2] << ", " 
                       << wsize[3] << "), ";
        
        // Get centroids, push to file
        std::vector<Index> centroids;
        analyst->get_centroids(centroids); 
        dumpFileStream << "'centroids': [";
        foreach(Index index, centroids)
            dumpFileStream << "(" << index[0] << "," << index[1] << "), ";
        dumpFileStream << "]}" << std::endl;  
        
        // Clean up
        dumpFileStream.flush();
        dumpFileStream.close();
    }
    
    // Exit
	logger->message("Done!", traceLevel);
}
Exemplo n.º 2
0
int
main(int argc, char* argv[])
{
    std::list<TEmployee*> mlist;

    TManager boss("Ezha", "Fukin", 'V', 1, 100); 
    mlist.push_back(&boss);

    TEmployee analyst("Yosya", "Gupkin", 'M', 2);
    mlist.push_back(&analyst);

    for (std::list<TEmployee*>::const_iterator it = mlist.begin();
            it != mlist.end(); ++it) {
        (*it)->Print();
        std::cout << std::endl;
    }

    return (0);
}
Exemplo n.º 3
0
void DocumentChecker::checkItems(ScribusDoc *currDoc, struct CheckerPrefs checkerSettings)
{
    QString chstr;
    errorCodes itemError;

    QList<PageItem*> allItems;
    uint masterItemsCount = currDoc->MasterItems.count();
    for (uint i = 0; i < masterItemsCount; ++i)
    {
        PageItem* currItem = currDoc->MasterItems.at(i);
        if (currItem->isGroup())
            allItems = currItem->getItemList();
        else
            allItems.append(currItem);
        for (int ii = 0; ii < allItems.count(); ii++)
        {
            currItem = allItems.at(ii);
            if (!currItem->printEnabled())
                continue;
            if (!(currDoc->layerPrintable(currItem->LayerID)) && (checkerSettings.ignoreOffLayers))
                continue;
            itemError.clear();
            if (((currItem->isAnnotation()) || (currItem->isBookmark)) && (checkerSettings.checkAnnotations))
                itemError.insert(PDFAnnotField, 0);
            if ((currItem->hasSoftShadow() || (currItem->fillTransparency() != 0.0) || (currItem->lineTransparency() != 0.0) || (currItem->fillBlendmode() != 0) || (currItem->lineBlendmode() != 0)) && (checkerSettings.checkTransparency))
                itemError.insert(Transparency, 0);
            if ((currItem->GrType != 0) && (checkerSettings.checkTransparency))
            {
                if (currItem->GrType == 9)
                {
                    if (currItem->GrCol1transp != 1.0)
                        itemError.insert(Transparency, 0);
                    else if (currItem->GrCol2transp != 1.0)
                        itemError.insert(Transparency, 0);
                    else if (currItem->GrCol3transp != 1.0)
                        itemError.insert(Transparency, 0);
                    else if (currItem->GrCol4transp != 1.0)
                        itemError.insert(Transparency, 0);
                }
                else if (currItem->GrType == 11)
                {
                    for (int grow = 0; grow < currItem->meshGradientArray.count(); grow++)
                    {
                        for (int gcol = 0; gcol < currItem->meshGradientArray[grow].count(); gcol++)
                        {
                            if (currItem->meshGradientArray[grow][gcol].transparency != 1.0)
                                itemError.insert(Transparency, 0);
                        }
                    }
                }
                else if (currItem->GrType == 12)
                {
                    for (int grow = 0; grow < currItem->meshGradientPatches.count(); grow++)
                    {
                        meshGradientPatch patch = currItem->meshGradientPatches[grow];
                        if (currItem->meshGradientPatches[grow].TL.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                        if (currItem->meshGradientPatches[grow].TR.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                        if (currItem->meshGradientPatches[grow].BR.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                        if (currItem->meshGradientPatches[grow].BL.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                    }
                }
                else
                {
                    QList<VColorStop*> colorStops = currItem->fill_gradient.colorStops();
                    for( int offset = 0 ; offset < colorStops.count() ; offset++ )
                    {
                        if (colorStops[offset]->opacity != 1.0)
                        {
                            itemError.insert(Transparency, 0);
                            break;
                        }
                    }
                }
            }
            if ((currItem->GrTypeStroke != 0) && (checkerSettings.checkTransparency))
            {
                QList<VColorStop*> colorStops = currItem->stroke_gradient.colorStops();
                for( int offset = 0 ; offset < colorStops.count() ; offset++ )
                {
                    if (colorStops[offset]->opacity != 1.0)
                    {
                        itemError.insert(Transparency, 0);
                        break;
                    }
                }
            }
            if ((currItem->GrMask > 0) && (checkerSettings.checkTransparency))
                itemError.insert(Transparency, 0);
            if ((currItem->OwnPage == -1) && (checkerSettings.checkOrphans))
                itemError.insert(ObjectNotOnPage, 0);
#ifdef HAVE_OSG
            if (currItem->asImageFrame() && !currItem->asOSGFrame())
#else
            if (currItem->asImageFrame())
#endif
            {

                // check image vs. frame sizes
                if (checkerSettings.checkPartFilledImageFrames && isPartFilledImageFrame(currItem))
                {
                    itemError.insert(PartFilledImageFrame, 0);
                }

                if ((!currItem->imageIsAvailable) && (checkerSettings.checkPictures))
                    itemError.insert(MissingImage, 0);
                else
                {
                    if (currItem->imageIsAvailable)
                    {
                        if (checkerSettings.checkTransparency && currItem->pixm.hasSmoothAlpha())
                            itemError.insert(Transparency, 0);
                    }
                    if  (((qRound(72.0 / currItem->imageXScale()) < checkerSettings.minResolution) || (qRound(72.0 / currItem->imageYScale()) < checkerSettings.minResolution))
                            && (currItem->isRaster) && (checkerSettings.checkResolution))
                        itemError.insert(ImageDPITooLow, 0);
                    if  (((qRound(72.0 / currItem->imageXScale()) > checkerSettings.maxResolution) || (qRound(72.0 / currItem->imageYScale()) > checkerSettings.maxResolution))
                            && (currItem->isRaster) && (checkerSettings.checkResolution))
                        itemError.insert(ImageDPITooHigh, 0);
                    QFileInfo fi = QFileInfo(currItem->Pfile);
                    QString ext = fi.suffix().toLower();
                    if (extensionIndicatesPDF(ext) && (checkerSettings.checkRasterPDF))
                        itemError.insert(PlacedPDF, 0);
                    if ((ext == "gif") && (checkerSettings.checkForGIF))
                        itemError.insert(ImageIsGIF, 0);

                    if (extensionIndicatesPDF(ext))
                    {
                        PDFAnalyzer analyst(currItem->Pfile);
                        QList<PDFColorSpace> usedColorSpaces;
                        bool hasTransparency = false;
                        QList<PDFFont> usedFonts;
                        int pageNum = qMin(qMax(1, currItem->pixm.imgInfo.actualPageNumber), currItem->pixm.imgInfo.numberOfPages) - 1;
                        QList<PDFImage> imgs;
                        bool succeeded = analyst.inspectPDF(pageNum, usedColorSpaces, hasTransparency, usedFonts, imgs);
                        if (succeeded)
                        {
                            if (checkerSettings.checkNotCMYKOrSpot || checkerSettings.checkDeviceColorsAndOutputIntent)
                            {
                                eColorSpaceType currPrintProfCS = ColorSpace_Unknown;
                                if (currDoc->HasCMS)
                                {
                                    ScColorProfile printerProf = currDoc->DocPrinterProf;
                                    currPrintProfCS = printerProf.colorSpace();
                                }
                                if (checkerSettings.checkNotCMYKOrSpot)
                                {
                                    for (int i=0; i<usedColorSpaces.size(); ++i)
                                    {
                                        if (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_ICCBased || usedColorSpaces[i] == CS_CalGray
                                                || usedColorSpaces[i] == CS_CalRGB || usedColorSpaces[i] == CS_Lab)
                                        {
                                            itemError.insert(NotCMYKOrSpot, 0);
                                            break;
                                        }
                                    }
                                }
                                if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
                                {
                                    for (int i=0; i<usedColorSpaces.size(); ++i)
                                    {
                                        if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
                                        {
                                            itemError.insert(DeviceColorsAndOutputIntent, 0);
                                            break;
                                        }
                                        else if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
                                        {
                                            itemError.insert(DeviceColorsAndOutputIntent, 0);
                                            break;
                                        }
                                    }
                                }
                            }
                            if (checkerSettings.checkTransparency && hasTransparency)
                                itemError.insert(Transparency, 0);
                            if (checkerSettings.checkFontNotEmbedded || checkerSettings.checkFontIsOpenType)
                            {
                                for (int i=0; i<usedFonts.size(); ++i)
                                {
                                    PDFFont currentFont = usedFonts[i];
                                    if (!currentFont.isEmbedded && checkerSettings.checkFontNotEmbedded)
                                        itemError.insert(FontNotEmbedded, 0);
                                    if (currentFont.isEmbedded && currentFont.isOpenType && checkerSettings.checkFontIsOpenType)
                                        itemError.insert(EmbeddedFontIsOpenType, 0);
                                }
                            }
                            if (checkerSettings.checkResolution)
                            {
                                for (int i=0; i<imgs.size(); ++i)
                                {
                                    if ((imgs[i].dpiX < checkerSettings.minResolution) || (imgs[i].dpiY < checkerSettings.minResolution))
                                        itemError.insert(ImageDPITooLow, 0);
                                    if ((imgs[i].dpiX > checkerSettings.maxResolution) || (imgs[i].dpiY > checkerSettings.maxResolution))
                                        itemError.insert(ImageDPITooHigh, 0);
                                }
                            }
                        }
                    }
                }
            }
            if ((currItem->asTextFrame()) || (currItem->asPathText()))
            {
                if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
                    itemError.insert(TextOverflow, 0);

                if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length()==0 || currItem->frameUnderflows()))
                    itemError.insert(EmptyTextFrame, 0);

                if (currItem->isAnnotation())
                {
                    ScFace::FontFormat fformat = currItem->itemText.defaultStyle().charStyle().font().format();
                    if (!(fformat == ScFace::SFNT || fformat == ScFace::TTCF))
                        itemError.insert(WrongFontInAnnotation, 0);
                }
                for (int e = currItem->firstInFrame(); e <= currItem->lastInFrame(); ++e)
                {
                    uint chr = currItem->itemText.text(e).unicode();
                    if ((chr == 13) || (chr == 32) || (chr == 29) || (chr == 28) || (chr == 27) || (chr == 26) || (chr == 25))
                        continue;
                    if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
                    {
                        chstr = currItem->itemText.text(e);
                        if (chstr.toUpper() != currItem->itemText.text(e))
                            chstr = chstr.toUpper();
                        chr = chstr[0].unicode();
                    }
                    if (chr == 9)
                    {
                        for (int t1 = 0; t1 < currItem->itemText.paragraphStyle(e).tabValues().count(); t1++)
                        {
                            if (currItem->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar.isNull())
                                continue;
                            chstr = QString(currItem->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar);
                            if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
                            {
                                if (chstr.toUpper() != QString(currItem->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar))
                                    chstr = chstr.toUpper();
                            }
                            chr = chstr[0].unicode();
                            if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
                                itemError.insert(MissingGlyph, e);
                        }
                        for (int t1 = 0; t1 < currItem->itemText.defaultStyle().tabValues().count(); t1++)
                        {
                            if (currItem->itemText.defaultStyle().tabValues()[t1].tabFillChar.isNull())
                                continue;
                            chstr = QString(currItem->itemText.defaultStyle().tabValues()[t1].tabFillChar);
                            if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
                            {
                                if (chstr.toUpper() != QString(currItem->itemText.defaultStyle().tabValues()[t1].tabFillChar))
                                    chstr = chstr.toUpper();
                            }
                            chr = chstr[0].unicode();
                            if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
                                itemError.insert(MissingGlyph, e);
                        }
                        continue;
                    }
                    if ((chr == 30) || (chr == 23))
                    {
                        for (int numco = 0x30; numco < 0x3A; ++numco)
                        {
                            if ((!currItem->itemText.charStyle(e).font().canRender(numco)) && (checkerSettings.checkGlyphs))
                                itemError.insert(MissingGlyph, e);
                        }
                        continue;
                    }
                    if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
                        itemError.insert(MissingGlyph, e);
                }
            }
            if (((currItem->fillColor() != CommonStrings::None) || (currItem->lineColor() != CommonStrings::None)) && (checkerSettings.checkNotCMYKOrSpot))
            {
                bool rgbUsed = false;
                if ((currItem->fillColor() != CommonStrings::None))
                {
                    ScColor tmpC = currDoc->PageColors[currItem->fillColor()];
                    if (tmpC.getColorModel() == colorModelRGB)
                        rgbUsed = true;
                }
                if ((currItem->lineColor() != CommonStrings::None))
                {
                    ScColor tmpC = currDoc->PageColors[currItem->lineColor()];
                    if (tmpC.getColorModel() == colorModelRGB)
                        rgbUsed = true;
                }
                if (rgbUsed)
                    itemError.insert(NotCMYKOrSpot, 0);
            }
            if (itemError.count() != 0)
                currDoc->masterItemErrors.insert(currItem, itemError);
        }
        allItems.clear();
    }
    allItems.clear();
    uint docItemsCount = currDoc->DocItems.count();
    for (uint i = 0; i < docItemsCount; ++i)
    {
        PageItem* currItem = currDoc->DocItems.at(i);
        if (currItem->isGroup())
            allItems = currItem->getItemList();
        else
            allItems.append(currItem);
        for (int ii = 0; ii < allItems.count(); ii++)
        {
            currItem = allItems.at(ii);
            if (!currItem->printEnabled())
                continue;
            if (!(currDoc->layerPrintable(currItem->LayerID)) && (checkerSettings.ignoreOffLayers))
                continue;
            itemError.clear();
            if ((currItem->hasSoftShadow() || (currItem->fillTransparency() != 0.0) || (currItem->lineTransparency() != 0.0) || (currItem->fillBlendmode() != 0) || (currItem->lineBlendmode() != 0)) && (checkerSettings.checkTransparency))
                itemError.insert(Transparency, 0);
            if ((currItem->GrType != 0) && (checkerSettings.checkTransparency))
            {
                if (currItem->GrType == 9)
                {
                    if (currItem->GrCol1transp != 1.0)
                        itemError.insert(Transparency, 0);
                    else if (currItem->GrCol2transp != 1.0)
                        itemError.insert(Transparency, 0);
                    else if (currItem->GrCol3transp != 1.0)
                        itemError.insert(Transparency, 0);
                    else if (currItem->GrCol4transp != 1.0)
                        itemError.insert(Transparency, 0);
                }
                else if (currItem->GrType == 11)
                {
                    for (int grow = 0; grow < currItem->meshGradientArray.count(); grow++)
                    {
                        for (int gcol = 0; gcol < currItem->meshGradientArray[grow].count(); gcol++)
                        {
                            if (currItem->meshGradientArray[grow][gcol].transparency != 1.0)
                                itemError.insert(Transparency, 0);
                        }
                    }
                }
                else if (currItem->GrType == 12)
                {
                    for (int grow = 0; grow < currItem->meshGradientPatches.count(); grow++)
                    {
                        meshGradientPatch patch = currItem->meshGradientPatches[grow];
                        if (currItem->meshGradientPatches[grow].TL.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                        if (currItem->meshGradientPatches[grow].TR.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                        if (currItem->meshGradientPatches[grow].BR.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                        if (currItem->meshGradientPatches[grow].BL.transparency != 1.0)
                            itemError.insert(Transparency, 0);
                    }
                }
                else
                {
                    QList<VColorStop*> colorStops = currItem->fill_gradient.colorStops();
                    for( int offset = 0 ; offset < colorStops.count() ; offset++ )
                    {
                        if (colorStops[offset]->opacity != 1.0)
                        {
                            itemError.insert(Transparency, 0);
                            break;
                        }
                    }
                }
            }
            if ((currItem->GrTypeStroke != 0) && (checkerSettings.checkTransparency))
            {
                QList<VColorStop*> colorStops = currItem->stroke_gradient.colorStops();
                for( int offset = 0 ; offset < colorStops.count() ; offset++ )
                {
                    if (colorStops[offset]->opacity != 1.0)
                    {
                        itemError.insert(Transparency, 0);
                        break;
                    }
                }
            }
            if ((currItem->GrMask > 0) && (checkerSettings.checkTransparency))
                itemError.insert(Transparency, 0);
            if (((currItem->isAnnotation()) || (currItem->isBookmark)) && (checkerSettings.checkAnnotations))
                itemError.insert(PDFAnnotField, 0);
            if ((currItem->OwnPage == -1) && (checkerSettings.checkOrphans))
                itemError.insert(ObjectNotOnPage, 0);
#ifdef HAVE_OSG
            if (currItem->asImageFrame() && !currItem->asOSGFrame())
#else
            if (currItem->asImageFrame())
#endif
            {

                // check image vs. frame sizes
                if (checkerSettings.checkPartFilledImageFrames && isPartFilledImageFrame(currItem))
                {
                    itemError.insert(PartFilledImageFrame, 0);
                }

                if ((!currItem->imageIsAvailable) && (checkerSettings.checkPictures))
                    itemError.insert(MissingImage, 0);
                else
                {
                    if (currItem->imageIsAvailable)
                    {
                        if (checkerSettings.checkTransparency && currItem->pixm.hasSmoothAlpha())
                            itemError.insert(Transparency, 0);
                    }
                    if  (((qRound(72.0 / currItem->imageXScale()) < checkerSettings.minResolution) || (qRound(72.0 / currItem->imageYScale()) < checkerSettings.minResolution))
                            && (currItem->isRaster) && (checkerSettings.checkResolution))
                        itemError.insert(ImageDPITooLow, 0);
                    if  (((qRound(72.0 / currItem->imageXScale()) > checkerSettings.maxResolution) || (qRound(72.0 / currItem->imageYScale()) > checkerSettings.maxResolution))
                            && (currItem->isRaster) && (checkerSettings.checkResolution))
                        itemError.insert(ImageDPITooHigh, 0);
                    QFileInfo fi = QFileInfo(currItem->Pfile);
                    QString ext = fi.suffix().toLower();
                    if (extensionIndicatesPDF(ext) && (checkerSettings.checkRasterPDF))
                        itemError.insert(PlacedPDF, 0);
                    if ((ext == "gif") && (checkerSettings.checkForGIF))
                        itemError.insert(ImageIsGIF, 0);

                    if (extensionIndicatesPDF(ext))
                    {
                        PDFAnalyzer analyst(currItem->Pfile);
                        QList<PDFColorSpace> usedColorSpaces;
                        bool hasTransparency = false;
                        QList<PDFFont> usedFonts;
                        int pageNum = qMin(qMax(1, currItem->pixm.imgInfo.actualPageNumber), currItem->pixm.imgInfo.numberOfPages) - 1;
                        QList<PDFImage> imgs;
                        bool succeeded = analyst.inspectPDF(pageNum, usedColorSpaces, hasTransparency, usedFonts, imgs);
                        if (succeeded)
                        {
                            if (checkerSettings.checkNotCMYKOrSpot || checkerSettings.checkDeviceColorsAndOutputIntent)
                            {
                                int currPrintProfCS = -1;
                                if (currDoc->HasCMS)
                                {
                                    ScColorProfile printerProf = currDoc->DocPrinterProf;
                                    currPrintProfCS = static_cast<int>(printerProf.colorSpace());
                                }
                                if (checkerSettings.checkNotCMYKOrSpot)
                                {
                                    for (int i=0; i<usedColorSpaces.size(); ++i)
                                    {
                                        if (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_ICCBased || usedColorSpaces[i] == CS_CalGray
                                                || usedColorSpaces[i] == CS_CalRGB || usedColorSpaces[i] == CS_Lab)
                                        {
                                            itemError.insert(NotCMYKOrSpot, 0);
                                            break;
                                        }
                                    }
                                }
                                if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
                                {
                                    for (int i=0; i<usedColorSpaces.size(); ++i)
                                    {
                                        if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
                                        {
                                            itemError.insert(DeviceColorsAndOutputIntent, 0);
                                            break;
                                        }
                                        else if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
                                        {
                                            itemError.insert(DeviceColorsAndOutputIntent, 0);
                                            break;
                                        }
                                    }
                                }
                            }
                            if (checkerSettings.checkTransparency && hasTransparency)
                                itemError.insert(Transparency, 0);
                            if (checkerSettings.checkFontNotEmbedded || checkerSettings.checkFontIsOpenType)
                            {
                                for (int i=0; i<usedFonts.size(); ++i)
                                {
                                    PDFFont currentFont = usedFonts[i];
                                    if (!currentFont.isEmbedded && checkerSettings.checkFontNotEmbedded)
                                        itemError.insert(FontNotEmbedded, 0);
                                    if (currentFont.isEmbedded && currentFont.isOpenType && checkerSettings.checkFontIsOpenType)
                                        itemError.insert(EmbeddedFontIsOpenType, 0);
                                }
                            }
                            if (checkerSettings.checkResolution)
                            {
                                for (int i=0; i<imgs.size(); ++i)
                                {
                                    if ((imgs[i].dpiX < checkerSettings.minResolution) || (imgs[i].dpiY < checkerSettings.minResolution))
                                        itemError.insert(ImageDPITooLow, 0);
                                    if ((imgs[i].dpiX > checkerSettings.maxResolution) || (imgs[i].dpiY > checkerSettings.maxResolution))
                                        itemError.insert(ImageDPITooHigh, 0);
                                }
                            }
                        }
                    }
                }
            }
            if ((currItem->asTextFrame()) || (currItem->asPathText()))
            {
                if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
                    itemError.insert(TextOverflow, 0);

                if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length()==0 || currItem->frameUnderflows()))
                    itemError.insert(EmptyTextFrame, 0);

                if (currItem->isAnnotation())
                {
                    ScFace::FontFormat fformat = currItem->itemText.defaultStyle().charStyle().font().format();
                    if (!(fformat == ScFace::SFNT || fformat == ScFace::TTCF))
                        itemError.insert(WrongFontInAnnotation, 0);
                }
                for (int e = currItem->firstInFrame(); e <= currItem->lastInFrame(); ++e)
                {
                    uint chr = currItem->itemText.text(e).unicode();
                    if ((chr == 13) || (chr == 32) || (chr == 29) || (chr == 28) || (chr == 27) || (chr == 26) || (chr == 25))
                        continue;
                    if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
                    {
                        chstr = currItem->itemText.text(e,1);
                        if (chstr.toUpper() != currItem->itemText.text(e,1))
                            chstr = chstr.toUpper();
                        chr = chstr[0].unicode();
                    }
                    if (chr == 9)
                    {
                        for (int t1 = 0; t1 < currItem->itemText.paragraphStyle(e).tabValues().count(); t1++)
                        {
                            if (currItem->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar.isNull())
                                continue;
                            chstr = QString(currItem->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar);
                            if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
                            {
                                if (chstr.toUpper() != QString(currItem->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar))
                                    chstr = chstr.toUpper();
                            }
                            chr = chstr[0].unicode();
                            if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
                                itemError.insert(MissingGlyph, e);
                        }
                        for (int t1 = 0; t1 < currItem->itemText.defaultStyle().tabValues().count(); t1++)
                        {
                            if (currItem->itemText.defaultStyle().tabValues()[t1].tabFillChar.isNull())
                                continue;
                            chstr = QString(currItem->itemText.defaultStyle().tabValues()[t1].tabFillChar);
                            if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
                            {
                                if (chstr.toUpper() != QString(currItem->itemText.defaultStyle().tabValues()[t1].tabFillChar))
                                    chstr = chstr.toUpper();
                            }
                            chr = chstr[0].unicode();
                            if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
                                itemError.insert(MissingGlyph, e);
                        }
                        continue;
                    }
                    if ((chr == 30) || (chr == 23))
                    {
                        for (uint numco = 0x30; numco < 0x3A; ++numco)
                        {
                            if ((!currItem->itemText.charStyle(e).font().canRender(numco)) && (checkerSettings.checkGlyphs))
                                itemError.insert(MissingGlyph, e);
                        }
                        continue;
                    }
                    if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
                        itemError.insert(MissingGlyph, e);
                }
            }
            if (((currItem->fillColor() != CommonStrings::None) || (currItem->lineColor() != CommonStrings::None)) && (checkerSettings.checkNotCMYKOrSpot))
            {
                bool rgbUsed = false;
                if ((currItem->fillColor() != CommonStrings::None))
                {
                    ScColor tmpC = currDoc->PageColors[currItem->fillColor()];
                    if (tmpC.getColorModel() == colorModelRGB)
                        rgbUsed = true;
                }
                if ((currItem->lineColor() != CommonStrings::None))
                {
                    ScColor tmpC = currDoc->PageColors[currItem->lineColor()];
                    if (tmpC.getColorModel() == colorModelRGB)
                        rgbUsed = true;
                }
                if (rgbUsed)
                    itemError.insert(NotCMYKOrSpot, 0);
            }
            if (itemError.count() != 0)
                currDoc->docItemErrors.insert(currItem, itemError);
        }
        allItems.clear();
    }
}