[Libreoffice-commits] core.git: basctl/source basegfx/source basic/source binaryurp/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Sep 8 18:17:52 UTC 2017


 basctl/source/basicide/basidesh.cxx               |    8 +-
 basegfx/source/polygon/b2dpolygoncutandtouch.cxx  |   18 ++---
 basegfx/source/polygon/b2dpolygontools.cxx        |   20 ++----
 basegfx/source/polygon/b2dpolygontriangulator.cxx |    2 
 basegfx/source/polygon/b2dpolypolygoncutter.cxx   |    4 -
 basegfx/source/polygon/b2dtrapezoid.cxx           |   67 +++++++++-------------
 basegfx/source/range/b2drangeclipper.cxx          |   20 ++----
 basegfx/source/raster/rasterconvert3d.cxx         |   20 +++---
 basegfx/source/tools/unotools.cxx                 |    8 +-
 basic/source/basmgr/basmgr.cxx                    |   18 ++---
 basic/source/classes/sb.cxx                       |    6 -
 basic/source/classes/sbunoobj.cxx                 |    4 -
 basic/source/runtime/runtime.cxx                  |    4 -
 binaryurp/source/bridge.cxx                       |   10 +--
 binaryurp/source/bridgefactory.cxx                |    3 
 binaryurp/source/incomingrequest.cxx              |    5 -
 binaryurp/source/proxy.cxx                        |   10 +--
 binaryurp/source/writer.cxx                       |    7 --
 18 files changed, 104 insertions(+), 130 deletions(-)

New commits:
commit 84cbd6a5434e119613d677370e7657ea77cd7767
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Sep 8 16:55:09 2017 +0200

    clang-tidy modernize-use-emplace in b*
    
    Change-Id: I51e0369ba2e1fe0b7c934531f71d3bda95ba09ec
    Reviewed-on: https://gerrit.libreoffice.org/42109
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 8ef3742d6222..9464c03e5da0 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -314,7 +314,7 @@ void Shell::onDocumentClosed( const ScriptDocument& _rDocument )
                 pWin->BasicStopped();
             }
             else
-                aDeleteVec.push_back( pWin );
+                aDeleteVec.emplace_back(pWin );
         }
     }
     // delete windows outside main loop so we don't invalidate the original iterator
@@ -557,7 +557,7 @@ void Shell::CheckWindows()
     {
         BaseWindow* pWin = it->second;
         if ( pWin->GetStatus() & BASWIN_TOBEKILLED )
-            aDeleteVec.push_back( pWin );
+            aDeleteVec.emplace_back(pWin );
     }
     for ( VclPtr<BaseWindow> const & pWin : aDeleteVec )
     {
@@ -579,7 +579,7 @@ void Shell::RemoveWindows( const ScriptDocument& rDocument, const OUString& rLib
     {
         BaseWindow* pWin = it->second;
         if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName )
-            aDeleteVec.push_back( pWin );
+            aDeleteVec.emplace_back(pWin );
     }
     for ( VclPtr<BaseWindow> const & pWin : aDeleteVec )
     {
@@ -612,7 +612,7 @@ void Shell::UpdateWindows()
                 // Window is frozen at first, later the windows should be changed
                 // anyway to be marked as hidden instead of being deleted.
                 if ( !(pWin->GetStatus() & ( BASWIN_TOBEKILLED | BASWIN_RUNNINGBASIC | BASWIN_SUSPENDED ) ) )
-                    aDeleteVec.push_back( pWin );
+                    aDeleteVec.emplace_back(pWin );
             }
         }
         for ( auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 74f60b17a59d..6f164d2965ec 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -189,7 +189,7 @@ namespace basegfx
                     const temporaryPoint& rTempPoint = rPointVector[a];
                     const double fCutPosInPolygon((double)rTempPoint.getIndex() + rTempPoint.getCut());
                     const double fRelativeCutPos(fCutPosInPolygon / (double)nEdgeCount);
-                    rTempPoints.push_back(temporaryPoint(rTempPoint.getPoint(), nInd, fRelativeCutPos));
+                    rTempPoints.emplace_back(rTempPoint.getPoint(), nInd, fRelativeCutPos);
                 }
             }
         }
@@ -251,8 +251,8 @@ namespace basegfx
                                 // add a cut point to each list. The lists may be the same for
                                 // self intersections.
                                 const B2DPoint aCutPoint(interpolate(rCurrA, rNextA, fCut));
-                                rTempPointsA.push_back(temporaryPoint(aCutPoint, nIndA, fCut));
-                                rTempPointsB.push_back(temporaryPoint(aCutPoint, nIndB, fCut2));
+                                rTempPointsA.emplace_back(aCutPoint, nIndA, fCut);
+                                rTempPointsB.emplace_back(aCutPoint, nIndB, fCut2);
                             }
                         }
                     }
