summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-18 18:27:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-17 12:56:51 +0200
commit9090dc1f3b27195f5defd35586ac79357992be21 (patch)
treed39f4b624ae337d5c9ce76eba8521b76e53afa05 /chart2/source
parentc8cf2e0e088b74afa52564945a9c005b3b86bf7e (diff)
split OutputDevice from Window
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/accessibility/AccessibleTextHelper.cxx2
-rw-r--r--chart2/source/controller/main/ChartController.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx12
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx4
4 files changed, 10 insertions, 10 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
index 620897210db1..d2b56b2b7364 100644
--- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
+++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
@@ -84,7 +84,7 @@ void SAL_CALL AccessibleTextHelper::initialize( const Sequence< uno::Any >& aArg
SdrObject * pTextObj = m_pDrawViewWrapper->getNamedSdrObject( aCID );
if( pTextObj )
{
- m_pTextHelper.reset( new ::accessibility::AccessibleTextHelper(std::make_unique<SvxTextEditSource>(*pTextObj, nullptr, *pView, *pWindow)) );
+ m_pTextHelper.reset( new ::accessibility::AccessibleTextHelper(std::make_unique<SvxTextEditSource>(*pTextObj, nullptr, *pView, *pWindow->GetOutDev())) );
m_pTextHelper->SetEventSource( xEventSource );
}
}
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 08b8c65c31f7..5adc15f78a09 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -718,7 +718,7 @@ void ChartController::impl_createDrawViewController()
{
if( m_pDrawModelWrapper )
{
- m_pDrawViewWrapper.reset( new DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),GetChartWindow()) );
+ m_pDrawViewWrapper.reset( new DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),GetChartWindow()->GetOutDev()) );
m_pDrawViewWrapper->attachParentReferenceDevice( getModel() );
}
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index afd4de8a5e75..a63da0791c30 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -279,7 +279,7 @@ void SAL_CALL ChartController::setPosSize(
//a correct work area is at least necessary for correct values in the position and size dialog and for dragging area
if(m_pDrawViewWrapper)
{
- tools::Rectangle aRect(Point(0,0), pChartWindow->GetOutputSize());
+ tools::Rectangle aRect(Point(0,0), pChartWindow->GetOutDev()->GetOutputSize());
m_pDrawViewWrapper->SetWorkArea( aRect );
}
pChartWindow->Invalidate();
@@ -600,7 +600,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
// #i12587# support for shapes in chart
( rMEvt.IsRight() && pDrawViewWrapper->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ) == SdrHitKind::MarkedObject ) )
{
- pDrawViewWrapper->MouseButtonDown(rMEvt, pChartWindow);
+ pDrawViewWrapper->MouseButtonDown(rMEvt, pChartWindow->GetOutDev());
return;
}
else
@@ -725,7 +725,7 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
if( m_pDrawViewWrapper->IsTextEdit() )
{
- if( m_pDrawViewWrapper->MouseMove(rMEvt,pChartWindow) )
+ if( m_pDrawViewWrapper->MouseMove(rMEvt,pChartWindow->GetOutDev()) )
return;
}
@@ -771,7 +771,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if(pDrawViewWrapper->IsTextEdit())
{
- if( pDrawViewWrapper->MouseButtonUp(rMEvt,pChartWindow) )
+ if( pDrawViewWrapper->MouseButtonUp(rMEvt,pChartWindow->GetOutDev()) )
return;
}
@@ -1925,7 +1925,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
if( m_pDrawViewWrapper->IsTextEditHit( aMousePos ) )
{
pChartWindow->SetPointer( m_pDrawViewWrapper->GetPreferredPointer(
- aMousePos, pChartWindow, nModifier, bLeftDown ) );
+ aMousePos, pChartWindow->GetOutDev(), nModifier, bLeftDown ) );
return;
}
}
@@ -1941,7 +1941,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
if( pHitSelectionHdl )
{
PointerStyle aPointer = m_pDrawViewWrapper->GetPreferredPointer(
- aMousePos, pChartWindow, nModifier, bLeftDown );
+ aMousePos, pChartWindow->GetOutDev(), nModifier, bLeftDown );
bool bForceArrowPointer = false;
ObjectIdentifier aOID( m_aSelection.getSelectedOID() );
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 6ab1fae77b99..73e642446be1 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -61,7 +61,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
SetMapMode( MapMode(MapUnit::Map100thMM) );
adjustHighContrastMode();
// chart does not depend on exact pixel painting => enable antialiased drawing
- SetAntialiasing( AntialiasingFlags::Enable | GetAntialiasing() );
+ GetOutDev()->SetAntialiasing( AntialiasingFlags::Enable | GetOutDev()->GetAntialiasing() );
EnableRTL( false );
if( pParent )
pParent->EnableRTL( false );// #i96215# necessary for a correct position of the context menu in rtl mode
@@ -252,7 +252,7 @@ void ChartWindow::adjustHighContrastMode()
DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient;
bool bUseContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- SetDrawMode( bUseContrast ? nContrastMode : DrawModeFlags::Default );
+ GetOutDev()->SetDrawMode( bUseContrast ? nContrastMode : DrawModeFlags::Default );
}
void ChartWindow::ForceInvalidate()