use more concrete UNO in svx
Change-Id: Ie947ba0209f9166ee1cd065f91341292f2b02668 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182621 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -30,8 +30,10 @@
|
||||
#include <svx/fmdmod.hxx>
|
||||
#include <svx/svxdllapi.h>
|
||||
#include <cppuhelper/weakref.hxx>
|
||||
#include <unotools/weakref.hxx>
|
||||
|
||||
class SdrModel;
|
||||
class SvxUnoDrawPagesAccess;
|
||||
|
||||
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxUnoDrawingModel
|
||||
: public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other
|
||||
@@ -45,7 +47,7 @@ class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxUnoDrawingModel
|
||||
private:
|
||||
SdrModel* mpDoc;
|
||||
|
||||
css::uno::WeakReference< css::drawing::XDrawPages > mxDrawPagesAccess;
|
||||
unotools::WeakReference< SvxUnoDrawPagesAccess > mxDrawPagesAccess;
|
||||
|
||||
css::uno::Reference< css::uno::XInterface > mxDashTable;
|
||||
css::uno::Reference< css::uno::XInterface > mxGradientTable;
|
||||
|
||||
@@ -64,9 +64,9 @@ uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleChild( sal_Int
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
if ( i < 0 || i >= getAccessibleChildCount())
|
||||
throw lang::IndexOutOfBoundsException();
|
||||
Reference< XAccessible > xChild;
|
||||
if (mpPixelCtl)
|
||||
xChild = CreateChild(i, mpPixelCtl->IndexToPoint(i));
|
||||
if (!mpPixelCtl)
|
||||
return nullptr;
|
||||
rtl::Reference< SvxPixelCtlAccessibleChild > xChild = CreateChild(i, mpPixelCtl->IndexToPoint(i));
|
||||
return xChild;
|
||||
}
|
||||
|
||||
@@ -131,13 +131,10 @@ uno::Reference<XAccessible > SAL_CALL SvxPixelCtlAccessible::getAccessibleAtPoin
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
|
||||
Reference< XAccessible > xRet;
|
||||
|
||||
if (mpPixelCtl)
|
||||
{
|
||||
tools::Long nIndex = mpPixelCtl->PointToIndex(Point(rPoint.X, rPoint.Y));
|
||||
xRet = CreateChild(nIndex, mpPixelCtl->IndexToPoint(nIndex));
|
||||
}
|
||||
if (!mpPixelCtl)
|
||||
return nullptr;
|
||||
tools::Long nIndex = mpPixelCtl->PointToIndex(Point(rPoint.X, rPoint.Y));
|
||||
rtl::Reference< SvxPixelCtlAccessibleChild > xRet = CreateChild(nIndex, mpPixelCtl->IndexToPoint(nIndex));
|
||||
|
||||
return xRet;
|
||||
}
|
||||
|
||||
@@ -335,14 +335,12 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
|
||||
xRenderedShape.get());
|
||||
}
|
||||
|
||||
Reference< drawing::XShape > xShape;
|
||||
if (!xRenderedShape)
|
||||
return nullptr;
|
||||
|
||||
if (xRenderedShape)
|
||||
{
|
||||
aCustomShape2d.ApplyGluePoints(xRenderedShape.get());
|
||||
xShape = SvxDrawPage::CreateShapeByTypeAndInventor( xRenderedShape->GetObjIdentifier(),
|
||||
xRenderedShape->GetObjInventor(), xRenderedShape.get() );
|
||||
}
|
||||
aCustomShape2d.ApplyGluePoints(xRenderedShape.get());
|
||||
rtl::Reference< SvxShape > xShape = SvxDrawPage::CreateShapeByTypeAndInventor( xRenderedShape->GetObjIdentifier(),
|
||||
xRenderedShape->GetObjInventor(), xRenderedShape.get() );
|
||||
|
||||
return xShape;
|
||||
}
|
||||
|
||||
@@ -484,31 +484,23 @@ sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleColumnExtentAt( sal_Int32
|
||||
|
||||
Reference< XAccessibleTable > SAL_CALL AccessibleTableShape::getAccessibleRowHeaders( )
|
||||
{
|
||||
Reference< XAccessibleTable > xRet;
|
||||
SvxTableController* pController = getTableController();
|
||||
if( pController )
|
||||
{
|
||||
if( pController->isRowHeader() )
|
||||
{
|
||||
xRet = new AccessibleTableHeaderShape( this, true );
|
||||
}
|
||||
}
|
||||
return xRet;
|
||||
if( !pController )
|
||||
return nullptr;
|
||||
if( !pController->isRowHeader() )
|
||||
return nullptr;
|
||||
return new AccessibleTableHeaderShape( this, true );
|
||||
}
|
||||
|
||||
|
||||
Reference< XAccessibleTable > SAL_CALL AccessibleTableShape::getAccessibleColumnHeaders( )
|
||||
{
|
||||
Reference< XAccessibleTable > xRet;
|
||||
SvxTableController* pController = getTableController();
|
||||
if( pController )
|
||||
{
|
||||
if( pController->isColumnHeader() )
|
||||
{
|
||||
xRet = new AccessibleTableHeaderShape( this, false );
|
||||
}
|
||||
}
|
||||
return xRet;
|
||||
if( !pController )
|
||||
return nullptr;
|
||||
if( !pController->isColumnHeader() )
|
||||
return nullptr;
|
||||
return new AccessibleTableHeaderShape( this, false );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -297,10 +297,13 @@ uno::Reference< drawing::XDrawPages > SAL_CALL SvxUnoDrawingModel::getDrawPages(
|
||||
{
|
||||
::SolarMutexGuard aGuard;
|
||||
|
||||
uno::Reference< drawing::XDrawPages > xDrawPages( mxDrawPagesAccess );
|
||||
rtl::Reference< SvxUnoDrawPagesAccess > xDrawPages( mxDrawPagesAccess );
|
||||
|
||||
if( !xDrawPages.is() )
|
||||
mxDrawPagesAccess = xDrawPages = new SvxUnoDrawPagesAccess(*this);
|
||||
{
|
||||
xDrawPages = new SvxUnoDrawPagesAccess(*this);
|
||||
mxDrawPagesAccess = xDrawPages.get();
|
||||
}
|
||||
|
||||
return xDrawPages;
|
||||
}
|
||||
|
||||
@@ -202,21 +202,14 @@ sal_Bool SAL_CALL GalleryThemeProvider::hasByName( const OUString& rName )
|
||||
uno::Reference< gallery::XGalleryTheme > SAL_CALL GalleryThemeProvider::insertNewByName( const OUString& rThemeName )
|
||||
{
|
||||
const SolarMutexGuard aGuard;
|
||||
uno::Reference< gallery::XGalleryTheme > xRet;
|
||||
|
||||
if( mpGallery )
|
||||
{
|
||||
if( mpGallery->HasTheme( rThemeName ) )
|
||||
{
|
||||
throw container::ElementExistException();
|
||||
}
|
||||
else if( mpGallery->CreateTheme( rThemeName ) )
|
||||
{
|
||||
xRet = new ::unogallery::GalleryTheme( rThemeName );
|
||||
}
|
||||
}
|
||||
|
||||
return xRet;
|
||||
if( !mpGallery )
|
||||
return nullptr;
|
||||
if( mpGallery->HasTheme( rThemeName ) )
|
||||
throw container::ElementExistException();
|
||||
if( !mpGallery->CreateTheme( rThemeName ) )
|
||||
return nullptr;
|
||||
return new ::unogallery::GalleryTheme( rThemeName );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user