This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 69e09ba32a Fix clang compatibility in vbahelper: replace
hash_map/auto_ptr
69e09ba32a is described below
commit 69e09ba32a56b933eba973a5084cbbe05b649266
Author: Pedro Giffuni <[email protected]>
AuthorDate: Mon Oct 26 17:31:14 2026 -0500
Fix clang compatibility in vbahelper: replace hash_map/auto_ptr
- Replace std::hash_map (non-standard GCC extension) with std::unordered_map
(C++11 standard) in 5 files:
- vbaeventshelperbase.hxx, vbacontrols.cxx, vbadocumentsbase.cxx,
vbaapplicationbase.cxx
- Replace std::auto_ptr (removed in C++17) with std::unique_ptr in 7 files:
- vbalistbox.hxx, vbacombobox.hxx, vbacontrol.hxx, vbacontrol.cxx,
vbashape.hxx, vbahelper.hxx
- Add #include <unordered_map> and <memory> headers where needed
---
main/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx | 4 ++--
main/vbahelper/inc/vbahelper/vbahelper.hxx | 2 +-
main/vbahelper/inc/vbahelper/vbashape.hxx | 3 ++-
main/vbahelper/source/msforms/vbacombobox.hxx | 3 ++-
main/vbahelper/source/msforms/vbacontrol.cxx | 4 ++--
main/vbahelper/source/msforms/vbacontrol.hxx | 2 +-
main/vbahelper/source/msforms/vbacontrols.cxx | 4 ++--
main/vbahelper/source/msforms/vbalistbox.hxx | 3 ++-
main/vbahelper/source/vbahelper/vbaapplicationbase.cxx | 4 ++--
main/vbahelper/source/vbahelper/vbadocumentsbase.cxx | 4 ++--
10 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/main/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
b/main/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
index 35fe1a2dce..25cfcccf37 100644
--- a/main/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
+++ b/main/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
@@ -25,7 +25,7 @@
#define VBAHELPER_VBAEVENTSHELPERBASE_HXX
#include <deque>
-#include <hash_map>
+#include <unordered_map>
#include <map>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
@@ -172,7 +172,7 @@ protected:
private:
typedef ::std::map< sal_Int32, EventHandlerInfo > EventHandlerInfoMap;
- typedef ::std::hash_map< ::rtl::OUString, ModulePathMap,
::rtl::OUStringHash > EventHandlerPathMap;
+ typedef ::std::unordered_map< ::rtl::OUString, ModulePathMap,
::rtl::OUStringHash > EventHandlerPathMap;
EventHandlerInfoMap maEventInfos;
EventHandlerPathMap maEventPaths;
diff --git a/main/vbahelper/inc/vbahelper/vbahelper.hxx
b/main/vbahelper/inc/vbahelper/vbahelper.hxx
index 1e78540260..37f35f850c 100644
--- a/main/vbahelper/inc/vbahelper/vbahelper.hxx
+++ b/main/vbahelper/inc/vbahelper/vbahelper.hxx
@@ -190,7 +190,7 @@ public:
class VBAHELPER_DLLPUBLIC ConcreteXShapeGeometryAttributes : public
AbstractGeometryAttributes
{
- std::auto_ptr< ShapeHelper > m_pShapeHelper;
+ std::unique_ptr< ShapeHelper > m_pShapeHelper;
public:
ConcreteXShapeGeometryAttributes( const css::uno::Reference<
css::uno::XComponentContext >& xContext, const css::uno::Reference<
css::drawing::XShape >& xShape );
virtual double getLeft() const;
diff --git a/main/vbahelper/inc/vbahelper/vbashape.hxx
b/main/vbahelper/inc/vbahelper/vbashape.hxx
index a479300616..a7938fb32c 100644
--- a/main/vbahelper/inc/vbahelper/vbashape.hxx
+++ b/main/vbahelper/inc/vbahelper/vbashape.hxx
@@ -33,6 +33,7 @@
#include <cppuhelper/implbase2.hxx>
#include <vbahelper/vbahelperinterface.hxx>
+#include <memory>
typedef ::cppu::WeakImplHelper2< ov::msforms::XShape,
css::lang::XEventListener > ListeningShape;
@@ -42,7 +43,7 @@ class VBAHELPER_DLLPUBLIC ScVbaShape : public ScVbaShape_BASE
{
private:
protected:
- std::auto_ptr< ov::ShapeHelper > m_pShapeHelper;
+ std::unique_ptr< ov::ShapeHelper > m_pShapeHelper;
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/main/vbahelper/source/msforms/vbacombobox.hxx
b/main/vbahelper/source/msforms/vbacombobox.hxx
index 21068f4438..e383bf4476 100644
--- a/main/vbahelper/source/msforms/vbacombobox.hxx
+++ b/main/vbahelper/source/msforms/vbacombobox.hxx
@@ -34,11 +34,12 @@
#include "vbacontrol.hxx"
#include "vbalistcontrolhelper.hxx"
#include <vbahelper/vbahelper.hxx>
+#include <memory>
typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XComboBox,
css::script::XDefaultProperty > ComboBoxImpl_BASE;
class ScVbaComboBox : public ComboBoxImpl_BASE
{
- std::auto_ptr< ListControlHelper > mpListHelper;
+ std::unique_ptr< ListControlHelper > mpListHelper;
rtl::OUString sSourceName;
rtl::OUString msDftPropName;
bool mbDialogType;
diff --git a/main/vbahelper/source/msforms/vbacontrol.cxx
b/main/vbahelper/source/msforms/vbacontrol.cxx
index a17fb96947..1ae663154d 100644
--- a/main/vbahelper/source/msforms/vbacontrol.cxx
+++ b/main/vbahelper/source/msforms/vbacontrol.cxx
@@ -412,7 +412,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32
/*nTabIndex*/ )
xProps->getPropertyValue( sClassId ) >>= nClassId;
uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be
worksheet I guess
uno::Reference< drawing::XShape > xShape( xControlShape,
uno::UNO_QUERY_THROW );
- ::std::auto_ptr< ConcreteXShapeGeometryAttributes > xGeoHelper( new
ConcreteXShapeGeometryAttributes( xContext, xShape ) );
+ ::std::unique_ptr< ConcreteXShapeGeometryAttributes > xGeoHelper( new
ConcreteXShapeGeometryAttributes( xContext, xShape ) );
switch( nClassId )
{
@@ -447,7 +447,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32
/*nTabIndex*/ )
uno::Reference< lang::XServiceInfo > xServiceInfo( xProps,
uno::UNO_QUERY_THROW );
uno::Reference< msforms::XControl > xVBAControl;
uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be
worksheet I guess
- ::std::auto_ptr< UserFormGeometryHelper > xGeoHelper( new
UserFormGeometryHelper( xContext, xControl, fOffsetX, fOffsetY ) );
+ ::std::unique_ptr< UserFormGeometryHelper > xGeoHelper( new
UserFormGeometryHelper( xContext, xControl, fOffsetX, fOffsetY ) );
if ( xServiceInfo->supportsService( rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) )
xVBAControl.set( new ScVbaCheckbox( xVbaParent, xContext, xControl,
xModel, xGeoHelper.release() ) );
diff --git a/main/vbahelper/source/msforms/vbacontrol.hxx
b/main/vbahelper/source/msforms/vbacontrol.hxx
index ca046fea59..e0d6410ccb 100644
--- a/main/vbahelper/source/msforms/vbacontrol.hxx
+++ b/main/vbahelper/source/msforms/vbacontrol.hxx
@@ -49,7 +49,7 @@ protected:
// whether it is necessary is another question
::rtl::OUString m_aControlTag;
- std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
+ std::unique_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
css::uno::Reference< css::beans::XPropertySet > m_xProps;
css::uno::Reference< css::uno::XInterface > m_xControl;
css::uno::Reference< css::frame::XModel > m_xModel;
diff --git a/main/vbahelper/source/msforms/vbacontrols.cxx
b/main/vbahelper/source/msforms/vbacontrols.cxx
index 0ac0f4b486..e58287e22f 100644
--- a/main/vbahelper/source/msforms/vbacontrols.cxx
+++ b/main/vbahelper/source/msforms/vbacontrols.cxx
@@ -35,7 +35,7 @@
#include "vbacontrol.hxx"
#include <cppuhelper/implbase2.hxx>
#include <ooo/vba/XControlProvider.hpp>
-#include <hash_map>
+#include <unordered_map>
using namespace com::sun::star;
using namespace ooo::vba;
@@ -43,7 +43,7 @@ using namespace ooo::vba;
typedef ::cppu::WeakImplHelper2< container::XNameAccess,
container::XIndexAccess > ArrayWrapImpl;
-typedef std::hash_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash,
+typedef std::unordered_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > ControlIndexMap;
typedef std::vector< uno::Reference< awt::XControl > > ControlVec;
diff --git a/main/vbahelper/source/msforms/vbalistbox.hxx
b/main/vbahelper/source/msforms/vbalistbox.hxx
index b28ef0f793..410fade23e 100644
--- a/main/vbahelper/source/msforms/vbalistbox.hxx
+++ b/main/vbahelper/source/msforms/vbalistbox.hxx
@@ -32,12 +32,13 @@
#include <vbahelper/vbapropvalue.hxx>
#include "vbalistcontrolhelper.hxx"
#include <vbahelper/vbahelper.hxx>
+#include <memory>
typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XListBox,
css::script::XDefaultProperty > ListBoxImpl_BASE;
class ScVbaListBox : public ListBoxImpl_BASE
,public PropListener
{
- std::auto_ptr< ListControlHelper > mpListHelper;
+ std::unique_ptr< ListControlHelper > mpListHelper;
rtl::OUString sSourceName;
rtl::OUString msDftPropName;
diff --git a/main/vbahelper/source/vbahelper/vbaapplicationbase.cxx
b/main/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 9c352106f3..e1d62be7d5 100644
--- a/main/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/main/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
-#include <hash_map>
+#include <unordered_map>
#include <filter/msfilter/msvbahelper.hxx>
#include <tools/datetime.hxx>
@@ -151,7 +151,7 @@ struct VbaTimerInfoHash
};
// ====VbaTimerHashMap==================================
-typedef ::std::hash_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash,
::std::equal_to< VbaTimerInfo > > VbaTimerHashMap;
+typedef ::std::unordered_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash,
::std::equal_to< VbaTimerInfo > > VbaTimerHashMap;
// ====VbaApplicationBase_Impl==================================
struct VbaApplicationBase_Impl
diff --git a/main/vbahelper/source/vbahelper/vbadocumentsbase.cxx
b/main/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index 0230ede5ea..70c60d93bc 100644
--- a/main/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/main/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -47,7 +47,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <sfx2/objsh.hxx>
#include <tools/urlobj.hxx>
-#include <hash_map>
+#include <unordered_map>
#include <osl/file.hxx>
#include "vbahelper/vbahelper.hxx"
@@ -59,7 +59,7 @@ using namespace ::com::sun::star;
static const rtl::OUString sSpreadsheetDocument(
rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ) );
static const rtl::OUString sTextDocument( rtl::OUString::createFromAscii(
"com.sun.star.text.TextDocument" ) );
-typedef std::hash_map< rtl::OUString,
+typedef std::unordered_map< rtl::OUString,
sal_Int32, ::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > NameIndexHash;