Kaydet (Commit) 30bb1d47 authored tarafından Caolán McNamara's avatar Caolán McNamara

Move OpenMainStream into ww8 as its the only consumer and simplify

OpenMainStream is only used by ww8 now, and the stream to open
is always WordDocument, so we don't need this whole complexity
of looking up the stream name in the filter config, etc. when its
all pointless
üst 2942ab76
...@@ -302,10 +302,6 @@ public: ...@@ -302,10 +302,6 @@ public:
class SW_DLLPUBLIC StgReader : public Reader class SW_DLLPUBLIC StgReader : public Reader
{ {
String aFltName; String aFltName;
protected:
ULONG OpenMainStream( SotStorageStreamRef& rRef, USHORT& rBuffSize );
public: public:
virtual int GetReaderType(); virtual int GetReaderType();
const String& GetFltName() { return aFltName; } const String& GetFltName() { return aFltName; }
......
...@@ -193,35 +193,6 @@ SwRead GetReader( const String& rFltName ) ...@@ -193,35 +193,6 @@ SwRead GetReader( const String& rFltName )
} // namespace SwReaderWriter } // namespace SwReaderWriter
/* */
ULONG StgReader::OpenMainStream( SvStorageStreamRef& rRef, USHORT& rBuffSize )
{
ULONG nRet = ERR_SWG_READ_ERROR;
OSL_ENSURE( pStg, "wo ist mein Storage?" );
const SfxFilter* pFltr = SwIoSystem::GetFilterOfFormat( aFltName );
if( pFltr )
{
rRef = pStg->OpenSotStream( SwIoSystem::GetSubStorageName( *pFltr ),
STREAM_READ | STREAM_SHARE_DENYALL );
if( rRef.Is() )
{
if( SVSTREAM_OK == rRef->GetError() )
{
USHORT nOld = rRef->GetBufferSize();
rRef->SetBufferSize( rBuffSize );
rBuffSize = nOld;
nRet = 0;
}
else
nRet = rRef->GetError();
}
}
return nRet;
}
void Writer::SetPasswd( const String& ) {} void Writer::SetPasswd( const String& ) {}
......
...@@ -5253,6 +5253,29 @@ extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportDOC() ...@@ -5253,6 +5253,29 @@ extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportDOC()
return new WW8Reader(); return new WW8Reader();
} }
ULONG WW8Reader::OpenMainStream( SvStorageStreamRef& rRef, USHORT& rBuffSize )
{
ULONG nRet = ERR_SWG_READ_ERROR;
OSL_ENSURE( pStg, "wo ist mein Storage?" );
rRef = pStg->OpenSotStream(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WordDocument")),
STREAM_READ | STREAM_SHARE_DENYALL);
if( rRef.Is() )
{
if( SVSTREAM_OK == rRef->GetError() )
{
USHORT nOld = rRef->GetBufferSize();
rRef->SetBufferSize( rBuffSize );
rBuffSize = nOld;
nRet = 0;
}
else
nRet = rRef->GetError();
}
return nRet;
}
ULONG WW8Reader::Read(SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, const String & /* FileName */) ULONG WW8Reader::Read(SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, const String & /* FileName */)
{ {
USHORT nOldBuffSize = 32768; USHORT nOldBuffSize = 32768;
......
...@@ -148,6 +148,7 @@ SV_DECL_PTRARR_SORT_DEL(WW8OleMaps, WW8OleMap_Ptr,16,16) ...@@ -148,6 +148,7 @@ SV_DECL_PTRARR_SORT_DEL(WW8OleMaps, WW8OleMap_Ptr,16,16)
class WW8Reader : public StgReader class WW8Reader : public StgReader
{ {
virtual ULONG Read(SwDoc &, const String& rBaseURL, SwPaM &,const String &); virtual ULONG Read(SwDoc &, const String& rBaseURL, SwPaM &,const String &);
ULONG OpenMainStream( SvStorageStreamRef& rRef, USHORT& rBuffSize );
public: public:
virtual int GetReaderType(); virtual int GetReaderType();
......
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