summaryrefslogtreecommitdiff
path: root/editeng
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 /editeng
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 'editeng')
-rw-r--r--editeng/source/editeng/editeng.cxx6
-rw-r--r--editeng/source/editeng/impedit.cxx8
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx3
-rw-r--r--editeng/source/uno/unoviwou.cxx4
5 files changed, 12 insertions, 11 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 992d3f3c515f..f42b494ab139 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1051,9 +1051,9 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
Point P2( P1 );
P2.AdjustX(n20 );
P2.AdjustY(nH );
- pEditView->GetWindow()->SetLineColor();
- pEditView->GetWindow()->SetFillColor( (n%2) ? COL_YELLOW : COL_LIGHTGREEN );
- pEditView->GetWindow()->DrawRect( tools::Rectangle( P1, P2 ) );
+ pEditView->GetWindow()->GetOutDev()->SetLineColor();
+ pEditView->GetWindow()->GetOutDev()->SetFillColor( (n%2) ? COL_YELLOW : COL_LIGHTGREEN );
+ pEditView->GetWindow()->GetOutDev()->DrawRect( tools::Rectangle( P1, P2 ) );
aPos.AdjustY(nH );
}
}
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 1d852ecec784..8e99f56156bc 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -349,7 +349,7 @@ void ImpEditView::lokSelectionCallback(const std::unique_ptr<tools::PolyPolygon>
}
else
{
- pOutWin->Push(PushFlags::MAPMODE);
+ pOutWin->GetOutDev()->Push(PushFlags::MAPMODE);
if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
{
// Find the parent that is not right
@@ -442,7 +442,7 @@ void ImpEditView::lokSelectionCallback(const std::unique_ptr<tools::PolyPolygon>
mpViewShell->NotifyOtherViews(LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRectangle);
}
- pOutWin->Pop();
+ pOutWin->GetOutDev()->Pop();
}
}
@@ -705,7 +705,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice& rTarget, const Point& rDo
if (pWindow)
{
- pWindow->Invert( aRect );
+ pWindow->GetOutDev()->Invert( aRect );
}
else
{
@@ -822,7 +822,7 @@ OutputDevice& ImpEditView::GetOutputDevice() const
{
if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
return pCallbacks->EditViewOutputDevice();
- return *pOutWin;
+ return *pOutWin->GetOutDev();
}
weld::Widget* ImpEditView::GetPopupParent(tools::Rectangle& rRect) const
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 207de9d1ca30..012342ce4d06 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -582,7 +582,7 @@ bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView )
{
if ( ( rMEvt.GetClicks() == 1 ) && rMEvt.IsLeft() && !rMEvt.IsMod2() )
{
- const OutputDevice& rOutDev = pView->getEditViewCallbacks() ? pView->getEditViewCallbacks()->EditViewOutputDevice() : *pView->GetWindow();
+ const OutputDevice& rOutDev = pView->getEditViewCallbacks() ? pView->getEditViewCallbacks()->EditViewOutputDevice() : *pView->GetWindow()->GetOutDev();
Point aLogicClick = rOutDev.PixelToLogic(rMEvt.GetPosPixel());
if (const SvxFieldItem* pFld = pView->GetField(aLogicClick))
{
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 6c3933c0ca54..ee9c0bb1a202 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -22,6 +22,7 @@
#include <vcl/metaact.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/settings.hxx>
+#include <vcl/window.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/lspcitem.hxx>
@@ -3782,7 +3783,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const tools::Rectangle& rRect, Ou
tools::Rectangle aClipRect( pView->GetOutputArea() );
aClipRect.Intersection( rRect );
- OutputDevice& rTarget = pTargetDevice ? *pTargetDevice : pView->GetOutputDevice();
+ OutputDevice& rTarget = pTargetDevice ? *pTargetDevice : *pView->GetWindow()->GetOutDev();
Point aStartPos;
if ( !IsVertical() )
diff --git a/editeng/source/uno/unoviwou.cxx b/editeng/source/uno/unoviwou.cxx
index d1d20110c75c..cbad84836610 100644
--- a/editeng/source/uno/unoviwou.cxx
+++ b/editeng/source/uno/unoviwou.cxx
@@ -52,7 +52,7 @@ bool SvxDrawOutlinerViewForwarder::IsValid() const
Point SvxDrawOutlinerViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
{
- OutputDevice* pOutDev = mrOutlinerView.GetWindow();
+ OutputDevice* pOutDev = mrOutlinerView.GetWindow()->GetOutDev();
if( pOutDev )
{
@@ -74,7 +74,7 @@ Point SvxDrawOutlinerViewForwarder::LogicToPixel( const Point& rPoint, const Map
Point SvxDrawOutlinerViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
{
- OutputDevice* pOutDev = mrOutlinerView.GetWindow();
+ OutputDevice* pOutDev = mrOutlinerView.GetWindow()->GetOutDev();
if( pOutDev )
{