loplugin:useuniqueptr in HStreamIODev
Change-Id: I81ab91bce2a83603b25922593c1fd764b5c0b003 Reviewed-on: https://gerrit.libreoffice.org/59358 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
079abbaefa
commit
c4558e4b7b
5 changed files with 10 additions and 10 deletions
|
@ -89,7 +89,7 @@ size_t HIODev::read4b(void *ptr, size_t nmemb)
|
|||
|
||||
|
||||
// hfileiodev class
|
||||
HStreamIODev::HStreamIODev(HStream * stream):_stream(stream)
|
||||
HStreamIODev::HStreamIODev(std::unique_ptr<HStream> stream):_stream(std::move(stream))
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ class HStreamIODev final: public HIODev
|
|||
std::unique_ptr<HStream> _stream;
|
||||
gz_stream *_gzfp;
|
||||
public:
|
||||
explicit HStreamIODev(HStream* stream);
|
||||
explicit HStreamIODev(std::unique_ptr<HStream> stream);
|
||||
virtual ~HStreamIODev() override;
|
||||
/**
|
||||
* Check whether the stream is available
|
||||
|
|
|
@ -65,9 +65,9 @@ HWPFile::~HWPFile()
|
|||
hiodev.reset();
|
||||
}
|
||||
|
||||
int HWPFile::ReadHwpFile(HStream * stream)
|
||||
int HWPFile::ReadHwpFile(std::unique_ptr<HStream> stream)
|
||||
{
|
||||
if (Open(stream) != HWP_NoError)
|
||||
if (Open(std::move(stream)) != HWP_NoError)
|
||||
return State();
|
||||
InfoRead();
|
||||
FontRead();
|
||||
|
@ -92,9 +92,9 @@ int detect_hwp_version(const char *str)
|
|||
|
||||
// HIODev wrapper
|
||||
|
||||
int HWPFile::Open(HStream * stream)
|
||||
int HWPFile::Open(std::unique_ptr<HStream> stream)
|
||||
{
|
||||
HStreamIODev *hstreamio = new HStreamIODev(stream);
|
||||
HStreamIODev *hstreamio = new HStreamIODev(std::move(stream));
|
||||
|
||||
if (!hstreamio->open())
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ class DLLEXPORT HWPFile
|
|||
* @returns 0 if success, otherwise error code
|
||||
* @see State()
|
||||
*/
|
||||
int Open( HStream * );
|
||||
int Open( std::unique_ptr<HStream> );
|
||||
|
||||
/**
|
||||
* Say current state
|
||||
|
@ -170,7 +170,7 @@ class DLLEXPORT HWPFile
|
|||
/**
|
||||
* Reads all information of hwp file from stream
|
||||
*/
|
||||
int ReadHwpFile( HStream *);
|
||||
int ReadHwpFile( std::unique_ptr<HStream> );
|
||||
/**
|
||||
* Reads document information of hwp file from HIODev
|
||||
*/
|
||||
|
|
|
@ -132,7 +132,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportHWP(SvStream &rStream)
|
|||
}
|
||||
|
||||
HWPFile hwpfile;
|
||||
if (hwpfile.ReadHwpFile(stream.release()))
|
||||
if (hwpfile.ReadHwpFile(std::move(stream)))
|
||||
return false;
|
||||
}
|
||||
catch (...)
|
||||
|
@ -164,7 +164,7 @@ sal_Bool HwpReader::filter(const Sequence< PropertyValue >& rDescriptor)
|
|||
|
||||
if( nTotal == 0 ) return false;
|
||||
|
||||
if (hwpfile.ReadHwpFile(stream.release()))
|
||||
if (hwpfile.ReadHwpFile(std::move(stream)))
|
||||
return false;
|
||||
|
||||
if (m_rxDocumentHandler.is())
|
||||
|
|
Loading…
Reference in a new issue