@@ -340,13 +340,13 @@ namespace basegfx
                                                 // by outer methods and would just produce a double point
                                                 if(a)
                                                 {
-                                                    rTempPointsA.push_back(temporaryPoint(aCurrA, a, 0.0));
+                                                    rTempPointsA.emplace_back(aCurrA, a, 0.0);
                                                 }
                                             }
                                             else
                                             {
                                                 const B2DPoint aCutPoint(interpolate(aCurrA, aNextA, fCutA));
-                                                rTempPointsA.push_back(temporaryPoint(aCutPoint, a, fCutA));
+                                                rTempPointsA.emplace_back(aCutPoint, a, fCutA);
                                             }
 
                                             // #i111715# use fTools::equal instead of fTools::equalZero for better accuracy
@@ -356,13 +356,13 @@ namespace basegfx
                                                 // by outer methods and would just produce a double point
                                                 if(b)
                                                 {
-                                                    rTempPointsB.push_back(temporaryPoint(aCurrB, b, 0.0));
+                                                    rTempPointsB.emplace_back(aCurrB, b, 0.0);
                                                 }
                                             }
                                             else
                                             {
                                                 const B2DPoint aCutPoint(interpolate(aCurrB, aNextB, fCutB));
-                                                rTempPointsB.push_back(temporaryPoint(aCutPoint, b, fCutB));
+                                                rTempPointsB.emplace_back(aCutPoint, b, fCutB);
                                             }
                                         }
                                     }
@@ -414,7 +414,7 @@ namespace basegfx
             // append remapped tempVector entries for edge to tempPoints for edge
             for(temporaryPoint & rTempPoint : aTempPointVectorEdge)
             {
-                rTempPointsB.push_back(temporaryPoint(rTempPoint.getPoint(), nIndB, rTempPoint.getCut()));
+                rTempPointsB.emplace_back(rTempPoint.getPoint(), nIndB, rTempPoint.getCut());
             }
         }
 
@@ -641,7 +641,7 @@ namespace basegfx
 
                                 if(fTools::more(fCut, fZero) && fTools::less(fCut, fOne))
                                 {
-                                    rTempPoints.push_back(temporaryPoint(aTestPoint, nInd, fCut));
+                                    rTempPoints.emplace_back(aTestPoint, nInd, fCut);
                                 }
                             }
                         }
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index 80f3da07d50b..00ba32193db5 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -3419,10 +3419,9 @@ namespace basegfx
                         {
                             // add current point (always) and remember StartPointIndex for evtl. later corrections
                             const sal_uInt32 nStartPointIndex(aCollectPoints.size());
-                            aCollectPoints.push_back(
-                                css::awt::Point(
+                            aCollectPoints.emplace_back(
                                     fround(aBezierSegment.getStartPoint().getX()),
-                                    fround(aBezierSegment.getStartPoint().getY())));
+                                    fround(aBezierSegment.getStartPoint().getY()));
                             aCollectFlags.push_back(css::drawing::PolygonFlags_NORMAL);
 
                             // prepare next segment
@@ -3434,16 +3433,14 @@ namespace basegfx
                             if(aBezierSegment.isBezier())
                             {
                                 // if bezier is used, add always two control points due to the old schema
-                                aCollectPoints.push_back(
-                                    css::awt::Point(
+                                aCollectPoints.emplace_back(
                                         fround(aBezierSegment.getControlPointA().getX()),
-                                        fround(aBezierSegment.getControlPointA().getY())));
+                                        fround(aBezierSegment.getControlPointA().getY()));
                                 aCollectFlags.push_back(css::drawing::PolygonFlags_CONTROL);
 
-                                aCollectPoints.push_back(
-                                    css::awt::Point(
+                                aCollectPoints.emplace_back(
                                         fround(aBezierSegment.getControlPointB().getX()),
-                                        fround(aBezierSegment.getControlPointB().getY())));
+                                        fround(aBezierSegment.getControlPointB().getY()));
                                 aCollectFlags.push_back(css::drawing::PolygonFlags_CONTROL);
                             }
 
@@ -3476,10 +3473,9 @@ namespace basegfx
                         {
                             // add last point as closing point
                             const B2DPoint aClosingPoint(rPolygon.getB2DPoint(nPointCount - 1));
-                            aCollectPoints.push_back(
-                                css::awt::Point(
+                            aCollectPoints.emplace_back(
                                     fround(aClosingPoint.getX()),
-                                    fround(aClosingPoint.getY())));
+                                    fround(aClosingPoint.getY()));
                             aCollectFlags.push_back(css::drawing::PolygonFlags_NORMAL);
                         }
 
diff --git a/basegfx/source/polygon/b2dpolygontriangulator.cxx b/basegfx/source/polygon/b2dpolygontriangulator.cxx
index c446bea22a6c..4a85547d7de3 100644
--- a/basegfx/source/polygon/b2dpolygontriangulator.cxx
+++ b/basegfx/source/polygon/b2dpolygontriangulator.cxx
@@ -233,7 +233,7 @@ namespace basegfx
 
                             if( !aPrevPnt.equal(aNextPnt) )
                             {
-                                maStartEntries.push_back(EdgeEntry(aPrevPnt, aNextPnt));
+                                maStartEntries.emplace_back(aPrevPnt, aNextPnt);
                             }
 
                             aPrevPnt = aNextPnt;
diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
index cbd5a50112af..1c72680a325a 100644
--- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx
+++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
@@ -449,13 +449,13 @@ namespace basegfx
 
                             if(pLast->getX() != aMiddle.getX() || pLast->getY() != aMiddle.getY())
                             {
-                                maCorrectionTable.push_back(CorrectionPair(*pLast, aMiddle));
+                                maCorrectionTable.emplace_back(*pLast, aMiddle);
                                 *pLast = aMiddle;
                             }
 
                             if(pCurrent->getX() != aMiddle.getX() || pCurrent->getY() != aMiddle.getY())
                             {
-                                maCorrectionTable.push_back(CorrectionPair(*pCurrent, aMiddle));
+                                maCorrectionTable.emplace_back(*pCurrent, aMiddle);
                                 *pCurrent = aMiddle;
                             }
                         }
diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx
index c92a64a3a903..8572e8d18754 100644
--- a/basegfx/source/polygon/b2dtrapezoid.cxx
+++ b/basegfx/source/polygon/b2dtrapezoid.cxx
@@ -556,7 +556,7 @@ namespace basegfx
                                     if(!fTools::equal(pPrev->getX(), pCurr->getX()))
                                     {
                                         // X-order not needed, just add
-                                        aTrDeSimpleEdges.push_back(TrDeSimpleEdge(pPrev, pCurr));
+                                        aTrDeSimpleEdges.emplace_back(pPrev, pCurr);
 
                                         const double fMiddle((pPrev->getY() + pCurr->getY()) * 0.5);
                                         pPrev->setY(fMiddle);
@@ -567,7 +567,7 @@ namespace basegfx
                                 {
                                     // vertical edge. Positive Y-direction is guaranteed by the
                                     // TrDeEdgeEntry constructor
-                                    maTrDeEdgeEntries.push_back(TrDeEdgeEntry(pPrev, pCurr, 0));
+                                    maTrDeEdgeEntries.emplace_back(pPrev, pCurr, 0);
                                     mnInitialEdgeEntryCount++;
                                 }
 
@@ -874,14 +874,13 @@ namespace basegfx
                     // the two edges start at the same Y, they use the same DeltaY, they
                     // do not cut themselves and not any other edge in range. Create a
                     // B2DTrapezoid and consume both edges
-                    ro_Result.push_back(
-                        B2DTrapezoid(
+                    ro_Result.emplace_back(
                             aLeft.getStart().getX(),
                             aRight.getStart().getX(),
                             aLeft.getStart().getY(),
                             aLeftEnd.getX(),
                             aRightEnd.getX(),
-                            aLeftEnd.getY()));
+                            aLeftEnd.getY());
 
                     maTrDeEdgeEntries.pop_front();
                     maTrDeEdgeEntries.pop_front();
@@ -980,14 +979,13 @@ namespace basegfx
                 const double fLeftX(rPointA.getX() - fHalfLineWidth);
                 const double fRightX(rPointA.getX() + fHalfLineWidth);
 
-                ro_Result.push_back(
-                    B2DTrapezoid(
+                ro_Result.emplace_back(
                         fLeftX,
                         fRightX,
                         std::min(rPointA.getY(), rPointB.getY()),
                         fLeftX,
                         fRightX,
-                        std::max(rPointA.getY(), rPointB.getY())));
+                        std::max(rPointA.getY(), rPointB.getY()));
             }
             else if(fTools::equal(rPointA.getY(), rPointB.getY()))
             {
@@ -995,14 +993,13 @@ namespace basegfx
                 const double fLeftX(std::min(rPointA.getX(), rPointB.getX()));
                 const double fRightX(std::max(rPointA.getX(), rPointB.getX()));
 
-                ro_Result.push_back(
-                    B2DTrapezoid(
+                ro_Result.emplace_back(
                         fLeftX,
                         fRightX,
                         rPointA.getY() - fHalfLineWidth,
                         fLeftX,
                         fRightX,
-                        rPointA.getY() + fHalfLineWidth));
+                        rPointA.getY() + fHalfLineWidth);
             }
             else
             {
@@ -1021,10 +1018,10 @@ namespace basegfx
                 // create EdgeEntries
                 basegfx::trapezoidhelper::TrDeEdgeEntries aTrDeEdgeEntries;
 
-                aTrDeEdgeEntries.push_back(basegfx::trapezoidhelper::TrDeEdgeEntry(&aStartLow, &aStartHigh, 0));
-                aTrDeEdgeEntries.push_back(basegfx::trapezoidhelper::TrDeEdgeEntry(&aStartHigh, &aEndHigh, 0));
-                aTrDeEdgeEntries.push_back(basegfx::trapezoidhelper::TrDeEdgeEntry(&aEndHigh, &aEndLow, 0));
-                aTrDeEdgeEntries.push_back(basegfx::trapezoidhelper::TrDeEdgeEntry(&aEndLow, &aStartLow, 0));
+                aTrDeEdgeEntries.emplace_back(&aStartLow, &aStartHigh, 0);
+                aTrDeEdgeEntries.emplace_back(&aStartHigh, &aEndHigh, 0);
+                aTrDeEdgeEntries.emplace_back(&aEndHigh, &aEndLow, 0);
+                aTrDeEdgeEntries.emplace_back(&aEndLow, &aStartLow, 0);
                 aTrDeEdgeEntries.sort();
 
                 // here we know we have exactly four edges, and they do not cut, touch or
@@ -1038,26 +1035,24 @@ namespace basegfx
                 if(bEndOnSameLine)
                 {
                     // create two triangle trapezoids
-                    ro_Result.push_back(
-                        B2DTrapezoid(
+                    ro_Result.emplace_back(
                             aLeft.getStart().getX(),
                             aRight.getStart().getX(),
                             aLeft.getStart().getY(),
                             aLeft.getEnd().getX(),
                             aRight.getEnd().getX(),
-                            aLeft.getEnd().getY()));
+                            aLeft.getEnd().getY());
 
                     basegfx::trapezoidhelper::TrDeEdgeEntries::reference aLeft2(*aCurrent++);
                     basegfx::trapezoidhelper::TrDeEdgeEntries::reference aRight2(*aCurrent++);
 
-                    ro_Result.push_back(
-                        B2DTrapezoid(
+                    ro_Result.emplace_back(
                             aLeft2.getStart().getX(),
                             aRight2.getStart().getX(),
                             aLeft2.getStart().getY(),
                             aLeft2.getEnd().getX(),
                             aRight2.getEnd().getX(),
-                            aLeft2.getEnd().getY()));
+                            aLeft2.getEnd().getY());
                 }
                 else
                 {
@@ -1072,32 +1067,29 @@ namespace basegfx
                         const B2DPoint aSplitLeft(aLeft.getCutPointForGivenY(aRight.getEnd().getY()));
                         const B2DPoint aSplitRight(aRight2.getCutPointForGivenY(aLeft.getEnd().getY()));
 
-                        ro_Result.push_back(
-                            B2DTrapezoid(
+                        ro_Result.emplace_back(
                                 aLeft.getStart().getX(),
                                 aRight.getStart().getX(),
                                 aLeft.getStart().getY(),
                                 aSplitLeft.getX(),
                                 aRight.getEnd().getX(),
-                                aRight.getEnd().getY()));
+                                aRight.getEnd().getY());
 
-                        ro_Result.push_back(
-                            B2DTrapezoid(
+                        ro_Result.emplace_back(
                                 aSplitLeft.getX(),
                                 aRight.getEnd().getX(),
                                 aRight.getEnd().getY(),
                                 aLeft2.getStart().getX(),
                                 aSplitRight.getX(),
-                                aLeft2.getStart().getY()));
+                                aLeft2.getStart().getY());
 
-                        ro_Result.push_back(
-                            B2DTrapezoid(
+                        ro_Result.emplace_back(
                                 aLeft2.getStart().getX(),
                                 aSplitRight.getX(),
                                 aLeft2.getStart().getY(),
                                 aLeft2.getEnd().getX(),
                                 aRight2.getEnd().getX(),
-                                aLeft2.getEnd().getY()));
+                                aLeft2.getEnd().getY());
                     }
                     else
                     {
@@ -1106,32 +1098,29 @@ namespace basegfx
                         const B2DPoint aSplitRight(aRight.getCutPointForGivenY(aLeft.getEnd().getY()));
                         const B2DPoint aSplitLeft(aLeft2.getCutPointForGivenY(aRight.getEnd().getY()));
 
-                        ro_Result.push_back(
-                            B2DTrapezoid(
+                        ro_Result.emplace_back(
                                 aLeft.getStart().getX(),
                                 aRight.getStart().getX(),
                                 aLeft.getStart().getY(),
                                 aLeft.getEnd().getX(),
                                 aSplitRight.getX(),
-                                aLeft.getEnd().getY()));
+                                aLeft.getEnd().getY());
 
-                        ro_Result.push_back(
-                            B2DTrapezoid(
+                        ro_Result.emplace_back(
                                 aLeft.getEnd().getX(),
                                 aSplitRight.getX(),
                                 aLeft.getEnd().getY(),
                                 aSplitLeft.getX(),
                                 aRight.getEnd().getX(),
-                                aRight2.getStart().getY()));
+                                aRight2.getStart().getY());
 
-                        ro_Result.push_back(
-                            B2DTrapezoid(
+                        ro_Result.emplace_back(
                                 aSplitLeft.getX(),
                                 aRight.getEnd().getX(),
                                 aRight2.getStart().getY(),
                                 aLeft2.getEnd().getX(),
                                 aRight2.getEnd().getX(),
-                                aLeft2.getEnd().getY()));
+                                aLeft2.getEnd().getY());
                     }
                 }
             }
diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx
index c4b8d83a1b71..2b68bae713ad 100644
--- a/basegfx/source/range/b2drangeclipper.cxx
+++ b/basegfx/source/range/b2drangeclipper.cxx
@@ -542,12 +542,11 @@ namespace basegfx
             {
                 const B2DRectangle& rCurrRect( *aCurrRect++ );
 
-                o_rEventVector.push_back(
-                    SweepLineEvent( rCurrRect.getMinX(),
+                o_rEventVector.emplace_back( rCurrRect.getMinX(),
                                     rCurrRect,
                                     SweepLineEvent::STARTING_EDGE,
                                     (*aCurrOrientation++) == B2VectorOrientation::Positive ?
-                                    SweepLineEvent::PROCEED_UP : SweepLineEvent::PROCEED_DOWN) );
+                                    SweepLineEvent::PROCEED_UP : SweepLineEvent::PROCEED_DOWN );
             }
 
             // second pass: add all right edges in reversed order
@@ -558,12 +557,11 @@ namespace basegfx
             {
                 const B2DRectangle& rCurrRect( *aCurrRectR++ );
 
-                o_rEventVector.push_back(
-                    SweepLineEvent( rCurrRect.getMaxX(),
+                o_rEventVector.emplace_back( rCurrRect.getMaxX(),
                                     rCurrRect,
                                     SweepLineEvent::FINISHING_EDGE,
                                     (*aCurrOrientationR++) == B2VectorOrientation::Positive ?
-                                    SweepLineEvent::PROCEED_DOWN : SweepLineEvent::PROCEED_UP ) );
+                                    SweepLineEvent::PROCEED_DOWN : SweepLineEvent::PROCEED_UP );
             }
 
             // sort events
