Kaydet (Commit) 6e4f6ec4 authored tarafından Zolnai Tamás's avatar Zolnai Tamás Kaydeden (comit) Markus Mohrhard

Add a method to check whether an XEmbeddedObject is a chart

Change-Id: I6f860b9f1bce200c5366df0a32650705cf429a80
üst 7daba09d
......@@ -67,6 +67,8 @@ public:
OUString* pMediaType )
throw();
static bool IsChart(const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj);
const com::sun::star::uno::Reference <com::sun::star::embed::XEmbeddedObject>& operator->() const;
const com::sun::star::uno::Reference <com::sun::star::embed::XEmbeddedObject>& GetObject() const;
......
......@@ -786,6 +786,21 @@ uno::Reference< io::XInputStream > EmbeddedObjectRef::GetGraphicReplacementStrea
return ::comphelper::EmbeddedObjectContainer::GetGraphicReplacementStream(nViewAspect,xObj,pMediaType);
}
bool EmbeddedObjectRef::IsChart(const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj)
{
SvGlobalName aObjClsId(xObj->getClassID());
if(
SvGlobalName(SO3_SCH_CLASSID_30) == aObjClsId
|| SvGlobalName(SO3_SCH_CLASSID_40) == aObjClsId
|| SvGlobalName(SO3_SCH_CLASSID_50) == aObjClsId
|| SvGlobalName(SO3_SCH_CLASSID_60) == aObjClsId)
{
return true;
}
return false;
}
void EmbeddedObjectRef::UpdateReplacement()
{
GetReplacement( true );
......@@ -816,17 +831,7 @@ bool EmbeddedObjectRef::IsChart() const
if (!mpImpl->mxObj.is())
return false;
SvGlobalName aObjClsId(mpImpl->mxObj->getClassID());
if(
SvGlobalName(SO3_SCH_CLASSID_30) == aObjClsId
|| SvGlobalName(SO3_SCH_CLASSID_40) == aObjClsId
|| SvGlobalName(SO3_SCH_CLASSID_50) == aObjClsId
|| SvGlobalName(SO3_SCH_CLASSID_60) == aObjClsId)
{
return true;
}
return false;
return EmbeddedObjectRef::IsChart(mpImpl->mxObj);
}
// MT: Only used for getting accessible attributes, which are not localized
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment