Online: Add isMathObject property when sending selected object info.
We need to distinguish the math objects from others for better handling on the Online side. Signed-off-by: Gökay Şatır <gokaysatir@gmail.com> Change-Id: Ie065d9a229f037dfcaefcfe680683c69b16cb581 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186664 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186813 Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com> Tested-by: Jenkins
This commit is contained in:
@@ -74,6 +74,9 @@
|
||||
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
|
||||
|
||||
using namespace com::sun::star;
|
||||
|
||||
// Migrate Marking of Objects, Points and GluePoints
|
||||
@@ -732,6 +735,30 @@ std::u16string_view lcl_getDragParameterString( std::u16string_view rCID )
|
||||
}
|
||||
return aRet;
|
||||
}
|
||||
|
||||
bool lcl_isStarMath(SdrObject* pO)
|
||||
{
|
||||
auto xUnoShape = pO->getUnoShape();
|
||||
|
||||
if (xUnoShape.is())
|
||||
{
|
||||
auto xServiceInfo = xUnoShape.query<lang::XServiceInfo>();
|
||||
|
||||
if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject"))
|
||||
{
|
||||
auto xUnoShapeProperties = xUnoShape.query<beans::XPropertySet>();
|
||||
if (xUnoShapeProperties.is())
|
||||
{
|
||||
auto xModelInfo = xUnoShapeProperties->getPropertyValue("Model").query<lang::XServiceInfo>();
|
||||
if (xModelInfo.is())
|
||||
return xModelInfo->supportsService("com.sun.star.formula.FormulaProperties");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
bool SdrMarkView::dumpGluePointsToJSON(boost::property_tree::ptree& rTree)
|
||||
@@ -958,6 +985,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
|
||||
+ ",\"OrdNum\":" + OString::number(pO->GetOrdNum())
|
||||
);
|
||||
|
||||
aExtraInfo.append(", \"isMathObject\": " + OString::boolean(lcl_isStarMath(pO)));
|
||||
|
||||
if (mpMarkedObj && !pOtherShell)
|
||||
{
|
||||
OString innerTextInfo = CreateInnerTextRectString();
|
||||
|
||||
Reference in New Issue
Block a user