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 <gulsah.kose@collabora.com> Change-Id: I627c280d6ef676dedfcac53387bc10a3882a247f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191830 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193015 Tested-by: Jenkins
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <ndole.hxx>
|
||||
#include <swcli.hxx>
|
||||
#include <docsh.hxx>
|
||||
#include <view.hxx>
|
||||
#include <IDocumentLinksAdministration.hxx>
|
||||
#include <sfx2/linkmgr.hxx>
|
||||
|
||||
@@ -106,7 +107,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();
|
||||
@@ -123,6 +124,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;
|
||||
|
||||
@@ -360,6 +360,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,
|
||||
|
||||
@@ -316,7 +316,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 ||
|
||||
|
||||
@@ -666,6 +666,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)
|
||||
|
||||
Reference in New Issue
Block a user