@@ -618,19 +616,17 @@ namespace basegfx
             io_rPolygonPool.get(nIdxPolygon).setPolygonPoolIndex(nIdxPolygon);
 
             // upper edge
-            aNewEdges.push_back(
-                ActiveEdge(
+            aNewEdges.emplace_back(
                     rRect,
                     rRect.getMinY(),
                     bGoesDown ? nIdxPolygon : -1,
-                    bGoesDown ? ActiveEdge::PROCEED_LEFT : ActiveEdge::PROCEED_RIGHT) );
+                    bGoesDown ? ActiveEdge::PROCEED_LEFT : ActiveEdge::PROCEED_RIGHT );
             // lower edge
-            aNewEdges.push_back(
-                ActiveEdge(
+            aNewEdges.emplace_back(
                     rRect,
                     rRect.getMaxY(),
                     bGoesDown ? -1 : nIdxPolygon,
-                    bGoesDown ? ActiveEdge::PROCEED_RIGHT : ActiveEdge::PROCEED_LEFT ) );
+                    bGoesDown ? ActiveEdge::PROCEED_RIGHT : ActiveEdge::PROCEED_LEFT );
 
             // furthermore, have to respect a special tie-breaking
             // rule here, for edges which share the same y value:
diff --git a/basegfx/source/raster/rasterconvert3d.cxx b/basegfx/source/raster/rasterconvert3d.cxx
index 951cdbd65ebd..8e1ab3b6d9d8 100644
--- a/basegfx/source/raster/rasterconvert3d.cxx
+++ b/basegfx/source/raster/rasterconvert3d.cxx
@@ -168,10 +168,10 @@ namespace basegfx
 
             const sal_uInt32 nYDelta(nYEnd - nYStart);
             const double fInvYDelta(1.0 / nYDelta);
-            maLineEntries.push_back(RasterConversionLineEntry3D(
+            maLineEntries.emplace_back(
                 aStart.getX(), (aEnd.getX() - aStart.getX()) * fInvYDelta,
                 aStart.getZ(), (aEnd.getZ() - aStart.getZ()) * fInvYDelta,
-                nYStart, nYDelta));
+                nYStart, nYDelta);
 
             // if extra interpolation data is used, add it to the last created entry
             RasterConversionLineEntry3D& rEntry = maLineEntries[maLineEntries.size() - 1];
