sw/source/core/frmedt/feflyole.cxx | 4 +++- sw/source/uibase/inc/wrtsh.hxx | 1 + sw/source/uibase/uiview/view.cxx | 3 ++- sw/source/uibase/wrtsh/wrtsh1.cxx | 10 ++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-)
New commits: commit 5db5e603d0e121e3e73881bc771c7a0e24e369a7 Author: Gülşah Köse <[email protected]> AuthorDate: Fri Oct 3 17:39:58 2025 +0300 Commit: Szymon Kłos <[email protected]> CommitDate: Tue Oct 7 10:18:16 2025 +0200 GH#13078 ONLINE: Fix the selecting shell issue on math objects Issue: Double click to math formula in Writer (Shows the right Sidebar elemets) Single click the outside Double click the formula again (Doesn't show the sidebar) Signed-off-by: Gülşah Köse <[email protected]> Change-Id: I627c280d6ef676dedfcac53387bc10a3882a247f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191830 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index 59d5595725d8..f0f0dd0b1ef4 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -30,6 +30,7 @@ #include <ndole.hxx> #include <swcli.hxx> #include <docsh.hxx> +#include <view.hxx> #include <IDocumentLinksAdministration.hxx> #include <sfx2/linkmgr.hxx> @@ -101,7 +102,7 @@ bool SwFEShell::FinishOLEObj() // Server is terminated IsCheckForOLEInCaption() ) SetCheckForOLEInCaption( !IsCheckForOLEInCaption() ); - if (const SwDocShell* pShell = GetDoc()->GetDocShell()) + if (SwDocShell* pShell = GetDoc()->GetDocShell()) { // enable update of the link preview comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pShell->getEmbeddedObjectContainer(); @@ -118,6 +119,7 @@ bool SwFEShell::FinishOLEObj() // Server is terminated // return back original value of the "update of the link preview" flag rEmbeddedObjectContainer.setUserAllowsLinkUpdate(aUserAllowsLinkUpdate); + pShell->GetView()->SelectShell(); } } return bRet; diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 5fbd8d1876c7..ba66490b3086 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -351,6 +351,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)(); bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrameFormat **pFlyFrameFormat = nullptr ); SW_DLLPUBLIC void LaunchOLEObj(sal_Int32 nVerb = css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY); // start server + bool IsOLEMath(); virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ) override; virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj, const SwRect *pFlyPrtRect = nullptr, diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 722cfcb514f3..263c62221bd0 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -303,7 +303,8 @@ void SwView::SelectShell() if ( m_pFormShell && m_pFormShell->IsActiveControl() ) nNewSelectionType |= SelectionType::FormControl; - if ( nNewSelectionType == m_nSelectionType ) + if ( nNewSelectionType == m_nSelectionType && + !(m_nSelectionType == SelectionType::Ole && m_pWrtShell->IsOLEMath()) ) { GetViewFrame().GetBindings().InvalidateAll( false ); if ( m_nSelectionType & SelectionType::Ole || diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 959eb327a8a4..803de825b73b 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -664,6 +664,16 @@ bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrame return bActivate; } +bool SwWrtShell::IsOLEMath() { + svt::EmbeddedObjectRef& xRef = GetOLEObject(); + OSL_ENSURE( xRef.is(), "OLE not found" ); + + const auto classId = xRef->getClassID(); + if ( SotExchange::IsMath(classId) ) + return true; + return false; +} + // The current selected OLE object will be loaded with the // verb into the server. void SwWrtShell::LaunchOLEObj(sal_Int32 nVerb)
