From 5202a6fe010fd9ce20303c573c8da0f5ab09eea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 19 Jan 2024 08:58:49 +0000 Subject: [PATCH] cid#1545244 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1546433 COPY_INSTEAD_OF_MOVE cid#1546428 COPY_INSTEAD_OF_MOVE cid#1546175 COPY_INSTEAD_OF_MOVE cid#1545866 COPY_INSTEAD_OF_MOVE Change-Id: I1d1e684faa422654fd90513cf459cde58d3d8914 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162298 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- .../source/drivers/calc/CConnection.cxx | 4 +-- .../source/drivers/writer/WConnection.cxx | 4 +-- .../xml/XMLTableHeaderFooterContext.cxx | 11 +++--- vcl/unx/generic/printer/cupsmgr.cxx | 2 +- xmlhelp/source/treeview/tvread.cxx | 34 +++++++++---------- 5 files changed, 25 insertions(+), 30 deletions(-) diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx index f4f1b409e2f5..5dc725e70ed9 100644 --- a/connectivity/source/drivers/calc/CConnection.cxx +++ b/connectivity/source/drivers/calc/CConnection.cxx @@ -62,9 +62,9 @@ void OCalcConnection::construct(const OUString& url,const Sequence< PropertyValu sal_Int32 nLen = url.indexOf(':'); nLen = url.indexOf(':',nLen+1); - OUString aDSN(url.copy(nLen+1)); - m_aFileName = aDSN; + m_aFileName = url.copy(nLen+1); // DSN + INetURLObject aURL; aURL.SetSmartProtocol(INetProtocol::File); { diff --git a/connectivity/source/drivers/writer/WConnection.cxx b/connectivity/source/drivers/writer/WConnection.cxx index 962af9dbacaf..c9900a4e5544 100644 --- a/connectivity/source/drivers/writer/WConnection.cxx +++ b/connectivity/source/drivers/writer/WConnection.cxx @@ -54,9 +54,9 @@ void OWriterConnection::construct(const OUString& rURL, sal_Int32 nLen = rURL.indexOf(':'); nLen = rURL.indexOf(':', nLen + 1); - OUString aDSN(rURL.copy(nLen + 1)); - m_aFileName = aDSN; + m_aFileName = rURL.copy(nLen + 1); // DSN + INetURLObject aURL; aURL.SetSmartProtocol(INetProtocol::File); { diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx index 192f1cbf56e7..0004c8849f97 100644 --- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx +++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx @@ -49,10 +49,6 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport, bContainsCenter(false) { OUString sOn( bFooter ? SC_UNO_PAGE_FTRON : SC_UNO_PAGE_HDRON ); - OUString sContent( bFooter ? SC_UNO_PAGE_RIGHTFTRCON : SC_UNO_PAGE_RIGHTHDRCON ); - OUString sContentLeft( bFooter ? SC_UNO_PAGE_LEFTFTRCONT : SC_UNO_PAGE_LEFTHDRCONT ); - OUString sContentFirst( bFooter ? SC_UNO_PAGE_FIRSTFTRCONT : SC_UNO_PAGE_FIRSTHDRCONT ); - OUString sShareContent( bFooter ? SC_UNO_PAGE_FTRSHARED : SC_UNO_PAGE_HDRSHARED ); OUString sShareFirstContent( bFooter ? SC_UNO_PAGE_FIRSTFTRSHARED : SC_UNO_PAGE_FIRSTHDRSHARED ); bool bDisplay( true ); for( auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ) ) @@ -65,6 +61,7 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport, bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn ))); if( bLeft || bFirst ) { + OUString sShareContent( bFooter ? SC_UNO_PAGE_FTRSHARED : SC_UNO_PAGE_HDRSHARED ); const OUString sShare = bLeft ? sShareContent : sShareFirstContent; if( bOn && bDisplay ) { @@ -86,16 +83,16 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport, } if (bLeft) { - sCont = sContentLeft; + sCont = bFooter ? SC_UNO_PAGE_LEFTFTRCONT : SC_UNO_PAGE_LEFTHDRCONT; } else if (bFirst) { - sCont = sContentFirst; + sCont = bFooter ? SC_UNO_PAGE_FIRSTFTRCONT : SC_UNO_PAGE_FIRSTHDRCONT; xPropSet->setPropertyValue( sShareFirstContent, uno::Any(!bDisplay) ); } else { - sCont = sContent; + sCont = bFooter ? SC_UNO_PAGE_RIGHTFTRCON : SC_UNO_PAGE_RIGHTHDRCON; } xPropSet->getPropertyValue( sCont ) >>= xHeaderFooterContent; } diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index 1fab7a172353..1529e7ae080e 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -98,7 +98,7 @@ struct GetPPDAttribs #pragma GCC diagnostic pop #endif MutexGuard aGuard( *m_pSyncMutex ); - m_aResult = aResult; + m_aResult = std::move(aResult); m_aCondition.set(); unref(); } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index cc06309369c2..7b1b1fd0713e 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -583,7 +583,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) Reference< XHierarchicalNameAccess > xHierAccess( getHierAccess( sProvider, "org.openoffice.Office.Common" ) ); - OUString system( getKey( xHierAccess,"Help/System" ) ); + configData.system = getKey(xHierAccess,"Help/System"); bool showBasic( getBooleanKey(xHierAccess,"Help/ShowBasic") ); OUString instPath( getKey( xHierAccess,"Path/Current/Help" ) ); if( instPath.isEmpty() ) @@ -626,8 +626,11 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) { } - OUString productVersion( setupversion + " " + setupextension ); - OUString locale( getKey( xHierAccess,"L10N/ooLocale" ) ); + configData.m_vReplacement[0] = utl::ConfigManager::getProductName(); + configData.m_vReplacement[1] = setupversion + " " + setupextension; // productVersion + // m_vReplacement[2...4] (vendorName/-Version/-Short) are empty strings + + configData.locale = getKey(xHierAccess,"L10N/ooLocale"); // Determine fileurl from url and locale OUString url; @@ -638,24 +641,24 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) OUString ret; sal_Int32 idx; osl::DirectoryItem aDirItem; - if( osl::FileBase::E_None == osl::DirectoryItem::get( url + locale,aDirItem ) ) - ret = locale; - else if( ( ( idx = locale.indexOf( '-' ) ) != -1 || - ( idx = locale.indexOf( '_' ) ) != -1 ) && - osl::FileBase::E_None == osl::DirectoryItem::get( url + locale.subView( 0,idx ), + if( osl::FileBase::E_None == osl::DirectoryItem::get( url + configData.locale, aDirItem ) ) + ret = configData.locale; + else if( ( ( idx = configData.locale.indexOf( '-' ) ) != -1 || + ( idx = configData.locale.indexOf( '_' ) ) != -1 ) && + osl::FileBase::E_None == osl::DirectoryItem::get( url + configData.locale.subView( 0,idx ), aDirItem ) ) - ret = locale.copy( 0,idx ); + ret = configData.locale.copy( 0,idx ); else - { - locale = "en-US"; + { + configData.locale= "en-US"; ret = "en"; - } + } url += ret; // first of all, try do determine whether there are any *.tree files present // Start with extensions to set them at the end of the list - TreeFileIterator aTreeIt( locale ); + TreeFileIterator aTreeIt(configData.locale); OUString aTreeFile; sal_Int32 nFileSize; for (;;) @@ -716,12 +719,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) configData.m_vAdd[2] = 11; configData.m_vAdd[3] = 14; configData.m_vAdd[4] = 12; - configData.m_vReplacement[0] = utl::ConfigManager::getProductName(); - configData.m_vReplacement[1] = productVersion; - // m_vReplacement[2...4] (vendorName/-Version/-Short) are empty strings - configData.system = system; - configData.locale = locale; configData.appendix = "?Language=" + configData.locale +