summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/refcounting.cxx153
-rw-r--r--compilerplugins/clang/test/refcounting.cxx27
-rw-r--r--drawinglayer/inc/wmfemfhelper.hxx9
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx30
-rw-r--r--drawinglayer/source/tools/wmfemfhelper.cxx72
-rw-r--r--include/oox/shape/ShapeFilterBase.hxx3
-rw-r--r--io/source/acceptor/acc_pipe.cxx5
-rw-r--r--io/source/acceptor/acc_socket.cxx5
-rw-r--r--io/source/connector/connector.cxx9
-rw-r--r--oox/source/shape/ShapeContextHandler.hxx4
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx4
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx20
-rw-r--r--sc/source/ui/unoobj/PivotTableDataSequence.cxx5
-rw-r--r--sc/source/ui/unoobj/TablePivotCharts.cxx4
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx4
-rw-r--r--sfx2/source/appl/shutdownicon.cxx12
-rw-r--r--sfx2/source/appl/shutdownicon.hxx3
-rw-r--r--svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx15
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx46
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx4
-rw-r--r--svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx24
-rw-r--r--svx/source/xml/xmlgrhlp.cxx8
-rw-r--r--ucb/source/ucp/tdoc/tdoc_stgelems.hxx1
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx8
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx5
25 files changed, 265 insertions, 215 deletions
diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx
index ae8a2b217bb5..df5805542fce 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -6,7 +6,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef LO_CLANG_SHARED_PLUGINS
#include <string>
#include <iostream>
@@ -56,6 +55,7 @@ public:
bool VisitFieldDecl(const FieldDecl *);
bool VisitVarDecl(const VarDecl *);
bool VisitFunctionDecl(const FunctionDecl *);
+ bool VisitTypeLoc(clang::TypeLoc typeLoc);
// Creation of temporaries with one argument are represented by
// CXXFunctionalCastExpr, while any other number of arguments are
@@ -217,8 +217,32 @@ bool containsOWeakObjectSubclass(const clang::Type* pType0) {
if (pRecordDecl) {
// because dbaccess just has to be special...
loplugin::DeclCheck dc(pRecordDecl);
- if ((dc.Class("DocumentEvents").Namespace("dbaccess")
- .GlobalNamespace()))
+ if (dc.Class("DocumentEvents").Namespace("dbaccess")
+ .GlobalNamespace() ||
+ dc.Class("OBookmarkContainer").Namespace("dbaccess")
+ .GlobalNamespace())
+ return false;
+ // TODO not sure about these ones, just avoiding dbaccess in general for now
+ if (dc.Class("SbaXPropertiesChangeMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXSubmitMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXResetMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXPropertyChangeMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXSQLErrorMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXParameterMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXRowSetApproveMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXRowSetMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXLoadMultiplexer").Namespace("dbaui").GlobalNamespace() ||
+ dc.Class("SbaXVetoableChangeMultiplexer").Namespace("dbaui").GlobalNamespace())
+ return false;
+ // slideshow playing games here
+ if (dc.Class("SlideView").AnonymousNamespace().Namespace("internal").Namespace("slideshow").GlobalNamespace())
+ return false;
+ // svx playing acquire/release games here in OWeakSubObject
+ if (dc.Class("FmXUpdateMultiplexer").GlobalNamespace() ||
+ dc.Class("FmXContainerMultiplexer").GlobalNamespace() ||
+ dc.Class("FmXSelectionMultiplexer").GlobalNamespace() ||
+ dc.Class("FmXGridControlMultiplexer").GlobalNamespace() ||
+ dc.Class("FmXModifyMultiplexer").GlobalNamespace())
return false;
}
if (pType->isPointerType()) {
@@ -405,6 +429,66 @@ bool RefCounting::visitTemporaryObjectExpr(Expr const * expr) {
return true;
}
+// check for dodgy code managing ref-counted stuff with shared_ptr or unique_ptr or similar stuff
+bool RefCounting::VisitTypeLoc(clang::TypeLoc typeLoc)
+{
+ QualType firstTemplateParamType;
+ if (auto recordType = typeLoc.getType()->getUnqualifiedDesugaredType()->getAs<RecordType>()) {
+ auto const tc = loplugin::TypeCheck(recordType);
+ if (tc.ClassOrStruct("unique_ptr").StdNamespace()
+ || tc.ClassOrStruct("weak_ptr").StdNamespace()
+ || tc.ClassOrStruct("shared_ptr").StdNamespace()
+ || tc.ClassOrStruct("intrusive_ptr").Namespace("boost").GlobalNamespace())
+ {
+ auto templateDecl = dyn_cast<ClassTemplateSpecializationDecl>(recordType->getDecl());
+ if (templateDecl && templateDecl->getTemplateArgs().size() > 0)
+ firstTemplateParamType = templateDecl->getTemplateArgs()[0].getAsType();
+ }
+ }
+ if (firstTemplateParamType.isNull())
+ return true;
+ if (containsSvRefBaseSubclass(firstTemplateParamType.getTypePtr()))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ "SvRefBase subclass %0 being managed via smart pointer, should be managed via tools::SvRef",
+ typeLoc.getBeginLoc())
+ << firstTemplateParamType
+ << typeLoc.getSourceRange();
+ }
+ if (containsSalhelperReferenceObjectSubclass(firstTemplateParamType.getTypePtr()))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ "salhelper::SimpleReferenceObject subclass %0 being managed via smart pointer, should be managed via rtl::Reference",
+ typeLoc.getBeginLoc())
+ << firstTemplateParamType
+ << typeLoc.getSourceRange();
+ }
+// Not in general (dbaccess::DocumentEvents, dbaccess/source/core/dataaccess/databasedocument.hxx):
+#if 0
+ if (containsXInterfaceSubclass(firstTemplateParamType))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ "XInterface subclass %0 being managed via smart pointer, should be managed via uno::Reference",
+ typeLoc.getBeginLoc())
+ << firstTemplateParamType
+ << typeLoc.getSourceRange();
+ }
+#endif
+ if (containsOWeakObjectSubclass(firstTemplateParamType.getTypePtr()))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ "cppu::OWeakObject subclass %0 being managed via smart pointer, should be managed via rtl::Reference",
+ typeLoc.getBeginLoc())
+ << firstTemplateParamType
+ << typeLoc.getSourceRange();
+ }
+ return true;
+}
+
bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
if (ignoreLocation(fieldDecl)) {
return true;
@@ -420,20 +504,6 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
return true;
}
- // check for dodgy code managing ref-counted stuff with shared_ptr or unique_ptr or similar stuff
- QualType firstTemplateParamType;
- if (auto recordType = fieldDecl->getType()->getUnqualifiedDesugaredType()->getAs<RecordType>()) {
- auto const tc = loplugin::TypeCheck(fieldDecl->getType());
- if (tc.ClassOrStruct("unique_ptr").StdNamespace()
- || tc.ClassOrStruct("shared_ptr").StdNamespace()
- || tc.ClassOrStruct("intrusive_ptr").Namespace("boost").GlobalNamespace())
- {
- auto templateDecl = dyn_cast<ClassTemplateSpecializationDecl>(recordType->getDecl());
- if (templateDecl && templateDecl->getTemplateArgs().size() > 0)
- firstTemplateParamType = templateDecl->getTemplateArgs()[0].getAsType();
- }
- }
-
if (containsSvRefBaseSubclass(fieldDecl->getType().getTypePtr())) {
report(
DiagnosticsEngine::Warning,
@@ -445,18 +515,6 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
<< fieldDecl->getSourceRange();
}
- if (!firstTemplateParamType.isNull() && containsSvRefBaseSubclass(firstTemplateParamType.getTypePtr()))
- {
- report(
- DiagnosticsEngine::Warning,
- "SvRefBase subclass %0 being managed via smart pointer, should be managed via tools::SvRef, "
- "parent is %1",
- fieldDecl->getLocation())
- << firstTemplateParamType
- << fieldDecl->getParent()
- << fieldDecl->getSourceRange();
- }
-
if (containsSalhelperReferenceObjectSubclass(fieldDecl->getType().getTypePtr())) {
report(
DiagnosticsEngine::Warning,
@@ -468,21 +526,10 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
<< fieldDecl->getSourceRange();
}
- if (!firstTemplateParamType.isNull() && containsSalhelperReferenceObjectSubclass(firstTemplateParamType.getTypePtr()))
- {
- report(
- DiagnosticsEngine::Warning,
- "salhelper::SimpleReferenceObject subclass %0 being managed via smart pointer, should be managed via rtl::Reference, "
- "parent is %1",
- fieldDecl->getLocation())
- << firstTemplateParamType
- << fieldDecl->getParent()
- << fieldDecl->getSourceRange();
- }
-
auto const dc = loplugin::DeclCheck(fieldDecl->getParent());
if ( (dc.Class("BaseReference").Namespace("uno").Namespace("star")
.Namespace("sun").Namespace("com").GlobalNamespace())
+ || (dc.Class("Reference").Namespace("rtl").GlobalNamespace())
|| (dc.Union("element_alias").Namespace("detail").Namespace("cppu")
.GlobalNamespace())
// this is playing some kind of game to avoid circular references
@@ -503,29 +550,13 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
<< fieldDecl->getSourceRange();
}
-// Not in general (dbaccess::DocumentEvents, dbaccess/source/core/dataaccess/databasedocument.hxx):
-#if 0
- if (!firstTemplateParamType.isNull() && containsXInterfaceSubclass(firstTemplateParamType))
- {
- report(
- DiagnosticsEngine::Warning,
- "XInterface subclass %0 being managed via smart pointer, should be managed via uno::Reference, "
- "parent is %1",
- fieldDecl->getLocation())
- << firstTemplateParamType
- << fieldDecl->getParent()
- << fieldDecl->getSourceRange();
- }
-#endif
-
- if (!firstTemplateParamType.isNull() && containsOWeakObjectSubclass(firstTemplateParamType.getTypePtr()))
- {
+ if (containsOWeakObjectSubclass(fieldDecl->getType())) {
report(
DiagnosticsEngine::Warning,
- "cppu::OWeakObject subclass %0 being managed via smart pointer, should be managed via rtl::Reference, "
+ "cppu::OWeakObject subclass %0 being directly heap managed, should be managed via rtl::Reference, "
"parent is %1",
fieldDecl->getLocation())
- << firstTemplateParamType
+ << fieldDecl->getType()
<< fieldDecl->getParent()
<< fieldDecl->getSourceRange();
}
@@ -606,6 +637,4 @@ loplugin::Plugin::Registration< RefCounting > refcounting("refcounting");
}
-#endif // LO_CLANG_SHARED_PLUGINS
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/compilerplugins/clang/test/refcounting.cxx b/compilerplugins/clang/test/refcounting.cxx
index 911d0461dd41..7e42094407fb 100644
--- a/compilerplugins/clang/test/refcounting.cxx
+++ b/compilerplugins/clang/test/refcounting.cxx
@@ -25,15 +25,30 @@ struct UnoObject : public cppu::OWeakObject
{
};
+//
+// Note, getting duplicate warnings for some reason I cannot fathom
+//
+
struct Foo
{
- std::unique_ptr<UnoObject>
- m_foo1; // expected-error {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference, parent is 'Foo' [loplugin:refcounting]}}
- std::shared_ptr<UnoObject>
- m_foo2; // expected-error {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference, parent is 'Foo' [loplugin:refcounting]}}
- boost::intrusive_ptr<UnoObject>
- m_foo3; // expected-error {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference, parent is 'Foo' [loplugin:refcounting]}}
+ // expected-error@+2 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+ // expected-error@+1 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+ std::unique_ptr<UnoObject> m_foo1;
+ // expected-error@+2 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+ // expected-error@+1 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+ std::shared_ptr<UnoObject> m_foo2;
+ // expected-error@+2 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+ // expected-error@+1 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+ boost::intrusive_ptr<UnoObject> m_foo3;
rtl::Reference<UnoObject> m_foo4; // no warning expected
};
+// expected-error@+2 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+// expected-error@+1 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+std::unique_ptr<UnoObject> foo1();
+rtl::Reference<UnoObject> foo2(); // no warning expected
+// expected-error@+2 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+// expected-error@+1 {{cppu::OWeakObject subclass 'UnoObject' being managed via smart pointer, should be managed via rtl::Reference [loplugin:refcounting]}}
+void foo3(std::unique_ptr<UnoObject> p);
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/drawinglayer/inc/wmfemfhelper.hxx b/drawinglayer/inc/wmfemfhelper.hxx
index 7b643bf5e36c..6c58dac68f7e 100644
--- a/drawinglayer/inc/wmfemfhelper.hxx
+++ b/drawinglayer/inc/wmfemfhelper.hxx
@@ -22,6 +22,7 @@
#include <sal/config.h>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <vcl/font.hxx>
+#include <rtl/ref.hxx>
#include <vcl/outdevstate.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -43,13 +44,17 @@ namespace wmfemfhelper
class TargetHolder
{
private:
- std::vector< std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> > aTargets;
+ std::vector< rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> > aTargets;
public:
TargetHolder();
~TargetHolder();
sal_uInt32 size() const;
- void append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> pCandidate);
+ void append(const rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> & pCandidate)
+ {
+ append(pCandidate.get());
+ }
+ void append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate);
drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequence(const PropertyHolder& rPropertyHolder);
};
}
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index d55babc0e960..e92e3e58ef27 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -572,7 +572,7 @@ namespace emfplushelper
if (!pen->GetColor().IsTransparent())
{
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D(
polygon,
lineAttribute,
aStrokeAttribute));
@@ -586,7 +586,7 @@ namespace emfplushelper
aStrokeAttribute));
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::UnifiedTransparencePrimitive2D>(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
drawinglayer::primitive2d::Primitive2DContainer { aPrimitive },
(255 - pen->GetColor().GetAlpha()) / 255.0));
}
@@ -622,14 +622,14 @@ namespace emfplushelper
if (pen->customStartCap->mbIsFilled)
{
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
startCapPolygon,
pen->GetColor().getBColor()));
}
else
{
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D(
startCapPolygon,
lineAttribute,
aStrokeAttribute));
@@ -667,14 +667,14 @@ namespace emfplushelper
if (pen->customEndCap->mbIsFilled)
{
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
endCapPolygon,
pen->GetColor().getBColor()));
}
else
{
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D(
endCapPolygon,
lineAttribute,
aStrokeAttribute));
@@ -695,7 +695,7 @@ namespace emfplushelper
{
// not transparent
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
polygon,
color.getBColor()));
}
@@ -707,7 +707,7 @@ namespace emfplushelper
color.getBColor()));
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::UnifiedTransparencePrimitive2D>(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
drawinglayer::primitive2d::Primitive2DContainer { aPrimitive },
(255 - color.GetAlpha()) / 255.0));
}
@@ -787,7 +787,7 @@ namespace emfplushelper
// temporal solution: create a solid colored polygon
// TODO create a 'real' hatching primitive
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
polygon,
fillColor.getBColor()));
}
@@ -918,7 +918,7 @@ namespace emfplushelper
// create the same one used for SVG
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::SvgLinearGradientPrimitive2D>(
+ new drawinglayer::primitive2d::SvgLinearGradientPrimitive2D(
aTextureTransformation,
polygon,
aVector,
@@ -934,7 +934,7 @@ namespace emfplushelper
// create the same one used for SVG
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::SvgRadialGradientPrimitive2D>(
+ new drawinglayer::primitive2d::SvgRadialGradientPrimitive2D(
aTextureTransformation,
polygon,
aVector,
@@ -1501,7 +1501,7 @@ namespace emfplushelper
if (aSize.Width() > 0 && aSize.Height() > 0)
{
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::BitmapPrimitive2D>(
+ new drawinglayer::primitive2d::BitmapPrimitive2D(
VCLUnoHelper::CreateVCLXBitmap(aBmp),
aTransformMatrix));
}
@@ -1516,7 +1516,7 @@ namespace emfplushelper
GDIMetaFile aGDI(image.graphic.GetGDIMetaFile());
aGDI.Clip(aSource);
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::MetafilePrimitive2D>(aTransformMatrix, aGDI));
+ new drawinglayer::primitive2d::MetafilePrimitive2D(aTransformMatrix, aGDI));
}
}
else
@@ -1674,7 +1674,7 @@ namespace emfplushelper
}
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
maMapTransform,
drawinglayer::primitive2d::Primitive2DContainer { aPrimitiveText } ));
}
@@ -2158,7 +2158,7 @@ namespace emfplushelper
(255 - color.GetAlpha()) / 255.0);
}
mrTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
maMapTransform,
drawinglayer::primitive2d::Primitive2DContainer { aPrimitiveText } ));
}
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index a5f0278b0c64..00ec09c9ab00 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -330,11 +330,11 @@ namespace wmfemfhelper
return aTargets.size();
}
- void TargetHolder::append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> pCandidate)
+ void TargetHolder::append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate)
{
if (pCandidate)
{
- aTargets.push_back(std::move(pCandidate));
+ aTargets.push_back(pCandidate);
}
}
@@ -345,7 +345,7 @@ namespace wmfemfhelper
for (sal_uInt32 a(0); a < nCount; a++)
{
- xRetval[a] = aTargets[a].release();
+ xRetval[a] = aTargets[a].get();
}
// Since we have released them from the list
aTargets.clear();
@@ -454,7 +454,7 @@ namespace wmfemfhelper
if(rProperties.getTransformation().isIdentity())
{
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::PointArrayPrimitive2D>(
+ new drawinglayer::primitive2d::PointArrayPrimitive2D(
rPositions,
rBColor));
}
@@ -468,7 +468,7 @@ namespace wmfemfhelper
}
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::PointArrayPrimitive2D>(
+ new drawinglayer::primitive2d::PointArrayPrimitive2D(
aPositions,
rBColor));
}
@@ -485,7 +485,7 @@ namespace wmfemfhelper
basegfx::B2DPolygon aLinePolygon(rLinePolygon);
aLinePolygon.transform(rProperties.getTransformation());
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::PolygonHairlinePrimitive2D>(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
aLinePolygon,
rProperties.getLineColor()));
}
@@ -502,7 +502,7 @@ namespace wmfemfhelper
basegfx::B2DPolyPolygon aFillPolyPolygon(rFillPolyPolygon);
aFillPolyPolygon.transform(rProperties.getTransformation());
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
aFillPolyPolygon,
rProperties.getFillColor()));
}
@@ -556,7 +556,7 @@ namespace wmfemfhelper
fAccumulated);
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::PolygonStrokePrimitive2D>(
+ new drawinglayer::primitive2d::PolygonStrokePrimitive2D(
aLinePolygon,
aLineAttribute,
aStrokeAttribute));
@@ -564,7 +564,7 @@ namespace wmfemfhelper
else
{
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::PolygonStrokePrimitive2D>(
+ new drawinglayer::primitive2d::PolygonStrokePrimitive2D(
aLinePolygon,
aLineAttribute));
}
@@ -630,7 +630,7 @@ namespace wmfemfhelper
aPoint = rProperties.getTransformation() * aPoint;
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::DiscreteBitmapPrimitive2D>(
+ new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D(
rBitmapEx,
aPoint));
}
@@ -657,7 +657,7 @@ namespace wmfemfhelper
aObjectTransform = rProperties.getTransformation() * aObjectTransform;
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::BitmapPrimitive2D>(
+ new drawinglayer::primitive2d::BitmapPrimitive2D(
VCLUnoHelper::CreateVCLXBitmap(rBitmapEx),
aObjectTransform));
}
@@ -853,7 +853,7 @@ namespace wmfemfhelper
if(!aSubContent.empty())
{
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::GroupPrimitive2D>(
+ new drawinglayer::primitive2d::GroupPrimitive2D(
aSubContent));
}
}
@@ -900,7 +900,7 @@ namespace wmfemfhelper
{
// force content to black
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::ModifiedColorPrimitive2D>(
+ new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
aSubContent,
std::make_shared<basegfx::BColorModifier_replace>(
basegfx::BColor(0.0, 0.0, 0.0))));
@@ -909,7 +909,7 @@ namespace wmfemfhelper
{
// invert content
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::InvertPrimitive2D>(
+ new drawinglayer::primitive2d::InvertPrimitive2D(
aSubContent));
}
}
@@ -929,7 +929,7 @@ namespace wmfemfhelper
/** helper to create needed data to emulate the VCL Wallpaper Metafile action.
It is a quite mighty action. This helper is for simple color filled background.
*/
- static std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateColorWallpaper(
+ static rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> CreateColorWallpaper(
const basegfx::B2DRange& rRange,
const basegfx::BColor& rColor,
PropertyHolder const & rPropertyHolder)
@@ -937,7 +937,7 @@ namespace wmfemfhelper
basegfx::B2DPolygon aOutline(basegfx::utils::createPolygonFromRect(rRange));
aOutline.transform(rPropertyHolder.getTransformation());
- return std::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
+ return new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
basegfx::B2DPolyPolygon(aOutline),
rColor);
}
@@ -945,7 +945,7 @@ namespace wmfemfhelper
/** helper to create needed data to emulate the VCL Wallpaper Metafile action.
It is a quite mighty action. This helper is for gradient filled background.
*/
- static std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateGradientWallpaper(
+ static rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> CreateGradientWallpaper(
const basegfx::B2DRange& rRange,
const Gradient& rGradient,
PropertyHolder const & rPropertyHolder)
@@ -960,19 +960,19 @@ namespace wmfemfhelper
else
{
// really a gradient
- std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> pRetval(
+ rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> pRetval(
new drawinglayer::primitive2d::FillGradientPrimitive2D(
rRange,
aAttribute));
if(!rPropertyHolder.getTransformation().isIdentity())
{
- const drawinglayer::primitive2d::Primitive2DReference xPrim(pRetval.release());
+ const drawinglayer::primitive2d::Primitive2DReference xPrim(pRetval.get());
const drawinglayer::primitive2d::Primitive2DContainer xSeq { xPrim };
- pRetval.reset(new drawinglayer::primitive2d::TransformPrimitive2D(
+ pRetval = new drawinglayer::primitive2d::TransformPrimitive2D(
rPropertyHolder.getTransformation(),
- xSeq));
+ xSeq);
}
return pRetval;
@@ -1032,7 +1032,7 @@ namespace wmfemfhelper
if(rProperty.getTransformation().isIdentity())
{
// add directly
- rTarget.append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D>(pBitmapWallpaperFill));
+ rTarget.append(pBitmapWallpaperFill);
}
else
{
@@ -1040,7 +1040,7 @@ namespace wmfemfhelper
const drawinglayer::primitive2d::Primitive2DReference xPrim(pBitmapWallpaperFill);
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
rProperty.getTransformation(),
drawinglayer::primitive2d::Primitive2DContainer { xPrim }));
}
@@ -1289,7 +1289,7 @@ namespace wmfemfhelper
// add created text primitive to target
if(rProperty.getTransformation().isIdentity())
{
- rTarget.append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D>(pResult));
+ rTarget.append(pResult);
}
else
{
@@ -1297,7 +1297,7 @@ namespace wmfemfhelper
const drawinglayer::primitive2d::Primitive2DReference aReference(pResult);
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
rProperty.getTransformation(),
drawinglayer::primitive2d::Primitive2DContainer { aReference }));
}
@@ -1413,7 +1413,7 @@ namespace wmfemfhelper
{
for(drawinglayer::primitive2d::BasePrimitive2D* a : aTargetVector)
{
- rTarget.append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D>(a));
+ rTarget.append(a);
}
}
else
@@ -1427,7 +1427,7 @@ namespace wmfemfhelper
}
rTarget.append(
- std::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
rProperty.getTransformation(),
xTargets));
}
@@ -1977,7 +1977,7 @@ namespace wmfemfhelper
{
// add with transformation
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::TransformPrimitive2D>(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
rPropertyHolders.Current().getTransformation(),
xSubContent));
}
@@ -2165,7 +2165,7 @@ namespace wmfemfhelper
// when a MetaGradientAction is executed
aOutline.transform(rPropertyHolders.Current().getTransformation());
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::MaskPrimitive2D>(
+ new drawinglayer::primitive2d::MaskPrimitive2D(
aOutline,
xGradient));
}
@@ -2195,7 +2195,7 @@ namespace wmfemfhelper
aAttribute));
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::MaskPrimitive2D>(
+ new drawinglayer::primitive2d::MaskPrimitive2D(
aOutline,
drawinglayer::primitive2d::Primitive2DContainer { aFillHatch }));
}
@@ -2707,7 +2707,7 @@ namespace wmfemfhelper
if(!aSubContent.empty())
{
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::UnifiedTransparencePrimitive2D>(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aSubContent,
nTransparence * 0.01));
}
@@ -2741,7 +2741,7 @@ namespace wmfemfhelper
// embed using EpsPrimitive
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::EpsPrimitive2D>(
+ new drawinglayer::primitive2d::EpsPrimitive2D(
aObjectTransform,
pA->GetLink(),
pA->GetSubstitute()));
@@ -2861,7 +2861,7 @@ namespace wmfemfhelper
{
// not really a gradient; create UnifiedTransparencePrimitive2D
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::UnifiedTransparencePrimitive2D>(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
xSubContent,
aAttribute.getStartColor().luminance()));
}
@@ -2879,7 +2879,7 @@ namespace wmfemfhelper
// create transparence primitive
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::TransparencePrimitive2D>(
+ new drawinglayer::primitive2d::TransparencePrimitive2D(
xSubContent,
drawinglayer::primitive2d::Primitive2DContainer { xTransparence }));
}
@@ -2981,7 +2981,7 @@ namespace wmfemfhelper
{
// not really a gradient
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonColorPrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
aPolyPolygon,
aAttribute.getStartColor()));
}
@@ -2989,7 +2989,7 @@ namespace wmfemfhelper
{
// really a gradient
rTargetHolders.Current().append(
- std::make_unique<drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D>(
+ new drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D(
aPolyPolygon,
aAttribute));
}
diff --git a/include/oox/shape/ShapeFilterBase.hxx b/include/oox/shape/ShapeFilterBase.hxx
index bfd5cea6d16e..5ae3b20c711d 100644
--- a/include/oox/shape/ShapeFilterBase.hxx
+++ b/include/oox/shape/ShapeFilterBase.hxx
@@ -26,6 +26,7 @@
#include <oox/core/xmlfilterbase.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
#include <com/sun/star/graphic/XGraphicMapper.hpp>
+#include <rtl/ref.hxx>
namespace oox::drawingml::table {
@@ -39,7 +40,7 @@ namespace oox::shape {
class OOX_DLLPUBLIC ShapeFilterBase final : public core::XmlFilterBase
{
public:
- typedef std::shared_ptr<ShapeFilterBase> Pointer_t;
+ typedef rtl::Reference<ShapeFilterBase> Pointer_t;
/// @throws css::uno::RuntimeException
explicit ShapeFilterBase(
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx
index 69f1cad79206..0718834e3115 100644
--- a/io/source/acceptor/acc_pipe.cxx
+++ b/io/source/acceptor/acc_pipe.cxx
@@ -26,6 +26,7 @@
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <cppuhelper/implbase.hxx>
+#include <rtl/ref.hxx>
using namespace ::osl;
using namespace ::cppu;
@@ -151,7 +152,7 @@ namespace io_acceptor
OUString error = "io.acceptor: pipe already closed" + m_sPipeName;
throw ConnectionSetupException( error );
}
- std::unique_ptr<PipeConnection> pConn(new PipeConnection( m_sConnectionDescription ));
+ rtl::Reference<PipeConnection> pConn(new PipeConnection( m_sConnectionDescription ));
oslPipeError status = pipe.accept( pConn->m_pipe );
@@ -162,7 +163,7 @@ namespace io_acceptor
}
else if( osl_Pipe_E_None == status )
{
- return Reference < XConnection > ( static_cast<XConnection *>(pConn.release()) );
+ return pConn.get();
}
else
{
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 9700cd566bb8..57c8a179885b 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -23,6 +23,7 @@
#include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/connection/XConnection.hpp>
#include <com/sun/star/connection/XConnectionBroadcaster.hpp>
#include <com/sun/star/connection/ConnectionSetupException.hpp>
@@ -316,7 +317,7 @@ namespace io_acceptor {
Reference< XConnection > SocketAcceptor::accept( )
{
- std::unique_ptr<SocketConnection> pConn(new SocketConnection( m_sConnectionDescription ));
+ rtl::Reference<SocketConnection> pConn(new SocketConnection( m_sConnectionDescription ));
if( m_socket.acceptConnection( pConn->m_socket )!= osl_Socket_Ok )
{
@@ -342,7 +343,7 @@ namespace io_acceptor {
sizeof( nTcpNoDelay ) , osl_Socket_LevelTcp );
}
- return Reference < XConnection > ( static_cast<XConnection *>(pConn.release()) );
+ return pConn.get();
}
void SocketAcceptor::stopAccepting()
diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx
index c6f01e130814..6072afb9dbff 100644
--- a/io/source/connector/connector.cxx
+++ b/io/source/connector/connector.cxx
@@ -24,6 +24,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/unourl.hxx>
#include <rtl/malformeduriexception.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/connection/ConnectionSetupException.hpp>
@@ -80,11 +81,11 @@ Reference< XConnection > SAL_CALL OConnector::connect( const OUString& sConnecti
{
OUString aName(aDesc.getParameter("name"));
- std::unique_ptr<stoc_connector::PipeConnection> pConn(new stoc_connector::PipeConnection( sConnectionDescription ));
+ rtl::Reference<stoc_connector::PipeConnection> pConn(new stoc_connector::PipeConnection( sConnectionDescription ));
if( pConn->m_pipe.create( aName.pData, osl_Pipe_OPEN, osl::Security() ) )
{
- r.set( static_cast<XConnection *>(pConn.release()) );
+ r.set( pConn.get() );
}
else
{
@@ -108,7 +109,7 @@ Reference< XConnection > SAL_CALL OConnector::connect( const OUString& sConnecti
bool bTcpNoDelay
= aDesc.getParameter("tcpnodelay").toInt32() != 0;
- std::unique_ptr<stoc_connector::SocketConnection> pConn(new stoc_connector::SocketConnection( sConnectionDescription));
+ rtl::Reference<stoc_connector::SocketConnection> pConn(new stoc_connector::SocketConnection( sConnectionDescription));
SocketAddr AddrTarget( aHost.pData, nPort );
if(pConn->m_socket.connect(AddrTarget) != osl_Socket_Ok)
@@ -127,7 +128,7 @@ Reference< XConnection > SAL_CALL OConnector::connect( const OUString& sConnecti
sizeof( nTcpNoDelay ) , osl_Socket_LevelTcp );
}
pConn->completeConnectionString();
- r.set( static_cast<XConnection *>(pConn.release()) );
+ r.set( pConn.get() );
}
else
{
diff --git a/oox/source/shape/ShapeContextHandler.hxx b/oox/source/shape/ShapeContextHandler.hxx
index a633fac2f028..a4878c4ee257 100644
--- a/oox/source/shape/ShapeContextHandler.hxx
+++ b/oox/source/shape/ShapeContextHandler.hxx
@@ -34,7 +34,7 @@ namespace oox::shape {
class ShapeFragmentHandler : public core::FragmentHandler2
{
public:
- typedef std::shared_ptr<ShapeFragmentHandler> Pointer_t;
+ typedef rtl::Reference<ShapeFragmentHandler> Pointer_t;
explicit ShapeFragmentHandler(core::XmlFilterBase& rFilter,
const OUString& rFragmentPath )
@@ -131,7 +131,7 @@ private:
drawingml::ShapePtr mpShape;
std::shared_ptr< vml::Drawing > mpDrawing;
- typedef std::shared_ptr<drawingml::GraphicShapeContext>
+ typedef rtl::Reference<drawingml::GraphicShapeContext>
GraphicShapeContextPtr;
css::uno::Reference<XFastContextHandler> mxDrawingFragmentHandler;
css::uno::Reference<XFastContextHandler> mxGraphicShapeContext;
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 9aee4d0ecec6..1502539ddae1 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -129,9 +129,9 @@ void lcl_ChartInit(const uno::Reference <embed::XEmbeddedObject>& xObj, ScViewDa
uno::Reference<chart2::data::XDataProvider> xDataProvider;
if (bRangeIsPivotTable)
{
- std::unique_ptr<sc::PivotTableDataProvider> pPivotTableDataProvider(new sc::PivotTableDataProvider(rScDoc));
+ rtl::Reference<sc::PivotTableDataProvider> pPivotTableDataProvider(new sc::PivotTableDataProvider(rScDoc));
pPivotTableDataProvider->setPivotTableName(aRangeString);
- xDataProvider.set(pPivotTableDataProvider.release());
+ xDataProvider.set(pPivotTableDataProvider.get());
}
else
{
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 4a459f06437e..1e244f07c37a 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -253,11 +253,10 @@ PivotTableDataProvider::createCategoriesDataSource(bool bOrientationIsColumn)
for (std::vector<ValueAndFormat> const & rCategories : rCategoriesVector)
{
uno::Reference<chart2::data::XLabeledDataSequence> xResult = newLabeledDataSequence();
- std::unique_ptr<PivotTableDataSequence> pSequence;
- pSequence.reset(new PivotTableDataSequence(m_pDocument,
+ rtl::Reference<PivotTableDataSequence> pSequence(new PivotTableDataSequence(m_pDocument,
lcl_identifierForCategories(), rCategories));
pSequence->setRole("categories");
- xResult->setValues(uno::Reference<chart2::data::XDataSequence>(pSequence.release()));
+ xResult->setValues(uno::Reference<chart2::data::XDataSequence>(pSequence.get()));
aLabeledSequences.push_back(xResult);
}
@@ -585,10 +584,9 @@ PivotTableDataProvider::assignValuesToDataSequence(size_t nIndex)
OUString sDataID = lcl_identifierForData(nIndex);
std::vector<ValueAndFormat> const & rRowOfData = m_aDataRowVector[nIndex];
- std::unique_ptr<PivotTableDataSequence> pSequence;
- pSequence.reset(new PivotTableDataSequence(m_pDocument, sDataID, rRowOfData));
+ rtl::Reference<PivotTableDataSequence> pSequence(new PivotTableDataSequence(m_pDocument, sDataID, rRowOfData));
pSequence->setRole("values-y");
- xDataSequence.set(pSequence.release());
+ xDataSequence.set(pSequence.get());
return xDataSequence;
}
@@ -624,11 +622,10 @@ PivotTableDataProvider::assignLabelsToDataSequence(size_t nIndex)
std::vector<ValueAndFormat> aLabelVector { ValueAndFormat(aLabel.makeStringAndClear()) };
- std::unique_ptr<PivotTableDataSequence> pSequence;
- pSequence.reset(new PivotTableDataSequence(m_pDocument,
+ rtl::Reference<PivotTableDataSequence> pSequence(new PivotTableDataSequence(m_pDocument,
sLabelID, aLabelVector));
pSequence->setRole("values-y");
- xDataSequence.set(pSequence.release());
+ xDataSequence.set(pSequence.get());
return xDataSequence;
}
@@ -642,11 +639,10 @@ css::uno::Reference<css::chart2::data::XDataSequence>
std::vector<ValueAndFormat> const & rCategories = m_aCategoriesColumnOrientation.back();
- std::unique_ptr<PivotTableDataSequence> pSequence;
- pSequence.reset(new PivotTableDataSequence(m_pDocument,
+ rtl::Reference<PivotTableDataSequence> pSequence(new PivotTableDataSequence(m_pDocument,
lcl_identifierForCategories(), rCategories));
pSequence->setRole("categories");
- xDataSequence.set(uno::Reference<chart2::data::XDataSequence>(pSequence.release()));
+ xDataSequence.set(uno::Reference<chart2::data::XDataSequence>(pSequence.get()));
return xDataSequence;
}
diff --git a/sc/source/ui/unoobj/PivotTableDataSequence.cxx b/sc/source/ui/unoobj/PivotTableDataSequence.cxx
index 1ec42754c889..1ac8d9339a47 100644
--- a/sc/source/ui/unoobj/PivotTableDataSequence.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataSequence.cxx
@@ -165,11 +165,10 @@ uno::Reference<util::XCloneable> SAL_CALL PivotTableDataSequence::createClone()
{
SolarMutexGuard aGuard;
- std::unique_ptr<PivotTableDataSequence> pClone;
- pClone.reset(new PivotTableDataSequence(m_pDocument, m_aID, m_aData));
+ rtl::Reference<PivotTableDataSequence> pClone(new PivotTableDataSequence(m_pDocument, m_aID, m_aData));
pClone->setRole(m_aRole);
- uno::Reference<util::XCloneable> xClone(pClone.release());
+ uno::Reference<util::XCloneable> xClone(pClone.get());
return xClone;
}
diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx
index 3356125df9fb..78d1918b3aba 100644
--- a/sc/source/ui/unoobj/TablePivotCharts.cxx
+++ b/sc/source/ui/unoobj/TablePivotCharts.cxx
@@ -125,10 +125,10 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName,
aAwtSize.Width = aSize.Width();
aAwtSize.Height = aSize.Height();
- std::unique_ptr<sc::PivotTableDataProvider> pPivotTableDataProvider(new sc::PivotTableDataProvider(rDoc));
+ rtl::Reference<sc::PivotTableDataProvider> pPivotTableDataProvider(new sc::PivotTableDataProvider(rDoc));
pPivotTableDataProvider->setPivotTableName(rDataPilotName);
- uno::Reference<chart2::data::XDataProvider> xDataProvider(pPivotTableDataProvider.release());
+ uno::Reference<chart2::data::XDataProvider> xDataProvider(pPivotTableDataProvider.get());
uno::Reference<chart2::data::XDataReceiver> xReceiver;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 5f22480879e3..e9eba14c9061 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5495,7 +5495,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
//! check if xObject is in the same document
- std::unique_ptr<ScFilterDescriptor> pNew(new ScFilterDescriptor(pDocSh)); //! instead from object?
+ rtl::Reference<ScFilterDescriptor> pNew(new ScFilterDescriptor(pDocSh)); //! instead from object?
ScQueryParam aParam = pNew->GetParam();
aParam.bHasHeader = true;
@@ -5524,7 +5524,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
}
pNew->SetParam( aParam );
- return pNew.release();
+ return pNew.get();
}
// XSubTotalSource
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 84d169cf708a..40febc9b422a 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -104,7 +104,7 @@ css::uno::Sequence<OUString> SAL_CALL ShutdownIcon::getSupportedServiceNames()
}
bool ShutdownIcon::bModalMode = false;
-ShutdownIcon* ShutdownIcon::pShutdownIcon = nullptr;
+rtl::Reference<ShutdownIcon> ShutdownIcon::pShutdownIcon;
extern "C" {
static void disabled_initSystray() { }
@@ -474,23 +474,23 @@ void ShutdownIcon::terminateDesktop()
ShutdownIcon* ShutdownIcon::getInstance()
{
OSL_ASSERT( pShutdownIcon );
- return pShutdownIcon;
+ return pShutdownIcon.get();
}
ShutdownIcon* ShutdownIcon::createInstance()
{
if (pShutdownIcon)
- return pShutdownIcon;
+ return pShutdownIcon.get();
try {
- std::unique_ptr<ShutdownIcon> pIcon(new ShutdownIcon( comphelper::getProcessComponentContext() ));
+ rtl::Reference<ShutdownIcon> pIcon(new ShutdownIcon( comphelper::getProcessComponentContext() ));
pIcon->init ();
- pShutdownIcon = pIcon.release();
+ pShutdownIcon = pIcon;
} catch (...) {
}
- return pShutdownIcon;
+ return pShutdownIcon.get();
}
void ShutdownIcon::init()
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx
index 6829330409de..32113cbc1ee2 100644
--- a/sfx2/source/appl/shutdownicon.hxx
+++ b/sfx2/source/appl/shutdownicon.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <rtl/ustring.hxx>
+#include <rtl/ref.hxx>
#include <osl/mutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <tools/link.hxx>
@@ -68,7 +69,7 @@ class ShutdownIcon : public ShutdownIconServiceBase
std::unique_ptr<sfx2::FileDialogHelper> m_pFileDlg;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
- static ShutdownIcon *pShutdownIcon; // one instance
+ static rtl::Reference<ShutdownIcon> pShutdownIcon; // one instance
bool m_bInitialized;
void initSystray();
diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
index c35e6b2daff7..8a9f25b9b243 100644
--- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -29,6 +29,7 @@
#include <sdr/attribute/sdrformtextattribute.hxx>
#include <tools/weakbase.h>
#include <svx/sdtaitm.hxx>
+#include <rtl/ref.hxx>
// predefines
@@ -93,7 +94,7 @@ namespace drawinglayer::primitive2d
virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
// transformed clone operator
- virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0;
+ virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0;
};
} // end of namespace drawinglayer::primitive2d
@@ -127,7 +128,7 @@ namespace drawinglayer::primitive2d
virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
// transformed clone operator
- virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
+ virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
// provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override;
@@ -164,7 +165,7 @@ namespace drawinglayer::primitive2d
virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
// transformed clone operator
- virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
+ virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
// provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override;
@@ -217,7 +218,7 @@ namespace drawinglayer::primitive2d
virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
// transformed clone operator
- virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
+ virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
// provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override;
@@ -253,7 +254,7 @@ namespace drawinglayer::primitive2d
virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
// transformed clone operator
- virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
+ virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
// provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override;
@@ -288,7 +289,7 @@ namespace drawinglayer::primitive2d
virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
// transformed clone operator
- virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const override;
+ virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const override;
// provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override;
@@ -321,7 +322,7 @@ namespace drawinglayer::primitive2d
virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
// transformed clone operator
- virtual std::unique_ptr<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
+ virtual rtl::Reference<SdrTextPrimitive2D> createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const override;
// provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override;
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index dd256654a8af..ad8814a974f0 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -198,7 +198,7 @@ namespace drawinglayer::primitive2d
bool bWordWrap)
{
basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
- std::unique_ptr<SdrTextPrimitive2D> pNew;
+ rtl::Reference<SdrTextPrimitive2D> pNew;
if(rText.isContour())
{
@@ -226,20 +226,20 @@ namespace drawinglayer::primitive2d
0.0 != aScale.getY() ? 1.0 / aScale.getY() : 1.0));
// create with unit polygon
- pNew.reset(new SdrContourTextPrimitive2D(
+ pNew = new SdrContourTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aScaledUnitPolyPolygon,
- rObjectTransform));
+ rObjectTransform);
}
else
{
// create with unit polygon
- pNew.reset(new SdrContourTextPrimitive2D(
+ pNew = new SdrContourTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
rUnitPolyPolygon,
- rObjectTransform));
+ rObjectTransform);
}
}
else if(!rText.getSdrFormTextAttribute().isDefault())
@@ -247,11 +247,11 @@ namespace drawinglayer::primitive2d
// text on path, use scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
- pNew.reset(new SdrPathTextPrimitive2D(
+ pNew = new SdrPathTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aScaledPolyPolygon,
- rText.getSdrFormTextAttribute()));
+ rText.getSdrFormTextAttribute());
}
else
{
@@ -325,32 +325,32 @@ namespace drawinglayer::primitive2d
if(rText.isFitToSize())
{
// stretched text in range
- pNew.reset(new SdrStretchTextPrimitive2D(
+ pNew = new SdrStretchTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aAnchorTransform,
- rText.isFixedCellHeight()));
+ rText.isFixedCellHeight());
}
else if(rText.isAutoFit())
{
// isotropically scaled text in range
- pNew.reset(new SdrAutoFitTextPrimitive2D(
+ pNew = new SdrAutoFitTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aAnchorTransform,
- bWordWrap));
+ bWordWrap);
}
else if( rText.isChainable() && !rText.isInEditMode() )
{
- pNew.reset(new SdrChainedTextPrimitive2D(
+ pNew = new SdrChainedTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
- aAnchorTransform ));
+ aAnchorTransform );
}
else // text in range
{
// build new primitive
- pNew.reset(new SdrBlockTextPrimitive2D(
+ pNew = new SdrBlockTextPrimitive2D(
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aAnchorTransform,
@@ -359,7 +359,7 @@ namespace drawinglayer::primitive2d
rText.isFixedCellHeight(),
rText.isScroll(),
bCellText,
- bWordWrap));
+ bWordWrap);
}
}
@@ -374,7 +374,7 @@ namespace drawinglayer::primitive2d
if(0.0 != aAnimationList.getDuration())
{
// create content sequence
- const Primitive2DReference xRefA(pNew.release());
+ const Primitive2DReference xRefA(pNew.get());
const Primitive2DContainer aContent { xRefA };
// create and add animated switch primitive
@@ -383,7 +383,7 @@ namespace drawinglayer::primitive2d
else
{
// add to decomposition
- return Primitive2DReference(pNew.release());
+ return Primitive2DReference(pNew.get());
}
}
@@ -408,9 +408,9 @@ namespace drawinglayer::primitive2d
aISRT.invert();
// bring the primitive back to scaled only and get scaled range, create new clone for this
- std::unique_ptr<SdrTextPrimitive2D> pNew2 = pNew->createTransformedClone(aISRT);
+ rtl::Reference<SdrTextPrimitive2D> pNew2 = pNew->createTransformedClone(aISRT);
OSL_ENSURE(pNew2, "createTextPrimitive: Could not create transformed clone of text primitive (!)");
- pNew = std::move(pNew2);
+ pNew = pNew2.get();
// create neutral geometry::ViewInformation2D for local range and decompose calls. This is okay
// since the decompose is view-independent
@@ -464,7 +464,7 @@ namespace drawinglayer::primitive2d
// pNew to aNewPrimitiveSequence)
Primitive2DContainer aAnimSequence;
pNew->get2DDecomposition(aAnimSequence, aViewInformation2D);
- pNew.reset();
+ pNew.clear();
// create a new animatedInterpolatePrimitive and add it
std::vector< basegfx::B2DHomMatrix > aMatrixStack;
@@ -482,7 +482,7 @@ namespace drawinglayer::primitive2d
else
{
// add to decomposition
- return Primitive2DReference(pNew.release());
+ return Primitive2DReference(pNew.get());
}
}
}
@@ -492,7 +492,7 @@ namespace drawinglayer::primitive2d
// #i97628#
// encapsulate with TextHierarchyEditPrimitive2D to allow renderers
// to suppress actively edited content if needed
- const Primitive2DReference xRefA(pNew.release());
+ const Primitive2DReference xRefA(pNew.get());
const Primitive2DContainer aContent { xRefA };
// create and add TextHierarchyEditPrimitive2D primitive
@@ -501,7 +501,7 @@ namespace drawinglayer::primitive2d
else
{
// add to decomposition
- return Primitive2DReference(pNew.release());
+ return pNew.get();
}
}
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 0b037e5fa74b..aa9ca030fe41 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -413,12 +413,12 @@ namespace drawinglayer::primitive2d
aChange *= aObjectMatrix;
// apply to existing text primitive
- std::unique_ptr<SdrTextPrimitive2D> pNewBlockText = xBlockText->createTransformedClone(aChange);
+ rtl::Reference<SdrTextPrimitive2D> pNewBlockText = xBlockText->createTransformedClone(aChange);
OSL_ENSURE(pNewBlockText, "SdrMeasurePrimitive2D::create2DDecomposition: Could not create transformed clone of text primitive (!)");
xBlockText.clear();
// add to local primitives
- aRetval.push_back(Primitive2DReference(pNewBlockText.release()));
+ aRetval.push_back(pNewBlockText.get());
}
// add shadow
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index 75744d7cad81..59a1551d9ca8 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -271,9 +271,9 @@ namespace drawinglayer::primitive2d
return false;
}
- std::unique_ptr<SdrTextPrimitive2D> SdrContourTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
+ rtl::Reference<SdrTextPrimitive2D> SdrContourTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- return std::make_unique<SdrContourTextPrimitive2D>(
+ return new SdrContourTextPrimitive2D(
getSdrText(),
getOutlinerParaObject(),
getUnitPolyPolygon(),
@@ -317,12 +317,12 @@ namespace drawinglayer::primitive2d
return false;
}
- std::unique_ptr<SdrTextPrimitive2D> SdrPathTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
+ rtl::Reference<SdrTextPrimitive2D> SdrPathTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
basegfx::B2DPolyPolygon aNewPolyPolygon(getPathPolyPolygon());
aNewPolyPolygon.transform(rTransform);
- return std::make_unique<SdrPathTextPrimitive2D>(
+ return new SdrPathTextPrimitive2D(
getSdrText(),
getOutlinerParaObject(),
aNewPolyPolygon,
@@ -381,9 +381,9 @@ namespace drawinglayer::primitive2d
return false;
}
- std::unique_ptr<SdrTextPrimitive2D> SdrBlockTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
+ rtl::Reference<SdrTextPrimitive2D> SdrBlockTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- return std::make_unique<SdrBlockTextPrimitive2D>(
+ return new SdrBlockTextPrimitive2D(
getSdrText(),
getOutlinerParaObject(),
rTransform * getTextRangeTransform(),
@@ -432,9 +432,9 @@ namespace drawinglayer::primitive2d
return false;
}
- std::unique_ptr<SdrTextPrimitive2D> SdrAutoFitTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const
+ rtl::Reference<SdrTextPrimitive2D> SdrAutoFitTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const
{
- return std::make_unique<SdrAutoFitTextPrimitive2D>(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getWordWrap());
+ return new SdrAutoFitTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getWordWrap());
}
// provide unique ID
@@ -471,9 +471,9 @@ namespace drawinglayer::primitive2d
return false;
}
- std::unique_ptr<SdrTextPrimitive2D> SdrChainedTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
+ rtl::Reference<SdrTextPrimitive2D> SdrChainedTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- return std::make_unique<SdrChainedTextPrimitive2D>(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform());
+ return new SdrChainedTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform());
}
// provide unique ID
@@ -512,9 +512,9 @@ namespace drawinglayer::primitive2d
return false;
}
- std::unique_ptr<SdrTextPrimitive2D> SdrStretchTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
+ rtl::Reference<SdrTextPrimitive2D> SdrStretchTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- return std::make_unique<SdrStretchTextPrimitive2D>(
+ return new SdrStretchTextPrimitive2D(
getSdrText(),
getOutlinerParaObject(),
rTransform * getTextRangeTransform(),
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index cefa978ff29b..42e8eb4a12e0 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -840,12 +840,12 @@ uno::Reference<io::XInputStream> SAL_CALL SvXMLGraphicHelper::createInputStream(
if (SvXMLGraphicHelperMode::Write == meCreateMode)
{
OUString sMimeType = comphelper::GraphicMimeTypeHelper::GetMimeTypeForExtension(OUStringToOString(maOutputMimeType, RTL_TEXTENCODING_ASCII_US));
- std::unique_ptr<GraphicInputStream> pInputStream(new GraphicInputStream(aGraphicObject, sMimeType));
+ rtl::Reference<GraphicInputStream> pInputStream(new GraphicInputStream(aGraphicObject, sMimeType));
// We release the pointer from unique_ptr and assign it to the input stream return type.
// In case the stream doesn't exists, unique_ptr will delete the pointer when we go out of scope.
if (pInputStream->exists())
- xInputStream = pInputStream.release();
+ xInputStream = pInputStream.get();
}
return xInputStream;
@@ -864,11 +864,11 @@ Reference< XOutputStream > SAL_CALL SvXMLGraphicHelper::createOutputStream()
if( SvXMLGraphicHelperMode::Read == meCreateMode )
{
- std::unique_ptr<SvXMLGraphicOutputStream> pOutputStream(new SvXMLGraphicOutputStream);
+ rtl::Reference<SvXMLGraphicOutputStream> pOutputStream(new SvXMLGraphicOutputStream);
if( pOutputStream->Exists() )
{
- xRet = pOutputStream.release();
+ xRet = pOutputStream.get();
maGrfStms.push_back( xRet );
}
}
diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
index acad1b4438e2..4002e30663ee 100644
--- a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
+++ b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
@@ -179,7 +179,6 @@ private:
StorageElementFactory::StorageMap::iterator m_aContainerIt;
friend class StorageElementFactory;
- friend class std::unique_ptr< Storage >;
};
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 583de4123e88..1f1a2868c477 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -24,6 +24,7 @@
#include <rtl/character.hxx>
#include <rtl/uri.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/i18n/Collator.hpp>
@@ -802,15 +803,14 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar,
Sequence< Any > aArguments( 2 );
- std::unique_ptr<XInputStream_impl> p(new XInputStream_impl( zipFile ));
+ rtl::Reference<XInputStream_impl> p(new XInputStream_impl( zipFile ));
if( p->CtorSuccess() )
{
- Reference< XInputStream > xInputStream( p.release() );
- aArguments[ 0 ] <<= xInputStream;
+ aArguments[ 0 ] <<= Reference< XInputStream >( p.get() );
}
else
{
- p.reset();
+ p.clear();
aArguments[ 0 ] <<= zipFile;
}
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index bb1a12bc8243..a4f6d8f89aec 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -25,6 +25,7 @@
#include <cppuhelper/queryinterface.hxx>
#include <comphelper/processfactory.hxx>
#include <rtl/uri.hxx>
+#include <rtl/ref.hxx>
#include <rtl/character.hxx>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
@@ -332,7 +333,7 @@ void URLParameter::open( const Reference< XOutputStream >& xDataSink )
return;
// a standard document or else an active help text, plug in the new input stream
- std::unique_ptr<InputStreamTransformer> p(new InputStreamTransformer( this,m_pDatabases,isRoot() ));
+ rtl::Reference<InputStreamTransformer> p(new InputStreamTransformer( this,m_pDatabases,isRoot() ));
try
{
xDataSink->writeBytes( Sequence< sal_Int8 >( reinterpret_cast<const sal_Int8*>(p->getData().getStr()), p->getData().getLength() ) );
@@ -340,7 +341,7 @@ void URLParameter::open( const Reference< XOutputStream >& xDataSink )
catch( const Exception& )
{
}
- p.reset();
+ p.clear();
xDataSink->closeOutput();
}