diff options
Diffstat (limited to 'writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx')
-rw-r--r-- | writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx b/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx index c0726fb44c73..b4c977943935 100644 --- a/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx +++ b/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx @@ -93,7 +93,6 @@ class MyRtfScannerHandler : public writerfilter::rtftok::RTFScannerHandler void dest(char* token, char* /*value*/) { destMap.insert(rtl::OString(token)); -// printf("{\\*\\%s%s ", token, value); if (strcmp(token, "objdata")==0) { binBuffer.clear(); @@ -104,11 +103,9 @@ class MyRtfScannerHandler : public writerfilter::rtftok::RTFScannerHandler void ctrl(char*token, char* /*value*/) { ctrlMap.insert(rtl::OString(token)); -// printf("\\%s%s ", token, value); } void lbrace(void) { -// printf("{"); } void rbrace(void) { @@ -127,29 +124,13 @@ class MyRtfScannerHandler : public writerfilter::rtftok::RTFScannerHandler o+=4; // dummy2 unsigned int binLen=((unsigned int)binBuffer[o]) | ((unsigned int)binBuffer[o+1])<<8 | ((unsigned int)binBuffer[o+2])<<16 | ((unsigned int)binBuffer[o+3]<<24); o+=4; printf("OLE%i \"%s\" type=%i recType=%i binBuffer.size()=%u len=%u\n", numOfOLEs, str, type, recType, (unsigned int)(binBuffer.size()), o+binLen); - //assert(binBuffer.size()==o+binLen); char buf[100]; sprintf(buf, "ole%02i.ole", numOfOLEs); -/* if 0{ - FILE *f=fopen(buf, "w+b"); - unsigned char *data=binBuffer.begin(); - fwrite(data+o, 1, binLen, f); - fclose(f); - }*/ -/* - rtl_uString *dir=NULL; - osl_getProcessWorkingDir(&dir); - rtl::OUString absFileUrl; - rtl::OUString fileUrl=rtl::OUString::createFromAscii(buf); - osl_getAbsoluteFileURL(dir, fileUrl.pData, &absFileUrl.pData); - rtl_uString_release(dir); -*/ + comphelper::ByteSequence seq(binLen); unsigned char *data0=binBufferStr; memcpy(seq.getArray(), data0+o, binLen); uno::Reference<io::XInputStream> myStream=new comphelper::SequenceInputStream(seq); -// uno::Reference<io::XStream> myStream=xFileAccess->openFileReadWrite(absFileUrl); -// uno::Reference<io::XStream> myStream(new MyStreamImpl(binBuffer, o)); uno::Sequence< uno::Any > aArgs0( 1 ); aArgs0[0] <<= myStream; uno::Reference< container::XNameContainer > xNameContainer( @@ -184,7 +165,6 @@ class MyRtfScannerHandler : public writerfilter::rtftok::RTFScannerHandler { printf("NOT OK\n"); comphelper::ByteSequence seq2(4+binLen); - // memcpy(seq2.getArray(), &binLen, 4); assert(0); //TODO linux seq2[0]= sal::static_int_cast<sal_Int8>(binLen&0xFF); seq2[1]= sal::static_int_cast<sal_Int8>((binLen>>8)&0xFF); seq2[2]= sal::static_int_cast<sal_Int8>((binLen>>16)&0xFF); @@ -221,21 +201,15 @@ class MyRtfScannerHandler : public writerfilter::rtftok::RTFScannerHandler numOfOLEs++; } #endif -// printf("}"); } void addSpaces(int /*count*/) { -// for(int i=0;i<count;i++) -// printf(" "); - } void addBinData(unsigned char /*data*/) { -// printf("%02Xh", data); } void addChar(char ch) { -// printf("%c", ch); if (objDataLevel) { if (numOfOLEChars%2==0) @@ -258,11 +232,9 @@ class MyRtfScannerHandler : public writerfilter::rtftok::RTFScannerHandler } void addCharU(sal_Unicode /*ch*/) { -// printf("\\u%i ", ch); } void addHexChar(char* /*hexch*/) { -// printf("\'%s ", hexch); } @@ -417,7 +389,6 @@ sal_Int32 SAL_CALL ScannerTestService::run( const uno::Sequence< rtl::OUString > TimeValue t2; osl_getSystemTime(&t2); printf("time=%" SAL_PRIuUINT32 "s\n", t2.Seconds-t1.Seconds); -// eventHandler.dump(); uno::Reference<embed::XTransactedObject> xTransact(xStorage, uno::UNO_QUERY); xTransact->commit(); |