summaryrefslogtreecommitdiff
path: root/include/uno
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-09-23 18:33:34 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-09-23 18:33:34 +0200
commitc53af84c9ca1a1d5090d72b03a8c483d7485f7db (patch)
treef32ea9f3d27457bc90c2e4c6164d078b7e3877f7 /include/uno
parent4c1823923f47103a29f208b72e96e6e70773f18e (diff)
cid#1371196: Add move semantics
Change-Id: I7bf2d6f5e5b1d10cde210c814567017680c6a74e
Diffstat (limited to 'include/uno')
-rw-r--r--include/uno/environment.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/uno/environment.hxx b/include/uno/environment.hxx
index 8a836148677a..e8b99a6ec14d 100644
--- a/include/uno/environment.hxx
+++ b/include/uno/environment.hxx
@@ -94,6 +94,11 @@ public:
*/
inline Environment( const Environment & rEnv );
+#if defined LIBO_INTERNAL_ONLY
+ Environment(Environment && other): _pEnv(other._pEnv)
+ { other._pEnv = nullptr; }
+#endif
+
/** Destructor: releases a set environment.
*/
inline ~Environment();
@@ -112,6 +117,17 @@ public:
inline Environment & SAL_CALL operator = ( const Environment & rEnv )
{ return operator = ( rEnv._pEnv ); }
+#if defined LIBO_INTERNAL_ONLY
+ Environment & operator =(Environment && other) {
+ if (_pEnv != nullptr) {
+ (*_pEnv->release)(_pEnv);
+ }
+ _pEnv = other._pEnv;
+ other._pEnv = nullptr;
+ return *this;
+ }
+#endif
+
/** Provides UNacquired pointer to the set C environment.
@return UNacquired pointer to the C environment struct