@@ -261,14 +261,14 @@ namespace basegfx
 
                     // horizontal line, create vertical entries. These will be sorted by
                     // X anyways, so no need to distinguish the case here
-                    maLineEntries.push_back(RasterConversionLineEntry3D(
+                    maLineEntries.emplace_back(
                         aStart.getX(), 0.0,
                         aStart.getZ() + fZBufferLineAdd, 0.0,
-                        nYStart, 1));
-                    maLineEntries.push_back(RasterConversionLineEntry3D(
+                        nYStart, 1);
+                    maLineEntries.emplace_back(
                         aEnd.getX(), 0.0,
                         aEnd.getZ() + fZBufferLineAdd, 0.0,
-                        nYStart, 1));
+                        nYStart, 1);
                 }
             }
             else
@@ -287,10 +287,10 @@ namespace basegfx
 
                 // non-horizontal line, create two parallel entries. These will be sorted by
                 // X anyways, so no need to distinguish the case here
-                maLineEntries.push_back(RasterConversionLineEntry3D(
+                maLineEntries.emplace_back(
                     aStart.getX(), (aEnd.getX() - aStart.getX()) * fInvYDelta,
                     aStart.getZ() + fZBufferLineAdd, (aEnd.getZ() - aStart.getZ()) * fInvYDelta,
-                    nYStart, nYDelta));
+                    nYStart, nYDelta);
 
                 RasterConversionLineEntry3D& rEntry = maLineEntries[maLineEntries.size() - 1];
 
@@ -300,10 +300,10 @@ namespace basegfx
                 // guarantee one pixel per line, add a minimum of one for X.
                 const double fDistanceX(fabs(rEntry.getX().getInc()) >= 1.0 ? rEntry.getX().getInc() : 1.0);
 
-                maLineEntries.push_back(RasterConversionLineEntry3D(
+                maLineEntries.emplace_back(
                     rEntry.getX().getVal() + fDistanceX, rEntry.getX().getInc(),
                     rEntry.getZ().getVal() + rEntry.getZ().getInc(), rEntry.getZ().getInc(),
-                    nYStart, nYDelta));
+                    nYStart, nYDelta);
             }
         }
 
diff --git a/basegfx/source/tools/unotools.cxx b/basegfx/source/tools/unotools.cxx
index 6b5b47ca9459..7e3309e09c79 100644
--- a/basegfx/source/tools/unotools.cxx
+++ b/basegfx/source/tools/unotools.cxx
@@ -200,12 +200,12 @@ namespace unotools
                     if(aBezier.isBezier())
                     {
                         // if one is used, add always two control points due to the old schema
-                        aPoints.push_back( awt::Point(fround(aBezier.getControlPointA().getX()),
-                                                      fround(aBezier.getControlPointA().getY())) );
+                        aPoints.emplace_back(fround(aBezier.getControlPointA().getX()),
+                                             fround(aBezier.getControlPointA().getY()) );
                         aFlags.push_back(drawing::PolygonFlags_CONTROL);
 
-                        aPoints.push_back( awt::Point(fround(aBezier.getControlPointB().getX()),
-                                                      fround(aBezier.getControlPointB().getY())) );
+                        aPoints.emplace_back(fround(aBezier.getControlPointB().getX()),
+                                             fround(aBezier.getControlPointB().getY()) );
                         aFlags.push_back(drawing::PolygonFlags_CONTROL);
                     }
 
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 823e2a04fd63..2342510bbd54 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -629,7 +629,7 @@ void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName )
     // pErrInf is only destroyed if the error os processed by an
     // ErrorHandler
     StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, DialogMask::ButtonsOk );
-    aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM));
+    aErrors.emplace_back(*pErrInf, BasicErrorReason::OPENMGRSTREAM);
 
     // Create a stdlib otherwise we crash!
     BasicLibInfo* pStdLibInfo = CreateLibInfo();
@@ -769,7 +769,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
     if (!ImplLoadBasic( *xManagerStream, mpImpl->aLibs.front()->GetLibRef() ))
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, DialogMask::ButtonsOk );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM));
+        aErrors.emplace_back(*pErrInf, BasicErrorReason::OPENMGRSTREAM);
         // and it proceeds ...
     }
     xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator
@@ -817,7 +817,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
             else
             {
                 StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, DialogMask::ButtonsOk );
-                aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STORAGENOTFOUND));
+                aErrors.emplace_back(*pErrInf, BasicErrorReason::STORAGENOTFOUND);
             }
         }
     }
