external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch | 69 +++++++++++ external/libcmis/UnpackedTarball_libcmis.mk | 3 sc/inc/patattr.hxx | 4 sc/source/core/data/patattr.cxx | 27 +++- sc/source/core/data/segmenttree.cxx | 2 sd/source/ui/view/Outliner.cxx | 2 sw/source/core/bastyp/calc.cxx | 6 7 files changed, 104 insertions(+), 9 deletions(-)
New commits: commit 369ecea5b9455e755a20e4fc2e62e4071076cec7 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Jan 14 20:52:52 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Jan 15 09:42:01 2024 +0100 cid#1545775 COPY_INSTEAD_OF_MOVE and cid#1546321 COPY_INSTEAD_OF_MOVE cid#1546272 COPY_INSTEAD_OF_MOVE cid#1546287 COPY_INSTEAD_OF_MOVE cid#1545443 COPY_INSTEAD_OF_MOVE Change-Id: Ia16a60665497e2c798fc03a2157587c107192558 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162060 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch b/external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch new file mode 100644 index 000000000000..ff022a82867e --- /dev/null +++ b/external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch @@ -0,0 +1,69 @@ +From ca078137dfa94664275f021c5fbf08a34f3fbc10 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <[email protected]> +Date: Sun, 14 Jan 2024 20:41:06 +0000 +Subject: [PATCH] cid#1545775 COPY_INSTEAD_OF_MOVE + +and + +cid#1546321 COPY_INSTEAD_OF_MOVE +cid#1546272 COPY_INSTEAD_OF_MOVE +cid#1546287 COPY_INSTEAD_OF_MOVE +cid#1545443 COPY_INSTEAD_OF_MOVE +--- + inc/libcmis/exception.hxx | 4 ++-- + inc/libcmis/property-type.hxx | 10 +++++----- + inc/libcmis/session-factory.hxx | 2 +- + 3 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/inc/libcmis/exception.hxx b/inc/libcmis/exception.hxx +index aa42ae7..565bff0 100644 +--- a/inc/libcmis/exception.hxx ++++ b/inc/libcmis/exception.hxx +@@ -44,8 +44,8 @@ namespace libcmis + public: + Exception( std::string message, std::string type = "runtime" ) : + exception( ), +- m_message( message ), +- m_type( type ) ++ m_message( std::move(message) ), ++ m_type( std::move(type) ) + { + } + +diff --git a/inc/libcmis/property-type.hxx b/inc/libcmis/property-type.hxx +index 350a7b2..e6b3779 100644 +--- a/inc/libcmis/property-type.hxx ++++ b/inc/libcmis/property-type.hxx +@@ -102,11 +102,11 @@ namespace libcmis + bool isOrderable( ) { return m_orderable; } + bool isOpenChoice( ) { return m_openChoice; } + +- void setId( std::string id ) { m_id = id; } +- void setLocalName( std::string localName ) { m_localName = localName; } +- void setLocalNamespace( std::string localNamespace ) { m_localNamespace = localNamespace; } +- void setDisplayName( std::string displayName ) { m_displayName = displayName; } +- void setQueryName( std::string queryName ) { m_queryName = queryName; } ++ void setId( const std::string& id ) { m_id = id; } ++ void setLocalName( const std::string& localName ) { m_localName = localName; } ++ void setLocalNamespace( const std::string& localNamespace ) { m_localNamespace = localNamespace; } ++ void setDisplayName( const std::string& displayName ) { m_displayName = displayName; } ++ void setQueryName( const std::string& queryName ) { m_queryName = queryName; } + void setType( Type type ) { m_type = type; } + void setMultiValued( bool multivalued ) { m_multiValued = multivalued; } + void setUpdatable( bool updatable ) { m_updatable = updatable; } +diff --git a/inc/libcmis/session-factory.hxx b/inc/libcmis/session-factory.hxx +index 227ac4d..1887254 100644 +--- a/inc/libcmis/session-factory.hxx ++++ b/inc/libcmis/session-factory.hxx +@@ -111,7 +111,7 @@ namespace libcmis + /** Set the handler to ask the user what to do with invalid SSL certificates. If not set, + every invalid certificate will raise an exception. + */ +- static void setCertificateValidationHandler( CertValidationHandlerPtr handler ) { s_certValidationHandler = handler; } ++ static void setCertificateValidationHandler(const CertValidationHandlerPtr& handler ) { s_certValidationHandler = handler; } + static CertValidationHandlerPtr getCertificateValidationHandler( ) { return s_certValidationHandler; } + + static void setCurlInitProtocolsFunction(CurlInitProtocolsFunction); +-- +2.43.0 + diff --git a/external/libcmis/UnpackedTarball_libcmis.mk b/external/libcmis/UnpackedTarball_libcmis.mk index 5e31b8939fcb..976fc8930e92 100644 --- a/external/libcmis/UnpackedTarball_libcmis.mk +++ b/external/libcmis/UnpackedTarball_libcmis.mk @@ -13,7 +13,10 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libcmis,$(LIBCMIS_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,libcmis,1)) +# 0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch is upstreamed + $(eval $(call gb_UnpackedTarball_add_patches,libcmis,\ + external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch \ )) # vim: set noet sw=4 ts=4: commit c752aacb3ad12c8887d65af9cce506637759fe4f Author: Caolán McNamara <[email protected]> AuthorDate: Sun Jan 14 20:31:24 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Jan 15 09:41:54 2024 +0100 cid#1546380 COPY_INSTEAD_OF_MOVE and cid#1545812 COPY_INSTEAD_OF_MOVE cid#1545463 COPY_INSTEAD_OF_MOVE cid#1545290 COPY_INSTEAD_OF_MOVE cid#1545844 COPY_INSTEAD_OF_MOVE Change-Id: Ie6d997fc6282599631dc9e07e2e59893e499c239 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162058 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx index aa10d32544cb..7ae8eba29e16 100644 --- a/sc/source/core/data/segmenttree.cxx +++ b/sc/source/core/data/segmenttree.cxx @@ -250,7 +250,7 @@ bool ScFlatSegmentsImpl<ValueType_, ExtValueType_>::getRangeData(SCCOLROW nPos, auto [it,found] = maSegments.search_tree(nPos, rData.mnValue, &rData.mnPos1, &rData.mnPos2); if (!found) return false; - maItr = it; // cache the iterator to speed up ForwardIterator. + maItr = std::move(it); // cache the iterator to speed up ForwardIterator. rData.mnPos2 = rData.mnPos2-1; // end point is not inclusive. return true; } diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index aaf4cc6a8160..cd499d787149 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -1596,7 +1596,7 @@ void SdOutliner::SetViewMode (PageKind ePageKind) // to. mnPageCount = mpDrawDocument->GetSdPageCount(ePageKind); - maObjectIterator = aIterator; + maObjectIterator = std::move(aIterator); mbMatchMayExist = bMatchMayExist; // Save edit mode so that it can be restored when switching the view diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 0c9643317a4e..4b793a6ece99 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -448,12 +448,12 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, bool bIns ) // ...and write them back. m_nListPor = nListPor; m_bHasNumber = bHasNumber; - m_nLastLeft = nLastLeft; - m_nNumberValue = nNumberValue; + m_nLastLeft = std::move(nLastLeft); + m_nNumberValue = std::move(nNumberValue); m_nCommandPos = nCommandPos; m_eCurrOper = eCurrOper; m_eCurrListOper = eCurrListOper; - m_sCommand = sCurrCommand; + m_sCommand = std::move(sCurrCommand); } else { commit e3b9ba8ad544bc54ecdbded163d356a498ff4155 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Jan 14 20:24:15 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Jan 15 09:41:46 2024 +0100 cid#1559946 Missing move assignment operator Change-Id: I73c8f506ed78238c80df45e087cb6b5bdc496ec9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162057 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index 361ed40cd25b..ca2f75818a03 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -87,9 +87,11 @@ class SC_DLLPUBLIC CellAttributeHolder final public: CellAttributeHolder(const ScPatternAttr* pScPatternAttr = nullptr, bool bPassingOwnership = false); CellAttributeHolder(const CellAttributeHolder& rHolder); + CellAttributeHolder(CellAttributeHolder&& rHolder) noexcept; ~CellAttributeHolder(); - const CellAttributeHolder& operator=(const CellAttributeHolder& rHolder); + CellAttributeHolder& operator=(const CellAttributeHolder& rHolder); + CellAttributeHolder& operator=(CellAttributeHolder&& rHolder); bool operator==(const CellAttributeHolder& rHolder) const; const ScPatternAttr* getScPatternAttr() const { return mpScPatternAttr; } diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 4d9c5887f8d8..693e08b20e7a 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -229,18 +229,25 @@ CellAttributeHolder::CellAttributeHolder(const CellAttributeHolder& rHolder) suppress_fun_call_w_exception(mpScPatternAttr = rHolder.getScPatternAttr()->getCellAttributeHelper().registerAndCheck(*rHolder.getScPatternAttr(), false)); } +CellAttributeHolder::CellAttributeHolder(CellAttributeHolder&& rHolder) noexcept +: mpScPatternAttr(rHolder.mpScPatternAttr) +{ + rHolder.mpScPatternAttr = nullptr; +} + CellAttributeHolder::~CellAttributeHolder() { if (nullptr != mpScPatternAttr) suppress_fun_call_w_exception(mpScPatternAttr->getCellAttributeHelper().doUnregister(*mpScPatternAttr)); } -const CellAttributeHolder& CellAttributeHolder::operator=(const CellAttributeHolder& rHolder) +CellAttributeHolder& CellAttributeHolder::operator=(const CellAttributeHolder& rHolder) { if (nullptr != mpScPatternAttr) + { mpScPatternAttr->getCellAttributeHelper().doUnregister(*mpScPatternAttr); - - mpScPatternAttr = nullptr; + mpScPatternAttr = nullptr; + } if (rHolder.getScPatternAttr()) mpScPatternAttr = rHolder.getScPatternAttr()->getCellAttributeHelper().registerAndCheck(*rHolder.getScPatternAttr(), false); @@ -248,6 +255,20 @@ const CellAttributeHolder& CellAttributeHolder::operator=(const CellAttributeHol return *this; } +CellAttributeHolder& CellAttributeHolder::operator=(CellAttributeHolder&& rHolder) +{ + if (nullptr != mpScPatternAttr) + { + mpScPatternAttr->getCellAttributeHelper().doUnregister(*mpScPatternAttr); + mpScPatternAttr = nullptr; + } + + std::swap(mpScPatternAttr, rHolder.mpScPatternAttr); + assert(!rHolder.mpScPatternAttr); + + return *this; +} + bool CellAttributeHolder::operator==(const CellAttributeHolder& rHolder) const { // here we have registered entries, so no need to test for equality
