summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-13 18:03:18 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-13 18:03:18 +0200
commitcbdd3c32703fd21b6911b5a6fc5803faeed9befb (patch)
tree34d88820a086096e8f36c00c0c68dad1269ffc41 /sw/source/ui
parent423dacde87cbb3cba466c9701ed10dadc2b8b4e0 (diff)
Use unique_ptr for SfxPrinter::pOptions
Change-Id: I46be77225c0323f8b7f293de9c022f0de6f425b7
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/config/optpage.cxx9
-rw-r--r--sw/source/ui/dialog/ascfldlg.cxx9
2 files changed, 14 insertions, 4 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 8c6306eb839b..83e249172f0e 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <utility>
+
#include <optpage.hxx>
#include <doc.hxx>
#include <hintids.hxx>
@@ -49,6 +53,7 @@
#include <editeng/fontitem.hxx>
#include <editeng/langitem.hxx>
#include <editeng/svxenum.hxx>
+#include <o3tl/make_unique.hxx>
#include <sal/macros.h>
#include <sfx2/dialoghelper.hxx>
#include <sfx2/request.hxx>
@@ -806,11 +811,11 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
}
else
{
- SfxItemSet* pPrinterSet = new SfxItemSet( *rSet->GetPool(),
+ auto pPrinterSet = o3tl::make_unique<SfxItemSet>( *rSet->GetPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
0 );
- m_pPrt = VclPtr<SfxPrinter>::Create(pPrinterSet);
+ m_pPrt = VclPtr<SfxPrinter>::Create(std::move(pPrinterSet));
}
delete m_pFontList;
m_pFontList = new FontList( m_pPrt );
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index 75e518af1657..665bd8d7a331 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -17,7 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <utility>
+
#include <hintids.hxx>
+#include <o3tl/make_unique.hxx>
#include <rtl/textenc.h>
#include <i18nlangtag/mslangid.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
@@ -177,11 +182,11 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh,
VclPtr<SfxPrinter> pPrt = pDoc ? pDoc->getIDocumentDeviceAccess().getPrinter(false) : nullptr;
if( !pPrt )
{
- SfxItemSet* pSet = new SfxItemSet( rDocSh.GetPool(),
+ auto pSet = o3tl::make_unique<SfxItemSet>( rDocSh.GetPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
0 );
- pPrt = VclPtr<SfxPrinter>::Create( pSet );
+ pPrt = VclPtr<SfxPrinter>::Create( std::move(pSet) );
bDelPrinter = true;
}