Kaydet (Commit) 3ee3e794 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Lock files make no sense on Android or iOS

Change-Id: Ie8d05b8596fb7d17e057bc32c7a4204a9ff54021
üst 83a48654
......@@ -442,12 +442,14 @@ bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& aArg
{
m_nologo = true;
}
#if !defined(ANDROID) && !defined(IOS)
else if ( oArg == "nolockcheck" )
{
m_nolockcheck = true;
// Workaround for automated testing
::svt::DocumentLockFile::AllowInteraction( false );
}
#endif
else if ( oArg == "help" || aArg == "-h" || aArg == "-?" )
{
m_help = true;
......
......@@ -2020,6 +2020,9 @@ void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible)
*/
void lc_removeLockFile(AutoRecovery::TDocumentInfo& rInfo)
{
#if defined(ANDROID) || defined(IOS)
(void) rInfo;
#else
if ( rInfo.Document.is() )
{
try
......@@ -2036,6 +2039,7 @@ void lc_removeLockFile(AutoRecovery::TDocumentInfo& rInfo)
{
}
}
#endif
}
......
......@@ -135,7 +135,8 @@ static const sal_Int8 LOCK_UI_NOLOCK = 0;
static const sal_Int8 LOCK_UI_SUCCEEDED = 1;
static const sal_Int8 LOCK_UI_TRY = 2;
//----------------------------------------------------------------
#if !defined(ANDROID) && !defined(IOS)
bool IsSystemFileLockingUsed()
{
// check whether system file locking has been used, the default value is false
......@@ -194,6 +195,8 @@ bool IsLockingUsed()
return officecfg::Office::Common::Misc::UseLocking::get();
}
#endif
} // anonymous namespace
//==========================================================
......@@ -981,12 +984,14 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri
namespace
{
#if !defined(ANDROID) && !defined(IOS)
bool isSuitableProtocolForLocking(const String & rLogicName)
{
INetURLObject aUrl( rLogicName );
INetProtocol eProt = aUrl.GetProtocol();
return eProt == INET_PROT_FILE || eProt == INET_PROT_SFTP;
}
#endif
}
// returns true if the document can be opened for editing ( even if it should be a copy )
......@@ -994,6 +999,11 @@ namespace
// if user cancel the loading the ERROR_ABORT is set
bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
{
#if defined(ANDROID) || defined(IOS)
(void) bLoading;
(void) bNoUI;
return true;
#else
if (!IsLockingUsed())
return true;
......@@ -1230,6 +1240,7 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
OSL_FAIL( "Locking exception: high probability, that the content has not been created" );
}
return bResult;
#endif
}
//------------------------------------------------------------------
......@@ -2671,6 +2682,9 @@ void SfxMedium::CloseAndRelease()
void SfxMedium::UnlockFile( sal_Bool bReleaseLockStream )
{
#if defined(ANDROID) || defined(IOS)
(void) bReleaseLockStream;
#else
if ( pImp->m_xLockingStream.is() )
{
if ( bReleaseLockStream )
......@@ -2703,6 +2717,7 @@ void SfxMedium::UnlockFile( sal_Bool bReleaseLockStream )
catch( const uno::Exception& )
{}
}
#endif
}
void SfxMedium::CloseAndReleaseStreams_Impl()
......
......@@ -110,7 +110,8 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
svl/source/items/whiter \
svl/source/misc/PasswordHelper \
svl/source/misc/adrparse \
svl/source/misc/documentlockfile \
$(if $(filter DESKTOP,$(BUILD_TYPE)),\
svl/source/misc/documentlockfile) \
svl/source/misc/filenotation \
svl/source/misc/folderrestriction \
svl/source/misc/fstathelper \
......
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