summaryrefslogtreecommitdiff
path: root/basic/source/classes
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-02 11:20:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-02 12:23:37 +0000
commit1f5797e0c0cc0425e29b7a945485ac146fec0085 (patch)
tree9032bd192a0988ba8d50a8f6beff110525f51680 /basic/source/classes
parent5d2be45a788c450e6f914eea8c3b74d214edaccd (diff)
flatten some classes in basic
no need to allocate separately where the contained class is only one pointer big Change-Id: If5fac0b0e20f80bffebc8611791d07888cbec1e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148089 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source/classes')
-rw-r--r--basic/source/classes/sb.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 0296e2238ca1..7f02e65d9b55 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -901,18 +901,18 @@ StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic )
if( !GetSbData()->nInst++ )
{
- GetSbData()->pSbFac.reset( new SbiFactory );
- AddFactory( GetSbData()->pSbFac.get() );
- GetSbData()->pTypeFac.reset(new SbTypeFactory);
- AddFactory( GetSbData()->pTypeFac.get() );
+ GetSbData()->pSbFac.emplace();
+ AddFactory( &*GetSbData()->pSbFac );
+ GetSbData()->pTypeFac.emplace();
+ AddFactory( &*GetSbData()->pTypeFac );
GetSbData()->pClassFac.reset(new SbClassFactory);
AddFactory( GetSbData()->pClassFac.get() );
- GetSbData()->pOLEFac.reset(new SbOLEFactory);
- AddFactory( GetSbData()->pOLEFac.get() );
- GetSbData()->pFormFac.reset(new SbFormFactory);
- AddFactory( GetSbData()->pFormFac.get() );
- GetSbData()->pUnoFac.reset( new SbUnoFactory );
- AddFactory( GetSbData()->pUnoFac.get() );
+ GetSbData()->pOLEFac.emplace();
+ AddFactory( &*GetSbData()->pOLEFac );
+ GetSbData()->pFormFac.emplace();
+ AddFactory( &*GetSbData()->pFormFac );
+ GetSbData()->pUnoFac.emplace();
+ AddFactory( &*GetSbData()->pUnoFac );
}
pRtl = new SbiStdObject(SB_RTLNAME, this );
// Search via StarBasic is always global
@@ -940,17 +940,17 @@ StarBASIC::~StarBASIC()
if( !--GetSbData()->nInst )
{
- RemoveFactory( GetSbData()->pSbFac.get() );
+ RemoveFactory( &*GetSbData()->pSbFac );
GetSbData()->pSbFac.reset();
- RemoveFactory( GetSbData()->pUnoFac.get() );
+ RemoveFactory( &*GetSbData()->pUnoFac );
GetSbData()->pUnoFac.reset();
- RemoveFactory( GetSbData()->pTypeFac.get() );
+ RemoveFactory( &*GetSbData()->pTypeFac );
GetSbData()->pTypeFac.reset();
RemoveFactory( GetSbData()->pClassFac.get() );
GetSbData()->pClassFac.reset();
- RemoveFactory( GetSbData()->pOLEFac.get() );
+ RemoveFactory( &*GetSbData()->pOLEFac );
GetSbData()->pOLEFac.reset();
- RemoveFactory( GetSbData()->pFormFac.get() );
+ RemoveFactory( &*GetSbData()->pFormFac );
GetSbData()->pFormFac.reset();
if( SbiGlobals::pGlobals )