diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-16 04:30:43 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-16 04:34:44 +0100 |
commit | 6454bb693413f4fbf5a1d309c67a78e1ea3f59c4 (patch) | |
tree | 06523834ddaf2246139d56525d21cccc755fb701 /chart2 | |
parent | text position for legend improvements (diff) | |
download | core-6454bb693413f4fbf5a1d309c67a78e1ea3f59c4.tar.gz core-6454bb693413f4fbf5a1d309c67a78e1ea3f59c4.zip |
fix crash when dumping OpenGL dummy shapes
CTRL + F12 is working now partly for the OpenGL shapes
Change-Id: Ia4d0499d0df683202d9e2f56de96b22abcd9e367
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/inc/DummyXShape.hxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/DummyXShape.cxx | 64 |
2 files changed, 64 insertions, 2 deletions
diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx index 45f6dc408625..4783cf696218 100644 --- a/chart2/source/view/inc/DummyXShape.hxx +++ b/chart2/source/view/inc/DummyXShape.hxx @@ -109,7 +109,7 @@ public: DummyXShape(); // XNamed - virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException); // XShape diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 134d6cc64d33..44f1476fb7d5 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -27,6 +27,7 @@ #include <vcl/svapp.hxx> #include <tools/gen.hxx> #include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/implbase1.hxx> #include <editeng/unoprnms.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -35,6 +36,8 @@ #include <basegfx/point/b2dpoint.hxx> #include <basegfx/matrix/b3dhommatrix.hxx> +#include <com/sun/star/beans/Property.hpp> + #define ENABLE_DEBUG_PROPERTIES 0 using namespace com::sun::star; @@ -45,6 +48,64 @@ namespace chart { namespace dummy { +class DummyPropertySetInfo : public cppu::WeakImplHelper1< + com::sun::star::beans::XPropertySetInfo > +{ +public: + DummyPropertySetInfo(const std::map<OUString, uno::Any>& rProps ): + mrProperties(rProps) {} + + virtual sal_Bool hasPropertyByName( const OUString& rName ) + throw(uno::RuntimeException); + + virtual beans::Property getPropertyByName( const OUString& rName ) + throw(uno::RuntimeException, beans::UnknownPropertyException); + + virtual uno::Sequence< beans::Property > getProperties() + throw(uno::RuntimeException); + +private: + const std::map<OUString, uno::Any>& mrProperties; +}; + +sal_Bool DummyPropertySetInfo::hasPropertyByName( const OUString& rName ) + throw(uno::RuntimeException) +{ + return mrProperties.find(rName) != mrProperties.end(); +} + +beans::Property DummyPropertySetInfo::getPropertyByName( const OUString& rName ) + throw(uno::RuntimeException, beans::UnknownPropertyException) +{ + beans::Property aRet; + if(mrProperties.find(rName) == mrProperties.end()) + throw beans::UnknownPropertyException(); + + std::map<OUString, uno::Any>::const_iterator itr = mrProperties.find(rName); + aRet.Name = rName; + aRet.Type = itr->second.getValueType(); + + return aRet; +} + +uno::Sequence< beans::Property > DummyPropertySetInfo::getProperties() + throw(uno::RuntimeException) +{ + uno::Sequence< beans::Property > aRet(mrProperties.size()); + + size_t i = 0; + for(std::map<OUString, uno::Any>::const_iterator itr = mrProperties.begin(), + itrEnd = mrProperties.end(); itr != itrEnd; ++itr, ++i) + { + beans::Property aProp; + + aProp.Name = itr->first; + aProp.Type = itr->second.getValueType(); + aRet[i] = aProp; + } + return aRet; +} + namespace { struct PrintProperties @@ -117,7 +178,7 @@ OUString DummyXShape::getShapeType() uno::Reference< beans::XPropertySetInfo > DummyXShape::getPropertySetInfo() throw(uno::RuntimeException) { - return uno::Reference< beans::XPropertySetInfo >(); + return new DummyPropertySetInfo(maProperties); } void DummyXShape::setPropertyValue( const OUString& rName, const uno::Any& rValue) @@ -798,6 +859,7 @@ void DummyText::setPropertyValue( const OUString& rName, const uno::Any& rValue) uno::RuntimeException) { SAL_WARN("chart2.opengl", "property value set after image has been created"); + SAL_WARN("chart2.opengl", rName); DummyXShape::setPropertyValue(rName, rValue); } |