diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-03-23 17:17:20 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-03-26 18:44:31 +0200 |
commit | 83a486546f535b32a565d9215e7584c5572c2fb0 (patch) | |
tree | 240d34ae820bd0f7150056f6fdd3da7a94e7a485 /sfx2 | |
parent | 434ba7317007f9d27dea3e8bbc52f69e074c2046 (diff) |
Shared documents make no sense for Android and iOS
(When I say documents, I mean spreadsheets. Only Calc has code for
this.)
Change-Id: I05fd19885633f9e250940678d33e2e4c82c31a9d
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/objsh.hxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 6 |
6 files changed, 21 insertions, 5 deletions
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 7e34147fb4b4..866f23819168 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -271,15 +271,21 @@ public: virtual sal_Bool AcceptStateUpdate() const; sal_Bool IsHelpDocument() const; +#if !defined(ANDROID) && !defined(IOS) sal_Bool IsDocShared() const; ::rtl::OUString GetSharedFileURL() const; sal_Bool SwitchToShared( sal_Bool bShared, sal_Bool bSave ); SAL_DLLPRIVATE void FreeSharedFile(); SAL_DLLPRIVATE void FreeSharedFile( const ::rtl::OUString& aTempFileURL ); SAL_DLLPRIVATE void DoNotCleanShareControlFile(); - void SetSharedXMLFlag( sal_Bool bFlag ) const; sal_Bool HasSharedXMLFlagSet() const; +#else + sal_Bool IsDocShared() const + { return sal_False; }; + ::rtl::OUString GetSharedFileURL() const + { return ::rtl::OUString(); }; +#endif SAL_DLLPRIVATE void SetModalMode_Impl(sal_Bool bModal=sal_True); SAL_DLLPRIVATE void SetMacroMode_Impl(sal_Bool bModal=sal_True); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index f150a01bab27..ea8590a76c94 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -495,7 +495,8 @@ void SfxObjectShell::SetModalMode_Impl( sal_Bool bModal ) } } -//-------------------------------------------------------------------- +#if !defined(ANDROID) && !defined(IOS) + sal_Bool SfxObjectShell::SwitchToShared( sal_Bool bShared, sal_Bool bSave ) { sal_Bool bResult = sal_True; @@ -679,6 +680,8 @@ sal_Bool SfxObjectShell::IsDocShared() const return pImp->m_aSharedFileURL; } +#endif + //-------------------------------------------------------------------- Size SfxObjectShell::GetFirstPageSize() diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 44b4e4c122ca..dbe660fe7d88 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2687,6 +2687,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl if ( pFilterOptItem ) pSet->Put( *pFilterOptItem ); +#if !defined(ANDROID) && !defined(IOS) if ( IsDocShared() && !aTempFileURL.isEmpty() ) { // this is a shared document that has to be disconnected from the old location @@ -2701,6 +2702,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl SwitchToShared( sal_True, sal_False ); } } +#endif } if ( bWasReadonly && !bSaveTo ) diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 6bc7a7260d9e..3830a297204b 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -390,9 +390,10 @@ SfxObjectShell::~SfxObjectShell() { pMedium->CloseAndReleaseStreams_Impl(); +#if !defined(ANDROID) && !defined(IOS) if ( IsDocShared() ) FreeSharedFile(); - +#endif DELETEX( pMedium ); } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 08e9b9fbe802..839006986057 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2952,6 +2952,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL } catch( const lang::IllegalArgumentException& ) { +#if !defined(ANDROID) && !defined(IOS) // some additional arguments do not allow to use saving, SaveAs should be done // but only for normal documents, the shared documents would be overwritten in this case // that would mean an information loss @@ -2979,6 +2980,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL throw task::ErrorCodeIOException( ::rtl::OUString( "Cant change password for shared document." ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE ); } } +#endif } } } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 98b2100fa5d8..7ab428e7c9b5 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -673,11 +673,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) pNewSet->ClearItem( SID_DOC_SALVAGE ); } +#if !defined(ANDROID) && !defined(IOS) // TODO/LATER: Temporary solution, the SfxMedium must know the original URL as aLogicName // SfxMedium::Transfer_Impl() will be forbidden then. if ( xOldObj->IsDocShared() ) pNewSet->Put( SfxStringItem( SID_FILE_NAME, xOldObj->GetSharedFileURL() ) ); - +#endif if ( pURLItem ) pNewSet->Put( SfxStringItem( SID_REFERER, pMedium->GetName() ) ); else @@ -789,12 +790,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) xNewObj->SetReadOnlyUI( !bForEdit ); } +#if !defined(ANDROID) && !defined(IOS) if ( xNewObj->IsDocShared() ) { // the file is shared but the closing can change the sharing control file xOldObj->DoNotCleanShareControlFile(); } - +#endif // the Reload and Silent items were only temporary, remove them xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_RELOAD ); xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_SILENT ); |