From 979aed6b38f4963ea37c39de090d4487a12ba2ba Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Thu, 17 Jan 2019 18:35:37 +0100 Subject: o3tl::make_unique -> std::make_unique in dbaccess...framework Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Iad5a422bc5a7da43d905edc91d1c46793332ec5e Reviewed-on: https://gerrit.libreoffice.org/66545 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/source/ui/control/dbtreelistbox.cxx | 4 ++-- dbaccess/source/ui/control/tabletree.cxx | 3 +-- dbaccess/source/ui/misc/WNameMatch.cxx | 3 +-- dbaccess/source/ui/querydesign/JoinTableView.cxx | 5 ++--- dbaccess/source/ui/querydesign/QueryTableView.cxx | 5 ++--- dbaccess/source/ui/tabledesign/TEditControl.cxx | 17 ++++++++--------- dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx | 3 +-- dbaccess/source/ui/uno/UserSettingsDlg.cxx | 3 +-- dbaccess/source/ui/uno/composerdialogs.cxx | 5 ++--- dbaccess/source/ui/uno/textconnectionsettings_uno.cxx | 3 +-- dbaccess/source/ui/uno/unosqlmessage.cxx | 5 ++--- 11 files changed, 23 insertions(+), 33 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 0f4c404c1c3b..43b6ecb1fa0e 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -43,7 +43,7 @@ #include #include -#include + namespace dbaui { @@ -142,7 +142,7 @@ void DBTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& aStr, co { SvTreeListBox::InitEntry( _pEntry, aStr, _rCollEntryBmp,_rExpEntryBmp, eButtonKind); SvLBoxItem* pTextItem(_pEntry->GetFirstItem(SvLBoxItemType::String)); - _pEntry->ReplaceItem(o3tl::make_unique(aStr), _pEntry->GetPos(pTextItem)); + _pEntry->ReplaceItem(std::make_unique(aStr), _pEntry->GetPos(pTextItem)); } void DBTreeListBox::implStopSelectionTimer() diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index bf68b08b3c53..9e8b7de36fb5 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include @@ -389,7 +388,7 @@ void OTableTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& _rSt size_t nTextPos = _pEntry->GetPos(pTextItem); OSL_ENSURE(SvTreeListEntry::ITEM_NOT_FOUND != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); - _pEntry->ReplaceItem(o3tl::make_unique(_rString), nTextPos); + _pEntry->ReplaceItem(std::make_unique(_rString), nTextPos); } SvTreeListEntry* OTableTreeListBox::implAddEntry( diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 782e62d1b4e0..237ba44929d6 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -29,7 +29,6 @@ #include #include #include -#include using namespace ::dbaui; @@ -382,7 +381,7 @@ VCL_BUILDER_FACTORY(OColumnTreeBox) void OColumnTreeBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) { DBTreeListBox::InitEntry(pEntry, rStr, rImg1, rImg2, eButtonKind); - pEntry->ReplaceItem(o3tl::make_unique(rStr,false), pEntry->ItemCount() - 1); + pEntry->ReplaceItem(std::make_unique(rStr,false), pEntry->ItemCount() - 1); } bool OColumnTreeBox::Select( SvTreeListEntry* pEntry, bool bSelect ) diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 9a9320a69fad..942ddafa40bf 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -1077,7 +1076,7 @@ void OJoinTableView::TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPositi Point ptThumbPos(GetHScrollBar().GetThumbPos(), GetVScrollBar().GetThumbPos()); ptWhich->GetData()->SetPosition(ptWhich->GetPosPixel() + ptThumbPos); - invalidateAndModify(o3tl::make_unique(this, ptOldPosition, ptWhich)); + invalidateAndModify(std::make_unique(this, ptOldPosition, ptWhich)); } void OJoinTableView::TabWinSized(OTableWindow* ptWhich, const Point& ptOldPosition, const Size& szOldSize) @@ -1085,7 +1084,7 @@ void OJoinTableView::TabWinSized(OTableWindow* ptWhich, const Point& ptOldPositi ptWhich->GetData()->SetSize(ptWhich->GetSizePixel()); ptWhich->GetData()->SetPosition(ptWhich->GetPosPixel()); - invalidateAndModify(o3tl::make_unique(this, ptOldPosition, szOldSize, ptWhich)); + invalidateAndModify(std::make_unique(this, ptOldPosition, szOldSize, ptWhich)); } bool OJoinTableView::IsAddAllowed() diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index d5c4a63c70bf..9f5c8a1520b9 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -49,7 +49,6 @@ #include #include #include -#include using namespace dbaui; using namespace ::com::sun::star::uno; @@ -111,7 +110,7 @@ namespace // add an undo action if ( _bAddUndo ) addUndoAction( _pView, - o3tl::make_unique(_pView), + std::make_unique(_pView), static_cast< OQueryTableConnection*>(_pConnection)); // redraw _pConnection->RecalcLines(); @@ -630,7 +629,7 @@ bool OQueryTableView::RemoveConnection(VclPtr& rConnection, bo // add undo action addUndoAction(this, - o3tl::make_unique(this), + std::make_unique(this), xConnection.get(), true); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 7fd6bc3341cd..be0fd79a8962 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -41,7 +41,6 @@ #include #include #include -#include #include #include "TableFieldControl.hxx" #include @@ -509,7 +508,7 @@ void OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId) // If FieldDescr exists, the field is deleted and the old content restored if (pActFieldDescr) { - GetUndoManager().AddUndoAction(o3tl::make_unique(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo())); + GetUndoManager().AddUndoAction(std::make_unique(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo())); SwitchType(TOTypeInfoSP()); pActFieldDescr = pActRow->GetActFieldDescr(); } @@ -660,14 +659,14 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) nInvalidateTypeEvent = Application::PostUserEvent( LINK(this, OTableEditorCtrl, InvalidateFieldType), nullptr, true ); pActFieldDescr = pActRow->GetActFieldDescr(); pDescrWin->DisplayData( pActFieldDescr ); - GetUndoManager().AddUndoAction( o3tl::make_unique(this, nRow, nColId+1, TOTypeInfoSP()) ); + GetUndoManager().AddUndoAction( std::make_unique(this, nRow, nColId+1, TOTypeInfoSP()) ); } if( nColId != FIELD_TYPE ) - GetUndoManager().AddUndoAction( o3tl::make_unique(this, nRow, nColId) ); + GetUndoManager().AddUndoAction( std::make_unique(this, nRow, nColId) ); else { - GetUndoManager().AddUndoAction(o3tl::make_unique(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo())); + GetUndoManager().AddUndoAction(std::make_unique(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo())); resetType(); } @@ -801,7 +800,7 @@ void OTableEditorCtrl::InsertRows( long nRow ) RowInserted( nRow,vInsertedUndoRedoRows.size() ); // Create the Undo-Action - GetUndoManager().AddUndoAction( o3tl::make_unique(this, nRow,vInsertedUndoRedoRows) ); + GetUndoManager().AddUndoAction( std::make_unique(this, nRow,vInsertedUndoRedoRows) ); GetView()->getController().setModified( true ); InvalidateFeatures(); } @@ -810,7 +809,7 @@ void OTableEditorCtrl::DeleteRows() { OSL_ENSURE(GetView()->getController().isDropAllowed(),"Call of DeleteRows not valid here. Please check isDropAllowed!"); // Create the Undo-Action - GetUndoManager().AddUndoAction( o3tl::make_unique(this) ); + GetUndoManager().AddUndoAction( std::make_unique(this) ); // Delete all marked rows long nIndex = FirstSelectedRow(); @@ -847,7 +846,7 @@ void OTableEditorCtrl::InsertNewRows( long nRow ) long nInsertRows = GetSelectRowCount(); if( !nInsertRows ) nInsertRows = 1; - GetUndoManager().AddUndoAction( o3tl::make_unique(this, nRow, nInsertRows) ); + GetUndoManager().AddUndoAction( std::make_unique(this, nRow, nInsertRows) ); // Insert the number of selected rows for( long i=nRow; i<(nRow+nInsertRows); i++ ) m_pRowList->insert( m_pRowList->begin()+i ,std::make_shared()); @@ -1527,7 +1526,7 @@ void OTableEditorCtrl::SetPrimaryKey( bool bSet ) } } - GetUndoManager().AddUndoAction( o3tl::make_unique(this, aDeletedPrimKeys, aInsertedPrimKeys) ); + GetUndoManager().AddUndoAction( std::make_unique(this, aDeletedPrimKeys, aInsertedPrimKeys) ); // Invalidate the handle-columns InvalidateHandleColumn(); diff --git a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx index 3a498049c7a7..2a63428abd9c 100644 --- a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx @@ -26,7 +26,6 @@ #include #include #include -#include namespace dbaui { @@ -126,7 +125,7 @@ namespace dbaui svt::OGenericUnoDialog::Dialog OAdvancedSettingsDialog::createDialog(const css::uno::Reference& rParent) { - return svt::OGenericUnoDialog::Dialog(o3tl::make_unique(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), + return svt::OGenericUnoDialog::Dialog(std::make_unique(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection)); } diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.cxx b/dbaccess/source/ui/uno/UserSettingsDlg.cxx index 760805897ab4..7cd0d3054699 100644 --- a/dbaccess/source/ui/uno/UserSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/UserSettingsDlg.cxx @@ -23,7 +23,6 @@ #include #include #include -#include using namespace dbaui; @@ -95,7 +94,7 @@ Reference SAL_CALL OUserSettingsDialog::getPropertySetInfo() svt::OGenericUnoDialog::Dialog OUserSettingsDialog::createDialog(const css::uno::Reference& rParent) { - return svt::OGenericUnoDialog::Dialog(o3tl::make_unique(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection, m_xActiveConnection)); + return svt::OGenericUnoDialog::Dialog(std::make_unique(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection, m_xActiveConnection)); } } // namespace dbaui diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 56593aefe9a6..20e7361c9125 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -31,7 +31,6 @@ #include #include #include -#include extern "C" void createRegistryInfo_ComposerDialogs() { @@ -146,7 +145,7 @@ namespace dbaui std::unique_ptr RowsetFilterDialog::createComposerDialog(weld::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) { - return o3tl::make_unique(_pParent, m_aContext, _rxConnection, m_xComposer, _rxColumns); + return std::make_unique(_pParent, m_aContext, _rxConnection, m_xComposer, _rxColumns); } void SAL_CALL RowsetFilterDialog::initialize( const Sequence< Any >& aArguments ) @@ -194,7 +193,7 @@ namespace dbaui std::unique_ptr RowsetOrderDialog::createComposerDialog(weld::Window* pParent, const Reference< XConnection >& rxConnection, const Reference< XNameAccess >& rxColumns) { - return o3tl::make_unique(pParent, rxConnection, m_xComposer, rxColumns); + return std::make_unique(pParent, rxConnection, m_xComposer, rxColumns); } void SAL_CALL RowsetOrderDialog::initialize( const Sequence< Any >& aArguments ) diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx index 4c7cc453cf7b..37b26c47f387 100644 --- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx +++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx @@ -35,7 +35,6 @@ #include #include #include -#include namespace dbaui { @@ -207,7 +206,7 @@ namespace dbaui svt::OGenericUnoDialog::Dialog OTextConnectionSettingsDialog::createDialog(const css::uno::Reference& rParent) { - return svt::OGenericUnoDialog::Dialog(o3tl::make_unique(Application::GetFrameWeld(rParent), *m_pDatasourceItems)); + return svt::OGenericUnoDialog::Dialog(std::make_unique(Application::GetFrameWeld(rParent), *m_pDatasourceItems)); } void SAL_CALL OTextConnectionSettingsDialog::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue ) diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index c0ca52114eb2..fb9675385738 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -28,7 +28,6 @@ #include #include #include -#include using namespace dbaui; using namespace dbtools; @@ -149,10 +148,10 @@ svt::OGenericUnoDialog::Dialog OSQLMessageDialog::createDialog(const css::uno::R { weld::Window* pParent = Application::GetFrameWeld(rParent); if ( m_aException.hasValue() ) - return svt::OGenericUnoDialog::Dialog(o3tl::make_unique(pParent, SQLExceptionInfo(m_aException), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, m_sHelpURL)); + return svt::OGenericUnoDialog::Dialog(std::make_unique(pParent, SQLExceptionInfo(m_aException), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, m_sHelpURL)); OSL_FAIL("OSQLMessageDialog::createDialog : You should use the SQLException property to specify the error to display!"); - return svt::OGenericUnoDialog::Dialog(o3tl::make_unique(pParent, SQLException())); + return svt::OGenericUnoDialog::Dialog(std::make_unique(pParent, SQLException())); } } // namespace dbaui -- cgit