diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-03-23 19:05:59 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-03-26 18:44:48 +0200 |
commit | 3ee3e7946c4a772fd13eada4b235479581190dce (patch) | |
tree | 70560d5e3f727cb4dd3b5a4b48522c3f92f49bc9 /sfx2 | |
parent | 83a486546f535b32a565d9215e7584c5572c2fb0 (diff) |
Lock files make no sense on Android or iOS
Change-Id: Ie8d05b8596fb7d17e057bc32c7a4204a9ff54021
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index fa8ef1845853..ca2afd3c6961 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -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() |