summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/sdrpaintwindow.hxx6
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx29
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx27
-rw-r--r--sw/source/core/view/viewsh.cxx28
4 files changed, 42 insertions, 48 deletions
diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx
index bf8620ca8655..d1694ee051cb 100644
--- a/include/svx/sdrpaintwindow.hxx
+++ b/include/svx/sdrpaintwindow.hxx
@@ -41,6 +41,12 @@ namespace sdr
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////
+/// paint the transparent children of rWin that overlap rPixelRect
+/// (for example, transparent form controls like check boxes)
+void SVX_DLLPUBLIC
+PaintTransparentChildren(Window & rWindow, Rectangle const& rPixelRect);
+
+
class SdrPreRenderDevice
{
// The original OutputDevice
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 133accc54e1a..c8c2db34cf28 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -18,6 +18,7 @@
*/
#include <svx/sdr/overlay/overlaymanagerbuffered.hxx>
+#include <svx/sdrpaintwindow.hxx>
#include <vcl/outdev.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/range/b2drange.hxx>
@@ -349,28 +350,12 @@ namespace sdr
{
Window& rWindow = static_cast< Window& >(rmOutputDevice);
- if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount())
- {
- const Rectangle aRegionRectanglePixel(
- maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(),
- maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY());
-
- for(sal_uInt16 a(0); a < rWindow.GetChildCount(); a++)
- {
- Window* pCandidate = rWindow.GetChild(a);
-
- if(pCandidate && pCandidate->IsPaintTransparent())
- {
- const Rectangle aCandidatePosSizePixel(pCandidate->GetPosPixel(), pCandidate->GetSizePixel());
-
- if(aCandidatePosSizePixel.IsOver(aRegionRectanglePixel))
- {
- pCandidate->Invalidate(INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN);
- pCandidate->Update();
- }
- }
- }
- }
+ const Rectangle aRegionRectanglePixel(
+ maBufferRememberedRangePixel.getMinX(),
+ maBufferRememberedRangePixel.getMinY(),
+ maBufferRememberedRangePixel.getMaxX(),
+ maBufferRememberedRangePixel.getMaxY());
+ PaintTransparentChildren(rWindow, aRegionRectanglePixel);
}
// #i80730# restore visibility of VCL cursor
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 3df44a1bac2b..6ab2b4051849 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -23,6 +23,33 @@
#include <vcl/gdimtf.hxx>
#include <vcl/svapp.hxx>
+
+void PaintTransparentChildren(Window & rWindow, Rectangle const& rPixelRect)
+{
+ if (rWindow.IsChildTransparentModeEnabled())
+ {
+ Window * pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
+ while (pCandidate)
+ {
+ if (pCandidate->IsPaintTransparent())
+ {
+ const Rectangle aCandidatePosSizePixel(
+ pCandidate->GetPosPixel(),
+ pCandidate->GetSizePixel());
+
+ if (aCandidatePosSizePixel.IsOver(rPixelRect))
+ {
+ pCandidate->Invalidate(
+ INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
+ // important: actually paint the child here!
+ pCandidate->Update();
+ }
+ }
+ pCandidate = pCandidate->GetWindow( WINDOW_NEXT );
+ }
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrPreRenderDevice::SdrPreRenderDevice(OutputDevice& rOriginal)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 993a03718b0c..19add81ac524 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -109,32 +109,8 @@ lcl_PaintTransparentFormControls(ViewShell & rShell, SwRect const& rRect)
if (rShell.GetWin())
{
Window& rWindow = *(rShell.GetWin());
- if (rWindow.IsChildTransparentModeEnabled())
- {
- Window * pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
- if (pCandidate)
- {
- const Rectangle aRectanglePixel(
- rWindow.LogicToPixel(rRect.SVRect()));
- while (pCandidate)
- {
- if (pCandidate->IsPaintTransparent())
- {
- const Rectangle aCandidatePosSizePixel(
- pCandidate->GetPosPixel(),
- pCandidate->GetSizePixel());
-
- if (aCandidatePosSizePixel.IsOver(aRectanglePixel))
- {
- pCandidate->Invalidate(
- INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
- pCandidate->Update();
- }
- }
- pCandidate = pCandidate->GetWindow( WINDOW_NEXT );
- }
- }
- }
+ const Rectangle aRectanglePixel(rWindow.LogicToPixel(rRect.SVRect()));
+ PaintTransparentChildren(rWindow, aRectanglePixel);
}
}