summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vbahelper/vbahelper.hxx2
-rw-r--r--include/vbahelper/vbashape.hxx2
-rw-r--r--vbahelper/source/msforms/vbacombobox.cxx14
-rw-r--r--vbahelper/source/msforms/vbacombobox.hxx3
-rw-r--r--vbahelper/source/msforms/vbalistbox.cxx14
-rw-r--r--vbahelper/source/msforms/vbalistbox.hxx3
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx18
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx24
8 files changed, 43 insertions, 37 deletions
diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx
index 9be2b900a019..e9d8fa8bc01f 100644
--- a/include/vbahelper/vbahelper.hxx
+++ b/include/vbahelper/vbahelper.hxx
@@ -193,7 +193,7 @@ public:
class VBAHELPER_DLLPUBLIC ConcreteXShapeGeometryAttributes final : public AbstractGeometryAttributes
{
- std::unique_ptr< ShapeHelper > m_pShapeHelper;
+ ShapeHelper m_aShapeHelper;
public:
ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::drawing::XShape >& xShape );
virtual double getLeft() const override;
diff --git a/include/vbahelper/vbashape.hxx b/include/vbahelper/vbashape.hxx
index 11ac68780193..0766b275b556 100644
--- a/include/vbahelper/vbashape.hxx
+++ b/include/vbahelper/vbashape.hxx
@@ -60,7 +60,7 @@ typedef InheritedHelperInterfaceImpl< ListeningShape > ScVbaShape_BASE;
class VBAHELPER_DLLPUBLIC ScVbaShape : public ScVbaShape_BASE
{
protected:
- std::unique_ptr< ov::ShapeHelper > m_pShapeHelper;
+ ov::ShapeHelper m_aShapeHelper;
css::uno::Reference< css::drawing::XShape > m_xShape;
css::uno::Reference< css::drawing::XShapes > m_xShapes;
css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx
index 16abb6d985d3..9f1d8dc81309 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -37,8 +37,8 @@ using namespace ooo::vba;
ScVbaComboBox::ScVbaComboBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, std::unique_ptr<ov::AbstractGeometryAttributes> pGeomHelper )
: ComboBoxImpl_BASE( xParent, xContext, xControl, xModel, std::move(pGeomHelper) )
+ , maListHelper( m_xProps )
{
- mpListHelper.reset( new ListControlHelper( m_xProps ) );
try
{
// grab the default value property name
@@ -149,38 +149,38 @@ ScVbaComboBox::setText( const OUString& _text )
void SAL_CALL
ScVbaComboBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex )
{
- mpListHelper->AddItem( pvargItem, pvargIndex );
+ maListHelper.AddItem( pvargItem, pvargIndex );
}
void SAL_CALL
ScVbaComboBox::removeItem( const uno::Any& index )
{
- mpListHelper->removeItem( index );
+ maListHelper.removeItem( index );
}
void SAL_CALL
ScVbaComboBox::Clear( )
{
- mpListHelper->Clear();
+ maListHelper.Clear();
}
void SAL_CALL
ScVbaComboBox::setRowSource( const OUString& _rowsource )
{
ScVbaControl::setRowSource( _rowsource );
- mpListHelper->setRowSource( _rowsource );
+ maListHelper.setRowSource( _rowsource );
}
sal_Int32 SAL_CALL
ScVbaComboBox::getListCount()
{
- return mpListHelper->getListCount();
+ return maListHelper.getListCount();
}
uno::Any SAL_CALL
ScVbaComboBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn )
{
- return mpListHelper->List( pvargIndex, pvarColumn );
+ return maListHelper.List( pvargIndex, pvarColumn );
}
sal_Int32 SAL_CALL ScVbaComboBox::getStyle()
diff --git a/vbahelper/source/msforms/vbacombobox.hxx b/vbahelper/source/msforms/vbacombobox.hxx
index feea8e52c504..4f682fc31648 100644
--- a/vbahelper/source/msforms/vbacombobox.hxx
+++ b/vbahelper/source/msforms/vbacombobox.hxx
@@ -19,6 +19,7 @@
#ifndef INCLUDED_VBAHELPER_SOURCE_MSFORMS_VBACOMBOBOX_HXX
#define INCLUDED_VBAHELPER_SOURCE_MSFORMS_VBACOMBOBOX_HXX
#include <memory>
+#include <optional>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -33,7 +34,7 @@
typedef cppu::ImplInheritanceHelper<ScVbaControl, ov::msforms::XComboBox, css::script::XDefaultProperty > ComboBoxImpl_BASE;
class ScVbaComboBox : public ComboBoxImpl_BASE
{
- std::unique_ptr< ListControlHelper > mpListHelper;
+ ListControlHelper maListHelper;
OUString sSourceName;
public:
diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx
index 40e4445f675b..b7c1fc0097db 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -27,9 +27,9 @@ using namespace ooo::vba;
ScVbaListBox::ScVbaListBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, std::unique_ptr<ov::AbstractGeometryAttributes> pGeomHelper )
: ListBoxImpl_BASE(xParent, xContext, xControl, xModel, std::move(pGeomHelper))
+ , maListHelper( m_xProps )
, m_nIndex(0)
{
- mpListHelper.reset( new ListControlHelper( m_xProps ) );
}
// Attributes
@@ -152,19 +152,19 @@ ScVbaListBox::Selected( sal_Int32 index )
void SAL_CALL
ScVbaListBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex )
{
- mpListHelper->AddItem( pvargItem, pvargIndex );
+ maListHelper.AddItem( pvargItem, pvargIndex );
}
void SAL_CALL
ScVbaListBox::removeItem( const uno::Any& index )
{
- mpListHelper->removeItem( index );
+ maListHelper.removeItem( index );
}
void SAL_CALL
ScVbaListBox::Clear( )
{
- mpListHelper->Clear();
+ maListHelper.Clear();
}
// this is called when something like the following vba code is used
@@ -236,19 +236,19 @@ void SAL_CALL
ScVbaListBox::setRowSource( const OUString& _rowsource )
{
ScVbaControl::setRowSource( _rowsource );
- mpListHelper->setRowSource( _rowsource );
+ maListHelper.setRowSource( _rowsource );
}
sal_Int32 SAL_CALL
ScVbaListBox::getListCount()
{
- return mpListHelper->getListCount();
+ return maListHelper.getListCount();
}
uno::Any SAL_CALL
ScVbaListBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn )
{
- return mpListHelper->List( pvargIndex, pvarColumn );
+ return maListHelper.List( pvargIndex, pvarColumn );
}
uno::Reference< msforms::XNewFont > SAL_CALL ScVbaListBox::getFont()
diff --git a/vbahelper/source/msforms/vbalistbox.hxx b/vbahelper/source/msforms/vbalistbox.hxx
index b87f9e74f7dd..b5dde46ebad3 100644
--- a/vbahelper/source/msforms/vbalistbox.hxx
+++ b/vbahelper/source/msforms/vbalistbox.hxx
@@ -19,6 +19,7 @@
#ifndef INCLUDED_VBAHELPER_SOURCE_MSFORMS_VBALISTBOX_HXX
#define INCLUDED_VBAHELPER_SOURCE_MSFORMS_VBALISTBOX_HXX
#include <memory>
+#include <optional>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/script/XDefaultProperty.hpp>
@@ -34,7 +35,7 @@ typedef cppu::ImplInheritanceHelper<ScVbaControl, ov::msforms::XListBox, css::sc
class ScVbaListBox : public ListBoxImpl_BASE
,public PropListener
{
- std::unique_ptr< ListControlHelper > mpListHelper;
+ ListControlHelper maListHelper;
sal_Int16 m_nIndex;
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 751cc8f24144..db59398763c0 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -625,8 +625,8 @@ double PixelsToPoints( const css::uno::Reference< css::awt::XDevice >& xDevice,
}
ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::drawing::XShape >& xShape )
+ : m_aShapeHelper( xShape )
{
- m_pShapeHelper.reset( new ShapeHelper( xShape ) );
}
ConcreteXShapeGeometryAttributes::~ConcreteXShapeGeometryAttributes()
{
@@ -935,36 +935,36 @@ void UserFormGeometryHelper::implSetSize( double fSize, bool bHeight, bool bOute
double ConcreteXShapeGeometryAttributes::getLeft() const
{
- return m_pShapeHelper->getLeft();
+ return m_aShapeHelper.getLeft();
}
void ConcreteXShapeGeometryAttributes::setLeft( double nLeft )
{
- m_pShapeHelper->setLeft( nLeft );
+ m_aShapeHelper.setLeft( nLeft );
}
double ConcreteXShapeGeometryAttributes::getTop() const
{
- return m_pShapeHelper->getTop();
+ return m_aShapeHelper.getTop();
}
void ConcreteXShapeGeometryAttributes::setTop( double nTop )
{
- m_pShapeHelper->setTop( nTop );
+ m_aShapeHelper.setTop( nTop );
}
double ConcreteXShapeGeometryAttributes::getHeight() const
{
- return m_pShapeHelper->getHeight();
+ return m_aShapeHelper.getHeight();
}
void ConcreteXShapeGeometryAttributes::setHeight( double nHeight )
{
- m_pShapeHelper->setHeight( nHeight );
+ m_aShapeHelper.setHeight( nHeight );
}
double ConcreteXShapeGeometryAttributes::getWidth() const
{
- return m_pShapeHelper->getWidth();
+ return m_aShapeHelper.getWidth();
}
void ConcreteXShapeGeometryAttributes::setWidth( double nWidth)
{
- m_pShapeHelper->setWidth( nWidth );
+ m_aShapeHelper.setWidth( nWidth );
}
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
index fead96292774..165d8d206dd0 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -50,10 +50,14 @@ using namespace ::ooo::vba;
using namespace ::com::sun::star;
ScVbaShape::ScVbaShape( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< drawing::XShape > xShape, uno::Reference< drawing::XShapes > xShapes, uno::Reference< frame::XModel > xModel, sal_Int32 nType )
- : ScVbaShape_BASE( xParent, xContext ), m_xShape(std::move( xShape )), m_xShapes(std::move( xShapes )), m_nType( nType ), m_xModel(std::move( xModel ))
+ : ScVbaShape_BASE( xParent, xContext )
+ , m_aShapeHelper( xShape )
+ , m_xShape(std::move( xShape ))
+ , m_xShapes(std::move( xShapes ))
+ , m_nType( nType )
+ , m_xModel(std::move( xModel ))
{
m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW );
- m_pShapeHelper.reset( new ShapeHelper( m_xShape ) );
addListeners();
}
@@ -232,25 +236,25 @@ ScVbaShape::setAlternativeText( const OUString& sAltText )
double SAL_CALL
ScVbaShape::getHeight()
{
- return m_pShapeHelper->getHeight();
+ return m_aShapeHelper.getHeight();
}
void SAL_CALL
ScVbaShape::setHeight(double _height)
{
- m_pShapeHelper->setHeight( _height );
+ m_aShapeHelper.setHeight( _height );
}
double SAL_CALL
ScVbaShape::getWidth()
{
- return m_pShapeHelper->getWidth();
+ return m_aShapeHelper.getWidth();
}
void SAL_CALL
ScVbaShape::setWidth(double _width)
{
- m_pShapeHelper->setWidth( _width );
+ m_aShapeHelper.setWidth( _width );
}
double SAL_CALL
@@ -259,7 +263,7 @@ ScVbaShape::getLeft()
double left = 0;
try
{
- left = m_pShapeHelper->getLeft();
+ left = m_aShapeHelper.getLeft();
}
catch( uno::Exception& )
{
@@ -276,7 +280,7 @@ ScVbaShape::setLeft( double _left )
{
try
{
- m_pShapeHelper->setLeft( _left );
+ m_aShapeHelper.setLeft( _left );
}
catch( uno::Exception& )
{
@@ -291,7 +295,7 @@ ScVbaShape::getTop()
double top = 0;
try
{
- top = m_pShapeHelper->getTop();
+ top = m_aShapeHelper.getTop();
}
catch( uno::Exception& )
{
@@ -307,7 +311,7 @@ ScVbaShape::setTop( double _top )
{
try
{
- m_pShapeHelper->setTop( _top );
+ m_aShapeHelper.setTop( _top );
}
catch( uno::Exception& )
{