diff options
Diffstat (limited to 'vbahelper/source/vbahelper/vbashapes.cxx')
-rw-r--r-- | vbahelper/source/vbahelper/vbashapes.cxx | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx index 859d5caa274c..bd0385bb2bcc 100644 --- a/vbahelper/source/vbahelper/vbashapes.cxx +++ b/vbahelper/source/vbahelper/vbashapes.cxx @@ -120,7 +120,7 @@ ScVbaShapes::getElementType() throw (uno::RuntimeException) rtl::OUString ScVbaShapes::getServiceImplName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaShapes")); + return rtl::OUString("ScVbaShapes"); } uno::Sequence< rtl::OUString > @@ -130,7 +130,7 @@ ScVbaShapes::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Shapes" ) ); + aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.Shapes" ); } return aServiceNames; } @@ -236,7 +236,7 @@ ScVbaShapes::createShape( rtl::OUString service ) throw (css::uno::RuntimeExcept uno::Any ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException) { - rtl::OUString sCreateShapeName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")) ); + rtl::OUString sCreateShapeName( rtl::OUString("com.sun.star.drawing.RectangleShape") ); sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY ); sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); @@ -245,7 +245,7 @@ ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWi uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW ); m_xShapes->add( xShape ); - rtl::OUString sName(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rectangle")) )); + rtl::OUString sName(createName( rtl::OUString("Rectangle") )); setDefaultShapeProperties( xShape ); setShape_NameProperty( xShape, sName ); @@ -268,7 +268,7 @@ ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWi uno::Any ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException) { - rtl::OUString sCreateShapeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.EllipseShape") ); + rtl::OUString sCreateShapeName( "com.sun.star.drawing.EllipseShape" ); sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY ); sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); @@ -290,7 +290,7 @@ ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidt setShape_AnchorTypeAndRangeProperty(xShape, _aRange); */ - rtl::OUString name(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Oval")))); + rtl::OUString name(createName( rtl::OUString("Oval"))); setDefaultShapeProperties(xShape); setShape_NameProperty(xShape, name); @@ -321,12 +321,12 @@ ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_In sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( StartX ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( StartY ); - uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape")) ), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString("com.sun.star.drawing.LineShape") ), uno::UNO_QUERY_THROW ); m_xShapes->add( xShape ); awt::Point aMovePositionIfRange( 0, 0 ); - rtl::OUString name(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line")) )); + rtl::OUString name(createName( rtl::OUString("Line") )); setDefaultShapeProperties(xShape); setShape_NameProperty(xShape, name); @@ -363,17 +363,17 @@ uno::Any SAL_CALL ScVbaShapes::AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException) { uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) ) + if( xServiceInfo->supportsService( ::rtl::OUString( "com.sun.star.text.TextDocument" ) ) ) { return AddTextboxInWriter( _nOrientation, _nLeft, _nTop, _nWidth, _nHeight ); } - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); } uno::Any ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException) { - rtl::OUString sCreateShapeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TextShape") ); + rtl::OUString sCreateShapeName( "com.sun.star.drawing.TextShape" ); sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( _nTop ); sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth ); @@ -384,7 +384,7 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, setDefaultShapeProperties(xShape); - rtl::OUString sName(createName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text Box")) )); + rtl::OUString sName(createName( rtl::OUString("Text Box") )); setShape_NameProperty( xShape, sName ); awt::Size size; @@ -393,23 +393,23 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, xShape->setSize(size); uno::Reference< beans::XPropertySet > xShapeProps( xShape, uno::UNO_QUERY_THROW ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorType")), uno::makeAny( text::TextContentAnchorType_AT_PAGE ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation")), uno::makeAny( text::RelOrientation::PAGE_LEFT ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrient")), uno::makeAny( text::HoriOrientation::NONE ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")), uno::makeAny( nXPos ) ); + xShapeProps->setPropertyValue( rtl::OUString("AnchorType"), uno::makeAny( text::TextContentAnchorType_AT_PAGE ) ); + xShapeProps->setPropertyValue( rtl::OUString("HoriOrientRelation"), uno::makeAny( text::RelOrientation::PAGE_LEFT ) ); + xShapeProps->setPropertyValue( rtl::OUString("HoriOrient"), uno::makeAny( text::HoriOrientation::NONE ) ); + xShapeProps->setPropertyValue( rtl::OUString("HoriOrientPosition"), uno::makeAny( nXPos ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation")), uno::makeAny( text::RelOrientation::PAGE_FRAME ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrient")), uno::makeAny( text::VertOrientation::NONE ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")), uno::makeAny( nYPos ) ); + xShapeProps->setPropertyValue( rtl::OUString("VertOrientRelation"), uno::makeAny( text::RelOrientation::PAGE_FRAME ) ); + xShapeProps->setPropertyValue( rtl::OUString("VertOrient"), uno::makeAny( text::VertOrientation::NONE ) ); + xShapeProps->setPropertyValue( rtl::OUString("VertOrientPosition"), uno::makeAny( nYPos ) ); // set to visible drawing::LineStyle aLineStyle = drawing::LineStyle_SOLID; - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")), uno::makeAny( aLineStyle ) ); + xShapeProps->setPropertyValue( rtl::OUString("LineStyle"), uno::makeAny( aLineStyle ) ); // set to font sal_Int16 nLayerId = 1; - rtl::OUString sLayerName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Heaven")); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayerID")), uno::makeAny( nLayerId ) ); - xShapeProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayerName")), uno::makeAny( sLayerName ) ); + rtl::OUString sLayerName = rtl::OUString("Heaven"); + xShapeProps->setPropertyValue( rtl::OUString("LayerID"), uno::makeAny( nLayerId ) ); + xShapeProps->setPropertyValue( rtl::OUString("LayerName"), uno::makeAny( sLayerName ) ); ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) ); @@ -420,11 +420,11 @@ void ScVbaShapes::setDefaultShapeProperties( uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")), uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SOLID")) ) ); - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")), uno::makeAny( sal_Int32(0xFFFFFF) ) ); - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextWordWrap")), uno::makeAny( text::WrapTextMode_THROUGHT ) ); + xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( rtl::OUString("SOLID") ) ); + xPropertySet->setPropertyValue( rtl::OUString("FillColor"), uno::makeAny( sal_Int32(0xFFFFFF) ) ); + xPropertySet->setPropertyValue( rtl::OUString("TextWordWrap"), uno::makeAny( text::WrapTextMode_THROUGHT ) ); //not find in OOo2.3 - //xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Opaque")), uno::makeAny( sal_True ) ); + //xPropertySet->setPropertyValue( rtl::OUString("Opaque"), uno::makeAny( sal_True ) ); } void @@ -433,7 +433,7 @@ ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShap uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); try { - xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), uno::makeAny( sName ) ); + xPropertySet->setPropertyValue( rtl::OUString("Name"), uno::makeAny( sName ) ); } catch(const script::BasicErrorException&) { |