diff options
-rw-r--r-- | comphelper/source/misc/mediadescriptor.cxx | 7 | ||||
-rw-r--r-- | comphelper/source/property/opropertybag.cxx | 8 | ||||
-rw-r--r-- | comphelper/source/property/opropertybag.hxx | 6 | ||||
-rw-r--r-- | sot/source/sdstor/stgelem.cxx | 12 | ||||
-rw-r--r-- | sot/source/sdstor/stgstrms.cxx | 5 | ||||
-rw-r--r-- | svtools/prj/build.lst | 2 | ||||
-rw-r--r-- | svtools/source/misc/documentlockfile.cxx | 32 | ||||
-rw-r--r-- | svtools/source/misc/sharecontrolfile.cxx | 32 |
8 files changed, 58 insertions, 46 deletions
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx index e2c8feefd95c..3016490ac57a 100644 --- a/comphelper/source/misc/mediadescriptor.cxx +++ b/comphelper/source/misc/mediadescriptor.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: mediadescriptor.cxx,v $ - * $Revision: 1.20 $ + * $Revision: 1.20.22.1 $ * * This file is part of OpenOffice.org. * @@ -827,7 +827,12 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL, s if( bLockFile && aScheme.equalsIgnoreAsciiCaseAscii( "file" ) ) bReadOnly = sal_True; else + { + sal_Bool bRequestReadOnly = bReadOnly; aContent.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bReadOnly; + if ( bReadOnly && !bRequestReadOnly && bModeRequestedExplicitly ) + return sal_False; // the document is explicitly requested with WRITEABLE mode + } } catch(const css::uno::RuntimeException&) { throw; } diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index 293718398c70..2cd347b29e10 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: opropertybag.cxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.44.1 $ * * This file is part of OpenOffice.org. * @@ -176,8 +176,10 @@ namespace comphelper void OPropertyBag::setModifiedImpl(::sal_Bool bModified, bool bIgnoreRuntimeExceptionsWhileFiring) { - ::osl::MutexGuard aGuard( m_aMutex ); - m_isModified = bModified; + { // do not lock mutex while notifying (#i93514#) to prevent deadlock + ::osl::MutexGuard aGuard( m_aMutex ); + m_isModified = bModified; + } if (bModified) { try { Reference<XInterface> xThis(*this); diff --git a/comphelper/source/property/opropertybag.hxx b/comphelper/source/property/opropertybag.hxx index a7a401a0755a..7acc0f451c4e 100644 --- a/comphelper/source/property/opropertybag.hxx +++ b/comphelper/source/property/opropertybag.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: opropertybag.hxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.4.38.1 $ * * This file is part of OpenOffice.org. * @@ -35,7 +35,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyContainer.hpp> #include <com/sun/star/beans/XPropertyAccess.hpp> @@ -77,7 +77,7 @@ namespace comphelper //==================================================================== typedef ::cppu::WeakAggImplHelper5 < ::com::sun::star::beans::XPropertyContainer , ::com::sun::star::beans::XPropertyAccess - , ::com::sun::star::util::XModifyBroadcaster + , ::com::sun::star::util::XModifiable , ::com::sun::star::lang::XServiceInfo , ::com::sun::star::lang::XInitialization > OPropertyBag_Base; diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index 5c0a7a009e94..d6fc8ce8f241 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: stgelem.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.6.1 $ * * This file is part of OpenOffice.org. * @@ -158,12 +158,18 @@ BOOL StgHeader::Store( StgIo& rIo ) return BOOL( !bDirty ); } -// Perform thorough checks also on unknown variables +static bool lcl_wontoverflow(short shift) +{ + return shift >= 0 && shift < (short)sizeof(short) * 8 - 1; +} +// Perform thorough checks also on unknown variables BOOL StgHeader::Check() { return BOOL( memcmp( cSignature, cStgSignature, 8 ) == 0 - && (short) ( nVersion >> 16 ) == 3 ); + && (short) ( nVersion >> 16 ) == 3 ) + && lcl_wontoverflow(nPageSize) + && lcl_wontoverflow(nDataPageSize); } INT32 StgHeader::GetFATPage( short n ) const diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index e3aa0ca7122d..46ae3529439c 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: stgstrms.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.8.1 $ * * This file is part of OpenOffice.org. * @@ -823,6 +823,9 @@ void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty ) INT32 StgDataStrm::Read( void* pBuf, INT32 n ) { + if ( n < 0 ) + return 0; + if( ( nPos + n ) > nSize ) n = nSize - nPos; INT32 nDone = 0; diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst index d1dce07c9870..ee2414e0da59 100644 --- a/svtools/prj/build.lst +++ b/svtools/prj/build.lst @@ -1,4 +1,4 @@ -st svtools : offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal jvmfwk NULL +st svtools : offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal sot jvmfwk NULL st svtools usr1 - all st_mkout NULL st svtools\inc nmake - all st_inc NULL st svtools\inc\sane get - all st_incsa NULL diff --git a/svtools/source/misc/documentlockfile.cxx b/svtools/source/misc/documentlockfile.cxx index 48a3966a4d76..24fe3349278f 100644 --- a/svtools/source/misc/documentlockfile.cxx +++ b/svtools/source/misc/documentlockfile.cxx @@ -8,7 +8,7 @@ * * $RCSfile: documentlockfile.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.82.1 $ * * This file is part of OpenOffice.org. * @@ -184,26 +184,24 @@ uno::Sequence< ::rtl::OUString > DocumentLockFile::ParseEntry( const uno::Sequen if ( o_nCurPos >= aBuffer.getLength() ) throw io::WrongFormatException(); - if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' ) + if ( bEscape ) + { + if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' || aBuffer[o_nCurPos] == '\\' ) + aResult.append( (sal_Char)aBuffer[o_nCurPos] ); + else + throw io::WrongFormatException(); + + bEscape = sal_False; + o_nCurPos++; + } + else if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' ) bHaveName = sal_True; else { - if ( bEscape ) - { - if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' || aBuffer[o_nCurPos] == '\\' ) - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - else - throw io::WrongFormatException(); - - bEscape = sal_False; - } + if ( aBuffer[o_nCurPos] == '\\' ) + bEscape = sal_True; else - { - if ( aBuffer[o_nCurPos] == '\\' ) - bEscape = sal_True; - else - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - } + aResult.append( (sal_Char)aBuffer[o_nCurPos] ); o_nCurPos++; } diff --git a/svtools/source/misc/sharecontrolfile.cxx b/svtools/source/misc/sharecontrolfile.cxx index de3ddb535a6e..0fd661f85135 100644 --- a/svtools/source/misc/sharecontrolfile.cxx +++ b/svtools/source/misc/sharecontrolfile.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: sharecontrolfile.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.82.1 $ * * This file is part of OpenOffice.org. * @@ -229,26 +229,24 @@ uno::Sequence< ::rtl::OUString > ShareControlFile::ParseEntry( const uno::Sequen if ( o_nCurPos >= aBuffer.getLength() ) throw io::WrongFormatException(); - if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' ) + if ( bEscape ) + { + if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' || aBuffer[o_nCurPos] == '\\' ) + aResult.append( (sal_Char)aBuffer[o_nCurPos] ); + else + throw io::WrongFormatException(); + + bEscape = sal_False; + o_nCurPos++; + } + else if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' ) bHaveName = sal_True; else { - if ( bEscape ) - { - if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' || aBuffer[o_nCurPos] == '\\' ) - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - else - throw io::WrongFormatException(); - - bEscape = sal_False; - } + if ( aBuffer[o_nCurPos] == '\\' ) + bEscape = sal_True; else - { - if ( aBuffer[o_nCurPos] == '\\' ) - bEscape = sal_True; - else - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - } + aResult.append( (sal_Char)aBuffer[o_nCurPos] ); o_nCurPos++; } |