summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-05-03 10:24:33 +0100
committerNoel Power <noel.power@suse.com>2013-05-07 09:56:26 +0100
commit54980ddb40a58d210693166df0143240444d5f1e (patch)
tree11492e5304ed7420dfa464e0be35d8d6c2121406
parent9b056d0e9575c8b6eea478590e054248d3882dc1 (diff)
support Shape.Alternative
Change-Id: I6d822ef0d06e222f454c1279be16e33bcaae0037
-rw-r--r--include/vbahelper/vbashape.hxx2
-rw-r--r--oovbaapi/ooo/vba/msforms/XShape.idl1
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx16
3 files changed, 19 insertions, 0 deletions
diff --git a/include/vbahelper/vbashape.hxx b/include/vbahelper/vbashape.hxx
index 58e4f2865545..ff9c99edf020 100644
--- a/include/vbahelper/vbashape.hxx
+++ b/include/vbahelper/vbashape.hxx
@@ -62,6 +62,8 @@ public:
// Attributes
virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException);
virtual void SAL_CALL setName( const OUString& _name ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getAlternativeText() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAlternativeText( const OUString& _name ) throw (css::uno::RuntimeException);
virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
diff --git a/oovbaapi/ooo/vba/msforms/XShape.idl b/oovbaapi/ooo/vba/msforms/XShape.idl
index 8b59f20edcb7..bdeba8306df6 100644
--- a/oovbaapi/ooo/vba/msforms/XShape.idl
+++ b/oovbaapi/ooo/vba/msforms/XShape.idl
@@ -28,6 +28,7 @@ interface XShapeRange;
interface XShape : ooo::vba::XHelperInterface
{
[attribute] string Name;
+ [attribute] string AlternativeText;
[attribute] double Height;
[attribute] double Width;
[attribute] double Left;
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
index 690f7b751545..f94d96d73a77 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -167,6 +167,22 @@ ScVbaShape::setName( const OUString& _name ) throw (uno::RuntimeException)
xNamed->setName( _name );
}
+OUString SAL_CALL
+ScVbaShape::getAlternativeText() throw (uno::RuntimeException)
+{
+ OUString sAltText;
+ uno::Reference< beans::XPropertySet > xProps( m_xShape, uno::UNO_QUERY_THROW );
+ xProps->getPropertyValue( OUString( "Title" ) ) >>= sAltText;
+ return sAltText;
+}
+
+void SAL_CALL
+ScVbaShape::setAlternativeText( const OUString& sAltText ) throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xProps( m_xShape, uno::UNO_QUERY_THROW );
+ xProps->setPropertyValue( OUString( "Title" ), uno::Any( sAltText ) );
+}
+
double SAL_CALL
ScVbaShape::getHeight() throw (uno::RuntimeException)
{