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 | |
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
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/unoobj/confuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 2 | ||||
-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 |
10 files changed, 40 insertions, 9 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 7a2aebae2a11..045eaa513456 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -635,6 +635,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { case SFX_EVENT_LOADFINISHED: { +#if !defined(ANDROID) && !defined(IOS) // the readonly documents should not be opened in shared mode if ( HasSharedXMLFlagSet() && !SC_MOD()->IsInSharedDocLoading() && !IsReadOnly() ) { @@ -654,10 +655,12 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) SetReadOnlyUI( sal_True ); } } +#endif } break; case SFX_EVENT_VIEWCREATED: { +#if !defined(ANDROID) && !defined(IOS) if ( IsDocShared() && !SC_MOD()->IsInSharedDocLoading() ) { ScAppOptions aAppOptions = SC_MOD()->GetAppOptions(); @@ -675,7 +678,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) } } } - +#endif try { uno::Reference< uno::XComponentContext > xContext( @@ -717,6 +720,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) break; case SFX_EVENT_SAVEDOC: { +#if !defined(ANDROID) && !defined(IOS) if ( IsDocShared() && !SC_MOD()->IsInSharedDocSaving() ) { bool bSuccess = false; @@ -900,7 +904,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( !bSuccess ) SetError( ERRCODE_IO_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); // this error code will produce no error message, but will break the further saving process } - +#endif if (pSheetSaveData) pSheetSaveData->SetInSupportedSave(true); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 93d1ca04f10e..42f7038f7b44 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -766,6 +766,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) aDocument.SetChangeViewSettings(aChangeViewSet); } } +#if !defined(ANDROID) && !defined(IOS) else if ( nSlot == SID_DOCUMENT_MERGE && IsDocShared() && pChangeTrack ) { sal_uLong nEnd = pChangeTrack->GetActionMax(); @@ -784,6 +785,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) PostPaintGridAll(); } } +#endif } pOtherDocSh->DoClose(); // delete passiert mit der Ref } @@ -895,6 +897,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) } break; +#if !defined(ANDROID) && !defined(IOS) case SID_SHARE_DOC: { ScViewData* pViewData = GetViewData(); @@ -1071,7 +1074,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) rReq.Done(); } break; - +#endif case SID_OPEN_CALC: { SfxStringItem aApp(SID_DOC_SERVICE, rtl::OUString("com.sun.star.sheet.SpreadsheetDocument")); @@ -2297,7 +2300,7 @@ IMPL_LINK( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) return 0; } -//------------------------------------------------------------------ +#if !defined(ANDROID) && !defined(IOS) void ScDocShell::EnableSharedSettings( bool bEnable ) { @@ -2376,4 +2379,6 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument() return xModel; } +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index f26007d854f1..5dbac2ba432f 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -257,11 +257,13 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( } else if ( aPropertyName.compareToAscii( SC_UNO_SHAREDOC ) == 0 ) { +#if !defined(ANDROID) && !defined(IOS) sal_Bool bDocShared = false; if ( aValue >>= bDocShared ) { pDocShell->SetSharedXMLFlag( bDocShared ); } +#endif } else if ( aPropertyName.compareToAscii( SC_UNO_MODIFYPASSWORDINFO ) == 0 ) { @@ -416,7 +418,9 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const rtl::OUString aRet <<= pDocShell->IsLoadReadonly(); else if ( aPropertyName.compareToAscii( SC_UNO_SHAREDOC ) == 0 ) { +#if !defined(ANDROID) && !defined(IOS) ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->HasSharedXMLFlagSet() ); +#endif } else if ( aPropertyName.compareToAscii( SC_UNO_MODIFYPASSWORDINFO ) == 0 ) aRet <<= pDocShell->GetModifyPasswordInfo(); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 14caaa54e0fc..52544d7c55cc 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1533,6 +1533,7 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd, sal_Bool bRecord ) ScDocShell* pDocSh = GetViewData()->GetDocShell(); const ScMarkData& rMark = GetViewData()->GetMarkData(); +#if !defined(ANDROID) && !defined(IOS) // #i94841# [Collaboration] if deleting rows is rejected, the content is sometimes wrong if ( pDocSh->IsDocShared() && ( eCmd == DEL_DELROWS || eCmd == DEL_DELCOLS ) ) { @@ -1553,6 +1554,7 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd, sal_Bool bRecord ) } } else +#endif { pDocSh->GetDocFunc().DeleteCells( aRange, &rMark, eCmd, bRecord, false ); } 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 ); |