summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/sddetect.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index 1d957b36c0bc..614773c7d7f7 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -352,17 +352,19 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes
pStm = aMedium.GetInStream();
if (!pStm)
pFilter = NULL;
-
- pStm->Seek(STREAM_SEEK_TO_END);
- const sal_Size nSize = pStm->Tell();
- pStm->Seek(STREAM_SEEK_TO_BEGIN);
-
- // Do not attempt to create an SotStorage on a
- // 0-length stream as that would create the compound
- // document header on the stream and effectively write to
- // disk!
- if (!nSize)
- pFilter = NULL;
+ else
+ {
+ pStm->Seek(STREAM_SEEK_TO_END);
+ const sal_Size nSize = pStm->Tell();
+ pStm->Seek(STREAM_SEEK_TO_BEGIN);
+
+ // Do not attempt to create an SotStorage on a
+ // 0-length stream as that would create the compound
+ // document header on the stream and effectively write to
+ // disk!
+ if (!nSize)
+ pFilter = NULL;
+ }
}
if (pFilter && pStm)