@@ -900,7 +900,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
     if ( !xBasicStorage.is() || xBasicStorage->GetError() )
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), DialogMask::ButtonsOk );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE));
+        aErrors.emplace_back(*pErrInf, BasicErrorReason::OPENLIBSTORAGE);
     }
     else
     {
@@ -909,7 +909,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
         if ( !xBasicStream.is() || xBasicStream->GetError() )
         {
             StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), DialogMask::ButtonsOk );
-            aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTREAM));
+            aErrors.emplace_back(*pErrInf, BasicErrorReason::OPENLIBSTREAM);
         }
         else
         {
@@ -932,7 +932,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
             if ( !bLoaded )
             {
                 StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), DialogMask::ButtonsOk );
-                aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::BASICLOADERROR));
+                aErrors.emplace_back(*pErrInf, BasicErrorReason::BASICLOADERROR);
             }
             else
             {
@@ -1116,7 +1116,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
     if( !nLib || nLib  < mpImpl->aLibs.size() )
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), DialogMask::ButtonsOk );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STDLIB));
+        aErrors.emplace_back(*pErrInf, BasicErrorReason::STDLIB);
         return false;
     }
 
@@ -1152,7 +1152,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
             if ( !xBasicStorage.is() || xBasicStorage->GetError() )
             {
                 StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), DialogMask::ButtonsOk );
-                aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE));
+                aErrors.emplace_back(*pErrInf, BasicErrorReason::OPENLIBSTORAGE);
             }
             else if (xBasicStorage->IsStream((*itLibInfo)->GetLibName()))
             {
@@ -1287,7 +1287,7 @@ bool BasicManager::LoadLib( sal_uInt16 nLib )
     else
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), DialogMask::ButtonsOk );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND));
+        aErrors.emplace_back(*pErrInf, BasicErrorReason::LIBNOTFOUND);
     }
     return bDone;
 }
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 810eaaaf2e56..1614c12bda53 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1064,7 +1064,7 @@ SbModule* StarBASIC::MakeModule( const OUString& rName, const ModuleInfo& mInfo,
     }
     p->SetSource32( rSrc );
     p->SetParent( this );
-    pModules.push_back(p);
+    pModules.emplace_back(p);
     SetModified( true );
     return p;
 }
@@ -1073,7 +1073,7 @@ void StarBASIC::Insert( SbxVariable* pVar )
 {
     if( dynamic_cast<const SbModule*>(pVar) != nullptr)
     {
-        pModules.push_back(static_cast<SbModule*>(pVar));
+        pModules.emplace_back(static_cast<SbModule*>(pVar));
         pVar->SetParent( this );
         StartListening( pVar->GetBroadcaster(), true );
     }
@@ -1862,7 +1862,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
         else
         {
             pMod->SetParent( this );
-            pModules.push_back( pMod );
+            pModules.emplace_back(pMod );
         }
     }
     // HACK for SFX-Bullshit!
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 1edf4bb1c527..83a06ff0d370 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -458,7 +458,7 @@ static sal_uInt32 lcl_registerNativeObjectWrapper( SbxObject* pNativeObj )
 {
     NativeObjectWrapperVector &rNativeObjectWrapperVector = GaNativeObjectWrapperVector::get();
     sal_uInt32 nIndex = rNativeObjectWrapperVector.size();
-    rNativeObjectWrapperVector.push_back( ObjectItem( pNativeObj ) );
+    rNativeObjectWrapperVector.emplace_back( pNativeObj );
     return nIndex;
 }
 
@@ -4452,7 +4452,7 @@ void registerComponentToBeDisposedForBasic
     ( const Reference< XComponent >& xComponent, StarBASIC* pBasic )
 {
     StarBasicDisposeItem* pItem = lcl_getOrCreateItemForBasic( pBasic );
-    pItem->m_vComImplementsObjects.push_back( xComponent );
+    pItem->m_vComImplementsObjects.emplace_back(xComponent );
 }
 
 void registerComListenerVariableForBasic( SbxVariable* pVar, StarBASIC* pBasic )
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 032e4d85128b..40e282d70868 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -3977,7 +3977,7 @@ void SbiRuntime::StepELEM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
     // #74254 now per list
     if( pObj )
     {
-        aRefSaved.push_back( pObj );
+        aRefSaved.emplace_back(pObj );
     }
     PushVar( FindElement( pObj, nOp1, nOp2, ERRCODE_BASIC_NO_METHOD, false ) );
 }
