basctl/source/basicide/baside2.cxx | 2 basic/source/classes/sbunoobj.cxx | 2 basic/source/uno/namecont.cxx | 2 chart2/source/controller/main/SelectionHelper.cxx | 4 chart2/source/model/template/BubbleDataInterpreter.cxx | 2 chart2/source/tools/InternalData.cxx | 3 chart2/source/view/charttypes/NetChart.cxx | 2 desktop/source/app/officeipcthread.cxx | 2 drawinglayer/source/tools/emfphelperdata.cxx | 2 forms/source/xforms/model.cxx | 2 framework/source/layoutmanager/toolbarlayoutmanager.cxx | 2 helpcompiler/source/HelpCompiler.cxx | 2 include/vcl/filter/pdfdocument.hxx | 7 + sc/source/core/data/patattr.cxx | 2 sc/source/core/tool/interpr1.cxx | 2 sc/source/filter/oox/drawingfragment.cxx | 2 sd/source/core/CustomAnimationPreset.cxx | 2 stoc/source/security/file_policy.cxx | 2 svx/source/dialog/imapwnd.cxx | 2 svx/source/sdr/contact/viewcontactofe3d.cxx | 2 svx/source/sdr/primitive2d/sdrattributecreator.cxx | 6 - svx/source/svdraw/svdotxtr.cxx | 2 sw/source/filter/ww8/attributeoutputbase.hxx | 4 sw/source/filter/ww8/docxattributeoutput.cxx | 4 sw/source/filter/ww8/docxattributeoutput.hxx | 4 sw/source/filter/ww8/rtfattributeoutput.cxx | 5 - sw/source/filter/ww8/rtfattributeoutput.hxx | 4 sw/source/filter/ww8/ww8atr.cxx | 2 sw/source/filter/ww8/ww8attributeoutput.hxx | 4 sw/source/ui/fldui/fldpage.cxx | 2 sw/source/uibase/shells/basesh.cxx | 3 sw/source/uibase/shells/textsh1.cxx | 3 sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx | 2 ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx | 4 vcl/qa/cppunit/pdfexport/data/xnview-colorspace.pdf |binary vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 66 ++++++++++++++++ vcl/source/bitmap/dibtools.cxx | 4 vcl/source/filter/graphicfilter.cxx | 2 vcl/source/filter/ipdf/pdfdocument.cxx | 16 +++ vcl/source/gdi/pdfobjectcopier.cxx | 15 +++ vcl/source/gdi/pdfwriter_impl.cxx | 8 - vcl/source/outdev/bitmap.cxx | 2 42 files changed, 157 insertions(+), 53 deletions(-)
New commits: commit ea2c60501a600d1f53bfc130e123c0996837b2fa Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Jul 23 15:39:24 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Jul 23 21:58:15 2024 +0200 Resolves: tdf#162161 reexport of specific pdf appears blank the contents of the referenced colorspace obj disappears so it gets rendered blank Change-Id: Iaa76d355b5903c695e74edadc329043156bad3b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170904 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx index dce7d976ee37..05e471e65e01 100644 --- a/include/vcl/filter/pdfdocument.hxx +++ b/include/vcl/filter/pdfdocument.hxx @@ -44,6 +44,7 @@ class PDFDocument; class PDFDictionaryElement; class PDFArrayElement; class PDFStreamElement; +class PDFNameElement; class PDFNumberElement; /// A byte range in a PDF file. @@ -73,6 +74,8 @@ class VCL_DLLPUBLIC PDFObjectElement final : public PDFElement double m_fGenerationValue; /// If set, the object contains this number element (outside any dictionary/array). PDFNumberElement* m_pNumberElement; + /// If set, the object contains this name element (outside any dictionary/array). + PDFNameElement* m_pNameElement; /// Position after the '<<' token. sal_uInt64 m_nDictionaryOffset; /// Length of the dictionary buffer till (before) the '>>' token. @@ -113,7 +116,9 @@ public: PDFDictionaryElement* GetDictionary(); SAL_DLLPRIVATE void SetDictionary(PDFDictionaryElement* pDictionaryElement); SAL_DLLPRIVATE void SetNumberElement(PDFNumberElement* pNumberElement); - SAL_DLLPRIVATE PDFNumberElement* GetNumberElement() const; + PDFNumberElement* GetNumberElement() const; + SAL_DLLPRIVATE void SetNameElement(PDFNameElement* pNameElement); + PDFNameElement* GetNameElement() const; /// Get access to the parsed key-value items from the object dictionary. const std::map<OString, PDFElement*>& GetDictionaryItems(); SAL_DLLPRIVATE const std::vector<PDFReferenceElement*>& GetDictionaryReferences() const; diff --git a/vcl/qa/cppunit/pdfexport/data/xnview-colorspace.pdf b/vcl/qa/cppunit/pdfexport/data/xnview-colorspace.pdf new file mode 100644 index 000000000000..0370c2bbd2e6 Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/xnview-colorspace.pdf differ diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index 58a5d93e060e..6765a1a6a624 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -5278,6 +5278,72 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf101686) CPPUNIT_ASSERT_EQUAL(u"Textbox"_ustr, aText[2].trim()); } +// tdf#162161 reexport appears to have blank image +CPPUNIT_TEST_FIXTURE(PdfExportTest2, testRexportXnViewColorspace) +{ + // We need to enable PDFium import (and make sure to disable after the test) + bool bResetEnvVar = false; + if (getenv("LO_IMPORT_USE_PDFIUM") == nullptr) + { + bResetEnvVar = true; + osl_setEnvironment(u"LO_IMPORT_USE_PDFIUM"_ustr.pData, u"1"_ustr.pData); + } + comphelper::ScopeGuard aPDFiumEnvVarGuard([&]() { + if (bResetEnvVar) + osl_clearEnvironment(u"LO_IMPORT_USE_PDFIUM"_ustr.pData); + }); + + // Load the PDF and save as PDF + vcl::filter::PDFDocument aDocument; + load(u"xnview-colorspace.pdf", aDocument); + + std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages(); + CPPUNIT_ASSERT_EQUAL(size_t(1), aPages.size()); + + // Get access to the only image on the only page. + vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources"_ostr); + CPPUNIT_ASSERT(pResources); + + auto pXObjects + = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"_ostr)); + CPPUNIT_ASSERT(pXObjects); + CPPUNIT_ASSERT_EQUAL(size_t(1), pXObjects->GetItems().size()); + vcl::filter::PDFObjectElement* pXObject + = pXObjects->LookupObject(pXObjects->GetItems().begin()->first); + CPPUNIT_ASSERT(pXObject); + + auto pSubResources + = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"_ostr)); + CPPUNIT_ASSERT(pSubResources); + pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>( + pSubResources->LookupElement("XObject"_ostr)); + CPPUNIT_ASSERT(pXObjects); + CPPUNIT_ASSERT_EQUAL(size_t(1), pXObjects->GetItems().size()); + pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first); + CPPUNIT_ASSERT(pXObject); + + pSubResources + = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"_ostr)); + CPPUNIT_ASSERT(pSubResources); + pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>( + pSubResources->LookupElement("XObject"_ostr)); + CPPUNIT_ASSERT(pXObjects); + CPPUNIT_ASSERT_EQUAL(size_t(1), pXObjects->GetItems().size()); + pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first); + CPPUNIT_ASSERT(pXObject); + + // Dig all the way down to this element which is originally + // 8 0 obj + // /DeviceRGB + // endobj + // and appeared blank when we lost the /DeviceRGB line + auto pColorspace = pXObject->LookupObject("ColorSpace"_ostr); + CPPUNIT_ASSERT(pColorspace); + auto pColorSpaceElement = pColorspace->GetNameElement(); + CPPUNIT_ASSERT(pColorSpaceElement); + CPPUNIT_ASSERT_EQUAL("DeviceRGB"_ostr, pColorSpaceElement->GetValue()); +} + } // end anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 159db9a38ba2..dac68d5344af 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -1102,6 +1102,14 @@ bool PDFDocument::Tokenize(SvStream& rStream, TokenizeMode eMode, pObjectStream = pObject; else pObjectKey = pNameElement; + + if (bInObject && !nDepth && pObject) + { + // Name element inside an object, but outside a + // dictionary / array: remember it. + pObject->SetNameElement(pNameElement); + } + break; } case '(': @@ -2291,6 +2299,7 @@ PDFObjectElement::PDFObjectElement(PDFDocument& rDoc, double fObjectValue, doubl , m_fObjectValue(fObjectValue) , m_fGenerationValue(fGenerationValue) , m_pNumberElement(nullptr) + , m_pNameElement(nullptr) , m_nDictionaryOffset(0) , m_nDictionaryLength(0) , m_pDictionaryElement(nullptr) @@ -2462,6 +2471,13 @@ void PDFObjectElement::SetNumberElement(PDFNumberElement* pNumberElement) PDFNumberElement* PDFObjectElement::GetNumberElement() const { return m_pNumberElement; } +void PDFObjectElement::SetNameElement(PDFNameElement* pNameElement) +{ + m_pNameElement = pNameElement; +} + +PDFNameElement* PDFObjectElement::GetNameElement() const { return m_pNameElement; } + const std::vector<PDFReferenceElement*>& PDFObjectElement::GetDictionaryReferences() const { return m_aDictionaryReferences; diff --git a/vcl/source/gdi/pdfobjectcopier.cxx b/vcl/source/gdi/pdfobjectcopier.cxx index 0d07c0df7f67..56c3ba6e8138 100644 --- a/vcl/source/gdi/pdfobjectcopier.cxx +++ b/vcl/source/gdi/pdfobjectcopier.cxx @@ -139,6 +139,21 @@ sal_Int32 PDFObjectCopier::copyExternalResource(SvMemoryStream& rDocBuffer, pNumber->writeString(aLine); aLine.append(" "); } + // If the object has a name element outside a dictionary or array, copy that. + else if (filter::PDFNameElement* pName = rObject.GetNameElement()) + { + // currently just handle the exact case seen in the real world + if (pName->GetValue() == "DeviceRGB") + { + pName->writeString(aLine); + aLine.append(" "); + } + else + { + SAL_INFO("vcl.pdfwriter", + "PDFObjectCopier::copyExternalResource: skipping: " << pName->GetValue()); + } + } // We have the whole object, now write it to the output. if (!m_rContainer.updateObject(nObject)) commit 8a83a62410bc3f9bbcd6d0dabb260814c6172bf8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Jul 23 08:25:57 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Jul 23 21:58:02 2024 +0200 cid#1555167 COPY_INSTEAD_OF_MOVE and cid#1555172 COPY_INSTEAD_OF_MOVE cid#1555184 COPY_INSTEAD_OF_MOVE cid#1555188 COPY_INSTEAD_OF_MOVE cid#1555197 COPY_INSTEAD_OF_MOVE cid#1555209 COPY_INSTEAD_OF_MOVE cid#1555211 COPY_INSTEAD_OF_MOVE cid#1555215 COPY_INSTEAD_OF_MOVE cid#1555216 COPY_INSTEAD_OF_MOVE cid#1555217 COPY_INSTEAD_OF_MOVE cid#1555218 COPY_INSTEAD_OF_MOVE cid#1555222 COPY_INSTEAD_OF_MOVE cid#1556674 COPY_INSTEAD_OF_MOVE cid#1555229 COPY_INSTEAD_OF_MOVE cid#1555233 COPY_INSTEAD_OF_MOVE cid#1555234 COPY_INSTEAD_OF_MOVE cid#1555242 COPY_INSTEAD_OF_MOVE cid#1555250 COPY_INSTEAD_OF_MOVE cid#1555251 COPY_INSTEAD_OF_MOVE cid#1555254 COPY_INSTEAD_OF_MOVE cid#1555304 COPY_INSTEAD_OF_MOVE cid#1555307 COPY_INSTEAD_OF_MOVE cid#1555317 COPY_INSTEAD_OF_MOVE cid#1555329 COPY_INSTEAD_OF_MOVE cid#1555340 COPY_INSTEAD_OF_MOVE cid#1555347 COPY_INSTEAD_OF_MOVE cid#1555352 COPY_INSTEAD_OF_MOVE cid#1555358 COPY_INSTEAD_OF_MOVE cid#1555363 COPY_INSTEAD_OF_MOVE cid#1555365 COPY_INSTEAD_OF_MOVE cid#1555367 COPY_INSTEAD_OF_MOVE cid#1555374 COPY_INSTEAD_OF_MOVE cid#1555380 COPY_INSTEAD_OF_MOVE Change-Id: I343194c10749488a1143e2517ee0638ab19da218 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170888 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 7a779a7f0ddf..76f3ec8ac7bd 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -1375,7 +1375,7 @@ EntryDescriptor ModulWindow::CreateEntryDescriptor() break; } } - return EntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aModName, OBJ_TYPE_MODULE ); + return EntryDescriptor( std::move(aDocument), eLocation, aLibName, aLibSubName, aModName, OBJ_TYPE_MODULE ); } void ModulWindow::SetReadOnly (bool b) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 0f59f78b0591..7b0ba32e3b7e 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -934,7 +934,7 @@ static Type getUnoTypeForSbxValue( const SbxValue* pVal ) aElementType = cppu::UnoType<Any>::get(); break; } - aElementType = aType; + aElementType = std::move(aType); bNeedsInit = false; } else if( aElementType != aType ) diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 02c2e78e3f16..3646fd140ceb 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1184,7 +1184,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, if( !bCleanUp ) return; - INetURLObject aPrevUserBasicInetObj_Err( aUserBasicInetObj ); + INetURLObject aPrevUserBasicInetObj_Err(std::move(aUserBasicInetObj)); aPrevUserBasicInetObj_Err.removeSegment(); aPrevUserBasicInetObj_Err.Append( u"__basic_80_err" ); OUString aPrevFolder_Err = aPrevUserBasicInetObj_Err.GetMainURL( INetURLObject::DecodeMechanism::NONE ); diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index de2ad664abe5..8a6305c6f6c2 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -217,10 +217,10 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper { if( bAllowMultiClickSelectionChange ) { - m_aSelectedOID = aLastChild; + m_aSelectedOID = std::move(aLastChild); } else - m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = aLastChild; + m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = std::move(aLastChild); break; } } diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx index f2d653acf91e..2d0aab593f66 100644 --- a/chart2/source/model/template/BubbleDataInterpreter.cxx +++ b/chart2/source/model/template/BubbleDataInterpreter.cxx @@ -148,7 +148,7 @@ InterpretedData BubbleDataInterpreter::interpretDataSource( aSeriesVec.push_back( xSeries ); } - return { { aSeriesVec }, xCategories }; + return { { std::move(aSeriesVec) }, xCategories }; } InterpretedData BubbleDataInterpreter::reinterpretDataSeries( diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx index e6e926078eb3..82537baf3d60 100644 --- a/chart2/source/tools/InternalData.cxx +++ b/chart2/source/tools/InternalData.cxx @@ -418,8 +418,7 @@ void InternalData::deleteColumn( sal_Int32 nAtIndex ) m_aData[ std::slice( nCol + 1, m_nRowCount, m_nColumnCount ) ] ); m_nColumnCount = nNewColumnCount; - m_aData.resize( nNewSize ); - m_aData = aNewData; + m_aData = std::move(aNewData); // labels if( nAtIndex < static_cast< sal_Int32 >( m_aColumnLabels.size())) diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx index b0e5a4a26c5c..3570fe2042a4 100644 --- a/chart2/source/view/charttypes/NetChart.cxx +++ b/chart2/source/view/charttypes/NetChart.cxx @@ -212,7 +212,7 @@ bool NetChart::impl_createArea( VDataSeries* pSeries std::vector<std::vector<css::drawing::Position3D>> aClippedPoly; Clipping::clipPolygonAtRectangle( aPoly, pPosHelper->getScaledLogicClipDoubleRect(), aClippedPoly, false ); ShapeFactory::closePolygon(aClippedPoly); //again necessary after clipping - aPoly = aClippedPoly; + aPoly = std::move(aClippedPoly); } if(!ShapeFactory::hasPolygonAnyLines(aPoly)) diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 9775c4c60fa9..33455d26725d 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -810,7 +810,7 @@ RequestHandler::Status PipeIpcThread::enable(rtl::Reference<IpcThread> * thread) if ( nPipeMode == PIPEMODE_CREATED ) { // Seems we are the one and only, so create listening thread - *thread = new PipeIpcThread(pipe); + *thread = new PipeIpcThread(std::move(pipe)); return RequestHandler::IPC_STATUS_OK; } else diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index 55eadda06d9c..b9162a7a3ed7 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -492,7 +492,7 @@ namespace emfplushelper wmfemfhelper::PropertyHolder state = mrPropertyHolders.Current(); // tdf#112500 We need to save world transform somehow, during graphic state push state.setTransformation(maWorldTransform); - map[ index ] = state; + map[ index ] = std::move(state); } void EmfPlusHelperData::GraphicStatePop(GraphicStateMap& map, sal_Int32 index) diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index 4fd318319590..04db24d1fb4c 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -205,7 +205,7 @@ MIP Model::queryMIP( const XNode_t& xNode ) const // inherit from current node (or set if we are at the start node) if( xCurrent == xNode ) - aRet = aMIP; + aRet = std::move(aMIP); else aRet.inherit( aMIP ); } diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 500d4a6d59ca..6e75d3c2691a 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -3270,7 +3270,7 @@ void SAL_CALL ToolbarLayoutManager::startDocking( const awt::DockingEvent& e ) SolarMutexGuard g; m_bDockingInProgress = bWinFound; - m_aDockUIElement = aUIElement; + m_aDockUIElement = std::move(aUIElement); m_aDockUIElement.m_bUserActive = true; } diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx index 20f4309c478d..5e259713d94b 100644 --- a/helpcompiler/source/HelpCompiler.cxx +++ b/helpcompiler/source/HelpCompiler.cxx @@ -341,7 +341,7 @@ void myparser::traverse( xmlNodePtr parentNode ) documentId = hid; extendedHelpText.push_back(hid); HCDBG(std::cerr << "hid pushback" << (anchor.empty() ? hid : hid + "#" + anchor) << std::endl); - hidlist->push_back( anchor.empty() ? hid : hid + "#" + anchor); + hidlist->push_back( anchor.empty() ? std::move(hid) : hid + "#" + anchor); } else continue; diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index d738507b2ffc..8998f697489d 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -808,7 +808,7 @@ void ScPatternAttr::fillColor(model::ComplexColor& rComplexColor, const SfxItemS aColor = aSysTextColor; } aComplexColor.setFinalColor(aColor); - rComplexColor = aComplexColor; + rComplexColor = std::move(aComplexColor); } ScDxfFont ScPatternAttr::GetDxfFont(const SfxItemSet& rItemSet, SvtScriptType nScript) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index e2f74c19925a..1c9c7e0d9663 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -919,7 +919,7 @@ double ScInterpreter::Compare( ScQueryOp eOp ) { svl::SharedString aStr; GetCellString(aStr, aCell); - rCell.maStr = aStr; + rCell.maStr = std::move(aStr); rCell.mbValue = false; } else diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index b3fc629f17e8..785ff7012dc6 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -136,7 +136,7 @@ GroupShapeContext::GroupShapeContext( const FragmentHandler2& rParent, { ShapePtr xShape = std::make_shared<Shape>( rHelper, rAttribs, u"com.sun.star.drawing.CustomShape"_ustr ); if( pxShape ) *pxShape = xShape; - return new ShapeContext( rParent, rxParentShape, xShape ); + return new ShapeContext( rParent, rxParentShape, std::move(xShape) ); } case XDR_TOKEN( cxnSp ): { diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 9e20f1f79c66..15be0c4aa5d0 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -280,7 +280,7 @@ void CustomAnimationPresets::importEffects() { pDescriptor = std::make_shared<CustomAnimationPreset>( pEffect ); pDescriptor->maLabel = getUINameForPresetId( pEffect->getPresetId() ); - maEffectDescriptorMap[aPresetId] = pDescriptor; + maEffectDescriptorMap[aPresetId] = std::move(pDescriptor); } ++aIter; diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index b25d24854949..5188df0a9ec3 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -462,7 +462,7 @@ void FilePolicy::refresh() // assign new ones MutexGuard guard( m_aMutex ); m_defaultPermissions = defaultPermissions; - m_userPermissions = userPermissions; + m_userPermissions = std::move(userPermissions); } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 0de8de06a050..00acb4271876 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -297,7 +297,7 @@ rtl::Reference<SdrObject> IMapWindow::CreateObj( const IMapObject* pIMapObj ) pSdrObj->SetMergedItemSetAndBroadcast(aSet); - pSdrObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pCloneIMapObj )) ); + pSdrObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( std::move(pCloneIMapObj) )) ); pSdrObj->SetUserCall( GetSdrUserCall() ); } diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx index 876619215797..dce05840e27e 100644 --- a/svx/source/sdr/contact/viewcontactofe3d.cxx +++ b/svx/source/sdr/contact/viewcontactofe3d.cxx @@ -142,7 +142,7 @@ drawinglayer::primitive3d::Primitive3DContainer const & ViewContactOfE3d::getVIP if(mxViewIndependentPrimitive3DContainer != xNew) { // has changed, copy content - const_cast< ViewContactOfE3d* >(this)->mxViewIndependentPrimitive3DContainer = xNew; + const_cast< ViewContactOfE3d* >(this)->mxViewIndependentPrimitive3DContainer = std::move(xNew); } // return current Primitive2DContainer diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 2f7b4da1c703..258831eab9dc 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -556,8 +556,10 @@ namespace drawinglayer::primitive2d std::optional<OutlinerParaObject> aTextEditOutlinerParaObject(rTextObj.CreateEditOutlinerParaObject()); if (aTextEditOutlinerParaObject) + { // if we got one, prefer text from active TextEdit - aOutlinerParaObject = aTextEditOutlinerParaObject; + aOutlinerParaObject = std::move(aTextEditOutlinerParaObject); + } } if(aOutlinerParaObject) @@ -868,7 +870,7 @@ namespace drawinglayer::primitive2d const sal_Int32 nSoftEdgeRadius(getSoftEdgeRadius(rSet)); return attribute::SdrLineFillEffectsTextAttribute(aLine, aFill, aLineStartEnd, - aShadow, aFillFloatTransGradient, + aShadow, std::move(aFillFloatTransGradient), aText, aGlow, nSoftEdgeRadius); } diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index cde62097f490..afd24c58e41d 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -359,7 +359,7 @@ rtl::Reference<SdrObject> SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool pPathObj = new SdrPathObj( getSdrModelFromSdrObject(), SdrObjKind::PathFill, - aPolyPolygon); + std::move(aPolyPolygon)); } else { diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index a6845c56b633..fa679b05b835 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -152,10 +152,10 @@ public: virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) = 0; /// Start of the paragraph. - virtual sal_Int32 StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, bool bGenerateParaId ) = 0; + virtual sal_Int32 StartParagraph( const ww8::WW8TableNodeInfo::Pointer_t& pTextNodeInfo, bool bGenerateParaId ) = 0; /// End of the paragraph. - virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) = 0; + virtual void EndParagraph( const ww8::WW8TableNodeInfoInner::Pointer_t& pTextNodeInfoInner ) = 0; /// Called in order to output section breaks. virtual void SectionBreaks(const SwNode& rNode) = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 07c7bba7ef87..35c7705bdd71 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -499,7 +499,7 @@ static void checkAndWriteFloatingTables(DocxAttributeOutput& rDocxAttributeOutpu } } -sal_Int32 DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, +sal_Int32 DocxAttributeOutput::StartParagraph(const ww8::WW8TableNodeInfo::Pointer_t& pTextNodeInfo, bool bGenerateParaId) { // Paragraphs (in headers/footers/comments/frames etc) can start before another finishes. @@ -1125,7 +1125,7 @@ bool DocxAttributeOutput::TextBoxIsFramePr(const SwFrameFormat& rFrameFormat) return bRet; } -void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) +void DocxAttributeOutput::EndParagraph( const ww8::WW8TableNodeInfoInner::Pointer_t& pTextNodeInfoInner ) { // write the paragraph properties + the run, already in the correct order m_pSerializer->mergeTopMarks(Tag_StartParagraph_2); diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index d9cddce059c7..f7c8d2892ac9 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -204,11 +204,11 @@ public: virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) override; /// Start of the paragraph. - virtual sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, + virtual sal_Int32 StartParagraph(const ww8::WW8TableNodeInfo::Pointer_t& pTextNodeInfo, bool bGenerateParaId) override; /// End of the paragraph. - virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) override; + virtual void EndParagraph( const ww8::WW8TableNodeInfoInner::Pointer_t& pTextNodeInfoInner ) override; /// Empty paragraph. virtual void EmptyParagraph() override; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 07063fb4d5c5..50003bda6d9c 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -221,7 +221,7 @@ void RtfAttributeOutput::RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) m_bControlLtrRtl = true; } -sal_Int32 RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, +sal_Int32 RtfAttributeOutput::StartParagraph(const ww8::WW8TableNodeInfo::Pointer_t& pTextNodeInfo, bool /*bGenerateParaId*/) { if (m_bIsBeforeFirstParagraph && m_rExport.m_nTextTyp != TXT_HDFT) @@ -281,7 +281,8 @@ sal_Int32 RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pT return 0; } -void RtfAttributeOutput::EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) +void RtfAttributeOutput::EndParagraph( + const ww8::WW8TableNodeInfoInner::Pointer_t& pTextNodeInfoInner) { bool bLastPara = false; if (m_rExport.m_nTextTyp == TXT_FTN || m_rExport.m_nTextTyp == TXT_EDN diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 8ba84bed6055..f6fc8c388dff 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -50,11 +50,11 @@ public: void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) override; /// Start of the paragraph. - sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, + sal_Int32 StartParagraph(const ww8::WW8TableNodeInfo::Pointer_t& pTextNodeInfo, bool bGenerateParaId) override; /// End of the paragraph. - void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override; + void EndParagraph(const ww8::WW8TableNodeInfoInner::Pointer_t& pTextNodeInfoInner) override; /// Empty paragraph. void EmptyParagraph() override; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index d72db627eced..3ad841ff5d43 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1112,7 +1112,7 @@ void WW8AttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) } } -void WW8AttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) +void WW8AttributeOutput::EndParagraph( const ww8::WW8TableNodeInfoInner::Pointer_t& pTextNodeInfoInner ) { m_rWW8Export.m_pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell() - (mbOnTOXEnding?2:0), m_rWW8Export.m_pO->size(), m_rWW8Export.m_pO->data() ); mbOnTOXEnding = false; diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index 52df22914aa5..8f32ab9f1d7c 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -32,10 +32,10 @@ public: virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) override; /// Start of the paragraph. - virtual sal_Int32 StartParagraph( ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, bool /*bGenerateParaId*/ ) override { return 0; } + virtual sal_Int32 StartParagraph( const ww8::WW8TableNodeInfo::Pointer_t& /*pTextNodeInfo*/, bool /*bGenerateParaId*/ ) override { return 0; } /// End of the paragraph. - virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) override; + virtual void EndParagraph( const ww8::WW8TableNodeInfoInner::Pointer_t& pTextNodeInfoInner ) override; /// Called in order to output section breaks. virtual void SectionBreaks(const SwNode& /*rNode*/) override {} diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 0bf3fa640dc0..fffdf7623164 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -211,7 +211,7 @@ void SwFieldPage::InsertField(SwFieldTypesEnum nTypeId, sal_uInt16 nSubType, con OUString sColumn = rPar1.getToken(0, DB_DELIM, nIdx); auto pOldType = static_cast<SwDBFieldType*>(pTmpField->GetTyp()); - auto pType = static_cast<SwDBFieldType*>(pSh->InsertFieldType(SwDBFieldType(pSh->GetDoc(), sColumn, aData))); + auto pType = static_cast<SwDBFieldType*>(pSh->InsertFieldType(SwDBFieldType(pSh->GetDoc(), sColumn, std::move(aData)))); if(auto pFormatField = pOldType->FindFormatForField(m_pCurField)) { pFormatField->RegisterToFieldType(*pType); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 953c129976fe..22f4f5d93211 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -3146,7 +3146,8 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) std::shared_ptr<weld::DialogController> pDialogController(pAbstractDialog->getDialogController()); weld::DialogController::runAsync(pDialogController, - [pAbstractDialog, &rSh, &rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn] (sal_Int32 nResult) { + [pAbstractDialog=std::move(pAbstractDialog), &rSh, &rTempView, aTableNameIn, + nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn] (sal_Int32 nResult) { if( RET_OK == nResult ) { sal_uInt16 nCols = nColsIn; diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index d37180489ef4..db00f15f9216 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -212,7 +212,8 @@ static void sw_CharDialog(SwWrtShell& rWrtSh, bool bUseDialog, bool bApplyToPara pRequest = std::make_shared<SfxRequest>(*pReq); pReq->Ignore(); // the 'old' request is not relevant any more } - pDlg->StartExecuteAsync([pDlg, &rWrtSh, pCoreSet, bSel, bSelectionPut, bApplyToParagraph, pRequest](sal_Int32 nResult){ + pDlg->StartExecuteAsync([pDlg, &rWrtSh, pCoreSet=std::move(pCoreSet), bSel, + bSelectionPut, bApplyToParagraph, pRequest](sal_Int32 nResult){ if (nResult == RET_OK) { sw_CharDialogResult(pDlg->GetOutputItemSet(), rWrtSh, pCoreSet, bSel, bSelectionPut, diff --git a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx index fa0e9b809f80..66eae29e5b63 100644 --- a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx +++ b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx @@ -348,7 +348,7 @@ OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet pBlipSet->add(NS_ooxml::LN_payload, pPayloadValue, OOXMLProperty::ATTRIBUTE); - OOXMLValue::Pointer_t pBlipValue(new OOXMLPropertySetValue(pBlipSet)); + OOXMLValue::Pointer_t pBlipValue(new OOXMLPropertySetValue(std::move(pBlipSet))); OOXMLPropertySet * pProps = new OOXMLPropertySet; diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx index a7d9f5504597..a69ec533d9e8 100644 --- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx @@ -227,7 +227,7 @@ void DAVResourceAccess::PROPFIND( rResources, DAVRequestEnvironment( new DAVAuthListener_Impl( xEnv, m_aURL ), - aHeaders ) ); + std::move(aHeaders) ) ); } catch (DAVException const& e) { @@ -631,7 +631,7 @@ void DAVResourceAccess::PUT( xSeekableStream, DAVRequestEnvironment( new DAVAuthListener_Impl( xEnv, m_aURL ), - aHeaders ) ); + std::move(aHeaders) ) ); } catch (DAVException const& e) { diff --git a/vcl/source/bitmap/dibtools.cxx b/vcl/source/bitmap/dibtools.cxx index c4b15f79e76b..97bcb86b0feb 100644 --- a/vcl/source/bitmap/dibtools.cxx +++ b/vcl/source/bitmap/dibtools.cxx @@ -1036,11 +1036,11 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uI if (bRet) { - rBmp = aNewBmp; + rBmp = std::move(aNewBmp); if(bAlphaPossible) { - *pBmpAlpha = aNewBmpAlpha; + *pBmpAlpha = std::move(aNewBmpAlpha); } } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 111bd905eb33..71092f3b8ffb 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -926,7 +926,7 @@ ErrCode GraphicFilter::readPNG(SvStream & rStream, Graphic & rGraphic, GfxLinkTy std::shared_ptr<SvStream> pIStrm(aMSGifChunk.getAsStream()); ImportGIF(*pIStrm, rGraphic); rLinkType = GfxLinkType::NativeGif; - rpGraphicContent = aMSGifChunk; + rpGraphicContent = std::move(aMSGifChunk); return aReturnCode; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index f0c49730a03a..f8477d02965a 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1260,16 +1260,14 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, m_aStructure[0].m_nParentElement = 0; //m_StructElementStack.push(0); - Font aFont; - aFont.SetFamilyName( u"Times"_ustr ); - aFont.SetFontSize( Size( 0, 12 ) ); - // tdf#150786 use the same settings for widgets regardless of theme m_aWidgetStyleSettings.SetStandardStyles(); GraphicsState aState; aState.m_aMapMode = m_aMapMode; - aState.m_aFont = aFont; + aState.m_aFont.SetFamilyName( u"Times"_ustr ); + aState.m_aFont.SetFontSize( Size( 0, 12 ) ); + m_aGraphicsStack.push_front( aState ); osl::File::RC aError = m_aFile.open(osl_File_OpenFlag_Write | osl_File_OpenFlag_Create); diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 86ac23137562..3788a1238818 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -677,7 +677,7 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, if (aLinearContext.blendBitmap( BitmapScopedWriteAccess(aBmp).get(), pBitmapReadAccess.get(), pAlphaReadAccess.get(), nDstWidth, nDstHeight)) { - aNewBitmap = aBmp; + aNewBitmap = std::move(aBmp); } else {