coverity#1371313 Missing move assignment operator

Change-Id: I07a9d7fe837c18e66b4a2a57186f1f9b0d44daee
This commit is contained in:
Caolán McNamara
2016-11-03 10:38:22 +00:00
parent 6a866f99ec
commit 11a1b70da2
2 changed files with 42 additions and 7 deletions

View File

@@ -74,9 +74,12 @@ namespace utl
OConfigurationNode() :m_bEscapeNames(false) { }
/// copy ctor
OConfigurationNode(const OConfigurationNode& _rSource);
/// move ctor
OConfigurationNode(OConfigurationNode&& _rSource);
/// assigment
OConfigurationNode& operator=(const OConfigurationNode& _rSource);
OConfigurationNode& operator=(OConfigurationNode&& _rSource);
/// dtor
virtual ~OConfigurationNode() override {}

View File

@@ -78,13 +78,27 @@ namespace utl
}
OConfigurationNode::OConfigurationNode(const OConfigurationNode& _rSource)
:OEventListenerAdapter()
,m_xHierarchyAccess(_rSource.m_xHierarchyAccess)
,m_xDirectAccess(_rSource.m_xDirectAccess)
,m_xReplaceAccess(_rSource.m_xReplaceAccess)
,m_xContainerAccess(_rSource.m_xContainerAccess)
,m_bEscapeNames(_rSource.m_bEscapeNames)
,m_sCompletePath(_rSource.m_sCompletePath)
: OEventListenerAdapter()
, m_xHierarchyAccess(_rSource.m_xHierarchyAccess)
, m_xDirectAccess(_rSource.m_xDirectAccess)
, m_xReplaceAccess(_rSource.m_xReplaceAccess)
, m_xContainerAccess(_rSource.m_xContainerAccess)
, m_bEscapeNames(_rSource.m_bEscapeNames)
, m_sCompletePath(_rSource.m_sCompletePath)
{
Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
if (xConfigNodeComp.is())
startComponentListening(xConfigNodeComp);
}
OConfigurationNode::OConfigurationNode(OConfigurationNode&& _rSource)
: OEventListenerAdapter()
, m_xHierarchyAccess(std::move(_rSource.m_xHierarchyAccess))
, m_xDirectAccess(std::move(_rSource.m_xDirectAccess))
, m_xReplaceAccess(std::move(_rSource.m_xReplaceAccess))
, m_xContainerAccess(std::move(_rSource.m_xContainerAccess))
, m_bEscapeNames(std::move(_rSource.m_bEscapeNames))
, m_sCompletePath(std::move(_rSource.m_sCompletePath))
{
Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
if (xConfigNodeComp.is())
@@ -109,6 +123,24 @@ namespace utl
return *this;
}
OConfigurationNode& OConfigurationNode::operator=(OConfigurationNode&& _rSource)
{
stopAllComponentListening();
m_xHierarchyAccess = std::move(_rSource.m_xHierarchyAccess);
m_xDirectAccess = std::move(_rSource.m_xDirectAccess);
m_xContainerAccess = std::move(_rSource.m_xContainerAccess);
m_xReplaceAccess = std::move(_rSource.m_xReplaceAccess);
m_bEscapeNames = std::move(_rSource.m_bEscapeNames);
m_sCompletePath = std::move(_rSource.m_sCompletePath);
Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
if (xConfigNodeComp.is())
startComponentListening(xConfigNodeComp);
return *this;
}
void OConfigurationNode::_disposing( const EventObject& _rSource )
{
Reference< XComponent > xDisposingSource(_rSource.Source, UNO_QUERY);