summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-10 12:30:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 12:47:37 +0100
commite57a036939e27ecd173ace691689e26a6a33df8e (patch)
treea36d589da272c4732cddb4ca0548cdb5dcb2b2bd /include/tools
parentcb5d79b504aa8575ea15c777707c7465ea43cb07 (diff)
loplugin:useuniqueptr in tools,stoc,unotools
Change-Id: Ia72b65577143623cedc7a40bc34f7fb897add097 Reviewed-on: https://gerrit.libreoffice.org/47726 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/inetstrm.hxx6
-rw-r--r--include/tools/multisel.hxx7
-rw-r--r--include/tools/stream.hxx7
3 files changed, 12 insertions, 8 deletions
diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx
index f3e7ae325c90..765474ef8248 100644
--- a/include/tools/inetstrm.hxx
+++ b/include/tools/inetstrm.hxx
@@ -23,6 +23,7 @@
#include <tools/stream.hxx>
#include <sal/types.h>
#include <vector>
+#include <memory>
class INetMIMEMessage;
class SvStream;
@@ -36,7 +37,8 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream
sal_Char *pRead;
sal_Char *pWrite;
- SvStream *pMsgStrm;
+ std::unique_ptr<SvStream>
+ pMsgStrm;
SvMemoryStream maMsgBuffer;
sal_Char *pMsgRead;
sal_Char *pMsgWrite;
@@ -44,7 +46,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream
bool done;
sal_uInt32 nChildIndex;
- INetMIMEMessageStream *pChildStrm;
+ std::unique_ptr<INetMIMEMessageStream> pChildStrm;
INetMIMEMessageStream (const INetMIMEMessageStream& rStrm) = delete;
INetMIMEMessageStream& operator= (const INetMIMEMessageStream& rStrm) = delete;
diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx
index 854be3768afb..c26eccf221c6 100644
--- a/include/tools/multisel.hxx
+++ b/include/tools/multisel.hxx
@@ -26,14 +26,13 @@
#include <vector>
#include <set>
-typedef ::std::vector< Range* > ImpSelList;
-
#define SFX_ENDOFSELECTION SAL_MAX_INT32
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC MultiSelection
{
private:
- ImpSelList aSels; // array of SV-selections
+ std::vector< Range >
+ aSels; // array of SV-selections
Range aTotRange; // total range of indexes
sal_Int32 nCurSubSel; // index in aSels of current selected index
sal_Int32 nCurIndex; // current selected entry
@@ -72,7 +71,7 @@ public:
sal_Int32 NextSelected();
sal_Int32 GetRangeCount() const { return aSels.size(); }
- const Range& GetRange( sal_Int32 nRange ) const { return *aSels[nRange]; }
+ const Range& GetRange( sal_Int32 nRange ) const { return aSels[nRange]; }
};
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC StringRangeEnumerator
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 640dca026598..cb211ddba607 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -26,6 +26,7 @@
#include <vcl/errcode.hxx>
#include <rtl/string.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <memory>
class StreamData;
@@ -143,7 +144,8 @@ private:
sal_uInt64 m_nActPos;
// buffer management
- sal_uInt8* m_pRWBuf; ///< Points to read/write buffer
+ std::unique_ptr<sal_uInt8>
+ m_pRWBuf; ///< Points to read/write buffer
sal_uInt8* m_pBufPos; ///< m_pRWBuf + m_nBufActualPos
sal_uInt16 m_nBufSize; ///< Allocated size of buffer
sal_uInt16 m_nBufActualLen; ///< Length of used segment of puffer
@@ -582,7 +584,8 @@ TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset) SAL_WARN_UNUSE
class TOOLS_DLLPUBLIC SvFileStream : public SvStream
{
private:
- StreamData* pInstanceData;
+ std::unique_ptr<StreamData>
+ pInstanceData;
OUString aFilename;
#if defined(_WIN32)
sal_uInt16 nLockCounter;