Kaydet (Commit) 83c888bd authored tarafından Miklos Vajna's avatar Miklos Vajna

writerfilter: remove dead doctok detection code

Change-Id: Ib39d54ce37b9e41ab6aff742d7680a7cd76168cd
üst 5e00a299
...@@ -71,40 +71,13 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r ...@@ -71,40 +71,13 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r
else if ( pValues[nProperty].Name == "InputStream" ) else if ( pValues[nProperty].Name == "InputStream" )
pValues[nProperty].Value >>= xInputStream; pValues[nProperty].Value >>= xInputStream;
} }
bool bBinary = sTypeName == "writer_MS_Word_97" ||
sTypeName == "writer_MS_Word_97_Vorlage";
try try
{
if(bBinary)
{
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( xInputStream );
if ( pStream && SotStorage::IsStorageFile(pStream) )
{
SotStorageRef xStg = new SotStorage( pStream, false );
bool bTable2 = xStg->IsContained(OUString("1Table"));
SotStorageStreamRef xRef = xStg->OpenSotStream(OUString("WordDocument"), STREAM_STD_READ | STREAM_NOCREATE );
if(bTable2 && xStg.Is())
{
xRef->Seek(2);
sal_Int16 nWord;
xRef->ReadInt16( nWord );
//version detection
bWord = nWord >= 0x6a && nWord <= 0xc1;
}
}
}
else
{ {
uno::Reference< embed::XStorage > xDocStorage; uno::Reference< embed::XStorage > xDocStorage;
if ( sURL == "private:stream" ) if ( sURL == "private:stream" )
xDocStorage = comphelper::OStorageHelper::GetStorageFromInputStream( xInputStream ); xDocStorage = comphelper::OStorageHelper::GetStorageFromInputStream( xInputStream );
else else
xDocStorage = comphelper::OStorageHelper::GetStorageFromURL( xDocStorage = comphelper::OStorageHelper::GetStorageFromURL( sURL, embed::ElementModes::READ );
sURL, embed::ElementModes::READ );
if( xDocStorage.is() ) if( xDocStorage.is() )
{ {
uno::Sequence< OUString > aNames = xDocStorage->getElementNames(); uno::Sequence< OUString > aNames = xDocStorage->getElementNames();
...@@ -121,7 +94,6 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r ...@@ -121,7 +94,6 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r
} }
} }
} }
}
catch(const uno::Exception&) catch(const uno::Exception&)
{ {
OSL_FAIL("exception while opening storage"); OSL_FAIL("exception while opening storage");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment