diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-07-31 21:41:41 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-09-03 21:43:36 +0200 |
commit | 3b9dfb7acd8b2625c39de4af94b4e01794fcd315 (patch) | |
tree | cd96d365cd12a8e75fe09a42773b0d59521dbdef | |
parent | LOK: per-view support for isMobile() (diff) | |
download | core-3b9dfb7acd8b2625c39de4af94b4e01794fcd315.tar.gz core-3b9dfb7acd8b2625c39de4af94b4e01794fcd315.zip |
LOK: Proper use of isMobile() on embedded charts
We are moving the isMobile() check to a higher layer,
to avoid changing a published API method
This is the follow-up of the commit feae0c186e700f6a48c3fad124fb4795ad1a8f83
(cherry picked from commit 9083a07e98a32e3ce7af4bd1a817f2b870df0f55)
Change-Id: Ia84baa36d66d5832e00e6466f5206631df0de443
Reviewed-on: https://gerrit.libreoffice.org/78310
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | embeddedobj/source/commonembedding/embedobj.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/view/ipclient.cxx | 11 |
2 files changed, 11 insertions, 7 deletions
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx index 93f121cee31b..14e7246b7b42 100644 --- a/embeddedobj/source/commonembedding/embedobj.cxx +++ b/embeddedobj/source/commonembedding/embedobj.cxx @@ -227,13 +227,6 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState ) } else { - if(comphelper::LibreOfficeKit::isActive() && comphelper::LibreOfficeKit::isMobile(-1)) - { - // Disable embedded object editing (e.g. chart) on mobile - if(nNextState == embed::EmbedStates::INPLACE_ACTIVE || nNextState == embed::EmbedStates::UI_ACTIVE) - return; - } - if ( nNextState == embed::EmbedStates::INPLACE_ACTIVE ) { if ( !m_xClientSite.is() ) diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 9dd4503eff7f..55fbdbaea2eb 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -932,6 +932,17 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) { m_xImp->m_xObject->setClientSite( m_xImp->m_xClient ); + // Disable embedded object editing (e.g. chart) on mobile + if ( comphelper::LibreOfficeKit::isActive() && comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()) + && m_xImp->m_xObject->getCurrentState() == embed::EmbedStates::RUNNING ) + { + // Also check next state + // Needs to be embed::EmbedStates::UI_ACTIVE or embed::EmbedStates::INPLACE_ACTIVE + // Conversion table is in embeddedobj/source/commonembedding/miscobj.cxx + if (nVerb != embed::EmbedVerbs::MS_OLEVERB_OPEN && nVerb != embed::EmbedVerbs::MS_OLEVERB_HIDE) + return nError; + } + m_xImp->m_xObject->doVerb( nVerb ); } catch ( embed::UnreachableStateException& ) |