diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-08-10 16:47:39 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-08-29 17:40:26 +0200 |
commit | 6e4f6ec445198f6252fdfed627a1c6d07557190a (patch) | |
tree | 7415c61174332c2889d347b5c38b88347dce4bad /svtools | |
parent | 7daba09d025a2ade10cecb33cd1d613f16b78fe4 (diff) |
Add a method to check whether an XEmbeddedObject is a chart
Change-Id: I6f860b9f1bce200c5366df0a32650705cf429a80
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/embedhlp.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 238ea0379201..365c316a5267 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -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 |