From f7936b021f7f0d08dc2baeddefb1b5613a8f87f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= Date: Wed, 8 Jan 2014 10:34:47 +0100 Subject: [PATCH] Do not use SvxShapeCollection directly. Change-Id: I1dd51df0e78a3cc89cdfcaec91ffd9a753393e2e --- chart2/inc/pch/precompiled_chartcontroller.hxx | 1 - .../chartapiwrapper/ChartDocumentWrapper.cxx | 7 ++++--- include/svx/unoshcol.hxx | 2 -- sc/inc/pch/precompiled_sc.hxx | 1 - sc/source/ui/Accessibility/AccessibleDocument.cxx | 9 +++++---- sc/source/ui/unoobj/viewuno.cxx | 10 ++++++---- sd/inc/pch/precompiled_sd.hxx | 1 - .../ui/accessibility/AccessibleDrawDocumentView.cxx | 9 ++++++--- sd/source/ui/unoidl/SdUnoDrawView.cxx | 6 ++++-- svx/source/unodraw/unoshcol.cxx | 9 --------- sw/inc/pch/precompiled_sw.hxx | 1 - sw/source/ui/uno/unotxvw.cxx | 6 ++++-- 12 files changed, 29 insertions(+), 33 deletions(-) diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index d4493754bf04..7ce733cfa448 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -273,7 +273,6 @@ #include #include #include -#include #include #include #include diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index de42006c6273..e1e38cd422d4 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -51,10 +51,10 @@ #include #include #include -// header for function SvxShapeCollection_NewInstance -#include +#include #include +#include #include #include #include @@ -1100,7 +1100,8 @@ Reference< drawing::XShapes > ChartDocumentWrapper::getAdditionalShapes() const if( !aShapeVector.empty() ) { // create a shape collection - xFoundShapes = uno::Reference< drawing::XShapes >( SvxShapeCollection_NewInstance(), uno::UNO_QUERY ); + xFoundShapes = uno::Reference< drawing::XShapes >( drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()), uno::UNO_QUERY ); OSL_ENSURE( xFoundShapes.is(), "Couldn't create a shape collection!" ); if( xFoundShapes.is()) diff --git a/include/svx/unoshcol.hxx b/include/svx/unoshcol.hxx index 523313f6213b..f0e85f70709d 100644 --- a/include/svx/unoshcol.hxx +++ b/include/svx/unoshcol.hxx @@ -34,8 +34,6 @@ public: ::osl::Mutex maMutex; }; -SVX_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvxShapeCollection_NewInstance() throw(); - /*********************************************************************** * * ***********************************************************************/ diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx index a83fe7201b6b..22f19b969d69 100644 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -876,7 +876,6 @@ #include #include #include -#include #include #include #include diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 2f1e514800f3..6271438fb537 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -70,7 +71,6 @@ #include #include #include -#include #include #include #include @@ -710,7 +710,8 @@ void ScChildrenShapes::Select(sal_Int32 nIndex) xSelectionSupplier->getSelection() >>= xShapes; if (!xShapes.is()) - xShapes = new SvxShapeCollection(); + xShapes = drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()); xShapes->add(maZOrderedShapes[nIndex]->xShape); @@ -757,8 +758,8 @@ void ScChildrenShapes::SelectAll() if (maZOrderedShapes.size() > 1) { - uno::Reference xShapes; - xShapes = new SvxShapeCollection(); + uno::Reference xShapes = drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()); try { diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 1b9319f4bc1f..ea92ba769f82 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -897,8 +897,10 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException) // ShapeCollection erzeugen (wie in SdXImpressView::getSelection im Draw) // Zurueckgegeben wird XInterfaceRef, das muss das UsrObject-XInterface sein - SvxShapeCollection* pShapes = new SvxShapeCollection(); - uno::Reference xRet(static_cast(pShapes)); + uno::Reference< drawing::XShapes > xShapes = drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()); + + uno::Reference xRet(xShapes); for (sal_uLong i=0; i xShape( pDrawObj->getUnoShape(), uno::UNO_QUERY ); if (xShape.is()) - pShapes->add(xShape); + xShapes->add(xShape); } } return uno::makeAny(xRet); diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 9521901b3045..12101c3161d1 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -752,7 +752,6 @@ #include #include #include -#include #include #include #include diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx index 25fd564bdfb1..3eee56dfeaf5 100644 --- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx +++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx @@ -18,6 +18,7 @@ */ #include "AccessibleDrawDocumentView.hxx" +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include @@ -38,7 +40,6 @@ #include #include #include -#include #include #include "Window.hxx" #include @@ -751,7 +752,8 @@ void xSel->select( aAny ); else { - uno::Reference< drawing::XShapes > xShapes( new SvxShapeCollection() ); + uno::Reference< drawing::XShapes > xShapes = drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()); for(sal_Int32 i = 0, nCount = getAccessibleChildCount(); i < nCount; ++i ) { @@ -800,7 +802,8 @@ void } else // Create an empty selection to add the shape to. - xShapes = new SvxShapeCollection(); + xShapes = drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()); // Update the selection. if( !bFound && bSelect ) diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx index 4e4e8ac2536a..cafb61c23448 100644 --- a/sd/source/ui/unoidl/SdUnoDrawView.cxx +++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx @@ -30,15 +30,16 @@ #include "Window.hxx" #include "pres.hxx" +#include #include #include #include #include #include #include -#include #include #include +#include #include #include @@ -287,7 +288,8 @@ Any SAL_CALL SdUnoDrawView::getSelection() sal_uInt32 nCount = rMarkList.GetMarkCount(); if( nCount ) { - Reference< drawing::XShapes > xShapes( SvxShapeCollection_NewInstance(), UNO_QUERY ); + Reference< drawing::XShapes > xShapes( drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()), UNO_QUERY ); for( sal_uInt32 nNum = 0; nNum < nCount; nNum++) { SdrMark *pMark = rMarkList.GetMark(nNum); diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 66b2195ed309..1c10e4b3bab9 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -44,15 +44,6 @@ SvxShapeCollection::~SvxShapeCollection() throw() { } - -//---------------------------------------------------------------------- -Reference< uno::XInterface > SvxShapeCollection_NewInstance() throw() -{ - Reference< drawing::XShapes > xShapes( new SvxShapeCollection() ); - Reference< uno::XInterface > xRef( xShapes, UNO_QUERY ); - return xRef; -} - // XInterface void SvxShapeCollection::release() throw() { diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index a9856d90784c..acce6e5654e1 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -930,7 +930,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index c0bf06a54834..68c12b3b2112 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -63,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +72,7 @@ #include #include "swdtflvr.hxx" #include +#include #include #include @@ -405,7 +406,8 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) getSomething(SwXTextDocument::getUnoTunnelId())); SwFmDrawPage* pSvxDrawPage = pTextDoc->GetDrawPage()->GetSvxPage(); - uno::Reference< drawing::XShapes > xShCol = new SvxShapeCollection(); + uno::Reference< drawing::XShapes > xShCol = drawing::ShapeCollection::create( + comphelper::getProcessComponentContext()); const SdrMarkList& rMarkList = rSh.GetDrawView()->GetMarkedObjectList(); for(sal_uInt16 i = 0; i < rMarkList.GetMarkCount(); i++)