[Libreoffice-commits] .: 2 commits - filter/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jul 12 01:17:35 PDT 2011
filter/source/msfilter/msdffimp.cxx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit c0f0b76fe7181161ce2f75f285e3ed47a8637b72
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 12 08:51:45 2011 +0100
check if seek succeeded
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 66b8274..62a7c76 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6671,10 +6671,10 @@ sal_Bool SvxMSDffManager::GetShape(sal_uLong nId, SdrObject*& rpShape,
sal_uLong nOldPosCtrl = rStCtrl.Tell();
sal_uLong nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
// das Shape im Steuer Stream anspringen
- rStCtrl.Seek( rInfo.nFilePos );
+ bool bSeeked = (rInfo.nFilePos == rStCtrl.Seek(rInfo.nFilePos));
// Falls missglueckt, den Fehlerstatus zuruecksetzen und Pech gehabt!
- if( rStCtrl.GetError() )
+ if (!bSeeked || rStCtrl.GetError())
rStCtrl.ResetError();
else
rpShape = ImportObj( rStCtrl, &rData, rData.aParentRect, rData.aParentRect );
commit 32cadb33a52a650a6c5e22fa3adb0357645ca9e4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jul 11 22:00:13 2011 +0100
avoid optimization turning into pessimisation for stupid strings
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index b65fa1a..66b8274 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -609,7 +609,10 @@ bool DffPropSet::GetPropertyBool( sal_uInt32 nId, bool bDefault ) const
if( (nBufferSize > 0) && SeekToContent( nId, rStrm ) )
{
sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufferSize / 2 );
- aBuffer.ensureCapacity( nStrLen );
+ //clip initial size of buffer to something sane in case of silly length
+ //strings. If there really is a silly amount of data available it still
+ //works out ok of course
+ aBuffer.ensureCapacity(std::min(nStrLen,static_cast<sal_Int32>(8192)));
for( sal_Int32 nCharIdx = 0; nCharIdx < nStrLen; ++nCharIdx )
{
sal_uInt16 nChar = 0;
More information about the Libreoffice-commits
mailing list