diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-26 10:01:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-31 07:30:07 +0100 |
commit | 9078b0b8f48b161ad5b880c31a4413f9e706f01b (patch) | |
tree | 656415a9a7fac4346bfa222558cffcb31bb0ee38 /vcl/inc | |
parent | 0df2d8726850eef54a1ed980bc7f33cc67265e12 (diff) |
loplugin:useuniqueptr in DeletePrinterQueueInfo
Change-Id: Ia124a4af642e449dc05f5bae2d5ca766bd67bd68
Reviewed-on: https://gerrit.libreoffice.org/62388
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/headless/svpinst.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/osx/salinst.h | 1 | ||||
-rw-r--r-- | vcl/inc/print.h | 22 | ||||
-rw-r--r-- | vcl/inc/qt5/Qt5Instance.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/salinst.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/unx/geninst.h | 1 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 1 |
7 files changed, 17 insertions, 11 deletions
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx index 4793d8e463d5..b331c5cbcbad 100644 --- a/vcl/inc/headless/svpinst.hxx +++ b/vcl/inc/headless/svpinst.hxx @@ -157,7 +157,6 @@ public: virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ) override; virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) override; - virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) override; virtual OUString GetDefaultPrinter() override; virtual void PostPrintersChanged() override; diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index afb1d2b34aa3..18b8de8cfc7f 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -109,7 +109,6 @@ public: virtual std::unique_ptr<SalPrinter> CreatePrinter( SalInfoPrinter* pInfoPrinter ) override; virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ) override; virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) override; - virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) override; virtual OUString GetDefaultPrinter() override; virtual SalTimer* CreateSalTimer() override; virtual SalSystem* CreateSalSystem() override; diff --git a/vcl/inc/print.h b/vcl/inc/print.h index 3ea53ec2bdd9..13650ceef34f 100644 --- a/vcl/inc/print.h +++ b/vcl/inc/print.h @@ -22,12 +22,12 @@ #include <rtl/ustring.hxx> #include <vcl/dllapi.h> +#include <vcl/print.hxx> +#include "salprn.hxx" #include <vector> #include <unordered_map> -struct SalPrinterQueueInfo; -class QueueInfo; class JobSetup; namespace vcl @@ -35,8 +35,17 @@ namespace vcl struct ImplPrnQueueData { - QueueInfo* mpQueueInfo; - SalPrinterQueueInfo* mpSalQueueInfo; + std::unique_ptr<QueueInfo> mpQueueInfo; + std::unique_ptr<SalPrinterQueueInfo> mpSalQueueInfo; + +// unlike other similar places, we need to ifdef this to keep old GCC baseline happy +#ifdef _MSC_VER + ImplPrnQueueData() {} + ImplPrnQueueData(ImplPrnQueueData&&) = default; + + ImplPrnQueueData& operator=( ImplPrnQueueData const & ) = delete; // MSVC2017 workaround + ImplPrnQueueData( ImplPrnQueueData const & ) = delete; // MSVC2017 workaround +#endif }; class VCL_PLUGIN_PUBLIC ImplPrnQueueList @@ -49,7 +58,10 @@ public: ImplPrnQueueList() {} ~ImplPrnQueueList(); - void Add( SalPrinterQueueInfo* pData ); + ImplPrnQueueList& operator=( ImplPrnQueueList const & ) = delete; // MSVC2017 workaround + ImplPrnQueueList( ImplPrnQueueList const & ) = delete; // MSVC2017 workaround + +void Add( std::unique_ptr<SalPrinterQueueInfo> pData ); ImplPrnQueueData* Get( const OUString& rPrinter ); }; diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx index 8f5a2670b238..473f26c58b13 100644 --- a/vcl/inc/qt5/Qt5Instance.hxx +++ b/vcl/inc/qt5/Qt5Instance.hxx @@ -76,7 +76,6 @@ public: virtual std::unique_ptr<SalPrinter> CreatePrinter(SalInfoPrinter* pInfoPrinter) override; virtual void GetPrinterQueueInfo(ImplPrnQueueList* pList) override; virtual void GetPrinterQueueState(SalPrinterQueueInfo* pInfo) override; - virtual void DeletePrinterQueueInfo(SalPrinterQueueInfo* pInfo) override; virtual OUString GetDefaultPrinter() override; virtual void PostPrintersChanged() override; diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index b365fe6545ca..1d400e5f9bae 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -122,7 +122,6 @@ public: virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ) = 0; virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) = 0; - virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) = 0; virtual OUString GetDefaultPrinter() = 0; // SalTimer diff --git a/vcl/inc/unx/geninst.h b/vcl/inc/unx/geninst.h index 17688b8772db..ba795485fff6 100644 --- a/vcl/inc/unx/geninst.h +++ b/vcl/inc/unx/geninst.h @@ -58,7 +58,6 @@ public: virtual std::unique_ptr<SalPrinter> CreatePrinter ( SalInfoPrinter* pInfoPrinter ) override; virtual void GetPrinterQueueInfo ( ImplPrnQueueList* pList ) override; virtual void GetPrinterQueueState ( SalPrinterQueueInfo* pInfo ) override; - virtual void DeletePrinterQueueInfo ( SalPrinterQueueInfo* pInfo ) override; virtual OUString GetDefaultPrinter() override; virtual void PostPrintersChanged() = 0; virtual void updatePrinterUpdate() override; diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index 88f31fd548cf..bcd3540ad8a9 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -58,7 +58,6 @@ public: virtual std::unique_ptr<SalPrinter> CreatePrinter( SalInfoPrinter* pInfoPrinter ) override; virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ) override; virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) override; - virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) override; virtual OUString GetDefaultPrinter() override; virtual SalTimer* CreateSalTimer() override; virtual SalSystem* CreateSalSystem() override; |