Kaydet (Commit) e48e0632 authored tarafından Gabor Kelemen's avatar Gabor Kelemen Kaydeden (comit) Noel Grandin

o3tl::make_unique -> std::make_unique in basctl...bridges

Since it is now possible to use C++14, it's time to replace
the temporary solution with the standard one

Change-Id: I9a20a58c68d12656359dcaa060d8ab41f621af32
Reviewed-on: https://gerrit.libreoffice.org/66262
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b0f3f309
......@@ -19,7 +19,6 @@
#include <sal/config.h>
#include <o3tl/make_unique.hxx>
#include <sfx2/app.hxx>
#include <sfx2/printer.hxx>
#include <sfx2/objface.hxx>
......@@ -63,7 +62,7 @@ DocShell::~DocShell()
SfxPrinter* DocShell::GetPrinter( bool bCreate )
{
if ( !pPrinter && bCreate )
pPrinter.disposeAndReset(VclPtr<SfxPrinter>::Create(o3tl::make_unique<SfxItemSet>(
pPrinter.disposeAndReset(VclPtr<SfxPrinter>::Create(std::make_unique<SfxItemSet>(
GetPool(), svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN>{}
)));
......
......@@ -23,7 +23,6 @@
#include <strings.hrc>
#include <bitmaps.hlst>
#include <iderid.hxx>
#include <o3tl/make_unique.hxx>
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
#include <tools/debug.hxx>
......@@ -212,7 +211,7 @@ void TreeListBox::ScanEntry( const ScriptDocument& rDocument, LibraryLocation eL
AddEntry(
aRootName,
aImage,
nullptr, true, o3tl::make_unique<DocumentEntry>(rDocument, eLocation));
nullptr, true, std::make_unique<DocumentEntry>(rDocument, eLocation));
}
SetUpdateMode(true);
......@@ -274,7 +273,7 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons
aLibName,
Image(StockImage::Yes, sId),
pDocumentRootEntry, true,
o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY));
std::make_unique<Entry>(OBJ_TYPE_LIBRARY));
}
}
}
......@@ -310,7 +309,7 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
aModName,
Image(StockImage::Yes, RID_BMP_MODULE),
pLibRootEntry, false,
o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
std::make_unique<Entry>(OBJ_TYPE_MODULE));
}
// methods
......@@ -373,7 +372,7 @@ void TreeListBox::ImpCreateLibSubEntriesInVBAMode( SvTreeListEntry* pLibRootEntr
AddEntry(
aEntryName,
Image(StockImage::Yes, RID_BMP_MODLIB),
pLibRootEntry, true, o3tl::make_unique<Entry>(eType));
pLibRootEntry, true, std::make_unique<Entry>(eType));
}
}
}
......@@ -435,7 +434,7 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo
aEntryName,
Image(StockImage::Yes, RID_BMP_MODULE),
pLibSubRootEntry, false,
o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
std::make_unique<Entry>(OBJ_TYPE_MODULE));
}
// methods
......@@ -639,7 +638,7 @@ void TreeListBox::FillTreeListBox( SvTreeListEntry* pRootEntry, const Sequence<
aName,
Image(StockImage::Yes, aBmpMacro),
pRootEntry, false,
o3tl::make_unique<Entry>( eType ));
std::make_unique<Entry>( eType ));
}
}
}
......@@ -913,7 +912,7 @@ void SbTreeListBox::ScanEntry( const ScriptDocument& rDocument, LibraryLocation
{
OUString aRootName(GetRootEntryName(rDocument, eLocation));
OUString aImage(GetRootEntryBitmaps(rDocument));
AddEntry(aRootName, aImage, nullptr, true, o3tl::make_unique<DocumentEntry>(rDocument, eLocation));
AddEntry(aRootName, aImage, nullptr, true, std::make_unique<DocumentEntry>(rDocument, eLocation));
}
m_xControl->thaw();
}
......@@ -971,7 +970,7 @@ void SbTreeListBox::ImpCreateLibEntries(weld::TreeIter& rIter, const ScriptDocum
}
else
{
AddEntry(aLibName, sId, &rIter, true, o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY));
AddEntry(aLibName, sId, &rIter, true, std::make_unique<Entry>(OBJ_TYPE_LIBRARY));
}
}
}
......@@ -1008,7 +1007,7 @@ void SbTreeListBox::ImpCreateLibSubEntries(weld::TreeIter& rLibRootEntry, const
bool bModuleEntry = FindEntry(aModName, OBJ_TYPE_MODULE, *xTreeIter);
if (!bModuleEntry)
{
AddEntry(aModName, RID_BMP_MODULE, &rLibRootEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
AddEntry(aModName, RID_BMP_MODULE, &rLibRootEntry, false, std::make_unique<Entry>(OBJ_TYPE_MODULE));
}
// methods
......@@ -1027,7 +1026,7 @@ void SbTreeListBox::ImpCreateLibSubEntries(weld::TreeIter& rLibRootEntry, const
bool bEntry = FindEntry(aName, OBJ_TYPE_METHOD, *xSubTreeIter);
if (!bEntry)
{
AddEntry(aName, RID_BMP_MACRO, xTreeIter.get(), false, o3tl::make_unique<Entry>(OBJ_TYPE_METHOD));
AddEntry(aName, RID_BMP_MACRO, xTreeIter.get(), false, std::make_unique<Entry>(OBJ_TYPE_METHOD));
}
}
}
......@@ -1064,7 +1063,7 @@ void SbTreeListBox::ImpCreateLibSubEntries(weld::TreeIter& rLibRootEntry, const
bool bDialogEntry = FindEntry(aDlgName, OBJ_TYPE_DIALOG, *xTreeIter);
if (!bDialogEntry)
{
AddEntry(aDlgName, RID_BMP_DIALOG, &rLibRootEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_DIALOG));
AddEntry(aDlgName, RID_BMP_DIALOG, &rLibRootEntry, false, std::make_unique<Entry>(OBJ_TYPE_DIALOG));
}
}
}
......@@ -1098,7 +1097,7 @@ void SbTreeListBox::ImpCreateLibSubEntriesInVBAMode(weld::TreeIter& rLibRootEntr
else
{
m_xControl->copy_iterator(rLibRootEntry, *xLibSubRootEntry);
AddEntry(aEntryName, RID_BMP_MODLIB, xLibSubRootEntry.get(), true, o3tl::make_unique<Entry>(eType));
AddEntry(aEntryName, RID_BMP_MODLIB, xLibSubRootEntry.get(), true, std::make_unique<Entry>(eType));
}
}
}
......@@ -1159,7 +1158,7 @@ void SbTreeListBox::ImpCreateLibSubSubEntriesInVBAMode(weld::TreeIter& rLibSubRo
{
m_xControl->copy_iterator(rLibSubRootEntry, *xModuleEntry);
AddEntry(aEntryName, RID_BMP_MODULE, xModuleEntry.get(), false,
o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
std::make_unique<Entry>(OBJ_TYPE_MODULE));
}
// methods
......@@ -1176,7 +1175,7 @@ void SbTreeListBox::ImpCreateLibSubSubEntriesInVBAMode(weld::TreeIter& rLibSubRo
bool bEntry = FindEntry(aName, OBJ_TYPE_METHOD, *xEntry);
if (!bEntry)
{
AddEntry(aName, RID_BMP_MACRO, xModuleEntry.get(), false, o3tl::make_unique<Entry>(OBJ_TYPE_METHOD));
AddEntry(aName, RID_BMP_MACRO, xModuleEntry.get(), false, std::make_unique<Entry>(OBJ_TYPE_METHOD));
}
}
}
......
......@@ -35,7 +35,6 @@
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <unotools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <o3tl/make_unique.hxx>
namespace basctl
{
......@@ -118,7 +117,7 @@ Dll::Dll () :
{
SfxObjectFactory& rFactory = DocShell::Factory();
auto pModule = o3tl::make_unique<Module>("basctl", &rFactory);
auto pModule = std::make_unique<Module>("basctl", &rFactory);
SfxModule* pMod = pModule.get();
SfxApplication::SetModule(SfxToolsModule::Basic, std::move(pModule));
......
......@@ -24,7 +24,6 @@
#include <bitmaps.hlst>
#include <iderdll.hxx>
#include "iderdll2.hxx"
#include <o3tl/make_unique.hxx>
#include <svx/passwd.hxx>
#include <ucbhelper/content.hxx>
#include <rtl/uri.hxx>
......@@ -250,7 +249,7 @@ void CheckBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rTxt,
for ( sal_uInt16 nCol = 1; nCol < nCount; ++nCol )
{
SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nCol ));
pEntry->ReplaceItem(o3tl::make_unique<LibLBoxString>( rCol.GetText() ), nCol);
pEntry->ReplaceItem(std::make_unique<LibLBoxString>( rCol.GetText() ), nCol);
}
}
}
......@@ -1531,7 +1530,7 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument,
aLibName,
Image(StockImage::Yes, sId),
pRootEntry, false,
o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY));
std::make_unique<Entry>(OBJ_TYPE_LIBRARY));
DBG_ASSERT( pNewLibEntry, "Insert entry failed!" );
if( pNewLibEntry )
......@@ -1540,7 +1539,7 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument,
aModName,
Image(StockImage::Yes, RID_BMP_MODULE),
pNewLibEntry, false,
o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
std::make_unique<Entry>(OBJ_TYPE_MODULE));
DBG_ASSERT( pEntry_, "Insert entry failed!" );
pBasicBox->SetCurEntry( pEntry_ );
pBasicBox->Select( pBasicBox->GetCurEntry() ); // OV-Bug?!
......@@ -1640,8 +1639,8 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument,
BrowseMode nMode = pBasicBox->GetMode();
bool bDlgMode = ( nMode & BrowseMode::Dialogs ) && !( nMode & BrowseMode::Modules );
const OUString sId = bDlgMode ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_MODLIB);
pBasicBox->AddEntry(aLibName, sId, xRootEntry.get(), false, o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY));
pBasicBox->AddEntry(aModName, RID_BMP_MODULE, xRootEntry.get(), false, o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
pBasicBox->AddEntry(aLibName, sId, xRootEntry.get(), false, std::make_unique<Entry>(OBJ_TYPE_LIBRARY));
pBasicBox->AddEntry(aModName, RID_BMP_MODULE, xRootEntry.get(), false, std::make_unique<Entry>(OBJ_TYPE_MODULE));
pBasicBox->set_cursor(*xRootEntry);
pBasicBox->select(*xRootEntry);
}
......
......@@ -29,7 +29,6 @@
#include <basic/basmgr.hxx>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <comphelper/processfactory.hxx>
#include <o3tl/make_unique.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
......@@ -862,7 +861,7 @@ void ObjectPage::NewDialog()
aDlgName,
Image(StockImage::Yes, RID_BMP_DIALOG),
pLibEntry, false,
o3tl::make_unique<Entry>(OBJ_TYPE_DIALOG));
std::make_unique<Entry>(OBJ_TYPE_DIALOG));
DBG_ASSERT( pEntry, "Insert entry failed!" );
}
m_pBasicBox->SetCurEntry( pEntry );
......@@ -1031,7 +1030,7 @@ SbModule* createModImpl(weld::Window* pWin, const ScriptDocument& rDocument,
aModName,
Image(StockImage::Yes, RID_BMP_MODULE),
pSubRootEntry, false,
o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
std::make_unique<Entry>(OBJ_TYPE_MODULE));
DBG_ASSERT( pEntry, "Insert entry failed!" );
}
rBasicBox.SetCurEntry( pEntry );
......@@ -1127,7 +1126,7 @@ SbModule* createModImpl(weld::Window* pWin, const ScriptDocument& rDocument,
if (!bEntry)
{
rBasicBox.AddEntry(aModName, RID_BMP_MODULE, xEntry.get(), false,
o3tl::make_unique<Entry>(OBJ_TYPE_MODULE));
std::make_unique<Entry>(OBJ_TYPE_MODULE));
}
rBasicBox.set_cursor(*xEntry);
rBasicBox.select(*xEntry);
......
......@@ -32,7 +32,6 @@
#include <tools/diagnose_ex.h>
#include <basic/sbmod.hxx>
#include <unotools/intlwrapper.hxx>
#include <o3tl/make_unique.hxx>
#include <sal/log.hxx>
#include <basic/sbuno.hxx>
......
......@@ -20,7 +20,6 @@
#include <sal/config.h>
#include <o3tl/any.hxx>
#include <o3tl/make_unique.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/errcode.hxx>
......@@ -4646,7 +4645,7 @@ void SbUnoStructRefObject::initMemberCache()
for ( sal_Int32 nPos = pCompTypeDescr->nMembers; nPos--; )
{
OUString aName( ppNames[nPos] );
maFields[ aName ] = o3tl::make_unique<StructRefInfo>( maMemberInfo.getRootAnyRef(), ppTypeRefs[nPos], maMemberInfo.getPos() + pMemberOffsets[nPos] );
maFields[ aName ] = std::make_unique<StructRefInfo>( maMemberInfo.getRootAnyRef(), ppTypeRefs[nPos], maMemberInfo.getPos() + pMemberOffsets[nPos] );
}
}
typelib_typedescription_release(pTD);
......
This diff is collapsed.
......@@ -22,7 +22,6 @@
#include <com/sun/star/script/ModuleType.hpp>
#include <svtools/miscopt.hxx>
#include <rtl/character.hxx>
#include <o3tl/make_unique.hxx>
struct SbiParseStack { // "Stack" for statement-blocks
SbiParseStack* pNext; // Chain
......@@ -508,10 +507,10 @@ void SbiParser::Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo )
if( nParCount == 2 || nParCount == 3 )
{
if( nParCount == 2 )
pPar->addExpression( o3tl::make_unique<SbiExpression>( this, -1, SbxLONG ) );
pPar->addExpression( std::make_unique<SbiExpression>( this, -1, SbxLONG ) );
TestToken( EQ );
pPar->addExpression( o3tl::make_unique<SbiExpression>( this ) );
pPar->addExpression( std::make_unique<SbiExpression>( this ) );
bSpecialMidHandling = true;
}
......
......@@ -25,7 +25,6 @@
#include <svtools/miscopt.hxx>
#include <rtl/character.hxx>
#include <memory>
#include <o3tl/make_unique.hxx>
// This routine is defined here, so that the
// compiler can be loaded as a discrete segment.
......@@ -42,7 +41,7 @@ bool SbModule::Compile()
SbModule* pOld = GetSbData()->pCompMod;
GetSbData()->pCompMod = this;
auto pParser = o3tl::make_unique<SbiParser>( pBasic, this );
auto pParser = std::make_unique<SbiParser>( pBasic, this );
while( pParser->Parse() ) {}
if( !pParser->GetErrors() )
pParser->aGen.Save();
......
......@@ -26,7 +26,6 @@
#include <stdio.h>
#include <string.h>
#include <rtl/character.hxx>
#include <o3tl/make_unique.hxx>
// All symbol names are laid down int the symbol-pool's stringpool, so that
// all symbols are handled in the same case. On saving the code-image, the
......@@ -352,7 +351,7 @@ SbiSymPool& SbiSymDef::GetPool()
{
if( !pPool )
{
pPool = o3tl::make_unique<SbiSymPool>( pIn->pParser->aGblStrings, SbLOCAL, pIn->pParser );// is dumped
pPool = std::make_unique<SbiSymPool>( pIn->pParser->aGblStrings, SbLOCAL, pIn->pParser );// is dumped
}
return *pPool;
}
......@@ -378,7 +377,7 @@ SbiProcDef::SbiProcDef( SbiParser* pParser, const OUString& rName,
, mbProcDecl( bProcDecl )
{
aParams.SetParent( &pParser->aPublics );
pPool = o3tl::make_unique<SbiSymPool>( pParser->aGblStrings, SbLOCAL, pParser );
pPool = std::make_unique<SbiSymPool>( pParser->aGblStrings, SbLOCAL, pParser );
pPool->SetParent( &aParams );
nLine1 =
nLine2 = 0;
......
......@@ -65,7 +65,6 @@
#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
#include <memory>
#include <random>
#include <o3tl/make_unique.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
using namespace comphelper;
......@@ -2567,7 +2566,7 @@ static OUString implSetupWildcard(const OUString& rFileParam, SbiRTLData& rRTLDa
// invalid anyway because it was not accepted by OSL before
if (aPureFileName != "*")
{
rRTLData.pWildCard = o3tl::make_unique<WildCard>(aPureFileName);
rRTLData.pWildCard = std::make_unique<WildCard>(aPureFileName);
}
return aPathStr;
}
......@@ -2798,7 +2797,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool)
// Read directory
bool bIncludeFolders = bool(nFlags & SbAttributes::DIRECTORY);
rRTLData.pDir = o3tl::make_unique<Directory>(aDirURL);
rRTLData.pDir = std::make_unique<Directory>(aDirURL);
FileBase::RC nRet = rRTLData.pDir->open();
if( nRet != FileBase::E_None )
{
......
......@@ -18,7 +18,6 @@
*/
#include <memory>
#include <o3tl/make_unique.hxx>
#include <tools/debug.hxx>
#include <tools/stream.hxx>
#include <vcl/svapp.hxx>
......@@ -280,7 +279,7 @@ SbxInfo::~SbxInfo()
void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, SbxFlagBits nFlags)
{
m_Params.push_back(o3tl::make_unique<SbxParamInfo>(rName, eType, nFlags));
m_Params.push_back(std::make_unique<SbxParamInfo>(rName, eType, nFlags));
}
const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const
......
......@@ -50,8 +50,6 @@
#include <sal/log.hxx>
#include <svl/zforlist.hxx>
#include <o3tl/make_unique.hxx>
void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep, sal_Unicode& rcDecimalSepAlt )
{
......@@ -858,7 +856,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
OUString aFalseStrg = BasResId(STR_BASICKEY_FORMAT_FALSE);
OUString aCurrencyFormatStrg = BasResId(STR_BASICKEY_FORMAT_CURRENCY);
rAppData.pBasicFormater = o3tl::make_unique<SbxBasicFormater>(
rAppData.pBasicFormater = std::make_unique<SbxBasicFormater>(
cComma,c1000,aOnStrg,aOffStrg,
aYesStrg,aNoStrg,aTrueStrg,aFalseStrg,
aCurrencyStrg,aCurrencyFormatStrg );
......
......@@ -28,7 +28,6 @@
#include <dlfcn.h>
#include <o3tl/make_unique.hxx>
#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
......@@ -210,7 +209,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr)
default:
{
m_rttiNames.emplace_back(OString(rttiName));
auto pad = o3tl::make_unique<char[]>(
auto pad = std::make_unique<char[]>(
sizeof (__cxxabiv1::__vmi_class_type_info)
+ ((itd.nBaseTypes - 1)
* sizeof (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment