summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-27 14:06:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-28 08:55:10 +0200
commit26c82e22bf4f077022ae88d0a7f8ad0fa6d2a5ba (patch)
tree42bf27db4a1da0fa3ea3bdd7997e7058c1638f98 /vbahelper
parentef531e85d95fe18d553bce1a6926d24c08ffe2bf (diff)
loplugin:oncevar in ucb..vbahelper
Change-Id: I1fc7c7505a42b3bf9d4a5ab22961930b9831d4ae Reviewed-on: https://gerrit.libreoffice.org/39327 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx3
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbadocumentbase.cxx3
-rw-r--r--vbahelper/source/vbahelper/vbashapes.cxx18
5 files changed, 11 insertions, 21 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 1c8e50d6632f..9e6290ddf474 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -460,7 +460,7 @@ PointerStyles const styles[] = {
static long lcl_loPointerToMsoPointer( PointerStyle eType )
{
long nRet = msforms::fmMousePointer::fmMousePointerDefault;
- for ( int i = 0, nElems = SAL_N_ELEMENTS( styles ); i < nElems; ++i )
+ for ( int i = 0; i < int(SAL_N_ELEMENTS( styles )); ++i )
{
if ( styles[ i ].loPointStyle == eType )
{
@@ -474,7 +474,7 @@ static long lcl_loPointerToMsoPointer( PointerStyle eType )
static Pointer lcl_msoPointerToLOPointer( long msoPointerStyle )
{
Pointer aPointer( PointerStyle::Arrow );
- for ( int i = 0, nElems = SAL_N_ELEMENTS( styles ); i < nElems; ++i )
+ for ( int i = 0; i < int(SAL_N_ELEMENTS( styles )); ++i )
{
if ( styles[ i ].msoPointerStyle == msoPointerStyle )
{
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 4933e902ecb5..da33cbcaf673 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -205,8 +205,7 @@ VbaApplicationBase::getDisplayStatusBar()
if( xProps.is() ){
uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager"), uno::UNO_QUERY_THROW );
- OUString url( "private:resource/statusbar/statusbar" );
- if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){
+ if( xLayoutManager.is() && xLayoutManager->isElementVisible( "private:resource/statusbar/statusbar" ) ){
return true;
}
}
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 0dc0af6406e7..915913586798 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -210,9 +210,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
}
else
{
- bool isVisible = true;
- sal_Int32 nStyle = 0;
- aProps = CreateToolbarItemData( sCommandUrl, sHelpUrl, sLabel, nItemType, aSubMenu, isVisible, nStyle );
+ aProps = CreateToolbarItemData( sCommandUrl, sHelpUrl, sLabel, nItemType, aSubMenu, true/*isVisible*/, 0/*nStyle*/ );
}
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index cf221ab6b95f..5028d1504b90 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -249,9 +249,8 @@ VbaDocumentBase::getSaved()
void
VbaDocumentBase::Save()
{
- OUString url(".uno:Save");
uno::Reference< frame::XModel > xModel = getModel();
- dispatchRequests(xModel,url);
+ dispatchRequests(xModel,".uno:Save");
}
void
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index da6f0dddc261..18d042ad0446 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -219,13 +219,12 @@ ScVbaShapes::createShape( const OUString& service )
uno::Any
ScVbaShapes::AddRectangle(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, const uno::Any& rRange)
{
- OUString sCreateShapeName( "com.sun.star.drawing.RectangleShape" );
sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
- uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.RectangleShape" ), uno::UNO_QUERY_THROW );
m_xShapes->add( xShape );
OUString sName(createName( "Rectangle" ));
@@ -251,13 +250,12 @@ ScVbaShapes::AddRectangle(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWid
uno::Any
ScVbaShapes::AddEllipse(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, const uno::Any& rRange)
{
- 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 );
sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
- uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.EllipseShape" ), uno::UNO_QUERY_THROW );
m_xShapes->add( xShape );
awt::Point aMovePositionIfRange( 0, 0 );
@@ -356,13 +354,12 @@ ScVbaShapes::AddTextbox( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int3
uno::Any
ScVbaShapes::AddTextboxInWriter( sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight )
{
- 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 );
sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( _nHeight );
- uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.TextShape" ), uno::UNO_QUERY_THROW );
m_xShapes->add( xShape );
setDefaultShapeProperties(xShape);
@@ -386,13 +383,10 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _n
xShapeProps->setPropertyValue( "VertOrientPosition", uno::makeAny( nYPos ) );
// set to visible
- drawing::LineStyle aLineStyle = drawing::LineStyle_SOLID;
- xShapeProps->setPropertyValue( "LineStyle", uno::makeAny( aLineStyle ) );
+ xShapeProps->setPropertyValue( "LineStyle", uno::makeAny( drawing::LineStyle_SOLID ) );
// set to font
- sal_Int16 nLayerId = 1;
- OUString sLayerName("Heaven");
- xShapeProps->setPropertyValue( "LayerID", uno::makeAny( nLayerId ) );
- xShapeProps->setPropertyValue( "LayerName", uno::makeAny( sLayerName ) );
+ xShapeProps->setPropertyValue( "LayerID", uno::makeAny( sal_Int16(1) ) );
+ xShapeProps->setPropertyValue( "LayerName", uno::makeAny( OUString("Heaven") ) );
ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );