The bad format is obviously caused by your mail program. I doubt that anyone will read the bad formatted mail, at least I can't stand it. Sorry, it's too time consuming to read it.
Please try to repost your mail with a better mail program. My recommendation would be Thunderbird (http://www.mozilla.com/en-US/thunderbird/). Best regards, Mathias [EMAIL PROTECTED] schrieb: > Oh sorry!I don't know why the letter become so ugly. > > Hello! > I'm chensuchun.I'm a newbie in devloping filter.I implement a filter > for exporting and importing my own format file,whose format is based on > odt.But I get some problems about filter. > the code of function filter( const Sequence< PropertyValue >& > rDescriptor ) is following: > xDoc = uno::Reference< document::XStorageBasedDocument >( mxSrcDoc, > uno::UNO_QUERY ); ///mxSrcDoc is set by setSourceDocument() > ////save to a tmp storage use filter writer8 > xSourceStorage = uno::Reference< embed::XStorage >( > xStorageFactory->createInstance(), > > uno::UNO_QUERY ); > uno::Sequence< beans::PropertyValue > afArgs( 1 ); > afArgs[0].Name = ::rtl::OUString::createFromAscii( "FilterName" ); > afArgs[0].Value <<= ::rtl::OUString::createFromAscii( "writer8" ); > xDoc->storeToStorage( xSourceStorage, afArgs ); > ////add a sub storage to the xSourceStorage > const ::rtl::OUString aSubStorageName ( RTL_CONSTASCII_USTRINGPARAM ( > "SubStorage" ) ); > uno::Reference< embed::XStorage > xSubStorage = > xSourceStorage->openStorageElement( > aSubStorageName, embed::ElementModes::WRITE ); > uno::Reference< beans::XPropertySet > xSubStoagePro( xSubStorage, > uno::UNO_QUERY ); > xSubStoagePro->setPropertyValue( > OUString::createFromAscii("MediaType"), > makeAny(OUString::createFromAscii("SubMediaType")) ); > ...... > ///create the target storage > uno::Sequence< uno::Any > aArgs( 2 ); > aArgs[0] <<= aURL; ////get from rDescriptor > aArgs[1] <<= embed::ElementModes::READWRITE; > uno::Reference< embed::XStorage > xTargetStorage( > xStorageFactory->createInstanceWithArguments( > aArgs ), > > uno::UNO_QUERY ); > > ////copy to target storage and commit > xSourceStorage->copyToStorage( xTargetStorage ); > bRet = sal_True; > uno::Reference< XTransactedObject > xTransaction = > uno::Reference< XTransactedObject >( xTargetStorage, > UNO_QUERY ); > if( xTransaction.is() ) > xTransaction->commit(); > /////dispose them > uno::Reference< lang::XComponent > xComponent1( xSourceStorage, > uno::UNO_QUERY ); > OSL_ENSURE( !xSourceStorage.is() || xComponent1.is(), > "Wrong storage implementation!" ); > if ( xComponent1.is() ) > xComponent1->dispose(); > uno::Reference< lang::XComponent > xComponent2( > xTargetStorage, uno::UNO_QUERY ); > OSL_ENSURE( !xTargetStorage.is() || xComponent2.is(), > "Wrong storage implementation!" ); > if ( xComponent2.is() ) > xComponent2->dispose(); > ////End > After the execution of filter( const Sequence< PropertyValue >& rDescriptor ), > the target file is created and the size of the file is about 7K. > But after executing the following code in sal_Bool > SfxObjectShell::SaveTo_Impl: > > // transfer data to its destinated location > // the medium commits the storage or the stream it is based on > RegisterTransfer( rMedium ); > bOk = rMedium.Commit(); > the target file becomes 0K. > Why? > Is some thing wrong in my filter( const Sequence< PropertyValue >& > rDescriptor ) function? > what should I do with the XStorage ? > Any help and sugestion in identifying the missing pieces is appreciated. > Thanks > > ------------------------------------------------------------------- > 特价限量商品限时抢购,8元起!( > http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_20070620.html > ) > > =================================================================== > 注册新浪2G免费邮箱( http://mail.sina.com.cn/chooseMode.html ) -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
