summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svl/svdde.hxx10
-rw-r--r--svl/source/svdde/ddedata.cxx15
-rw-r--r--svl/unx/source/svdde/ddedummy.cxx13
3 files changed, 30 insertions, 8 deletions
diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx
index e59aea050ce2..5a2696cac197 100644
--- a/include/svl/svdde.hxx
+++ b/include/svl/svdde.hxx
@@ -65,9 +65,10 @@ class SVL_DLLPUBLIC DdeData
public:
DdeData();
- DdeData( SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER long, SAL_UNUSED_PARAMETER SotClipboardFormatId = SotClipboardFormatId::STRING );
- DdeData( SAL_UNUSED_PARAMETER const OUString& );
- DdeData( const DdeData& );
+ DdeData(SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER long, SAL_UNUSED_PARAMETER SotClipboardFormatId = SotClipboardFormatId::STRING);
+ DdeData(SAL_UNUSED_PARAMETER const OUString&);
+ DdeData(const DdeData&);
+ DdeData(DdeData&&);
~DdeData();
void const * getData() const;
@@ -75,7 +76,8 @@ public:
SotClipboardFormatId GetFormat() const;
- DdeData& operator = ( const DdeData& );
+ DdeData& operator=(const DdeData&);
+ DdeData& operator=(DdeData&&);
static sal_uLong GetExternalFormat(SotClipboardFormatId nFmt);
static SotClipboardFormatId GetInternalFormat(sal_uLong nFmt);
diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx
index d6cd5341e64d..44817c3d03d8 100644
--- a/svl/source/svdde/ddedata.cxx
+++ b/svl/source/svdde/ddedata.cxx
@@ -57,7 +57,7 @@ DdeData::DdeData( const OUString& s )
xImp->nFmt = SotClipboardFormatId::STRING;
}
-DdeData::DdeData( const DdeData& rData )
+DdeData::DdeData(const DdeData& rData)
{
xImp.reset(new DdeDataImp);
xImp->hData = rData.xImp->hData;
@@ -67,6 +67,11 @@ DdeData::DdeData( const DdeData& rData )
Lock();
}
+DdeData::DdeData(DdeData&& rData)
+ : xImp(std::move(rData.xImp))
+{
+}
+
DdeData::~DdeData()
{
if (xImp && xImp->hData)
@@ -99,7 +104,7 @@ long DdeData::getSize() const
return xImp->nData;
}
-DdeData& DdeData::operator = ( const DdeData& rData )
+DdeData& DdeData::operator=(const DdeData& rData)
{
if ( &rData != this )
{
@@ -110,6 +115,12 @@ DdeData& DdeData::operator = ( const DdeData& rData )
return *this;
}
+DdeData& DdeData::operator=(DdeData&& rData)
+{
+ xImp = std::move(rData.xImp);
+ return *this;
+}
+
sal_uLong DdeData::GetExternalFormat(SotClipboardFormatId nFmt)
{
switch( nFmt )
diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx
index 393759545a19..c8f95d7c15ce 100644
--- a/svl/unx/source/svdde/ddedummy.cxx
+++ b/svl/unx/source/svdde/ddedummy.cxx
@@ -32,7 +32,11 @@ DdeData::DdeData( const OUString& )
{
}
-DdeData::DdeData( const DdeData& )
+DdeData::DdeData(const DdeData&)
+{
+}
+
+DdeData::DdeData(DdeData&&)
{
}
@@ -53,7 +57,12 @@ SotClipboardFormatId DdeData::GetFormat() const
return SotClipboardFormatId::NONE;
}
-DdeData& DdeData::operator = ( const DdeData& )
+DdeData& DdeData::operator=(const DdeData&)
+{
+ return *this;
+}
+
+DdeData& DdeData::operator=(DdeData&&)
{
return *this;
}