tdf#131281 Always draw FormControls when TiledRendering
When FormControls are not in layout mode it would be necessary to have real VCL ChildWindows in the client (usually the office). While this is done in the office itself and thus the visualization of FormControls (and their usage) is guaranteed, this is currently not the case for existing clients of TiledRendering. The big solution would be an API for the TiledRendering client to get infos for FormControls and create these locally (what would allow to have these editable/interactive and in the style of the client system). As long as this is not the case, I add this fallback to render the FormControls as content to the tiles to get them visualized at all. Change-Id: I0f7a5e7dc028373145a6a19b639ce82bdafc149d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107735 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
This commit is contained in:
committed by
Armin Le Grand
parent
8928ea836e
commit
bcb8d2d3a0
@@ -20,6 +20,7 @@
|
||||
#include "vclpixelprocessor2d.hxx"
|
||||
#include "vclhelperbufferdevice.hxx"
|
||||
#include "helperwrongspellrenderer.hxx"
|
||||
#include <comphelper/lok.hxx>
|
||||
|
||||
#include <sal/log.hxx>
|
||||
#include <vcl/BitmapBasicMorphologyFilter.hxx>
|
||||
@@ -695,7 +696,34 @@ void VclPixelProcessor2D::processControlPrimitive2D(
|
||||
|
||||
if (xNewGraphics.is())
|
||||
{
|
||||
// link graphics and view
|
||||
// find out if the control is already visualized as a VCL-ChildWindow. If yes,
|
||||
// it does not need to be painted at all.
|
||||
uno::Reference<awt::XWindow2> xControlWindow(rXControl, uno::UNO_QUERY_THROW);
|
||||
bool bControlIsVisibleAsChildWindow(rXControl->getPeer().is()
|
||||
&& xControlWindow->isVisible());
|
||||
|
||||
// tdf#131281 The FormControls are not painted when using the Tiled Rendering for a simple
|
||||
// reason: when e.g. bControlIsVisibleAsChildWindow is true. This is the case because the
|
||||
// office is in non-layout mode (default for controls at startup). For the common office
|
||||
// this means that there exists a real VCL-System-Window for the control, so it is *not*
|
||||
// painted here due to being exactly obscured by that real Window (and creates danger of
|
||||
// flickering, too).
|
||||
// Tiled Rendering clients usually do *not* have real VCL-Windows for the controls, but
|
||||
// exactly that would be needed on each client displaying the tiles (what would be hard
|
||||
// to do but also would have advantages - the clients would have real controls in the
|
||||
// shape of their traget system which could be interacted with...). It is also what the
|
||||
// office does.
|
||||
// For now, fallback to just render these controls when Tiled Rendering is active to just
|
||||
// have them displayed on all clients.
|
||||
if (bControlIsVisibleAsChildWindow && comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
// Do force paint when we are in Tiled Renderer and FormControl is 'visible'
|
||||
bControlIsVisibleAsChildWindow = false;
|
||||
}
|
||||
|
||||
if (!bControlIsVisibleAsChildWindow)
|
||||
{
|
||||
// Needs to be drawn. Link new graphics and view
|
||||
xControlView->setGraphics(xNewGraphics);
|
||||
|
||||
// get position
|
||||
@@ -703,25 +731,17 @@ void VclPixelProcessor2D::processControlPrimitive2D(
|
||||
* rControlPrimitive.getTransform());
|
||||
const basegfx::B2DPoint aTopLeftPixel(aObjectToPixel * basegfx::B2DPoint(0.0, 0.0));
|
||||
|
||||
// find out if the control is already visualized as a VCL-ChildWindow. If yes,
|
||||
// it does not need to be painted at all.
|
||||
uno::Reference<awt::XWindow2> xControlWindow(rXControl, uno::UNO_QUERY_THROW);
|
||||
const bool bControlIsVisibleAsChildWindow(rXControl->getPeer().is()
|
||||
&& xControlWindow->isVisible());
|
||||
|
||||
if (!bControlIsVisibleAsChildWindow)
|
||||
{
|
||||
// draw it. Do not forget to use the evtl. offsetted origin of the target device,
|
||||
// Do not forget to use the evtl. offsetted origin of the target device,
|
||||
// e.g. when used with mask/transparence buffer device
|
||||
const Point aOrigin(mpOutputDevice->GetMapMode().GetOrigin());
|
||||
xControlView->draw(aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()),
|
||||
aOrigin.Y() + basegfx::fround(aTopLeftPixel.getY()));
|
||||
}
|
||||
|
||||
// restore original graphics
|
||||
xControlView->setGraphics(xOriginalGraphics);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const uno::Exception&)
|
||||
{
|
||||
// #i116763# removing since there is a good alternative when the xControlView
|
||||
|
Reference in New Issue
Block a user