Kaydet (Commit) b1500002 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

SfxMedium::LockOrigFileOnDemand return value is never used

Change-Id: I2f64cc8fbe78354f9ded7a9a6bf03d9c597b3897
üst 78e2af8d
...@@ -161,7 +161,7 @@ public: ...@@ -161,7 +161,7 @@ public:
sal_Bool IsStorage(); sal_Bool IsStorage();
sal_Int8 ShowLockedDocumentDialog( const css::uno::Sequence< OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock ); sal_Int8 ShowLockedDocumentDialog( const css::uno::Sequence< OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock );
bool LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ); void LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI );
void UnlockFile( sal_Bool bReleaseLockStream ); void UnlockFile( sal_Bool bReleaseLockStream );
css::uno::Reference< css::embed::XStorage > GetStorage( sal_Bool bCreateTempIfNo = sal_True ); css::uno::Reference< css::embed::XStorage > GetStorage( sal_Bool bCreateTempIfNo = sal_True );
......
...@@ -979,23 +979,17 @@ namespace ...@@ -979,23 +979,17 @@ namespace
#endif // HAVE_FEATURE_MULTIUSER_ENVIRONMENT #endif // HAVE_FEATURE_MULTIUSER_ENVIRONMENT
// returns true if the document can be opened for editing ( even if it should be a copy ) // sets SID_DOC_READONLY if the document cannot be opened for editing
// otherwise the document should be opened readonly
// if user cancel the loading the ERROR_ABORT is set // if user cancel the loading the ERROR_ABORT is set
bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) void SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
{ {
#if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT #if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT
(void) bLoading; (void) bLoading;
(void) bNoUI; (void) bNoUI;
return true;
#else #else
if (!IsLockingUsed()) if (!IsLockingUsed() || GetURLObject().HasError())
return true; return;
if ( GetURLObject().HasError() )
return false;
bool bResult = false;
try try
{ {
if ( pImp->m_bLocked && bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) if ( pImp->m_bLocked && bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
...@@ -1005,7 +999,7 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) ...@@ -1005,7 +999,7 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
GetLockingStream_Impl(); GetLockingStream_Impl();
} }
bResult = pImp->m_bLocked; bool bResult = pImp->m_bLocked;
if ( !bResult ) if ( !bResult )
{ {
...@@ -1224,7 +1218,6 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) ...@@ -1224,7 +1218,6 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
{ {
SAL_WARN( "sfx.doc", "Locking exception: high probability, that the content has not been created" ); SAL_WARN( "sfx.doc", "Locking exception: high probability, that the content has not been created" );
} }
return bResult;
#endif #endif
} }
......
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