summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-21 18:26:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-22 14:45:06 +0200
commitd9f2486bee13cc1710ef66bf5e64e30f2f702772 (patch)
tree7d122249c91107ee678c220eff018afef85774de
parent840b1714d3f00a60b81676bddf201355e3c47afb (diff)
no need to use unique_ptr for Polygon
it is already a COW type Change-Id: I74ffb129aa63cd9c56794997d72e32002f8b45fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120822 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--filter/source/msfilter/msdffimp.cxx4
-rw-r--r--include/filter/msfilter/msdffimp.hxx7
-rw-r--r--sw/source/filter/ww8/ww8par.cxx2
3 files changed, 6 insertions, 7 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index e24b342f6f3e..dade5bcd999e 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5525,7 +5525,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
bool bOk = nElemSizeVert && (rSt.remainingSize() / nElemSizeVert >= nNumElemVert);
if (bOk)
{
- pTextImpRec->pWrapPolygon.reset(new tools::Polygon(nNumElemVert));
+ pTextImpRec->pWrapPolygon = tools::Polygon(nNumElemVert);
for (sal_uInt16 i = 0; i < nNumElemVert; ++i)
{
sal_Int32 nX(0), nY(0);
@@ -7501,7 +7501,7 @@ SvxMSDffImportRec::SvxMSDffImportRec(const SvxMSDffImportRec& rCopy)
pClientDataBuffer = nullptr;
if (rCopy.pWrapPolygon)
- pWrapPolygon.reset( new tools::Polygon(*rCopy.pWrapPolygon) );
+ pWrapPolygon = rCopy.pWrapPolygon;
}
SvxMSDffImportRec::~SvxMSDffImportRec()
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index d3c6657c7b90..e1437faf6c90 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -23,6 +23,7 @@
#include <cstring>
#include <map>
#include <memory>
+#include <optional>
#include <set>
#include <utility>
#include <vector>
@@ -44,6 +45,7 @@
#include <tools/gen.hxx>
#include <tools/ref.hxx>
#include <tools/solar.h>
+#include <tools/poly.hxx>
#include <vcl/graph.hxx>
class Color;
@@ -52,9 +54,6 @@ class SotStorage;
class SvStream;
class SdrObject;
class SdrOle2Obj;
-namespace tools {
- class Polygon;
-}
class SdrModel;
class SwFlyFrameFormat;
@@ -218,7 +217,7 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
static const int RELTO_DEFAULT = 2;
SdrObject* pObj;
- std::unique_ptr<tools::Polygon>
+ std::optional<tools::Polygon>
pWrapPolygon;
std::unique_ptr<char[]>
pClientAnchorBuffer;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index a6559a681a8c..146de94a0230 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1031,7 +1031,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
}
if (bOk)
{
- pImpRec->pWrapPolygon.reset( new tools::Polygon(nNumElemVert) );
+ pImpRec->pWrapPolygon = tools::Polygon(nNumElemVert);
for (sal_uInt16 i = 0; i < nNumElemVert; ++i)
{
sal_Int32 nX(0), nY(0);