summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-19 09:10:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-19 08:33:10 +0000
commitd4d2fc24793960a07275e49706b90928b4a0c764 (patch)
tree3d5bd19190426cee18730893ac9ff292caf2566e /svx
parent71b74f8fd1fc84cf92dddeab02647b8b765d0d4a (diff)
clang-tidy modernize-make-unique
Change-Id: I550bb69ddcef69906027516ccde62cf8e87c295b Reviewed-on: https://gerrit.libreoffice.org/25138 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/ctredlin.cxx21
-rw-r--r--svx/source/dialog/fontlb.cxx13
-rw-r--r--svx/source/fmcomp/gridcell.cxx5
3 files changed, 21 insertions, 18 deletions
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index a74418260c86..7003011bad7a 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <o3tl/make_unique.hxx>
#include <vcl/dialog.hxx>
#include <vcl/layout.hxx>
#include <vcl/svapp.hxx>
@@ -335,22 +336,22 @@ void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr,
{
if (nTreeFlags & SvTreeFlags::CHKBTN)
{
- pEntry->AddItem(std::unique_ptr<SvLBoxButton>(
- new SvLBoxButton(eButtonKind, pCheckButtonData)));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(
+ eButtonKind, pCheckButtonData));
}
- pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(
- new SvLBoxContextBmp(rColl, rExp, true)));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(
+ rColl, rExp, true));
// the type of the change
assert((rStr.isEmpty() && !!maEntryImage) || (!rStr.isEmpty() && !maEntryImage));
if (rStr.isEmpty())
- pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp(
- maEntryImage, maEntryImage, true)));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(
+ maEntryImage, maEntryImage, true));
else
- pEntry->AddItem(std::unique_ptr<SvLBoxColorString>(
- new SvLBoxColorString(rStr, maEntryColor)));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxColorString>(
+ rStr, maEntryColor));
// the change tracking entries
sal_Int32 nIndex = 0;
@@ -358,8 +359,8 @@ void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr,
for (sal_uInt16 nToken = 0; nToken < nCount; nToken++)
{
const OUString aToken = GetToken(maEntryString, nIndex);
- pEntry->AddItem(std::unique_ptr<SvLBoxColorString>(
- new SvLBoxColorString(aToken, maEntryColor)));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxColorString>(
+ aToken, maEntryColor));
}
}
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index 65f41e2e6649..265e5c1c2b60 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -18,6 +18,7 @@
*/
#include "svx/fontlb.hxx"
+#include <o3tl/make_unique.hxx>
#include <vcl/builderfactory.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
@@ -133,12 +134,12 @@ void SvxFontListBox::InitEntry(
if( mbUseFont )
{
if( nTreeFlags & SvTreeFlags::CHKBTN )
- pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(
- eButtonKind, pCheckButtonData)));
- pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp(
- rCollImg, rExpImg, true)));
- pEntry->AddItem(std::unique_ptr<SvLBoxFontString>(new SvLBoxFontString(
- rEntryText, maEntryFont, mpEntryColor)));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(
+ eButtonKind, pCheckButtonData));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(
+ rCollImg, rExpImg, true));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxFontString>(
+ rEntryText, maEntryFont, mpEntryColor));
}
else
SvTreeListBox::InitEntry( pEntry, rEntryText, rCollImg, rExpImg,
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 6ca782c34fdf..b14cdd18e14a 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -52,6 +52,7 @@
#include <connectivity/formattedcolumnvalue.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <i18nlangtag/lang.h>
+#include <o3tl/make_unique.hxx>
#include <rtl/math.hxx>
#include <svtools/calendar.hxx>
@@ -1787,8 +1788,8 @@ OUString DbPatternField::GetFormatText(const Reference< css::sdb::XColumn >& _rx
if ( !rpFormatter.get() )
{
- rpFormatter = ::std::unique_ptr< FormattedColumnValue> (
- new FormattedColumnValue(m_xContext, getCursor(), Reference< XPropertySet >( _rxField, UNO_QUERY ) ) );
+ rpFormatter = o3tl::make_unique< FormattedColumnValue> (
+ m_xContext, getCursor(), Reference< XPropertySet >( _rxField, UNO_QUERY ) );
OSL_ENSURE( rpFormatter.get(), "DbPatternField::Init: no value formatter!" );
}
else