IE_Imp_MSWrite::IE_Imp_MSWrite (PD_Document *pDocument) : IE_Imp(pDocument), mDefaultCodepage("CP1252"), hasHeader(false), hasFooter(false), wri_fonts(0), wri_fonts_count(0), pic_nr(0), lf(false) { setProps(AP_Args::m_impProps); const std::string &propCP = getProperty("mswrite-codepage"); if (!propCP.empty()) mDefaultCodepage = propCP; UT_DEBUGMSG(("Codepage: %s\n", mDefaultCodepage.c_str())); wri_file_header = static_cast<wri_struct*>(malloc(sizeof(WRI_FILE_HEADER))); memcpy(wri_file_header, WRI_FILE_HEADER, sizeof(WRI_FILE_HEADER)); wri_picture_header = static_cast<wri_struct*>(malloc(sizeof(WRI_PICTURE_HEADER))); memcpy(wri_picture_header, WRI_PICTURE_HEADER, sizeof(WRI_PICTURE_HEADER)); wri_ole_header = static_cast<wri_struct*>(malloc(sizeof(WRI_OLE_HEADER))); memcpy(wri_ole_header, WRI_OLE_HEADER, sizeof(WRI_OLE_HEADER)); }
// Create overview for image: void ossimImageUtil::createOverview(ossimRefPtr<ossimImageHandler>& ih, bool& consumedHistogramOptions, bool& /* consumedCmmOptions */) { static const char M[] = "ossimImageUtil::createOverview #1"; if(traceDebug()) { ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n"; } if ( ih.valid() ) { // Get the entry list: std::vector<ossim_uint32> entryList; ih->getEntryList(entryList); bool useEntryIndex = false; if ( entryList.size() ) { if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true; } // Create the overview builder: ossimString overviewType; getOverviewType( overviewType.string() ); ossimRefPtr<ossimOverviewBuilderBase> ob = ossimOverviewBuilderFactoryRegistry::instance()->createBuilder(overviewType); if ( ob.valid() ) { // Set up any overview builder options that don't involve histograms. ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>( ob.get() ); if ( pi ) setProps(pi); ossim_uint32 stopDimension = getOverviewStopDimension(); if ( stopDimension ) ob->setOverviewStopDimension(stopDimension); ob->setScanForMinMax( scanForMinMax() ); ob->setScanForMinMaxNull( scanForMinMaxNull() ); for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx) { createOverview(ih, ob, entryList[idx], useEntryIndex, consumedHistogramOptions); } } else { ossimNotify(ossimNotifyLevel_WARN) << "ERROR:\nCould not create builder for: "<< overviewType << std::endl; outputOverviewWriterTypes(); } } if(traceDebug()) { ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n"; } }
static void U_CALLCONV unicodeDataLineFn(void *context, char *fields[][2], int32_t fieldCount, UErrorCode *pErrorCode) { Props p; char *end; static UChar32 prevCode=0; UChar32 value; int32_t i; /* reset the properties */ uprv_memset(&p, 0, sizeof(Props)); /* get the character code, field 0 */ p.code=(UChar32)uprv_strtoul(fields[0][0], &end, 16); if(end<=fields[0][0] || end!=fields[0][1]) { fprintf(stderr, "gencase: syntax error in field 0 at %s\n", fields[0][0]); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } /* get general category, field 2 */ i=getTokenIndex(genCategoryNames, U_CHAR_CATEGORY_COUNT, fields[2][0]); if(i>=0) { p.gc=(uint8_t)i; } else { fprintf(stderr, "gencase: unknown general category \"%s\" at code 0x%lx\n", fields[2][0], (unsigned long)p.code); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } /* get canonical combining class, field 3 */ value=(UChar32)uprv_strtoul(fields[3][0], &end, 10); if(end<=fields[3][0] || end!=fields[3][1] || value>0xff) { fprintf(stderr, "gencase: syntax error in field 3 at %s\n", fields[0][0]); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } p.cc=(uint8_t)value; /* get uppercase mapping, field 12 */ value=(UChar32)uprv_strtoul(fields[12][0], &end, 16); if(end!=fields[12][1]) { fprintf(stderr, "gencase: syntax error in field 12 at code 0x%lx\n", (unsigned long)p.code); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } if(value!=0 && value!=p.code) { p.upperCase=value; uset_add(caseSensitive, p.code); uset_add(caseSensitive, value); } /* get lowercase value, field 13 */ value=(UChar32)uprv_strtoul(fields[13][0], &end, 16); if(end!=fields[13][1]) { fprintf(stderr, "gencase: syntax error in field 13 at code 0x%lx\n", (unsigned long)p.code); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } if(value!=0 && value!=p.code) { p.lowerCase=value; uset_add(caseSensitive, p.code); uset_add(caseSensitive, value); } /* get titlecase value, field 14 */ value=(UChar32)uprv_strtoul(fields[14][0], &end, 16); if(end!=fields[14][1]) { fprintf(stderr, "gencase: syntax error in field 14 at code 0x%lx\n", (unsigned long)p.code); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } if(value!=0 && value!=p.code) { p.titleCase=value; uset_add(caseSensitive, p.code); uset_add(caseSensitive, value); } /* set additional properties from previously parsed files */ if(specialCasingIndex<specialCasingCount && p.code==specialCasings[specialCasingIndex].code) { p.specialCasing=specialCasings+specialCasingIndex++; } else { p.specialCasing=NULL; } if(caseFoldingIndex<caseFoldingCount && p.code==caseFoldings[caseFoldingIndex].code) { p.caseFolding=caseFoldings+caseFoldingIndex++; /* ignore "Common" mappings (simple==full) that map to the same code point as the regular lowercase mapping */ if( p.caseFolding->status=='C' && p.caseFolding->simple==p.lowerCase ) { p.caseFolding=NULL; } } else { p.caseFolding=NULL; } /* check for non-character code points */ if((p.code&0xfffe)==0xfffe || (uint32_t)(p.code-0xfdd0)<0x20) { fprintf(stderr, "gencase: error - properties for non-character code point U+%04lx\n", (unsigned long)p.code); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } /* check that the code points (p.code) are in ascending order */ if(p.code<=prevCode && p.code>0) { fprintf(stderr, "gencase: error - UnicodeData entries out of order, U+%04lx after U+%04lx\n", (unsigned long)p.code, (unsigned long)prevCode); *pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR); } /* properties for a single code point */ setProps(&p); prevCode=p.code; }
//--- // This method is called back by the ossimFileWalker::walk method for each file it finds that it // deems can be processed. //--- void ossimImageUtil::processFile(const ossimFilename& file) { static const char M[] = "ossimImageUtil::processFile"; if(traceDebug()) { ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n" << "file: " << file << "\n"; } bool processFileFlag = true; if ( !getOverrideFilteredImagesFlag() ) { processFileFlag = !isFiltered( file ); } if ( processFileFlag ) { ossimNotify(ossimNotifyLevel_NOTICE) << "Processing file: " << file << std::endl; m_mutex.lock(); ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(file, true, true); m_mutex.unlock(); if ( ih.valid() && !ih->hasError() ) { if ( isDirectoryBasedImage( ih.get() ) ) { // Tell the walker not to recurse this directory. m_mutex.lock(); m_fileWalker->setRecurseFlag(false); m_mutex.unlock(); } // Set any reader props: ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>(ih.get()); if ( pi ) setProps(pi); bool consumedHistogramOptions = false; bool consumedCmmOptionsOptions = false; if ( getOutputFileNamesFlag() ) { // Simply output the file name of any images we can open: ossimNotify(ossimNotifyLevel_NOTICE) << ih->getFilename().expand(); } if ( createOverviews() ) { // Skip shape files... if ( ih->getClassName() != "ossimOgrGdalTileSource" ) { createOverview(ih, consumedHistogramOptions, consumedCmmOptionsOptions); } } // Build stand alone histogram. Note the overview sequencer may have computed for us. if ( hasHistogramOption() && !consumedHistogramOptions) { createHistogram( ih ); } } else { ossimNotify(ossimNotifyLevel_WARN) << M << "\nCould not open: " << file << std::endl; } } else // Matches: if ( processFileFlag ) { ossimNotify(ossimNotifyLevel_NOTICE) << "Filtered file, not processing: " << file << std::endl; } if(traceDebug()) { // Since ossimFileWalker is threaded output the file so we know which job exited. ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n"; } }