@@ -4057,7 +4057,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
     else if( t != SbxVARIANT && (SbxDataType)(p->GetType() & 0x0FFF ) != t )
     {
         SbxVariable* q = new SbxVariable( t );
-        aRefSaved.push_back( q );
+        aRefSaved.emplace_back(q );
         *q = *p;
         p = q;
         if ( i )
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index 191ca4dc087f..9a02085b3182 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -622,10 +622,9 @@ void Bridge::sendRequestChangeRequest() {
     assert(mode_ == MODE_REQUESTED);
     random_ = random();
     std::vector< BinaryAny > a;
-    a.push_back(
-        BinaryAny(
+    a.emplace_back(
             css::uno::TypeDescription(cppu::UnoType< sal_Int32 >::get()),
-            &random_));
+            &random_);
     sendProtPropRequest(OutgoingRequest::KIND_REQUEST_CHANGE, a);
 }
 
@@ -865,10 +864,9 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
     css::uno::TypeDescription ifc(cppu::UnoType<css::uno::XInterface>::get());
     typelib_TypeDescription * p = ifc.get();
     std::vector< BinaryAny > inArgs;
-    inArgs.push_back(
-        BinaryAny(
+    inArgs.emplace_back(
             css::uno::TypeDescription(cppu::UnoType< css::uno::Type >::get()),
-            &p));
+            &p);
     BinaryAny ret;
     std::vector< BinaryAny> outArgs;
     bool bExc = makeCall(
diff --git a/binaryurp/source/bridgefactory.cxx b/binaryurp/source/bridgefactory.cxx
index 3a4a99fd091e..fdf80873ac2b 100644
--- a/binaryurp/source/bridgefactory.cxx
+++ b/binaryurp/source/bridgefactory.cxx
@@ -126,8 +126,7 @@ css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge(
         }
         b.set(new Bridge(this, sName, aConnection, anInstanceProvider));
         if (sName.isEmpty()) {
-            unnamed_.push_back(
-                css::uno::Reference< css::bridge::XBridge >(b.get()));
+            unnamed_.emplace_back(b.get());
         } else {
             named_[sName] = b.get();
         }
diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx
index 96307bb23770..9043b22daadf 100644
--- a/binaryurp/source/incomingrequest.cxx
+++ b/binaryurp/source/incomingrequest.cxx
@@ -212,11 +212,10 @@ bool IncomingRequest::execute_throw(
                                 css::uno::TypeDescription(
                                     mtd->pParams[j].pTypeRef));
                         } else {
-                            outBufs.push_back(
-                                std::vector< char >(size_t_round(
+                            outBufs.emplace_back(size_t_round(
                                     css::uno::TypeDescription(
                                         mtd->pParams[j].pTypeRef).
-                                    get()->nSize)));
+                                    get()->nSize));
                             p = &outBufs.back()[0];
                         }
                         args.push_back(p);
diff --git a/binaryurp/source/proxy.cxx b/binaryurp/source/proxy.cxx
index 699037f915dd..d7c7ba410631 100644
--- a/binaryurp/source/proxy.cxx
+++ b/binaryurp/source/proxy.cxx
@@ -136,14 +136,13 @@ void Proxy::do_dispatch_throw(
     case typelib_TypeClass_INTERFACE_ATTRIBUTE:
         bSetter = returnValue == nullptr;
         if (bSetter) {
-            inArgs.push_back(
-                BinaryAny(
+            inArgs.emplace_back(
                     css::uno::TypeDescription(
                         reinterpret_cast<
                             typelib_InterfaceAttributeTypeDescription const * >(
                                 member)->
                         pAttributeTypeRef),
-                    arguments[0]));
+                    arguments[0]);
         }
         break;
     case typelib_TypeClass_INTERFACE_METHOD:
@@ -153,10 +152,9 @@ void Proxy::do_dispatch_throw(
                     typelib_InterfaceMethodTypeDescription const * >(member);
             for (sal_Int32 i = 0; i != mtd->nParams; ++i) {
                 if (mtd->pParams[i].bIn) {
-                    inArgs.push_back(
-                        BinaryAny(
+                    inArgs.emplace_back(
                             css::uno::TypeDescription(mtd->pParams[i].pTypeRef),
-                            arguments[i]));
+                            arguments[i]);
                 }
             }
             break;
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
index e38495d0498c..ba79ee096d55 100644
--- a/binaryurp/source/writer.cxx
+++ b/binaryurp/source/writer.cxx
@@ -108,7 +108,7 @@ void Writer::queueRequest(
 {
     css::uno::UnoInterfaceReference cc(current_context::get());
     osl::MutexGuard g(mutex_);
-    queue_.push_back(Item(tid, oid, type, member, inArguments, cc));
+    queue_.emplace_back(tid, oid, type, member, inArguments, cc);
     items_.set();
 }
 
@@ -119,10 +119,9 @@ void Writer::queueReply(
     std::vector< BinaryAny > const & outArguments, bool setCurrentContextMode)
 {
     osl::MutexGuard g(mutex_);
-    queue_.push_back(
-        Item(
+    queue_.emplace_back(
             tid, member, setter, exception, returnValue, outArguments,
-            setCurrentContextMode));
+            setCurrentContextMode);
     items_.set();
 }
 


More information about the Libreoffice-commits mailing list