summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-16 14:14:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-05-17 09:54:56 +0200
commit57a23fcb90a3af9ed362dc053c4112f844a81a2c (patch)
tree9a09d3486f152f396b406e4f4c7d6ae025463518
parentaaa44dc0b07262d2fcae8f6136566baa6c8c169d (diff)
allow a OutputDevice parent where that is sufficient
Change-Id: I2920ea1a82de5eacbfeceafbb3c63693dd4365db Reviewed-on: https://gerrit.libreoffice.org/72414 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartShape.cxx2
-rw-r--r--include/svx/AccessibleShapeTreeInfo.hxx15
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx2
-rw-r--r--svx/source/accessibility/AccessibleControlShape.cxx4
-rw-r--r--svx/source/accessibility/AccessibleShapeTreeInfo.cxx11
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx2
-rw-r--r--sw/source/core/access/accmap.cxx2
9 files changed, 21 insertions, 23 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.cxx b/chart2/source/controller/accessibility/AccessibleChartShape.cxx
index b935bd9923d1..6b751a369d24 100644
--- a/chart2/source/controller/accessibility/AccessibleChartShape.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartShape.cxx
@@ -50,7 +50,7 @@ AccessibleChartShape::AccessibleChartShape(
m_aShapeTreeInfo.SetSdrView( rAccInfo.m_pSdrView );
m_aShapeTreeInfo.SetController( nullptr );
- m_aShapeTreeInfo.SetWindow( VCLUnoHelper::GetWindow( rAccInfo.m_xWindow ) );
+ m_aShapeTreeInfo.SetDevice( VCLUnoHelper::GetWindow( rAccInfo.m_xWindow ) );
m_aShapeTreeInfo.SetViewForwarder( rAccInfo.m_pViewForwarder );
::accessibility::ShapeTypeHandler& rShapeHandler = ::accessibility::ShapeTypeHandler::Instance();
diff --git a/include/svx/AccessibleShapeTreeInfo.hxx b/include/svx/AccessibleShapeTreeInfo.hxx
index 6057433c4181..0b5ddf8fae52 100644
--- a/include/svx/AccessibleShapeTreeInfo.hxx
+++ b/include/svx/AccessibleShapeTreeInfo.hxx
@@ -22,7 +22,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <svx/svxdllapi.h>
-#include <vcl/vclptr.hxx>
+#include <vcl/window.hxx>
namespace com { namespace sun { namespace star {
namespace accessibility { class XAccessibleComponent; }
@@ -31,7 +31,6 @@ namespace com { namespace sun { namespace star {
} } }
class SdrView;
-namespace vcl { class Window; }
namespace accessibility {
@@ -135,13 +134,19 @@ public:
/** Set the window that is used to construct SvxTextEditSources which in
turn is used to create accessible edit engines.
*/
- void SetWindow (vcl::Window* pWindow);
+ void SetDevice(OutputDevice* pWindow);
/** Return the current Window.
@return
The returned value may be NULL.
*/
- vcl::Window* GetWindow() const { return mpWindow;}
+ vcl::Window* GetWindow() const
+ {
+ if (mpWindow && mpWindow->GetOutDevType() == OUTDEV_WINDOW)
+ return static_cast<vcl::Window*>(mpWindow.get());
+ return nullptr;
+ }
+ OutputDevice* GetDevice() const { return mpWindow;}
/** The view forwarder allows the transformation between internal
and pixel coordinates and can be asked for the visible area.
@@ -183,7 +188,7 @@ private:
/** This window is necessary to construct an SvxTextEditSource which in
turn is used to create an accessible edit engine.
*/
- VclPtr<vcl::Window> mpWindow;
+ VclPtr<OutputDevice> mpWindow;
/** The view forwarder allows the transformation between internal
and pixel coordinates and can be asked for the visible area.
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index f95028b5aca3..9ad7aa3a98f0 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -317,7 +317,7 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc
maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(rViewData.GetDocument()->GetDrawLayer()) );
maShapeTreeInfo.SetSdrView(rViewData.GetScDrawView());
maShapeTreeInfo.SetController(nullptr);
- maShapeTreeInfo.SetWindow(pViewShell->GetWindowByPos(meSplitPos));
+ maShapeTreeInfo.SetDevice(pViewShell->GetWindowByPos(meSplitPos));
maShapeTreeInfo.SetViewForwarder(mpAccessibleDocument);
}
}
@@ -350,7 +350,7 @@ void ScChildrenShapes::SetDrawBroadcaster()
maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(rViewData.GetDocument()->GetDrawLayer()) );
maShapeTreeInfo.SetSdrView(rViewData.GetScDrawView());
maShapeTreeInfo.SetController(nullptr);
- maShapeTreeInfo.SetWindow(mpViewShell->GetWindowByPos(meSplitPos));
+ maShapeTreeInfo.SetDevice(mpViewShell->GetWindowByPos(meSplitPos));
maShapeTreeInfo.SetViewForwarder(mpAccessibleDocument);
}
}
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index cffe595b2043..1bc96eb92037 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -919,7 +919,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetBackgroundShapeAt(const awt::Poi
::accessibility::AccessibleShapeTreeInfo aShapeTreeInfo;
aShapeTreeInfo.SetSdrView(mpViewShell->GetPreview()->GetDrawView());
aShapeTreeInfo.SetController(nullptr);
- aShapeTreeInfo.SetWindow(mpViewShell->GetWindow());
+ aShapeTreeInfo.SetDevice(mpViewShell->GetWindow());
aShapeTreeInfo.SetViewForwarder(&(maShapeRanges[rShape.mnRangeId].maViewForwarder));
rShape.mpAccShape = rShapeHandler.CreateAccessibleObject(aShapeInfo, aShapeTreeInfo);
if (rShape.mpAccShape.is())
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index ae783b311a29..c271e70718cb 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -80,7 +80,7 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase (
mxModel, uno::UNO_QUERY));
maShapeTreeInfo.SetController (mxController);
maShapeTreeInfo.SetSdrView (pViewShell->GetView());
- maShapeTreeInfo.SetWindow (pSdWindow);
+ maShapeTreeInfo.SetDevice (pSdWindow);
maShapeTreeInfo.SetViewForwarder (&maViewForwarder);
mxWindow = ::VCLUnoHelper::GetInterface (pSdWindow);
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx
index 4721672ee00e..09dd1fb887bb 100644
--- a/svx/source/accessibility/AccessibleControlShape.cxx
+++ b/svx/source/accessibility/AccessibleControlShape.cxx
@@ -189,7 +189,7 @@ void AccessibleControlShape::Init()
// I'm aware of at the moment .....
// get the control which belongs to our model (relative to our view)
- const OutputDevice* pViewWindow = maShapeTreeInfo.GetWindow();
+ const OutputDevice* pViewWindow = maShapeTreeInfo.GetDevice();
SdrUnoObj* pUnoObjectImpl = dynamic_cast<SdrUnoObj*>( GetSdrObjectFromXShape(mxShape) );
SdrView* pView = maShapeTreeInfo.GetSdrView();
OSL_ENSURE( pView && pViewWindow && pUnoObjectImpl, "AccessibleControlShape::Init: no view, or no view window, no SdrUnoObj!" );
@@ -637,7 +637,7 @@ void SAL_CALL AccessibleControlShape::disposing()
if ( m_bWaitingForControl )
{
OSL_FAIL( "AccessibleControlShape::disposing: this should never happen!" );
- Reference< XContainer > xContainer = lcl_getControlContainer( maShapeTreeInfo.GetWindow(), maShapeTreeInfo.GetSdrView() );
+ Reference< XContainer > xContainer = lcl_getControlContainer( maShapeTreeInfo.GetDevice(), maShapeTreeInfo.GetSdrView() );
if ( xContainer.is() )
{
m_bWaitingForControl = false;
diff --git a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
index 837c73081ea7..88d24ac1d86f 100644
--- a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
+++ b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
@@ -72,14 +72,12 @@ AccessibleShapeTreeInfo& AccessibleShapeTreeInfo::operator= (const AccessibleSha
return *this;
}
-
AccessibleShapeTreeInfo::~AccessibleShapeTreeInfo()
{
SolarMutexGuard g;
mpWindow.reset();
}
-
void AccessibleShapeTreeInfo::SetDocumentWindow (
const Reference<XAccessibleComponent>& rxDocumentWindow)
{
@@ -93,32 +91,27 @@ void AccessibleShapeTreeInfo::SetModelBroadcaster (
mxModelBroadcaster = rxModelBroadcaster;
}
-
void AccessibleShapeTreeInfo::SetSdrView (SdrView* pView)
{
mpView = pView;
}
-
void AccessibleShapeTreeInfo::SetController (
const Reference<frame::XController>& rxController)
{
mxController = rxController;
}
-
-void AccessibleShapeTreeInfo::SetWindow (vcl::Window* pWindow)
+void AccessibleShapeTreeInfo::SetDevice(OutputDevice* pDevice)
{
- mpWindow = pWindow;
+ mpWindow = pDevice;
}
-
void AccessibleShapeTreeInfo::SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder)
{
mpViewForwarder = pViewForwarder;
}
-
} // end of namespace accessibility
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 23584422480f..065515de3604 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -96,7 +96,7 @@ SvxGraphCtrlAccessibleContext::SvxGraphCtrlAccessibleContext(
}
maTreeInfo.SetSdrView( mpView );
- maTreeInfo.SetWindow( mpControl );
+ maTreeInfo.SetDevice( mpControl );
maTreeInfo.SetViewForwarder( this );
}
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 6b49f1ca5c55..a2919d91372f 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -243,7 +243,7 @@ public:
: maMap()
{
maInfo.SetSdrView( pMap->GetShell()->GetDrawView() );
- maInfo.SetWindow( pMap->GetShell()->GetWin() );
+ maInfo.SetDevice( pMap->GetShell()->GetWin() );
maInfo.SetViewForwarder( pMap );
uno::Reference < document::XEventBroadcaster > xModelBroadcaster =
new SwDrawModellListener_Impl(