[Libreoffice-commits] core.git: sc/inc sc/source
Jochen Nitschke
j.nitschke+logerrit at ok.de
Fri Dec 29 07:03:43 UTC 2017
sc/inc/queryparam.hxx | 6 +--
sc/source/core/tool/queryparam.cxx | 58 +++++++++++++------------------------
2 files changed, 24 insertions(+), 40 deletions(-)
New commits:
commit db8085636aec89205fdc944ec55ef11645705a97
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date: Thu Dec 28 00:35:41 2017 +0100
simplify copy of ScQueryParam
define copy assignment for ScQueryParamBase and use
default copy implementations for other structs.
Change-Id: Ie384a4f9a3647e8492b4921055df0f2c6bff708e
Reviewed-on: https://gerrit.libreoffice.org/47141
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index 0c704789e004..cde359ec7a72 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -77,6 +77,7 @@ public:
protected:
ScQueryParamBase();
ScQueryParamBase(const ScQueryParamBase& r);
+ ScQueryParamBase& operator=(const ScQueryParamBase& r);
EntriesType m_Entries;
};
@@ -107,7 +108,6 @@ struct ScQueryParamTable
SCTAB nTab;
ScQueryParamTable();
- ScQueryParamTable(const ScQueryParamTable& r);
virtual ~ScQueryParamTable();
};
@@ -134,11 +134,11 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT
SCROW nDestRow;
ScQueryParam();
- ScQueryParam( const ScQueryParam& r );
+ ScQueryParam( const ScQueryParam& );
ScQueryParam( const ScDBQueryParamInternal& r );
virtual ~ScQueryParam() override;
- ScQueryParam& operator= ( const ScQueryParam& r );
+ ScQueryParam& operator= ( const ScQueryParam& );
bool operator== ( const ScQueryParam& rOther ) const;
void Clear();
void ClearDestParams();
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index 60bf01366886..269eb700bb83 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -87,6 +87,25 @@ ScQueryParamBase::ScQueryParamBase(const ScQueryParamBase& r) :
}
}
+ScQueryParamBase& ScQueryParamBase::operator=(const ScQueryParamBase& r)
+{
+ eSearchType = r.eSearchType;
+ bHasHeader = r.bHasHeader;
+ bByRow = r.bByRow;
+ bInplace = r.bInplace;
+ bCaseSens = r.bCaseSens;
+ bDuplicate = r.bDuplicate;
+ mbRangeLookup = r.mbRangeLookup;
+
+ m_Entries.clear();
+ for (auto const& it : r.m_Entries)
+ {
+ m_Entries.push_back(o3tl::make_unique<ScQueryEntry>(*it));
+ }
+
+ return *this;
+}
+
ScQueryParamBase::~ScQueryParamBase()
{
}
@@ -283,11 +302,6 @@ ScQueryParamTable::ScQueryParamTable() :
{
}
-ScQueryParamTable::ScQueryParamTable(const ScQueryParamTable& r) :
- nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),nTab(r.nTab)
-{
-}
-
ScQueryParamTable::~ScQueryParamTable()
{
}
@@ -303,12 +317,7 @@ ScQueryParam::ScQueryParam() :
Clear();
}
-ScQueryParam::ScQueryParam( const ScQueryParam& r ) :
- ScQueryParamBase(r),
- ScQueryParamTable(r),
- bDestPers(r.bDestPers), nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow)
-{
-}
+ScQueryParam::ScQueryParam( const ScQueryParam& ) = default;
ScQueryParam::ScQueryParam( const ScDBQueryParamInternal& r ) :
ScQueryParamBase(r),
@@ -349,32 +358,7 @@ void ScQueryParam::ClearDestParams()
nDestRow = 0;
}
-ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r )
-{
- nCol1 = r.nCol1;
- nRow1 = r.nRow1;
- nCol2 = r.nCol2;
- nRow2 = r.nRow2;
- nTab = r.nTab;
- nDestTab = r.nDestTab;
- nDestCol = r.nDestCol;
- nDestRow = r.nDestRow;
- bHasHeader = r.bHasHeader;
- bInplace = r.bInplace;
- bCaseSens = r.bCaseSens;
- eSearchType = r.eSearchType;
- bDuplicate = r.bDuplicate;
- bByRow = r.bByRow;
- bDestPers = r.bDestPers;
-
- m_Entries.clear();
- for (auto const& it : r.m_Entries)
- {
- m_Entries.push_back(o3tl::make_unique<ScQueryEntry>(*it));
- }
-
- return *this;
-}
+ScQueryParam& ScQueryParam::operator=( const ScQueryParam& ) = default;
bool ScQueryParam::operator==( const ScQueryParam& rOther ) const
{
More information about the Libreoffice-commits
mailing list