19 #ifndef INCLUDED_SC_SOURCE_UI_VBA_VBATITLE_HXX
20 #define INCLUDED_SC_SOURCE_UI_VBA_VBATITLE_HXX
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/drawing/XShape.hpp>
28 #include <com/sun/star/script/BasicErrorException.hpp>
32 template<
typename... Ifc >
42 TitleImpl(
const css::uno::Reference< ov::XHelperInterface >& xParent,
43 const css::uno::Reference< css::uno::XComponentContext >& xContext,
44 const css::uno::Reference< css::drawing::XShape >& _xTitleShape )
45 :
BaseClass( xParent, xContext ), xTitleShape( _xTitleShape ), m_Palette(nullptr)
47 xShapePropertySet.set( xTitleShape, css::uno::UNO_QUERY_THROW );
48 oShapeHelper.reset(
new ov::ShapeHelper(xTitleShape) );
50 css::uno::Reference< ov::excel::XInterior > SAL_CALL
Interior( )
override
58 css::uno::Reference< ov::excel::XFont > SAL_CALL
Font( )
override
65 void SAL_CALL
setText(
const OUString& Text )
override
69 xShapePropertySet->setPropertyValue(
"String", css::uno::makeAny( Text ));
71 catch ( css::uno::Exception& )
73 throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), sal_uInt32(
ERRCODE_BASIC_METHOD_FAILED), OUString() );
81 xShapePropertySet->getPropertyValue(
"String") >>= sText;
83 catch ( css::uno::Exception& )
85 throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), sal_uInt32(
ERRCODE_BASIC_METHOD_FAILED), OUString() );
90 void SAL_CALL
setTop(
double Top )
override
92 oShapeHelper->setTop( Top );
96 return oShapeHelper->getTop();
98 void SAL_CALL
setLeft(
double Left )
override
100 oShapeHelper->setLeft( Left );
104 return oShapeHelper->getLeft();
110 xShapePropertySet->setPropertyValue(
"TextRotation", css::uno::makeAny(_nOrientation*100));
112 catch (css::uno::Exception& )
114 throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), sal_uInt32(
ERRCODE_BASIC_METHOD_FAILED), OUString() );
119 sal_Int32 nSOOrientation = 0;
122 xShapePropertySet->getPropertyValue(
"TextRotation") >>= nSOOrientation;
124 catch (css::uno::Exception& )
126 throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), sal_uInt32(
ERRCODE_BASIC_METHOD_FAILED), OUString() );
128 return static_cast< sal_Int32
>(nSOOrientation / 100) ;
138 if ( !aServiceNames.hasElements() )
140 aServiceNames.realloc( 1 );
141 aServiceNames[ 0 ] =
"ooo.vba.excel.XTitle";
143 return aServiceNames;
OUString getServiceImplName() override
void SAL_CALL setTop(double Top) override
css::uno::Reference< css::drawing::XShape > xTitleShape
Sequence< OUString > aServiceNames
css::uno::Reference< ov::excel::XInterior > SAL_CALL Interior() override
TitleImpl(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::drawing::XShape > &_xTitleShape)
double SAL_CALL getLeft() override
void SAL_CALL setText(const OUString &Text) override
css::uno::WeakReference< ov::XHelperInterface > mxParent
css::uno::Reference< css::beans::XPropertySet > xShapePropertySet
std::unique_ptr< ov::ShapeHelper > oShapeHelper
css::uno::Sequence< OUString > getServiceNames() override
::sal_Int32 SAL_CALL getOrientation() override
css::uno::Reference< css::uno::XComponentContext > mxContext
#define ERRCODE_BASIC_METHOD_FAILED
OUString SAL_CALL getText() override
double SAL_CALL getTop() override
css::uno::Reference< ov::excel::XFont > SAL_CALL Font() override
InheritedHelperInterfaceImpl< Ifc... > BaseClass
void SAL_CALL setLeft(double Left) override
void SAL_CALL setOrientation(::sal_Int32 _nOrientation) override