[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - include/svx svx/qa svx/source

2021-10-21 Thread Noel (via logerrit)
 include/svx/EnhancedCustomShape2d.hxx |   10 -
 svx/qa/unit/customshapes.cxx  |   12 +
 svx/source/customshapes/EnhancedCustomShape2d.cxx |  111 +++---
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx |4 
 4 files changed, 63 insertions(+), 74 deletions(-)

New commits:
commit 3dcd7d8e412e2f05a213695eeb3ea2a296e9da73
Author: Noel 
AuthorDate: Wed Feb 3 08:59:13 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:07:04 2021 +0200

use more unique_ptr in EnhancedCustomShape2d

and fix some leaks in the unit tests

Change-Id: I8d324a24de11b14b4820e3cdd7f078d5877489e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110288
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123954
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/include/svx/EnhancedCustomShape2d.hxx 
b/include/svx/EnhancedCustomShape2d.hxx
index 8976b2bdb106..a01e8411b9c7 100644
--- a/include/svx/EnhancedCustomShape2d.hxx
+++ b/include/svx/EnhancedCustomShape2d.hxx
@@ -22,6 +22,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -141,11 +143,11 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShape2d : public 
SfxItemSet
 SAL_DLLPRIVATE void CreateSubPath(
 sal_Int32& rSrcPt,
 sal_Int32& rSegmentInd,
-std::vector< std::pair< SdrPathObj*, double> >& rObjectList,
+std::vector< std::pair< SdrPathObjUniquePtr, double> >& 
rObjectList,
 bool bLineGeometryNeededOnly,
 bool bSortFilledObjectsToBack,
 sal_Int32 nIndex);
-SAL_DLLPRIVATE SdrObject* CreatePathObj( bool bLineGeometryNeededOnly 
);
+SAL_DLLPRIVATE SdrObjectUniquePtr CreatePathObj( bool 
bLineGeometryNeededOnly );
 SAL_DLLPRIVATE void ApplyShapeAttributes( const 
SdrCustomShapeGeometryItem& rItem );
 
 SAL_DLLPRIVATE void SetPathSize( sal_Int32 nIndex = 0 );
@@ -185,8 +187,8 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShape2d : public 
SfxItemSet
 SAL_DLLPRIVATE bool IsFlipHorz() const { return bFlipH; };
 SAL_DLLPRIVATE sal_Int32 GetRotateAngle() const { return nRotateAngle; 
};
 
-SdrObject*  CreateLineGeometry();
-SdrObject*  CreateObject( bool bLineGeometryNeededOnly );
+SdrObjectUniquePtr  CreateLineGeometry();
+SdrObjectUniquePtr  CreateObject( bool bLineGeometryNeededOnly );
 voidApplyGluePoints( SdrObject* pObj );
 tools::RectangleGetTextRect() const;
 const tools::Rectangle& GetLogicRect() const { return aLogicRect; }
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index db7808a16f2f..791588f1984d 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -383,7 +383,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf121845_two_commands_U)
 SdrObjCustomShape& rSdrObjCustomShape(
 static_cast(*GetSdrObjectFromXShape(xShape)));
 EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape);
-SdrPathObj* pPathObj = 
static_cast(aCustomShape2d.CreateLineGeometry());
+SdrPathObjUniquePtr pPathObj(
+
static_cast(aCustomShape2d.CreateLineGeometry().release()));
 CPPUNIT_ASSERT_MESSAGE("Could not convert to SdrPathObj", pPathObj);
 const basegfx::B2DPolyPolygon aPolyPolygon(pPathObj->GetPathPoly());
 CPPUNIT_ASSERT_EQUAL_MESSAGE("count polygons", static_cast(2),
@@ -811,7 +812,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf103474_commandT_CaseZeroHeight)
 SdrObjCustomShape& rSdrObjCustomShape(
 static_cast(*GetSdrObjectFromXShape(xShape)));
 EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape);
-SdrPathObj* pPathObj = 
static_cast(aCustomShape2d.CreateLineGeometry());
+SdrPathObjUniquePtr pPathObj(
+
static_cast(aCustomShape2d.CreateLineGeometry().release()));
 CPPUNIT_ASSERT_MESSAGE("Could not convert to SdrPathObj", pPathObj);
 const basegfx::B2DPolyPolygon aPolyPolygon(pPathObj->GetPathPoly());
 CPPUNIT_ASSERT_EQUAL_MESSAGE("count polygons", static_cast(1),
@@ -841,7 +843,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf103474_commandG_CaseZeroHeight)
 SdrObjCustomShape& rSdrObjCustomShape(
 static_cast(*GetSdrObjectFromXShape(xShape)));
 EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape);
-SdrPathObj* pPathObj = 
static_cast(aCustomShape2d.CreateLineGeometry());
+SdrPathObjUniquePtr pPathObj(
+
static_cast(aCustomShape2d.CreateLineGeometry().release()));
 CPPUNIT_ASSERT_MESSAGE("Could not convert to SdrPathObj", pPathObj);
 const basegfx::B2DPolyPolygon aPolyPolygon(pPathObj->GetPathPoly());
 CPPUNIT_ASSERT_EQUAL_MESSAGE("count polygons", static_cast(1),
@@ -871,7 +874,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 

[Libreoffice-commits] core.git: include/vcl vcl/qa vcl/source

2021-05-31 Thread Noel (via logerrit)
 include/vcl/vclreferencebase.hxx |8 ++--
 include/vcl/window.hxx   |3 ++-
 vcl/qa/cppunit/lifecycle.cxx |4 ++--
 vcl/source/app/vclevent.cxx  |5 ++---
 vcl/source/window/window.cxx |   33 ++---
 5 files changed, 26 insertions(+), 27 deletions(-)

New commits:
commit 9abedad72c73ad83b66f3f8d261efdc5ce889683
Author: Noel 
AuthorDate: Sun Mar 28 10:28:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon May 31 15:19:31 2021 +0200

Drop Window::IsDisposed

in favour of the isDisposed in the VclReferenceBase base class,
so we have one flag for this instead of two.

Change-Id: Ib3d6ba750f95f21996bab2838af4c56295a13f4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113249
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/vclreferencebase.hxx b/include/vcl/vclreferencebase.hxx
index b7dc2b9183a2..2ba39026a362 100644
--- a/include/vcl/vclreferencebase.hxx
+++ b/include/vcl/vclreferencebase.hxx
@@ -22,11 +22,14 @@
 #include 
 #include 
 
+class VclBuilder;
+
 class VCL_DLLPUBLIC VclReferenceBase
 {
 mutable oslInterlockedCount mnRefCnt;
 
 template friend class VclPtr;
+friend class ::VclBuilder; // needed by ::delete_by_window(vcl::Window 
*pWindow)
 
 public:
 void acquire() const
@@ -54,14 +57,15 @@ private:
 
 protected:
 VclReferenceBase();
-protected:
 virtual ~VclReferenceBase();
 
-protected:
+// This is only supposed to be called from disposeOnce
 virtual voiddispose();
 
 public:
+// This is normally supposed to be called from VclPtr::disposeAndClear
 voiddisposeOnce();
+
 boolisDisposed() const { return mbDisposed; }
 
 };
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 9d8c5ae954c5..1cdb347a486e 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -60,6 +60,7 @@ class VCLXWindow;
 class VclWindowEvent;
 class AllSettings;
 class InputContext;
+class VclEventListeners;
 enum class ImplPaintFlags;
 enum class VclEventId;
 enum class PointerStyle;
@@ -472,6 +473,7 @@ class VCL_DLLPUBLIC Window : public virtual VclReferenceBase
 friend class ::ImplBorderWindow;
 friend class ::PaintHelper;
 friend class ::LifecycleTest;
+friend class ::VclEventListeners;
 
 // TODO: improve missing functionality
 // only required because of SetFloatingMode()
@@ -796,7 +798,6 @@ public:
 boolIsMenuFloatingWindow() const;
 boolIsToolbarFloatingWindow() const;
 boolIsTopWindow() const;
-boolIsDisposed() const;
 SystemWindow*   GetSystemWindow() const;
 
 /// Can the widget derived from this Window do the double-buffering via 
RenderContext properly?
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index ee706178bad2..853cef3828e4 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -294,9 +294,9 @@ void LifecycleTest::testToolkit()
 // test UNO dispose
 css::uno::Reference xWinComponent = xWindow;
 CPPUNIT_ASSERT(xWinComponent.is());
-CPPUNIT_ASSERT(!pVclWin->getRef()->IsDisposed());
+CPPUNIT_ASSERT(!pVclWin->getRef()->isDisposed());
 xWinComponent->dispose();
-CPPUNIT_ASSERT(pVclWin->getRef()->IsDisposed());
+CPPUNIT_ASSERT(pVclWin->getRef()->isDisposed());
 
 // test UNO cleanup
 xWinComponent.clear();
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index 8d2142fa4821..af6ff02a15a8 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -35,9 +35,8 @@ void VclEventListeners::Call( VclSimpleEvent& rEvent ) const
 if (VclWindowEvent* pWindowEvent = dynamic_cast())
 {
 VclPtr xWin(pWindowEvent->GetWindow());
-// see tdf#142549 before changing IsDisposed() to isDisposed(), maybe 
!xWin->mpWindowImpl
-// or special case VclEventId::ObjectDying ?
-while ( aIter != aEnd && (!xWin || !xWin->IsDisposed()) )
+// checking mpWindowImpl to see if disposal is complete yet
+while ( aIter != aEnd && (!xWin || xWin->mpWindowImpl) )
 {
 Link  = *aIter;
 // check this hasn't been removed in some re-enterancy scenario 
fdo#47368
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fa3cb12133d5..5c9d7c431437 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -134,17 +134,12 @@ namespace
 }
 #endif
 
-bool Window::IsDisposed() const
-{
-return !mpWindowImpl;
-}
-
 void Window::dispose()
 {
 assert( mpWindowImpl );
 assert( !mpWindowImpl->mbInDispose ); // should only be called from 
disposeOnce()
 assert( (!mpWindowImpl->mpParent ||
-

[Libreoffice-commits] core.git: vcl/source

2021-04-07 Thread Noel (via logerrit)
 vcl/source/bitmap/bitmap.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f1a57c38681eda897e42ae0358556f4d55e45dad
Author: Noel 
AuthorDate: Tue Apr 6 13:38:11 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 7 21:24:17 2021 +0200

can short-circuit this conversion

Change-Id: I042bcd0ea9d64ab5d9cca301a04235a89b1e4fbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113662
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index 656e9bd15528..7bf272225d6c 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -945,6 +945,8 @@ bool Bitmap::Convert( BmpConversion eConversion )
 // avoid large chunk of obsolete and hopefully rarely used conversions.
 if (eConversion == BmpConversion::N8BitNoConversion)
 {
+if (mxSalBmp->GetBitCount() == 8 && HasGreyPalette8Bit())
+return true;
 std::shared_ptr 
xImpBmp(ImplGetSVData()->mpDefInst->CreateSalBitmap());
 // frequently used conversion for creating alpha masks
 if (xImpBmp->Create(*mxSalBmp) && xImpBmp->InterpretAs8Bit())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: canvas/source include/vcl vcl/headless vcl/qt5 vcl/quartz vcl/skia vcl/source vcl/unx vcl/win

2021-03-31 Thread Noel (via logerrit)
 canvas/source/directx/dx_vcltools.cxx   |6 ---
 include/vcl/BitmapReadAccess.hxx|8 
 include/vcl/Scanline.hxx|5 --
 vcl/headless/svpbmp.cxx |9 +
 vcl/qt5/Qt5Bitmap.cxx   |4 --
 vcl/quartz/salbmp.cxx   |3 -
 vcl/skia/salbmp.cxx |3 -
 vcl/source/bitmap/BitmapReadAccess.cxx  |   54 
 vcl/source/bitmap/BitmapWriteAccess.cxx |6 ---
 vcl/source/bitmap/bitmappaint.cxx   |   46 ---
 vcl/source/bitmap/bmpfast.cxx   |   14 
 vcl/source/bitmap/dibtools.cxx  |1 
 vcl/source/bitmap/salbmp.cxx|8 
 vcl/source/gdi/salmisc.cxx  |   24 --
 vcl/source/helper/canvasbitmap.cxx  |   14 
 vcl/unx/generic/gdi/salbmp.cxx  |   18 --
 vcl/win/gdi/salbmp.cxx  |1 
 17 files changed, 6 insertions(+), 218 deletions(-)

New commits:
commit 740757d17452e3b2f9bfa7897c05dedeca639e34
Author: Noel 
AuthorDate: Wed Mar 31 14:32:02 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 31 17:38:04 2021 +0200

remove internal 4bit scanline formats

since we have already removed the 4-bit internal bitmap formats.

Change-Id: Ie481aaa8e25642a47e30beb6f37e2d3beda304e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113412
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/canvas/source/directx/dx_vcltools.cxx 
b/canvas/source/directx/dx_vcltools.cxx
index 68a07ae79b4a..707d358e5869 100644
--- a/canvas/source/directx/dx_vcltools.cxx
+++ b/canvas/source/directx/dx_vcltools.cxx
@@ -176,7 +176,6 @@ namespace dxcanvas::tools
 // one of the following formats:
 
 //ScanlineFormat::N1BitMsbPal
-//ScanlineFormat::N4BitMsnPal
 //ScanlineFormat::N8BitPal
 //ScanlineFormat::N24BitTcBgr
 //ScanlineFormat::N32BitTcMask
@@ -240,7 +239,6 @@ namespace dxcanvas::tools
 // to hand-formulate the following
 // formats, too.
 case ScanlineFormat::N1BitMsbPal:
-case ScanlineFormat::N4BitMsnPal:
 case ScanlineFormat::N32BitTcMask:
 {
 Scanline pAScan = 
pAlphaReadAccess->GetScanline( y );
@@ -261,7 +259,6 @@ namespace dxcanvas::tools
 break;
 
 case ScanlineFormat::N1BitLsbPal:
-case ScanlineFormat::N4BitLsnPal:
 case ScanlineFormat::N24BitTcRgb:
 case ScanlineFormat::N32BitTcAbgr:
 case ScanlineFormat::N32BitTcArgb:
@@ -285,7 +282,6 @@ namespace dxcanvas::tools
 // one of the following formats:
 
 //ScanlineFormat::N1BitMsbPal
-//ScanlineFormat::N4BitMsnPal
 //ScanlineFormat::N8BitPal
 //ScanlineFormat::N24BitTcBgr
 //ScanlineFormat::N32BitTcMask
@@ -371,7 +367,6 @@ namespace dxcanvas::tools
 // to hand-formulate the following
 // formats, too.
 case ScanlineFormat::N1BitMsbPal:
-case ScanlineFormat::N4BitMsnPal:
 case ScanlineFormat::N32BitTcMask:
 {
 Scanline pMScan = 
pMaskReadAccess->GetScanline( y );
@@ -395,7 +390,6 @@ namespace dxcanvas::tools
 break;
 
 case ScanlineFormat::N1BitLsbPal:
-case ScanlineFormat::N4BitLsnPal:
 case ScanlineFormat::N24BitTcRgb:
 case ScanlineFormat::N32BitTcAbgr:
 case ScanlineFormat::N32BitTcArgb:
diff --git a/include/vcl/BitmapReadAccess.hxx b/include/vcl/BitmapReadAccess.hxx
index 845e9994aa6b..b68332e89294 100644
--- a/include/vcl/BitmapReadAccess.hxx
+++ b/include/vcl/BitmapReadAccess.hxx
@@ -119,10 +119,6 @@ public:
   const ColorMask& rMask);
 static BitmapColor GetPixelForN1BitLsbPal(ConstScanline pScanline, 
tools::Long nX,
   const ColorMask& rMask);
-static BitmapColor GetPixelForN4BitMsnPal(ConstScanline pScanline, 
tools::Long nX,
-  const ColorMask& rMask);
-static BitmapColor GetPixelForN4BitLsnPal(ConstScanline pScanline, 
tools::Long nX,
-  const ColorMask& rMask);
 static 

[Libreoffice-commits] core.git: include/vcl vcl/qa vcl/source

2021-03-31 Thread Noel (via logerrit)
 include/vcl/bitmap.hxx   |4 -
 include/vcl/bitmap/BitmapTypes.hxx   |4 -
 vcl/qa/cppunit/BitmapTest.cxx|   62 ---
 vcl/qa/cppunit/canvasbitmaptest.cxx  |1 
 vcl/qa/cppunit/svm/svmtest.cxx   |4 -
 vcl/source/bitmap/BitmapEmbossGreyFilter.cxx |2 
 vcl/source/bitmap/BitmapSobelGreyFilter.cxx  |2 
 vcl/source/bitmap/bitmap.cxx |   45 +++
 vcl/source/bitmap/bitmappaint.cxx|4 -
 vcl/source/gdi/pdfwriter_impl.cxx|5 --
 vcl/source/gdi/pdfwriter_impl2.cxx   |5 --
 vcl/source/helper/canvastools.cxx|1 
 12 files changed, 22 insertions(+), 117 deletions(-)

New commits:
commit a6c6f35ccc78e74cfa76397d649c1b6fc4baad29
Author: Noel 
AuthorDate: Mon Mar 29 14:23:16 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 31 09:22:27 2021 +0200

drop 4bpp image formats

on a path to simplifying our internal bitmap stuff, aiming to
support a smaller set of image formats, but support them
in an accelerated fashion.

Change-Id: I5f8bf3cd49abf16ce460771492cdd5f358cb34df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113313
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 1bfc484fee5b..eaec09ad7037 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -72,8 +72,6 @@ enum class BmpConversion
 {
 NNONE,
 N1BitThreshold,
-N4BitGreys,
-N4BitColors,
 N8BitGreys,
 N8BitColors,
 N24Bit,
@@ -526,7 +524,7 @@ public:
 const std::shared_ptr& ImplGetSalBitmap() const { return 
mxSalBmp; }
 SAL_DLLPRIVATE void ImplSetSalBitmap( const 
std::shared_ptr& xImpBmp );
 
-SAL_DLLPRIVATE bool ImplMakeGreyscales( sal_uInt16 nGreyscales );
+SAL_DLLPRIVATE bool ImplMakeGreyscales();
 
 public:
 
diff --git a/include/vcl/bitmap/BitmapTypes.hxx 
b/include/vcl/bitmap/BitmapTypes.hxx
index 866cf0b2950e..7ebf9fc8dafc 100644
--- a/include/vcl/bitmap/BitmapTypes.hxx
+++ b/include/vcl/bitmap/BitmapTypes.hxx
@@ -17,7 +17,6 @@ enum class PixelFormat
 {
 INVALID = 0,
 N1_BPP = 1,
-N4_BPP = 4,
 N8_BPP = 8,
 N24_BPP = 24,
 N32_BPP = 32
@@ -37,7 +36,8 @@ constexpr PixelFormat bitDepthToPixelFormat(sal_uInt16 
nBitDepth)
 case 1:
 return PixelFormat::N1_BPP;
 case 4:
-return PixelFormat::N4_BPP;
+assert(false);
+break;
 case 8:
 return PixelFormat::N8_BPP;
 case 24:
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 4a7cc5cc0477..655e76dc21fc 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -34,7 +34,6 @@ class BitmapTest : public CppUnit::TestFixture
 void testCreation();
 void testEmpty();
 void testMonochrome();
-void testN4Greyscale();
 void testN8Greyscale();
 void testConvert();
 void testCRC();
@@ -52,7 +51,6 @@ class BitmapTest : public CppUnit::TestFixture
 CPPUNIT_TEST(testEmpty);
 CPPUNIT_TEST(testMonochrome);
 CPPUNIT_TEST(testConvert);
-CPPUNIT_TEST(testN4Greyscale);
 CPPUNIT_TEST(testN8Greyscale);
 CPPUNIT_TEST(testCRC);
 CPPUNIT_TEST(testGreyPalette);
@@ -112,20 +110,6 @@ void BitmapTest::testCreation()
  aBmp.GetSizeBytes());
 }
 
-{
-Bitmap aBmp(Size(10, 10), vcl::PixelFormat::N4_BPP);
-Size aSize = aBmp.GetSizePixel();
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", 
static_cast(10), aSize.Width());
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", 
static_cast(10), aSize.Height());
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), 
aBmp.GetPrefSize());
-CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", 
static_cast(4),
- aBmp.GetBitCount());
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong color count", sal_Int64(16), 
aBmp.GetColorCount());
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", 
static_cast(50),
- aBmp.GetSizeBytes());
-}
-
 {
 Bitmap aBmp(Size(10, 10), vcl::PixelFormat::N8_BPP);
 Size aSize = aBmp.GetSizePixel();
@@ -260,48 +244,6 @@ void BitmapTest::testMonochrome()
  aBmpReadAccess.GetColor(3, 3));
 }
 
-void BitmapTest::testN4Greyscale()
-{
-Bitmap aBmp = createTestBitmap();
-BitmapPalette aGreyscalePalette = Bitmap::GetGreyPalette(16);
-
-aBmp.Convert(BmpConversion::N4BitGreys);
-BitmapReadAccess aBmpReadAccess(aBmp);
-
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Black pixel wrong 8-bit greyscale value", 
aGreyscalePalette[0],
- aBmpReadAccess.GetColor(0, 0));
-

[Libreoffice-commits] core.git: canvas/source cppcanvas/qa drawinglayer/source emfio/source filter/source forms/source framework/source include/vcl sd/source svtools/source svx/source sw/source vcl/os

2021-03-28 Thread Noel (via logerrit)
 canvas/source/cairo/cairo_canvashelper.cxx |2 
 canvas/source/directx/dx_vcltools.cxx  |2 
 canvas/source/vcl/impltools.cxx|2 
 cppcanvas/qa/unit/test.cxx |2 
 drawinglayer/source/texture/texture3d.cxx  |2 
 emfio/source/reader/wmfreader.cxx  |2 
 filter/source/graphicfilter/icgm/actimpr.cxx   |2 
 filter/source/graphicfilter/icgm/bitmap.cxx|2 
 filter/source/svg/svgwriter.cxx|4 -
 forms/source/component/imgprod.cxx |2 
 framework/source/fwe/classes/addonsoptions.cxx |   12 ++---
 include/vcl/alpha.hxx  |1 
 include/vcl/bitmap.hxx |   12 -
 include/vcl/bitmapex.hxx   |1 
 sd/source/ui/dlg/vectdlg.cxx   |2 
 sd/source/ui/docshell/docshel2.cxx |2 
 sd/source/ui/view/drviews8.cxx |2 
 svtools/source/table/gridtablerenderer.cxx |2 
 svx/source/dialog/_contdlg.cxx |2 
 svx/source/svdraw/svdfmtf.cxx  |2 
 svx/source/svdraw/svdpdf.cxx   |2 
 svx/source/svdraw/svdxcgv.cxx  |2 
 svx/source/tbxctrls/fontworkgallery.cxx|2 
 sw/source/uibase/uiview/view.cxx   |2 
 vcl/osx/salinst.cxx|2 
 vcl/source/animate/Animation.cxx   |2 
 vcl/source/bitmap/BitmapEx.cxx |   58 -
 vcl/source/bitmap/alpha.cxx|4 -
 vcl/source/bitmap/bitmappaint.cxx  |2 
 vcl/source/bitmap/dibtools.cxx |2 
 vcl/source/control/fixed.cxx   |2 
 vcl/source/control/roadmap.cxx |2 
 vcl/source/filter/egif/egif.cxx|2 
 vcl/source/filter/igif/gifread.cxx |2 
 vcl/source/filter/wmf/emfwr.cxx|8 +--
 vcl/source/filter/wmf/wmfwr.cxx|6 +-
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx|4 -
 vcl/source/gdi/graph.cxx   |2 
 vcl/source/gdi/impgraph.cxx|6 +-
 vcl/source/gdi/metaact.cxx |   18 +++
 vcl/source/gdi/pdfwriter_impl.cxx  |6 +-
 vcl/source/gdi/wall.cxx|2 
 vcl/source/image/ImplImage.cxx |2 
 vcl/source/outdev/bitmap.cxx   |6 +-
 vcl/source/outdev/text.cxx |2 
 vcl/source/outdev/transparent.cxx  |2 
 vcl/win/window/salframe.cxx|2 
 vcl/workben/fftester.cxx   |2 
 48 files changed, 100 insertions(+), 114 deletions(-)

New commits:
commit c7483d48df1b9ae70335346846d02a4fc53b4558
Author: Noel 
AuthorDate: Fri Mar 26 16:15:11 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Mar 28 10:26:06 2021 +0200

drop operator bool and operator! from Bitmap and BitmapEx

IRC chat:
 noelgrandin: doesn't adding operator bool to Bitmap
  has the same problem as Graphic and the reason why you dropped that
  commit 7334034ae93b49fc93b5859a3c047a319d138282
  "drop Graphic::operator bool"
 quikee[m], hmmm, good point
 maybe I should just drop both operator bool and
  operator! in favor of IsEmpty
 noelgrandin: I don't remember what the problem is I just
  remembered we dropped it Graphic :) sure, dropping everything for
  IsEmpty is probably the best

Change-Id: Ieae289cda64f0b8d8fdecd5ea9e6f2bb874ff4cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113163
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx 
b/canvas/source/cairo/cairo_canvashelper.cxx
index 7d4cdba478f4..9d9a8bdf9bb8 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -316,7 +316,7 @@ namespace cairocanvas
 uno::Reference xIntBmp(xBitmap,
   
uno::UNO_QUERY_THROW);
 ::BitmapEx aBmpEx = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
-if( !!aBmpEx )
+if( !aBmpEx.IsEmpty() )
 return aBmpEx;
 
 // TODO(F1): extract pixel from XBitmap interface
diff --git a/canvas/source/directx/dx_vcltools.cxx 
b/canvas/source/directx/dx_vcltools.cxx
index 323022b9caa2..68a07ae79b4a 100644
--- a/canvas/source/directx/dx_vcltools.cxx
+++ b/canvas/source/directx/dx_vcltools.cxx
@@ -440,7 +440,7 @@ namespace dxcanvas::tools
 return false;
 
 ::BitmapEx aBmpEx = vcl::unotools::bitmapExFromXBitmap( xIntBmp );
-if( !aBmpEx )
+if( aBmpEx.IsEmpty() )
 return false;
 
 return drawVCLBitmapEx( rGraphics, aBmpEx );
diff --git a/canvas/source/vcl/impltools.cxx 

[Libreoffice-commits] core.git: basic/source comphelper/source cui/source dbaccess/source emfio/source extensions/source framework/source lotuswordpro/source oox/source sc/source sdext/source sd/sourc

2021-03-26 Thread Noel (via logerrit)
 UnoControls/source/base/multiplexer.cxx   |   43 ++--
 basic/source/uno/namecont.cxx |   31 +--
 comphelper/source/property/propertysethelper.cxx  |   17 -
 cui/source/options/treeopt.cxx|   28 +-
 cui/source/tabpages/tpbitmap.cxx  |   24 +-
 dbaccess/source/ui/app/AppDetailPageHelper.cxx|   20 +-
 emfio/source/reader/mtftools.cxx  |  150 +++
 extensions/source/bibliography/general.cxx|   30 +--
 framework/source/uielement/resourcemenucontroller.cxx |   61 +++---
 lotuswordpro/source/filter/lwpfribsection.cxx |   22 +-
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx   |   18 -
 oox/source/export/chartexport.cxx |  176 +-
 sc/source/filter/oox/autofilterbuffer.cxx |   90 -
 sc/source/filter/oox/querytablebuffer.cxx |5 
 sc/source/ui/app/inputwin.cxx |   92 -
 sc/source/ui/cctrl/checklistmenu.cxx  |   21 +-
 sc/source/ui/dbgui/tpsubt.cxx |   22 +-
 sc/source/ui/drawfunc/drawsh2.cxx |  124 ++--
 sc/source/ui/drawfunc/futext.cxx  |   30 +--
 sd/source/ui/annotations/annotationtag.cxx|   60 +++---
 sd/source/ui/app/scalectrl.cxx|   40 ++--
 sd/source/ui/app/sdpopup.cxx  |   24 +-
 sdext/source/presenter/PresenterAccessibility.cxx |   21 +-
 sfx2/source/control/recentdocsview.cxx|   52 ++---
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx   |   64 +++---
 sfx2/source/doc/objserv.cxx   |   28 +-
 sfx2/source/sidebar/DeckLayouter.cxx  |   30 +--
 sfx2/source/sidebar/Sidebar.cxx   |   31 +--
 slideshow/source/engine/animationfactory.cxx  |   56 ++---
 starmath/source/mathml/mathmlimport.cxx   |   32 +--
 svtools/source/misc/sampletext.cxx|   12 -
 svx/source/items/numfmtsh.cxx |   26 +-
 svx/source/svdraw/svdobj.cxx  |   30 +--
 svx/source/svdraw/svdoole2.cxx|   40 ++--
 sw/source/core/access/AccessibilityCheck.cxx  |   29 +-
 sw/source/core/doc/textboxhelper.cxx  |   22 +-
 sw/source/core/docnode/ndsect.cxx |   26 +-
 sw/source/core/edit/ednumber.cxx  |   28 +-
 sw/source/core/layout/fly.cxx |   26 +-
 sw/source/core/layout/objectformattertxtfrm.cxx   |   22 +-
 sw/source/core/layout/pagechg.cxx |   26 +-
 sw/source/core/layout/sectfrm.cxx |   26 +-
 sw/source/core/layout/tabfrm.cxx  |   26 +-
 sw/source/core/layout/wsfrm.cxx   |   26 +-
 sw/source/core/text/porrst.cxx|   50 ++---
 sw/source/filter/ww8/docxattributeoutput.cxx  |   22 +-
 sw/source/ui/dbui/dbtablepreviewdialog.cxx|   24 +-
 sw/source/ui/table/instable.cxx   |   26 +-
 sw/source/uibase/app/appopt.cxx   |   32 +--
 sw/source/uibase/docvw/SidebarTxtControl.cxx  |   28 +-
 sw/source/uibase/ribbar/workctrl.cxx  |   28 +-
 sw/source/uibase/utlui/content.cxx|  106 +-
 unoidl/source/legacyprovider.cxx  |   25 +-
 unoidl/source/unoidl-write.cxx|   45 ++--
 54 files changed, 1098 insertions(+), 1095 deletions(-)

New commits:
commit b624b13b3d5a8e573c7de8158cadc66b1982d157
Author: Noel 
AuthorDate: Fri Mar 26 13:35:54 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 26 18:02:19 2021 +0100

loplugin:flatten

Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/UnoControls/source/base/multiplexer.cxx 
b/UnoControls/source/base/multiplexer.cxx
index 2e0f48dd75fb..a8322d845c43 100644
--- a/UnoControls/source/base/multiplexer.cxx
+++ b/UnoControls/source/base/multiplexer.cxx
@@ -40,29 +40,26 @@ namespace unocontrols {
 /* First get all interfaces from container with right type.*/  
 \
 OInterfaceContainerHelper* pContainer = m_aListenerHolder.getContainer( 
cppu::UnoType::get() );  \
 /* Do the follow only, if elements in container exist.*/   
 \
-if( pContainer != nullptr )
\
-{  
 \
-

[Libreoffice-commits] core.git: drawinglayer/source include/vcl sd/source vcl/source vcl/win

2021-03-26 Thread Noel (via logerrit)
 drawinglayer/source/texture/texture3d.cxx |2 -
 include/vcl/bitmap.hxx|6 +
 sd/source/ui/docshell/docshel2.cxx|2 -
 vcl/source/bitmap/BitmapEx.cxx|   34 +++---
 vcl/source/bitmap/alpha.cxx   |4 +--
 vcl/source/gdi/metaact.cxx|6 ++---
 vcl/win/window/salframe.cxx   |4 +--
 7 files changed, 32 insertions(+), 26 deletions(-)

New commits:
commit 83b011b61e941250f8c58ff12c864830fe52f9c0
Author: Noel 
AuthorDate: Fri Mar 26 10:30:34 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 26 11:58:03 2021 +0100

create operator bool for Bitmap

so we can use a more natural syntax than "!!"

Change-Id: I8152a0d3ce37115fc83d332a26725ca1d28d959a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113147
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/source/texture/texture3d.cxx 
b/drawinglayer/source/texture/texture3d.cxx
index ef53c94d0d10..2c8be33a2086 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -89,7 +89,7 @@ namespace drawinglayer::texture
 mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence);
 }
 
-if (!!maBitmap)
+if (maBitmap)
 mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap);
 SAL_WARN_IF(!mpReadBitmap, "drawinglayer", "GeoTexSvxBitmapEx: Got 
no read access to Bitmap");
 if (mpReadBitmap)
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 3a2baf9e24c7..4c1a3b3dbddf 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -124,6 +124,7 @@ public:
 inline bool operator!() const;
 booloperator==( const Bitmap& rBitmap ) const;
 booloperator!=( const Bitmap& rBitmap ) const { return 
!operator==(rBitmap); }
+inline  operator bool() const;
 
 inline bool IsEmpty() const;
 voidSetEmpty();
@@ -550,6 +551,11 @@ private:
 
 };
 
+inline Bitmap::operator bool() const
+{
+return mxSalBmp != nullptr;
+}
+
 inline bool Bitmap::operator!() const
 {
 return( mxSalBmp == nullptr );
diff --git a/sd/source/ui/docshell/docshel2.cxx 
b/sd/source/ui/docshell/docshel2.cxx
index bfbb92ab61c5..68bdf0af1f7e 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -262,7 +262,7 @@ BitmapEx DrawDocShell::GetPagePreviewBitmap(SdPage* pPage)
 
 BitmapEx aPreview( pVDev->GetBitmapEx( aNullPt, 
pVDev->GetOutputSizePixel() ) );
 
-DBG_ASSERT(!!aPreview, "Preview-Bitmap could not be generated");
+DBG_ASSERT(aPreview, "Preview-Bitmap could not be generated");
 
 return aPreview;
 }
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 60272c728485..8f1693193e78 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -127,7 +127,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask 
) :
 {
 // Ensure a mask is exactly one bit deep,
 // alternatively also allow 8bpp masks.
-if( !!maMask && maMask.GetBitCount() != 1 && !(maMask.GetBitCount() == 8 
&& maMask.HasGreyPalette8Bit()))
+if( maMask && maMask.GetBitCount() != 1 && !(maMask.GetBitCount() == 8 && 
maMask.HasGreyPalette8Bit()))
 {
 SAL_WARN( "vcl", "BitmapEx: forced mask to monochrome");
 BitmapEx aMaskEx(maMask);
@@ -135,7 +135,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask 
) :
 maMask = aMaskEx.GetBitmap();
 }
 
-if (!!maBitmap && !!maMask && maBitmap.GetSizePixel() != 
maMask.GetSizePixel())
+if (maBitmap && maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel())
 {
 OSL_ENSURE(false, "Mask size differs from Bitmap size, corrected Mask 
(!)");
 maMask.Scale(maBitmap.GetSizePixel());
@@ -149,7 +149,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& 
rAlphaMask ) :
 meTransparent( !rAlphaMask ? TransparentType::NONE : 
TransparentType::Bitmap ),
 mbAlpha  ( !rAlphaMask.IsEmpty() )
 {
-if (!!maBitmap && !!maMask && maBitmap.GetSizePixel() != 
maMask.GetSizePixel())
+if (maBitmap && maMask && maBitmap.GetSizePixel() != maMask.GetSizePixel())
 {
 OSL_ENSURE(false, "Alpha size differs from Bitmap size, corrected Mask 
(!)");
 maMask.Scale(rBmp.GetSizePixel());
@@ -306,7 +306,7 @@ bool BitmapEx::Invert()
 {
 bool bRet = false;
 
-if (!!maBitmap)
+if (maBitmap)
 bRet = maBitmap.Invert();
 
 return bRet;
@@ -316,7 +316,7 @@ bool BitmapEx::Mirror( BmpMirrorFlags nMirrorFlags )
 {
 bool bRet = false;
 
-if( !!maBitmap )
+if( maBitmap )
 {
 bRet = maBitmap.Mirror( nMirrorFlags );
 
@@ -331,7 +331,7 @@ bool BitmapEx::Scale( const double& rScaleX, const 

[Libreoffice-commits] core.git: vcl/source

2021-03-26 Thread Noel (via logerrit)
 vcl/source/bitmap/BitmapEx.cxx |   64 -
 1 file changed, 32 insertions(+), 32 deletions(-)

New commits:
commit e51824788d59b060b93d6632c1498fa71fbd9e69
Author: Noel 
AuthorDate: Fri Mar 26 08:52:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 26 08:40:06 2021 +0100

flatten BitmapEx::GetAlpha

Change-Id: Ica7ed7fd94f2ddeaa6c5400d3606c5eeeffbf4f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113141
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index a2667cbb6534..60272c728485 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -659,49 +659,49 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx const & 
aBitmap, const tools::Long
 
 sal_uInt8 BitmapEx::GetAlpha(sal_Int32 nX, sal_Int32 nY) const
 {
-sal_uInt8 nAlpha(0);
+if(maBitmap.IsEmpty())
+return 0;
+
+if (nX < 0 || nX >= GetSizePixel().Width() || nY < 0 || nY >= 
GetSizePixel().Height())
+return 0;
+
+if (maBitmap.GetBitCount() == 32)
+return GetPixelColor(nX, nY).GetAlpha();
 
-if(!maBitmap.IsEmpty())
+sal_uInt8 nAlpha(0);
+switch(meTransparent)
 {
-if (nX >= 0 && nX < GetSizePixel().Width() && nY >= 0 && nY < 
GetSizePixel().Height())
+case TransparentType::NONE:
+{
+// Not transparent, ergo all covered
+nAlpha = 255;
+break;
+}
+case TransparentType::Bitmap:
 {
-if (maBitmap.GetBitCount() == 32)
-return GetPixelColor(nX, nY).GetAlpha();
-switch(meTransparent)
+if(!maMask.IsEmpty())
 {
-case TransparentType::NONE:
-{
-// Not transparent, ergo all covered
-nAlpha = 255;
-break;
-}
-case TransparentType::Bitmap:
+Bitmap aTestBitmap(maMask);
+Bitmap::ScopedReadAccess pRead(aTestBitmap);
+
+if(pRead)
 {
-if(!maMask.IsEmpty())
-{
-Bitmap aTestBitmap(maMask);
-Bitmap::ScopedReadAccess pRead(aTestBitmap);
+const BitmapColor aBitmapColor(pRead->GetPixel(nY, nX));
 
-if(pRead)
+if(mbAlpha)
+{
+nAlpha = 255 - aBitmapColor.GetIndex();
+}
+else
+{
+if(0x00 == aBitmapColor.GetIndex())
 {
-const BitmapColor aBitmapColor(pRead->GetPixel(nY, 
nX));
-
-if(mbAlpha)
-{
-nAlpha = 255 - aBitmapColor.GetIndex();
-}
-else
-{
-if(0x00 == aBitmapColor.GetIndex())
-{
-nAlpha = 255;
-}
-}
+nAlpha = 255;
 }
 }
-break;
 }
 }
+break;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang dbaccess/source include/xmloff sc/source sdext/source sd/source vcl/source xmloff/source

2021-03-25 Thread Noel (via logerrit)
 compilerplugins/clang/unusedvarsglobal.py|2 
 compilerplugins/clang/unusedvarsglobal.untouched.results |   26 -
 compilerplugins/clang/unusedvarsglobal.writeonly.results |  320 ++-
 dbaccess/source/ui/browser/genericcontroller.cxx |9 
 include/xmloff/xmlimp.hxx|1 
 sc/source/ui/inc/inscodlg.hxx|1 
 sd/source/ui/inc/framework/FrameworkHelper.hxx   |3 
 sdext/source/presenter/PresenterHelper.hxx   |1 
 vcl/source/filter/FilterConfigCache.cxx  |7 
 vcl/source/filter/FilterConfigCache.hxx  |1 
 xmloff/source/draw/sdpropls.cxx  |   10 
 xmloff/source/forms/elementimport.cxx|1 
 xmloff/source/forms/elementimport.hxx|1 
 13 files changed, 71 insertions(+), 312 deletions(-)

New commits:
commit eab3fa1f372887c913b2f2d85bbccadede10355d
Author: Noel 
AuthorDate: Thu Mar 25 13:56:39 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 25 14:13:12 2021 +0100

loplugin:unusedvarsglobal

Change-Id: Ie73c8bec0196c680311b0959f3a17c3af900ce88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113084
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedvarsglobal.py 
b/compilerplugins/clang/unusedvarsglobal.py
index db46b9fee1ca..da268794bb6e 100755
--- a/compilerplugins/clang/unusedvarsglobal.py
+++ b/compilerplugins/clang/unusedvarsglobal.py
@@ -127,7 +127,7 @@ def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
 # sort by both the source-line and the datatype, so the output file ordering 
is stable
 # when we have multiple items on the same source line
 def v_sort_key(v):
-return natural_sort_key(v[0]) + [v1]]
+return natural_sort_key(v[0]) + [v[1]]
 
 # sort results by name and line number
 tmp1list = sorted(untouchedSet, key=lambda v: v_sort_key(v))
diff --git a/compilerplugins/clang/unusedvarsglobal.untouched.results 
b/compilerplugins/clang/unusedvarsglobal.untouched.results
index cdc7a6e89477..4a40feec0bf2 100644
--- a/compilerplugins/clang/unusedvarsglobal.untouched.results
+++ b/compilerplugins/clang/unusedvarsglobal.untouched.results
@@ -1,38 +1,44 @@
-canvas/workben/canvasdemo.cxx:672
+canvas/workben/canvasdemo.cxx:669
 (anonymous namespace)::DemoApp aApp
-connectivity/source/drivers/evoab2/EApi.h:52
-gconstpointer (*)(EContact *, EContactField) e_contact_get_const
 cppu/source/uno/check.cxx:315
 (anonymous namespace)::BinaryCompatible_Impl aTest
-framework/source/services/ContextChangeEventMultiplexer.cxx:381
+framework/source/services/ContextChangeEventMultiplexer.cxx:370
 framework::(anonymous namespace)::Hook g_hook
 hwpfilter/source/nodes.h:92
 int count
-pyuno/source/loader/pyuno_loader.cxx:240
-pyuno_loader::(anonymous namespace)::PythonInit s_Init
 pyuno/source/module/pyuno_gc.cxx:45
 pyuno::(anonymous namespace)::StaticDestructorGuard guard
 sal/osl/all/utility.cxx:45
 osl::(anonymous namespace)::OGlobalTimer aGlobalTimer
-sal/qa/osl/file/osl_File.cxx:5199
+sal/qa/osl/file/osl_File.cxx:4970
 (anonymous namespace)::GlobalObject theGlobalObject
 sal/rtl/cmdargs.cxx:46
 (anonymous namespace)::ArgHolder argHolder
+sal/rtl/strtmpl.hxx:1258
+IMPL_RTL_STRINGDATA data
+sc/source/ui/inc/inscodlg.hxx:88
+_Bool bPreviousAllCheck
+sdext/source/presenter/PresenterHelper.hxx:33
+rtl::OUString msCenterPaneURL
 soltools/cpp/cpp.h:239
 int Lflag
 soltools/mkdepend/parse.c:40
 symhash * maininclist
 soltools/mkdepend/pr.c:34
 int width
+starmath/inc/ElementsDockingWindow.hxx:81
+std::tuple [0] m_a6Categories
 svx/source/gengal/gengal.cxx:323
 (anonymous namespace)::GalApp aGalApp
-vcl/backendtest/VisualBackendTest.cxx:745
+vcl/backendtest/VisualBackendTest.cxx:799
 (anonymous namespace)::VisualBackendTestApp aApplication
 vcl/source/uipreviewer/previewer.cxx:113
 (anonymous namespace)::UIPreviewApp aApp
-vcl/workben/icontest.cxx:216
+vcl/workben/icontest.cxx:214
 (anonymous namespace)::IconTestApp aApp
 vcl/workben/mtfdemo.cxx:162
 (anonymous namespace)::DemoMtfApp aApp
-vcl/workben/vcldemo.cxx:2445
+vcl/workben/vcldemo.cxx:2258
 (anonymous namespace)::DemoApp aApp
+xmloff/source/forms/elementimport.hxx:54
+xmloff::OElementNameMap::MapString2Element s_sElementTranslations
diff --git a/compilerplugins/clang/unusedvarsglobal.writeonly.results 
b/compilerplugins/clang/unusedvarsglobal.writeonly.results
index 92413e328e2c..a79fcd405751 100644
--- a/compilerplugins/clang/unusedvarsglobal.writeonly.results
+++ b/compilerplugins/clang/unusedvarsglobal.writeonly.results
@@ -1,38 +1,18 @@
-basctl/source/basicide/localizationmgr.cxx:52
-rtl::OUStringLiteral aSemi
-chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx:149
-sal_uInt16 [7] nAreaWhichPairs

[Libreoffice-commits] core.git: 2 commits - chart2/uiconfig vcl/inc vcl/source

2021-03-24 Thread Noel (via logerrit)
 chart2/uiconfig/ui/tp_Trendline.ui |   25 ++---
 vcl/inc/sft.hxx|4 ++--
 vcl/source/fontsubset/sft.cxx  |   12 ++--
 3 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit 6c13e5a92ed4b6a10458cd5d5741ddb3d816df4e
Author: Noel 
AuthorDate: Tue Mar 23 12:17:16 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 24 20:36:35 2021 +0100

convert m_pFileName to std::string

which simplifies the code and fixes a problem with using
strdup(), because strdup() allocates with malloc, while
unique_ptr will free it with delete[], and we'll get
a mismatch error from ASAN
(spotted by Mike Kaganski)

Change-Id: I0f21828ef3482898b81aa3f0745b2bd855a2c286
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112980
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 877b94713a8f..fb43e51a174a 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -720,7 +720,7 @@ constexpr int NUM_TAGS = 17;
 
 class VCL_DLLPUBLIC AbstractTrueTypeFont
 {
-std::unique_ptr m_pFileName;
+std::string m_sFileName;
 sal_uInt32 m_nGlyphs;
 sal_uInt32 m_nHorzMetrics;
 sal_uInt32 m_nVertMetrics; /* if not 0 => font has vertical metrics 
information */
@@ -735,7 +735,7 @@ public:
 AbstractTrueTypeFont(const char* fileName = nullptr, const FontCharMapRef 
xCharMap = nullptr);
 virtual ~AbstractTrueTypeFont();
 
-const char* fileName() const { return m_pFileName.get(); }
+std::string const & fileName() const { return m_sFileName; }
 sal_uInt32 glyphCount() const { return m_nGlyphs; }
 sal_uInt32 glyphOffset(sal_uInt32 glyphID) const;
 sal_uInt32 horzMetricCount() const { return m_nHorzMetrics; }
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 5208b46adb28..fe0f0ef1562a 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -925,9 +925,9 @@ static void GetNames(TrueTypeFont *t)
 }
 if ( ! t->psname )
 {
-if (t->fileName())
+if (!t->fileName().empty())
 {
-const char* pReverse = t->fileName() + strlen(t->fileName());
+const char* pReverse = t->fileName().data() + 
t->fileName().length();
 /* take only last token of filename */
 while (pReverse != t->fileName() && *pReverse != '/') pReverse--;
 if(*pReverse == '/') pReverse++;
@@ -1034,7 +1034,7 @@ SFErrCodes OpenTTFontFile(const char* fname, sal_uInt32 
facenum, TrueTypeFont**
 if( ! *ttf )
 return SFErrCodes::Memory;
 
-if( ! (*ttf)->fileName() )
+if( (*ttf)->fileName().empty() )
 {
 ret = SFErrCodes::Memory;
 goto cleanup;
@@ -1121,7 +1121,7 @@ AbstractTrueTypeFont::AbstractTrueTypeFont(const char* 
pFileName, const FontChar
 , m_xCharMap(xCharMap)
 {
 if (pFileName)
-m_pFileName.reset(strdup(pFileName));
+m_sFileName = pFileName;
 }
 
 AbstractTrueTypeFont::~AbstractTrueTypeFont()
@@ -1144,7 +1144,7 @@ TrueTypeFont::TrueTypeFont(const char* pFileName, const 
FontCharMapRef xCharMap)
 TrueTypeFont::~TrueTypeFont()
 {
 #if !defined(_WIN32)
-if (fileName())
+if (!fileName().empty())
 munmap(ptr, fsize);
 #endif
 free(psname);
@@ -1897,7 +1897,7 @@ SFErrCodes CreateT42FromTTGlyphs(TrueTypeFont  *ttf,
 
 fprintf(outf, "%%!PS-TrueTypeFont-%d.%d-%d.%d\n", static_cast(ver), 
static_cast(ver & 0xFF), static_cast(rev>>16), static_cast(rev & 
0x));
 fprintf(outf, "Creator: %s %s %s\n", modname, modver, modextra);
-fprintf(outf, "%%- Font subset generated from a source font file: '%s'\n", 
ttf->fileName());
+fprintf(outf, "%%- Font subset generated from a source font file: '%s'\n", 
ttf->fileName().data());
 fprintf(outf, "%%- Original font name: %s\n", ttf->psname);
 fprintf(outf, "%%- Original font family: %s\n", ttf->family);
 fprintf(outf, "%%- Original font sub-family: %s\n", ttf->subfamily);
commit 4f28ca3e16de71e279fc54cd4a95e8181479c263
Author: Caolán McNamara 
AuthorDate: Tue Mar 23 10:12:15 2021 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 24 20:36:24 2021 +0100

tdf#141191 use plain GtkComboBoxText for standard case

Change-Id: I0afa3c59737eb44a8775f2958ebf2fc813b23af9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112979
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/chart2/uiconfig/ui/tp_Trendline.ui 
b/chart2/uiconfig/ui/tp_Trendline.ui
index 9b16231f7b46..af630ba12137 100644
--- a/chart2/uiconfig/ui/tp_Trendline.ui
+++ b/chart2/uiconfig/ui/tp_Trendline.ui
@@ -332,10 +332,14 @@
   
 
 
-  
+  
 True
 False
-liststore_moving_type
+
+  Prior
+  Central
+  Averaged Abscissa
+ 

[Libreoffice-commits] core.git: compilerplugins/clang include/vcl sfx2/source

2021-03-24 Thread Noel (via logerrit)
 compilerplugins/clang/unnecessaryvirtual-dead.results |8 -
 compilerplugins/clang/unnecessaryvirtual.results  |  132 +-
 include/vcl/toolkit/dialog.hxx|2 
 sfx2/source/devtools/DocumentModelTreeHandler.cxx |2 
 4 files changed, 73 insertions(+), 71 deletions(-)

New commits:
commit a7cf7da8d21d3d4d54bd532f07fc0c4712239dbb
Author: Noel 
AuthorDate: Wed Mar 24 14:55:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 24 20:01:06 2021 +0100

loplugin:unnecessaryvirtual

Change-Id: Ic414b72299b5c5c19e5b37156ac6dec4bedadf65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113038
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unnecessaryvirtual-dead.results 
b/compilerplugins/clang/unnecessaryvirtual-dead.results
index ff6177df67f3..a541ad4cf929 100644
--- a/compilerplugins/clang/unnecessaryvirtual-dead.results
+++ b/compilerplugins/clang/unnecessaryvirtual-dead.results
@@ -18,11 +18,11 @@ vcl/inc/salinst.hxx:200
 void SalInstance::releaseMainThread()
 vcl/inc/salobj.hxx:49
 void SalObject::Enable(_Bool,)
-writerfilter/source/ooxml/OOXMLFactory.hxx:66
+writerfilter/source/ooxml/OOXMLFactory.hxx:65
 void writerfilter::ooxml::OOXMLFactory_ns::startAction(class 
writerfilter::ooxml::OOXMLFastContextHandler *,)
-writerfilter/source/ooxml/OOXMLFactory.hxx:67
+writerfilter/source/ooxml/OOXMLFactory.hxx:66
 void writerfilter::ooxml::OOXMLFactory_ns::charactersAction(class 
writerfilter::ooxml::OOXMLFastContextHandler *,const class rtl::OUString &,)
-writerfilter/source/ooxml/OOXMLFactory.hxx:68
+writerfilter/source/ooxml/OOXMLFactory.hxx:67
 void writerfilter::ooxml::OOXMLFactory_ns::endAction(class 
writerfilter::ooxml::OOXMLFastContextHandler *,)
-writerfilter/source/ooxml/OOXMLFactory.hxx:69
+writerfilter/source/ooxml/OOXMLFactory.hxx:68
 void writerfilter::ooxml::OOXMLFactory_ns::attributeAction(class 
writerfilter::ooxml::OOXMLFastContextHandler *,int,const class 
tools::SvRef &,)
diff --git a/compilerplugins/clang/unnecessaryvirtual.results 
b/compilerplugins/clang/unnecessaryvirtual.results
index 45b9d0f6d699..6624c18108e5 100644
--- a/compilerplugins/clang/unnecessaryvirtual.results
+++ b/compilerplugins/clang/unnecessaryvirtual.results
@@ -216,37 +216,37 @@ chart2/source/inc/ModifyListenerCallBack.hxx:41
 void chart::ModifyListenerCallBack::~ModifyListenerCallBack()
 chart2/source/inc/WeakListenerAdapter.hxx:56
 void chart::WeakListenerAdapter::disposing(const struct 
com::sun::star::lang::EventObject &,)
-extensions/source/dbpilots/unoautopilot.hxx:81
+extensions/source/dbpilots/unoautopilot.hxx:80
 class cppu::IPropertyArrayHelper * 
dbp::OUnoAutoPilot::createArrayHelper()const
-extensions/source/propctrlr/commoncontrol.hxx:130
+extensions/source/propctrlr/commoncontrol.hxx:129
 short pcr::CommonBehaviourControl::getControlType()
-extensions/source/propctrlr/commoncontrol.hxx:132
+extensions/source/propctrlr/commoncontrol.hxx:131
 class com::sun::star::uno::Reference 
pcr::CommonBehaviourControl::getControlContext()
-extensions/source/propctrlr/commoncontrol.hxx:134
+extensions/source/propctrlr/commoncontrol.hxx:133
 void pcr::CommonBehaviourControl::setControlContext(const class 
com::sun::star::uno::Reference &,)
-extensions/source/propctrlr/commoncontrol.hxx:136
+extensions/source/propctrlr/commoncontrol.hxx:135
 class com::sun::star::uno::Reference 
pcr::CommonBehaviourControl::getControlWindow()
-extensions/source/propctrlr/commoncontrol.hxx:138
+extensions/source/propctrlr/commoncontrol.hxx:137
 unsigned char pcr::CommonBehaviourControl::isModified()
-extensions/source/propctrlr/commoncontrol.hxx:140
+extensions/source/propctrlr/commoncontrol.hxx:139
 void pcr::CommonBehaviourControl::notifyModifiedValue()
-extensions/source/propctrlr/commoncontrol.hxx:155
+extensions/source/propctrlr/commoncontrol.hxx:154
 void pcr::CommonBehaviourControl::disposing()
-forms/source/xforms/datatypes.hxx:234
+forms/source/xforms/datatypes.hxx:233
 class cppu::IPropertyArrayHelper * 
xforms::ODerivedDataType::createArrayHelper()const
-forms/source/xforms/datatypes.hxx:237
+forms/source/xforms/datatypes.hxx:236
 class com::sun::star::uno::Reference 
xforms::ODerivedDataType::getPropertySetInfo()
-forms/source/xforms/datatypes.hxx:238
+forms/source/xforms/datatypes.hxx:237
 class cppu::IPropertyArrayHelper & 
xforms::ODerivedDataType::getInfoHelper()
-forms/source/xforms/namedcollection.hxx:82
+forms/source/xforms/namedcollection.hxx:81
 class com::sun::star::uno::Type NamedCollection::getElementType()
-forms/source/xforms/namedcollection.hxx:87
+forms/source/xforms/namedcollection.hxx:86
 unsigned char NamedCollection::hasElements()
-forms/source/xforms/namedcollection.hxx:93
+forms/source/xforms/namedcollection.hxx:92
 class com::sun::star::uno::Any NamedCollection::getByName(const class 

[Libreoffice-commits] core.git: compilerplugins/clang include/sfx2 include/vcl include/xmloff sfx2/inc sfx2/source svx/source vcl/inc vcl/source

2021-03-24 Thread Noel (via logerrit)
 compilerplugins/clang/unusedmethods.results|  400 -
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |4 
 include/sfx2/sidebar/Deck.hxx  |2 
 include/sfx2/sidebar/Theme.hxx |1 
 include/vcl/settings.hxx   |2 
 include/xmloff/xmlnumfi.hxx|1 
 sfx2/inc/sidebar/DrawHelper.hxx|2 
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |5 
 sfx2/source/sidebar/DrawHelper.cxx |   19 
 sfx2/source/sidebar/Theme.cxx  |9 
 svx/source/gallery2/galbrws1.cxx   |8 
 svx/source/gallery2/galbrws1.hxx   |1 
 vcl/inc/impglyphitem.hxx   |1 
 vcl/source/app/settings.cxx|   10 
 vcl/source/gdi/impglyphitem.cxx|6 
 15 files changed, 202 insertions(+), 269 deletions(-)

New commits:
commit 3b9866ee35fe3567e850f0f1a888d96e60b6fbfa
Author: Noel 
AuthorDate: Wed Mar 24 14:47:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 24 20:00:47 2021 +0100

loplugin:unusedmethods

Change-Id: Id54e7545b3a69e03c29daf9d372bbf605312f547
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113036
Reviewed-by: Tomaž Vajngerl 
Reviewed-by: Caolán McNamara 
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index 1a61b78f1c03..e3686d2235de 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -44,43 +44,43 @@ connectivity/inc/sdbcx/VGroup.hxx:61
  connectivity::sdbcx::OGroup::OGroup(_Bool)
 connectivity/inc/sdbcx/VGroup.hxx:62
  connectivity::sdbcx::OGroup::OGroup(const class rtl::OUString &,_Bool)
-connectivity/source/drivers/firebird/Driver.hxx:60
+connectivity/source/drivers/firebird/Driver.hxx:59
 const class com::sun::star::uno::Reference & 
connectivity::firebird::FirebirdDriver::getContext() const
-connectivity/source/drivers/firebird/Util.hxx:66
+connectivity/source/drivers/firebird/Util.hxx:65
  connectivity::firebird::ColumnTypeInfo::ColumnTypeInfo(short,const class 
rtl::OUString &)
-connectivity/source/drivers/firebird/Util.hxx:71
+connectivity/source/drivers/firebird/Util.hxx:70
 short connectivity::firebird::ColumnTypeInfo::getType() const
-connectivity/source/drivers/firebird/Util.hxx:72
+connectivity/source/drivers/firebird/Util.hxx:71
 short connectivity::firebird::ColumnTypeInfo::getSubType() const
-connectivity/source/drivers/firebird/Util.hxx:74
+connectivity/source/drivers/firebird/Util.hxx:73
 const class rtl::OUString & 
connectivity::firebird::ColumnTypeInfo::getCharacterSet() const
-connectivity/source/drivers/mysqlc/mysqlc_connection.hxx:176
+connectivity/source/drivers/mysqlc/mysqlc_connection.hxx:175
 class rtl::OUString 
connectivity::mysqlc::OConnection::transFormPreparedStatement(const class 
rtl::OUString &)
-connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx:94
+connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx:93
 type-parameter-?-? 
connectivity::mysqlc::OPreparedResultSet::safelyRetrieveValue(const int)
-connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx:95
+connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx:94
 type-parameter-?-? 
connectivity::mysqlc::OPreparedResultSet::retrieveValue(const int)
-connectivity/source/inc/dbase/dindexnode.hxx:65
+connectivity/source/inc/dbase/dindexnode.hxx:64
 _Bool connectivity::dbase::ONDXKey::operator<(const class 
connectivity::dbase::ONDXKey &) const
-connectivity/source/inc/java/sql/Connection.hxx:61
+connectivity/source/inc/java/sql/Connection.hxx:60
 class rtl::OUString 
connectivity::java_sql_Connection::transFormPreparedStatement(const class 
rtl::OUString &)
-connectivity/source/inc/OColumn.hxx:103
+connectivity/source/inc/OColumn.hxx:102
 _Bool connectivity::OColumn::isReadOnly() const
-connectivity/source/inc/OColumn.hxx:104
+connectivity/source/inc/OColumn.hxx:103
 _Bool connectivity::OColumn::isWritable() const
-connectivity/source/inc/OColumn.hxx:105
+connectivity/source/inc/OColumn.hxx:104
 _Bool connectivity::OColumn::isDefinitelyWritable() const
-connectivity/source/inc/odbc/OConnection.hxx:118
+connectivity/source/inc/odbc/OConnection.hxx:117
 class connectivity::odbc::ODBCDriver * 
connectivity::odbc::OConnection::getDriver() const
-connectivity/source/inc/odbc/ODriver.hxx:72
+connectivity/source/inc/odbc/ODriver.hxx:71
 const class com::sun::star::uno::Reference & 
connectivity::odbc::ODBCDriver::getContext() const
-connectivity/source/inc/odbc/OPreparedStatement.hxx:71
+connectivity/source/inc/odbc/OPreparedStatement.hxx:70
 void 

[Libreoffice-commits] core.git: include/svx svx/source

2021-03-24 Thread Noel (via logerrit)
 include/svx/svdobj.hxx |2 +-
 svx/source/svdraw/svdogrp.cxx  |2 +-
 svx/source/svdraw/svdovirt.cxx |8 
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 4f3fb443cea4364b2ec8cb56515ec9bdfe6f5391
Author: Noel 
AuthorDate: Wed Mar 24 10:38:52 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 24 14:33:04 2021 +0100

use mutable rather than const_cast..this

Change-Id: I0512ac563a8065814bccbcd942a47f1c5fa11c04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113018
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 38bdc98eea5d..c759f3cfff14 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -871,7 +871,7 @@ public:
 const Graphic* getFillGraphic() const;
 
 protected:
-tools::RectangleaOutRect; // surrounding rectangle for 
Paint (incl. LineWidth, ...)
+mutable tools::RectangleaOutRect; // surrounding rectangle for 
Paint (incl. LineWidth, ...)
 Point   aAnchor;  // anchor position (Writer)
 SdrObjUserCall* pUserCall;
 std::unique_ptr
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 67783b147c3e..9124e0849090 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -199,7 +199,7 @@ const tools::Rectangle& SdrObjGroup::GetCurrentBoundRect() 
const
 //  has to contain the bounding rectangle
 if(0 != GetObjCount())
 {
-const_cast< SdrObjGroup* >(this)->aOutRect = GetAllObjBoundRect();
+aOutRect = GetAllObjBoundRect();
 }
 
 return aOutRect;
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 552eb438b755..34b1361d7521 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -114,15 +114,15 @@ SdrObjList* SdrVirtObj::GetSubList() const
 
 const tools::Rectangle& SdrVirtObj::GetCurrentBoundRect() const
 {
-const_cast(this)->aOutRect=rRefObj.GetCurrentBoundRect(); // 
TODO: Optimize this.
-const_cast(this)->aOutRect+=aAnchor;
+aOutRect = rRefObj.GetCurrentBoundRect(); // TODO: Optimize this.
+aOutRect += aAnchor;
 return aOutRect;
 }
 
 const tools::Rectangle& SdrVirtObj::GetLastBoundRect() const
 {
-const_cast(this)->aOutRect=rRefObj.GetLastBoundRect(); // 
TODO: Optimize this.
-const_cast(this)->aOutRect+=aAnchor;
+aOutRect = rRefObj.GetLastBoundRect(); // TODO: Optimize this.
+aOutRect += aAnchor;
 return aOutRect;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/source

2021-03-23 Thread Noel (via logerrit)
 vcl/source/outdev/nativecontrols.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 32a16bae415f64adcbad447162824611200407a1
Author: Noel 
AuthorDate: Tue Mar 23 09:00:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 23 11:17:00 2021 +0100

TransformControlValue can return unique_ptr

Change-Id: I902ba385d72a15e52b692da373f2fee5be6fc621
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112947
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/outdev/nativecontrols.cxx 
b/vcl/source/outdev/nativecontrols.cxx
index 8e0d54708391..48ea73db4bf9 100644
--- a/vcl/source/outdev/nativecontrols.cxx
+++ b/vcl/source/outdev/nativecontrols.cxx
@@ -163,9 +163,9 @@ bool OutputDevice::HitTestNativeScrollbar(
 rIsInside, *this );
 }
 
-static std::shared_ptr< ImplControlValue > TransformControlValue( const 
ImplControlValue& rVal, const OutputDevice& rDev )
+static std::unique_ptr< ImplControlValue > TransformControlValue( const 
ImplControlValue& rVal, const OutputDevice& rDev )
 {
-std::shared_ptr< ImplControlValue > aResult;
+std::unique_ptr< ImplControlValue > aResult;
 switch( rVal.getType() )
 {
 case ControlType::Slider:
@@ -235,7 +235,7 @@ static std::shared_ptr< ImplControlValue > 
TransformControlValue( const ImplCont
 }
 break;
 case ControlType::Generic:
-aResult = std::make_shared( rVal );
+aResult = std::make_unique( rVal );
 break;
 case ControlType::MenuPopup:
 {
@@ -281,7 +281,7 @@ bool OutputDevice::DrawNativeControl( ControlType nType,
 
 // Convert the coordinates from relative to Window-absolute, so we draw
 // in the correct place in platform code
-std::shared_ptr< ImplControlValue > aScreenCtrlValue( 
TransformControlValue( aValue, *this ) );
+std::unique_ptr< ImplControlValue > aScreenCtrlValue( 
TransformControlValue( aValue, *this ) );
 tools::Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
 
 bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, 
nState, *aScreenCtrlValue, aCaption, *this, rBackgroundColor);
@@ -306,7 +306,7 @@ bool OutputDevice::GetNativeControlRegion(  ControlType 
nType,
 
 // Convert the coordinates from relative to Window-absolute, so we draw
 // in the correct place in platform code
-std::shared_ptr< ImplControlValue > aScreenCtrlValue( 
TransformControlValue( aValue, *this ) );
+std::unique_ptr< ImplControlValue > aScreenCtrlValue( 
TransformControlValue( aValue, *this ) );
 tools::Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
 
 bool bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, 
nState, *aScreenCtrlValue,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/source framework/util

2021-03-20 Thread Noel (via logerrit)
 framework/source/uifactory/uicontrollerfactory.cxx |   21 +
 framework/util/fwk.component   |3 ++-
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 918dc4c2050ff0e1e95d0dfc2c8db3a376161f16
Author: Noel 
AuthorDate: Thu Mar 18 11:20:50 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 20 16:50:15 2021 +0100

use single-use attribute for StatusBarControllerFactory

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: Ifec5f54633508aa66492599caf80ed2bf3d7cbe5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112683
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uifactory/uicontrollerfactory.cxx 
b/framework/source/uifactory/uicontrollerfactory.cxx
index 493d1d5522d0..4b5d36948bc3 100644
--- a/framework/source/uifactory/uicontrollerfactory.cxx
+++ b/framework/source/uifactory/uicontrollerfactory.cxx
@@ -315,24 +315,6 @@ StatusbarControllerFactory::StatusbarControllerFactory( 
const Reference< XCompon
 {
 }
 
-struct StatusbarControllerFactoryInstance {
-explicit StatusbarControllerFactoryInstance(
-css::uno::Reference const & context):
-instance(static_cast(
-new StatusbarControllerFactory(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct StatusbarControllerFactorySingleton:
-public rtl::StaticWithArg<
-StatusbarControllerFactoryInstance,
-css::uno::Reference,
-StatusbarControllerFactorySingleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -356,8 +338,7 @@ 
com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-StatusbarControllerFactorySingleton::get(context).instance.get()));
+return cppu::acquire(new StatusbarControllerFactory(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 5c9085759b19..10a07911ab1b 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -128,7 +128,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - embeddedobj/source framework/source framework/util

2021-03-20 Thread Noel (via logerrit)
 embeddedobj/source/commonembedding/miscobj.cxx  |   30 
 embeddedobj/source/inc/commonembobj.hxx |3 +-
 framework/source/uielement/uicommanddescription.cxx |   23 ---
 framework/util/fwk.component|3 +-
 4 files changed, 18 insertions(+), 41 deletions(-)

New commits:
commit b7d10f138182b0f2d9b682582f73de8d6ceceb8d
Author: Noel 
AuthorDate: Thu Mar 18 11:26:03 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 20 09:30:57 2021 +0100

use single-use attribute for UICommandDescription

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: Ia26871e1a2cf2cc6150d681f3a40b42269fb65c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112686
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uielement/uicommanddescription.cxx 
b/framework/source/uielement/uicommanddescription.cxx
index d791ddfd89ab..4d9fccf5af41 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -710,33 +710,12 @@ sal_Bool SAL_CALL UICommandDescription::hasElements()
 
 } // namespace framework
 
-namespace {
-
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(static_cast(
-new framework::UICommandDescription(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
 com_sun_star_comp_framework_UICommandDescription_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new framework::UICommandDescription(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 12ce9ec7d966..5c9085759b19 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -161,7 +161,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_UICommandDescription_get_implementation"
+  single-instance="true">
 
 
   
commit 3e12b2fb64350938a3efe3252e84f62aa608356e
Author: Noel Grandin 
AuthorDate: Fri Mar 19 14:44:16 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 20 09:30:32 2021 +0100

use unique_ptr in OCommonEmbeddedObject

Change-Id: I2258838cbbe242dbe31500ecd6f29c315a335b71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112743
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/embeddedobj/source/commonembedding/miscobj.cxx 
b/embeddedobj/source/commonembedding/miscobj.cxx
index c62527f84398..c30a4bc64168 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -41,8 +41,7 @@ using namespace ::com::sun::star;
 
 OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< 
uno::XComponentContext >& rxContext,
 const uno::Sequence< 
beans::NamedValue >& aObjProps )
-: m_pInterfaceContainer( nullptr )
-, m_bReadOnly( false )
+: m_bReadOnly( false )
 , m_bDisposed( false )
 , m_bClosed( false )
 , m_nObjectState( -1 )
@@ -67,8 +66,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject(
 const uno::Sequence< beans::NamedValue >& aObjProps,
 const uno::Sequence< beans::PropertyValue >& aMediaDescr,
 const uno::Sequence< beans::PropertyValue >& aObjectDescr )
-: m_pInterfaceContainer( nullptr )
-, m_bReadOnly( false )
+: m_bReadOnly( false )
 , m_bDisposed( false )
 , m_bClosed( false )
 , m_nObjectState( embed::EmbedStates::LOADED )
@@ -242,17 +240,14 @@ OCommonEmbeddedObject::~OCommonEmbeddedObject()
 return;
 
 osl_atomic_increment(_refCount);
-try {
-lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >( this ) 
);
-
-if ( m_pInterfaceContainer )
-{
+if ( m_pInterfaceContainer )
+{
+try {
+lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >( 
this ) );
 m_pInterfaceContainer->disposeAndClear( aSource );
-
-delete m_pInterfaceContainer;
-m_pInterfaceContainer = nullptr;
-}
-} catch( const uno::Exception& ) {}
+} catch( const uno::Exception& ) {}
+m_pInterfaceContainer.reset();
+}
 
 try {
 if ( m_xDocHolder.is() )
@@ -429,7 +424,7 @@ void SAL_CALL 
OCommonEmbeddedObject::addStateChangeListener( const uno::Referenc
 throw lang::DisposedException(); // TODO
 
 if ( !m_pInterfaceContainer )
-m_pInterfaceContainer = new 
::cppu::OMultiTypeInterfaceContainerHelper( m_aMutex );
+

[Libreoffice-commits] core.git: framework/source framework/util

2021-03-20 Thread Noel (via logerrit)
 framework/source/uiconfiguration/uicategorydescription.cxx |   19 -
 framework/util/fwk.component   |3 +-
 2 files changed, 3 insertions(+), 19 deletions(-)

New commits:
commit 8a6887717f4f667ff3621e98379e62e0d57a4a3a
Author: Noel 
AuthorDate: Thu Mar 18 11:28:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 20 09:30:20 2021 +0100

use single-use attribute for UICategoryDescription

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: Ie6c8f76b88f1e059b81b28a40343a2207531b0d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112688
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx 
b/framework/source/uiconfiguration/uicategorydescription.cxx
index 279b8b7fd192..218032c5238e 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -381,22 +381,6 @@ UICategoryDescription::UICategoryDescription( const 
Reference< XComponentContext
 impl_fillElements("ooSetupFactoryCmdCategoryConfigRef");
 }
 
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(static_cast(
-new UICategoryDescription(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -404,8 +388,7 @@ 
com_sun_star_comp_framework_UICategoryDescription_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new UICategoryDescription(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 80af7267b774..12ce9ec7d966 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -155,7 +155,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_UICategoryDescription_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/source framework/util

2021-03-20 Thread Noel (via logerrit)
 framework/source/uifactory/uicontrollerfactory.cxx |   21 +
 framework/util/fwk.component   |3 ++-
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit ea004488f6d55eaebe58c595ac53392bf936b5e4
Author: Noel 
AuthorDate: Thu Mar 18 11:23:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 20 07:52:33 2021 +0100

use single-use attribute for ToolbarControllerFactory

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: Ie856c5954965fc640dc34d500664be924ddab69c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112684
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uifactory/uicontrollerfactory.cxx 
b/framework/source/uifactory/uicontrollerfactory.cxx
index 5f81f80be026..493d1d5522d0 100644
--- a/framework/source/uifactory/uicontrollerfactory.cxx
+++ b/framework/source/uifactory/uicontrollerfactory.cxx
@@ -288,24 +288,6 @@ ToolbarControllerFactory::ToolbarControllerFactory( const 
Reference< XComponentC
 {
 }
 
-struct ToolbarControllerFactoryInstance {
-explicit ToolbarControllerFactoryInstance(
-css::uno::Reference const & context):
-instance(static_cast(
-new ToolbarControllerFactory(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct ToolbarControllerFactorySingleton:
-public rtl::StaticWithArg<
-ToolbarControllerFactoryInstance,
-css::uno::Reference,
-ToolbarControllerFactorySingleton>
-{};
-
 class StatusbarControllerFactory :  public UIControllerFactory
 {
 public:
@@ -366,8 +348,7 @@ 
com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-ToolbarControllerFactorySingleton::get(context).instance.get()));
+return cppu::acquire(new ToolbarControllerFactory(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 2d71213468d6..80af7267b774 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -145,7 +145,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/source framework/util

2021-03-19 Thread Noel (via logerrit)
 framework/source/uifactory/uicontrollerfactory.cxx |   21 +
 framework/util/fwk.component   |3 ++-
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 109312f4223a986444c589eca51eac7cdeb5ff48
Author: Noel 
AuthorDate: Thu Mar 18 11:24:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 19 20:04:43 2021 +0100

use single-use attribute for PopupMenuControllerFactory

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: Ib7e51a5ba945ad151176d207d2d40f13d0fa6813
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112685
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uifactory/uicontrollerfactory.cxx 
b/framework/source/uifactory/uicontrollerfactory.cxx
index 619b66d7c420..5f81f80be026 100644
--- a/framework/source/uifactory/uicontrollerfactory.cxx
+++ b/framework/source/uifactory/uicontrollerfactory.cxx
@@ -261,24 +261,6 @@ PopupMenuControllerFactory::PopupMenuControllerFactory( 
const Reference< XCompon
 {
 }
 
-struct PopupMenuControllerFactoryInstance {
-explicit PopupMenuControllerFactoryInstance(
-css::uno::Reference const & context):
-instance(static_cast(
-new PopupMenuControllerFactory(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct PopupMenuControllerFactorySingleton:
-public rtl::StaticWithArg<
-PopupMenuControllerFactoryInstance,
-css::uno::Reference,
-PopupMenuControllerFactorySingleton>
-{};
-
 class ToolbarControllerFactory :  public UIControllerFactory
 {
 public:
@@ -376,8 +358,7 @@ 
com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-PopupMenuControllerFactorySingleton::get(context).instance.get()));
+return cppu::acquire(new PopupMenuControllerFactory(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index f3a0cfcf1edd..2d71213468d6 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -110,7 +110,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - framework/source framework/util

2021-03-19 Thread Noel (via logerrit)
 framework/source/uiconfiguration/moduleuicfgsupplier.cxx  |   19 --
 framework/source/uiconfiguration/windowstateconfiguration.cxx |   19 --
 framework/util/fwk.component  |6 ++-
 3 files changed, 6 insertions(+), 38 deletions(-)

New commits:
commit ccef00e160439f1836ab27cd13cbe6aa8f9e5146
Author: Noel 
AuthorDate: Thu Mar 18 11:27:23 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 19 20:04:25 2021 +0100

use single-use attribute for WindowStateConfiguration

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: I2a6a3b1e989d48f4eebf19e9922df22124d25d2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112687
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx 
b/framework/source/uiconfiguration/windowstateconfiguration.cxx
index ba8d0c15a43e..31b08076e953 100644
--- a/framework/source/uiconfiguration/windowstateconfiguration.cxx
+++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx
@@ -1383,22 +1383,6 @@ sal_Bool SAL_CALL WindowStateConfiguration::hasElements()
 return true;
 }
 
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(static_cast(
-new WindowStateConfiguration(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -1406,8 +1390,7 @@ 
com_sun_star_comp_framework_WindowStateConfiguration_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new WindowStateConfiguration(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index efc79a108e5d..f3a0cfcf1edd 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -183,7 +183,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_WindowStateConfiguration_get_implementation"
+  single-instance="true">
 
 
   
commit 2167edad3b1f79e304a072b4d74eb1705cfe66b4
Author: Noel 
AuthorDate: Thu Mar 18 11:31:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 19 20:04:18 2021 +0100

use single-use attribute for ModuleUIConfigurationManagerSupplier

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: I146c0da83e59557ec563ec33851d2418c15aa065
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112689
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx 
b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx
index 31d61d8d0ad5..f28c2afedddf 100644
--- a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx
+++ b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx
@@ -171,22 +171,6 @@ Reference< XUIConfigurationManager > SAL_CALL 
ModuleUIConfigurationManagerSuppli
 return pIter->second;
 }
 
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(static_cast(
-new ModuleUIConfigurationManagerSupplier(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -194,8 +178,7 @@ 
com_sun_star_comp_framework_ModuleUIConfigurationManagerSupplier_get_implementat
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new ModuleUIConfigurationManagerSupplier(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 9f050373c603..efc79a108e5d 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -91,7 +91,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_ModuleUIConfigurationManagerSupplier_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/source framework/util

2021-03-19 Thread Noel (via logerrit)
 framework/source/uifactory/uielementfactorymanager.cxx |   19 -
 framework/util/fwk.component   |3 +-
 2 files changed, 3 insertions(+), 19 deletions(-)

New commits:
commit f5784794f4cecd4fd57a803191b544f80f7ba02e
Author: Noel 
AuthorDate: Thu Mar 18 11:19:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 19 17:37:07 2021 +0100

use single-use attribute for UIElementFactoryManager

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: I52193861c4b2e07c3655773c8d185b2036336da2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112682
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uifactory/uielementfactorymanager.cxx 
b/framework/source/uifactory/uielementfactorymanager.cxx
index 02d5435bab80..b1567724ff06 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -542,22 +542,6 @@ void SAL_CALL UIElementFactoryManager::deregisterFactory( 
const OUString& aType,
 // SAFE
 }
 
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(static_cast(
-new UIElementFactoryManager(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -565,8 +549,7 @@ 
com_sun_star_comp_framework_UIElementFactoryManager_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new UIElementFactoryManager(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index d6ca2652d3cf..9f050373c603 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -166,7 +166,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_UIElementFactoryManager_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/source framework/util

2021-03-19 Thread Noel (via logerrit)
 framework/source/uifactory/windowcontentfactorymanager.cxx |   19 -
 framework/util/fwk.component   |3 +-
 2 files changed, 3 insertions(+), 19 deletions(-)

New commits:
commit 22e4f7a348f82fae7eefae5b67de3d829dceadcb
Author: Noel 
AuthorDate: Thu Mar 18 11:17:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 19 17:36:29 2021 +0100

use single-use attribute for WindowContentFactoryManager

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: I877c541c11d5c667b0d94cb3875f4263a9323dcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112681
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx 
b/framework/source/uifactory/windowcontentfactorymanager.cxx
index 996fae5f41a1..0d2991c80b7e 100644
--- a/framework/source/uifactory/windowcontentfactorymanager.cxx
+++ b/framework/source/uifactory/windowcontentfactorymanager.cxx
@@ -193,22 +193,6 @@ uno::Reference< uno::XInterface > SAL_CALL 
WindowContentFactoryManager::createIn
 return xWindow;
 }
 
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(static_cast(
-new WindowContentFactoryManager(context)))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -216,8 +200,7 @@ 
com_sun_star_comp_framework_WindowContentFactoryManager_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new WindowContentFactoryManager(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index e056e8a9aeb6..d6ca2652d3cf 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -175,7 +175,8 @@
 
   
   
+  
constructor="com_sun_star_comp_framework_WindowContentFactoryManager_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/source sfx2/util

2021-03-19 Thread Noel (via logerrit)
 sfx2/source/appl/shutdownicon.cxx |   21 +
 sfx2/util/sfx.component   |3 ++-
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 896bed62eff679e354e46635f5659fe0caa650fe
Author: Noel 
AuthorDate: Thu Mar 18 11:16:27 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 19 13:58:40 2021 +0100

use single-use attribute for ShutdownIcon

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: I40de6f9d9c86f1056860d6a9e412b0c1571703bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112680
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sfx2/source/appl/shutdownicon.cxx 
b/sfx2/source/appl/shutdownicon.cxx
index 40febc9b422a..fcebfe809d1e 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -706,31 +706,12 @@ css::uno::Any SAL_CALL 
ShutdownIcon::getFastPropertyValue( ::sal_Int32 nHandle )
 return aValue;
 }
 
-namespace {
-
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(static_cast(new ShutdownIcon(context)))
-{}
-
-rtl::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
 com_sun_star_comp_desktop_QuickstartWrapper_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new ShutdownIcon(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index a8f4b7104991..a7c9930e0ec8 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -33,7 +33,8 @@
 
   
   
+  
constructor="com_sun_star_comp_desktop_QuickstartWrapper_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/source sfx2/util

2021-03-19 Thread Noel (via logerrit)
 sfx2/source/notify/globalevents.cxx |   20 ++--
 sfx2/util/sfx.component |3 ++-
 2 files changed, 4 insertions(+), 19 deletions(-)

New commits:
commit 42969ac2c3db42460a9aaa8b51df76f58b360526
Author: Noel 
AuthorDate: Thu Mar 18 11:14:46 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 19 13:23:06 2021 +0100

use single-use attribute for SfxGlobalEvents_Impl

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: I77154b14aa3b71828590242acef97b2948ec5638
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112679
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sfx2/source/notify/globalevents.cxx 
b/sfx2/source/notify/globalevents.cxx
index 9ac9e8707565..2176c327243f 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -519,30 +519,14 @@ TModelList::iterator 
SfxGlobalEvents_Impl::impl_searchDoc(const uno::Reference<
 });
 }
 
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(
-static_cast(new 
SfxGlobalEvents_Impl(context)))
-{}
-
-rtl::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
-}
+} // namespace
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
 com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new SfxGlobalEvents_Impl(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index 314b8c18ecc9..a8f4b7104991 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -70,7 +70,8 @@
 
   
   
+  
constructor="com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source

2021-03-18 Thread Noel (via logerrit)
 include/sfx2/shell.hxx   |5 -
 sfx2/source/control/bindings.cxx |4 ++--
 sfx2/source/control/dispatch.cxx |4 ++--
 sfx2/source/control/shell.cxx|6 +++---
 4 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit 6e4238018bf0408f2961e5708212e09a8c3597dc
Author: Noel 
AuthorDate: Thu Mar 18 11:06:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 18 20:49:26 2021 +0100

inline some tiny sfx2 functions

Change-Id: I960d479d18bdd29fc14dd39649330d05fcdc0010
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112664
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index 60de3579e8d3..3266c989a7d4 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -193,11 +193,6 @@ public:
 */
 SfxViewShell*   GetViewShell() const;
 
-voidCallExec( SfxExecFunc pFunc, SfxRequest  )
-{ (*pFunc)(this, rReq); }
-voidCallState( SfxStateFunc pFunc, SfxItemSet 
 )
-{ (*pFunc)(this, rSet); }
-
 static void EmptyExecStub(SfxShell *pShell, SfxRequest &);
 static void EmptyStateStub(SfxShell *pShell, SfxItemSet &);
 
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 6ac0bb9c59cc..aa565d9c4a96 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -988,8 +988,8 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const 
SfxSlot* pSlot, SfxShell
 // The value is attached to a toggleable attribute (Bools)
 sal_uInt16 nWhich = pSlot->GetWhich(rPool);
 SfxItemSet aSet(rPool, {{nWhich, nWhich}});
-SfxStateFunc aFunc  = pSlot->GetStateFnc();
-pShell->CallState( aFunc, aSet );
+SfxStateFunc pFunc = pSlot->GetStateFnc();
+(*pFunc)(pShell, aSet);
 const SfxPoolItem *pOldItem;
 SfxItemState eState = aSet.GetItemState(nWhich, true, );
 if ( eState == SfxItemState::DISABLED )
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 9939b01f0b90..613b8cf0f7b7 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -250,7 +250,7 @@ void SfxDispatcher::Call_Impl(SfxShell& rShell, const 
SfxSlot , SfxRequest
 xImp->pInCallAliveFlag = 
 
 SfxExecFunc pFunc = rSlot.GetExecFnc();
-rShell.CallExec( pFunc, rReq );
+(*pFunc)(, rReq);
 
 // If 'this' is still alive
 if ( bThisDispatcherAlive )
@@ -1655,7 +1655,7 @@ bool SfxDispatcher::FillState_(const SfxSlotServer& rSvr, 
SfxItemSet& rState,
 else
 pFunc = pSlot->GetStateFnc();
 
-pSh->CallState( pFunc, rState );
+(*pFunc)(pSh, rState);
 #ifdef DBG_UTIL
 // To examine the conformity of IDL (SlotMap) and current Items
 if ( rState.Count() )
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 353dde1a8d07..795f25f708aa 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -381,7 +381,7 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot  )
 const sal_uInt16 nId = rSlot.GetWhich( rPool );
 SfxItemSet aSet(rPool, {{nId, nId}});
 SfxStateFunc pFunc = rSlot.GetStateFnc();
-CallState( pFunc, aSet );
+(*pFunc)( this, aSet );
 return aSet.GetItemState(nId) != SfxItemState::DISABLED;
 }
 
@@ -437,7 +437,7 @@ const SfxPoolItem* SfxShell::ExecuteSlot
 
 SfxExecFunc pFunc = pSlot->GetExecFnc();
 if ( pFunc )
-CallExec( pFunc, rReq );
+(*pFunc)( this, rReq );
 
 return rReq.GetReturnValue();
 }
@@ -472,7 +472,7 @@ const SfxPoolItem* SfxShell::GetSlotState
 // Call Status method
 SfxStateFunc pFunc = pSlot->GetStateFnc();
 if ( pFunc )
-CallState( pFunc, aSet );
+(*pFunc)( this, aSet );
 eState = aSet.GetItemState( nSlotId, true,  );
 
 // get default Item if possible
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/vcl

2021-03-15 Thread Noel (via logerrit)
 include/vcl/ITiledRenderable.hxx |2 +-
 include/vcl/uitest/uiobject.hxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0a900287cff32c7fd94f498f8077a3a2d162e131
Author: Noel 
AuthorDate: Sun Mar 14 18:02:13 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 15 09:17:13 2021 +0100

no need for this map<> key to be const

it is a value type

Change-Id: If2b122a72b3e0359a9b7996ede85e625a44102d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112476
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 42689ed98c2a..1fa0d7dcd060 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -46,7 +46,7 @@ class VCL_DLLPUBLIC ITiledRenderable
 {
 public:
 
-typedef std::map  StringMap;
+typedef std::map  StringMap;
 
 virtual ~ITiledRenderable();
 
diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index e2cb07384cf7..c9f2b922a792 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -40,7 +40,7 @@ class MenuButton;
 class ToolBox;
 namespace weld { class CustomWidgetController; }
 
-typedef std::map StringMap;
+typedef std::map StringMap;
 
 /**
  * This class wraps a UI object like vcl::Window and provides
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang drawinglayer/source editeng/source include/editeng include/tools include/vcl sd/source svx/source sw/source tools/source vcl/source

2021-03-13 Thread Noel (via logerrit)
 compilerplugins/clang/unusedmethods.results   |  320 --
 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |   45 -
 drawinglayer/source/processor2d/vclhelperbufferdevice.hxx |2 
 editeng/source/editeng/editview.cxx   |5 
 include/editeng/editview.hxx  |1 
 include/tools/zcodec.hxx  |4 
 include/vcl/alpha.hxx |1 
 include/vcl/toolkit/floatwin.hxx  |2 
 sd/source/ui/inc/TableDesignPane.hxx  |7 
 svx/source/gallery2/galbrws1.cxx  |5 
 svx/source/gallery2/galbrws1.hxx  |1 
 sw/source/core/inc/frmtool.hxx|1 
 sw/source/uibase/inc/conttree.hxx |   10 
 tools/source/zcodec/zcodec.cxx|   61 --
 vcl/source/bitmap/alpha.cxx   |   23 -
 vcl/source/window/floatwin.cxx|5 
 16 files changed, 198 insertions(+), 295 deletions(-)

New commits:
commit ebe1f639cf65c20cee70aa55176bfb67e7b915f7
Author: Noel 
AuthorDate: Sat Mar 13 12:23:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Mar 14 08:11:55 2021 +0100

loplugin:unusedmethods

Change-Id: I851eba4ca80eac9ee5896df53fbcd0f5ad125763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112433
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index f832e2c29e01..1a61b78f1c03 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -100,8 +100,6 @@ dbaccess/source/ui/inc/FieldControls.hxx:67
 class rtl::OUString dbaui::OPropNumericEditCtrl::get_text() const
 dbaccess/source/ui/inc/FieldControls.hxx:72
 void dbaui::OPropNumericEditCtrl::set_min(int)
-dbaccess/source/ui/inc/imageprovider.hxx:92
-class Image dbaui::ImageProvider::getDefaultImage(int)
 dbaccess/source/ui/inc/indexcollection.hxx:52
 class __gnu_debug::_Safe_iterator > >, class 
std::__debug::vector >, struct std::random_access_iterator_tag> 
dbaui::OIndexCollection::begin() const
 dbaccess/source/ui/inc/indexcollection.hxx:56
@@ -112,8 +110,6 @@ dbaccess/source/ui/inc/indexcollection.hxx:63
 class __gnu_debug::_Safe_iterator > >, class 
std::__debug::vector >, struct std::random_access_iterator_tag> 
dbaui::OIndexCollection::findOriginal(const class rtl::OUString &) const
 dbaccess/source/ui/inc/sbamultiplex.hxx:384
 class cppu::OInterfaceContainerHelper * 
dbaui::SbaXVetoableChangeMultiplexer::getContainer(const class rtl::OUString &)
-dbaccess/source/ui/inc/TableRow.hxx:41
- dbaui::OTableRow::OTableRow(const class 
com::sun::star::uno::Reference &)
 dbaccess/source/ui/inc/unodatbr.hxx:313
 _Bool dbaui::SbaTableQueryBrowser::implCopyObject(class ODataClipboard 
&,const class weld::TreeIter &,int)
 desktop/source/deployment/gui/dp_gui_dialog2.hxx:132
@@ -122,6 +118,8 @@ desktop/source/lib/lokclipboard.hxx:95
  LOKClipboardFactory::LOKClipboardFactory()
 drawinglayer/inc/texture/texture.hxx:39
 _Bool drawinglayer::texture::GeoTexSvx::operator!=(const class 
drawinglayer::texture::GeoTexSvx &) const
+drawinglayer/source/processor2d/vclhelperbufferdevice.hxx:48
+class VirtualDevice & drawinglayer::impBufferDevice::getMask()
 drawinglayer/source/tools/emfpcustomlinecap.hxx:37
 void emfplushelper::EMFPCustomLineCap::SetAttributes(struct 
com::sun::star::rendering::StrokeAttributes &)
 drawinglayer/source/tools/emfpstringformat.hxx:93
@@ -144,8 +142,74 @@ editeng/inc/edtspell.hxx:103
 class __gnu_debug::_Safe_iterator > 
>, class std::__debug::vector >, struct 
std::random_access_iterator_tag> WrongList::begin() const
 editeng/inc/edtspell.hxx:104
 class __gnu_debug::_Safe_iterator > 
>, class std::__debug::vector >, struct 
std::random_access_iterator_tag> WrongList::end() const
-extensions/source/bibliography/general.hxx:152
-class BibDataManager * BibGeneralPage::GetDataManager()
+embeddedobj/source/msole/olecomponent.hxx:75
+_Bool OleComponent::InitializeObject_Impl()
+embeddedobj/source/msole/olecomponent.hxx:77
+void OleComponent::CreateNewIStorage_Impl()
+embeddedobj/source/msole/olecomponent.hxx:78
+void OleComponent::RetrieveObjectDataFlavors_Impl()
+embeddedobj/source/msole/olecomponent.hxx:79
+void OleComponent::Dispose()
+embeddedobj/source/msole/olecomponent.hxx:83
+ OleComponent::OleComponent(const class 
com::sun::star::uno::Reference 
&,class OleEmbeddedObject *)
+embeddedobj/source/msole/olecomponent.hxx:88
+class OleComponent * OleComponent::createEmbeddedCopyOfLink()
+embeddedobj/source/msole/olecomponent.hxx:90
+void OleComponent::disconnectEmbeddedObject()
+embeddedobj/source/msole/olecomponent.hxx:92
+

[Libreoffice-commits] core.git: compilerplugins/clang sfx2/source vcl/inc

2021-03-13 Thread Noel (via logerrit)
 compilerplugins/clang/unusedfields.only-used-in-constructor.results |   72 +++-
 compilerplugins/clang/unusedfields.readonly.results |   20 -
 compilerplugins/clang/unusedfields.untouched.results|   66 +++-
 compilerplugins/clang/unusedfields.writeonly.results|  152 
+-
 sfx2/source/appl/childwin.cxx   |2 
 sfx2/source/appl/workwin.cxx|3 
 sfx2/source/inc/workwin.hxx |2 
 vcl/inc/window.h|1 
 8 files changed, 189 insertions(+), 129 deletions(-)

New commits:
commit c58cc416b604de0891fc8976bcf7cf099e2e8e00
Author: Noel 
AuthorDate: Sat Mar 13 11:45:33 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 13 20:20:52 2021 +0100

loplugin:unusedfields

Change-Id: Ic40d908c3063cc2537bc1746421fb76f070e5bc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112432
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git 
a/compilerplugins/clang/unusedfields.only-used-in-constructor.results 
b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
index a46426654f0e..cb65bc2deae1 100644
--- a/compilerplugins/clang/unusedfields.only-used-in-constructor.results
+++ b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
@@ -66,8 +66,6 @@ cppcanvas/source/mtfrenderer/textaction.cxx:1643
 cppcanvas::internal::(anonymous namespace)::OutlineAction maTextLineInfo 
const tools::TextLineInfo
 cppu/source/threadpool/threadpool.cxx:365
 _uno_ThreadPool dummy sal_Int32
-cppu/source/typelib/typelib.cxx:59
-(anonymous namespace)::AlignSize_Impl nInt16 sal_Int16
 cppu/source/uno/check.cxx:38
 (anonymous namespace)::C1 n1 sal_Int16
 cppu/source/uno/check.cxx:67
@@ -100,6 +98,8 @@ cppu/source/uno/check.cxx:107
 (anonymous namespace)::P p2 double
 cppu/source/uno/check.cxx:115
 (anonymous namespace)::second a int
+cppu/source/uno/check.cxx:120
+(anonymous namespace)::AlignSize_Impl nInt16 sal_Int16
 cppu/source/uno/check.cxx:126
 (anonymous namespace)::Char1 c1 char
 cppu/source/uno/check.cxx:130
@@ -164,8 +164,32 @@ drawinglayer/source/tools/emfphelperdata.hxx:197
 emfplushelper::EmfPlusHelperData mnFrameRight sal_Int32
 drawinglayer/source/tools/emfphelperdata.hxx:198
 emfplushelper::EmfPlusHelperData mnFrameBottom sal_Int32
-editeng/source/editeng/impedit.hxx:520
+editeng/source/editeng/impedit.hxx:519
 ImpEditEngine aSelFuncSet class EditSelFunctionSet
+embeddedobj/source/msole/olecomponent.hxx:51
+OleComponent m_pInterfaceContainer 
::cppu::OMultiTypeInterfaceContainerHelper *
+embeddedobj/source/msole/olecomponent.hxx:53
+OleComponent m_bDisposed _Bool
+embeddedobj/source/msole/olecomponent.hxx:54
+OleComponent m_bModified _Bool
+embeddedobj/source/msole/olecomponent.hxx:55
+OleComponent m_pNativeImpl struct OleComponentNative_Impl *
+embeddedobj/source/msole/olecomponent.hxx:57
+OleComponent m_pUnoOleObject class OleEmbeddedObject *
+embeddedobj/source/msole/olecomponent.hxx:58
+OleComponent m_pOleWrapClientSite class OleWrapperClientSite *
+embeddedobj/source/msole/olecomponent.hxx:59
+OleComponent m_pImplAdviseSink class OleWrapperAdviseSink *
+embeddedobj/source/msole/olecomponent.hxx:61
+OleComponent m_nOLEMiscFlags sal_Int32
+embeddedobj/source/msole/olecomponent.hxx:62
+OleComponent m_nAdvConn sal_Int32
+embeddedobj/source/msole/olecomponent.hxx:64
+OleComponent m_aVerbList css::uno::Sequence
+embeddedobj/source/msole/olecomponent.hxx:65
+OleComponent m_aDataFlavors 
css::uno::Sequence
+embeddedobj/source/msole/olecomponent.hxx:69
+OleComponent m_bOleInitialized _Bool
 extensions/source/bibliography/datman.cxx:407
 (anonymous namespace)::DBChangeDialog_Impl aConfig class 
DBChangeDialogConfig_Impl
 filter/source/graphicfilter/icgm/chart.hxx:49
@@ -548,10 +572,10 @@ sd/source/filter/eppt/epptbase.hxx:348
 PPTWriterBase maFraction class Fraction
 sd/source/filter/ppt/pptin.hxx:82
 SdPPTImport maParam struct PowerPointImportParam
-sd/source/ui/animations/CustomAnimationList.hxx:124
-sd::CustomAnimationList maDropTargetHelper class 
sd::CustomAnimationListDropTarget
 sd/source/ui/inc/AccessibleDocumentViewBase.hxx:261
 accessibility::AccessibleDocumentViewBase maViewForwarder class 
accessibility::AccessibleViewForwarder
+sd/source/ui/inc/CustomAnimationList.hxx:128
+sd::CustomAnimationList maDropTargetHelper class 
sd::CustomAnimationListDropTarget
 sd/source/ui/inc/OutlineBulletDlg.hxx:44
 sd::OutlineBulletDlg m_aInputSet class SfxItemSet
 sd/source/ui/remotecontrol/Receiver.hxx:35
@@ -640,21 +664,21 @@ slideshow/source/engine/smilfunctionparser.cxx:495
 slideshow::internal::(anonymous namespace)::ExpressionGrammar::definition 
binaryFunction ::boost::spirit::classic::rule
 

[Libreoffice-commits] core.git: 2 commits - accessibility/inc accessibility/source avmedia/source basctl/source dbaccess/source extensions/source forms/source framework/inc framework/source include/av

2021-03-11 Thread Noel (via logerrit)
 accessibility/inc/standard/vclxaccessibletoolboxitem.hxx |2 
 accessibility/source/standard/vclxaccessibletoolbox.cxx  |   26 +-
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx  |4 
 avmedia/source/framework/mediatoolbox.cxx|2 
 basctl/source/basicide/IDEComboBox.cxx   |4 
 basctl/source/inc/IDEComboBox.hxx|4 
 dbaccess/source/ui/browser/unodatbr.cxx  |4 
 extensions/source/bibliography/toolbar.cxx   |   18 -
 extensions/source/bibliography/toolbar.hxx   |   28 +-
 forms/source/solar/control/navtoolbar.cxx|   61 ++--
 framework/inc/uielement/FixedImageToolbarController.hxx  |2 
 framework/inc/uielement/FixedTextToolbarController.hxx   |2 
 framework/inc/uielement/comboboxtoolbarcontroller.hxx|2 
 framework/inc/uielement/commandinfo.hxx  |5 
 framework/inc/uielement/complextoolbarcontroller.hxx |4 
 framework/inc/uielement/dropdownboxtoolbarcontroller.hxx |2 
 framework/inc/uielement/edittoolbarcontroller.hxx|2 
 framework/inc/uielement/imagebuttontoolbarcontroller.hxx |2 
 framework/inc/uielement/spinfieldtoolbarcontroller.hxx   |2 
 framework/inc/uielement/togglebuttontoolbarcontroller.hxx|2 
 framework/inc/uielement/toolbarmanager.hxx   |3 
 framework/inc/uielement/toolbarmerger.hxx|   12 
 framework/source/fwe/classes/sfxhelperfunctions.cxx  |2 
 framework/source/layoutmanager/toolbarlayoutmanager.cxx  |4 
 framework/source/uielement/FixedImageToolbarController.cxx   |2 
 framework/source/uielement/FixedTextToolbarController.cxx|2 
 framework/source/uielement/comboboxtoolbarcontroller.cxx |2 
 framework/source/uielement/complextoolbarcontroller.cxx  |4 
 framework/source/uielement/dropdownboxtoolbarcontroller.cxx  |2 
 framework/source/uielement/edittoolbarcontroller.cxx |2 
 framework/source/uielement/generictoolbarcontroller.cxx  |6 
 framework/source/uielement/imagebuttontoolbarcontroller.cxx  |2 
 framework/source/uielement/popuptoolbarcontroller.cxx|   14 -
 framework/source/uielement/spinfieldtoolbarcontroller.cxx|2 
 framework/source/uielement/styletoolbarcontroller.cxx|2 
 framework/source/uielement/subtoolbarcontroller.cxx  |8 
 framework/source/uielement/togglebuttontoolbarcontroller.cxx |2 
 framework/source/uielement/toolbarmanager.cxx|   36 +-
 framework/source/uielement/toolbarmerger.cxx |   16 -
 include/avmedia/mediatoolbox.hxx |2 
 include/framework/generictoolbarcontroller.hxx   |4 
 include/framework/sfxhelperfunctions.hxx |5 
 include/sfx2/strings.hrc |2 
 include/sfx2/tbxctrl.hxx |   16 -
 include/svtools/toolboxcontroller.hxx|5 
 include/svx/ParaSpacingControl.hxx   |   14 -
 include/svx/clipboardctl.hxx |2 
 include/svx/colorwindow.hxx  |4 
 include/svx/fillctrl.hxx |2 
 include/svx/formatpaintbrushctrl.hxx |2 
 include/svx/grafctrl.hxx |   18 -
 include/svx/linectrl.hxx |2 
 include/svx/tbxctl.hxx   |2 
 include/vcl/builder.hxx  |3 
 include/vcl/toolbox.hxx  |  128 +
 sc/inc/NumberFormatControl.hxx   |2 
 sc/inc/sc.hrc|6 
 sc/source/ui/app/inputwin.cxx|  143 +--
 sc/source/ui/cctrl/tbzoomsliderctrl.cxx  |4 
 sc/source/ui/inc/tbzoomsliderctrl.hxx|2 
 sc/source/ui/sidebar/NumberFormatControl.cxx |4 
 sd/source/ui/controller/displaymodecontroller.cxx|4 
 sd/source/ui/controller/slidelayoutcontroller.cxx|2 
 sd/source/ui/dlg/diactrl.cxx |2 
 sd/source/ui/dlg/gluectrl.cxx|2 
 sd/source/ui/inc/diactrl.hxx |2 
 sd/source/ui/inc/gluectrl.hxx|2 
 sfx2/inc/inettbc.hxx |2 
 sfx2/inc/sidebar/ControllerFactory.hxx   |3 
 sfx2/inc/sidebar/SidebarToolBox.hxx  |6 
 sfx2/source/appl/linkmgr2.cxx

[Libreoffice-commits] core.git: sw/source

2021-03-11 Thread Noel (via logerrit)
 sw/source/filter/ww8/ww8graf.cxx  |   10 +-
 sw/source/filter/ww8/ww8graf2.cxx |2 +-
 sw/source/filter/ww8/ww8par.cxx   |4 ++--
 sw/source/filter/ww8/ww8par.hxx   |4 ++--
 sw/source/filter/ww8/ww8par4.cxx  |4 ++--
 sw/source/filter/ww8/ww8par6.cxx  |2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 0374d5fe08050062394038ffe863c037d95ffac1
Author: Noel 
AuthorDate: Wed Mar 10 14:46:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 11 14:09:56 2021 +0100

rename GrafikCtor to GraphicCtor

Change-Id: Ib9f4665a9b77e0d90070060f635466a046058431
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112266
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 674ca5649dca..89a3e8ac14f2 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -,7 +,7 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
 
static_cast(pNew)->SetGraphic(aGraph);
 }
 
-GrafikCtor();
+GraphicCtor();
 
 pNew->SetLogicRect( 
pTextObj->GetCurrentBoundRect() );
 pNew->SetLayer( pTextObj->GetLayer() );
@@ -1661,7 +1661,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject 
const * pSdrObj,
 */
 
 // 1. GraphicObject of documents?
-GrafikCtor();
+GraphicCtor();
 
 const SfxItemSet& rOldSet = pSdrObj->GetMergedItemSet();
 
@@ -2512,7 +2512,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( 
tools::Long nGrafAnchorCp )
 m_nDrawCpO = 0;
 m_bDrawCpOValid = m_xWwFib->GetBaseCp(m_xPlcxMan->GetManType() == MAN_HDFT 
? MAN_TXBX_HDFT : MAN_TXBX, _nDrawCpO);
 
-GrafikCtor();
+GraphicCtor();
 
 WW8PLCFspecial* pPF = m_xPlcxMan->GetFdoa();
 if( !pPF )
@@ -3186,7 +3186,7 @@ SwFlyFrameFormat* 
SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* 
 return pRetFrameFormat;
 }
 
-void SwWW8ImplReader::GrafikCtor()  // For SVDraw and VCControls and Escher
+void SwWW8ImplReader::GraphicCtor()  // For SVDraw and VCControls and Escher
 {
 if (m_pDrawModel)
 return;
@@ -3208,7 +3208,7 @@ void SwWW8ImplReader::GrafikCtor()  // For SVDraw and 
VCControls and Escher
 m_xMSDffManager->GetShapeOrders()));
 }
 
-void SwWW8ImplReader::GrafikDtor()
+void SwWW8ImplReader::GraphicDtor()
 {
 m_pDrawEditEngine.reset(); // maybe created by graphic
 m_xWWZOrder.reset();   // same
diff --git a/sw/source/filter/ww8/ww8graf2.cxx 
b/sw/source/filter/ww8/ww8graf2.cxx
index 3cb16f6422b8..08ef81f6e397 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -467,7 +467,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const 
* pTextObj,
 
 ::SetProgressState(m_nProgress, m_pDocShell); // Update
 
-GrafikCtor();
+GraphicCtor();
 
 /*
  * Little joke from Microsoft: sometimes a stream named DATA exists. This
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 68069d83a7a1..b95e5e2795af 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4396,7 +4396,7 @@ void wwSectionManager::SetSegmentToPageDesc(const 
wwSection ,
 SwFrameFormat  = rPage.GetMaster();
 
 if(mrReader.m_xWDop->fUseBackGroundInAllmodes) // #i56806# Make sure 
mrReader is initialized
-mrReader.GrafikCtor();
+mrReader.GraphicCtor();
 
 if (mrReader.m_xWDop->fUseBackGroundInAllmodes && mrReader.m_xMSDffManager)
 {
@@ -5357,7 +5357,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 m_xStyles.reset();
 
 m_xFormImpl.reset();
-GrafikDtor();
+GraphicDtor();
 m_xMSDffManager.reset();
 m_xHdFt.reset();
 m_xSBase.reset();
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 21975f20fac8..bb05228159fd 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1608,8 +1608,8 @@ private:
 SwFrameFormat* MungeTextIntoDrawBox(SvxMSDffImportRec *pRecord,
 tools::Long nGrafAnchorCp, SwFrameFormat *pRetFrameFormat);
 
-void GrafikCtor();
-void GrafikDtor();
+void GraphicCtor();
+void GraphicDtor();
 
 // other stuff
 OUString GetFieldResult( WW8FieldDesc const * pF );
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 1c5bc2a09b6c..2f0a87cc4849 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -243,7 +243,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* 
pGrf,
 ::SetProgressState(m_nProgress, m_pDocShell); // Update
 SwFrameFormat* pFormat = nullptr;
 
-GrafikCtor();
+GraphicCtor();
 
 Graphic aGraph;
 SdrObject* pRet = 

[Libreoffice-commits] core.git: 2 commits - cppuhelper/source logerrit

2021-03-10 Thread Noel (via logerrit)
 cppuhelper/source/weak.cxx |9 +
 logerrit   |2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 3d7103f18eb0a5eaf49c0acd72c7f6a3b98199ae
Author: Noel 
AuthorDate: Wed Mar 10 16:05:31 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 11 07:44:16 2021 +0100

cppu:OWeakObject zombie debugging

add some logic to catch re-animating objects early

Change-Id: I42b13eaddbc227d8b0a4e786e86ced8fbb406cae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112268
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index a11e5278..06c6ed178def 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -100,6 +100,10 @@ Any SAL_CALL OWeakConnectionPoint::queryInterface( const 
Type & rType )
 // XInterface
 void SAL_CALL OWeakConnectionPoint::acquire() throw()
 {
+#ifdef DBG_UTIL
+// catch things early which have been deleted and then re-acquired
+assert(m_aRefCount != -1);
+#endif
 osl_atomic_increment( _aRefCount );
 }
 
@@ -107,7 +111,12 @@ void SAL_CALL OWeakConnectionPoint::acquire() throw()
 void SAL_CALL OWeakConnectionPoint::release() throw()
 {
 if (! osl_atomic_decrement( _aRefCount ))
+{
+#ifdef DBG_UTIL
+m_aRefCount = -1;
+#endif
 delete this;
+}
 }
 
 void OWeakConnectionPoint::dispose()
commit 3646ab583736e6d5e2b3fb4d51857b4b6b777b45
Author: Noel 
AuthorDate: Wed Mar 10 16:12:02 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 11 07:44:03 2021 +0100

and fix logerrit on linux again

after I broke it with
commit 69959235c3094b811406f734e863a63fc61046c0
Date:   Tue Mar 9 19:29:19 2021 +0200
adapt recent change to macOS

Change-Id: Ib58e9903839143fdf6e84a04d532f70a8212f984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112269
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/logerrit b/logerrit
index fc30f918c17c..35a454c9267f 100755
--- a/logerrit
+++ b/logerrit
@@ -24,7 +24,7 @@ submit() {
 fi
 
 if [ "$BRANCH" = "master" ]; then
-if [ "$unamestr" = 'Linux' ]; then
+if [[ "$(uname)" == *Linux* ]]; then
 WEEKOLDDATE=$(date --date="7 days ago" +%s)
 else
 WEEKOLDDATE=$(date -v7d +%s) # BSD equivalent
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source

2021-03-10 Thread Noel (via logerrit)
 svx/source/svdraw/svdobj.cxx |  138 +--
 1 file changed, 69 insertions(+), 69 deletions(-)

New commits:
commit 93b544d64bfaaa0ce9d9cb5e72969dbb6c08
Author: Noel 
AuthorDate: Wed Mar 10 11:03:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 10 14:50:38 2021 +0100

flatten SdrObject::getUnoShape

Change-Id: I1239dd809e6a86780df45f1870e00d988bb43ea7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112258
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index b1b0f7a6b21a..ce282769f997 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2833,82 +2833,82 @@ css::uno::Reference< css::uno::XInterface > 
SdrObject::getUnoShape()
 {
 // try weak reference first
 uno::Reference< uno::XInterface > xShape( getWeakUnoShape() );
-if( !xShape.is() )
-{
-OSL_ENSURE( mpSvxShape == nullptr, "SdrObject::getUnoShape: XShape 
already dead, but still an IMPL pointer!" );
-
-// try to access SdrPage from this SdrObject. This will only exist if 
the SdrObject is
-// inserted in a SdrObjList (page/group/3dScene)
-SdrPage* pPageCandidate(getSdrPageFromSdrObject());
-
-// tdf#12152, tdf#120728
-//
-// With the paradigm change to only get a SdrPage for a SdrObject when 
the SdrObject
-// is *inserted*, the functionality for creating 1:1 associated UNO 
API implementation
-// SvxShapes was partially broken: The used ::CreateShape relies on 
the SvxPage being
-// derived and the CreateShape method overloaded, implementing 
additional SdrInventor
-// types as needed.
-//
-// The fallback to use SvxDrawPage::CreateShapeByTypeAndInventor is a 
trap: It's only
-// a static fallback that handles the SdrInventor types 
SdrInventor::E3d and
-// SdrInventor::Default. Due to that, e.g. the ReportDesigner broke in 
various conditions.
-//
-// That again has to do with the ReportDesigner being implemented 
using the UNO API
-// aspects of SdrObjects early during their construction, not just 
after these are
-// inserted to a SdrPage - but that is not illegal or wrong, the 
SdrObject exists already.
-//
-// As a current solution, use the (now always available) SdrModel and 
any of the
-// existing SdrPages. The only important thing is to get a SdrPage 
where ::CreateShape is
-// overloaded and implemented as needed.
-//
-// Note for the future:
-// In a more ideal world there would be only one factory method for 
creating SdrObjects (not
-// ::CreateShape and ::CreateShapeByTypeAndInventor). This also would 
not be placed at
-// SdrPage/SvxPage at all, but at the Model where it belongs - where 
else would you expect
-// objects for the current Model to be constructed? To have this at 
the Page only would make
-// sense if different shapes would need to be constructed for 
different Pages in the same Model
-// - this is never the case.
-// At that Model extended functionality for that factory (or overloads 
and implementations)
-// should be placed. But to be realistic, migrating the factories to 
Model now is too much
-// work - maybe over time when melting SdrObject/SvxObject one day...
-if(nullptr == pPageCandidate)
+if( xShape )
+return xShape;
+
+OSL_ENSURE( mpSvxShape == nullptr, "SdrObject::getUnoShape: XShape already 
dead, but still an IMPL pointer!" );
+
+// try to access SdrPage from this SdrObject. This will only exist if the 
SdrObject is
+// inserted in a SdrObjList (page/group/3dScene)
+SdrPage* pPageCandidate(getSdrPageFromSdrObject());
+
+// tdf#12152, tdf#120728
+//
+// With the paradigm change to only get a SdrPage for a SdrObject when the 
SdrObject
+// is *inserted*, the functionality for creating 1:1 associated UNO API 
implementation
+// SvxShapes was partially broken: The used ::CreateShape relies on the 
SvxPage being
+// derived and the CreateShape method overloaded, implementing additional 
SdrInventor
+// types as needed.
+//
+// The fallback to use SvxDrawPage::CreateShapeByTypeAndInventor is a 
trap: It's only
+// a static fallback that handles the SdrInventor types SdrInventor::E3d 
and
+// SdrInventor::Default. Due to that, e.g. the ReportDesigner broke in 
various conditions.
+//
+// That again has to do with the ReportDesigner being implemented using 
the UNO API
+// aspects of SdrObjects early during their construction, not just after 
these are
+// inserted to a SdrPage - but that is not illegal or wrong, the SdrObject 
exists already.
+//
+// As a current solution, use the (now always available) SdrModel and any 
of the
+// existing 

[Libreoffice-commits] core.git: vcl/source

2021-03-09 Thread Noel (via logerrit)
 vcl/source/edit/textundo.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3dfe1df0f1084b06c7d4c95df387253b2e058cd6
Author: Noel 
AuthorDate: Tue Mar 9 12:08:43 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 9 17:46:29 2021 +0100

this should be dynamic_cast

accidentally broken with
commit e4e80ed313882f9ea1b309054e5aa3e839586516
Date:   Sat Mar 6 20:40:58 2021 +0200
loplugin:staticdynamic now with extra salt

Change-Id: If5946d7f65eb51c9785e7ad2e6def0ebd56fd9cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112198
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx
index e7c2fe1c76aa..89dd0c50f316 100644
--- a/vcl/source/edit/textundo.cxx
+++ b/vcl/source/edit/textundo.cxx
@@ -273,7 +273,7 @@ void TextUndoInsertChars::Redo()
 
 bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
 {
-TextUndoInsertChars* pNext = 
static_cast(pNextAction);
+TextUndoInsertChars* pNext = 
dynamic_cast(pNextAction);
 if ( !pNext )
 return false;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source framework/source sc/source sd/source svx/source sw/source

2021-03-07 Thread Noel (via logerrit)
 filter/source/msfilter/svdfppt.cxx  |4 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |2 
 sc/source/ui/undo/areasave.cxx  |4 -
 sd/source/core/drawdoc.cxx  |   23 -
 sd/source/core/sdpage.cxx   |6 +-
 sd/source/ui/app/sdxfer.cxx |2 
 sd/source/ui/func/fupoor.cxx|8 +--
 sd/source/ui/func/futext.cxx|4 -
 sd/source/ui/view/sdview2.cxx   |8 +--
 svx/source/engine3d/view3d.cxx  |   19 ---
 svx/source/form/filtnav.cxx |   17 +++---
 svx/source/gallery2/galmisc.cxx |   40 
 svx/source/toolbars/fontworkbar.cxx |4 -
 sw/source/core/frmedt/feshview.cxx  |4 -
 sw/source/uibase/docvw/edtwin2.cxx  |2 
 15 files changed, 75 insertions(+), 72 deletions(-)

New commits:
commit c7b898df4d452746399621f6adc8e7da088f0f3a
Author: Noel 
AuthorDate: Sun Mar 7 18:41:56 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 8 07:40:01 2021 +0100

clean up some more dynamic/static casting

using a hacked version of the staticdynamic plugin
and some judgement

Change-Id: I5e6668b19320025e419f84bebceade4239577729
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112137
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index 462cefb3738b..c2c8b8b25070 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -778,12 +778,12 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, 
DffObjData& rObjData, Svx
 
 case PPT_PST_RecolorInfoAtom :
 {
-if ( auto pSdrGrafObj = dynamic_cast(pRet) )
+if ( auto pSdrGrafObj = dynamic_cast(pRet) )
 if ( pSdrGrafObj->HasGDIMetaFile() )
 {
 Graphic aGraphic( pSdrGrafObj->GetGraphic() );
 RecolorGraphic( rSt, aClientDataHd.nRecLen, 
aGraphic );
-static_cast(pRet)->SetGraphic( 
aGraphic );
+pSdrGrafObj->SetGraphic( aGraphic );
 }
 }
 break;
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx 
b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 36a91c9074f6..1f46f09e2274 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -965,7 +965,7 @@ void ToolbarLayoutManager::childWindowEvent( VclSimpleEvent 
const * pEvent )
 {
 if ( !implts_isToolbarCreationActive() )
 {
-ToolBox* pToolBox = getToolboxPtr( static_cast(pEvent)->GetWindow() );
+ToolBox* pToolBox = getToolboxPtr( pWindowEvent->GetWindow() );
 if ( pToolBox )
 {
 OUString aToolbarName = retrieveToolbarNameFromHelpURL( 
pToolBox );
diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx
index 3d50fba4f826..a46adae4017c 100644
--- a/sc/source/ui/undo/areasave.cxx
+++ b/sc/source/ui/undo/areasave.cxx
@@ -156,12 +156,12 @@ std::unique_ptr 
ScAreaLinkSaveCollection::CreateFromDo
 for (sal_uInt16 i=0; i( pBase) != nullptr)
+if (auto pAreaLink = dynamic_cast( pBase))
 {
 if (!pColl)
 pColl.reset(new ScAreaLinkSaveCollection);
 
-pColl->push_back( ScAreaLinkSaver( 
*static_cast(pBase ) ) );
+pColl->push_back( ScAreaLinkSaver( *pAreaLink ) );
 }
 }
 }
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index c257fa909ae2..48769e0b88da 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -887,19 +887,20 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, 
SdStyleSheetPool* pSPool
 }
 }
 
-if( dynamic_cast< const SdrTextObj *>( pObj ) !=  nullptr && 
pObj->IsEmptyPresObj())
-{
-PresObjKind ePresObjKind = pPage->GetPresObjKind(pObj);
-OUString aString( pPage->GetPresObjText(ePresObjKind) );
-
-if (!aString.isEmpty())
+if( auto pTextObj = dynamic_cast( pObj ) )
+if (pTextObj->IsEmptyPresObj())
 {
-SdOutliner* pInternalOutl = GetInternalOutliner();
-pPage->SetObjText( static_cast(pObj), 
pInternalOutl, ePresObjKind, aString );
-pObj->NbcSetStyleSheet( 

[Libreoffice-commits] core.git: accessibility/source canvas/source chart2/source compilerplugins/clang sc/source sd/source writerfilter/source

2021-03-07 Thread Noel (via logerrit)
 accessibility/source/standard/vclxaccessibletoolbox.cxx  |4 
 canvas/source/opengl/ogl_canvashelper.cxx|3 
 chart2/source/controller/main/ChartController_Window.cxx |6 -
 compilerplugins/clang/refcounting.cxx|   72 +--
 compilerplugins/clang/test/refcounting.cxx   |   22 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |3 
 sd/source/ui/dlg/sdtreelb.cxx|3 
 writerfilter/source/ooxml/OOXMLFastHelper.hxx|6 -
 8 files changed, 104 insertions(+), 15 deletions(-)

New commits:
commit 04e7a34a19b3658de57c4f2b3b0fa8445b01f199
Author: Noel 
AuthorDate: Fri Mar 5 15:51:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 8 07:37:26 2021 +0100

loplugin:refcounting check for one more case

where we might be holding something newly created by pointer
instead of by *::Reference

Change-Id: Ife6f7acae4252bf56dcdeb95d72e43c523444f97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112138
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx 
b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index acd2c4f18899..a04685730c85 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -593,8 +593,8 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const 
VclWindowEvent& rVclWindow
 if ( pWin && pWin->GetParent() &&
  pWin->GetParent()->GetType() == WindowType::TOOLBOX )
 {
-VCLXAccessibleToolBox* pParent = static_cast< 
VCLXAccessibleToolBox* >(
-
pWin->GetParent()->GetAccessible()->getAccessibleContext().get() );
+auto pParentAccContext = 
pWin->GetParent()->GetAccessible()->getAccessibleContext();
+VCLXAccessibleToolBox* pParent = static_cast< 
VCLXAccessibleToolBox* >( pParentAccContext.get() );
 if ( pParent )
 pParent->ReleaseSubToolBox(static_cast(pWin.get()));
 }
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx 
b/canvas/source/opengl/ogl_canvashelper.cxx
index d64e1ba1d7f0..0484f710ae53 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -679,7 +679,8 @@ namespace oglcanvas
 ScopedVclPtrInstance< VirtualDevice > pVDev;
 pVDev->EnableOutput(false);
 
-CanvasFont* 
pFont=dynamic_cast(xLayoutetText->getFont().get());
+auto pLayoutFont = xLayoutetText->getFont();
+CanvasFont* pFont=dynamic_cast(pLayoutFont.get());
 const rendering::StringContext& rTxt=xLayoutetText->getText();
 if( pFont && rTxt.Length )
 {
diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index a8d71e903fd3..afd4de8a5e75 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -863,7 +863,8 @@ void ChartController::execute_MouseButtonUp( const 
MouseEvent& rMEvt )
 m_xUndoManager );
 
 bool bChanged = false;
-ChartModel* pModel = 
dynamic_cast(getModel().get());
+css::uno::Reference< css::frame::XModel > xModel = 
getModel();
+ChartModel* pModel = 
dynamic_cast(xModel.get());
 assert(pModel);
 if ( eObjectType == OBJECTTYPE_LEGEND )
 bChanged = 
DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, false , 
true );
@@ -2090,7 +2091,8 @@ void ChartController::sendPopupRequest(OUString const & 
rCID, tools::Rectangle a
 
 OUString sPivotTableName = xPivotTableDataProvider->getPivotTableName();
 
-PopupRequest* pPopupRequest = 
dynamic_cast(pChartModel->getPopupRequest().get());
+css::uno::Reference xPopupRequest = 
pChartModel->getPopupRequest();
+PopupRequest* pPopupRequest = 
dynamic_cast(xPopupRequest.get());
 if (!pPopupRequest)
 return;
 
diff --git a/compilerplugins/clang/refcounting.cxx 
b/compilerplugins/clang/refcounting.cxx
index 319a23b83a9b..9157a1910add 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -73,6 +73,7 @@ private:
const RecordDecl* parent, const std::string& 
rDeclName);
 
 bool visitTemporaryObjectExpr(Expr const * expr);
+bool isCastingReference(const Expr* expr);
 };
 
 bool containsXInterfaceSubclass(const clang::Type* pType0);
@@ -693,6 +694,56 @@ bool RefCounting::VisitVarDecl(const VarDecl * varDecl) {
 << pointeeType
 << varDecl->getSourceRange();
 }
+

[Libreoffice-commits] core.git: basctl/source chart2/source cui/source filter/source include/filter include/svx reportdesign/inc reportdesign/source sc/inc sc/source sd/inc sd/qa sd/source svx/inc svx

2021-03-07 Thread Noel (via logerrit)
 basctl/source/dlged/dlgedmod.cxx  |5 
 basctl/source/dlged/dlgedpage.cxx |6 
 basctl/source/inc/dlgedmod.hxx|2 
 basctl/source/inc/dlgedpage.hxx   |2 
 chart2/source/controller/drawinglayer/ViewElementListProvider.cxx |6 
 cui/source/tabpages/tpline.cxx|   12 -
 filter/source/msfilter/svdfppt.cxx|4 
 include/filter/msfilter/svdfppt.hxx   |2 
 include/svx/connctrl.hxx  |2 
 include/svx/dlgctl3d.hxx  |2 
 include/svx/fmmodel.hxx   |6 
 include/svx/fmpage.hxx|2 
 include/svx/svdmodel.hxx  |   10 
 include/svx/svdpage.hxx   |6 
 include/svx/svdundo.hxx   |7 
 reportdesign/inc/RptModel.hxx |4 
 reportdesign/inc/RptPage.hxx  |2 
 reportdesign/source/core/sdr/RptModel.cxx |   12 -
 reportdesign/source/core/sdr/RptPage.cxx  |4 
 sc/inc/drawpage.hxx   |2 
 sc/inc/drwlayer.hxx   |2 
 sc/source/core/data/drawpage.cxx  |4 
 sc/source/core/data/drwlayer.cxx  |6 
 sc/source/ui/view/notemark.cxx|4 
 sd/inc/drawdoc.hxx|8 
 sd/inc/sdpage.hxx |2 
 sd/inc/undo/undoobjects.hxx   |9 
 sd/qa/unit/uimpress.cxx   |9 
 sd/source/core/drawdoc.cxx|4 
 sd/source/core/drawdoc2.cxx   |   60 ++---
 sd/source/core/drawdoc3.cxx   |   40 +--
 sd/source/core/sdpage2.cxx|4 
 sd/source/core/stlfamily.cxx  |   16 -
 sd/source/core/undo/undoobjects.cxx   |   34 +--
 sd/source/filter/ppt/pptin.cxx|   51 ++---
 sd/source/ui/dlg/animobjs.cxx |4 
 sd/source/ui/func/fuexpand.cxx|8 
 sd/source/ui/func/fusumry.cxx |8 
 sd/source/ui/inc/DrawController.hxx   |4 
 sd/source/ui/sidebar/DocumentHelper.cxx   |   20 -
 sd/source/ui/unoidl/DrawController.cxx|   11 -
 sd/source/ui/unoidl/unomodel.cxx  |   34 +--
 sd/source/ui/view/outlview.cxx|   10 
 sd/source/ui/view/sdview3.cxx |4 
 svx/inc/sdr/contact/objectcontactofobjlistpainter.hxx |8 
 svx/source/dialog/connctrl.cxx|   28 +-
 svx/source/dialog/dlgctl3d.cxx|   15 -
 svx/source/dialog/graphctl.cxx|4 
 svx/source/form/fmmodel.cxx   |   10 
 svx/source/form/fmpage.cxx|6 
 svx/source/gallery2/galobj.cxx|2 
 svx/source/sdr/contact/objectcontactofobjlistpainter.cxx  |2 
 svx/source/svdraw/svdmodel.cxx|   62 ++
 svx/source/svdraw/svdpage.cxx |5 
 svx/source/svdraw/svdundo.cxx |  102 
--
 svx/source/svdraw/svdxcgv.cxx |4 
 svx/source/unodraw/unomod.cxx |4 
 svx/source/unogallery/unogaltheme.cxx |4 
 sw/inc/dpage.hxx  |2 
 sw/inc/drawdoc.hxx|2 
 sw/source/core/doc/DocumentDrawModelManager.cxx   |6 
 sw/source/core/doc/doclay.cxx |5 
 sw/source/core/draw/dpage.cxx |4 
 sw/source/core/draw/drawdoc.cxx   |4 
 sw/source/core/frmedt/feshview.cxx|5 
 65 files changed, 354 insertions(+), 384 deletions(-)

New commits:
commit 

[Libreoffice-commits] core.git: compilerplugins/clang sc/source starmath/source svx/source sw/source vcl/source

2021-03-07 Thread Noel (via logerrit)
 compilerplugins/clang/staticdynamic.cxx  |   26 ++
 compilerplugins/clang/test/staticdynamic.cxx |   10 +-
 sc/source/core/tool/interpr4.cxx |9 +++--
 starmath/source/edit.cxx |5 ++---
 svx/source/engine3d/view3d.cxx   |5 +++--
 svx/source/form/fmview.cxx   |6 +++---
 svx/source/form/navigatortree.cxx|8 
 svx/source/sidebar/SelectionAnalyzer.cxx |8 
 svx/source/svdraw/svdmrkv.cxx|3 ++-
 svx/source/unodraw/UnoGraphicExporter.cxx|6 +++---
 sw/source/core/access/acccontext.cxx |8 ++--
 sw/source/core/access/accdoc.cxx |4 +---
 sw/source/core/access/accframebase.cxx   |3 +--
 sw/source/core/access/accpara.cxx|3 +--
 sw/source/core/doc/docfly.cxx|9 -
 sw/source/core/docnode/section.cxx   |   14 +++---
 sw/source/core/layout/frmtool.cxx|7 ---
 sw/source/core/layout/layact.cxx |   12 ++--
 sw/source/core/text/txtftn.cxx   |5 +++--
 sw/source/uibase/uiview/viewdraw.cxx |   21 +++--
 vcl/source/edit/textundo.cxx |5 ++---
 21 files changed, 97 insertions(+), 80 deletions(-)

New commits:
commit e4e80ed313882f9ea1b309054e5aa3e839586516
Author: Noel 
AuthorDate: Sat Mar 6 20:40:58 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Mar 7 13:22:28 2021 +0100

loplugin:staticdynamic now with extra salt

because it wasn't quite there yet - now checks for casts with and
without const, because const doesn't really matter here.

Change-Id: I319025b2095a803fcaad2a7a696d2730b7fd2f81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112098
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/staticdynamic.cxx 
b/compilerplugins/clang/staticdynamic.cxx
index b104b0333fcd..7f3d2bd49aed 100644
--- a/compilerplugins/clang/staticdynamic.cxx
+++ b/compilerplugins/clang/staticdynamic.cxx
@@ -80,6 +80,18 @@ bool StaticDynamic::TraverseCompoundStmt(CompoundStmt* 
compoundStmt)
 return ret;
 }
 
+const clang::Type* strip(QualType qt)
+{
+const clang::Type* varType = qt->getUnqualifiedDesugaredType();
+if (varType->isPointerType())
+varType = varType->getPointeeType()->getUnqualifiedDesugaredType();
+if (varType->isReferenceType())
+varType = varType->getAs()
+  ->getPointeeType()
+  ->getUnqualifiedDesugaredType();
+return varType;
+}
+
 bool StaticDynamic::VisitCXXStaticCastExpr(CXXStaticCastExpr const* 
staticCastExpr)
 {
 if (ignoreLocation(staticCastExpr))
@@ -90,8 +102,8 @@ bool StaticDynamic::VisitCXXStaticCastExpr(CXXStaticCastExpr 
const* staticCastEx
 auto varDecl = dyn_cast_or_null(subExprDecl->getDecl());
 if (!varDecl)
 return true;
-auto it = blockState.dynamicCastVars.find(
-{ varDecl, staticCastExpr->getTypeAsWritten().getTypePtr() });
+auto varType = strip(staticCastExpr->getType());
+auto it = blockState.dynamicCastVars.find({ varDecl, varType });
 if (it != blockState.dynamicCastVars.end())
 {
 StringRef fn = getFilenameOfLocation(
@@ -110,8 +122,7 @@ bool 
StaticDynamic::VisitCXXStaticCastExpr(CXXStaticCastExpr const* staticCastEx
 report(DiagnosticsEngine::Note, "dynamic_cast here", it->second);
 return true;
 }
-blockState.staticCastVars.insert({ { varDecl, 
staticCastExpr->getTypeAsWritten().getTypePtr() },
-   compat::getBeginLoc(staticCastExpr) });
+blockState.staticCastVars.insert({ { varDecl, varType }, 
compat::getBeginLoc(staticCastExpr) });
 return true;
 }
 
@@ -126,8 +137,8 @@ bool 
StaticDynamic::VisitCXXDynamicCastExpr(CXXDynamicCastExpr const* dynamicCas
 auto varDecl = dyn_cast_or_null(subExprDecl->getDecl());
 if (!varDecl)
 return true;
-auto it = blockState.staticCastVars.find(
-{ varDecl, dynamicCastExpr->getTypeAsWritten().getTypePtr() });
+auto varType = strip(dynamicCastExpr->getTypeAsWritten());
+auto it = blockState.staticCastVars.find({ varDecl, varType });
 if (it != blockState.staticCastVars.end())
 {
 report(DiagnosticsEngine::Warning, "dynamic_cast after static_cast",
@@ -145,8 +156,7 @@ bool 
StaticDynamic::VisitCXXDynamicCastExpr(CXXDynamicCastExpr const* dynamicCas
 return true;
 }
 blockState.dynamicCastVars.insert(
-{ { varDecl, dynamicCastExpr->getTypeAsWritten().getTypePtr() },
-  compat::getBeginLoc(dynamicCastExpr) });
+{ { varDecl, varType }, compat::getBeginLoc(dynamicCastExpr) });
 return true;
 }
 
diff --git a/compilerplugins/clang/test/staticdynamic.cxx 
b/compilerplugins/clang/test/staticdynamic.cxx
index d700ea06c435..aa6ca7559b6b 

[Libreoffice-commits] core.git: compilerplugins/clang sd/source sfx2/source svx/source sw/source

2021-03-06 Thread Noel (via logerrit)
 compilerplugins/clang/staticdynamic.cxx  |   64 +++
 compilerplugins/clang/test/staticdynamic.cxx |8 ++
 sd/source/ui/accessibility/AccessibleOutlineView.cxx |3 
 sd/source/ui/unoidl/unoobj.cxx   |5 -
 sd/source/ui/view/drviews6.cxx   |9 --
 sfx2/source/control/unoctitm.cxx |6 -
 sfx2/source/doc/objxtor.cxx  |5 +
 sfx2/source/toolbox/tbxitem.cxx  |7 +-
 svx/source/svdraw/svdedtv.cxx|   14 +---
 svx/source/svdraw/svdedtv2.cxx   |5 +
 sw/source/core/access/accmap.cxx |6 -
 sw/source/core/doc/doclay.cxx|   16 ++--
 sw/source/core/draw/dview.cxx|3 
 sw/source/core/frmedt/fews.cxx   |5 -
 14 files changed, 102 insertions(+), 54 deletions(-)

New commits:
commit bd37588605f7773d41b5388b18952e5c90f12214
Author: Noel 
AuthorDate: Fri Mar 5 08:37:41 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 6 13:08:26 2021 +0100

loplugin:staticdynamic look for static after dynamic

Change-Id: Ic3066d9a9441e369370cc6aa0fbffb9a321bc928
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111985
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/staticdynamic.cxx 
b/compilerplugins/clang/staticdynamic.cxx
index b2383413b287..b104b0333fcd 100644
--- a/compilerplugins/clang/staticdynamic.cxx
+++ b/compilerplugins/clang/staticdynamic.cxx
@@ -45,22 +45,26 @@ public:
 
 private:
 // the key is the pair of VarDecl and the type being cast to.
-typedef std::map, 
SourceLocation> MapType;
-MapType staticCastVars;
+struct BlockState
+{
+std::map, 
SourceLocation> staticCastVars;
+std::map, 
SourceLocation> dynamicCastVars;
+};
 // only maintain state inside a single basic block, we're not trying to 
analyse
 // cross-block interactions.
-std::vector blockStack;
+std::vector blockStack;
+BlockState blockState;
 };
 
 bool StaticDynamic::PreTraverseCompoundStmt(CompoundStmt*)
 {
-blockStack.push_back(std::move(staticCastVars));
+blockStack.push_back(std::move(blockState));
 return true;
 }
 
 bool StaticDynamic::PostTraverseCompoundStmt(CompoundStmt*, bool)
 {
-staticCastVars = std::move(blockStack.back());
+blockState = std::move(blockStack.back());
 blockStack.pop_back();
 return true;
 }
@@ -86,8 +90,28 @@ bool StaticDynamic::VisitCXXStaticCastExpr(CXXStaticCastExpr 
const* staticCastEx
 auto varDecl = dyn_cast_or_null(subExprDecl->getDecl());
 if (!varDecl)
 return true;
-staticCastVars.insert({ { varDecl, 
staticCastExpr->getTypeAsWritten().getTypePtr() },
-compat::getBeginLoc(staticCastExpr) });
+auto it = blockState.dynamicCastVars.find(
+{ varDecl, staticCastExpr->getTypeAsWritten().getTypePtr() });
+if (it != blockState.dynamicCastVars.end())
+{
+StringRef fn = getFilenameOfLocation(
+
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(staticCastExpr)));
+// loop
+if (loplugin::isSamePathname(fn, SRCDIR 
"/basctl/source/basicide/basobj3.cxx"))
+return true;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/sw/source/core/doc/swserv.cxx"))
+return true;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/sw/source/core/text/txtfly.cxx"))
+return true;
+
+report(DiagnosticsEngine::Warning, "static_cast after dynamic_cast",
+   compat::getBeginLoc(staticCastExpr))
+<< staticCastExpr->getSourceRange();
+report(DiagnosticsEngine::Note, "dynamic_cast here", it->second);
+return true;
+}
+blockState.staticCastVars.insert({ { varDecl, 
staticCastExpr->getTypeAsWritten().getTypePtr() },
+   compat::getBeginLoc(staticCastExpr) });
 return true;
 }
 
@@ -102,13 +126,27 @@ bool 
StaticDynamic::VisitCXXDynamicCastExpr(CXXDynamicCastExpr const* dynamicCas
 auto varDecl = dyn_cast_or_null(subExprDecl->getDecl());
 if (!varDecl)
 return true;
-auto it = staticCastVars.find({ varDecl, 
dynamicCastExpr->getTypeAsWritten().getTypePtr() });
-if (it == staticCastVars.end())
+auto it = blockState.staticCastVars.find(
+{ varDecl, dynamicCastExpr->getTypeAsWritten().getTypePtr() });
+if (it != blockState.staticCastVars.end())
+{
+report(DiagnosticsEngine::Warning, "dynamic_cast after static_cast",
+   compat::getBeginLoc(dynamicCastExpr))
+<< dynamicCastExpr->getSourceRange();
+report(DiagnosticsEngine::Note, "static_cast here", it->second);
 return true;
-report(DiagnosticsEngine::Warning, "dynamic_cast after static_cast",
-   

[Libreoffice-commits] core.git: compilerplugins/clang dbaccess/source

2021-03-04 Thread Noel (via logerrit)
 compilerplugins/clang/refcounting.cxx|   29 +++
 compilerplugins/clang/test/refcounting.cxx   |   12 +++
 dbaccess/source/core/dataaccess/databasedocument.hxx |2 -
 3 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit 5146d482a20494069670496786a1ba3037e979ce
Author: Noel 
AuthorDate: Wed Feb 24 15:44:52 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 5 08:09:21 2021 +0100

loplugin:refcounting return objects properly

check that when we return ref-counted objects, we do so using
rtl::Reference, so that the object actually has a non-zero
ref count.

Change-Id: Ib3ffae0d2502f6d117550c82fde5449729c27324
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111487
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/refcounting.cxx 
b/compilerplugins/clang/refcounting.cxx
index 7f1d7f38fba8..319a23b83a9b 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -58,6 +58,7 @@ public:
 bool VisitTypeLoc(clang::TypeLoc typeLoc);
 bool VisitCXXDeleteExpr(const CXXDeleteExpr *);
 bool VisitBinaryOperator(const BinaryOperator *);
+bool VisitReturnStmt(const ReturnStmt *);
 
 // Creation of temporaries with one argument are represented by
 // CXXFunctionalCastExpr, while any other number of arguments are
@@ -520,6 +521,7 @@ bool RefCounting::VisitCXXDeleteExpr(const CXXDeleteExpr * 
cxxDeleteExpr)
 }
 return true;
 }
+
 bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
 if (ignoreLocation(fieldDecl)) {
 return true;
@@ -599,6 +601,33 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * 
fieldDecl) {
 return true;
 }
 
+bool RefCounting::VisitReturnStmt(const ReturnStmt * returnStmt) {
+if (ignoreLocation(returnStmt)) {
+return true;
+}
+
+if (!returnStmt->getRetValue())
+return true;
+auto cxxNewExpr = 
dyn_cast(compat::IgnoreImplicit(returnStmt->getRetValue()));
+if (!cxxNewExpr)
+return true;
+
+auto qt = returnStmt->getRetValue()->getType();
+if (!qt->isPointerType())
+return false;
+qt = qt->getPointeeType();
+
+if (containsOWeakObjectSubclass(qt)) {
+report(
+DiagnosticsEngine::Warning,
+"new object of cppu::OWeakObject subclass %0 being returned via 
raw pointer, should be returned by via rtl::Reference",
+compat::getBeginLoc(returnStmt))
+<< qt
+<< returnStmt->getSourceRange();
+}
+
+return true;
+}
 
 bool RefCounting::VisitVarDecl(const VarDecl * varDecl) {
 if (ignoreLocation(varDecl))
diff --git a/compilerplugins/clang/test/refcounting.cxx 
b/compilerplugins/clang/test/refcounting.cxx
index ca27ac0614a7..4c133023b0b8 100644
--- a/compilerplugins/clang/test/refcounting.cxx
+++ b/compilerplugins/clang/test/refcounting.cxx
@@ -18,6 +18,7 @@ namespace cppu
 {
 class OWeakObject
 {
+public:
 void acquire();
 void release();
 };
@@ -83,4 +84,15 @@ void foo4()
 p = new UnoObject;
 }
 
+UnoObject* foo5()
+{
+// expected-error@+1 {{new object of cppu::OWeakObject subclass 
'UnoObject' being returned via raw pointer, should be returned by via 
rtl::Reference [loplugin:refcounting]}}
+return new UnoObject;
+}
+rtl::Reference foo6()
+{
+// no warning expected
+return new UnoObject;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx 
b/dbaccess/source/core/dataaccess/databasedocument.hxx
index 6ce35092ea5b..d4deb94b2186 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.hxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.hxx
@@ -286,7 +286,7 @@ protected:
 
 public:
 struct FactoryAccess { friend class ODatabaseModelImpl; private: 
FactoryAccess() { } };
-static ODatabaseDocument* createDatabaseDocument( const 
::rtl::Reference& _pImpl, FactoryAccess /*accessControl*/ )
+static rtl::Reference createDatabaseDocument( const 
::rtl::Reference& _pImpl, FactoryAccess /*accessControl*/ )
 {
 return new ODatabaseDocument( _pImpl );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - include/xmloff xmloff/source

2021-03-03 Thread Noel (via logerrit)
 include/xmloff/xmlictxt.hxx   |4 
 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |3 +--
 xmloff/source/core/xmlimp.cxx |   11 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit fed3ed5828eda88f82d97e95b34dfdd1ca0c9dec
Author: Noel 
AuthorDate: Fri Feb 12 13:02:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 4 07:46:05 2021 +0100

restore namespace unwinding in SvXMLImport

accidentally lost during the fastparser conversion

Change-Id: I7d53e9f32dd8cff650b9ffb6dae493419ce8461f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110813
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit e5f436bc53e0d07654901ef7cc8ff56d04f0686e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111897

diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx
index 82f4c11632f1..3e6f25329d98 100644
--- a/include/xmloff/xmlictxt.hxx
+++ b/include/xmloff/xmlictxt.hxx
@@ -53,6 +53,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public 
css::xml::sax::XFastContextHa
 oslInterlockedCountm_nRefCount;
 sal_uInt16 mnPrefix;
 bool   mbPrefixAndLocalNameFilledIn;
+std::unique_ptr m_pRewindMap;
+
+SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return 
std::move(m_pRewindMap); }
+SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr p) { 
m_pRewindMap = std::move(p); }
 
 protected:
 
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx 
b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index a8cc84392627..5f6073d171bc 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -82,8 +82,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLEmbeddedObjectImpor
 sal_Int32 ,
 const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
-// we carry no state, so just re-use the same instance
-return this;
+return new XMLEmbeddedObjectImportContext_Impl(GetImport(), mxFastHandler);
 }
 
 void XMLEmbeddedObjectImportContext_Impl::startFastElement(
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index c47ad94ceffa..4a8241e4ea69 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -765,7 +765,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 
Element,
 maNamespaceAttrList->Clear();
 
 maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList );
-processNSAttributes( maNamespaceAttrList.get() );
+std::unique_ptr pRewindMap = processNSAttributes( 
maNamespaceAttrList.get() );
 
 SvXMLImportContextRef xContext;
 const bool bRootContext = maContexts.empty();
@@ -828,6 +828,10 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 
Element,
 if ( !xContext )
 xContext.set( new SvXMLImportContext( *this ) );
 
+// Remember old namespace map.
+if( pRewindMap )
+xContext->PutRewindMap(std::move(pRewindMap));
+
 // Call a startElement at the new context.
 xContext->startFastElement( Element, Attribs );
 
@@ -917,8 +921,13 @@ void SAL_CALL SvXMLImport::endFastElement (sal_Int32 
Element)
 return;
 }
 SvXMLImportContextRef xContext = std::move(maContexts.top());
+// Get a namespace map to rewind.
+std::unique_ptr pRewindMap = xContext->TakeRewindMap();
 maContexts.pop();
 xContext->endFastElement( Element );
+// Rewind a namespace map.
+if (pRewindMap)
+mpNamespaceMap = std::move(pRewindMap);
 }
 
 void SAL_CALL SvXMLImport::endUnknownElement (const OUString & rPrefix, const 
OUString & rLocalName)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/qt5 vcl/unx

2021-03-03 Thread Noel (via logerrit)
 vcl/inc/qt5/Qt5Instance.hxx|2 +-
 vcl/qt5/Qt5Instance.cxx|4 ++--
 vcl/unx/kf5/KF5SalInstance.cxx |4 ++--
 vcl/unx/kf5/KF5SalInstance.hxx |5 +++--
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 9b56b718f6921b1160733e56f5cfc0d12c4146ab
Author: Noel 
AuthorDate: Mon Mar 1 20:36:56 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 3 11:09:15 2021 +0100

loplugin:refcounting in vcl

Change-Id: I92e9db7abdfe5912335fd94e42422e8556d71091
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111769
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index cd9c51826a90..8cfa9ac960f1 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -80,7 +80,7 @@ Q_SIGNALS:
 void deleteObjectLaterSignal(QObject* pObject);
 
 protected:
-virtual Qt5FilePicker*
+virtual rtl::Reference
 createPicker(css::uno::Reference const& 
context,
  QFileDialog::FileMode);
 
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 97eff04fe77a..5afbd8722418 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -437,14 +437,14 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent)
 aEvent.m_pFrame->CallCallback(aEvent.m_nEvent, aEvent.m_pData);
 }
 
-Qt5FilePicker*
+rtl::Reference
 Qt5Instance::createPicker(css::uno::Reference 
const& context,
   QFileDialog::FileMode eMode)
 {
 if (!IsMainThread())
 {
 SolarMutexGuard g;
-Qt5FilePicker* pPicker;
+rtl::Reference pPicker;
 RunInMainThread([&, this]() { pPicker = createPicker(context, eMode); 
});
 assert(pPicker);
 return pPicker;
diff --git a/vcl/unx/kf5/KF5SalInstance.cxx b/vcl/unx/kf5/KF5SalInstance.cxx
index 5b95ff8df572..4c1a87730e51 100644
--- a/vcl/unx/kf5/KF5SalInstance.cxx
+++ b/vcl/unx/kf5/KF5SalInstance.cxx
@@ -57,14 +57,14 @@ bool KF5SalInstance::hasNativeFileSelection() const
 return Qt5Instance::hasNativeFileSelection();
 }
 
-Qt5FilePicker*
+rtl::Reference
 KF5SalInstance::createPicker(css::uno::Reference 
const& context,
  QFileDialog::FileMode eMode)
 {
 if (!IsMainThread())
 {
 SolarMutexGuard g;
-Qt5FilePicker* pPicker;
+rtl::Reference pPicker;
 RunInMainThread([&, this]() { pPicker = createPicker(context, eMode); 
});
 assert(pPicker);
 return pPicker;
diff --git a/vcl/unx/kf5/KF5SalInstance.hxx b/vcl/unx/kf5/KF5SalInstance.hxx
index 5dd306da5231..b462e147003d 100644
--- a/vcl/unx/kf5/KF5SalInstance.hxx
+++ b/vcl/unx/kf5/KF5SalInstance.hxx
@@ -24,8 +24,9 @@
 class KF5SalInstance final : public Qt5Instance
 {
 bool hasNativeFileSelection() const override;
-Qt5FilePicker* 
createPicker(css::uno::Reference const& context,
-QFileDialog::FileMode) override;
+rtl::Reference
+createPicker(css::uno::Reference const& 
context,
+ QFileDialog::FileMode) override;
 
 SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) 
override;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/inc sd/source

2021-03-03 Thread Noel (via logerrit)
 sd/inc/stlsheet.hxx  |2 +-
 sd/source/core/stlfamily.cxx |2 +-
 sd/source/core/stlsheet.cxx  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fd91c4937b942f7e28a1b6a30afddfb2abadfcf1
Author: Noel 
AuthorDate: Tue Mar 2 09:23:06 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 3 09:33:29 2021 +0100

loplugin:refcounting in sd

Change-Id: I5e259fc7028b75910efd6a99ed445690a9c496ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111803
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx
index dc32df9fa5eb..b6b693d4f937 100644
--- a/sd/inc/stlsheet.hxx
+++ b/sd/inc/stlsheet.hxx
@@ -72,7 +72,7 @@ public:
 
 static OUString GetFamilyString( SfxStyleFamily eFamily );
 
-static SdStyleSheet* CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, 
SfxStyleFamily eFamily );
+static rtl::Reference CreateEmptyUserStyle( 
SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily );
 
 //Broadcast that a SdStyleSheet has changed, taking into account outline 
sublevels
 //which need to be explicitly broadcast as changing if their parent style 
was
diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx
index 8e9150a292ef..164fb7814b41 100644
--- a/sd/source/core/stlfamily.cxx
+++ b/sd/source/core/stlfamily.cxx
@@ -429,7 +429,7 @@ Reference< XInterface > SAL_CALL 
SdStyleFamily::createInstance()
 throw IllegalAccessException();
 }
 return Reference(
-static_cast(SdStyleSheet::CreateEmptyUserStyle(*mxPool, 
mnFamily)));
+static_cast(SdStyleSheet::CreateEmptyUserStyle(*mxPool, 
mnFamily).get()));
 }
 
 Reference< XInterface > SAL_CALL SdStyleFamily::createInstanceWithArguments( 
const Sequence< Any >&  )
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 270b1c5d63b7..a470ff28c4f1 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -675,7 +675,7 @@ void SdStyleSheet::throwIfDisposed()
 throw DisposedException();
 }
 
-SdStyleSheet* SdStyleSheet::CreateEmptyUserStyle( SfxStyleSheetBasePool& 
rPool, SfxStyleFamily eFamily )
+rtl::Reference SdStyleSheet::CreateEmptyUserStyle( 
SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily )
 {
 OUString aName;
 sal_Int32 nIndex = 1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/inc sc/source

2021-03-02 Thread Noel (via logerrit)
 sc/inc/afmtuno.hxx  |6 +++---
 sc/inc/cellsuno.hxx |2 +-
 sc/inc/chartuno.hxx |4 ++--
 sc/inc/dapiuno.hxx  |8 
 sc/inc/datauno.hxx  |6 +++---
 sc/inc/docuno.hxx   |   16 
 sc/inc/linkuno.hxx  |   10 +-
 sc/inc/nameuno.hxx  |   14 +++---
 sc/inc/styleuno.hxx |   10 +-
 sc/inc/viewuno.hxx  |2 +-
 sc/source/ui/Accessibility/AccessibleCsvControl.cxx |2 +-
 sc/source/ui/inc/AccessibleCsvControl.hxx   |2 +-
 sc/source/ui/unoobj/afmtuno.cxx |6 +++---
 sc/source/ui/unoobj/cellsuno.cxx|2 +-
 sc/source/ui/unoobj/chartuno.cxx|4 ++--
 sc/source/ui/unoobj/dapiuno.cxx |8 
 sc/source/ui/unoobj/datauno.cxx |6 +++---
 sc/source/ui/unoobj/docuno.cxx  |   20 ++--
 sc/source/ui/unoobj/linkuno.cxx |   10 +-
 sc/source/ui/unoobj/nameuno.cxx |   10 +-
 sc/source/ui/unoobj/styleuno.cxx|   10 +-
 sc/source/ui/unoobj/viewuno.cxx |2 +-
 sc/source/ui/vba/vbarange.cxx   |2 +-
 sc/source/ui/vba/vbasheetobjects.cxx|6 +++---
 24 files changed, 84 insertions(+), 84 deletions(-)

New commits:
commit 4adfd75021d50e8e91c71bbe1526a1c752343059
Author: Noel 
AuthorDate: Tue Mar 2 09:20:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 3 07:36:59 2021 +0100

loplugin:refcounting in sc

Change-Id: I0b808785e54bf1dfc9387a649aacf731b2f34d12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111801
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/inc/afmtuno.hxx b/sc/inc/afmtuno.hxx
index f3d9ba2a3d20..f005773d9c91 100644
--- a/sc/inc/afmtuno.hxx
+++ b/sc/inc/afmtuno.hxx
@@ -45,8 +45,8 @@ class ScAutoFormatsObj final : public ::cppu::WeakImplHelper<
 css::lang::XServiceInfo >
 {
 private:
-static ScAutoFormatObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
-static ScAutoFormatObj* GetObjectByName_Impl(std::u16string_view aName);
+static rtl::Reference GetObjectByIndex_Impl(sal_uInt16 
nIndex);
+static rtl::Reference 
GetObjectByName_Impl(std::u16string_view aName);
 
 public:
 ScAutoFormatsObj();
@@ -96,7 +96,7 @@ private:
 SfxItemPropertySet  aPropSet;
 sal_uInt16  nFormatIndex;
 
-ScAutoFormatFieldObj*   GetObjectByIndex_Impl(sal_uInt16 nIndex);
+rtl::Reference GetObjectByIndex_Impl(sal_uInt16 
nIndex);
 
 public:
 ScAutoFormatObj(sal_uInt16 nIndex);
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index 3c19e9ff88de..87bca6b02a29 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -387,7 +387,7 @@ private:
 struct Impl;
 std::unique_ptr m_pImpl;
 
-ScCellRangeObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const;
+rtl::Reference GetObjectByIndex_Impl(sal_Int32 nIndex) 
const;
 
 public:
 ScCellRangesObj(ScDocShell* pDocSh, const 
ScRangeList& rR);
diff --git a/sc/inc/chartuno.hxx b/sc/inc/chartuno.hxx
index aac210fb1314..5a3ed1f1e2ac 100644
--- a/sc/inc/chartuno.hxx
+++ b/sc/inc/chartuno.hxx
@@ -50,8 +50,8 @@ private:
 ScDocShell* pDocShell;
 SCTAB   nTab;   // Charts are per sheet
 
-ScChartObj* GetObjectByIndex_Impl(tools::Long nIndex) const;
-ScChartObj* GetObjectByName_Impl(const OUString& aName) const;
+rtl::Reference GetObjectByIndex_Impl(tools::Long nIndex) const;
+rtl::Reference GetObjectByName_Impl(const OUString& aName) 
const;
 
 public:
 ScChartsObj(ScDocShell* pDocSh, SCTAB nT);
diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index c32c2d6bf01e..613d114128ff 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -87,8 +87,8 @@ private:
 ScDocShell* pDocShell;
 SCTAB   nTab;
 
-ScDataPilotTableObj*GetObjectByIndex_Impl( sal_Int32 nIndex );
-ScDataPilotTableObj*GetObjectByName_Impl(const OUString& aName);
+rtl::Reference GetObjectByIndex_Impl( sal_Int32 
nIndex );
+rtl::Reference GetObjectByName_Impl(const OUString& 
aName);
 
 public:
 ScDataPilotTablesObj(ScDocShell* pDocSh, SCTAB nT);
@@ -374,8 +374,8 @@ public:
 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
 private:
-ScDataPilotFieldObj*GetObjectByIndex_Impl( 

[Libreoffice-commits] core.git: sw/inc sw/source

2021-03-02 Thread Noel (via logerrit)
 sw/inc/unoparagraph.hxx  |2 +-
 sw/inc/unotextbodyhf.hxx |2 +-
 sw/inc/unotextrange.hxx  |2 +-
 sw/source/core/inc/unoparaframeenum.hxx  |2 +-
 sw/source/core/unocore/unoobj.cxx|4 ++--
 sw/source/core/unocore/unoobj2.cxx   |6 +++---
 sw/source/core/unocore/unotext.cxx   |6 +++---
 sw/source/ui/vba/vbaapplication.cxx  |2 +-
 sw/source/ui/vba/vbaapplication.hxx  |3 ++-
 sw/source/uibase/uno/SwXDocumentSettings.cxx |4 ++--
 sw/source/uibase/uno/unomod.cxx  |8 
 sw/source/uibase/uno/unotxdoc.cxx|4 ++--
 12 files changed, 23 insertions(+), 22 deletions(-)

New commits:
commit 5e4e39b2a3db18b5f06070d01d15b35576e4b2cc
Author: Noel 
AuthorDate: Tue Mar 2 09:22:44 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 2 20:47:18 2021 +0100

loplugin:refcounting in sw

Change-Id: I5d3768503effa002c4a308bfad30d9b56d5365f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111802
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx
index eb89ce47249e..dc4d22f896cd 100644
--- a/sw/inc/unoparagraph.hxx
+++ b/sw/inc/unoparagraph.hxx
@@ -212,7 +212,7 @@ public:
 struct SwXParagraphEnumeration
 : public SwSimpleEnumeration_Base
 {
-static SwXParagraphEnumeration* Create(
+static rtl::Reference Create(
 css::uno::Reference< css::text::XText > const & xParent,
 const std::shared_ptr& pCursor,
 const CursorType eType,
diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx
index 5b3c518e79b9..7bbffae58d20 100644
--- a/sw/inc/unotextbodyhf.hxx
+++ b/sw/inc/unotextbodyhf.hxx
@@ -48,7 +48,7 @@ public:
 
 SwXBodyText(SwDoc *const pDoc);
 
-SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false);
+rtl::Reference CreateTextCursor(const bool bIgnoreTables = 
false);
 
 // XInterface
 virtual css::uno::Any SAL_CALL queryInterface(
diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx
index 693595e76eef..f3ed06fb4a06 100644
--- a/sw/inc/unotextrange.hxx
+++ b/sw/inc/unotextrange.hxx
@@ -217,7 +217,7 @@ typedef ::cppu::WeakImplHelper
 struct SwXTextRanges : public SwXTextRanges_Base
 {
 virtual SwUnoCursor* GetCursor() =0;
-static SwXTextRanges* Create(SwPaM* const pCursor);
+static rtl::Reference Create(SwPaM* const pCursor);
 static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
 };
 
diff --git a/sw/source/core/inc/unoparaframeenum.hxx 
b/sw/source/core/inc/unoparaframeenum.hxx
index f68c55f6d317..017232c5a46b 100644
--- a/sw/source/core/inc/unoparaframeenum.hxx
+++ b/sw/source/core/inc/unoparaframeenum.hxx
@@ -69,7 +69,7 @@ enum ParaFrameMode
 struct SwXParaFrameEnumeration
 : public SwSimpleEnumeration_Base
 {
-static SwXParaFrameEnumeration* Create(const SwPaM& rPaM, const enum 
ParaFrameMode eParaFrameMode, SwFrameFormat* const pFormat = nullptr);
+static rtl::Reference Create(const SwPaM& rPaM, 
const enum ParaFrameMode eParaFrameMode, SwFrameFormat* const pFormat = 
nullptr);
 };
 
 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNOPARAFRAMEENUM_HXX
diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index 43d976a20dba..c5e67bac1ae4 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2082,9 +2082,9 @@ SwXTextCursor::getPropertySetInfo()
 m_pImpl->m_rPropSet.getPropertySetInfo();
 // extend PropertySetInfo!
 const uno::Sequence aPropSeq = xInfo->getProperties();
-return new SfxExtItemPropertySetInfo(
+return rtl::Reference(new 
SfxExtItemPropertySetInfo(
 aCursorExtMap_Impl,
-aPropSeq );
+aPropSeq ));
 }();
 return xRef;
 }
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index 6afc81076269..7f5cc2c6b0ad 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -446,7 +446,7 @@ struct SwXParagraphEnumerationImpl final : public 
SwXParagraphEnumeration
 
 }
 
-SwXParagraphEnumeration* SwXParagraphEnumeration::Create(
+rtl::Reference SwXParagraphEnumeration::Create(
 uno::Reference< text::XText > const& xParent,
 const std::shared_ptr& pCursor,
 const CursorType eType,
@@ -1606,7 +1606,7 @@ void SwXTextRangesImpl::MakeRanges()
 }
 }
 
-SwXTextRanges* SwXTextRanges::Create(SwPaM *const pPaM)
+rtl::Reference SwXTextRanges::Create(SwPaM *const pPaM)
 { return new SwXTextRangesImpl(pPaM); }
 
 namespace
@@ -1714,7 +1714,7 @@ struct SwXParaFrameEnumerationImpl final : public 
SwXParaFrameEnumeration
 
 }
 
-SwXParaFrameEnumeration* SwXParaFrameEnumeration::Create(const SwPaM& rPaM, 
const enum ParaFrameMode eParaFrameMode, SwFrameFormat* const pFormat)
+rtl::Reference SwXParaFrameEnumeration::Create(const 

[Libreoffice-commits] core.git: toolkit/inc toolkit/source

2021-03-02 Thread Noel (via logerrit)
 toolkit/inc/controls/geometrycontrolmodel.hxx  |7 ---
 toolkit/inc/controls/geometrycontrolmodel_impl.hxx |2 +-
 toolkit/source/controls/geometrycontrolmodel.cxx   |   10 --
 3 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 81cacf8dea7ca2fb7b0d6e86b36b9f9568ff849d
Author: Noel 
AuthorDate: Mon Mar 1 20:37:24 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 2 20:45:51 2021 +0100

loplugin:refcounting in toolkit

Change-Id: I7564951f3e3fdc0554de9a4af3833bc4f0facce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111770
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/toolkit/inc/controls/geometrycontrolmodel.hxx 
b/toolkit/inc/controls/geometrycontrolmodel.hxx
index 2d87f7cca2af..600e9592046f 100644
--- a/toolkit/inc/controls/geometrycontrolmodel.hxx
+++ b/toolkit/inc/controls/geometrycontrolmodel.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::resource { class XStringResourceResolver; }
 
@@ -144,7 +145,7 @@ namespace com::sun::star {
 SAL_CALL getEvents(  ) override;
 
 // XCloneable implementation - to be overwritten
-virtual OGeometryControlModel_Base* createClone_Impl(
+virtual rtl::Reference createClone_Impl(
 css::uno::Reference< css::util::XCloneable >& 
_rxAggregateInstance) = 0;
 
 // XComponent
@@ -190,7 +191,7 @@ namespace com::sun::star {
 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() 
override;
 
 // OGeometryControlModel_Base
-virtual OGeometryControlModel_Base* createClone_Impl(
+virtual rtl::Reference createClone_Impl(
 css::uno::Reference< css::util::XCloneable >& 
_rxAggregateInstance) override;
 
 // XTypeProvider
@@ -230,7 +231,7 @@ namespace com::sun::star {
 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() 
override;
 
 // OGeometryControlModel_Base
-virtual OGeometryControlModel_Base* createClone_Impl(
+virtual rtl::Reference createClone_Impl(
 css::uno::Reference< css::util::XCloneable >& 
_rxAggregateInstance) override;
 
 // XTypeProvider
diff --git a/toolkit/inc/controls/geometrycontrolmodel_impl.hxx 
b/toolkit/inc/controls/geometrycontrolmodel_impl.hxx
index 37a3983f6888..2ec8595dddf1 100644
--- a/toolkit/inc/controls/geometrycontrolmodel_impl.hxx
+++ b/toolkit/inc/controls/geometrycontrolmodel_impl.hxx
@@ -60,7 +60,7 @@ css::uno::Sequence SAL_CALL 
OGeometryControlModel::getIm
 }
 
 template 
-OGeometryControlModel_Base* 
OGeometryControlModel::createClone_Impl(
+rtl::Reference 
OGeometryControlModel::createClone_Impl(
 css::uno::Reference& _rxAggregateInstance)
 {
 return new OGeometryControlModel(_rxAggregateInstance);
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx 
b/toolkit/source/controls/geometrycontrolmodel.cxx
index be4e4ffce065..eb21d49bc07f 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -372,7 +372,7 @@
 OSL_ENSURE(xAggregateClone.is(), 
"OGeometryControlModel_Base::createClone: suspicious return of the aggregate!");
 
 // create a new wrapper aggregating this return value
-OGeometryControlModel_Base* pOwnClone = 
createClone_Impl(xAggregateClone);
+rtl::Reference pOwnClone = 
createClone_Impl(xAggregateClone);
 OSL_ENSURE(pOwnClone, "OGeometryControlModel_Base::createClone: 
invalid derivee behaviour!");
 OSL_ENSURE(!xAggregateClone.is(), 
"OGeometryControlModel_Base::createClone: invalid ctor behaviour!");
 // should have been reset
@@ -391,13 +391,11 @@
 // Clone event container
 Reference< css::script::XScriptEventsSupplier > xEventsSupplier =
 static_cast< css::script::XScriptEventsSupplier* >( this );
-Reference< css::script::XScriptEventsSupplier > xCloneEventsSupplier =
-static_cast< css::script::XScriptEventsSupplier* >( pOwnClone );
 
-if( xEventsSupplier.is() && xCloneEventsSupplier.is() )
+if( xEventsSupplier.is() )
 {
 Reference< XNameContainer > xEventCont = 
xEventsSupplier->getEvents();
-Reference< XNameContainer > xCloneEventCont = 
xCloneEventsSupplier->getEvents();
+Reference< XNameContainer > xCloneEventCont = 
pOwnClone->getEvents();
 
 const css::uno::Sequence< OUString > aNames =
 xEventCont->getElementNames();
@@ -561,7 +559,7 @@
 }
 
 
-OGeometryControlModel_Base* OCommonGeometryControlModel::createClone_Impl( 
Reference< XCloneable >& _rxAggregateInstance )
+rtl::Reference 
OCommonGeometryControlModel::createClone_Impl( Reference< XCloneable >& 
_rxAggregateInstance )
 {
 return new OCommonGeometryControlModel( _rxAggregateInstance, 
m_sServiceSpecifier );
 }

[Libreoffice-commits] core.git: filter/source

2021-03-02 Thread Noel (via logerrit)
 filter/source/xslt/odf2xhtml/export/common/body.xsl |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3eb870f0843a00042ca7dd89837fbe0cc6f918c2
Author: Noel 
AuthorDate: Fri Feb 26 12:45:19 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 2 17:32:22 2021 +0100

fix xhtml list export in other locales

where other locales will have lists with ',' instead of '.'
which generates an invalid HTML margin-width value

Change-Id: I30ec6f88140ba1187f7c30b697dfe82055b2e25c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111604
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/xslt/odf2xhtml/export/common/body.xsl 
b/filter/source/xslt/odf2xhtml/export/common/body.xsl
index 9bc022e38d62..9b10e56187bf 100644
--- a/filter/source/xslt/odf2xhtml/export/common/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/body.xsl
@@ -105,7 +105,8 @@
 
 
 
-margin-left:cm
+
+margin-left:cm
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlhelp/source

2021-03-01 Thread Noel (via logerrit)
 xmlhelp/source/cxxhelp/provider/content.cxx  |4 ++--
 xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx |3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 095928cd526da3b26c44e204624a4e5b55cfcaaa
Author: Noel 
AuthorDate: Mon Mar 1 20:36:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 2 07:20:06 2021 +0100

loplugin:refcounting in xmlhelp

Change-Id: I0b045ab762e946db16632637f24b06d20e294bc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111768
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx 
b/xmlhelp/source/cxxhelp/provider/content.cxx
index 273c68555c9f..f16c6b880471 100644
--- a/xmlhelp/source/cxxhelp/provider/content.cxx
+++ b/xmlhelp/source/cxxhelp/provider/content.cxx
@@ -154,7 +154,7 @@ public:
 {
 }
 
-ResultSetBase* createResultSet() override
+rtl::Reference createResultSet() override
 {
 return new ResultSetForRoot( m_xContext,
  m_xProvider,
@@ -191,7 +191,7 @@ public:
 {
 }
 
-ResultSetBase* createResultSet() override
+rtl::Reference createResultSet() override
 {
 return new ResultSetForQuery( m_xContext,
   m_xProvider,
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx 
b/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx
index 2dba0ec05fb6..ad1e03c13196 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_RESULTSETFACTORY_HXX
 
 #include "resultsetbase.hxx"
+#include 
 
 namespace chelp {
 
@@ -32,7 +33,7 @@ namespace chelp {
 
 virtual ~ResultSetFactory() { };
 
-virtual ResultSetBase* createResultSet() = 0;
+virtual rtl::Reference createResultSet() = 0;
 };
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/source include/framework include/sfx2 sfx2/source

2021-03-01 Thread Noel (via logerrit)
 framework/source/fwe/classes/sfxhelperfunctions.cxx |6 --
 framework/source/uielement/toolbarmanager.cxx   |4 ++--
 include/framework/sfxhelperfunctions.hxx|9 +
 include/sfx2/stbitem.hxx|   10 +-
 include/sfx2/tbxctrl.hxx|   13 +++--
 include/sfx2/thumbnailviewitem.hxx  |3 ++-
 sfx2/source/control/thumbnailviewitem.cxx   |2 +-
 sfx2/source/doc/SfxDocumentMetaData.cxx |6 +++---
 sfx2/source/sidebar/ControllerFactory.cxx   |6 ++
 sfx2/source/statbar/stbitem.cxx |4 ++--
 sfx2/source/toolbox/tbxitem.cxx |6 +++---
 11 files changed, 36 insertions(+), 33 deletions(-)

New commits:
commit 05d6dae5ebd172c6738dc8cd7c94b57f671f698e
Author: Noel 
AuthorDate: Sat Feb 27 18:22:18 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 1 19:34:08 2021 +0100

loplugin:refcounting in sfx2

Change-Id: Iba7b1be688f1a7c1b0947c2423cc1965362386b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111682
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/source/fwe/classes/sfxhelperfunctions.cxx 
b/framework/source/fwe/classes/sfxhelperfunctions.cxx
index c6fe0bf030f1..c96791c2f422 100644
--- a/framework/source/fwe/classes/sfxhelperfunctions.cxx
+++ b/framework/source/fwe/classes/sfxhelperfunctions.cxx
@@ -20,6 +20,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 static pfunc_setToolBoxControllerCreator   pToolBoxControllerCreator   = 
nullptr;
 static pfunc_setStatusBarControllerCreator pStatusBarControllerCreator = 
nullptr;
@@ -41,7 +43,7 @@ pfunc_setToolBoxControllerCreator 
SetToolBoxControllerCreator( pfunc_setToolBoxC
 return pOldSetToolBoxControllerCreator;
 }
 
-svt::ToolboxController* CreateToolBoxController( const Reference< XFrame >& 
rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL )
+rtl::Reference CreateToolBoxController( const 
Reference< XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const 
OUString& aCommandURL )
 {
 pfunc_setToolBoxControllerCreator pFactory = nullptr;
 {
@@ -63,7 +65,7 @@ pfunc_setStatusBarControllerCreator 
SetStatusBarControllerCreator( pfunc_setStat
 return pOldSetStatusBarControllerCreator;
 }
 
-svt::StatusbarController* CreateStatusBarController( const Reference< XFrame 
>& rFrame, StatusBar* pStatusBar, unsigned short nID, const OUString& 
aCommandURL )
+rtl::Reference CreateStatusBarController( const 
Reference< XFrame >& rFrame, StatusBar* pStatusBar, unsigned short nID, const 
OUString& aCommandURL )
 {
 pfunc_setStatusBarControllerCreator pFactory = nullptr;
 {
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 6902bcf49e00..d88ba1384f39 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -669,7 +669,7 @@ void ToolBarManager::CreateControllers()
 bool bCreate( true );
 Reference< XStatusListener > xController;
 
-svt::ToolboxController* pController( nullptr );
+rtl::Reference pController;
 
 OUString aCommandURL( m_pToolBar->GetItemCommand( nId ) );
 // Command can be just an alias to another command.
@@ -768,7 +768,7 @@ void ToolBarManager::CreateControllers()
 }
 else if ( pController )
 {
-xController.set( static_cast< ::cppu::OWeakObject *>( 
pController ), UNO_QUERY );
+xController = pController;
 }
 }
 
diff --git a/include/framework/sfxhelperfunctions.hxx 
b/include/framework/sfxhelperfunctions.hxx
index 0fedd75d11f5..7a30899d97de 100644
--- a/include/framework/sfxhelperfunctions.hxx
+++ b/include/framework/sfxhelperfunctions.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::frame { class XFrame; }
 namespace com::sun::star::uno { template  class Reference; }
@@ -31,13 +32,13 @@ namespace svt { class ToolboxController; }
 class StatusBar;
 class ToolBox;
 
-typedef svt::ToolboxController* ( *pfunc_setToolBoxControllerCreator)(
+typedef rtl::Reference ( 
*pfunc_setToolBoxControllerCreator)(
 const css::uno::Reference< css::frame::XFrame >& rFrame,
 ToolBox* pToolbox,
 unsigned short nID,
 const OUString& aCommandURL );
 
-typedef svt::StatusbarController* ( *pfunc_setStatusBarControllerCreator)(
+typedef rtl::Reference ( 
*pfunc_setStatusBarControllerCreator)(
 const css::uno::Reference< css::frame::XFrame >& rFrame,
 StatusBar* pStatusBar,
 unsigned short nID,
@@ -58,14 +59,14 @@ typedef bool ( *pfunc_isDockingWindowVisible)(
 namespace framework
 {
 FWK_DLLPUBLIC pfunc_setToolBoxControllerCreator SetToolBoxControllerCreator( 
pfunc_setToolBoxControllerCreator pSetToolBoxControllerCreator );

[Libreoffice-commits] core.git: canvas/inc canvas/source

2021-03-01 Thread Noel (via logerrit)
 canvas/inc/parametricpolypolygon.hxx  |9 +
 canvas/source/tools/parametricpolypolygon.cxx |8 
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit ee7368f6289ffc46425e4f3db1f7b40b7e6e089e
Author: Noel 
AuthorDate: Mon Mar 1 13:37:02 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 1 19:33:47 2021 +0100

loplugin:refcounting in canvas

Change-Id: I7807e2e7fa7f9a68d36c103d8b1dba708350f8aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111745
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/canvas/inc/parametricpolypolygon.hxx 
b/canvas/inc/parametricpolypolygon.hxx
index 15957b58f960..089c42e76f57 100644
--- a/canvas/inc/parametricpolypolygon.hxx
+++ b/canvas/inc/parametricpolypolygon.hxx
@@ -26,6 +26,7 @@
 #include 
 
 #include 
+#include 
 
 namespace com::sun::star::rendering { class XGraphicDevice; }
 
@@ -85,7 +86,7 @@ namespace canvas
 };
 
 static css::uno::Sequence< OUString > getAvailableServiceNames();
-static ParametricPolyPolygon* create(
+static rtl::Reference create(
 const css::uno::Reference< css::rendering::XGraphicDevice >& 
rDevice,
 std::u16string_view rServiceName,
 const css::uno::Sequence< css::uno::Any >& rArgs );
@@ -112,16 +113,16 @@ namespace canvas
 ParametricPolyPolygon(const ParametricPolyPolygon&) = delete;
 ParametricPolyPolygon& operator=( const ParametricPolyPolygon& ) = 
delete;
 
-static ParametricPolyPolygon* createLinearHorizontalGradient( const 
css::uno::Reference<
+static rtl::Reference 
createLinearHorizontalGradient( const css::uno::Reference<
  
css::rendering::XGraphicDevice >& rDevice,
   const 
css::uno::Sequence< css::uno::Sequence< double > >& colors,
   const 
css::uno::Sequence< double >& stops );
-static ParametricPolyPolygon* createEllipticalGradient( const 
css::uno::Reference<
+static rtl::Reference createEllipticalGradient( 
const css::uno::Reference<

css::rendering::XGraphicDevice >& rDevice,
 const 
css::uno::Sequence< css::uno::Sequence< double > >& colors,
 const 
css::uno::Sequence< double >& stops,
 double fAspect 
);
-static ParametricPolyPolygon* createRectangularGradient( const 
css::uno::Reference<
+static rtl::Reference 
createRectangularGradient( const css::uno::Reference<
 
css::rendering::XGraphicDevice >& rDevice,
  const 
css::uno::Sequence< css::uno::Sequence< double > >& colors,
  const 
css::uno::Sequence< double >& stops,
diff --git a/canvas/source/tools/parametricpolypolygon.cxx 
b/canvas/source/tools/parametricpolypolygon.cxx
index bd62b1b5568a..c75d84348690 100644
--- a/canvas/source/tools/parametricpolypolygon.cxx
+++ b/canvas/source/tools/parametricpolypolygon.cxx
@@ -39,7 +39,7 @@ namespace canvas
 "RectangularGradient"};
 }
 
-ParametricPolyPolygon* ParametricPolyPolygon::create(
+rtl::Reference ParametricPolyPolygon::create(
 const uno::Reference< rendering::XGraphicDevice >& rDevice,
 std::u16string_view rServiceName,
 const uno::Sequence< uno::Any >& rArgs )
@@ -110,7 +110,7 @@ namespace canvas
 return nullptr;
 }
 
-ParametricPolyPolygon* 
ParametricPolyPolygon::createLinearHorizontalGradient(
+rtl::Reference 
ParametricPolyPolygon::createLinearHorizontalGradient(
 const uno::Reference< rendering::XGraphicDevice >&  rDevice,
 const uno::Sequence< uno::Sequence< double > >& colors,
 const uno::Sequence< double >&  stops )
@@ -120,7 +120,7 @@ namespace canvas
 return new ParametricPolyPolygon( rDevice, GradientType::Linear, 
colors, stops );
 }
 
-ParametricPolyPolygon* ParametricPolyPolygon::createEllipticalGradient(
+rtl::Reference 
ParametricPolyPolygon::createEllipticalGradient(
 const uno::Reference< rendering::XGraphicDevice >&  rDevice,
 const uno::Sequence< uno::Sequence< double > >& colors,
 const uno::Sequence< double >&  stops,
@@ -136,7 +136,7 @@ namespace canvas
 colors, stops, fAspectRatio );
 }
 
-ParametricPolyPolygon* ParametricPolyPolygon::createRectangularGradient( 
const uno::Reference< rendering::XGraphicDevice >& 

[Libreoffice-commits] core.git: include/svx sd/source svx/source

2021-03-01 Thread Noel (via logerrit)
 include/svx/ShapeTypeHandler.hxx  |2 +-
 sd/source/ui/accessibility/SdShapeTypes.cxx   |2 +-
 svx/source/accessibility/ShapeTypeHandler.cxx |2 +-
 svx/source/accessibility/SvxShapeTypes.cxx|2 +-
 svx/source/form/filtnav.cxx   |2 +-
 svx/source/form/fmexch.cxx|2 +-
 svx/source/form/fmtextcontrolshell.cxx|6 +++---
 svx/source/inc/filtnav.hxx|2 +-
 svx/source/inc/fmexch.hxx |4 ++--
 svx/source/inc/fmtextcontrolshell.hxx |2 +-
 10 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 3c699b2a480e0795a3a7085c2bcd1a9e8d649ed2
Author: Noel 
AuthorDate: Mon Mar 1 14:35:54 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 1 19:30:37 2021 +0100

loplugin:refcounting in svx

Change-Id: I87b1d0684e6e8921b222f76a13a36706c0eb8c87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111750
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/svx/ShapeTypeHandler.hxx b/include/svx/ShapeTypeHandler.hxx
index ccf61121876f..15992311dfc2 100644
--- a/include/svx/ShapeTypeHandler.hxx
+++ b/include/svx/ShapeTypeHandler.hxx
@@ -44,7 +44,7 @@ typedef int ShapeTypeId;
 /** Define the function type for creating accessible objects for given
 service names.
 */
-typedef AccessibleShape* (*tCreateFunction)
+typedef rtl::Reference (*tCreateFunction)
 (const AccessibleShapeInfo& rShapeInfo,
 const AccessibleShapeTreeInfo& rShapeTreeInfo,
 ShapeTypeId nId);
diff --git a/sd/source/ui/accessibility/SdShapeTypes.cxx 
b/sd/source/ui/accessibility/SdShapeTypes.cxx
index a6159b05f7a0..7fab0961ee27 100644
--- a/sd/source/ui/accessibility/SdShapeTypes.cxx
+++ b/sd/source/ui/accessibility/SdShapeTypes.cxx
@@ -25,7 +25,7 @@
 
 namespace accessibility {
 
-static AccessibleShape*
+static rtl::Reference
 CreateSdAccessibleShape (
 const AccessibleShapeInfo& rShapeInfo,
 const AccessibleShapeTreeInfo& rShapeTreeInfo,
diff --git a/svx/source/accessibility/ShapeTypeHandler.cxx 
b/svx/source/accessibility/ShapeTypeHandler.cxx
index 03ef0bf86bb6..368c2f698ee9 100644
--- a/svx/source/accessibility/ShapeTypeHandler.cxx
+++ b/svx/source/accessibility/ShapeTypeHandler.cxx
@@ -40,7 +40,7 @@ ShapeTypeHandler* ShapeTypeHandler::instance = nullptr;
 
 
 // Create an empty reference to an accessible object.
-static AccessibleShape*
+static rtl::Reference
 CreateEmptyShapeReference (
 const AccessibleShapeInfo& /*rShapeInfo*/,
 const AccessibleShapeTreeInfo& /*rShapeTreeInfo*/,
diff --git a/svx/source/accessibility/SvxShapeTypes.cxx 
b/svx/source/accessibility/SvxShapeTypes.cxx
index 5ca2804b5d7f..b02a153a4cdb 100644
--- a/svx/source/accessibility/SvxShapeTypes.cxx
+++ b/svx/source/accessibility/SvxShapeTypes.cxx
@@ -28,7 +28,7 @@
 
 namespace accessibility {
 
-static AccessibleShape* CreateSvxAccessibleShape (
+static rtl::Reference CreateSvxAccessibleShape (
 const AccessibleShapeInfo& rShapeInfo,
 const AccessibleShapeTreeInfo& rShapeTreeInfo,
 ShapeTypeId nId)
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 7e9e53c62d7f..cee9f5d3c71b 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -103,7 +103,7 @@ SotClipboardFormatId OFilterItemExchange::getFormatId()
 return s_nFormat;
 }
 
-OLocalExchange* OFilterExchangeHelper::createExchange() const
+rtl::Reference OFilterExchangeHelper::createExchange() const
 {
 return new OFilterItemExchange;
 }
diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx
index 38e5fbd947cb..002b3b6175fc 100644
--- a/svx/source/form/fmexch.cxx
+++ b/svx/source/form/fmexch.cxx
@@ -306,7 +306,7 @@ namespace svxform
 }
 
 //= OControlExchangeHelper
-OLocalExchange* OControlExchangeHelper::createExchange() const
+rtl::Reference OControlExchangeHelper::createExchange() 
const
 {
 return new OControlExchange;
 }
diff --git a/svx/source/form/fmtextcontrolshell.cxx 
b/svx/source/form/fmtextcontrolshell.cxx
index a9ec64108a85..0818e9c7be8a 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -1226,9 +1226,9 @@ namespace svx
 SfxSlotId* pSlots = _pZeroTerminatedSlots;
 while ( *pSlots )
 {
-FmTextControlFeature* pDispatcher = implGetFeatureDispatcher( 
xProvider, pApplication, *pSlots );
+rtl::Reference pDispatcher = 
implGetFeatureDispatcher( xProvider, pApplication, *pSlots );
 if ( pDispatcher )
-_rDispatchers.emplace( *pSlots, ControlFeature( 
pDispatcher ) );
+_rDispatchers.emplace( *pSlots, pDispatcher );
 
 ++pSlots;
 }
@@ -1236,7 +1236,7 @@ namespace svx
 }
 
 
-FmTextControlFeature* FmTextControlShell::implGetFeatureDispatcher( const 
Reference< 

[Libreoffice-commits] core.git: chart2/source compilerplugins/clang sd/source solenv/CompilerTest_compilerplugins_clang.mk

2021-03-01 Thread Noel (via logerrit)
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |5 
 compilerplugins/clang/sharedvisitor/dummyplugin.hxx   |1 
 compilerplugins/clang/staticdynamic.cxx   |  120 ++
 compilerplugins/clang/test/staticdynamic.cxx  |   28 +++
 sd/source/core/drawdoc2.cxx   |5 
 solenv/CompilerTest_compilerplugins_clang.mk  |1 
 6 files changed, 156 insertions(+), 4 deletions(-)

New commits:
commit 11083d1fcfc2dde543c6daddea51b554d032392c
Author: Noel 
AuthorDate: Fri Feb 26 15:20:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 1 12:33:17 2021 +0100

new loplugin:staticdynamic

look for places we are dynamic_cast'ing after static_cast'ing,
which means the dynamic_cast is a waste of time.

Change-Id: Ife11bb675020738040646230bbd038278d84f7f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111631
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx 
b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index a356c1ac4185..b941deab6ab9 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -535,8 +535,9 @@ void SchAttribTabDlg::PageCreated(const OString& rId, 
SfxTabPage )
 else if (rId == "axislabel")
 {
 bool bShowStaggeringControls = 
m_pParameter->CanAxisLabelsBeStaggered();
-static_cast(rPage).ShowStaggeringControls( 
bShowStaggeringControls );
-dynamic_cast< SchAxisLabelTabPage& >( rPage ).SetComplexCategories( 
m_pParameter->IsComplexCategoriesAxis() );
+auto & rLabelPage = static_cast(rPage);
+rLabelPage.ShowStaggeringControls( bShowStaggeringControls );
+rLabelPage.SetComplexCategories( 
m_pParameter->IsComplexCategoriesAxis() );
 }
 else if (rId == "axispos")
 {
diff --git a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx 
b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx
index d20f82f9278e..fea2786a796e 100644
--- a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx
+++ b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx
@@ -43,6 +43,7 @@ public:
 bool TraverseWhileStmt( WhileStmt* ) { return complain(); }
 bool TraverseDoStmt( DoStmt* ) { return complain(); }
 bool TraverseForStmt( ForStmt* ) { return complain(); }
+bool TraverseCompoundStmt( CompoundStmt* ) { return complain(); }
 bool TraverseCXXForRangeStmt( CXXForRangeStmt* ) { return complain(); }
 bool TraverseConditionalOperator( ConditionalOperator* ) { return 
complain(); }
 bool TraverseCXXCatchStmt( CXXCatchStmt* ) { return complain(); }
diff --git a/compilerplugins/clang/staticdynamic.cxx 
b/compilerplugins/clang/staticdynamic.cxx
new file mode 100644
index ..b2383413b287
--- /dev/null
+++ b/compilerplugins/clang/staticdynamic.cxx
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "compat.hxx"
+#include "check.hxx"
+#include "plugin.hxx"
+
+namespace
+{
+class StaticDynamic : public loplugin::FilteringPlugin
+{
+public:
+explicit StaticDynamic(loplugin::InstantiationData const& data)
+: FilteringPlugin(data)
+{
+}
+
+bool preRun() override { return compiler.getLangOpts().CPlusPlus; }
+void postRun() override {}
+virtual void run() override
+{
+if (preRun())
+TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+}
+
+bool VisitCXXDynamicCastExpr(CXXDynamicCastExpr const*);
+bool VisitCXXStaticCastExpr(CXXStaticCastExpr const*);
+bool PreTraverseCompoundStmt(CompoundStmt*);
+bool PostTraverseCompoundStmt(CompoundStmt*, bool);
+bool TraverseCompoundStmt(CompoundStmt*);
+
+private:
+// the key is the pair of VarDecl and the type being cast to.
+typedef std::map, 
SourceLocation> MapType;
+MapType staticCastVars;
+// only maintain state inside a single basic block, we're not trying to 
analyse
+// cross-block interactions.
+std::vector blockStack;
+};
+
+bool StaticDynamic::PreTraverseCompoundStmt(CompoundStmt*)
+{
+blockStack.push_back(std::move(staticCastVars));
+return true;
+}
+
+bool StaticDynamic::PostTraverseCompoundStmt(CompoundStmt*, bool)
+{
+staticCastVars = std::move(blockStack.back());
+blockStack.pop_back();
+return true;
+}
+
+bool StaticDynamic::TraverseCompoundStmt(CompoundStmt* compoundStmt)
+{
+bool ret = true;
+if 

[Libreoffice-commits] core.git: svx/source

2021-02-27 Thread Noel (via logerrit)
 svx/source/xoutdev/_xoutbmp.cxx |  330 +++-
 1 file changed, 159 insertions(+), 171 deletions(-)

New commits:
commit d87e95289363e95eec2c6603f248253e6c7598df
Author: Noel 
AuthorDate: Sat Feb 27 15:33:26 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 27 19:33:55 2021 +0100

flatten XOutBitmap::WriteGraphic a little

Change-Id: I91f456673ff54649f6e3f837d9ec8fb6d5dd2b2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111678
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 9f53d9c22d41..60e11abdba56 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -105,219 +105,207 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& 
rGraphic, OUString& rFileName,
  const Size* pMtfSize_100TH_MM,
  const css::uno::Sequence< 
css::beans::PropertyValue >* pFilterData )
 {
-if( rGraphic.GetType() != GraphicType::NONE )
-{
-INetURLObject   aURL( rFileName );
-Graphic aGraphic;
-OUStringaExt;
-GraphicFilter&  rFilter = GraphicFilter::GetGraphicFilter();
-ErrCode nErr = ERRCODE_GRFILTER_FILTERERROR;
-boolbTransparent = rGraphic.IsTransparent(), bAnimated = 
rGraphic.IsAnimated();
+if( rGraphic.GetType() == GraphicType::NONE )
+return ERRCODE_NONE;
 
-DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, 
"XOutBitmap::WriteGraphic(...): invalid URL" );
+INetURLObject   aURL( rFileName );
+Graphic aGraphic;
+OUStringaExt;
+GraphicFilter&  rFilter = GraphicFilter::GetGraphicFilter();
+ErrCode nErr = ERRCODE_GRFILTER_FILTERERROR;
+boolbTransparent = rGraphic.IsTransparent(), bAnimated = 
rGraphic.IsAnimated();
 
-// calculate correct file name
-if( !( nFlags & XOutFlags::DontExpandFilename ) )
-{
-OUString aStr( OUString::number( rGraphic.GetChecksum(), 16 ) );
-if ( aStr[0] == '-' )
-aStr = OUString::Concat("m") + aStr.subView(1);
-OUString aName = aURL.getBase() + "_" + aURL.getExtension() + "_" 
+ aStr;
-aURL.setBase( aName );
-}
+DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, 
"XOutBitmap::WriteGraphic(...): invalid URL" );
+
+// calculate correct file name
+if( !( nFlags & XOutFlags::DontExpandFilename ) )
+{
+OUString aStr( OUString::number( rGraphic.GetChecksum(), 16 ) );
+if ( aStr[0] == '-' )
+aStr = OUString::Concat("m") + aStr.subView(1);
+OUString aName = aURL.getBase() + "_" + aURL.getExtension() + "_" + 
aStr;
+aURL.setBase( aName );
+}
 
-// #i121128# use shortcut to write Vector Graphic Data data in 
original form (if possible)
-auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData());
+// #i121128# use shortcut to write Vector Graphic Data data in original 
form (if possible)
+auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData());
 
-if (rVectorGraphicDataPtr && 
rVectorGraphicDataPtr->getBinaryDataContainer().getSize())
-{
-const bool bIsSvg(rFilterName.equalsIgnoreAsciiCase("svg") && 
VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getType());
-const bool bIsWmf(rFilterName.equalsIgnoreAsciiCase("wmf") && 
VectorGraphicDataType::Wmf == rVectorGraphicDataPtr->getType());
-const bool bIsEmf(rFilterName.equalsIgnoreAsciiCase("emf") && 
VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getType());
-const bool bIsPdf(rFilterName.equalsIgnoreAsciiCase("pdf") && 
VectorGraphicDataType::Pdf == rVectorGraphicDataPtr->getType());
+if (rVectorGraphicDataPtr && 
rVectorGraphicDataPtr->getBinaryDataContainer().getSize())
+{
+const bool bIsSvg(rFilterName.equalsIgnoreAsciiCase("svg") && 
VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getType());
+const bool bIsWmf(rFilterName.equalsIgnoreAsciiCase("wmf") && 
VectorGraphicDataType::Wmf == rVectorGraphicDataPtr->getType());
+const bool bIsEmf(rFilterName.equalsIgnoreAsciiCase("emf") && 
VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getType());
+const bool bIsPdf(rFilterName.equalsIgnoreAsciiCase("pdf") && 
VectorGraphicDataType::Pdf == rVectorGraphicDataPtr->getType());
 
-if (bIsSvg || bIsWmf || bIsEmf || bIsPdf)
+if (bIsSvg || bIsWmf || bIsEmf || bIsPdf)
+{
+if (!(nFlags & XOutFlags::DontAddExtension))
 {
-if (!(nFlags & XOutFlags::DontAddExtension))
-{
-aURL.setExtension(rFilterName);
-}
+aURL.setExtension(rFilterName);
+}
 
-rFileName = 

[Libreoffice-commits] core.git: accessibility/inc accessibility/source comphelper/source include/comphelper

2021-02-27 Thread Noel (via logerrit)
 accessibility/inc/extended/AccessibleBrowseBox.hxx  |2 +-
 accessibility/inc/extended/AccessibleGridControl.hxx|2 +-
 accessibility/inc/extended/accessibletablistbox.hxx |2 +-
 accessibility/source/extended/AccessibleBrowseBox.cxx   |2 +-
 accessibility/source/extended/AccessibleGridControl.cxx |2 +-
 accessibility/source/extended/accessibletablistbox.cxx  |2 +-
 accessibility/source/standard/vclxaccessibletoolbox.cxx |4 ++--
 comphelper/source/misc/accessiblewrapper.cxx|2 +-
 include/comphelper/accessiblewrapper.hxx|2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 26d56470e6af28b9f537690e1f97ec827b1a4737
Author: Noel 
AuthorDate: Fri Feb 26 15:22:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 27 17:19:15 2021 +0100

loplugin:refcounting in accessibility

Change-Id: I0a17e149487cf05fb5e6d004a6402a2a5215a79b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111632
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/accessibility/inc/extended/AccessibleBrowseBox.hxx 
b/accessibility/inc/extended/AccessibleBrowseBox.hxx
index ebaf71991992..5b676ecf5bd3 100644
--- a/accessibility/inc/extended/AccessibleBrowseBox.hxx
+++ b/accessibility/inc/extended/AccessibleBrowseBox.hxx
@@ -169,7 +169,7 @@ protected:
 
 /** This method creates and returns an accessible table.
 @return  An AccessibleBrowseBoxTable. */
-virtual AccessibleBrowseBoxTable*   createAccessibleTable();
+virtual rtl::Reference createAccessibleTable();
 
 private:
 /// the css::accessibility::XAccessible which created the 
AccessibleBrowseBox
diff --git a/accessibility/inc/extended/AccessibleGridControl.hxx 
b/accessibility/inc/extended/AccessibleGridControl.hxx
index 5584fe5ed01b..34d0d0ffaf1c 100644
--- a/accessibility/inc/extended/AccessibleGridControl.hxx
+++ b/accessibility/inc/extended/AccessibleGridControl.hxx
@@ -135,7 +135,7 @@ private:
 
 /** This method creates and returns an accessible table.
 @return  An AccessibleGridControlTable. */
-AccessibleGridControlTable* createAccessibleTable();
+rtl::Reference createAccessibleTable();
 
 /// the css::accessibility::XAccessible which created the 
AccessibleGridControl
 css::uno::WeakReference< css::accessibility::XAccessible > 
   m_aCreator;
diff --git a/accessibility/inc/extended/accessibletablistbox.hxx 
b/accessibility/inc/extended/accessibletablistbox.hxx
index c7ae77b03c77..02704ea872c2 100644
--- a/accessibility/inc/extended/accessibletablistbox.hxx
+++ b/accessibility/inc/extended/accessibletablistbox.hxx
@@ -86,7 +86,7 @@ private:
 
 /** This method creates and returns an accessible table.
 @return  An AccessibleBrowseBoxTable. */
-virtual AccessibleBrowseBoxTable*   createAccessibleTable() override;
+virtual rtl::Reference createAccessibleTable() 
override;
 };
 
 
diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx 
b/accessibility/source/extended/AccessibleBrowseBox.cxx
index c6fb251b849e..5500397b70c6 100644
--- a/accessibility/source/extended/AccessibleBrowseBox.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBox.cxx
@@ -240,7 +240,7 @@ AccessibleBrowseBox::implGetFixedChild( sal_Int32 
nChildIndex )
 return xRet;
 }
 
-AccessibleBrowseBoxTable* AccessibleBrowseBox::createAccessibleTable()
+rtl::Reference 
AccessibleBrowseBox::createAccessibleTable()
 {
 css::uno::Reference< css::accessibility::XAccessible > 
xCreator(m_aCreator);
 OSL_ENSURE( xCreator.is(), 
"extended/AccessibleBrowseBox::createAccessibleTable: my creator died - how 
this?" );
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx 
b/accessibility/source/extended/AccessibleGridControl.cxx
index 124ef5d4f69f..22e6539b8afd 100644
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -260,7 +260,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 
nChildIndex )
 return xRet;
 }
 
-AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable()
+rtl::Reference 
AccessibleGridControl::createAccessibleTable()
 {
 css::uno::Reference< css::accessibility::XAccessible > 
xCreator(m_aCreator);
 OSL_ENSURE( xCreator.is(), 
"extended/AccessibleGridControl::createAccessibleTable: my creator died - how 
this?" );
diff --git a/accessibility/source/extended/accessibletablistbox.cxx 
b/accessibility/source/extended/accessibletablistbox.cxx
index 4bcfa92f7378..f5cdfc75837b 100644
--- a/accessibility/source/extended/accessibletablistbox.cxx
+++ b/accessibility/source/extended/accessibletablistbox.cxx
@@ -58,7 +58,7 @@ namespace accessibility
 }
 }
 
-AccessibleBrowseBoxTable* AccessibleTabListBox::createAccessibleTable()
+rtl::Reference 
AccessibleTabListBox::createAccessibleTable()
 {
 return new 

[Libreoffice-commits] core.git: compilerplugins/clang include/vcl vcl/source

2021-02-27 Thread Noel (via logerrit)
 compilerplugins/clang/unusedfields.only-used-in-constructor.results |   10 ---
 compilerplugins/clang/unusedfields.untouched.results|6 --
 compilerplugins/clang/unusedfields.writeonly.results|   26 
--
 include/vcl/syswin.hxx  |1 
 vcl/source/window/syswin.cxx|1 
 5 files changed, 14 insertions(+), 30 deletions(-)

New commits:
commit 58f4c0eee21839143d4ad3606b6f8fed54eaab6e
Author: Noel 
AuthorDate: Fri Feb 26 13:28:18 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 27 11:58:36 2021 +0100

loplugin:unusedfields

Change-Id: Ie82cfbc8294ffb6b07e66f6cf15fd326bd551d91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111625
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git 
a/compilerplugins/clang/unusedfields.only-used-in-constructor.results 
b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
index 846fb0395a50..a46426654f0e 100644
--- a/compilerplugins/clang/unusedfields.only-used-in-constructor.results
+++ b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
@@ -550,12 +550,6 @@ sd/source/filter/ppt/pptin.hxx:82
 SdPPTImport maParam struct PowerPointImportParam
 sd/source/ui/animations/CustomAnimationList.hxx:124
 sd::CustomAnimationList maDropTargetHelper class 
sd::CustomAnimationListDropTarget
-sd/source/ui/annotations/annotationwindow.hxx:137
-sd::AnnotationWindow mrManager class sd::AnnotationManagerImpl &
-sd/source/ui/annotations/annotationwindow.hxx:138
-sd::AnnotationWindow mpDocShell class sd::DrawDocShell *
-sd/source/ui/annotations/annotationwindow.hxx:139
-sd::AnnotationWindow mpDoc class SdDrawDocument *
 sd/source/ui/inc/AccessibleDocumentViewBase.hxx:261
 accessibility::AccessibleDocumentViewBase maViewForwarder class 
accessibility::AccessibleViewForwarder
 sd/source/ui/inc/OutlineBulletDlg.hxx:44
@@ -710,7 +704,7 @@ svx/source/inc/datanavi.hxx:190
 svxform::XFormsPage m_aDropHelper class svxform::DataTreeDropTarget
 svx/source/svdraw/svdcrtv.cxx:48
 ImplConnectMarkerOverlay maObjects sdr::overlay::OverlayObjectList
-svx/source/svdraw/svdmrkv.cxx:132
+svx/source/svdraw/svdmrkv.cxx:134
 MarkingSubSelectionOverlay maObjects sdr::overlay::OverlayObjectList
 svx/source/tbxctrls/extrusioncontrols.hxx:66
 svx::ExtrusionDirectionWindow maImgDirection class Image [9]
@@ -772,7 +766,7 @@ ucb/source/ucp/gio/gio_mount.hxx:79
 OOoMountOperationClass _gtk_reserved3 void (*)(void)
 ucb/source/ucp/gio/gio_mount.hxx:80
 OOoMountOperationClass _gtk_reserved4 void (*)(void)
-vcl/headless/svpgdi.cxx:397
+vcl/headless/svpgdi.cxx:395
 (anonymous namespace)::BitmapHelper aTmpBmp class SvpSalBitmap
 vcl/inc/canvasbitmap.hxx:40
 vcl::unotools::VclCanvasBitmap m_aAlpha ::Bitmap
diff --git a/compilerplugins/clang/unusedfields.untouched.results 
b/compilerplugins/clang/unusedfields.untouched.results
index 40413a8bde1a..c414b2434ef9 100644
--- a/compilerplugins/clang/unusedfields.untouched.results
+++ b/compilerplugins/clang/unusedfields.untouched.results
@@ -300,12 +300,6 @@ sc/source/ui/inc/PivotLayoutTreeListBase.hxx:48
 ScPivotLayoutTreeListBase maDropTargetHelper class 
ScPivotLayoutTreeDropTarget
 sd/source/ui/animations/CustomAnimationList.hxx:124
 sd::CustomAnimationList maDropTargetHelper class 
sd::CustomAnimationListDropTarget
-sd/source/ui/annotations/annotationwindow.hxx:137
-sd::AnnotationWindow mrManager class sd::AnnotationManagerImpl &
-sd/source/ui/annotations/annotationwindow.hxx:138
-sd::AnnotationWindow mpDocShell class sd::DrawDocShell *
-sd/source/ui/annotations/annotationwindow.hxx:139
-sd::AnnotationWindow mpDoc class SdDrawDocument *
 sd/source/ui/inc/sdtreelb.hxx:73
 SdPageObjsTLV m_xDropTargetHelper std::unique_ptr
 sd/source/ui/remotecontrol/ZeroconfService.hxx:32
diff --git a/compilerplugins/clang/unusedfields.writeonly.results 
b/compilerplugins/clang/unusedfields.writeonly.results
index 8deb7463ab92..8b9d9b1e75ee 100644
--- a/compilerplugins/clang/unusedfields.writeonly.results
+++ b/compilerplugins/clang/unusedfields.writeonly.results
@@ -266,7 +266,7 @@ embeddedobj/source/inc/oleembobj.hxx:174
 OleEmbeddedObject m_nStatusAspect sal_Int64
 embeddedobj/source/inc/oleembobj.hxx:188
 OleEmbeddedObject m_bFromClipboard _Bool
-emfio/inc/mtftools.hxx:515
+emfio/inc/mtftools.hxx:536
 emfio::MtfTools mrclBounds tools::Rectangle
 extensions/source/propctrlr/genericpropertyhandler.hxx:65
 pcr::GenericPropertyHandler m_xComponentIntrospectionAccess 
css::uno::Reference
@@ -346,8 +346,6 @@ include/opencl/platforminfo.hxx:30
 OpenCLDeviceInfo mnComputeUnits size_t
 include/opencl/platforminfo.hxx:31
 OpenCLDeviceInfo mnFrequency size_t
-include/sfx2/docmacromode.hxx:299
-sfx2::DocumentMacroMode m_bNeedsContentSigned _Bool
 include/sfx2/minfitem.hxx:35
 SfxMacroInfoItem 

[Libreoffice-commits] core.git: ucb/source

2021-02-27 Thread Noel (via logerrit)
 ucb/source/ucp/ftp/ftpcontent.cxx |2 +-
 ucb/source/ucp/ftp/ftpresultsetfactory.hxx|3 ++-
 ucb/source/ucp/hierarchy/hierarchycontent.cxx |4 ++--
 ucb/source/ucp/hierarchy/hierarchycontent.hxx |4 ++--
 ucb/source/ucp/package/pkgcontent.cxx |4 ++--
 ucb/source/ucp/package/pkgcontent.hxx |4 ++--
 ucb/source/ucp/tdoc/tdoc_content.cxx  |4 ++--
 ucb/source/ucp/tdoc/tdoc_content.hxx  |4 ++--
 8 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 11cd35b5a2d137de83daaad63edac69916fe5fe1
Author: Noel 
AuthorDate: Fri Feb 26 15:22:38 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 27 11:55:28 2021 +0100

loplugin:refcounting in ucb

Change-Id: I5dd8295648aadafc7dfc73121354aa5f602c2c79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111633
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx 
b/ucb/source/ucp/ftp/ftpcontent.cxx
index bac2579ffa54..7a6716ee06a0 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -208,7 +208,7 @@ ResultSetFactory::ResultSetFactory(const 
Reference&  rxConte
 }
 
 
-ResultSetBase* ResultSetFactory::createResultSet()
+rtl::Reference ResultSetFactory::createResultSet()
 {
 return new ResultSetI(m_xContext,
   m_xProvider,
diff --git a/ucb/source/ucp/ftp/ftpresultsetfactory.hxx 
b/ucb/source/ucp/ftp/ftpresultsetfactory.hxx
index 24102b870d5f..e230a04d316b 100644
--- a/ucb/source/ucp/ftp/ftpresultsetfactory.hxx
+++ b/ucb/source/ucp/ftp/ftpresultsetfactory.hxx
@@ -29,6 +29,7 @@
 #include "ftpdirp.hxx"
 #include 
 #include 
+#include 
 #include 
 
 namespace ftp {
@@ -43,7 +44,7 @@ public:
   const css::uno::Sequence& seq,
   const std::vector& dirvec);
 
-ResultSetBase* createResultSet();
+rtl::Reference createResultSet();
 private:
 css::uno::Reference< css::uno::XComponentContext >m_xContext;
 css::uno::Reference< css::ucb::XContentProvider > m_xProvider;
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx 
b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index e3cc82594f37..5afd6cc5bb3b 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -80,7 +80,7 @@ using namespace hierarchy_ucp;
 
 
 // static ( "virtual" ctor )
-HierarchyContent* HierarchyContent::create(
+rtl::Reference HierarchyContent::create(
 const uno::Reference< uno::XComponentContext >& rxContext,
 HierarchyContentProvider* pProvider,
 const uno::Reference< ucb::XContentIdentifier >& Identifier )
@@ -95,7 +95,7 @@ HierarchyContent* HierarchyContent::create(
 
 
 // static ( "virtual" ctor )
-HierarchyContent* HierarchyContent::create(
+rtl::Reference HierarchyContent::create(
 const uno::Reference< uno::XComponentContext >& rxContext,
 HierarchyContentProvider* pProvider,
 const uno::Reference< ucb::XContentIdentifier >& Identifier,
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.hxx 
b/ucb/source/ucp/hierarchy/hierarchycontent.hxx
index 3e17ac35e643..c830c5772b77 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.hxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.hxx
@@ -183,14 +183,14 @@ private:
 
 public:
 // Create existing content. Fail, if not already exists.
-static HierarchyContent* create(
+static rtl::Reference create(
 const css::uno::Reference< css::uno::XComponentContext >& 
rxContext,
 HierarchyContentProvider* pProvider,
 const css::uno::Reference<
 css::ucb::XContentIdentifier >& Identifier );
 
 // Create new content. Fail, if already exists.
-static HierarchyContent* create(
+static rtl::Reference create(
 const css::uno::Reference< css::uno::XComponentContext >& 
rxContext,
 HierarchyContentProvider* pProvider,
 const css::uno::Reference< css::ucb::XContentIdentifier >& 
Identifier,
diff --git a/ucb/source/ucp/package/pkgcontent.cxx 
b/ucb/source/ucp/package/pkgcontent.cxx
index a3944757ec48..dfda010f2f63 100644
--- a/ucb/source/ucp/package/pkgcontent.cxx
+++ b/ucb/source/ucp/package/pkgcontent.cxx
@@ -140,7 +140,7 @@ ContentProperties::getCreatableContentsInfo( PackageUri 
const & rUri ) const
 
 
 // static ( "virtual" ctor )
-Content* Content::create(
+rtl::Reference Content::create(
 const uno::Reference< uno::XComponentContext >& rxContext,
 ContentProvider* pProvider,
 const uno::Reference< ucb::XContentIdentifier >& Identifier )
@@ -192,7 +192,7 @@ Content* Content::create(
 
 
 // static ( "virtual" ctor )
-Content* Content::create(
+rtl::Reference Content::create(
 const uno::Reference< uno::XComponentContext >& rxContext,
 ContentProvider* pProvider,
 

[Libreoffice-commits] core.git: extensions/source

2021-02-27 Thread Noel (via logerrit)
 extensions/source/bibliography/bibmod.cxx |2 +-
 extensions/source/bibliography/bibmod.hxx |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 92b96423e0cf494e562e9771fc2b315d46fffc39
Author: Noel 
AuthorDate: Fri Feb 26 15:22:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 27 11:55:08 2021 +0100

loplugin:refcounting in extensions

Change-Id: I3a03bdb53e2d75da3ca40b48ed8fd133dbf69dff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111634
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/extensions/source/bibliography/bibmod.cxx 
b/extensions/source/bibliography/bibmod.cxx
index 1a4f6cca47d2..c355e836a02b 100644
--- a/extensions/source/bibliography/bibmod.cxx
+++ b/extensions/source/bibliography/bibmod.cxx
@@ -74,7 +74,7 @@ BibModul::~BibModul()
 pBibConfig = nullptr;
 }
 
-BibDataManager*  BibModul::createDataManager()
+rtl::Reference  BibModul::createDataManager()
 {
 return new BibDataManager();
 }
diff --git a/extensions/source/bibliography/bibmod.hxx 
b/extensions/source/bibliography/bibmod.hxx
index e651f720e753..6720b50bc549 100644
--- a/extensions/source/bibliography/bibmod.hxx
+++ b/extensions/source/bibliography/bibmod.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_BIBMOD_HXX
 
 #include 
+#include 
 
 class BibDataManager;
 class BibConfig;
@@ -38,7 +39,7 @@ class BibModul
 const std::locale&  GetResLocale() const { return m_aResLocale; }
 static BibConfig*   GetConfig();
 
-static BibDataManager*  createDataManager();
+static rtl::Reference  createDataManager();
 
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang include/vcl

2021-02-26 Thread Noel (via logerrit)
 compilerplugins/clang/unnecessaryvirtual.results |   22 +-
 include/vcl/menu.hxx |2 +-
 2 files changed, 10 insertions(+), 14 deletions(-)

New commits:
commit 3190244989a233902845fa4a7ab8dd64c2372da3
Author: Noel 
AuthorDate: Fri Feb 26 13:23:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 27 08:21:47 2021 +0100

loplugin:unnecessaryvirtual

Change-Id: I99f5302ec5727aae3fad6767b9b477d37beb573b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111624
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unnecessaryvirtual.results 
b/compilerplugins/clang/unnecessaryvirtual.results
index 59268ce03547..45b9d0f6d699 100644
--- a/compilerplugins/clang/unnecessaryvirtual.results
+++ b/compilerplugins/clang/unnecessaryvirtual.results
@@ -232,11 +232,11 @@ extensions/source/propctrlr/commoncontrol.hxx:140
 void pcr::CommonBehaviourControl::notifyModifiedValue()
 extensions/source/propctrlr/commoncontrol.hxx:155
 void pcr::CommonBehaviourControl::disposing()
-forms/source/xforms/datatypes.hxx:233
+forms/source/xforms/datatypes.hxx:234
 class cppu::IPropertyArrayHelper * 
xforms::ODerivedDataType::createArrayHelper()const
-forms/source/xforms/datatypes.hxx:236
-class com::sun::star::uno::Reference 
xforms::ODerivedDataType::getPropertySetInfo()
 forms/source/xforms/datatypes.hxx:237
+class com::sun::star::uno::Reference 
xforms::ODerivedDataType::getPropertySetInfo()
+forms/source/xforms/datatypes.hxx:238
 class cppu::IPropertyArrayHelper & 
xforms::ODerivedDataType::getInfoHelper()
 forms/source/xforms/namedcollection.hxx:82
 class com::sun::star::uno::Type NamedCollection::getElementType()
@@ -296,10 +296,10 @@ include/vbahelper/vbareturntypes.hxx:39
 type-parameter-0-0 ooo::vba::DefaultReturnHelper::getValue()
 include/vcl/customweld.hxx:45
 class rtl::OUString weld::CustomWidgetController::GetHelpText()const
+include/vcl/menu.hxx:236
+void Menu::Select()
 include/vcl/toolkit/dialog.hxx:99
 void Dialog::set_content_area(class VclBox *,)
-include/vcl/toolkit/menubtn.hxx:67
-void MenuButton::Select()
 include/vcl/weld.hxx:100
 void weld::Widget::set_visible(_Bool,)
 sc/source/core/opencl/formulagroupcl.cxx:1061
@@ -402,14 +402,10 @@ slideshow/source/inc/shape.hxx:221
 void slideshow::internal::Shape::setIsForeground(const _Bool,)
 sw/inc/flypos.hxx:37
 void SwPosFlyFrame::~SwPosFlyFrame()
-sw/source/core/inc/MarkManager.hxx:104
-void sw::mark::MarkManager::LOKUpdateActiveField(class SfxViewShell *,)
-toolkit/inc/controls/geometrycontrolmodel.hxx:182
+toolkit/inc/controls/geometrycontrolmodel.hxx:185
 void OGeometryControlModel::fillProperties(class 
com::sun::star::uno::Sequence &,class 
com::sun::star::uno::Sequence &,)const
 vcl/inc/jsdialog/jsdialogbuilder.hxx:90
 void JSDialogSender::sendFullUpdate(_Bool,)
-vcl/inc/jsdialog/jsdialogbuilder.hxx:92
-void JSDialogSender::sendUpdate(class VclPtr,_Bool,)
 vcl/inc/jsdialog/jsdialogbuilder.hxx:250
 void JSWidget::show()
 vcl/inc/jsdialog/jsdialogbuilder.hxx:256
@@ -436,7 +432,7 @@ vcl/inc/salprn.hxx:116
 enum SalPrinterError SalPrinter::GetErrorCode()
 vcl/inc/salvtables.hxx:1577
 _Bool SalInstanceTreeView::get_iter_abs_pos(class weld::TreeIter 
&,int,)const
-vcl/inc/skia/gdiimpl.hxx:236
+vcl/inc/skia/gdiimpl.hxx:238
 void SkiaSalGraphicsImpl::createSurface()
 vcl/inc/unx/gtk/gtkdata.hxx:180
 int GtkSalDisplay::CaptureMouse(class SalFrame *,)
@@ -462,7 +458,7 @@ vcl/inc/unx/saldisp.hxx:197
 _Bool SalXLib::CheckTimeout(_Bool,)
 vcl/inc/unx/saldisp.hxx:404
 void SalX11Display::Yield()
-vcl/inc/unx/salframe.h:206
+vcl/inc/unx/salframe.h:205
 void X11SalFrame::updateGraphics(_Bool,)
 vcl/inc/unx/salinst.h:41
 class SalX11Display * X11SalInstance::CreateDisplay()const
@@ -479,7 +475,7 @@ workdir/../vcl/inc/qt5/Qt5Frame.hxx:162
 workdir/../vcl/inc/qt5/Qt5Frame.hxx:163
 void Qt5Frame::deregisterDropTarget(const class Qt5DropTarget *,)
 workdir/../vcl/inc/qt5/Qt5Instance.hxx:84
-class Qt5FilePicker * Qt5Instance::createPicker(const class 
com::sun::star::uno::Reference 
&,enum QFileDialog::FileMode,)
+class rtl::Reference Qt5Instance::createPicker(const 
class com::sun::star::uno::Reference &,enum QFileDialog::FileMode,)
 writerfilter/source/dmapper/TableManager.hxx:484
 void writerfilter::dmapper::TableManager::tableExceptionProps(const class 
tools::SvRef &,)
 writerfilter/source/ooxml/OOXMLFactory.hxx:66
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 55b4ca10ed71..f48a4e427d06 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -233,7 +233,7 @@ public:
 
 void Activate();
 void Deactivate();
-virtual void Select();
+void Select();
 
 void InsertItem(sal_uInt16 nItemId, const OUString& rStr,
 MenuItemBits nItemBits = MenuItemBits::NONE,

[Libreoffice-commits] core.git: include/svl sc/inc sc/source svl/source sw/inc sw/source

2021-02-26 Thread Noel (via logerrit)
 include/svl/style.hxx |2 +-
 sc/inc/stlpool.hxx|2 +-
 sc/source/core/data/stlpool.cxx   |2 +-
 svl/source/items/style.cxx|2 +-
 sw/inc/docstyle.hxx   |2 +-
 sw/source/uibase/app/docstyle.cxx |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit f77250f3159ec58f8d7d2770496fac64536b4f6f
Author: Noel 
AuthorDate: Thu Feb 25 15:14:18 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 26 13:10:49 2021 +0100

loplugin:refcounting in svl

Change-Id: I0009464121faf6dd36793b031d892f492b56187c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111544
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index bd1b0adb0790..735e3607242d 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -238,7 +238,7 @@ protected:
 
 voidChangeParent(std::u16string_view rOld, const 
OUString& rNew, SfxStyleFamily eFamily, bool bVirtual = true);
 virtual rtl::Reference Create( const OUString&, 
SfxStyleFamily, SfxStyleSearchBits );
-virtual SfxStyleSheetBase*  Create( const SfxStyleSheetBase& );
+virtual rtl::Reference  Create( const 
SfxStyleSheetBase& );
 
 virtual ~SfxStyleSheetBasePool() override;
 
diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx
index b4a5c312d6ea..e6d816096d9d 100644
--- a/sc/inc/stlpool.hxx
+++ b/sc/inc/stlpool.hxx
@@ -66,7 +66,7 @@ private:
 virtual rtl::Reference Create( const OUString&  rName,
SfxStyleFamily   eFamily,
SfxStyleSearchBits nMask) override;
-virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& rStyle ) 
override;
+virtual rtl::Reference Create( const SfxStyleSheetBase& 
rStyle ) override;
 
 SfxStyleSheetBase*  pActualStyleSheet;
 ScDocument* pDoc;
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 3654799790da..b4074c1773b5 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -107,7 +107,7 @@ rtl::Reference ScStyleSheetPool::Create( 
const OUString&   rN
 return pSheet;
 }
 
-SfxStyleSheetBase* ScStyleSheetPool::Create( const SfxStyleSheetBase& rStyle )
+rtl::Reference ScStyleSheetPool::Create( const 
SfxStyleSheetBase& rStyle )
 {
 OSL_ENSURE( rStyle.isScStyleSheet(), "Invalid StyleSheet-class! :-/" );
 return new ScStyleSheet( static_cast(rStyle) );
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 5b430259de2a..a053044b7de9 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -615,7 +615,7 @@ rtl::Reference 
SfxStyleSheetBasePool::Create
 return new SfxStyleSheetBase( rName, this, eFam, mask );
 }
 
-SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r )
+rtl::Reference SfxStyleSheetBasePool::Create( const 
SfxStyleSheetBase& r )
 {
 return new SfxStyleSheetBase( r );
 }
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index 90ad2f61ff7c..3ac7b308315d 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -198,7 +198,7 @@ class SwDocStyleSheetPool : public SfxStyleSheetBasePool
 boolbOrganizer : 1; ///< Organizer
 
 virtual rtl::Reference Create( const OUString&, 
SfxStyleFamily, SfxStyleSearchBits nMask) override;
-virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ) override;
+virtual rtl::Reference Create( const SfxStyleSheetBase& 
) override;
 
 using SfxStyleSheetBasePool::Find;
 
diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index 102afc1a3253..e173eddfbc3d 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2428,7 +2428,7 @@ SfxStyleSheetBase&   SwDocStyleSheetPool::Make( const 
OUString&   rName,
 return *mxStyleSheet;
 }
 
-SfxStyleSheetBase*   SwDocStyleSheetPool::Create( const SfxStyleSheetBase& 
/*rOrg*/)
+rtl::Reference SwDocStyleSheetPool::Create( const 
SfxStyleSheetBase& /*rOrg*/)
 {
 OSL_ENSURE(false , "Create in SW-Stylesheet-Pool not possible" );
 return nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: forms/source

2021-02-26 Thread Noel (via logerrit)
 forms/source/component/Columns.cxx |3 +--
 forms/source/component/Columns.hxx |7 ---
 forms/source/xforms/datatyperepository.cxx |2 +-
 forms/source/xforms/datatypes.cxx  |8 
 forms/source/xforms/datatypes.hxx  |9 +
 5 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 9c1ec551524a75c20c1468a6fc0101eb2480e8e3
Author: Noel 
AuthorDate: Thu Feb 25 14:50:15 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 26 10:00:06 2021 +0100

loplugin:refcounting in forms

Change-Id: Idba46c8b30a3c44f12c0aaa8a00477865ecfb848
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111542
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/forms/source/component/Columns.cxx 
b/forms/source/component/Columns.cxx
index 95438dc86cbf..50a9e05875d6 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -455,8 +455,7 @@ Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 
nHandle ) const
 
 Reference< XCloneable > SAL_CALL OGridColumn::createClone(  )
 {
-OGridColumn* pNewColumn = createCloneColumn();
-return pNewColumn;
+return createCloneColumn();
 }
 
 // XPersistObject
diff --git a/forms/source/component/Columns.hxx 
b/forms/source/component/Columns.hxx
index 010252615930..2f2bb3e846be 100644
--- a/forms/source/component/Columns.hxx
+++ b/forms/source/component/Columns.hxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace comphelper;
 
@@ -106,7 +107,7 @@ protected:
 static void clearAggregateProperties(css::uno::Sequence< 
css::beans::Property>& seqProps, bool bAllowDropDown);
 static void setOwnProperties(css::uno::Sequence< css::beans::Property>& 
seqProps);
 
-virtual OGridColumn* createCloneColumn() const = 0;
+virtual rtl::Reference createCloneColumn() const = 0;
 };
 
 #define DECL_COLUMN(ClassName) 
 \
@@ -126,7 +127,7 @@ public:
 css::uno::Sequence< css::beans::Property >& /* [out] */ 
_rAggregateProps  \
 ) const override;  
  \

 \
-virtual OGridColumn* createCloneColumn() const override;   
  \
+virtual rtl::Reference createCloneColumn() const override;
 \
 };
 
 
@@ -160,7 +161,7 @@ void ClassName::fillProperties( \
 setOwnProperties(_rProps); \
 } \
 } \
-OGridColumn* ClassName::createCloneColumn() const \
+rtl::Reference ClassName::createCloneColumn() const \
 { \
 return new ClassName( this ); \
 } \
diff --git a/forms/source/xforms/datatyperepository.cxx 
b/forms/source/xforms/datatyperepository.cxx
index bb0bf4a34135..22a56ce545ee 100644
--- a/forms/source/xforms/datatyperepository.cxx
+++ b/forms/source/xforms/datatyperepository.cxx
@@ -131,7 +131,7 @@ namespace xforms
 throw ElementExistException( OUString(), *this );
 
 aTypePos = implLocate( sourceName );
-OXSDDataType* pClone = aTypePos->second->clone( newName );
+rtl::Reference pClone = aTypePos->second->clone( newName 
);
 m_aRepository[ newName ] = pClone;
 
 return pClone;
diff --git a/forms/source/xforms/datatypes.cxx 
b/forms/source/xforms/datatypes.cxx
index 91175dea907c..c4ce2d941bb4 100644
--- a/forms/source/xforms/datatypes.cxx
+++ b/forms/source/xforms/datatypes.cxx
@@ -89,9 +89,9 @@ namespace xforms
 }
 
 
-OXSDDataType* OXSDDataType::clone( const OUString& _rNewName ) const
+rtl::Reference OXSDDataType::clone( const OUString& 
_rNewName ) const
 {
-OXSDDataType* pClone = createClone( _rNewName );
+rtl::Reference pClone = createClone( _rNewName );
 pClone->initializeClone( *this );
 return pClone;
 }
@@ -568,7 +568,7 @@ namespace xforms
 {
 }
 
-OXSDDataType* OBooleanType::createClone( const OUString& _rName ) const
+rtl::Reference OBooleanType::createClone( const OUString& 
_rName ) const
 {
 return new OBooleanType( _rName );
 }
@@ -695,7 +695,7 @@ namespace xforms
 :classname##_Base( _rName, DataTypeClass::typeclass )   \
 {   \
 }   \
-OXSDDataType* classname::createClone( const OUString& _rName ) const \
+rtl::Reference classname::createClone( const OUString& 
_rName ) const \
 {   \
 return new classname( _rName ); \
 }   \
diff --git a/forms/source/xforms/datatypes.hxx 

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

2021-02-26 Thread Noel (via logerrit)
 basic/source/inc/dlgcont.hxx|2 +-
 basic/source/inc/namecont.hxx   |2 +-
 basic/source/inc/scriptcont.hxx |2 +-
 basic/source/uno/dlgcont.cxx|2 +-
 basic/source/uno/scriptcont.cxx |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 568b4e8d7a98da3d7f8f80c7e5a13d01676e96d6
Author: Noel 
AuthorDate: Thu Feb 25 14:49:36 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 26 09:59:21 2021 +0100

loplugin:refcounting in basic

Change-Id: Idbee5b35215f794e6785925dafb6f160caa24a22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111541
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx
index 1152dd82b2b3..4be36fec9160 100644
--- a/basic/source/inc/dlgcont.hxx
+++ b/basic/source/inc/dlgcont.hxx
@@ -56,7 +56,7 @@ class SfxDialogLibraryContainer : public SfxLibraryContainer
 
 virtual void importFromOldStorage( const OUString& aFile ) override;
 
-virtual SfxLibraryContainer* createInstanceImpl() override;
+virtual rtl::Reference createInstanceImpl() override;
 
 virtual void onNewRootStorage() override;
 
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 5a3ce4afd09e..169182464fee 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -297,7 +297,7 @@ protected:
 
 // #5, Creates another library container
 // instance of the same derived class
-virtual SfxLibraryContainer* createInstanceImpl() = 0;
+virtual rtl::Reference createInstanceImpl() = 0;
 
 
 // Interface to get the BasicManager (Hack for password implementation)
diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx
index 17f3089f1092..29a384942ad3 100644
--- a/basic/source/inc/scriptcont.hxx
+++ b/basic/source/inc/scriptcont.hxx
@@ -56,7 +56,7 @@ class SfxScriptLibraryContainer : public SfxLibraryContainer, 
public OldBasicPas
 
 virtual void importFromOldStorage( const OUString& aFile ) override;
 
-virtual SfxLibraryContainer* createInstanceImpl() override;
+virtual rtl::Reference createInstanceImpl() override;
 
 
 // Password encryption
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index ff89a780c2f5..cc03680f4cb6 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -335,7 +335,7 @@ void SfxDialogLibraryContainer::importFromOldStorage( const 
OUString& )
 // Nothing to do here, old dialogs cannot be imported
 }
 
-SfxLibraryContainer* SfxDialogLibraryContainer::createInstanceImpl()
+rtl::Reference 
SfxDialogLibraryContainer::createInstanceImpl()
 {
 return new SfxDialogLibraryContainer();
 }
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index eab8faf71735..cf26443777b6 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -311,7 +311,7 @@ Any SfxScriptLibraryContainer::importLibraryElement
 return aRetAny;
 }
 
-SfxLibraryContainer* SfxScriptLibraryContainer::createInstanceImpl()
+rtl::Reference 
SfxScriptLibraryContainer::createInstanceImpl()
 {
 return new SfxScriptLibraryContainer();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: connectivity/source

2021-02-25 Thread Noel (via logerrit)
 connectivity/source/drivers/component/CPreparedStatement.cxx |2 +-
 connectivity/source/drivers/component/CStatement.cxx |2 +-
 connectivity/source/drivers/dbase/DPreparedStatement.cxx |2 +-
 connectivity/source/drivers/dbase/DStatement.cxx |2 +-
 connectivity/source/drivers/file/FPreparedStatement.cxx  |2 +-
 connectivity/source/drivers/file/FStatement.cxx  |6 +++---
 connectivity/source/drivers/flat/EPreparedStatement.cxx  |2 +-
 connectivity/source/drivers/flat/EStatement.cxx  |2 +-
 connectivity/source/inc/component/CPreparedStatement.hxx |2 +-
 connectivity/source/inc/component/CStatement.hxx |2 +-
 connectivity/source/inc/dbase/DPreparedStatement.hxx |2 +-
 connectivity/source/inc/dbase/DStatement.hxx |2 +-
 connectivity/source/inc/file/FPreparedStatement.hxx  |2 +-
 connectivity/source/inc/file/FStatement.hxx  |4 ++--
 connectivity/source/inc/flat/EPreparedStatement.hxx  |2 +-
 connectivity/source/inc/flat/EStatement.hxx  |2 +-
 16 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 5170614a3160dceba63478291a00bbde9d37729f
Author: Noel 
AuthorDate: Thu Feb 25 14:48:36 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 26 07:37:05 2021 +0100

loplugin:refcounting in connectivity

Change-Id: Iee324d84334f60a13615a4d422d480c9c597fdbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111539
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/connectivity/source/drivers/component/CPreparedStatement.cxx 
b/connectivity/source/drivers/component/CPreparedStatement.cxx
index bc3af3e8c9b8..7c5c8e07f891 100644
--- a/connectivity/source/drivers/component/CPreparedStatement.cxx
+++ b/connectivity/source/drivers/component/CPreparedStatement.cxx
@@ -24,7 +24,7 @@ using namespace connectivity::component;
 using namespace connectivity::file;
 using namespace com::sun::star::uno;
 
-OResultSet* OComponentPreparedStatement::createResultSet()
+rtl::Reference OComponentPreparedStatement::createResultSet()
 {
 return new 
connectivity::component::OComponentResultSet(this,m_aSQLIterator);
 }
diff --git a/connectivity/source/drivers/component/CStatement.cxx 
b/connectivity/source/drivers/component/CStatement.cxx
index 8a1a2fa92287..f3bd03e8b276 100644
--- a/connectivity/source/drivers/component/CStatement.cxx
+++ b/connectivity/source/drivers/component/CStatement.cxx
@@ -24,7 +24,7 @@ using namespace connectivity::component;
 using namespace connectivity::file;
 using namespace com::sun::star::uno;
 
-OResultSet* OComponentStatement::createResultSet()
+rtl::Reference OComponentStatement::createResultSet()
 {
 return new connectivity::component::OComponentResultSet(this, 
m_aSQLIterator);
 }
diff --git a/connectivity/source/drivers/dbase/DPreparedStatement.cxx 
b/connectivity/source/drivers/dbase/DPreparedStatement.cxx
index 852c98acf509..9a2b54409bea 100644
--- a/connectivity/source/drivers/dbase/DPreparedStatement.cxx
+++ b/connectivity/source/drivers/dbase/DPreparedStatement.cxx
@@ -24,7 +24,7 @@ using namespace connectivity::dbase;
 using namespace connectivity::file;
 using namespace com::sun::star::uno;
 
-OResultSet* ODbasePreparedStatement::createResultSet()
+rtl::Reference ODbasePreparedStatement::createResultSet()
 {
 return new ODbaseResultSet(this, m_aSQLIterator);
 }
diff --git a/connectivity/source/drivers/dbase/DStatement.cxx 
b/connectivity/source/drivers/dbase/DStatement.cxx
index 096878e3e245..d2537232778e 100644
--- a/connectivity/source/drivers/dbase/DStatement.cxx
+++ b/connectivity/source/drivers/dbase/DStatement.cxx
@@ -25,7 +25,7 @@ using namespace connectivity::file;
 using namespace com::sun::star::uno;
 
 
-OResultSet* ODbaseStatement::createResultSet()
+rtl::Reference ODbaseStatement::createResultSet()
 {
 return new ODbaseResultSet(this,m_aSQLIterator);
 }
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx 
b/connectivity/source/drivers/file/FPreparedStatement.cxx
index 4550f2053e80..6441534e66c9 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -363,7 +363,7 @@ void SAL_CALL OPreparedStatement::clearParameters(  )
 m_aParameterRow->push_back(new ORowSetValueDecorator(sal_Int32(0)) );
 }
 
-OResultSet* OPreparedStatement::createResultSet()
+rtl::Reference OPreparedStatement::createResultSet()
 {
 return new OResultSet(this,m_aSQLIterator);
 }
diff --git a/connectivity/source/drivers/file/FStatement.cxx 
b/connectivity/source/drivers/file/FStatement.cxx
index a78f7a096955..6c9367c83a78 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -216,7 +216,7 @@ void SAL_CALL OStatement_Base::clearWarnings(  )
 return *getArrayHelper();
 }
 

[Libreoffice-commits] core.git: avmedia/source

2021-02-25 Thread Noel (via logerrit)
 avmedia/source/framework/mediatoolbox.cxx|2 +-
 avmedia/source/gstreamer/gstframegrabber.cxx |2 +-
 avmedia/source/gstreamer/gstframegrabber.hxx |3 ++-
 avmedia/source/gstreamer/gstplayer.cxx   |4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 19ddd197a4246b8ab62932d63670b3d281e7b626
Author: Noel 
AuthorDate: Thu Feb 25 14:49:13 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 26 07:36:12 2021 +0100

loplugin:refcounting in avmedia

Change-Id: I0cd6d6a4a45d77b25f04c3b49327f1cf9279c6a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111540
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/avmedia/source/framework/mediatoolbox.cxx 
b/avmedia/source/framework/mediatoolbox.cxx
index a109113a78fe..5cdde7399afe 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -65,7 +65,7 @@ void MediaToolBoxControl_Impl::execute( const MediaItem& 
rItem )
 }
 
 
-SFX_IMPL_TOOLBOX_CONTROL( ::avmedia::MediaToolBoxControl, ::avmedia::MediaItem 
);
+SFX_IMPL_TOOLBOX_CONTROL( MediaToolBoxControl, ::avmedia::MediaItem );
 
 
 MediaToolBoxControl::MediaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, 
ToolBox& rTbx ) :
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx 
b/avmedia/source/gstreamer/gstframegrabber.cxx
index c1341d8d6ad4..7f86852c5609 100644
--- a/avmedia/source/gstreamer/gstframegrabber.cxx
+++ b/avmedia/source/gstreamer/gstframegrabber.cxx
@@ -87,7 +87,7 @@ FrameGrabber::~FrameGrabber()
 disposePipeline();
 }
 
-FrameGrabber* FrameGrabber::create( std::u16string_view rURL )
+rtl::Reference FrameGrabber::create( std::u16string_view rURL )
 {
 return new FrameGrabber( rURL );
 }
diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx 
b/avmedia/source/gstreamer/gstframegrabber.hxx
index b99401526506..c706192efd7d 100644
--- a/avmedia/source/gstreamer/gstframegrabber.hxx
+++ b/avmedia/source/gstreamer/gstframegrabber.hxx
@@ -26,6 +26,7 @@
 #include "gstplayer.hxx"
 #include 
 #include 
+#include 
 
 namespace avmedia::gstreamer {
 
@@ -43,7 +44,7 @@ public:
 const FrameGrabber& operator=(const FrameGrabber&) =delete;
 
 // static create method instead of public Ctor
-static FrameGrabber* create( std::u16string_view rURL );
+static rtl::Reference create( std::u16string_view rURL );
 
 virtual ~FrameGrabber() override;
 
diff --git a/avmedia/source/gstreamer/gstplayer.cxx 
b/avmedia/source/gstreamer/gstplayer.cxx
index cab9f4649b6a..2e723ce6efbc 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -897,12 +897,12 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL 
Player::createPlayerWindow( co
 uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber()
 {
 ::osl::MutexGuard aGuard(m_aMutex);
-FrameGrabber* pFrameGrabber = nullptr;
+rtl::Reference pFrameGrabber;
 const awt::Size aPrefSize( getPreferredPlayerWindowSize() );
 
 if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) )
 pFrameGrabber = FrameGrabber::create( maURL );
-SAL_INFO( "avmedia.gstreamer", AVVERSION "created FrameGrabber " << 
pFrameGrabber );
+SAL_INFO( "avmedia.gstreamer", AVVERSION "created FrameGrabber " << 
pFrameGrabber.get() );
 
 return pFrameGrabber;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/xmloff xmloff/source

2021-02-23 Thread Noel (via logerrit)
 include/xmloff/xmlictxt.hxx   |4 
 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |3 +--
 xmloff/source/core/xmlimp.cxx |   11 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit e5f436bc53e0d07654901ef7cc8ff56d04f0686e
Author: Noel 
AuthorDate: Fri Feb 12 13:02:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 24 07:26:23 2021 +0100

restore namespace unwinding in SvXMLImport

accidentally lost during the fastparser conversion

Change-Id: I7d53e9f32dd8cff650b9ffb6dae493419ce8461f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110813
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx
index 1fee33fce666..7216105fcd1f 100644
--- a/include/xmloff/xmlictxt.hxx
+++ b/include/xmloff/xmlictxt.hxx
@@ -50,6 +50,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public 
css::xml::sax::XFastContextHa
 
 SvXMLImport&   mrImport;
 oslInterlockedCountm_nRefCount;
+std::unique_ptr m_pRewindMap;
+
+SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return 
std::move(m_pRewindMap); }
+SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr p) { 
m_pRewindMap = std::move(p); }
 
 protected:
 
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx 
b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index f190a4a18c75..79705901cf2d 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -82,8 +82,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLEmbeddedObjectImpor
 sal_Int32 ,
 const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
-// we have no state, so avoid allocation cost, and just use a single 
instance
-return this;
+return new XMLEmbeddedObjectImportContext_Impl(GetImport(), mxFastHandler);
 }
 
 void XMLEmbeddedObjectImportContext_Impl::startFastElement(
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 33cca656fb1f..8c4b02f50754 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -768,7 +768,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 
Element,
 maNamespaceAttrList->Clear();
 
 maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList );
-processNSAttributes( maNamespaceAttrList );
+std::unique_ptr pRewindMap = processNSAttributes( 
maNamespaceAttrList );
 
 SvXMLImportContextRef xContext;
 const bool bRootContext = maContexts.empty();
@@ -793,6 +793,10 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 
Element,
 if ( !xContext )
 xContext.set( new SvXMLImportContext( *this ) );
 
+// Remember old namespace map.
+if( pRewindMap )
+xContext->PutRewindMap(std::move(pRewindMap));
+
 // Call a startElement at the new context.
 xContext->startFastElement( Element, Attribs );
 
@@ -847,8 +851,13 @@ void SAL_CALL SvXMLImport::endFastElement (sal_Int32 
Element)
 return;
 }
 SvXMLImportContextRef xContext = std::move(maContexts.top());
+// Get a namespace map to rewind.
+std::unique_ptr pRewindMap = xContext->TakeRewindMap();
 maContexts.pop();
 xContext->endFastElement( Element );
+// Rewind a namespace map.
+if (pRewindMap)
+mpNamespaceMap = std::move(pRewindMap);
 }
 
 void SAL_CALL SvXMLImport::endUnknownElement (const OUString & rPrefix, const 
OUString & rLocalName)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/source

2021-02-23 Thread Noel (via logerrit)
 vcl/source/outdev/transparent.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6e01d697ef58155ea9133e2ff19df0442d30a2eb
Author: Noel 
AuthorDate: Tue Feb 23 15:43:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 19:02:45 2021 +0100

use unique_ptr in OutputDevice::EmulateDrawTransparent

Change-Id: I45f04c49055b0bead6b966ed4e682aec70c6e7a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111402
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/outdev/transparent.cxx 
b/vcl/source/outdev/transparent.cxx
index 49c8bfa23e07..3d37b8fe47ba 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -421,7 +421,8 @@ void OutputDevice::EmulateDrawTransparent ( const 
tools::PolyPolygon& rPolyPoly,
 {
 const BitmapPalette& rPal = pW->GetPalette();
 const sal_uInt16 nCount = rPal.GetEntryCount();
-BitmapColor* pMap = 
reinterpret_cast(new sal_uInt8[ nCount * sizeof( BitmapColor ) ]);
+std::unique_ptr xMap(new sal_uInt8[ 
nCount * sizeof( BitmapColor )]);
+BitmapColor* pMap = 
reinterpret_cast(xMap.get());
 
 for( sal_uInt16 i = 0; i < nCount; i++ )
 {
@@ -470,7 +471,6 @@ void OutputDevice::EmulateDrawTransparent ( const 
tools::PolyPolygon& rPolyPoly,
 }
 }
 }
-delete[] reinterpret_cast(pMap);
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang dbaccess/source editeng/source extensions/source include/editeng include/vcl sd/source svx/source sw/inc sw/source vcl/inc vcl/source writerfilter

2021-02-23 Thread Noel (via logerrit)
 compilerplugins/clang/unusedmethods.results   |  316 ++
 dbaccess/source/ui/inc/TableRow.hxx   |1 
 dbaccess/source/ui/inc/imageprovider.hxx  |   16 -
 dbaccess/source/ui/misc/imageprovider.cxx |9 
 dbaccess/source/ui/tabledesign/TableRow.cxx   |9 
 editeng/source/outliner/outlvw.cxx|5 
 extensions/source/bibliography/general.hxx|5 
 include/editeng/outliner.hxx  |1 
 include/vcl/toolkit/fixed.hxx |1 
 sd/source/ui/annotations/annotationwindow.hxx |1 
 svx/source/inc/StylesPreviewWindow.hxx|5 
 svx/source/tbxctrls/StylesPreviewWindow.cxx   |   13 
 sw/inc/AnnotationWin.hxx  |2 
 sw/source/uibase/docvw/SidebarTxtControl.hxx  |2 
 vcl/inc/graphic/UnoBinaryDataContainer.hxx|7 
 vcl/source/control/fixed.cxx  |5 
 vcl/source/filter/FilterConfigCache.hxx   |3 
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |1 
 18 files changed, 157 insertions(+), 245 deletions(-)

New commits:
commit ba20fcaa257f4ce8491e4303c0e05dc5460c18fe
Author: Noel 
AuthorDate: Tue Feb 23 13:17:29 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 19:02:25 2021 +0100

loplugin:unusedmethods

Change-Id: Ie0534244cc7a30ad006e65baf125c59757c90d50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111388
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index de8f37e5db59..f832e2c29e01 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -100,6 +100,8 @@ dbaccess/source/ui/inc/FieldControls.hxx:67
 class rtl::OUString dbaui::OPropNumericEditCtrl::get_text() const
 dbaccess/source/ui/inc/FieldControls.hxx:72
 void dbaui::OPropNumericEditCtrl::set_min(int)
+dbaccess/source/ui/inc/imageprovider.hxx:92
+class Image dbaui::ImageProvider::getDefaultImage(int)
 dbaccess/source/ui/inc/indexcollection.hxx:52
 class __gnu_debug::_Safe_iterator > >, class 
std::__debug::vector >, struct std::random_access_iterator_tag> 
dbaui::OIndexCollection::begin() const
 dbaccess/source/ui/inc/indexcollection.hxx:56
@@ -110,6 +112,8 @@ dbaccess/source/ui/inc/indexcollection.hxx:63
 class __gnu_debug::_Safe_iterator > >, class 
std::__debug::vector >, struct std::random_access_iterator_tag> 
dbaui::OIndexCollection::findOriginal(const class rtl::OUString &) const
 dbaccess/source/ui/inc/sbamultiplex.hxx:384
 class cppu::OInterfaceContainerHelper * 
dbaui::SbaXVetoableChangeMultiplexer::getContainer(const class rtl::OUString &)
+dbaccess/source/ui/inc/TableRow.hxx:41
+ dbaui::OTableRow::OTableRow(const class 
com::sun::star::uno::Reference &)
 dbaccess/source/ui/inc/unodatbr.hxx:313
 _Bool dbaui::SbaTableQueryBrowser::implCopyObject(class ODataClipboard 
&,const class weld::TreeIter &,int)
 desktop/source/deployment/gui/dp_gui_dialog2.hxx:132
@@ -140,6 +144,8 @@ editeng/inc/edtspell.hxx:103
 class __gnu_debug::_Safe_iterator > 
>, class std::__debug::vector >, struct 
std::random_access_iterator_tag> WrongList::begin() const
 editeng/inc/edtspell.hxx:104
 class __gnu_debug::_Safe_iterator > 
>, class std::__debug::vector >, struct 
std::random_access_iterator_tag> WrongList::end() const
+extensions/source/bibliography/general.hxx:152
+class BibDataManager * BibGeneralPage::GetDataManager()
 extensions/source/scanner/scanner.hxx:79
 void ScannerManager::SetData(void *)
 hwpfilter/source/mzstring.h:100
@@ -150,8 +156,6 @@ hwpfilter/source/mzstring.h:103
 class MzString & MzString::operator<<(short)
 idl/source/prj/svidl.cxx:105
 int main(int,char **)
-include/basegfx/color/bcolormodifier.hxx:76
-_Bool basegfx::BColorModifier::operator!=(const class 
basegfx::BColorModifier &) const
 include/basegfx/curve/b2dcubicbezier.hxx:51
 _Bool basegfx::B2DCubicBezier::operator==(const class 
basegfx::B2DCubicBezier &) const
 include/basegfx/curve/b2dcubicbezier.hxx:52
@@ -334,6 +338,8 @@ include/basegfx/vector/b3dvector.hxx:75
 class basegfx::B3DVector & basegfx::B3DVector::operator*=(const class 
basegfx::B3DVector &)
 include/basic/sbxvar.hxx:138
 struct SbxValues * SbxValue::data()
+include/codemaker/commoncpp.hxx:47
+class rtl::OString codemaker::cpp::translateUnoToCppType(enum 
codemaker::UnoType::Sort,class std::basic_string_view >)
 include/codemaker/global.hxx:55
 class FileStream & operator<<(class FileStream &,const class rtl::OString 
*)
 include/codemaker/global.hxx:57
@@ -480,11 +486,11 @@ include/editeng/editeng.hxx:243
 enum TextRotation EditEngine::GetRotation() const
 include/editeng/editeng.hxx:468
 _Bool EditEngine::(anonymous)::__invoke(const class SvxFieldData *)
-include/editeng/editview.hxx:169
-class 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/svx include/vcl sc/inc sc/source svx/source sw/source vcl/source

2021-02-23 Thread Noel (via logerrit)
 compilerplugins/clang/constantparam.bitmask.results  |   10 
 compilerplugins/clang/constantparam.booleans.results | 1298 +++
 compilerplugins/clang/constantparam.constructors.results |  294 +--
 compilerplugins/clang/constantparam.numbers.results  | 1086 +---
 compilerplugins/clang/constantparam.py   |2 
 editeng/source/outliner/outlvw.cxx   |4 
 include/editeng/outliner.hxx |2 
 include/svx/fontworkgallery.hxx  |2 
 include/vcl/toolkit/button.hxx   |2 
 sc/inc/document.hxx  |2 
 sc/inc/drwlayer.hxx  |2 
 sc/source/core/data/documen2.cxx |4 
 sc/source/core/data/drwlayer.cxx |6 
 svx/source/tbxctrls/fontworkgallery.cxx  |4 
 sw/source/uibase/uiview/viewdraw.cxx |2 
 vcl/source/control/button.cxx|4 
 16 files changed, 1314 insertions(+), 1410 deletions(-)

New commits:
commit 4b9ad812facbd9416d9658325791bad3ab48934d
Author: Noel 
AuthorDate: Tue Feb 23 14:35:04 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 17:43:06 2021 +0100

loplugin:constantparam

Change-Id: Ieaee9a3e3ef4aa9bc390ddb198ee1718f635bcbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111391
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/constantparam.bitmask.results 
b/compilerplugins/clang/constantparam.bitmask.results
index b651e6b9c82f..90fdcd09bd07 100644
--- a/compilerplugins/clang/constantparam.bitmask.results
+++ b/compilerplugins/clang/constantparam.bitmask.results
@@ -4,7 +4,7 @@ codemaker/source/javamaker/classfile.hxx:152
 codemaker/source/javamaker/classfile.hxx:167
 void codemaker::javamaker::ClassFile::addField(enum 
codemaker::javamaker::ClassFile::AccessFlags,const class rtl::OString &,const 
class rtl::OString &,unsigned short,const class rtl::OString &)
 enum codemaker::javamaker::ClassFile::AccessFlags accessFlags setBits=0x1
-dbaccess/source/filter/xml/xmlExport.hxx:164
+dbaccess/source/filter/xml/xmlExport.hxx:163
 void dbaxml::ODBExport::ODBExport(const class 
com::sun::star::uno::Reference 
&,const class rtl::OUString &,enum SvXMLExportFlags)
 enum SvXMLExportFlags nExportFlag setBits=0x400 clearBits=0x200
 include/basegfx/polygon/b2dpolygontools.hxx:145
@@ -13,10 +13,10 @@ include/basegfx/polygon/b2dpolygontools.hxx:145
 include/framework/framelistanalyzer.hxx:185
 void framework::FrameListAnalyzer::FrameListAnalyzer(const class 
com::sun::star::uno::Reference 
&,const class com::sun::star::uno::Reference &,enum FrameAnalyzerFlags)
 enum FrameAnalyzerFlags eDetectMode setBits=0x4
-include/sfx2/objsh.hxx:477
+include/sfx2/objsh.hxx:467
 void SfxObjectShell::FinishedLoading(enum SfxLoadedFlags)
 enum SfxLoadedFlags nWhich setBits=0x1
-include/svtools/brwbox.hxx:511
+include/svtools/brwbox.hxx:510
 void BrowseBox::InsertDataColumn(unsigned short,const class rtl::OUString 
&,long,enum HeaderBarItemBits,unsigned short)
 enum HeaderBarItemBits nBits setBits=0x400 clearBits=0x3ec
 include/vcl/wizardmachine.hxx:139
@@ -37,10 +37,10 @@ sc/source/ui/view/cellsh1.cxx:103
 sc/source/ui/view/cellsh1.cxx:126
 class rtl::OUString FlagsToString(enum InsertDeleteFlags,enum 
InsertDeleteFlags)
 enum InsertDeleteFlags nFlagsMask setBits=0x87f clearBits=0x700
-sw/source/core/view/viewsh.cxx:717
+sw/source/core/view/viewsh.cxx:719
 void lcl_InvalidateAllContent(class SwViewShell &,enum SwInvalidateFlags)
 enum SwInvalidateFlags nInv setBits=0x2
-sw/source/filter/html/swhtml.hxx:687
+sw/source/filter/html/swhtml.hxx:689
 void SwHTMLParser::SetFrameFormatAttrs(class SfxItemSet &,enum 
HtmlFrameFormatFlags,class SfxItemSet &)
 enum HtmlFrameFormatFlags nFlags setBits=0x1
 sw/source/filter/ww8/wrtw8esh.cxx:1545
diff --git a/compilerplugins/clang/constantparam.booleans.results 
b/compilerplugins/clang/constantparam.booleans.results
index 18cf2a58bb2e..8076a6771b2c 100644
--- a/compilerplugins/clang/constantparam.booleans.results
+++ b/compilerplugins/clang/constantparam.booleans.results
@@ -6,7 +6,7 @@ accessibility/source/standard/vclxaccessibletoolbox.cxx:101
 void (anonymous 
namespace)::OToolBoxWindowItem::OToolBoxWindowItem(int,const class 
com::sun::star::uno::Reference 
&,const class com::sun::star::uno::Reference &,const class 
com::sun::star::uno::Reference &)
 int _nIndexInParent
 0
-basctl/source/basicide/moduldlg.hxx:103
+basctl/source/basicide/moduldlg.hxx:107
 void basctl::LibDialog::EnableReference(_Bool)
 _Bool b
 0
@@ -14,7 +14,7 @@ basctl/source/inc/scriptdocument.hxx:88
 void basctl::ScriptDocument::ScriptDocument(enum 
basctl::ScriptDocument::SpecialDocument)
 enum 

[Libreoffice-commits] core.git: compilerplugins/clang include/vcl sw/source vcl/inc

2021-02-23 Thread Noel (via logerrit)
 compilerplugins/clang/unnecessaryvirtual.results |   30 ---
 include/vcl/toolkit/menubtn.hxx  |2 -
 sw/source/core/inc/MarkManager.hxx   |2 -
 vcl/inc/jsdialog/jsdialogbuilder.hxx |2 -
 4 files changed, 24 insertions(+), 12 deletions(-)

New commits:
commit e549d811466c6e77815f60b64dd0a9f949e7f518
Author: Noel 
AuthorDate: Tue Feb 23 12:42:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 14:56:44 2021 +0100

loplugin:unnecessaryvirtual

Change-Id: I792a717306c232cf200940f9e3944f91885e426a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111387
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unnecessaryvirtual.results 
b/compilerplugins/clang/unnecessaryvirtual.results
index 1d3821d7c2af..59268ce03547 100644
--- a/compilerplugins/clang/unnecessaryvirtual.results
+++ b/compilerplugins/clang/unnecessaryvirtual.results
@@ -296,8 +296,10 @@ include/vbahelper/vbareturntypes.hxx:39
 type-parameter-0-0 ooo::vba::DefaultReturnHelper::getValue()
 include/vcl/customweld.hxx:45
 class rtl::OUString weld::CustomWidgetController::GetHelpText()const
-include/vcl/toolkit/dialog.hxx:98
+include/vcl/toolkit/dialog.hxx:99
 void Dialog::set_content_area(class VclBox *,)
+include/vcl/toolkit/menubtn.hxx:67
+void MenuButton::Select()
 include/vcl/weld.hxx:100
 void weld::Widget::set_visible(_Bool,)
 sc/source/core/opencl/formulagroupcl.cxx:1061
@@ -400,18 +402,26 @@ slideshow/source/inc/shape.hxx:221
 void slideshow::internal::Shape::setIsForeground(const _Bool,)
 sw/inc/flypos.hxx:37
 void SwPosFlyFrame::~SwPosFlyFrame()
+sw/source/core/inc/MarkManager.hxx:104
+void sw::mark::MarkManager::LOKUpdateActiveField(class SfxViewShell *,)
 toolkit/inc/controls/geometrycontrolmodel.hxx:182
 void OGeometryControlModel::fillProperties(class 
com::sun::star::uno::Sequence &,class 
com::sun::star::uno::Sequence &,)const
-vcl/inc/jsdialog/jsdialogbuilder.hxx:190
+vcl/inc/jsdialog/jsdialogbuilder.hxx:90
+void JSDialogSender::sendFullUpdate(_Bool,)
+vcl/inc/jsdialog/jsdialogbuilder.hxx:92
+void JSDialogSender::sendUpdate(class VclPtr,_Bool,)
+vcl/inc/jsdialog/jsdialogbuilder.hxx:250
 void JSWidget::show()
-vcl/inc/jsdialog/jsdialogbuilder.hxx:196
+vcl/inc/jsdialog/jsdialogbuilder.hxx:256
 void JSWidget::hide()
-vcl/inc/jsdialog/jsdialogbuilder.hxx:203
+vcl/inc/jsdialog/jsdialogbuilder.hxx:263
 void JSWidget::set_sensitive(_Bool,)
-vcl/inc/jsdialog/jsdialogbuilder.hxx:209
+vcl/inc/jsdialog/jsdialogbuilder.hxx:271
 class com::sun::star::uno::Reference JSWidget::get_drop_target()
-vcl/inc/salbmp.hxx:118
-void SalBitmap::updateChecksum()const
+vcl/inc/jsdialog/jsdialogbuilder.hxx:279
+void JSWidget::freeze()
+vcl/inc/jsdialog/jsdialogbuilder.hxx:285
+void JSWidget::thaw()
 vcl/inc/salframe.hxx:145
 void SalFrame::SetRepresentedURL(const class rtl::OUString &,)
 vcl/inc/salframe.hxx:194
@@ -424,9 +434,11 @@ vcl/inc/salobj.hxx:49
 void SalObject::Enable(_Bool,)
 vcl/inc/salprn.hxx:116
 enum SalPrinterError SalPrinter::GetErrorCode()
+vcl/inc/salvtables.hxx:1577
+_Bool SalInstanceTreeView::get_iter_abs_pos(class weld::TreeIter 
&,int,)const
 vcl/inc/skia/gdiimpl.hxx:236
 void SkiaSalGraphicsImpl::createSurface()
-vcl/inc/unx/gtk/gtkdata.hxx:121
+vcl/inc/unx/gtk/gtkdata.hxx:180
 int GtkSalDisplay::CaptureMouse(class SalFrame *,)
 vcl/inc/unx/saldata.hxx:50
 void X11SalData::Init()
@@ -450,7 +462,7 @@ vcl/inc/unx/saldisp.hxx:197
 _Bool SalXLib::CheckTimeout(_Bool,)
 vcl/inc/unx/saldisp.hxx:404
 void SalX11Display::Yield()
-vcl/inc/unx/salframe.h:207
+vcl/inc/unx/salframe.h:206
 void X11SalFrame::updateGraphics(_Bool,)
 vcl/inc/unx/salinst.h:41
 class SalX11Display * X11SalInstance::CreateDisplay()const
diff --git a/include/vcl/toolkit/menubtn.hxx b/include/vcl/toolkit/menubtn.hxx
index 234383b68b2e..db4f9f44f5d6 100644
--- a/include/vcl/toolkit/menubtn.hxx
+++ b/include/vcl/toolkit/menubtn.hxx
@@ -64,7 +64,7 @@ public:
 virtual voidKeyInput( const KeyEvent& rKEvt ) override;
 
 virtual voidActivate() override;
-virtual voidSelect();
+voidSelect();
 
 voidExecuteMenu();
 boolInPopupMode() const;
diff --git a/sw/source/core/inc/MarkManager.hxx 
b/sw/source/core/inc/MarkManager.hxx
index 94cd907b0f12..11db9719d439 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -101,7 +101,7 @@ namespace sw::mark {
 
 virtual void NotifyCursorUpdate(const SwCursorShell& rCursorShell) 
override;
 virtual void ClearFieldActivation() override;
-virtual void LOKUpdateActiveField(SfxViewShell* pViewShell);
+void LOKUpdateActiveField(SfxViewShell* pViewShell);
 
 void dumpAsXml(xmlTextWriterPtr pWriter) const;
 
diff --git 

[Libreoffice-commits] core.git: compilerplugins/clang include/sfx2 sc/source sd/source sfx2/source

2021-02-23 Thread Noel (via logerrit)
 compilerplugins/clang/unusedfields.only-used-in-constructor.results |  132 
+-
 compilerplugins/clang/unusedfields.py   |3 
 compilerplugins/clang/unusedfields.readonly.results |   34 +-
 compilerplugins/clang/unusedfields.untouched.results|   58 ++--
 compilerplugins/clang/unusedfields.writeonly.results|   90 
+++---
 include/sfx2/docmacromode.hxx   |1 
 sc/source/filter/xml/celltextparacontext.cxx|1 
 sc/source/filter/xml/celltextparacontext.hxx|1 
 sd/source/ui/annotations/annotationtag.cxx  |2 
 sd/source/ui/annotations/annotationwindow.cxx   |5 
 sd/source/ui/annotations/annotationwindow.hxx   |6 
 sfx2/source/doc/docmacromode.cxx|5 
 12 files changed, 174 insertions(+), 164 deletions(-)

New commits:
commit e7f82300b9a6317ecca2a338234cc27c12b5cb2b
Author: Noel 
AuthorDate: Tue Feb 23 12:38:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 13:33:33 2021 +0100

loplugin:unusedfields

Change-Id: Ieb1b890040964e755de5bdf5f8576d4d3bd8a407
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111386
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git 
a/compilerplugins/clang/unusedfields.only-used-in-constructor.results 
b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
index f25624a14c94..846fb0395a50 100644
--- a/compilerplugins/clang/unusedfields.only-used-in-constructor.results
+++ b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
@@ -154,7 +154,7 @@ dbaccess/source/core/dataaccess/connection.hxx:101
 dbaccess::OConnection m_nInAppend std::atomic
 dbaccess/source/core/inc/databasecontext.hxx:84
 dbaccess::ODatabaseContext m_aBasicDLL class BasicDLL
-desktop/qa/desktop_lib/test_desktop_lib.cxx:2905
+desktop/qa/desktop_lib/test_desktop_lib.cxx:2883
   class AllSettings &
 drawinglayer/inc/texture/texture3d.hxx:55
 drawinglayer::texture::GeoTexSvxBitmapEx maBitmap class Bitmap
@@ -342,8 +342,6 @@ include/vcl/pdf/PDFAnnotationMarker.hxx:65
 vcl::pdf::PDFAnnotationMarkerHighlight meTextMarkerType enum 
vcl::pdf::PDFTextMarkerType
 include/xmloff/shapeimport.hxx:56
 SdXML3DLightContext mbSpecular _Bool
-include/xmloff/xmltkmap.hxx:38
-SvXMLTokenMapEntry nFastToken sal_Int32
 libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx:51
 GtvApplicationWindow parent_instance GtkApplicationWindow
 libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx:55
@@ -384,25 +382,23 @@ oox/source/drawingml/diagram/layoutnodecontext.cxx:135
 oox::drawingml::(anonymous namespace)::ChooseContext msName class 
rtl::OUString
 oox/source/drawingml/hyperlinkcontext.hxx:41
 oox::drawingml::HyperLinkContext maProperties class oox::PropertyMap &
-oox/source/ppt/timenodelistcontext.cxx:200
-oox::ppt::(anonymous namespace)::MediaNodeContext mbIsNarration _Bool
-oox/source/ppt/timenodelistcontext.cxx:201
+oox/source/ppt/timenodelistcontext.cxx:209
 oox::ppt::(anonymous namespace)::MediaNodeContext mbFullScrn _Bool
-oox/source/ppt/timenodelistcontext.cxx:395
+oox/source/ppt/timenodelistcontext.cxx:404
 oox::ppt::(anonymous namespace)::SequenceTimeNodeContext mbConcurrent _Bool
-oox/source/ppt/timenodelistcontext.cxx:396
+oox/source/ppt/timenodelistcontext.cxx:405
 oox::ppt::(anonymous namespace)::SequenceTimeNodeContext mnNextAc sal_Int32
-oox/source/ppt/timenodelistcontext.cxx:396
+oox/source/ppt/timenodelistcontext.cxx:405
 oox::ppt::(anonymous namespace)::SequenceTimeNodeContext mnPrevAc sal_Int32
-oox/source/ppt/timenodelistcontext.cxx:632
+oox/source/ppt/timenodelistcontext.cxx:641
 oox::ppt::(anonymous namespace)::AnimContext mnValueType sal_Int32
-oox/source/ppt/timenodelistcontext.cxx:714
+oox/source/ppt/timenodelistcontext.cxx:723
 oox::ppt::(anonymous namespace)::AnimScaleContext mbZoomContents _Bool
-oox/source/ppt/timenodelistcontext.cxx:854
+oox/source/ppt/timenodelistcontext.cxx:863
 oox::ppt::(anonymous namespace)::AnimMotionContext msPtsTypes class 
rtl::OUString
-oox/source/ppt/timenodelistcontext.cxx:855
+oox/source/ppt/timenodelistcontext.cxx:864
 oox::ppt::(anonymous namespace)::AnimMotionContext mnPathEditMode sal_Int32
-oox/source/ppt/timenodelistcontext.cxx:856
+oox/source/ppt/timenodelistcontext.cxx:865
 oox::ppt::(anonymous namespace)::AnimMotionContext mnAngle sal_Int32
 pyuno/source/module/pyuno_callable.cxx:45
 pyuno::(anonymous namespace)::PyUNO_callable ob_base PyObject
@@ -418,18 +414,20 @@ sal/qa/osl/condition/osl_Condition.cxx:202
 osl_Condition::wait bRes2 _Bool
 sal/qa/osl/condition/osl_Condition.cxx:273
 osl_Condition::check bRes2 _Bool
-sal/qa/osl/file/osl_File.cxx:1588
+sal/qa/osl/file/osl_File.cxx:1387
+

[Libreoffice-commits] core.git: compilerplugins/clang cpputools/source hwpfilter/source lingucomponent/source linguistic/source slideshow/source writerperfect/source

2021-02-23 Thread Noel (via logerrit)
 compilerplugins/clang/refcounting.cxx   |   54 +++-
 compilerplugins/clang/test/refcounting.cxx  |   11 
 cpputools/source/unoexe/unoexe.cxx  |6 +-
 hwpfilter/source/hwpreader.cxx  |5 -
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx |2 
 linguistic/source/spelldta.cxx  |5 +
 slideshow/source/engine/shapes/gdimtftools.cxx  |7 +-
 writerperfect/source/common/DocumentHandler.cxx |5 -
 8 files changed, 77 insertions(+), 18 deletions(-)

New commits:
commit c13133b613fda3255fab60c03012aff93a5f2f02
Author: Noel 
AuthorDate: Wed Feb 10 20:33:16 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 12:11:31 2021 +0100

loplugin:refcounting check for managing OWeakObject with raw pointer

Change-Id: I7471725f1e658940b5e6993361c327be6ccf0d31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111064
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/refcounting.cxx 
b/compilerplugins/clang/refcounting.cxx
index f15e423aebd2..7f1d7f38fba8 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -57,6 +57,7 @@ public:
 bool VisitFunctionDecl(const FunctionDecl *);
 bool VisitTypeLoc(clang::TypeLoc typeLoc);
 bool VisitCXXDeleteExpr(const CXXDeleteExpr *);
+bool VisitBinaryOperator(const BinaryOperator *);
 
 // Creation of temporaries with one argument are represented by
 // CXXFunctionalCastExpr, while any other number of arguments are
@@ -600,9 +601,8 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * 
fieldDecl) {
 
 
 bool RefCounting::VisitVarDecl(const VarDecl * varDecl) {
-if (ignoreLocation(varDecl)) {
+if (ignoreLocation(varDecl))
 return true;
-}
 
 checkUnoReference(varDecl->getType(), varDecl, nullptr, "var");
 
@@ -646,6 +646,56 @@ bool RefCounting::VisitVarDecl(const VarDecl * varDecl) {
 varDecl->getLocation())
 << varDecl->getSourceRange();
 }
+
+if (varDecl->getType()->isPointerType() && varDecl->getInit())
+{
+auto newExpr = 
dyn_cast(compat::IgnoreImplicit(varDecl->getInit()));
+if (newExpr)
+{
+StringRef fileName = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(varDecl)));
+if (loplugin::isSamePathname(fileName, SRCDIR 
"/cppuhelper/source/component_context.cxx"))
+return true;
+auto pointeeType = varDecl->getType()->getPointeeType();
+if (containsOWeakObjectSubclass(pointeeType))
+report(
+DiagnosticsEngine::Warning,
+"cppu::OWeakObject subclass %0 being managed via raw 
pointer, should be managed via rtl::Reference",
+varDecl->getLocation())
+<< pointeeType
+<< varDecl->getSourceRange();
+}
+}
+return true;
+}
+
+bool RefCounting::VisitBinaryOperator(const BinaryOperator * binaryOperator)
+{
+if (ignoreLocation(binaryOperator))
+return true;
+if (binaryOperator->getOpcode() != BO_Assign)
+return true;
+if (!binaryOperator->getLHS()->getType()->isPointerType())
+return true;
+
+// deliberately does not want to keep track at the allocation site
+StringRef fileName = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(binaryOperator)));
+if (loplugin::isSamePathname(fileName, SRCDIR 
"/vcl/unx/generic/dtrans/X11_selection.cxx"))
+return true;
+
+auto newExpr = 
dyn_cast(compat::IgnoreImplicit(binaryOperator->getRHS()));
+if (newExpr)
+{
+auto pointeeType = 
binaryOperator->getLHS()->getType()->getPointeeType();
+if (containsOWeakObjectSubclass(pointeeType))
+{
+report(
+DiagnosticsEngine::Warning,
+"cppu::OWeakObject subclass %0 being managed via raw pointer, 
should be managed via rtl::Reference",
+compat::getBeginLoc(binaryOperator))
+<< pointeeType
+<< binaryOperator->getSourceRange();
+}
+}
 return true;
 }
 
diff --git a/compilerplugins/clang/test/refcounting.cxx 
b/compilerplugins/clang/test/refcounting.cxx
index 8a1f277829cc..ca27ac0614a7 100644
--- a/compilerplugins/clang/test/refcounting.cxx
+++ b/compilerplugins/clang/test/refcounting.cxx
@@ -18,6 +18,8 @@ namespace cppu
 {
 class OWeakObject
 {
+void acquire();
+void release();
 };
 }
 
@@ -72,4 +74,13 @@ void dummy(Dependent* p1, Dependent* p2)
 p2->g();
 }
 
+void foo4()
+{
+// expected-error@+1 {{cppu::OWeakObject subclass 'UnoObject' being 
managed via raw pointer, should be managed via rtl::Reference 
[loplugin:refcounting]}}
+UnoObject* p = new UnoObject;
+(void)p;
+// expected-error@+1 

[Libreoffice-commits] core.git: 2 commits - unotools/source writerfilter/source

2021-02-23 Thread Noel (via logerrit)
 unotools/source/config/itemholder1.cxx|3 ++-
 unotools/source/misc/eventlisteneradapter.cxx |2 +-
 unotools/source/misc/mediadescriptor.cxx  |   15 ++-
 unotools/source/ucbhelper/ucbhelper.cxx   |6 ++
 unotools/source/ucbhelper/ucblockbytes.cxx|   15 +++
 unotools/source/ucbhelper/ucbstreamhelper.cxx |3 +--
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx   |   10 --
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |4 ++--
 8 files changed, 25 insertions(+), 33 deletions(-)

New commits:
commit 137a93776c91765176867157669b1f95cffb8ae8
Author: Noel 
AuthorDate: Tue Feb 23 10:27:29 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 10:39:43 2021 +0100

loplugin:refcounting in unotools

Change-Id: I7c4540a6b2975c590b36332f23d15882a79491a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111376
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/unotools/source/config/itemholder1.cxx 
b/unotools/source/config/itemholder1.cxx
index bad26a977108..23149a6af6b8 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -74,7 +75,7 @@ ItemHolder1::~ItemHolder1()
 
 void ItemHolder1::holdConfigItem(EItem eItem)
 {
-static ItemHolder1* pHolder = new ItemHolder1();
+static rtl::Reference pHolder = new ItemHolder1();
 pHolder->impl_addItem(eItem);
 }
 
diff --git a/unotools/source/misc/eventlisteneradapter.cxx 
b/unotools/source/misc/eventlisteneradapter.cxx
index d9736905de81..b899db5c0723 100644
--- a/unotools/source/misc/eventlisteneradapter.cxx
+++ b/unotools/source/misc/eventlisteneradapter.cxx
@@ -146,7 +146,7 @@ namespace utl
 return;
 }
 
-OEventListenerImpl* pListenerImpl = new OEventListenerImpl(this, 
_rxComp);
+rtl::Reference pListenerImpl = new 
OEventListenerImpl(this, _rxComp);
 m_pImpl->aListeners.emplace_back(pListenerImpl);
 }
 
diff --git a/unotools/source/misc/mediadescriptor.cxx 
b/unotools/source/misc/mediadescriptor.cxx
index d73f3c5dd2eb..1021b3ed 100644
--- a/unotools/source/misc/mediadescriptor.cxx
+++ b/unotools/source/misc/mediadescriptor.cxx
@@ -545,8 +545,7 @@ bool MediaDescriptor::impl_openStreamWithPostData( const 
css::uno::Reference< cs
 MediaDescriptor::PROP_INTERACTIONHANDLER(),
 css::uno::Reference< css::task::XInteractionHandler >());
 css::uno::Reference< css::ucb::XProgressHandler > xProgress;
-::ucbhelper::CommandEnvironment* pCommandEnv = new 
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
-css::uno::Reference< css::ucb::XCommandEnvironment > 
xCommandEnv(static_cast< css::ucb::XCommandEnvironment* >(pCommandEnv), 
css::uno::UNO_QUERY);
+rtl::Reference<::ucbhelper::CommandEnvironment> xCommandEnv = new 
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
 
 // media type
 OUString sMediaType = 
getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), OUString());
@@ -615,12 +614,10 @@ bool MediaDescriptor::impl_openStreamWithURL( const 
OUString& sURL, bool bLockFi
 MediaDescriptor::PROP_AUTHENTICATIONHANDLER(),
 css::uno::Reference< css::task::XInteractionHandler >());
 
-comphelper::StillReadWriteInteraction* pInteraction = new 
comphelper::StillReadWriteInteraction(xOrgInteraction,xAuthenticationInteraction);
-css::uno::Reference< css::task::XInteractionHandler > 
xInteraction(static_cast< css::task::XInteractionHandler* >(pInteraction), 
css::uno::UNO_QUERY);
+rtl::Reference xInteraction = new 
comphelper::StillReadWriteInteraction(xOrgInteraction,xAuthenticationInteraction);
 
 css::uno::Reference< css::ucb::XProgressHandler > xProgress;
-::ucbhelper::CommandEnvironment* pCommandEnv = new 
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
-css::uno::Reference< css::ucb::XCommandEnvironment > 
xCommandEnv(static_cast< css::ucb::XCommandEnvironment* >(pCommandEnv), 
css::uno::UNO_QUERY);
+rtl::Reference<::ucbhelper::CommandEnvironment> xCommandEnv = new 
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
 
 // try to create the content
 // no content -> no stream => return immediately with FALSE
@@ -679,7 +676,7 @@ bool MediaDescriptor::impl_openStreamWithURL( const 
OUString& sURL, bool bLockFi
 // later a second time.
 // All other errors must be handled as real error an
 // break this method.
-if (!pInteraction->wasWriteError() || bModeRequestedExplicitly)
+if (!xInteraction->wasWriteError() || bModeRequestedExplicitly)
 {
 SAL_WARN("unotools.misc","url: '" << sURL << "' " << 
exceptionToString(ex));
 // If the protocol is webdav, then 

[Libreoffice-commits] core.git: 2 commits - i18npool/source toolkit/inc toolkit/source

2021-02-23 Thread Noel (via logerrit)
 i18npool/source/localedata/saxparser.cxx  |   10 --
 toolkit/inc/controls/accessiblecontrolcontext.hxx |4 ++--
 toolkit/inc/controls/geometrycontrolmodel.hxx |2 ++
 toolkit/inc/controls/roadmapentry.hxx |2 +-
 toolkit/source/awt/vclxaccessiblecomponent.cxx|   12 +---
 toolkit/source/awt/vclxdevice.cxx |   11 +--
 toolkit/source/awt/vclxgraphics.cxx   |2 +-
 toolkit/source/awt/vclxprinter.cxx|2 +-
 toolkit/source/awt/vclxtoolkit.cxx|   12 +---
 toolkit/source/awt/vclxwindow.cxx |2 +-
 toolkit/source/awt/vclxwindows.cxx|2 +-
 toolkit/source/controls/accessiblecontrolcontext.cxx  |6 +++---
 toolkit/source/controls/controlmodelcontainerbase.cxx |6 +++---
 toolkit/source/controls/dialogcontrol.cxx |8 
 toolkit/source/controls/roadmapcontrol.cxx|8 
 toolkit/source/helper/unowrapper.cxx  |6 ++
 toolkit/source/helper/vclunohelper.cxx|9 -
 17 files changed, 48 insertions(+), 56 deletions(-)

New commits:
commit a079e9010398ba2c33cf2509ff511e711b5e5b37
Author: Noel 
AuthorDate: Tue Feb 23 09:41:33 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 09:25:07 2021 +0100

loplugin:refcounting in toolkit

Change-Id: I4a65ee848eed7c48340c73d3144b4a1e29ab867c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111370
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/toolkit/inc/controls/accessiblecontrolcontext.hxx 
b/toolkit/inc/controls/accessiblecontrolcontext.hxx
index 6a07e3e89865..ea4f959b853e 100644
--- a/toolkit/inc/controls/accessiblecontrolcontext.hxx
+++ b/toolkit/inc/controls/accessiblecontrolcontext.hxx
@@ -58,14 +58,14 @@ namespace toolkit
 the uno control's XAccessible interface. This must be an XControl, 
from which an XControlModel
 can be retrieved.
 */
-static OAccessibleControlContext* create(
+static rtl::Reference create(
 const css::uno::Reference< css::accessibility::XAccessible >& 
_rxCreator
 );
 
-private:
 // XInterface
 DECLARE_XINTERFACE( )
 DECLARE_XTYPEPROVIDER( )
+private:
 
 // XAccessibleContext
 virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) override;
diff --git a/toolkit/inc/controls/geometrycontrolmodel.hxx 
b/toolkit/inc/controls/geometrycontrolmodel.hxx
index 8c1109c30396..2d87f7cca2af 100644
--- a/toolkit/inc/controls/geometrycontrolmodel.hxx
+++ b/toolkit/inc/controls/geometrycontrolmodel.hxx
@@ -103,11 +103,13 @@ namespace com::sun::star {
 // XAggregation
 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _aType 
) override;
 
+public:
 // XInterface
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& 
aType ) override;
 virtual void SAL_CALL acquire(  ) throw() override;
 virtual void SAL_CALL release(  ) throw() override;
 
+protected:
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
 
diff --git a/toolkit/inc/controls/roadmapentry.hxx 
b/toolkit/inc/controls/roadmapentry.hxx
index 81aa9b74dff0..b8490439c99c 100644
--- a/toolkit/inc/controls/roadmapentry.hxx
+++ b/toolkit/inc/controls/roadmapentry.hxx
@@ -42,10 +42,10 @@ class ORoadmapEntry final : public ORoadmapEntry_Base
 public:
ORoadmapEntry();
 
-private:
 DECLARE_XINTERFACE()// merge XInterface implementations
 DECLARE_XTYPEPROVIDER() // merge XTypeProvider implementations
 
+private:
 /// @see css::beans::XPropertySet
 virtual css::uno::Reference< css::beans::XPropertySetInfo >
 SAL_CALL getPropertySetInfo() override;
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx 
b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 9ce8f6a61d7c..101307bf1d96 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -631,20 +631,18 @@ uno::Reference< accessibility::XAccessibleRelationSet > 
VCLXAccessibleComponent:
 {
 OExternalLockGuard aGuard( this );
 
-utl::AccessibleRelationSetHelper* pRelationSetHelper = new 
utl::AccessibleRelationSetHelper;
-uno::Reference< accessibility::XAccessibleRelationSet > xSet = 
pRelationSetHelper;
+rtl::Reference pRelationSetHelper = new 
utl::AccessibleRelationSetHelper;
 FillAccessibleRelationSet( *pRelationSetHelper );
-return xSet;
+return pRelationSetHelper;
 }
 
 uno::Reference< accessibility::XAccessibleStateSet > 
VCLXAccessibleComponent::getAccessibleStateSet(  )
 {
 OExternalLockGuard aGuard( this );
 
-utl::AccessibleStateSetHelper* pStateSetHelper = new 
utl::AccessibleStateSetHelper;
-

[Libreoffice-commits] core.git: comphelper/source

2021-02-22 Thread Noel (via logerrit)
 comphelper/source/misc/docpasswordhelper.cxx |5 +---
 comphelper/source/xml/attributelist.cxx  |3 --
 comphelper/source/xml/ofopxmlhelper.cxx  |   31 +++
 3 files changed, 16 insertions(+), 23 deletions(-)

New commits:
commit d678a580419dda0b2b3d9ef13b027c769ac7b71b
Author: Noel 
AuthorDate: Mon Feb 22 19:45:09 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 08:39:44 2021 +0100

loplugin:refcounting in comphelper

Change-Id: Ie3e1fcdbdbd01448a9eea23a899a924e6b626257
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111354
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/comphelper/source/misc/docpasswordhelper.cxx 
b/comphelper/source/misc/docpasswordhelper.cxx
index bd8ce5d7de7f..cd7090944dc0 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -494,9 +494,8 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
 PasswordRequestMode eRequestMode = PasswordRequestMode_PASSWORD_ENTER;
 while( eResult == DocPasswordVerifierResult::WrongPassword )
 {
-DocPasswordRequest* pRequest = new DocPasswordRequest( 
eRequestType, eRequestMode, rDocumentUrl );
-Reference< XInteractionRequest > xRequest( pRequest );
-rxInteractHandler->handle( xRequest );
+rtl::Reference pRequest = new 
DocPasswordRequest( eRequestType, eRequestMode, rDocumentUrl );
+rxInteractHandler->handle( pRequest );
 if( pRequest->isPassword() )
 {
 if( !pRequest->getPassword().isEmpty() )
diff --git a/comphelper/source/xml/attributelist.cxx 
b/comphelper/source/xml/attributelist.cxx
index d99139c852ea..a02c82f69465 100644
--- a/comphelper/source/xml/attributelist.cxx
+++ b/comphelper/source/xml/attributelist.cxx
@@ -65,8 +65,7 @@ AttributeList::~AttributeList()
 
 css::uno::Reference< css::util::XCloneable > AttributeList::createClone()
 {
-AttributeList *p = new AttributeList( *this );
-return css::uno::Reference< css::util::XCloneable > ( 
static_cast(p) );
+return new AttributeList( *this );
 }
 
 } // namespace comphelper
diff --git a/comphelper/source/xml/ofopxmlhelper.cxx 
b/comphelper/source/xml/ofopxmlhelper.cxx
index 2da35bdd0a3a..10840368d976 100644
--- a/comphelper/source/xml/ofopxmlhelper.cxx
+++ b/comphelper/source/xml/ofopxmlhelper.cxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -145,20 +146,18 @@ void WriteRelationsInfoSequence(
 OUString aWhiteSpace( " " );
 
 // write the namespace
-AttributeList* pRootAttrList = new AttributeList;
-uno::Reference< css::xml::sax::XAttributeList > xRootAttrList( 
pRootAttrList );
+rtl::Reference pRootAttrList = new AttributeList;
 pRootAttrList->AddAttribute(
 "xmlns",
 aCDATAString,
 "http://schemas.openxmlformats.org/package/2006/relationships; );
 
 xWriter->startDocument();
-xWriter->startElement( aRelListElement, xRootAttrList );
+xWriter->startElement( aRelListElement, pRootAttrList );
 
 for ( const auto & i : aSequence )
 {
-AttributeList *pAttrList = new AttributeList;
-uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList );
+rtl::Reference pAttrList = new AttributeList;
 for( const beans::StringPair & pair : i )
 {
 if ( !(pair.First == "Id"
@@ -172,7 +171,7 @@ void WriteRelationsInfoSequence(
 pAttrList->AddAttribute( pair.First, aCDATAString, pair.Second );
 }
 
-xWriter->startElement( aRelElement, xAttrList );
+xWriter->startElement( aRelElement, pAttrList );
 xWriter->ignorableWhitespace( aWhiteSpace );
 xWriter->endElement( aRelElement );
 }
@@ -204,36 +203,33 @@ void WriteContentSequence(
 static constexpr OUStringLiteral aWhiteSpace(u" ");
 
 // write the namespace
-AttributeList* pRootAttrList = new AttributeList;
-uno::Reference< css::xml::sax::XAttributeList > xRootAttrList( 
pRootAttrList );
+rtl::Reference pRootAttrList = new AttributeList;
 pRootAttrList->AddAttribute(
 "xmlns",
 aCDATAString,
 "http://schemas.openxmlformats.org/package/2006/content-types; );
 
 xWriter->startDocument();
-xWriter->startElement( aTypesElement, xRootAttrList );
+xWriter->startElement( aTypesElement, pRootAttrList );
 
 for ( const beans::StringPair & pair : aDefaultsSequence )
 {
-AttributeList *pAttrList = new AttributeList;
-uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList );
+rtl::Reference pAttrList = new AttributeList;
 pAttrList->AddAttribute( "Extension", aCDATAString, pair.First );
 pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second );
 
-xWriter->startElement( aDefaultElement, xAttrList );
+xWriter->startElement( 

[Libreoffice-commits] core.git: cui/source

2021-02-22 Thread Noel (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |6 ++
 cui/source/options/webconninfo.cxx |5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit c2a0896183f33fab5f643400b171b031af5e468e
Author: Noel 
AuthorDate: Tue Feb 23 08:36:20 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 08:35:19 2021 +0100

loplugin:refcounting in cui

Change-Id: I09b71657f9f5fef733cbaae8a2eda457735b50cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111368
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index a6f21fe6bdda..4ea381e385db 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -755,14 +755,12 @@ IMPL_LINK_NOARG(AdditionsItem, InstallHdl, weld::Button&, 
void)
 return;
 }
 
-TmpRepositoryCommandEnv* pCmdEnv = new TmpRepositoryCommandEnv();
-uno::Reference 
xCmdEnv(static_cast(pCmdEnv),
- uno::UNO_QUERY);
+rtl::Reference pCmdEnv = new 
TmpRepositoryCommandEnv();
 uno::Reference xAbortChannel;
 try
 {
 m_pParentDialog->m_xExtensionManager->addExtension(
-aExtensionFile, uno::Sequence(), "user", 
xAbortChannel, xCmdEnv);
+aExtensionFile, uno::Sequence(), "user", 
xAbortChannel, pCmdEnv);
 
m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLEDBUTTON));
 }
 catch (const ucb::CommandFailedException)
diff --git a/cui/source/options/webconninfo.cxx 
b/cui/source/options/webconninfo.cxx
index 1d3abe82f860..b8ae35dba1e3 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -178,13 +178,12 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, 
ChangePasswordHdl, weld::Button&, void)
 OUString aURL = m_xPasswordsLB->get_text(nEntry, 0);
 OUString aUserName = m_xPasswordsLB->get_text(nEntry, 1);
 
-::comphelper::SimplePasswordRequest* pPasswordRequest
+rtl::Reference<::comphelper::SimplePasswordRequest> 
pPasswordRequest
   = new ::comphelper::SimplePasswordRequest;
-uno::Reference< task::XInteractionRequest > rRequest( 
pPasswordRequest );
 
 uno::Reference< task::XInteractionHandler > xInteractionHandler =
 
task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(),
 m_xDialog->GetXWindow());
-xInteractionHandler->handle( rRequest );
+xInteractionHandler->handle( pPasswordRequest );
 
 if ( pPasswordRequest->isPassword() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-22 Thread Noel (via logerrit)
 basctl/source/accessibility/accessibledialogcontrolshape.cxx |   11 ---
 basctl/source/accessibility/accessibledialogwindow.cxx   |   11 ---
 basctl/source/dlged/dlged.cxx|2 +-
 3 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 73cfa4945d1d429688a104240cf3268d3ce06029
Author: Noel 
AuthorDate: Mon Feb 22 19:43:49 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 07:31:06 2021 +0100

loplugin:refcounting in basctl

Change-Id: I22ddaee2b97af75c710df78542c27dca0730d0bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111352
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx 
b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
index 949c8fa86c69..f885ff4bda1b 100644
--- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx
+++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
@@ -393,9 +393,7 @@ Reference< XAccessibleRelationSet > 
AccessibleDialogControlShape::getAccessibleR
 {
 OExternalLockGuard aGuard( this );
 
-utl::AccessibleRelationSetHelper* pRelationSetHelper = new 
utl::AccessibleRelationSetHelper;
-Reference< XAccessibleRelationSet > xSet = pRelationSetHelper;
-return xSet;
+return new utl::AccessibleRelationSetHelper;
 }
 
 
@@ -403,8 +401,7 @@ Reference< XAccessibleStateSet > 
AccessibleDialogControlShape::getAccessibleStat
 {
 OExternalLockGuard aGuard( this );
 
-utl::AccessibleStateSetHelper* pStateSetHelper = new 
utl::AccessibleStateSetHelper;
-Reference< XAccessibleStateSet > xSet = pStateSetHelper;
+rtl::Reference pStateSetHelper = new 
utl::AccessibleStateSetHelper;
 
 if ( !rBHelper.bDisposed && !rBHelper.bInDispose )
 {
@@ -415,7 +412,7 @@ Reference< XAccessibleStateSet > 
AccessibleDialogControlShape::getAccessibleStat
 pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
 }
 
-return xSet;
+return pStateSetHelper;
 }
 
 
@@ -506,7 +503,7 @@ Reference< awt::XFont > 
AccessibleDialogControlShape::getFont(  )
 aFont = pWindow->GetControlFont();
 else
 aFont = pWindow->GetFont();
-VCLXFont* pVCLXFont = new VCLXFont;
+rtl::Reference pVCLXFont = new VCLXFont;
 pVCLXFont->Init( *xDev, aFont );
 xFont = pVCLXFont;
 }
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx 
b/basctl/source/accessibility/accessibledialogwindow.cxx
index eeb43b4f0c8b..0b641c8aca5e 100644
--- a/basctl/source/accessibility/accessibledialogwindow.cxx
+++ b/basctl/source/accessibility/accessibledialogwindow.cxx
@@ -668,9 +668,7 @@ Reference< XAccessibleRelationSet > 
AccessibleDialogWindow::getAccessibleRelatio
 {
 OExternalLockGuard aGuard( this );
 
-utl::AccessibleRelationSetHelper* pRelationSetHelper = new 
utl::AccessibleRelationSetHelper;
-Reference< XAccessibleRelationSet > xSet = pRelationSetHelper;
-return xSet;
+return new utl::AccessibleRelationSetHelper;
 }
 
 
@@ -678,8 +676,7 @@ Reference< XAccessibleStateSet > 
AccessibleDialogWindow::getAccessibleStateSet(
 {
 OExternalLockGuard aGuard( this );
 
-utl::AccessibleStateSetHelper* pStateSetHelper = new 
utl::AccessibleStateSetHelper;
-Reference< XAccessibleStateSet > xSet = pStateSetHelper;
+rtl::Reference pStateSetHelper = new 
utl::AccessibleStateSetHelper;
 
 if ( !rBHelper.bDisposed && !rBHelper.bInDispose )
 {
@@ -690,7 +687,7 @@ Reference< XAccessibleStateSet > 
AccessibleDialogWindow::getAccessibleStateSet(
 pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
 }
 
-return xSet;
+return pStateSetHelper;
 }
 
 
@@ -801,7 +798,7 @@ Reference< awt::XFont > AccessibleDialogWindow::getFont(  )
 aFont = m_pDialogWindow->GetControlFont();
 else
 aFont = m_pDialogWindow->GetFont();
-VCLXFont* pVCLXFont = new VCLXFont;
+rtl::Reference pVCLXFont = new VCLXFont;
 pVCLXFont->Init( *xDev, aFont );
 xFont = pVCLXFont;
 }
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index f99dab40d4c3..d74d375357ce 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -748,7 +748,7 @@ void DlgEditor::Copy()
 {}
 }
 
-DlgEdTransferableImpl* pTrans = nullptr;
+rtl::Reference pTrans;
 if( xStringResourcePersistence.is() )
 {
 // With resource, support old and new format
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: avmedia/source

2021-02-22 Thread Noel (via logerrit)
 avmedia/source/gstreamer/gstmanager.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 239d3a850dd3bef82c050fd727f4dbd5cf8ae0af
Author: Noel 
AuthorDate: Mon Feb 22 19:43:35 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 07:30:42 2021 +0100

loplugin:refcounting in avmedia

Change-Id: I150a0f9ffe6ca10d9e92af347e5cc4b87a828125
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111351
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/avmedia/source/gstreamer/gstmanager.cxx 
b/avmedia/source/gstreamer/gstmanager.cxx
index bc7c917dc99d..1803b5880bc1 100644
--- a/avmedia/source/gstreamer/gstmanager.cxx
+++ b/avmedia/source/gstreamer/gstmanager.cxx
@@ -23,6 +23,7 @@
 #include "gstplayer.hxx"
 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -38,14 +39,13 @@ Manager::~Manager()
 
 uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const 
OUString& rURL )
 {
-Player* pPlayer( new Player );
-uno::Reference< media::XPlayer >xRet( pPlayer );
+rtl::Reference pPlayer( new Player );
 const INetURLObject aURL( rURL );
 
 if( !pPlayer->create( aURL.GetMainURL( 
INetURLObject::DecodeMechanism::Unambiguous ) )  )
-xRet.clear();
+pPlayer.clear();
 
-return xRet;
+return pPlayer;
 }
 
 OUString SAL_CALL Manager::getImplementationName(  )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/source

2021-02-22 Thread Noel (via logerrit)
 chart2/source/controller/accessibility/AccessibleBase.cxx  |2 
 chart2/source/controller/main/ChartController.cxx  |   10 ++--
 chart2/source/controller/main/CommandDispatchContainer.cxx |5 +-
 chart2/source/model/main/Axis.cxx  |7 +--
 chart2/source/model/main/DataSeries.cxx|7 +--
 chart2/source/tools/CachedDataSequence.cxx |4 -
 chart2/source/tools/UncachedDataSequence.cxx   |3 -
 chart2/source/view/main/ChartView.cxx  |   28 -
 8 files changed, 26 insertions(+), 40 deletions(-)

New commits:
commit 9861aaad25f3e9bf5d78c56143c3f3b727c73007
Author: Noel 
AuthorDate: Mon Feb 22 19:44:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 07:30:22 2021 +0100

loplugin:refcounting in chart2

Change-Id: I4949e67aae74631acc138a3a52621705cda0dd77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111353
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx 
b/chart2/source/controller/accessibility/AccessibleBase.cxx
index 7d9e244bfa1b..9e05f896b422 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -427,7 +427,7 @@ void SAL_CALL AccessibleBase::disposing()
 m_aAccInfo.m_pParent = nullptr;
 
 // attach new empty state set helper to member reference
-::utl::AccessibleStateSetHelper * pHelper = new 
::utl::AccessibleStateSetHelper();
+rtl::Reference<::utl::AccessibleStateSetHelper> pHelper = new 
::utl::AccessibleStateSetHelper();
 pHelper->AddState(AccessibleStateType::DEFUNC);
 // release old helper and attach new one
 m_xStateSetHelper = pHelper;
diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index d19f3b97ef32..3d310d8d8bea 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -588,7 +588,7 @@ sal_Bool SAL_CALL ChartController::attachModel( const 
uno::Reference< frame::XMo
 aGuard.reset(); // lock for m_aDispatchContainer access
 // set new model at dispatchers
 m_aDispatchContainer.setModel( aNewModelRef->getModel());
-ControllerCommandDispatch * pDispatch = new ControllerCommandDispatch( 
m_xCC, this, _aDispatchContainer );
+rtl::Reference pDispatch = new 
ControllerCommandDispatch( m_xCC, this, _aDispatchContainer );
 pDispatch->initialize();
 
 // the dispatch container will return "this" for all commands returned by
@@ -596,13 +596,13 @@ sal_Bool SAL_CALL ChartController::attachModel( const 
uno::Reference< frame::XMo
 // is called here at the ChartController.
 m_aDispatchContainer.setChartDispatch( pDispatch, 
impl_getAvailableCommands() );
 
-DrawCommandDispatch* pDrawDispatch = new DrawCommandDispatch( m_xCC, this 
);
+rtl::Reference pDrawDispatch = new 
DrawCommandDispatch( m_xCC, this );
 pDrawDispatch->initialize();
-m_aDispatchContainer.setDrawCommandDispatch( pDrawDispatch );
+m_aDispatchContainer.setDrawCommandDispatch( pDrawDispatch.get() );
 
-ShapeController* pShapeController = new ShapeController( m_xCC, this );
+rtl::Reference pShapeController = new ShapeController( 
m_xCC, this );
 pShapeController->initialize();
-m_aDispatchContainer.setShapeController( pShapeController );
+m_aDispatchContainer.setShapeController( pShapeController.get() );
 aGuard.clear();
 
 #ifdef TEST_ENABLE_MODIFY_LISTENER
diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx 
b/chart2/source/controller/main/CommandDispatchContainer.cxx
index b007ebe5c652..dee4c961358e 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.cxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -87,7 +88,7 @@ Reference< frame::XDispatch > 
CommandDispatchContainer::getDispatchForURL(
 if( xModel.is() && ( rURL.Path == "Undo" || rURL.Path == "Redo" ||
  rURL.Path == "GetUndoStrings" || rURL.Path == 
"GetRedoStrings" ) )
 {
-CommandDispatch * pDispatch = new UndoCommandDispatch( m_xContext, 
xModel );
+rtl::Reference pDispatch = new 
UndoCommandDispatch( m_xContext, xModel );
 xResult.set( pDispatch );
 pDispatch->initialize();
 m_aCachedDispatches[ ".uno:Undo" ].set( xResult );
@@ -99,7 +100,7 @@ Reference< frame::XDispatch > 
CommandDispatchContainer::getDispatchForURL(
 else if( xModel.is() && ( rURL.Path == "Context" || rURL.Path == 
"ModifiedStatus" ) )
 {
 Reference< view::XSelectionSupplier > xSelSupp( 
xModel->getCurrentController(), uno::UNO_QUERY );
-CommandDispatch * 

[Libreoffice-commits] core.git: fpicker/source include/ucbhelper

2021-02-22 Thread Noel (via logerrit)
 fpicker/source/office/RemoteFilesDialog.cxx  |   10 --
 fpicker/source/office/iodlg.cxx  |5 ++---
 include/ucbhelper/interceptedinteraction.hxx |5 -
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 9a61e9a3356874a23a697ace57a53e3ada505d87
Author: Noel 
AuthorDate: Sun Feb 21 20:02:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 07:30:05 2021 +0100

loplugin:refcounting in fpicker

Change-Id: Ia14d2a874d559c4438a33c8a46ec6076802cd637
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111285
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx 
b/fpicker/source/office/RemoteFilesDialog.cxx
index 30115abd93e8..1282d47115a3 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -683,11 +683,10 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, const 
OString&, rIdent, void
 {
 OUString sUserName = aURLEntries.UserList[0].UserName;
 
-::comphelper::SimplePasswordRequest* pPasswordRequest
+rtl::Reference<::comphelper::SimplePasswordRequest> 
pPasswordRequest
 = new ::comphelper::SimplePasswordRequest;
-Reference< XInteractionRequest > rRequest( 
pPasswordRequest );
 
-xInteractionHandler->handle( rRequest );
+xInteractionHandler->handle( pPasswordRequest );
 
 if ( pPasswordRequest->isPassword() )
 {
@@ -1180,10 +1179,9 @@ bool RemoteFilesDialog::ContentIsDocument( const 
OUString& rURL )
 // It's a webdav URL, so use the same open sequence as in normal 
open process.
 // Let's use a comphelper::StillReadWriteInteraction to trap 
errors here without showing the user.
 // This sequence will result in an exception if the target URL 
resource is not present
-comphelper::StillReadWriteInteraction* pInteraction = new 
comphelper::StillReadWriteInteraction(xInteractionHandler,xInteractionHandler);
-css::uno::Reference< css::task::XInteractionHandler > 
xInteraction(static_cast< css::task::XInteractionHandler* >(pInteraction), 
css::uno::UNO_QUERY);
+rtl::Reference pInteraction 
= new 
comphelper::StillReadWriteInteraction(xInteractionHandler,xInteractionHandler);
 
-Reference< XCommandEnvironment > xEnv = new 
::ucbhelper::CommandEnvironment( xInteraction, Reference< XProgressHandler >() 
);
+Reference< XCommandEnvironment > xEnv = new 
::ucbhelper::CommandEnvironment( pInteraction, Reference< XProgressHandler >() 
);
 ::ucbhelper::Content aContent( rURL, xEnv, m_xContext );
 
 aContent.openStream();
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index cbb354ecf585..fe199ae5a530 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1401,14 +1401,13 @@ void SvtFileDialog::displayIOException( const OUString& 
_rURL, IOErrorCode _eCod
 aException.Classification = InteractionClassification_ERROR;
 
 // let and interaction handler handle this exception
-::comphelper::OInteractionRequest* pRequest = nullptr;
-Reference< css::task::XInteractionRequest > xRequest = pRequest =
+rtl::Reference<::comphelper::OInteractionRequest> pRequest =
 new ::comphelper::OInteractionRequest( makeAny( aException ) );
 pRequest->addContinuation( new ::comphelper::OInteractionAbort( ) );
 
 Reference< XInteractionHandler2 > xHandler(
 InteractionHandler::createWithParent( 
::comphelper::getProcessComponentContext(), nullptr ) );
-xHandler->handle( xRequest );
+xHandler->handle( pRequest );
 }
 catch( const Exception& )
 {
diff --git a/include/ucbhelper/interceptedinteraction.hxx 
b/include/ucbhelper/interceptedinteraction.hxx
index b6a410ca3dba..85699c1d534b 100644
--- a/include/ucbhelper/interceptedinteraction.hxx
+++ b/include/ucbhelper/interceptedinteraction.hxx
@@ -41,7 +41,10 @@ namespace ucbhelper{
   only
 - or as base class if interactions must be modified.
  */
-class UCBHELPER_DLLPUBLIC InterceptedInteraction : public 
::cppu::WeakImplHelper< css::task::XInteractionHandler >
+// extra struct to work around MSVC linking issue
+struct InterceptedInteraction_Base : public ::cppu::WeakImplHelper< 
css::task::XInteractionHandler > {};
+
+class UCBHELPER_DLLPUBLIC InterceptedInteraction : public 
InterceptedInteraction_Base
 {
 
 // types
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - basic/source editeng/source include/editeng

2021-02-22 Thread Noel (via logerrit)
 basic/source/basmgr/basicmanagerrepository.cxx  |8 ++
 basic/source/classes/sbunoobj.cxx   |9 +++
 basic/source/inc/dlgcont.hxx|4 +--
 basic/source/inc/namecont.hxx   |4 +--
 basic/source/inc/scriptcont.hxx |4 +--
 basic/source/uno/dlgcont.cxx|   10 +++-
 basic/source/uno/namecont.cxx   |   12 -
 basic/source/uno/scriptcont.cxx |   15 
 editeng/source/accessibility/AccessibleContextBase.cxx  |   10 
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |4 +--
 editeng/source/accessibility/AccessibleHyperlink.cxx|2 -
 editeng/source/accessibility/AccessibleImageBullet.cxx  |2 -
 editeng/source/editeng/impedit.cxx  |3 --
 editeng/source/editeng/impedit2.cxx |5 +---
 editeng/source/misc/unolingu.cxx|2 -
 editeng/source/uno/unotext.cxx  |   13 --
 editeng/source/uno/unotext2.cxx |4 +--
 editeng/source/xml/xmltxtexp.cxx|2 -
 editeng/source/xml/xmltxtimp.cxx|5 +---
 include/editeng/unolingu.hxx|3 +-
 20 files changed, 55 insertions(+), 66 deletions(-)

New commits:
commit 1571fd8bfdb1deb07b4d6a4abde4919d24550cea
Author: Noel 
AuthorDate: Mon Feb 22 12:12:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 17:32:28 2021 +0100

loplugin:refcounting in basic

Change-Id: I0c1e41436ddae176695a90c120303727aa3bc2ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111306
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/basic/source/basmgr/basicmanagerrepository.cxx 
b/basic/source/basmgr/basicmanagerrepository.cxx
index 01ca8759e145..a70c49eb1149 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -292,15 +292,13 @@ namespace basic
 pBasicManager->SetStorageName( aAppBasic.PathToFileName() );
 
 // Basic container
-SfxScriptLibraryContainer* pBasicCont = new SfxScriptLibraryContainer( 
Reference< XStorage >() );
-Reference< XPersistentLibraryContainer > xBasicCont( pBasicCont );
+rtl::Reference pBasicCont = new 
SfxScriptLibraryContainer( Reference< XStorage >() );
 pBasicCont->setBasicManager( pBasicManager );
 
 // Dialog container
-SfxDialogLibraryContainer* pDialogCont = new 
SfxDialogLibraryContainer( Reference< XStorage >() );
-Reference< XPersistentLibraryContainer > xDialogCont( pDialogCont );
+rtl::Reference pDialogCont = new 
SfxDialogLibraryContainer( Reference< XStorage >() );
 
-LibraryContainerInfo aInfo( xBasicCont, xDialogCont, static_cast< 
OldBasicPassword* >( pBasicCont ) );
+LibraryContainerInfo aInfo( pBasicCont, pDialogCont, static_cast< 
OldBasicPassword* >( pBasicCont.get() ) );
 pBasicManager->SetLibraryContainerInfo( aInfo );
 
 // global constants
diff --git a/basic/source/classes/sbunoobj.cxx 
b/basic/source/classes/sbunoobj.cxx
index 2afc7ed52604..259cd5ae88f4 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -4048,8 +4048,7 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray 
& rPar, bool)
 Reference< XInvocationAdapterFactory2 > xInvocationAdapterFactory =
  InvocationAdapterFactory::create( xContext );
 
-BasicAllListener_Impl * p;
-Reference< XAllListener > xAllLst = p = new BasicAllListener_Impl( 
aPrefixName );
+rtl::Reference xAllLst = new BasicAllListener_Impl( 
aPrefixName );
 Any aTmp;
 Reference< XInterface > xLst = createAllListenerAdapter( 
xInvocationAdapterFactory, xClass, xAllLst, aTmp );
 if( !xLst.is() )
@@ -4062,8 +4061,8 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray 
& rPar, bool)
 return;
 
 SbUnoObject* pUnoObj = new SbUnoObject( aListenerClassName, aTmp );
-p->xSbxObj = pUnoObj;
-p->xSbxObj->SetParent( pBasic );
+xAllLst->xSbxObj = pUnoObj;
+xAllLst->xSbxObj->SetParent( pBasic );
 
 // #100326 Register listener object to set Parent NULL in Dtor
 SbxArrayRef xBasicUnoListeners = pBasic->getUnoListeners();
@@ -4071,7 +4070,7 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray 
& rPar, bool)
 
 // return the object
 SbxVariableRef refVar = rPar.Get32(0);
-refVar->PutObject( p->xSbxObj.get() );
+refVar->PutObject( xAllLst->xSbxObj.get() );
 }
 
 
diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx
index f9dbe2745c25..1152dd82b2b3 100644
--- a/basic/source/inc/dlgcont.hxx
+++ b/basic/source/inc/dlgcont.hxx
@@ -34,8 

[Libreoffice-commits] core.git: canvas/source

2021-02-22 Thread Noel (via logerrit)
 canvas/source/cairo/cairo_canvas.cxx   |4 ++--
 canvas/source/cairo/cairo_spritecanvas.cxx |4 ++--
 canvas/source/opengl/ogl_spritecanvas.cxx  |6 +++---
 canvas/source/vcl/canvas.cxx   |6 +++---
 canvas/source/vcl/spritecanvas.cxx |6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 919e47ee210dc40ae8f235e6904b217b26788f26
Author: Noel 
AuthorDate: Mon Feb 22 12:12:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 13:40:12 2021 +0100

loplugin:refcounting in canvas

Change-Id: I77e4d29b2911bb86c383afbf977d241eaa8cd341
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111307
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/canvas/source/cairo/cairo_canvas.cxx 
b/canvas/source/cairo/cairo_canvas.cxx
index f8266cffe446..10edc0681843 100644
--- a/canvas/source/cairo/cairo_canvas.cxx
+++ b/canvas/source/cairo/cairo_canvas.cxx
@@ -176,7 +176,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 com_sun_star_comp_rendering_Canvas_Cairo_get_implementation(
 css::uno::XComponentContext* context, css::uno::Sequence 
const& args)
 {
-auto p = new cairocanvas::Canvas(args, context);
+rtl::Reference p = new cairocanvas::Canvas(args, 
context);
 p->acquire();
 try {
 p->initialize();
@@ -185,7 +185,7 @@ com_sun_star_comp_rendering_Canvas_Cairo_get_implementation(
 p->release();
 throw;
 }
-return static_cast(p);
+return static_cast(p.get());
 }
 
 
diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx 
b/canvas/source/cairo/cairo_spritecanvas.cxx
index ddb4491afdf2..91ac7c376b4d 100644
--- a/canvas/source/cairo/cairo_spritecanvas.cxx
+++ b/canvas/source/cairo/cairo_spritecanvas.cxx
@@ -224,10 +224,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 com_sun_star_comp_rendering_SpriteCanvas_Cairo_get_implementation(
 css::uno::XComponentContext* context, css::uno::Sequence 
const& args)
 {
-auto p = new cairocanvas::SpriteCanvas(args, context);
+rtl::Reference p = new 
cairocanvas::SpriteCanvas(args, context);
 p->acquire();
 p->initialize();
-return static_cast(p);
+return static_cast(p.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx 
b/canvas/source/opengl/ogl_spritecanvas.cxx
index d55625b47668..babeafa19af9 100644
--- a/canvas/source/opengl/ogl_spritecanvas.cxx
+++ b/canvas/source/opengl/ogl_spritecanvas.cxx
@@ -157,10 +157,10 @@ 
com_sun_star_comp_rendering_SpriteCanvas_OGL_get_implementation(
 {
 if( !OpenGLHelper::supportsOpenGL())
 return nullptr;
-auto p = new oglcanvas::SpriteCanvas(args, context);
-cppu::acquire(p);
+rtl::Reference p = new 
oglcanvas::SpriteCanvas(args, context);
+cppu::acquire(p.get());
 p->initialize();
-return static_cast(p);
+return static_cast(p.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx
index e8f6ffe0c62a..467da51f37ed 100644
--- a/canvas/source/vcl/canvas.cxx
+++ b/canvas/source/vcl/canvas.cxx
@@ -134,10 +134,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 com_sun_star_comp_rendering_Canvas_VCL_get_implementation(
 css::uno::XComponentContext* context, css::uno::Sequence 
const& args)
 {
-auto p = new vclcanvas::Canvas(args, context);
-cppu::acquire(p);
+rtl::Reference p = new vclcanvas::Canvas(args, context);
+cppu::acquire(p.get());
 p->initialize();
-return static_cast(p);
+return static_cast(p.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/source/vcl/spritecanvas.cxx 
b/canvas/source/vcl/spritecanvas.cxx
index bc3b2d9f290a..2238a79127f0 100644
--- a/canvas/source/vcl/spritecanvas.cxx
+++ b/canvas/source/vcl/spritecanvas.cxx
@@ -163,10 +163,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 com_sun_star_comp_rendering_SpriteCanvas_VCL_get_implementation(
 css::uno::XComponentContext* context, css::uno::Sequence 
const& args)
 {
-auto p = new vclcanvas::SpriteCanvas(args, context);
-cppu::acquire(p);
+rtl::Reference p = new 
vclcanvas::SpriteCanvas(args, context);
+cppu::acquire(p.get());
 p->initialize();
-return static_cast(p);
+return static_cast(p.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2021-02-22 Thread Noel (via logerrit)
 accessibility/inc/extended/AccessibleBrowseBoxBase.hxx|2 
 accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx|2 
 accessibility/inc/extended/AccessibleBrowseBoxHeaderCell.hxx  |2 
 accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx   |2 
 accessibility/inc/extended/AccessibleGridControlBase.hxx  |3 -
 accessibility/inc/extended/AccessibleGridControlHeaderCell.hxx|2 
 accessibility/inc/extended/AccessibleGridControlTable.hxx |7 --
 accessibility/inc/extended/AccessibleGridControlTableCell.hxx |2 
 accessibility/source/extended/AccessibleBrowseBox.cxx |2 
 accessibility/source/extended/AccessibleBrowseBoxBase.cxx |4 -
 accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx |4 -
 accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx   |4 -
 accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx|4 -
 accessibility/source/extended/AccessibleGridControl.cxx   |   12 
 accessibility/source/extended/AccessibleGridControlBase.cxx   |4 -
 accessibility/source/extended/AccessibleGridControlHeader.cxx |8 +-
 accessibility/source/extended/AccessibleGridControlHeaderCell.cxx |4 -
 accessibility/source/extended/AccessibleGridControlTable.cxx  |   28 
--
 accessibility/source/extended/AccessibleGridControlTableCell.cxx  |4 -
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx   |5 -
 accessibility/source/extended/accessiblelistbox.cxx   |4 -
 accessibility/source/extended/accessiblelistboxentry.cxx  |7 +-
 accessibility/source/extended/accessibletabbar.cxx|   11 +--
 accessibility/source/extended/accessibletabbarpage.cxx|9 +--
 accessibility/source/extended/accessibletabbarpagelist.cxx|9 +--
 accessibility/source/extended/textwindowaccessibility.cxx |5 -
 accessibility/source/helper/acc_factory.cxx   |2 
 accessibility/source/standard/accessiblemenubasecomponent.cxx |7 +-
 accessibility/source/standard/accessiblemenucomponent.cxx |6 --
 accessibility/source/standard/accessiblemenuitemcomponent.cxx |4 -
 accessibility/source/standard/vclxaccessiblebox.cxx   |2 
 accessibility/source/standard/vclxaccessiblebutton.cxx|5 -
 accessibility/source/standard/vclxaccessiblecheckbox.cxx  |5 -
 accessibility/source/standard/vclxaccessibleheaderbaritem.cxx |9 +--
 accessibility/source/standard/vclxaccessiblelistitem.cxx  |   11 +--
 accessibility/source/standard/vclxaccessiblemenuitem.cxx  |7 +-
 accessibility/source/standard/vclxaccessibleradiobutton.cxx   |5 -
 accessibility/source/standard/vclxaccessiblestatusbaritem.cxx |   11 +--
 accessibility/source/standard/vclxaccessibletabpage.cxx   |   11 +--
 accessibility/source/standard/vclxaccessibletextcomponent.cxx |2 
 accessibility/source/standard/vclxaccessibletoolbox.cxx   |2 
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx   |   11 +--
 42 files changed, 99 insertions(+), 151 deletions(-)

New commits:
commit 18aafdd0f936ab6bb4225447a328f5471d143b0d
Author: Noel 
AuthorDate: Mon Feb 22 10:46:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 13:39:58 2021 +0100

loplugin:refcounting in accessibility

Change-Id: Ic9e780dc3f834e2e8b5d3a8d8445419a4bd050dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111300
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx 
b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx
index ea2a011723f3..7f7788fe3d35 100644
--- a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx
+++ b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx
@@ -254,7 +254,7 @@ protected:
 may overwrite this method and add more states.
 @attention  This method requires locked mutex's.
 @return  A filled AccessibleStateSetHelper. */
-virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper();
+virtual rtl::Reference<::utl::AccessibleStateSetHelper> 
implCreateStateSetHelper();
 
 // internal helper methods
 
diff --git a/accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx 
b/accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx
index 0ad34ba18ede..a550eed5e220 100644
--- a/accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx
+++ b/accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx
@@ -39,7 +39,7 @@ namespace accessibility
 
 virtual ~AccessibleCheckBoxCell() override {}
 
-virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() 
override;
+virtual rtl::Reference<::utl::AccessibleStateSetHelper> 
implCreateStateSetHelper() override;
 
 

[Libreoffice-commits] core.git: connectivity/source include/connectivity

2021-02-22 Thread Noel (via logerrit)
 connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx |   38 
 connectivity/source/commontools/TColumnsHelper.cxx |2 
 connectivity/source/commontools/TDatabaseMetaDataBase.cxx  |5 -
 connectivity/source/commontools/TIndexColumns.cxx  |   21 ++--
 connectivity/source/commontools/TIndexes.cxx   |3 
 connectivity/source/commontools/TKeyColumns.cxx|   25 ++---
 connectivity/source/commontools/TKeys.cxx  |6 -
 connectivity/source/commontools/dbtools.cxx|9 --
 connectivity/source/commontools/dbtools2.cxx   |3 
 connectivity/source/commontools/parameters.cxx |9 --
 connectivity/source/commontools/predicateinput.cxx |2 
 connectivity/source/cpool/ZPoolCollection.cxx  |6 -
 connectivity/source/drivers/calc/CConnection.cxx   |6 -
 connectivity/source/drivers/calc/CDatabaseMetaData.cxx |7 -
 connectivity/source/drivers/calc/CDriver.cxx   |5 -
 connectivity/source/drivers/calc/CTable.cxx|5 -
 connectivity/source/drivers/calc/CTables.cxx   |5 -
 connectivity/source/drivers/component/CDatabaseMetaData.cxx|   10 --
 connectivity/source/drivers/dbase/DConnection.cxx  |7 -
 connectivity/source/drivers/dbase/DDatabaseMetaData.cxx|   15 +--
 connectivity/source/drivers/dbase/DDriver.cxx  |5 -
 connectivity/source/drivers/dbase/DIndexes.cxx |2 
 connectivity/source/drivers/dbase/DTable.cxx   |4 
 connectivity/source/drivers/dbase/DTables.cxx  |5 -
 connectivity/source/drivers/file/FColumns.cxx  |3 
 connectivity/source/drivers/file/FConnection.cxx   |3 
 connectivity/source/drivers/file/FDatabaseMetaData.cxx |   19 +---
 connectivity/source/drivers/file/FDriver.cxx   |5 -
 connectivity/source/drivers/firebird/DatabaseMetaData.cxx  |   45 
--
 connectivity/source/drivers/firebird/Driver.cxx|5 -
 connectivity/source/drivers/flat/EConnection.cxx   |   16 +--
 connectivity/source/drivers/flat/EDatabaseMetaData.cxx |   10 --
 connectivity/source/drivers/flat/EDriver.cxx   |5 -
 connectivity/source/drivers/flat/ETable.cxx|5 -
 connectivity/source/drivers/flat/ETables.cxx   |5 -
 connectivity/source/drivers/hsqldb/HDriver.cxx |2 
 connectivity/source/drivers/hsqldb/HTable.cxx  |9 --
 connectivity/source/drivers/hsqldb/HTables.cxx |3 
 connectivity/source/drivers/hsqldb/HUsers.cxx  |3 
 connectivity/source/drivers/hsqldb/HViews.cxx  |3 
 connectivity/source/drivers/jdbc/DatabaseMetaData.cxx  |2 
 connectivity/source/drivers/jdbc/JConnection.cxx   |6 -
 connectivity/source/drivers/jdbc/JDriver.cxx   |2 
 connectivity/source/drivers/mysql_jdbc/YTable.cxx  |   11 +-
 connectivity/source/drivers/mysql_jdbc/YTables.cxx |7 -
 connectivity/source/drivers/mysql_jdbc/YUsers.cxx  |6 -
 connectivity/source/drivers/mysql_jdbc/YViews.cxx  |2 
 connectivity/source/drivers/mysqlc/mysqlc_driver.cxx   |5 -
 connectivity/source/drivers/odbc/ODatabaseMetaData.cxx |   37 
 connectivity/source/drivers/odbc/ODriver.cxx   |5 -
 connectivity/source/drivers/odbc/OPreparedStatement.cxx|4 
 connectivity/source/drivers/odbc/OStatement.cxx|4 
 connectivity/source/drivers/writer/WConnection.cxx |7 -
 connectivity/source/drivers/writer/WDatabaseMetaData.cxx   |8 -
 connectivity/source/drivers/writer/WDriver.cxx |5 -
 connectivity/source/drivers/writer/WTable.cxx  |5 -
 connectivity/source/drivers/writer/WTables.cxx |   12 +-
 connectivity/source/inc/odbc/OPreparedStatement.hxx|2 
 connectivity/source/inc/odbc/OStatement.hxx|2 
 connectivity/source/parse/PColumn.cxx  |6 -
 connectivity/source/parse/sqliterator.cxx  |   41 -
 connectivity/source/sdbcx/VColumn.cxx  |3 
 connectivity/source/sdbcx/VTable.cxx   |2 
 include/connectivity/PColumn.hxx   |2 
 64 files changed, 227 insertions(+), 305 deletions(-)

New commits:
commit dffe94959ada5297c7c719497395f5dfe66c4d2f
Author: Noel 
AuthorDate: Mon Feb 22 10:48:51 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 13:37:53 2021 +0100

loplugin:refcounting in connectivity

  

[Libreoffice-commits] core.git: desktop/source

2021-02-22 Thread Noel (via logerrit)
 desktop/source/deployment/manager/dp_extensionmanager.cxx   |5 ++---
 desktop/source/deployment/manager/dp_manager.cxx|5 ++---
 desktop/source/deployment/registry/dp_registry.cxx  |7 +++
 desktop/source/deployment/registry/sfwk/dp_sfwk.cxx |6 ++
 desktop/source/migration/services/oo3extensionmigration.cxx |7 +++
 5 files changed, 12 insertions(+), 18 deletions(-)

New commits:
commit f0c0796cb9a1dba9e03f6ce863ac96e596b04981
Author: Noel 
AuthorDate: Mon Feb 22 10:47:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 11:08:55 2021 +0100

loplugin:refcounting in desktop

Change-Id: If62998173edb3961beb32de484eba000bd28f4d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111301
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx 
b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 2a17e2d6860c..63882cefdfd3 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -696,12 +696,11 @@ Reference 
ExtensionManager::addExtension(
 //check again dependencies but prevent user interaction,
 //We can disregard the license, because the user must have 
already
 //accepted it, when we called checkPrerequisites the first time
-SilentCheckPrerequisitesCommandEnv * pSilentCommandEnv =
+rtl::Reference 
pSilentCommandEnv =
 new SilentCheckPrerequisitesCommandEnv();
-Reference 
silentCommandEnv(pSilentCommandEnv);
 
 sal_Int32 failedPrereq = xTmpExtension->checkPrerequisites(
-xAbortChannel, silentCommandEnv, true);
+xAbortChannel, pSilentCommandEnv, true);
 if (failedPrereq == 0)
 {
 xNewExtension = xPackageManager->addPackage(
diff --git a/desktop/source/deployment/manager/dp_manager.cxx 
b/desktop/source/deployment/manager/dp_manager.cxx
index 5ff55abe6b33..bd68c26a9512 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -340,9 +340,8 @@ Reference 
PackageManagerImpl::create(
 Reference const & xComponentContext,
 OUString const & context )
 {
-PackageManagerImpl * that = new PackageManagerImpl(
+rtl::Reference that = new PackageManagerImpl(
 xComponentContext, context );
-Reference xPackageManager( that );
 
 OUString logFile, stamp;
 if ( context == "user" ) {
@@ -433,7 +432,7 @@ Reference 
PackageManagerImpl::create(
 that->initRegistryBackends();
 that->initActivationLayer( xCmdEnv );
 
-return xPackageManager;
+return that;
 
 }
 catch (const RuntimeException &) {
diff --git a/desktop/source/deployment/registry/dp_registry.cxx 
b/desktop/source/deployment/registry/dp_registry.cxx
index 90248158056a..a061aa4382dc 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -273,8 +273,7 @@ Reference 
PackageRegistryImpl::create(
 OUString const & cachePath,
 Reference const & xComponentContext )
 {
-PackageRegistryImpl * that = new PackageRegistryImpl;
-Reference xRet(that);
+rtl::Reference that = new PackageRegistryImpl;
 
 // auto-detect all registered package registries:
 Reference xEnum(
@@ -325,7 +324,7 @@ Reference 
PackageRegistryImpl::create(
 "cannot instantiate PackageRegistryBackend service: "
 + Reference(
 element, UNO_QUERY_THROW )->getImplementationName(),
-static_cast(that) );
+static_cast(that.get()) );
 }
 
 that->insertBackend( xBackend );
@@ -407,7 +406,7 @@ Reference 
PackageRegistryImpl::create(
 }
 #endif
 
-return xRet;
+return that;
 }
 
 // XUpdatable: broadcast to backends
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx 
b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 916a5882c519..758bdf264a18 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -244,17 +244,15 @@ Reference BackendImpl::bindPackage_(
 if (create_ucb_content( _content, sParcelDescURL,
 xCmdEnv, false /* no throw */ ))
 {
-ParcelDescDocHandler* pHandler =
+rtl::Reference pHandler =
 new ParcelDescDocHandler();
-Reference< xml::sax::XDocumentHandler >
-xDocHandler = pHandler;
 
 Reference
 xContext( getComponentContext() );
 
 Reference< xml::sax::XParser 

[Libreoffice-commits] core.git: extensions/source

2021-02-22 Thread Noel (via logerrit)
 extensions/source/bibliography/toolbar.cxx   |4 +--
 extensions/source/propctrlr/formcomponenthandler.cxx |   10 -
 extensions/source/propctrlr/propcontroller.cxx   |   20 +--
 extensions/source/scanner/scanunx.cxx|5 +---
 4 files changed, 19 insertions(+), 20 deletions(-)

New commits:
commit 7be139f114f5f14588e06f8224b0b978db833de2
Author: Noel 
AuthorDate: Sun Feb 21 20:02:40 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 10:16:08 2021 +0100

loplugin:refcounting in extensions

Change-Id: Ie4e4c771542ce38ce8197667f6374cc191a44ee9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111286
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/extensions/source/bibliography/toolbar.cxx 
b/extensions/source/bibliography/toolbar.cxx
index ae054801d8db..ea8ae0eeaee8 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -295,8 +295,8 @@ void BibToolBar::InitListener()
 util::URL aQueryURL;
 aQueryURL.Complete = ".uno:Bib/MenuFilter";
 xTrans->parseStrict( aQueryURL);
-BibToolBarListener* pQuery=new BibTBQueryMenuListener(this, 
aQueryURL.Complete, nTBC_BT_AUTOFILTER);
-xDisp->addStatusListener(uno::Reference< frame::XStatusListener > 
(pQuery),aQueryURL);
+rtl::Reference pQuery=new BibTBQueryMenuListener(this, 
aQueryURL.Complete, nTBC_BT_AUTOFILTER);
+xDisp->addStatusListener(pQuery, aQueryURL);
 
 for(ToolBox::ImplToolItems::size_type nPos=0;nPos 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/urlcontrol.ui",
 m_xContext));
 auto pURLBox = 
std::make_unique(xBuilder->weld_combo_box("urlcontrol"));
-auto pControl = new OFileUrlControl(std::move(pURLBox), 
std::move(xBuilder), false);
+rtl::Reference pControl = new 
OFileUrlControl(std::move(pURLBox), std::move(xBuilder), false);
 pControl->SetModifyHandler();
 aDescriptor.Control = pControl;
 
@@ -1095,7 +1095,7 @@ namespace pcr
 {
 std::unique_ptr 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/formattedsample.ui",
 m_xContext));
 auto pContainer = 
xBuilder->weld_container("formattedsample");
-auto pControl = new 
OFormatSampleControl(std::move(pContainer), std::move(xBuilder), false);
+rtl::Reference pControl = new 
OFormatSampleControl(std::move(pContainer), std::move(xBuilder), false);
 pControl->SetModifyHandler();
 
 pControl->SetFormatSupplier(pSupplier);
@@ -1110,7 +1110,7 @@ namespace pcr
 auto pSpinButton = 
xBuilder->weld_formatted_spin_button("formattedcontrol");
 // for ui-testing try and distinguish different 
instances of this formatted control
 
pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() + "-" + 
aDescriptor.DisplayName.toUtf8());
-auto pControl = new 
OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false);
+rtl::Reference pControl = 
new OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), 
false);
 pControl->SetModifyHandler();
 
 FormatDescription aDesc;
@@ -1151,7 +1151,7 @@ namespace pcr
 auto pSpinButton = 
xBuilder->weld_formatted_spin_button("formattedcontrol");
 // for ui-testing try and distinguish different instances of this 
formatted control
 pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() 
+ "-" + aDescriptor.DisplayName.toUtf8());
-auto pControl = new 
OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false);
+rtl::Reference pControl = new 
OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false);
 pControl->SetModifyHandler();
 aDescriptor.Control = pControl;
 
@@ -1285,7 +1285,7 @@ namespace pcr
 {
 std::unique_ptr 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/numericfield.ui",
 m_xContext));
 auto pSpinButton = 
xBuilder->weld_metric_spin_button("numericfield", FieldUnit::MILLISECOND);
-auto pControl = new ONumericControl(std::move(pSpinButton), 
std::move(xBuilder), bReadOnly);
+rtl::Reference pControl = new 
ONumericControl(std::move(pSpinButton), std::move(xBuilder), bReadOnly);
 pControl->SetModifyHandler();
 pControl->setMinValue( Optional< double >( true, 0 ) );
 pControl->setMaxValue( Optional< double >( true, 
std::numeric_limits< double >::max() ) );
diff --git a/extensions/source/propctrlr/propcontroller.cxx 

[Libreoffice-commits] core.git: 2 commits - dbaccess/source drawinglayer/source

2021-02-21 Thread Noel (via logerrit)
 dbaccess/source/core/api/RowSet.cxx|   19 
+++
 dbaccess/source/core/api/RowSetCache.cxx   |4 -
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx |2 
 dbaccess/source/core/api/TableDeco.cxx |8 +--
 dbaccess/source/core/api/preparedstatement.cxx |4 -
 dbaccess/source/core/api/query.cxx |9 +--
 dbaccess/source/core/api/query.hxx |2 
 dbaccess/source/core/api/querycontainer.cxx|2 
 dbaccess/source/core/api/querydescriptor.cxx   |2 
 dbaccess/source/core/api/querydescriptor.hxx   |2 
 dbaccess/source/core/api/resultset.cxx |4 -
 dbaccess/source/core/api/table.cxx |8 ---
 dbaccess/source/core/api/tablecontainer.cxx|8 +--
 dbaccess/source/core/dataaccess/ComponentDefinition.cxx|2 
 dbaccess/source/core/dataaccess/ComponentDefinition.hxx|2 
 dbaccess/source/core/dataaccess/databasedocument.cxx   |8 +--
 dbaccess/source/core/dataaccess/datasource.cxx |   15 
+++---
 dbaccess/source/core/dataaccess/documentdefinition.cxx |   24 
--
 dbaccess/source/core/inc/TableDeco.hxx |2 
 dbaccess/source/core/inc/column.hxx|2 
 dbaccess/source/core/inc/table.hxx |2 
 dbaccess/source/filter/xml/xmlExport.cxx   |   10 +---
 dbaccess/source/ui/browser/brwctrlr.cxx|   21 
+++-
 dbaccess/source/ui/browser/exsrcbrw.cxx|1 
 dbaccess/source/ui/browser/genericcontroller.cxx   |4 -
 dbaccess/source/ui/browser/sbagrid.cxx |2 
 dbaccess/source/ui/dlg/CollectionView.cxx  |7 +-
 dbaccess/source/ui/dlg/ConnectionHelper.cxx|2 
 dbaccess/source/ui/dlg/DbAdminImpl.cxx |5 --
 dbaccess/source/ui/dlg/dbwizsetup.cxx  |   10 +---
 dbaccess/source/ui/inc/JoinTableView.hxx   |2 
 dbaccess/source/ui/inc/brwctrlr.hxx|3 -
 dbaccess/source/ui/inc/exsrcbrw.hxx|2 
 dbaccess/source/ui/misc/TableCopyHelper.cxx|4 -
 dbaccess/source/ui/querydesign/JoinTableView.cxx   |1 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx |2 
 dbaccess/source/ui/uno/ColumnControl.cxx   |2 
 drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D.cxx |6 +-
 drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx|6 +-
 drawinglayer/source/primitive2d/helplineprimitive2d.cxx|9 +--
 drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx |   15 
++
 drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx|3 -
 drawinglayer/source/processor3d/shadow3dextractor.cxx  |6 +-
 drawinglayer/source/tools/emfphelperdata.cxx   |4 -
 drawinglayer/source/tools/wmfemfhelper.cxx |4 -
 45 files changed, 118 insertions(+), 144 deletions(-)

New commits:
commit eac1daddf376f44b55b5d592cdada2b7775f2910
Author: Noel 
AuthorDate: Sun Feb 21 20:03:52 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 08:08:40 2021 +0100

loplugin:refcounting in dbaccess

Change-Id: I8d8b33b5488dd1568f0105425d033da42578b4e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111289
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/dbaccess/source/core/api/RowSet.cxx 
b/dbaccess/source/core/api/RowSet.cxx
index 80e5206b4dd6..613a69fdecb2 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1853,7 +1853,7 @@ void 
ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
 }
 sName = sAlias;
 }
-ORowSetDataColumn* pColumn = new ORowSetDataColumn( 
getMetaData(),
+rtl::Reference pColumn = new 
ORowSetDataColumn( getMetaData(),
 
this,
 
this,
 
i+1,
@@ -1867,7 +1867,7 @@ void 
ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
 aColumns->emplace_back(pColumn);

[Libreoffice-commits] core.git: package/source pyuno/source reportdesign/source sax/source

2021-02-21 Thread Noel (via logerrit)
 package/source/manifest/ManifestExport.cxx  |   31 
 package/source/xstor/owriteablestream.cxx   |   30 ---
 package/source/xstor/xstorage.cxx   |   12 +---
 package/source/xstor/xstorage.hxx   |2 
 package/source/zippackage/ZipPackage.cxx|   16 ++
 package/source/zippackage/ZipPackageStream.cxx  |7 --
 pyuno/source/module/pyuno_runtime.cxx   |3 -
 reportdesign/source/core/api/ReportDefinition.cxx   |8 +--
 reportdesign/source/core/api/Section.cxx|4 -
 reportdesign/source/core/sdr/ReportDrawPage.cxx |   13 ++---
 reportdesign/source/filter/xml/xmlColumn.cxx|4 -
 reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx |   20 +++
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx |3 -
 reportdesign/source/ui/misc/statusbarcontroller.cxx |2 
 sax/source/expatwrap/sax_expat.cxx  |4 -
 15 files changed, 66 insertions(+), 93 deletions(-)

New commits:
commit e150c78cdfbe112bd880107b476ac42e72d4643c
Author: Noel 
AuthorDate: Sun Feb 21 12:34:46 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 19:00:26 2021 +0100

loplugin:refcounting in package..sax

Change-Id: I83618f54a4117cd81d8626307716129a761e14c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111274
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/package/source/manifest/ManifestExport.cxx 
b/package/source/manifest/ManifestExport.cxx
index 2f6f1ea0d913..c3c4be339646 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -32,6 +32,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -119,7 +120,7 @@ ManifestExport::ManifestExport( uno::Reference< 
xml::sax::XDocumentHandler > con
 const OUString  sPBKDF2_Name ( PBKDF2_NAME );
 const OUString  sPGP_Name( PGP_NAME );
 
-::comphelper::AttributeList * pRootAttrList = new 
::comphelper::AttributeList;
+rtl::Reference<::comphelper::AttributeList> pRootAttrList = new 
::comphelper::AttributeList;
 
 // find the mediatype of the document if any
 OUString aDocMediaType;
@@ -211,8 +212,6 @@ ManifestExport::ManifestExport( uno::Reference< 
xml::sax::XDocumentHandler > con
 }
 }
 
-uno::Reference < xml::sax::XAttributeList > xRootAttrList (pRootAttrList);
-
 xHandler->startDocument();
 uno::Reference < xml::sax::XExtendedDocumentHandler > xExtHandler ( 
xHandler, uno::UNO_QUERY );
 if ( xExtHandler.is() && bProvideDTD )
@@ -220,7 +219,7 @@ ManifestExport::ManifestExport( uno::Reference< 
xml::sax::XDocumentHandler > con
 xExtHandler->unknown ( MANIFEST_DOCTYPE );
 xHandler->ignorableWhitespace ( sWhiteSpace );
 }
-xHandler->startElement( sManifestElement, xRootAttrList );
+xHandler->startElement( sManifestElement, pRootAttrList );
 
 const uno::Any *pKeyInfoProperty = nullptr;
 if ( pRootFolderPropSeq )
@@ -271,14 +270,13 @@ ManifestExport::ManifestExport( uno::Reference< 
xml::sax::XDocumentHandler > con
 xHandler->startElement(isODF13 ? sEncryptedKeyElement13 : 
sEncryptedKeyElement, nullptr);
 xHandler->ignorableWhitespace ( sWhiteSpace );
 
-::comphelper::AttributeList * pNewAttrList = new 
::comphelper::AttributeList;
-uno::Reference < xml::sax::XAttributeList > xNewAttrList 
(pNewAttrList);
+rtl::Reference<::comphelper::AttributeList> pNewAttrList = 
new ::comphelper::AttributeList;
 // TODO: the algorithm should rather be configurable
 pNewAttrList->AddAttribute(
 isODF13 ? sAlgorithmAttribute13 : sAlgorithmAttribute,
 sCdataAttribute,
  
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p; );
-xHandler->startElement(isODF13 ? 
sEncryptionMethodElement13 : sEncryptionMethodElement, xNewAttrList);
+xHandler->startElement(isODF13 ? 
sEncryptionMethodElement13 : sEncryptionMethodElement, pNewAttrList);
 xHandler->endElement(isODF13 ? sEncryptionMethodElement13 
:  sEncryptionMethodElement);
 xHandler->ignorableWhitespace ( sWhiteSpace );
 
@@ -339,7 +337,7 @@ ManifestExport::ManifestExport( uno::Reference< 
xml::sax::XDocumentHandler > con
 // now write individual file entries
 for (const uno::Sequence& rSequence : rManList)
 {
-::comphelper::AttributeList *pAttrList = new 
::comphelper::AttributeList;
+rtl::Reference<::comphelper::AttributeList> pAttrList = new 
::comphelper::AttributeList;
 OUString aString;
 const uno::Any *pVector 

[Libreoffice-commits] core.git: include/unotools sc/inc sc/source

2021-02-21 Thread Noel (via logerrit)
 include/unotools/weakref.hxx |  132 +++
 sc/inc/cellsuno.hxx  |4 
 sc/source/core/data/dpobject.cxx |3 
 sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx   |   15 -
 sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx   |4 
 sc/source/filter/xml/xmlexprt.cxx|8 
 sc/source/ui/Accessibility/AccessibleCell.cxx|8 
 sc/source/ui/Accessibility/AccessibleCsvControl.cxx  |   14 -
 sc/source/ui/Accessibility/AccessibleDocument.cxx|   15 -
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |2 
 sc/source/ui/Accessibility/AccessibleEditObject.cxx  |7 
 sc/source/ui/Accessibility/AccessiblePageHeader.cxx  |2 
 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx  |2 
 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx |2 
 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx   |2 
 sc/source/ui/Accessibility/AccessiblePreviewTable.cxx|2 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |   10 
 sc/source/ui/app/drwtrans.cxx|2 
 sc/source/ui/app/inputwin.cxx|1 
 sc/source/ui/app/seltrans.cxx|4 
 sc/source/ui/drawfunc/fuins2.cxx |5 
 sc/source/ui/inc/AccessibleCsvControl.hxx|2 
 sc/source/ui/inc/AccessibleDocument.hxx  |4 
 sc/source/ui/inc/inputwin.hxx|2 
 sc/source/ui/inc/seltrans.hxx|2 
 sc/source/ui/inc/tphfedit.hxx|4 
 sc/source/ui/inc/viewfunc.hxx|2 
 sc/source/ui/pagedlg/tphfedit.cxx|   39 +--
 sc/source/ui/unoobj/cellsuno.cxx |   17 -
 sc/source/ui/unoobj/chart2uno.cxx|2 
 sc/source/ui/unoobj/docuno.cxx   |9 
 sc/source/ui/unoobj/fmtuno.cxx   |2 
 sc/source/ui/unoobj/shapeuno.cxx |7 
 sc/source/ui/unoobj/textuno.cxx  |   30 +-
 sc/source/ui/unoobj/viewuno.cxx  |   10 
 sc/source/ui/vba/vbaworkbooks.cxx|4 
 sc/source/ui/view/drawvie4.cxx   |5 
 sc/source/ui/view/gridwin5.cxx   |2 
 sc/source/ui/view/hintwin.cxx|   11 
 sc/source/ui/view/preview.cxx|2 
 sc/source/ui/view/viewfun3.cxx   |5 
 41 files changed, 247 insertions(+), 158 deletions(-)

New commits:
commit 78040af9acea0ab681aa54ff23844b647bc9b4f3
Author: Noel 
AuthorDate: Sun Feb 21 12:33:10 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:13:31 2021 +0100

loplugin:refcounting in sc

Change-Id: Id0ba24985aab36b931fa74b266dc5bf0bef62bb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111273
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
new file mode 100644
index ..7fdf5acba698
--- /dev/null
+++ b/include/unotools/weakref.hxx
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+namespace cppu
+{
+class OWeakObject;
+}
+
+namespace unotools
+{
+/** The WeakReference<> holds a weak reference to an object.
+
+That object must implement the css::uno::XWeak interface.
+
+The WeakReference itself is *not* thread safe, just as
+Reference itself isn't, but the implementation of the listeners etc.
+behind it *is* thread-safe, so multiple threads can 

[Libreoffice-commits] core.git: sdext/source sd/source

2021-02-21 Thread Noel (via logerrit)
 sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx  |2 
 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx|2 
 sd/source/ui/framework/configuration/Configuration.cxx  |4 -
 sd/source/ui/slidesorter/controller/SlsClipboard.cxx|8 +--
 sd/source/ui/slidesorter/controller/SlsTransferableData.cxx |4 -
 sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx |2 
 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |6 --
 sd/source/ui/unoidl/unopage.cxx |   16 +++---
 sd/source/ui/unoidl/unosrch.cxx |2 
 sd/source/ui/view/drviews5.cxx  |6 --
 sd/source/ui/view/outlnvsh.cxx  |6 --
 sd/source/ui/view/sdview2.cxx   |   23 
--
 sdext/source/pdfimport/pdfiadaptor.cxx  |   13 +++--
 13 files changed, 41 insertions(+), 53 deletions(-)

New commits:
commit 8f231fc5df201c45d16bce0b4b17f727842b2121
Author: Noel 
AuthorDate: Sun Feb 21 12:32:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:13:06 2021 +0100

loplugin:refcounting in sd

Change-Id: Ic95aa7a3c1fdab1baef744ec85ffc9c98dee5f1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111272
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx 
b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
index a8c81225130b..fde0cd953677 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
@@ -188,7 +188,7 @@ Reference SAL_CALL
 {
 ThrowIfDisposed();
 const SolarMutexGuard aSolarGuard;
-::utl::AccessibleStateSetHelper* pStateSet = new 
::utl::AccessibleStateSetHelper();
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet = new 
::utl::AccessibleStateSetHelper();
 
 if (mxParent.is())
 {
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx 
b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index ee663f2fbb1a..3ce13b899ef9 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -285,7 +285,7 @@ Reference SAL_CALL
 {
 ThrowIfDisposed();
 const SolarMutexGuard aSolarGuard;
-::utl::AccessibleStateSetHelper* pStateSet = new 
::utl::AccessibleStateSetHelper();
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet = new 
::utl::AccessibleStateSetHelper();
 
 pStateSet->AddState(AccessibleStateType::FOCUSABLE);
 pStateSet->AddState(AccessibleStateType::SELECTABLE);
diff --git a/sd/source/ui/framework/configuration/Configuration.cxx 
b/sd/source/ui/framework/configuration/Configuration.cxx
index 53bbaa339316..f155e0992e68 100644
--- a/sd/source/ui/framework/configuration/Configuration.cxx
+++ b/sd/source/ui/framework/configuration/Configuration.cxx
@@ -182,12 +182,10 @@ Reference SAL_CALL 
Configuration::createClone()
 ::osl::MutexGuard aGuard (maMutex);
 ThrowIfDisposed();
 
-Configuration* pConfiguration = new Configuration(
+return new Configuration(
 mxBroadcaster,
 mbBroadcastRequestEvents,
 *mpResourceContainer);
-
-return Reference(pConfiguration);
 }
 
 //- XNamed 
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx 
b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 25e2aaea7b56..c7f333a5f0b9 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -429,17 +429,17 @@ void Clipboard::CreateSlideTransferable (
 return;
 
 mrSlideSorter.GetView().BrkAction();
-SdTransferable* pTransferable = TransferableData::CreateTransferable (
+rtl::Reference pTransferable = 
TransferableData::CreateTransferable (
 pDocument,
 dynamic_cast(mrSlideSorter.GetViewShell()),
 aRepresentatives);
 
 if (bDrag)
-SD_MOD()->pTransferDrag = pTransferable;
+SD_MOD()->pTransferDrag = pTransferable.get();
 else
-SD_MOD()->pTransferClip = pTransferable;
+SD_MOD()->pTransferClip = pTransferable.get();
 
-pDocument->CreatingDataObj (pTransferable);
+pDocument->CreatingDataObj (pTransferable.get());
 pTransferable->SetWorkDocument(pDocument->AllocSdDrawDocument());
 std::unique_ptr pObjDesc(new 
TransferableObjectDescriptor);
 pTransferable->GetWorkDocument()->GetDocSh()
diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx 
b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
index b340642553cc..2aac76fe0600 100644
--- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
+++ 

[Libreoffice-commits] core.git: include/oox oox/source

2021-02-21 Thread Noel (via logerrit)
 include/oox/ppt/timenodelistcontext.hxx |2 +-
 oox/source/drawingml/shape.cxx  |2 +-
 oox/source/ppt/timenodelistcontext.cxx  |6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 98173f6222cec22170b53c7d9c94c6ce5b08b4d9
Author: Noel 
AuthorDate: Sun Feb 21 13:30:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:12:44 2021 +0100

loplugin:refcounting in oox..i18npool

Change-Id: Iff904a7ac887fa9b77bea87dbb1012281848a540
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111278
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/oox/ppt/timenodelistcontext.hxx 
b/include/oox/ppt/timenodelistcontext.hxx
index 8bc76b3c185d..cd98d06b15fd 100644
--- a/include/oox/ppt/timenodelistcontext.hxx
+++ b/include/oox/ppt/timenodelistcontext.hxx
@@ -40,7 +40,7 @@ namespace oox::ppt {
 public:
 virtual ~TimeNodeContext() throw() override;
 
-static TimeNodeContext * makeContext( ::oox::core::FragmentHandler2 
const & rParent, sal_Int32  aElement, const css::uno::Reference< 
css::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode );
+static rtl::Reference makeContext( 
::oox::core::FragmentHandler2 const & rParent, sal_Int32  aElement, const 
css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttribs, const 
TimeNodePtr & pNode );
 
 protected:
 TimeNodeContext( ::oox::core::FragmentHandler2 const & rParent, 
sal_Int32  aElement, const TimeNodePtr & pNode ) throw();
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 22cacec6eaa6..469dc7c30c17 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1840,7 +1840,7 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const 
Reference< XShapes >&
 // load the chart data from the XML fragment
 bool bMSO2007Doc = rFilter.isMSO2007Document();
 chart::ChartSpaceModel aModel(bMSO2007Doc);
-chart::ChartSpaceFragment *pChartSpaceFragment = new 
chart::ChartSpaceFragment(
+rtl::Reference pChartSpaceFragment 
= new chart::ChartSpaceFragment(
 rFilter, mxChartShapeInfo->maFragmentPath, aModel );
 const OUString aThemeOverrideFragmentPath( 
pChartSpaceFragment->
 
getFragmentPathFromFirstTypeFromOfficeDoc(u"themeOverride") );
diff --git a/oox/source/ppt/timenodelistcontext.cxx 
b/oox/source/ppt/timenodelistcontext.cxx
index 6ecd0985cd0a..93525ae4879a 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -909,12 +909,12 @@ namespace oox::ppt {
 
 }
 
-TimeNodeContext * TimeNodeContext::makeContext(
+rtl::Reference TimeNodeContext::makeContext(
 FragmentHandler2 const & rParent, sal_Int32  aElement,
 const Reference< XFastAttributeList >& xAttribs,
 const TimeNodePtr & pNode )
 {
-TimeNodeContext *pCtx = nullptr;
+rtl::Reference pCtx;
 switch( aElement )
 {
 case PPT_TOKEN( animClr ):
@@ -1039,7 +1039,7 @@ namespace oox::ppt {
 
 TimeNodePtr pNode = std::make_shared(nNodeType);
 maList.push_back( pNode );
-FragmentHandler2 * pContext = TimeNodeContext::makeContext( *this, 
aElementToken, rAttribs.getFastAttributeList(), pNode );
+rtl::Reference pContext = 
TimeNodeContext::makeContext( *this, aElementToken, 
rAttribs.getFastAttributeList(), pNode );
 
 return pContext ? pContext : this;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/inc framework/source

2021-02-21 Thread Noel (via logerrit)
 framework/inc/uielement/toolbarmerger.hxx  |2 
 framework/source/accelerators/acceleratorconfiguration.cxx |8 --
 framework/source/accelerators/documentacceleratorconfiguration.cxx |4 -
 framework/source/accelerators/moduleacceleratorconfiguration.cxx   |4 -
 framework/source/dispatch/dispatchinformationprovider.cxx  |6 -
 framework/source/dispatch/dispatchprovider.cxx |   30 
+---
 framework/source/fwe/xml/menudocumenthandler.cxx   |   13 +--
 framework/source/fwe/xml/saxnamespacefilter.cxx|3 
 framework/source/fwe/xml/statusbardocumenthandler.cxx  |8 --
 framework/source/fwe/xml/toolboxdocumenthandler.cxx|8 --
 framework/source/fwi/uielement/constitemcontainer.cxx  |5 -
 framework/source/fwi/uielement/itemcontainer.cxx   |5 -
 framework/source/fwi/uielement/rootitemcontainer.cxx   |5 -
 framework/source/helper/ocomponentaccess.cxx   |3 
 framework/source/helper/statusindicatorfactory.cxx |8 --
 framework/source/layoutmanager/layoutmanager.cxx   |4 -
 framework/source/loadenv/loadenv.cxx   |   16 +---
 framework/source/services/desktop.cxx  |   17 +---
 framework/source/services/frame.cxx|   27 
++-
 framework/source/services/modulemanager.cxx|5 -
 framework/source/services/taskcreatorsrv.cxx   |   15 +---
 framework/source/uiconfiguration/globalsettings.cxx|5 -
 framework/source/uiconfiguration/imagemanagerimpl.cxx  |   35 
--
 framework/source/uiconfiguration/windowstateconfiguration.cxx  |4 -
 framework/source/uielement/addonstoolbarwrapper.cxx|4 -
 framework/source/uielement/menubarmanager.cxx  |8 +-
 framework/source/uielement/menubarwrapper.cxx  |8 --
 framework/source/uielement/progressbarwrapper.cxx  |4 -
 framework/source/uielement/statusbarmanager.cxx|   10 +-
 framework/source/uielement/statusbarwrapper.cxx|6 -
 framework/source/uielement/toolbarmanager.cxx  |2 
 framework/source/uielement/toolbarmerger.cxx   |4 -
 framework/source/uielement/toolbarwrapper.cxx  |4 -
 framework/source/uielement/uicommanddescription.cxx|8 --
 framework/source/uifactory/addonstoolbarfactory.cxx|7 --
 framework/source/xml/acceleratorconfigurationwriter.cxx|   11 +--
 framework/source/xml/imagesdocumenthandler.cxx |   13 +--
 37 files changed, 128 insertions(+), 201 deletions(-)

New commits:
commit 897970cd0b9709258b6b5b5fc05dba2e74a72b7c
Author: Noel 
AuthorDate: Sun Feb 21 13:32:15 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:11:48 2021 +0100

loplugin:refcounting in framework

Change-Id: I2d7d14fe0335689e4a338c70587bf33137ed1ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111279
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index b62e3be6972c..bd07bb17e7e4 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -115,7 +115,7 @@ class ToolBarMerger
ToolBox::ImplToolItems::size_type nPos,
const OUString&
rMergeCommandParameter );
 
-static ::cppu::OWeakObject* CreateController(
+static rtl::Reference<::cppu::OWeakObject> CreateController(
 const css::uno::Reference< css::uno::XComponentContext > & 
rxContext,
 const css::uno::Reference< css::frame::XFrame > & xFrame,
 ToolBox*pToolbar,
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx 
b/framework/source/accelerators/acceleratorconfiguration.cxx
index 96c0056d35c0..821b1137259c 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -384,14 +384,12 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const 
css::uno::Reference< c
 // Note: Use special filter object between parser and reader
 // to get filtered xml with right namespaces ...
 // Use further a temp cache for reading!
-AcceleratorConfigurationReader*pReader = new 
AcceleratorConfigurationReader(m_aReadCache);
-css::uno::Reference< css::xml::sax::XDocumentHandler > xReader 
(static_cast< ::cppu::OWeakObject* >(pReader), css::uno::UNO_QUERY_THROW);
-SaxNamespaceFilter*

[Libreoffice-commits] core.git: filter/source

2021-02-21 Thread Noel (via logerrit)
 filter/source/config/cache/basecontainer.cxx |6 +--
 filter/source/config/cache/filterfactory.cxx |3 -
 filter/source/msfilter/eschesdo.cxx  |2 -
 filter/source/svg/svgexport.cxx  |   10 -
 filter/source/svg/svgfilter.cxx  |1 
 filter/source/svg/svgfilter.hxx  |2 -
 filter/source/t602/t602filter.cxx|2 -
 filter/source/t602/t602filter.hxx|3 +
 filter/source/xsltdialog/typedetectionexport.cxx |   39 ++-
 filter/source/xsltdialog/typedetectionimport.cxx |6 +--
 filter/source/xsltfilter/XSLTFilter.cxx  |   19 +--
 11 files changed, 38 insertions(+), 55 deletions(-)

New commits:
commit 6b6f9fb71fa1bfcb438b89596e6f19529cfe1eba
Author: Noel 
AuthorDate: Sun Feb 21 13:33:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:11:14 2021 +0100

loplugin:refcounting in filter

Change-Id: I77323376b7a2b04e50bf3017c00a0eea566da37d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111281
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/basecontainer.cxx 
b/filter/source/config/cache/basecontainer.cxx
index 4f7b4f04ca49..71eb4f931399 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -353,8 +353,7 @@ css::uno::Reference< css::container::XEnumeration > 
SAL_CALL BaseContainer::crea
 {
 OSL_FAIL("not pure virtual ... but not really implemented .-)");
 
-::comphelper::OEnumerationByName* pEnum = new 
::comphelper::OEnumerationByName(this, css::uno::Sequence< OUString >());
-return css::uno::Reference< css::container::XEnumeration >(static_cast< 
css::container::XEnumeration* >(pEnum), css::uno::UNO_QUERY);
+return new ::comphelper::OEnumerationByName(this, css::uno::Sequence< 
OUString >());
 }
 
 
@@ -398,8 +397,7 @@ css::uno::Reference< css::container::XEnumeration > 
SAL_CALL BaseContainer::crea
  instead of checking of NULL returns! */
 
 css::uno::Sequence< OUString > lSubSet = 
comphelper::containerToSequence(lKeys);
-::comphelper::OEnumerationByName* pEnum = new 
::comphelper::OEnumerationByName(this, lSubSet);
-return css::uno::Reference< css::container::XEnumeration >(static_cast< 
css::container::XEnumeration* >(pEnum), css::uno::UNO_QUERY);
+return new ::comphelper::OEnumerationByName(this, lSubSet);
 }
 
 
diff --git a/filter/source/config/cache/filterfactory.cxx 
b/filter/source/config/cache/filterfactory.cxx
index fa26ee7ba580..e499b4bad633 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -182,8 +182,7 @@ css::uno::Reference< css::container::XEnumeration > 
SAL_CALL FilterFactory::crea
 // Attention: Do not return empty reference for empty list!
 // The outside check "hasMoreElements()" should be enough, to detect this 
state :-)
 css::uno::Sequence< OUString > lSet = 
comphelper::containerToSequence(lEnumSet);
-::comphelper::OEnumerationByName* pEnum = new 
::comphelper::OEnumerationByName(this, lSet);
-return css::uno::Reference< css::container::XEnumeration >(static_cast< 
css::container::XEnumeration* >(pEnum), css::uno::UNO_QUERY);
+return new ::comphelper::OEnumerationByName(this, lSet);
 }
 
 
diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index d2c85672ca05..7df0a58f7aa4 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -861,7 +861,7 @@ ImplEESdrWriter::~ImplEESdrWriter()
 
 bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
 {
-SvxDrawPage* pSvxDrawPage;
+rtl::Reference pSvxDrawPage;
 if ( mpSdrPage !=  || !mXDrawPage.is() )
 {
 // eventually write SolverContainer of current page, deletes the Solver
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index a33fb46f1980..e35a42746216 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -575,10 +575,6 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< 
XOutputStream >& rxOSt
 // mpSVGExport = new SVGExport( xDocHandler );
 mpSVGExport = new SVGExport( xContext, xDocHandler, 
maFilterData );
 
-// xKeepAlive is set up only to manage the life-time of the 
object pointed by mpSVGExport,
-// and in order to prevent that it is destroyed when passed to 
AnimationExporter.
-Reference< XInterface > xKeepAlive = static_cast< 
css::document::XFilter* >( mpSVGExport );
-
 // create an id for each draw page
 for( const auto& rPage : mSelectedPages )
 implRegisterInterface( rPage );
@@ -664,10 +660,6 @@ bool SVGFilter::implExportWriterOrCalc( const Reference< 
XOutputStream >& rxOStm
 // mpSVGExport = 

[Libreoffice-commits] core.git: forms/source

2021-02-21 Thread Noel (via logerrit)
 forms/source/component/DatabaseForm.cxx   |4 +---
 forms/source/component/FormComponent.cxx  |4 
 forms/source/component/FormattedField.cxx |9 -
 forms/source/component/FormattedField.hxx |1 +
 forms/source/component/FormattedFieldWrapper.cxx  |   19 +++
 forms/source/component/FormsCollection.cxx|7 +++
 forms/source/component/Grid.cxx   |6 ++
 forms/source/component/clickableimage.cxx |2 +-
 forms/source/component/navigationbar.hxx  |1 -
 forms/source/inc/FormComponent.hxx|4 ++--
 forms/source/richtext/richtextcontrol.cxx |6 +++---
 forms/source/richtext/richtextmodel.cxx   |2 +-
 forms/source/richtext/richtextmodel.hxx   |2 --
 forms/source/xforms/binding.cxx   |5 ++---
 forms/source/xforms/model_ui.cxx  |6 +++---
 forms/source/xforms/submission.cxx|   15 ++-
 forms/source/xforms/submission/replace.cxx|5 +++--
 forms/source/xforms/submission/submission_get.cxx |4 ++--
 18 files changed, 41 insertions(+), 61 deletions(-)

New commits:
commit 7ffb71e759e5d29a505188d1cbf506dd57383a4a
Author: Noel 
AuthorDate: Sun Feb 21 13:33:00 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:10:51 2021 +0100

loplugin:refcounting in forms

Change-Id: I19d67e54f77e354eaddaaa7de1f3e22c2b7cdbf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111280
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/forms/source/component/DatabaseForm.cxx 
b/forms/source/component/DatabaseForm.cxx
index 066eeb45e293..7411abf90351 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -1373,10 +1373,8 @@ void SAL_CALL ODatabaseForm::clearWarnings(  )
 
 Reference< XCloneable > SAL_CALL ODatabaseForm::createClone(  )
 {
-ODatabaseForm* pClone = new ODatabaseForm( *this );
-osl_atomic_increment( >m_refCount );
+rtl::Reference pClone = new ODatabaseForm( *this );
 pClone->clonedFrom( *this );
-osl_atomic_decrement( >m_refCount );
 return pClone;
 }
 
diff --git a/forms/source/component/FormComponent.cxx 
b/forms/source/component/FormComponent.cxx
index 8b3047cc176b..e2a6a582ed31 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1137,7 +1137,6 @@ OBoundControlModel::OBoundControlModel(
 ,m_aUpdateListeners(m_aMutex)
 ,m_aFormComponentListeners( m_aMutex )
 ,m_bInputRequired( false )
-,m_pAggPropMultiplexer( nullptr )
 ,m_bFormListening( false )
 ,m_bLoaded(false)
 ,m_bRequired(false)
@@ -1170,7 +1169,6 @@ OBoundControlModel::OBoundControlModel(
 ,m_aFormComponentListeners( m_aMutex )
 ,m_xValidator( _pOriginal->m_xValidator )
 ,m_bInputRequired( false )
-,m_pAggPropMultiplexer( nullptr )
 ,m_bFormListening( false )
 ,m_bLoaded( false )
 ,m_bRequired( false )
@@ -1214,7 +1212,6 @@ OBoundControlModel::~OBoundControlModel()
 if ( m_pAggPropMultiplexer )
 {
 m_pAggPropMultiplexer->dispose();
-m_pAggPropMultiplexer->release();
 m_pAggPropMultiplexer = nullptr;
 }
 }
@@ -1244,7 +1241,6 @@ void OBoundControlModel::implInitAggMultiplexer( )
 if ( m_xAggregateSet.is() )
 {
 m_pAggPropMultiplexer = new OPropertyChangeMultiplexer( this, 
m_xAggregateSet, false );
-m_pAggPropMultiplexer->acquire();
 }
 
 osl_atomic_decrement( _refCount );
diff --git a/forms/source/component/FormattedField.cxx 
b/forms/source/component/FormattedField.cxx
index ed2f748fb7cd..74e6aaf08e01 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -72,7 +72,7 @@ namespace frm
 {
 namespace {
 
-class StandardFormatsSupplier : protected SvNumberFormatsSupplierObj, public 
::utl::ITerminationListener
+class StandardFormatsSupplier : public SvNumberFormatsSupplierObj, public 
::utl::ITerminationListener
 {
 protected:
 std::unique_ptr   m_pMyPrivateFormatter;
@@ -113,8 +113,7 @@ Reference< XNumberFormatsSupplier > 
StandardFormatsSupplier::get( const Referenc
 // get the Office's locale
 eSysLanguage = SvtSysLocale().GetLanguageTag().getLanguageType( false);
 }
-StandardFormatsSupplier* pSupplier = new StandardFormatsSupplier( _rxORB, 
eSysLanguage );
-Reference< XNumberFormatsSupplier > xNewlyCreatedSupplier( pSupplier );
+rtl::Reference pSupplier = new 
StandardFormatsSupplier( _rxORB, eSysLanguage );
 {
 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
 Reference< XNumberFormatsSupplier > xSupplier = 
s_xDefaultFormatsSupplier;
@@ -122,9 +121,9 @@ Reference< XNumberFormatsSupplier > 
StandardFormatsSupplier::get( const Referenc
 // somebody used the small time frame 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source

2021-02-20 Thread Noel (via logerrit)
 include/sfx2/stbitem.hxx |3 ++-
 sfx2/source/appl/appdispatchprovider.cxx |2 +-
 sfx2/source/appl/appopen.cxx |4 ++--
 sfx2/source/appl/helpinterceptor.cxx |3 +--
 sfx2/source/appl/workwin.cxx |5 ++---
 sfx2/source/control/thumbnailviewacc.cxx |4 ++--
 sfx2/source/dialog/infobar.cxx   |9 ++---
 sfx2/source/dialog/mailmodel.cxx |7 +++
 sfx2/source/doc/docfile.cxx  |8 +++-
 sfx2/source/doc/doctemplateslocal.cxx|   16 +++-
 sfx2/source/doc/objmisc.cxx  |8 
 sfx2/source/doc/objstor.cxx  |   10 --
 sfx2/source/doc/sfxbasemodel.cxx |   12 +---
 sfx2/source/view/sfxbasecontroller.cxx   |4 ++--
 sfx2/source/view/viewprn.cxx |2 +-
 15 files changed, 41 insertions(+), 56 deletions(-)

New commits:
commit d49277fc7c017c5a62a0c28af782cfc04a6460ab
Author: Noel 
AuthorDate: Sat Feb 20 12:50:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 19:21:52 2021 +0100

loplugin:refcounting in sfx2

Change-Id: I22ca5dab32fb4bf9a1ab7d478105db2d12e14b14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111262
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx
index 8929e2efb2f3..060866e4c3eb 100644
--- a/include/sfx2/stbitem.hxx
+++ b/include/sfx2/stbitem.hxx
@@ -61,12 +61,13 @@ class SFX2_DLLPUBLIC SfxStatusBarControl: public 
svt::StatusbarController
 sal_uInt16 nId;
 VclPtr  pBar;
 
-protected:
+public:
 // new controller API
 // XInterface
 virtual void   SAL_CALL acquire() throw() override;
 virtual void   SAL_CALL release() throw() override;
 
+protected:
 // XEventListener
 using svt::StatusbarController::disposing;
 
diff --git a/sfx2/source/appl/appdispatchprovider.cxx 
b/sfx2/source/appl/appdispatchprovider.cxx
index a62872a9a420..af86f8bcc02c 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -133,7 +133,7 @@ Reference < XDispatch > SAL_CALL 
SfxAppDispatchProvider::queryDispatch(
 
 if ( pSlot )
 {
-SfxOfficeDispatch* pDispatch = new SfxOfficeDispatch( pAppDisp, pSlot, 
aURL ) ;
+rtl::Reference pDispatch = new SfxOfficeDispatch( 
pAppDisp, pSlot, aURL ) ;
 pDispatch->SetFrame(m_xFrame);
 pDispatch->SetMasterUnoCommand( bMasterCommand );
 xDisp = pDispatch;
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index e59e58b08033..4a6c1f403bbb 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -676,8 +676,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 // intercept all incoming interactions and provide useful 
information
 // later if the following transaction was finished.
 
-sfx2::PreventDuplicateInteraction* pHandler = new 
sfx2::PreventDuplicateInteraction(comphelper::getProcessComponentContext());
-uno::Reference xHandler(static_cast< 
css::task::XInteractionHandler* >(pHandler), css::uno::UNO_QUERY);
+rtl::Reference pHandler = new 
sfx2::PreventDuplicateInteraction(comphelper::getProcessComponentContext());
+uno::Reference xHandler(pHandler);
 uno::Reference xWrappedHandler;
 
 // wrap existing handler or create new UUI handler
diff --git a/sfx2/source/appl/helpinterceptor.cxx 
b/sfx2/source/appl/helpinterceptor.cxx
index ccab2578e750..7fd631b05951 100644
--- a/sfx2/source/appl/helpinterceptor.cxx
+++ b/sfx2/source/appl/helpinterceptor.cxx
@@ -112,8 +112,7 @@ Reference< XDispatch > SAL_CALL 
HelpInterceptor_Impl::queryDispatch(
 if ( bHelpURL )
 {
 DBG_ASSERT( xResult.is(), "invalid dispatch" );
-HelpDispatch_Impl* pHelpDispatch = new HelpDispatch_Impl( *this, 
xResult );
-xResult.set( static_cast< ::cppu::OWeakObject* >(pHelpDispatch), 
UNO_QUERY );
+xResult = new HelpDispatch_Impl( *this, xResult );
 }
 
 return xResult;
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 217ae75436bf..d3af7dfa6950 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -485,9 +485,8 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxFrame 
*pFrm, SfxFrame* pMast
 
 // create and initialize layout manager listener
 Reference< css::frame::XFrame > xFrame = GetFrameInterface();
-LayoutManagerListener* pLayoutManagerListener = new LayoutManagerListener( 
this );
-m_xLayoutManagerListener.set( static_cast< cppu::OWeakObject* >( 
pLayoutManagerListener ),
-  css::uno::UNO_QUERY );
+rtl::Reference pLayoutManagerListener = new 
LayoutManagerListener( this );
+m_xLayoutManagerListener = pLayoutManagerListener;
 

[Libreoffice-commits] core.git: starmath/source

2021-02-20 Thread Noel (via logerrit)
 starmath/source/AccessibleSmElement.cxx |   10 --
 starmath/source/AccessibleSmElementsControl.cxx |9 -
 starmath/source/accessibility.cxx   |   14 +-
 3 files changed, 13 insertions(+), 20 deletions(-)

New commits:
commit 7c992bd895574eb1faf473875f8e655e9b73cb79
Author: Noel 
AuthorDate: Sat Feb 20 12:49:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 19:21:34 2021 +0100

loplugin:refcounting in starmath

Change-Id: I165272a8f7bd514b60719db360a2a19236b6658a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111260
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/AccessibleSmElement.cxx 
b/starmath/source/AccessibleSmElement.cxx
index 848af8af6b0d..30d19cc8afc3 100644
--- a/starmath/source/AccessibleSmElement.cxx
+++ b/starmath/source/AccessibleSmElement.cxx
@@ -168,17 +168,15 @@ uno::Reference 
AccessibleSmElement::getAccessibleRelatio
 {
 OContextEntryGuard aGuard(this);
 
-utl::AccessibleRelationSetHelper* pRelationSetHelper = new 
utl::AccessibleRelationSetHelper;
-uno::Reference xSet = pRelationSetHelper;
-return xSet;
+return new utl::AccessibleRelationSetHelper;
 }
 
 uno::Reference 
AccessibleSmElement::getAccessibleStateSet()
 {
 OExternalLockGuard aGuard(this);
 
-utl::AccessibleStateSetHelper* pStateSetHelper = new 
utl::AccessibleStateSetHelper;
-uno::Reference xStateSet = pStateSetHelper;
+rtl::Reference pStateSetHelper
+= new utl::AccessibleStateSetHelper;
 
 if (m_pSmElementsControl && !rBHelper.bDisposed && !rBHelper.bInDispose)
 {
@@ -199,7 +197,7 @@ uno::Reference 
AccessibleSmElement::getAccessibleStateSet()
 else
 pStateSetHelper->AddState(AccessibleStateType::DEFUNC);
 
-return xStateSet;
+return pStateSetHelper;
 }
 
 // XAccessibleComponent
diff --git a/starmath/source/AccessibleSmElementsControl.cxx 
b/starmath/source/AccessibleSmElementsControl.cxx
index 0b82f3f87e5a..922c8097fd6a 100644
--- a/starmath/source/AccessibleSmElementsControl.cxx
+++ b/starmath/source/AccessibleSmElementsControl.cxx
@@ -192,7 +192,8 @@ uno::Reference 
AccessibleSmElementsControl::getAccessibleChild(sal_
 if (!xChild.is())
 {
 sal_uInt16 nHighlightItemId = m_pControl->itemHighlighted();
-AccessibleSmElement* pChild = new AccessibleSmElement(m_pControl, 
nItemId, c);
+rtl::Reference pChild
+= new AccessibleSmElement(m_pControl, nItemId, c);
 if (pChild->itemId() == nHighlightItemId)
 pChild->SetFocus(true);
 m_aAccessibleChildren[c] = pChild;
@@ -342,9 +343,7 @@ uno::Reference 
AccessibleSmElementsControl::getAccessibl
 uno::Reference 
AccessibleSmElementsControl::getAccessibleStateSet()
 {
 SolarMutexGuard aGuard;
-::utl::AccessibleStateSetHelper* pStateSet = new 
::utl::AccessibleStateSetHelper;
-
-uno::Reference xStateSet(pStateSet);
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet = new 
::utl::AccessibleStateSetHelper;
 
 if (!m_pControl)
 pStateSet->AddState(AccessibleStateType::DEFUNC);
@@ -364,7 +363,7 @@ uno::Reference 
AccessibleSmElementsControl::getAccessibleSt
 pStateSet->AddState(AccessibleStateType::OPAQUE);
 }
 
-return xStateSet;
+return pStateSet;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/accessibility.cxx 
b/starmath/source/accessibility.cxx
index efc6bc691043..851f122c5ad5 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -337,11 +337,9 @@ Reference< XAccessibleRelationSet > SAL_CALL 
SmGraphicAccessible::getAccessibleR
 Reference< XAccessibleStateSet > SAL_CALL 
SmGraphicAccessible::getAccessibleStateSet()
 {
 SolarMutexGuard aGuard;
-::utl::AccessibleStateSetHelper *pStateSet =
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet =
 new ::utl::AccessibleStateSetHelper;
 
-Reference xStateSet( pStateSet );
-
 if (!pWin)
 pStateSet->AddState( AccessibleStateType::DEFUNC );
 else
@@ -360,7 +358,7 @@ Reference< XAccessibleStateSet > SAL_CALL 
SmGraphicAccessible::getAccessibleStat
 pStateSet->AddState( AccessibleStateType::OPAQUE );
 }
 
-return xStateSet;
+return pStateSet;
 }
 
 Locale SAL_CALL SmGraphicAccessible::getLocale()
@@ -703,7 +701,7 @@ sal_Bool SAL_CALL SmGraphicAccessible::copyText(
 {
 OUString sText( getTextRange(nStartIndex, nEndIndex) );
 
-vcl::unohelper::TextDataObject* pDataObj = new 
vcl::unohelper::TextDataObject( sText );
+rtl::Reference pDataObj = new 
vcl::unohelper::TextDataObject( sText );
 SolarMutexReleaser aReleaser;
 xClipboard->setContents( pDataObj, nullptr );
 
@@ -1717,11 +1715,9 @@ uno::Reference< XAccessibleRelationSet > SAL_CALL 
SmEditAccessible::getAccessibl
 uno::Reference< XAccessibleStateSet > SAL_CALL 

[Libreoffice-commits] core.git: sot/source

2021-02-20 Thread Noel (via logerrit)
 sot/source/sdstor/ucbstorage.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 85a74ebd929d6396daf591a01f7975fd7e4f
Author: Noel 
AuthorDate: Sat Feb 20 12:49:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 17:48:23 2021 +0100

loplugin:refcounting in sot

Change-Id: I29d50f536779c28570c8920ad34d0770934af0c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111261
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index ee6576c6b87c..bb936124a2ff 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -1577,18 +1577,17 @@ void UCBStorage_Impl::Init()
 {
 if ( !pStream->GetError() )
 {
-::utl::OInputStreamWrapper* pHelper = new 
::utl::OInputStreamWrapper( *pStream );
-css::uno::Reference < css::io::XInputStream > 
xInputStream( pHelper );
+rtl::Reference<::utl::OInputStreamWrapper> pHelper 
= new ::utl::OInputStreamWrapper( *pStream );
 
 // create a manifest reader object that will read 
in the manifest from the stream
 Reference < 
css::packages::manifest::XManifestReader > xReader =
 
css::packages::manifest::ManifestReader::create(
 ::comphelper::getProcessComponentContext() 
) ;
-Sequence < Sequence < PropertyValue > > aProps = 
xReader->readManifestSequence( xInputStream );
+Sequence < Sequence < PropertyValue > > aProps = 
xReader->readManifestSequence( pHelper );
 
 // cleanup
 xReader = nullptr;
-xInputStream = nullptr;
+pHelper = nullptr;
 SetProps( aProps, OUString() );
 }
 }
@@ -2125,8 +2124,7 @@ sal_Int16 UCBStorage_Impl::Commit()
 
 // get the stream from the temp file and create an 
output stream wrapper
 SvStream* pStream = pTempFile->GetStream( 
StreamMode::STD_READWRITE );
-::utl::OOutputStreamWrapper* pHelper = new 
::utl::OOutputStreamWrapper( *pStream );
-css::uno::Reference < css::io::XOutputStream > 
xOutputStream( pHelper );
+rtl::Reference<::utl::OOutputStreamWrapper> 
xOutputStream = new ::utl::OOutputStreamWrapper( *pStream );
 
 // create a manifest writer object that will fill 
the stream
 Reference < 
css::packages::manifest::XManifestWriter > xWriter =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svgio/inc svgio/source

2021-02-20 Thread Noel (via logerrit)
 svgio/inc/svgcharacternode.hxx  |3 ++-
 svgio/source/svgreader/svgcharacternode.cxx |4 ++--
 svgio/source/svguno/xsvgparser.cxx  |   11 +--
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit f56ae6badbb1eeb53c443bedbe8e96fd36ed426c
Author: Noel 
AuthorDate: Sat Feb 20 12:49:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 17:48:01 2021 +0100

loplugin:refcounting in svgio

Change-Id: Id7669026fbe4b6cc92e2b137cba0c6c3c33f7712
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111259
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svgio/inc/svgcharacternode.hxx b/svgio/inc/svgcharacternode.hxx
index 46d7ec995b18..2a3331808949 100644
--- a/svgio/inc/svgcharacternode.hxx
+++ b/svgio/inc/svgcharacternode.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVGIO_INC_SVGCHARACTERNODE_HXX
 
 #include 
+#include 
 
 #include 
 
@@ -133,7 +134,7 @@ namespace svgio::svgreader
 OUString   maText;
 
 /// local helpers
-drawinglayer::primitive2d::TextSimplePortionPrimitive2D* 
createSimpleTextPrimitive(
+
rtl::Reference 
createSimpleTextPrimitive(
 SvgTextPosition& rSvgTextPosition,
 const SvgStyleAttributes& rSvgStyleAttributes) const;
 void decomposeTextWithStyle(
diff --git a/svgio/source/svgreader/svgcharacternode.cxx 
b/svgio/source/svgreader/svgcharacternode.cxx
index dc24adc7ffc0..a0ab6d9b08a9 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -209,12 +209,12 @@ namespace svgio::svgreader
 }
 }
 
-drawinglayer::primitive2d::TextSimplePortionPrimitive2D* 
SvgCharacterNode::createSimpleTextPrimitive(
+
rtl::Reference 
SvgCharacterNode::createSimpleTextPrimitive(
 SvgTextPosition& rSvgTextPosition,
 const SvgStyleAttributes& rSvgStyleAttributes) const
 {
 // prepare retval, index and length
-drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pRetval = 
nullptr;
+
rtl::Reference pRetval;
 sal_uInt32 nLength(getText().getLength());
 
 if(nLength)
diff --git a/svgio/source/svguno/xsvgparser.cxx 
b/svgio/source/svguno/xsvgparser.cxx
index 511640e6f6d7..ddd9d20cd74c 100644
--- a/svgio/source/svguno/xsvgparser.cxx
+++ b/svgio/source/svguno/xsvgparser.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -124,9 +125,8 @@ namespace svgio::svgreader
 if(xSVGStream.is())
 {
 // local document handler
-SvgDocHdl* pSvgDocHdl = new SvgDocHdl(aAbsolutePath);
-uno::Reference 
xSvgDocHdl(pSvgDocHdl);
-parseSvgXML(xSVGStream, xSvgDocHdl);
+rtl::Reference pSvgDocHdl = new 
SvgDocHdl(aAbsolutePath);
+parseSvgXML(xSVGStream, pSvgDocHdl);
 
 // decompose to primitives
 for(std::unique_ptr const & pCandidate : 
pSvgDocHdl->getSvgDocument().getSvgNodeVector())
@@ -154,9 +154,8 @@ namespace svgio::svgreader
 if (!xSvgStream.is())
 return aAnyResult;
 
-SvgDocHdl* pSvgDocHdl = new SvgDocHdl(aAbsolutePath);
-uno::Reference xSvgDocHdl(pSvgDocHdl);
-parseSvgXML(xSvgStream, xSvgDocHdl);
+rtl::Reference pSvgDocHdl = new 
SvgDocHdl(aAbsolutePath);
+parseSvgXML(xSvgStream, pSvgDocHdl);
 
 // decompose to primitives
 for (std::unique_ptr const & pCandidate : 
pSvgDocHdl->getSvgDocument().getSvgNodeVector())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: dbaccess/source include/svx sd/source svx/source

2021-02-20 Thread Noel (via logerrit)
 dbaccess/source/ui/browser/sbagrid.cxx|2 -
 dbaccess/source/ui/inc/sbagrid.hxx|2 -
 include/svx/fmgridif.hxx  |2 -
 include/svx/tbcontrl.hxx  |3 -
 include/svx/unoapi.hxx|3 +
 include/svx/unopage.hxx   |3 +
 sd/source/ui/unoidl/unomodel.cxx  |8 ++---
 svx/source/accessibility/AccessibleControlShape.cxx   |5 +--
 svx/source/accessibility/AccessibleFrameSelector.cxx  |   10 ++
 svx/source/accessibility/AccessibleShape.cxx  |4 +-
 svx/source/accessibility/GraphCtlAccessibleContext.cxx|2 -
 svx/source/accessibility/charmapacc.cxx   |4 +-
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx |7 +---
 svx/source/accessibility/svxrectctaccessiblecontext.cxx   |   12 +++
 svx/source/dialog/charmap.cxx |2 -
 svx/source/dialog/docrecovery.cxx |6 +--
 svx/source/dialog/weldeditview.cxx|7 +---
 svx/source/fmcomp/fmgridif.cxx|6 +--
 svx/source/form/fmobj.cxx |2 -
 svx/source/form/formcontroller.cxx|   18 +--
 svx/source/gallery2/galtheme.cxx  |2 -
 svx/source/inc/StylesPreviewWindow.hxx|3 -
 svx/source/sdr/overlay/overlaypolypolygon.cxx |7 +---
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx  |   13 +++-
 svx/source/svdraw/svdobj.cxx  |3 +
 svx/source/svdraw/svdotextdecomposition.cxx   |   19 ++--
 svx/source/svdraw/svdotextpathdecomposition.cxx   |   22 +-
 svx/source/table/accessibletableshape.cxx |6 +--
 svx/source/tbxctrls/StylesPreviewWindow.cxx   |7 +---
 svx/source/tbxctrls/tbcontrl.cxx  |9 +
 svx/source/unodraw/UnoGraphicExporter.cxx |3 -
 svx/source/unodraw/unomod.cxx |5 +--
 svx/source/unodraw/unopage.cxx|6 +--
 33 files changed, 94 insertions(+), 119 deletions(-)

New commits:
commit d8ed3bda462b351d2b98ec57cfdb879e0eec0010
Author: Noel 
AuthorDate: Fri Feb 19 15:53:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 11:38:55 2021 +0100

loplugin:refcounting in svx

Change-Id: I79afd219a29ad176ce72020579d2b29a0b3ec09d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111220
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/dbaccess/source/ui/browser/sbagrid.cxx 
b/dbaccess/source/ui/browser/sbagrid.cxx
index 093f243ca738..f10ee9ccb0df 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -108,7 +108,7 @@ SbaXGridControl::~SbaXGridControl()
 {
 }
 
-FmXGridPeer* SbaXGridControl::imp_CreatePeer(vcl::Window* pParent)
+rtl::Reference SbaXGridControl::imp_CreatePeer(vcl::Window* 
pParent)
 {
 FmXGridPeer* pReturn = new SbaXGridPeer(m_xContext);
 
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx 
b/dbaccess/source/ui/inc/sbagrid.hxx
index 2bef1cfbbcd2..5bf7752311ba 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -83,7 +83,7 @@ namespace dbaui
 virtual void SAL_CALL createPeer(const css::uno::Reference< 
css::awt::XToolkit > & rToolkit, const css::uno::Reference< 
css::awt::XWindowPeer > & rParentPeer) override;
 
 protected:
-virtual FmXGridPeer*imp_CreatePeer(vcl::Window* pParent) override;
+virtual rtl::Reference imp_CreatePeer(vcl::Window* 
pParent) override;
 };
 
 // SbaXGridPeer
diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx
index 2703b6a016d7..8db610a77414 100644
--- a/include/svx/fmgridif.hxx
+++ b/include/svx/fmgridif.hxx
@@ -310,7 +310,7 @@ public:
 virtual void SAL_CALL setFocus() override;
 
 protected:
-virtual FmXGridPeer*imp_CreatePeer(vcl::Window* pParent);
+virtual rtl::Reference imp_CreatePeer(vcl::Window* pParent);
 // ImplCreatePeer would be better, but doesn't work because it's not 
exported
 };
 
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index c020ccd52a8d..995bbb05a1cb 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -186,8 +186,7 @@ private:
 #define MAX_FAMILIES 5
 
 SfxStyleSheetBasePool* pStyleSheetPool;
-SfxStyleControllerItem_Impl* pBoundItems[MAX_FAMILIES];
-css::uno::Reference m_xBoundItems[MAX_FAMILIES];
+rtl::Reference m_xBoundItems[MAX_FAMILIES];
 std::unique_ptr pFamilyState[MAX_FAMILIES];
 sal_uInt16 nActFamily; // Id in the ToolBox = Position - 1
 
diff --git a/include/svx/unoapi.hxx 

[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2021-02-20 Thread Noel (via logerrit)
 sw/inc/SwSmartTagMgr.hxx|3 +
 sw/inc/unodraw.hxx  |3 -
 sw/inc/unotbl.hxx   |2 -
 sw/inc/unotxdoc.hxx |6 +--
 sw/qa/extras/tiledrendering/tiledrendering.cxx  |   12 +++
 sw/source/core/access/acccontext.cxx|5 +--
 sw/source/core/access/acchyperlink.cxx  |2 -
 sw/source/core/access/accmap.cxx|2 -
 sw/source/core/access/accnotexthyperlink.cxx|2 -
 sw/source/core/access/accpara.cxx   |   11 ++
 sw/source/core/access/accpara.hxx   |2 -
 sw/source/core/access/acctable.cxx  |5 +--
 sw/source/core/access/acctextframe.cxx  |2 -
 sw/source/core/bastyp/SwSmartTagMgr.cxx |2 -
 sw/source/core/doc/notxtfrm.cxx |   14 +++-
 sw/source/core/layout/paintfrm.cxx  |   24 --
 sw/source/core/swg/SwXMLTextBlocks1.cxx |5 +--
 sw/source/core/txtnode/fmtatr2.cxx  |5 +--
 sw/source/core/unocore/unobkm.cxx   |4 +-
 sw/source/core/unocore/unochart.cxx |9 +
 sw/source/core/unocore/unocoll.cxx  |7 +---
 sw/source/core/unocore/unodraw.cxx  |   29 +++--
 sw/source/core/unocore/unoframe.cxx |7 +---
 sw/source/core/unocore/unoftn.cxx   |6 +--
 sw/source/core/unocore/unoobj.cxx   |8 ++--
 sw/source/core/unocore/unoportenum.cxx  |   39 +++-
 sw/source/core/unocore/unoredline.cxx   |   10 ++
 sw/source/core/unocore/unorefmk.cxx |4 +-
 sw/source/core/unocore/unosect.cxx  |2 -
 sw/source/core/unocore/unotbl.cxx   |   21 ++--
 sw/source/core/unocore/unotext.cxx  |7 +---
 sw/source/filter/ww8/ww8par.cxx |5 +--
 sw/source/filter/ww8/ww8par5.cxx|4 +-
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |4 +-
 sw/source/ui/dbui/dbinsdlg.cxx  |5 +--
 sw/source/ui/dbui/mmaddressblockpage.cxx|7 +---
 sw/source/ui/dbui/mmoutputtypepage.cxx  |5 +--
 sw/source/ui/vba/vbadocuments.cxx   |3 +
 sw/source/uibase/dbui/dbmgr.cxx |9 ++---
 sw/source/uibase/dochdl/swdtflvr.cxx|2 -
 sw/source/uibase/docvw/AnnotationWin2.cxx   |9 +
 sw/source/uibase/docvw/DashedLine.cxx   |8 +---
 sw/source/uibase/docvw/SidebarWinAcc.cxx|5 +--
 sw/source/uibase/table/chartins.cxx |5 +--
 sw/source/uibase/uno/unotxdoc.cxx   |   35 +++--
 sw/source/uibase/uno/unotxvw.cxx|8 ++--
 46 files changed, 153 insertions(+), 221 deletions(-)

New commits:
commit 7d7d4cf217e82db8839dbc49dcab1ab72c203b4e
Author: Noel 
AuthorDate: Fri Feb 19 14:33:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 10:21:07 2021 +0100

loplugin:refcounting in sw

Change-Id: I56f2f5aa4d9105e93f28701b8352d1fb97829ead
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111215
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/SwSmartTagMgr.hxx b/sw/inc/SwSmartTagMgr.hxx
index e6d60c530f84..f1c254f93e45 100644
--- a/sw/inc/SwSmartTagMgr.hxx
+++ b/sw/inc/SwSmartTagMgr.hxx
@@ -21,12 +21,13 @@
 #define INCLUDED_SW_INC_SWSMARTTAGMGR_HXX
 
 #include 
+#include 
 
 // Wrapper for the svx SmartTagMgr
 class SwSmartTagMgr final : public SmartTagMgr
 {
 private:
-static SwSmartTagMgr* spTheSwSmartTagMgr;
+static rtl::Reference spTheSwSmartTagMgr;
 
 SwSmartTagMgr(const OUString& rModuleName);
 virtual ~SwSmartTagMgr() override;
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 22ddffda5881..e9e69318cdea 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -80,8 +80,7 @@ SwXDrawPageBaseClass;
 class SwXDrawPage final : public SwXDrawPageBaseClass
 {
 SwDoc*  m_pDoc;
-css::uno::Reference< css::uno::XAggregation > m_xPageAgg;
-SwFmDrawPage*   m_pDrawPage;
+rtl::Reference  m_pDrawPage;
 public:
 SwXDrawPage(SwDoc* pDoc);
 virtual ~SwXDrawPage() override;
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 7ec4121a9ad8..e7d9a224e259 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -141,7 +141,7 @@ public:
 virtual sal_Bool SAL_CALL hasElements(  ) override;
 
 SwTableBox* GetTableBox() const { return m_pBox; }
-static SwXCell* CreateXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, 
SwTable *pTable = nullptr );
+static rtl::Reference CreateXCell(SwFrameFormat* pTableFormat, 
SwTableBox* pBox, SwTable *pTable = nullptr );
 SwTableBox* FindBox(SwTable* pTable, SwTableBox* pBox);
 SwFrameFormat* GetFrameFormat() const { return m_pTableFormat; }
 double GetForcedNumericalValue() const;

[Libreoffice-commits] core.git: test/source

2021-02-19 Thread Noel (via logerrit)
 test/source/lang/xcomponent.cxx |   23 ++-
 1 file changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 6aecd49aa6de7c7f65c3c240ee3b7db36497df4d
Author: Noel 
AuthorDate: Fri Feb 19 14:32:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 07:34:06 2021 +0100

loplugin:refcounting in test

Change-Id: I1e741283bffae6c3e40f4e61aaed5c085997c74f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111214
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/test/source/lang/xcomponent.cxx b/test/source/lang/xcomponent.cxx
index abe5111e4f2a..286f66c5c77a 100644
--- a/test/source/lang/xcomponent.cxx
+++ b/test/source/lang/xcomponent.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -38,9 +39,8 @@ namespace apitest
 void XComponent::testAddEventListener()
 {
 Reference xComponent(init(), uno::UNO_QUERY_THROW);
-auto pListenerAdded(new TestEventListener());
-Reference xListenerAdded(pListenerAdded);
-xComponent->addEventListener(xListenerAdded);
+rtl::Reference pListenerAdded(new TestEventListener());
+xComponent->addEventListener(pListenerAdded);
 xComponent->dispose();
 CPPUNIT_ASSERT_EQUAL(true, pListenerAdded->m_hasDisposingCalled);
 }
@@ -48,10 +48,9 @@ void XComponent::testAddEventListener()
 void XComponent::testRemoveEventListener()
 {
 Reference xComponent(init(), uno::UNO_QUERY_THROW);
-auto pListenerAddedAndRemoved(new TestEventListener());
-Reference 
xListenerAddedAndRemoved(pListenerAddedAndRemoved);
-xComponent->addEventListener(xListenerAddedAndRemoved);
-xComponent->removeEventListener(xListenerAddedAndRemoved);
+rtl::Reference pListenerAddedAndRemoved(new 
TestEventListener());
+xComponent->addEventListener(pListenerAddedAndRemoved);
+xComponent->removeEventListener(pListenerAddedAndRemoved);
 xComponent->dispose();
 CPPUNIT_ASSERT_EQUAL(false, 
pListenerAddedAndRemoved->m_hasDisposingCalled);
 }
@@ -59,9 +58,8 @@ void XComponent::testRemoveEventListener()
 void XComponent::testDispose()
 {
 Reference xComponent(init(), uno::UNO_QUERY_THROW);
-auto pListenerAdded(new TestEventListener());
-Reference xListenerAdded(pListenerAdded);
-xComponent->addEventListener(xListenerAdded);
+rtl::Reference pListenerAdded(new TestEventListener());
+xComponent->addEventListener(pListenerAdded);
 xComponent->dispose();
 CPPUNIT_ASSERT_EQUAL(true, pListenerAdded->m_hasDisposingCalled);
 }
@@ -69,9 +67,8 @@ void XComponent::testDispose()
 void XComponent::testDisposedByDesktopTerminate()
 {
 Reference xComponent(init(), uno::UNO_QUERY_THROW);
-auto pListenerAdded(new TestEventListener());
-Reference xListenerAdded(pListenerAdded);
-xComponent->addEventListener(xListenerAdded);
+rtl::Reference pListenerAdded(new TestEventListener());
+xComponent->addEventListener(pListenerAdded);
 triggerDesktopTerminate();
 CPPUNIT_ASSERT_EQUAL(true, pListenerAdded->m_hasDisposingCalled);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svtools/source

2021-02-19 Thread Noel (via logerrit)
 svtools/source/config/itemholder2.cxx |3 ++-
 svtools/source/control/accessibleruler.cxx|2 +-
 svtools/source/control/valueacc.cxx   |4 ++--
 svtools/source/hatchwindow/hatchwindowfactory.cxx |4 ++--
 svtools/source/misc/acceleratorexecute.cxx|   11 ++-
 svtools/source/uno/unoiface.cxx   |2 +-
 6 files changed, 14 insertions(+), 12 deletions(-)

New commits:
commit 197bcde5c4d771ace11962213c11c9763be11039
Author: Noel 
AuthorDate: Fri Feb 19 15:54:19 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 07:33:33 2021 +0100

loplugin:refcounting in svtools

Change-Id: I20f6b07aded513a4100d7ae4c7d74365a93dacca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111221
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svtools/source/config/itemholder2.cxx 
b/svtools/source/config/itemholder2.cxx
index 692f182a08f8..cb02d6de5e5c 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace svtools {
 
@@ -75,7 +76,7 @@ ItemHolder2::~ItemHolder2()
 
 void ItemHolder2::holdConfigItem(EItem eItem)
 {
-static ItemHolder2* pHolder = new ItemHolder2();
+static rtl::Reference pHolder = new ItemHolder2();
 pHolder->impl_addItem(eItem);
 }
 
diff --git a/svtools/source/control/accessibleruler.cxx 
b/svtools/source/control/accessibleruler.cxx
index cfd54364e3ae..7d557a622ad4 100644
--- a/svtools/source/control/accessibleruler.cxx
+++ b/svtools/source/control/accessibleruler.cxx
@@ -197,7 +197,7 @@ uno::Reference< XAccessibleRelationSet > SAL_CALL 
SvtRulerAccessible::getAccessi
 uno::Reference< XAccessibleStateSet > SAL_CALL 
SvtRulerAccessible::getAccessibleStateSet()
 {
 ::osl::MutexGuard   aGuard( m_aMutex );
-utl::AccessibleStateSetHelper*  pStateSetHelper = new 
utl::AccessibleStateSetHelper;
+rtl::Reference pStateSetHelper = new 
utl::AccessibleStateSetHelper;
 
 if( IsAlive() )
 {
diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index ff0e18959a9b..5db6e920eae3 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -218,7 +218,7 @@ uno::Reference< accessibility::XAccessibleRelationSet > 
SAL_CALL ValueItemAcc::g
 uno::Reference< accessibility::XAccessibleStateSet > SAL_CALL 
ValueItemAcc::getAccessibleStateSet()
 {
 const SolarMutexGuard aSolarGuard;
-::utl::AccessibleStateSetHelper*pStateSet = new 
::utl::AccessibleStateSetHelper;
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet = new 
::utl::AccessibleStateSetHelper;
 
 if( mpParent )
 {
@@ -638,7 +638,7 @@ uno::Reference< accessibility::XAccessibleRelationSet > 
SAL_CALL ValueSetAcc::ge
 uno::Reference< accessibility::XAccessibleStateSet > SAL_CALL 
ValueSetAcc::getAccessibleStateSet()
 {
 ThrowIfDisposed();
-::utl::AccessibleStateSetHelper* pStateSet = new 
::utl::AccessibleStateSetHelper();
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet = new 
::utl::AccessibleStateSetHelper();
 
 // Set some states.
 pStateSet->AddState (accessibility::AccessibleStateType::ENABLED);
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx 
b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index 520cc1a25a01..36fe6c9c1104 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -56,9 +56,9 @@ uno::Reference< embed::XHatchWindow > SAL_CALL 
OHatchWindowFactory::createHatchW
 throw lang::IllegalArgumentException(); // TODO
 
 SolarMutexGuard aGuard;
-VCLXHatchWindow* pResult = new VCLXHatchWindow();
+rtl::Reference pResult = new VCLXHatchWindow();
 pResult->initializeWindow( xParent, aBounds, aHandlerSize );
-return uno::Reference< embed::XHatchWindow >( static_cast< 
embed::XHatchWindow* >( pResult ) );
+return pResult;
 }
 
 OUString SAL_CALL OHatchWindowFactory::getImplementationName()
diff --git a/svtools/source/misc/acceleratorexecute.cxx 
b/svtools/source/misc/acceleratorexecute.cxx
index 5ff9e5fa8aae..a378587fd8e5 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace svt
 {
@@ -57,7 +58,7 @@ class AsyncAccelExec : public 
cppu::WeakImplHelper
 This instance can be forced to execute its internal set request
 asynchronous. After that it deletes itself!
  */
-static AsyncAccelExec* createOneShotInstance(const 
css::uno::Reference& xFrame,
+static rtl::Reference createOneShotInstance(const 
css::uno::Reference& xFrame,
 const 
css::uno::Reference& xDispatch,
 

  1   2   3   4   5   >