chart2/source/controller/main/ShapeController.cxx | 3 - cui/source/tabpages/transfrm.cxx | 60 ++++++++++++---------- oox/inc/drawingml/scene3dhelper.hxx | 2 oox/source/drawingml/scene3dhelper.cxx | 2 sc/source/filter/oox/worksheetsettings.cxx | 2 sd/source/core/CustomAnimationPreset.cxx | 2 sd/source/ui/dlg/RemoteDialogClientBox.cxx | 3 - sfx2/source/bastyp/fltfnc.cxx | 2 sfx2/source/view/lokhelper.cxx | 2 ucb/source/ucp/cmis/cmis_content.cxx | 4 - unoxml/source/rdf/librdf_repository.cxx | 5 + 11 files changed, 48 insertions(+), 39 deletions(-)
New commits: commit 270f80c3f2244a68de55bee0b92e2f0a04e2821b Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Aug 9 15:49:39 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Aug 9 19:40:43 2025 +0200 cid#1555415 Variable copied when it could be moved and cid#1659706 Variable copied when it could be moved cid#1659716 Variable copied when it could be moved cid#1659727 Variable copied when it could be moved cid#1659735 Variable copied when it could be moved cid#1659739 Variable copied when it could be moved cid#1659740 Variable copied when it could be moved cid#1659746 Variable copied when it could be moved Change-Id: I981c42ebad50670d7704d5377b97917c966ee7da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189262 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index 548982720cd5..e60b1f728f3a 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -359,8 +359,7 @@ void ShapeController::executeDispatch_TransformDialog() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr< SfxAbstractTabDialog > pDlg( pFact->CreateCaptionDialog(pChartWindow, pDrawViewWrapper)); - const WhichRangesContainer aRange = pDlg->GetInputRanges( *aAttr.GetPool() ); - SfxItemSet aCombAttr( *aAttr.GetPool(), aRange ); + SfxItemSet aCombAttr(*aAttr.GetPool(), pDlg->GetInputRanges(*aAttr.GetPool())); aCombAttr.Put( aAttr ); aCombAttr.Put( aGeoAttr ); pDlg->SetInputSet( &aCombAttr ); diff --git a/oox/inc/drawingml/scene3dhelper.hxx b/oox/inc/drawingml/scene3dhelper.hxx index 0f79825b13ca..d0c9598157ba 100644 --- a/oox/inc/drawingml/scene3dhelper.hxx +++ b/oox/inc/drawingml/scene3dhelper.hxx @@ -47,7 +47,7 @@ public: @param [in] rRotZ the shape rotation inclusive camera z-rotation as calculated by setExtrusionProperties() @param [in, out] rPropertyMap the map, that was already filled by setExtrusionProperties()*/ - void setLightingProperties(const oox::drawingml::Shape3DPropertiesPtr p3DProperties, + void setLightingProperties(const oox::drawingml::Shape3DPropertiesPtr& p3DProperties, const double& rRotZ, oox::PropertyMap& rPropertyMap); /** Puts the material properties of the 3D-shape into the property map diff --git a/oox/source/drawingml/scene3dhelper.cxx b/oox/source/drawingml/scene3dhelper.cxx index 7ad926b4bbf2..6e0fb0b107a2 100644 --- a/oox/source/drawingml/scene3dhelper.cxx +++ b/oox/source/drawingml/scene3dhelper.cxx @@ -875,7 +875,7 @@ void lcl_tweakLightRig(std::vector<basegfx::B3DVector>& rLightDirVec, PrstLightR } // end anonymous namespace -void Scene3DHelper::setLightingProperties(const oox::drawingml::Shape3DPropertiesPtr p3DProperties, +void Scene3DHelper::setLightingProperties(const oox::drawingml::Shape3DPropertiesPtr& p3DProperties, const double& rfRotZ, oox::PropertyMap& rPropertyMap) { if (!p3DProperties || !(*p3DProperties).mnLightRigType.has_value()) diff --git a/sc/source/filter/oox/worksheetsettings.cxx b/sc/source/filter/oox/worksheetsettings.cxx index 46d633044115..9cc98952049f 100644 --- a/sc/source/filter/oox/worksheetsettings.cxx +++ b/sc/source/filter/oox/worksheetsettings.cxx @@ -160,7 +160,7 @@ void WorksheetSettings::importProtectedRange( const AttributeList& rAttribs ) aProt.maRangeList = xRangeList.release(); } } - maSheetProt.maEnhancedProtections.push_back( aProt); + maSheetProt.maEnhancedProtections.push_back(std::move(aProt)); } void WorksheetSettings::importChartProtection( const AttributeList& rAttribs ) diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index b20dc5e8357f..cb4656a6b5f8 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -359,7 +359,7 @@ void CustomAnimationPresets::importPresets( const Reference< XMultiServiceFactor CustomAnimationPresetPtr pEffect = getEffectDescriptor( rEffectName ); if( pEffect ) { - aEffectsList.push_back( pEffect ); + aEffectsList.push_back(std::move(pEffect)); } #if OSL_DEBUG_LEVEL >= 2 else diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 4a84f49287c7..3eac5443176e 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -82,8 +82,7 @@ ClientBoxEntry* ClientBox::GetActiveEntry() void ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo ) { - TClientBoxEntry xEntry = std::make_shared<ClientBoxEntry>(this, pClientInfo); - m_vEntries.push_back(xEntry); + m_vEntries.push_back(std::make_shared<ClientBoxEntry>(this, pClientInfo)); } void ClientBox::setActive(ClientBoxEntry* pClientEntry) diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index f32a7ef36847..473bdfe17788 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -512,7 +512,7 @@ ErrCode SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, std::shared_ptr<cons if ( nErr == ERRCODE_IO_PENDING ) { - rpFilter = pFilter; + rpFilter = std::move(pFilter); return nErr; } diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index fab94e157562..157742768f47 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -859,7 +859,7 @@ std::vector<std::string> SfxLokHelper::extractCertificates(const std::string& rC break; } - aRet.push_back(aNext); + aRet.push_back(std::move(aNext)); } return aRet; } diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index ed94b74c13c8..6548692b326a 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -463,7 +463,7 @@ namespace cmis { if ( nullptr == m_pObjectType.get( ) && m_bTransient ) { - const std::string typeId = m_bIsFolder ? "cmis:folder" : "cmis:document"; + const std::string_view typeId = m_bIsFolder ? "cmis:folder" : "cmis:document"; // The type to create needs to be fetched from the possible children types // defined in the parent folder. Then, we'll pick up the first one we find matching // cmis:folder or cmis:document (depending what we need to create). @@ -505,7 +505,7 @@ namespace cmis } if ( !bTypeRestricted ) - m_pObjectType = getSession( xEnv )->getType( typeId ); + m_pObjectType = getSession( xEnv )->getType(std::string(typeId)); } return m_pObjectType; } diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index ce9691fb984c..7fc6967056b2 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1429,7 +1429,7 @@ librdf_Repository::queryConstruct(const OUString & i_rQuery) std::scoped_lock g(m_aMutex); const OString query( OUStringToOString(i_rQuery, RTL_TEXTENCODING_UTF8) ); - const std::shared_ptr<librdf_query> pQuery( + std::shared_ptr<librdf_query> pQuery( librdf_new_query(m_pWorld.get(), s_sparql, nullptr, reinterpret_cast<const unsigned char*> (query.getStr()), nullptr), safe_librdf_free_query); @@ -1456,7 +1456,8 @@ librdf_Repository::queryConstruct(const OUString & i_rQuery) } return new librdf_GraphResult(this, m_aMutex, std::move(pStream), - std::shared_ptr<librdf_node>(), pQuery); + std::shared_ptr<librdf_node>(), + std::move(pQuery)); } sal_Bool SAL_CALL commit 56c55dceea7ddb15bf42e68d58a2eb23bb5bcd05 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Aug 9 12:38:35 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Aug 9 19:40:29 2025 +0200 cid#1660069 Division or modulo by float zero and cid#1660394 Division or modulo by float zero Change-Id: I10b0b100ff3fe99682bf4e0da6bc9ef3e356a996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189257 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 80ed92a94c81..0a1c566102b3 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -1020,18 +1020,23 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) if ( !mbPageDisabled ) { - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_X ); - if ( pItem ) + m_xMtrPosX->set_sensitive(fUIScale != 0.0); + m_xMtrPosY->set_sensitive(fUIScale != 0.0); + if (fUIScale != 0.0) { - const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getX()) / fUIScale); - SetMetricValue(*m_xMtrPosX, basegfx::fround(fTmp), mePoolUnit); - } + pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_X ); + if ( pItem ) + { + const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getX()) / fUIScale); + SetMetricValue(*m_xMtrPosX, basegfx::fround(fTmp), mePoolUnit); + } - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_Y ); - if ( pItem ) - { - const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getY()) / fUIScale); - SetMetricValue(*m_xMtrPosY, basegfx::fround(fTmp), mePoolUnit); + pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_Y ); + if ( pItem ) + { + const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getY()) / fUIScale); + SetMetricValue(*m_xMtrPosY, basegfx::fround(fTmp), mePoolUnit); + } } pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_POS ); @@ -1052,22 +1057,27 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) ChangePosProtectHdl(*m_xTsbPosProtect); } - { // #i75273# set width - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH ); - mfOldWidth = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 ); - double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); - if (m_xMtrWidth->get_digits()) - fTmpWidth *= pow(10.0, m_xMtrWidth->get_digits()); - m_xMtrWidth->set_value(fTmpWidth, FieldUnit::MM_100TH); - } + m_xMtrWidth->set_sensitive(fUIScale != 0.0); + m_xMtrHeight->set_sensitive(fUIScale != 0.0); + if (fUIScale != 0.0) + { + { // #i75273# set width + pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH ); + mfOldWidth = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 ); + double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); + if (m_xMtrWidth->get_digits()) + fTmpWidth *= pow(10.0, m_xMtrWidth->get_digits()); + m_xMtrWidth->set_value(fTmpWidth, FieldUnit::MM_100TH); + } - { // #i75273# set height - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT ); - mfOldHeight = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 ); - double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); - if (m_xMtrHeight->get_digits()) - fTmpHeight *= pow(10.0, m_xMtrHeight->get_digits()); - m_xMtrHeight->set_value(fTmpHeight, FieldUnit::MM_100TH); + { // #i75273# set height + pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT ); + mfOldHeight = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 ); + double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); + if (m_xMtrHeight->get_digits()) + fTmpHeight *= pow(10.0, m_xMtrHeight->get_digits()); + m_xMtrHeight->set_value(fTmpHeight, FieldUnit::MM_100TH); + } } pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE );