diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-07 15:56:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-07 19:15:55 +0000 |
commit | c596fd59dc75823002bdfd3676d600a56e3bfb5e (patch) | |
tree | 03a4f761c0e729de27a245bcf3a7701fd5b35781 /basic | |
parent | e096fbc3e06d2c2b55ef8706c954efb6555ca0e6 (diff) |
no need to allocate these separately
they are all one or two words in size
Change-Id: I86611e14a32dda3ae2226bbfa775ad0234513888
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148425
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/inc/runtime.hxx | 6 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index f202a2acaa08..662a7d696859 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -32,12 +32,14 @@ #include <cmath> #include <vector> #include <memory> +#include <optional> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <unotools/localedatawrapper.hxx> #include <o3tl/deleter.hxx> #include <o3tl/typed_flags_set.hxx> +#include <tools/wldcrd.hxx> class SbiInstance; // active StarBASIC process class SbiRuntime; // active StarBASIC procedure instance @@ -99,8 +101,6 @@ namespace o3tl template<> struct typed_flags<SbAttributes> : is_typed_flags<SbAttributes, 0x13> {}; } -class WildCard; - class SbiRTLData { public: @@ -110,7 +110,7 @@ public: short nCurDirPos; OUString sFullNameToBeChecked; - std::unique_ptr<WildCard> pWildCard; + std::optional<WildCard> moWildCard; css::uno::Sequence< OUString > aDirSeq; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 8d50c6cc3409..3e0194f5783f 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2490,7 +2490,7 @@ static OUString implSetupWildcard(const OUString& rFileParam, SbiRTLData& rRTLDa static const char cWild1 = '*'; static const char cWild2 = '?'; - rRTLData.pWildCard.reset(); + rRTLData.moWildCard.reset(); rRTLData.sFullNameToBeChecked.clear(); OUString aFileParam = rFileParam; @@ -2544,7 +2544,7 @@ static OUString implSetupWildcard(const OUString& rFileParam, SbiRTLData& rRTLDa // invalid anyway because it was not accepted by OSL before if (aPureFileName != "*") { - rRTLData.pWildCard = std::make_unique<WildCard>(aPureFileName); + rRTLData.moWildCard.emplace(aPureFileName); } return aPathStr; } @@ -2553,9 +2553,9 @@ static bool implCheckWildcard(std::u16string_view rName, SbiRTLData const& rRTLD { bool bMatch = true; - if (rRTLData.pWildCard) + if (rRTLData.moWildCard) { - bMatch = rRTLData.pWildCard->Matches(rName); + bMatch = rRTLData.moWildCard->Matches(rName); } return bMatch; } |