diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-12-06 22:59:40 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-12-07 14:46:07 +0100 |
commit | 689cead9e0837dc932e3a4cd765f7d319b529018 (patch) | |
tree | cd6cdcd77f017ef1e60ec11556617da5b1c39721 /include | |
parent | b346439637b7d03a3eb1d6e67dfb585b357567f4 (diff) |
tdf#91260 svx, sw: don't paint off-page part of drawing object
Since commit a4dee94afed9ade6ac50237c8d99a6e49d3bebc1 Writer no
longer forces drawing objects to be entirely on one page. However since
there is only one SdrPage for the entire document, a drawing object
dangleing off the bottom of one page will be painted again on the next
page, which is clearly undesirable since Word doesn't do that
(and it also destroys the nice invariant that a fly on page N never
overlaps a fly on page N+1).
So force the SdrPageView code to ignore the drawing object on the next
page, by passing in the area of the page frame so that
ViewObjectContactOfSdrObj::isPrimitiveVisible() can verify that the
anchor position of the SdrObject is actually on the painted page.
This requires passing in another parameter; in the usual case the
DisplayInfo::maRedrawArea already contains the page frame since
commit 8af09bf33291df2fb2bfbbd6e42f9bf074fcc4fc, but there are special
cases in SwFrame::Retouch() and SwFlyFrameFormat::MakeGraphic() where
some sub-area is passed in, which cannot be used to check the anchor.
Change-Id: Ia0476216ca41dbdaa3de1063fa18cb94fe2e5ae8
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/sdr/contact/displayinfo.hxx | 6 | ||||
-rw-r--r-- | include/svx/sdrpagewindow.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdpagv.hxx | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/include/svx/sdr/contact/displayinfo.hxx b/include/svx/sdr/contact/displayinfo.hxx index b474cae3377e..b4981808f023 100644 --- a/include/svx/sdr/contact/displayinfo.hxx +++ b/include/svx/sdr/contact/displayinfo.hxx @@ -23,6 +23,7 @@ #include <svx/svdsob.hxx> #include <vcl/region.hxx> #include <svx/svxdllapi.h> +#include <basegfx/range/b2irectangle.hxx> namespace sdr { @@ -37,6 +38,8 @@ namespace sdr // is empty, everything needs to be redrawn vcl::Region maRedrawArea; + /// only for Writer: current page being painted + basegfx::B2IRectangle m_WriterPageFrame; // Internal flag to know when the control layer is painted. Default is // false. If set to true, painting of the page, page borders and @@ -78,6 +81,9 @@ namespace sdr void SetRedrawArea(const vcl::Region& rRegion); const vcl::Region& GetRedrawArea() const { return maRedrawArea; } + void SetWriterPageFrame(basegfx::B2IRectangle const& rPageFrame); + basegfx::B2IRectangle const& GetWriterPageFrame() const { return m_WriterPageFrame; } + // Access to ControlLayerProcessingActive flag void SetControlLayerProcessingActive(bool bDoPaint); bool GetControlLayerProcessingActive() const { return mbControlLayerProcessingActive; } diff --git a/include/svx/sdrpagewindow.hxx b/include/svx/sdrpagewindow.hxx index 0adc7e4f8dfa..ca55b110c2d1 100644 --- a/include/svx/sdrpagewindow.hxx +++ b/include/svx/sdrpagewindow.hxx @@ -39,7 +39,7 @@ namespace sdr } } -namespace basegfx { class B2DRange; } +namespace basegfx { class B2DRange; class B2IRange; } class SdrPaintWindow; class SdrPageView; @@ -74,7 +74,7 @@ public: void PrePaint(); void PrepareRedraw(const vcl::Region& rReg); void RedrawAll( sdr::contact::ViewObjectContactRedirector* pRedirector ); - void RedrawLayer( const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector ); + void RedrawLayer( const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector, basegfx::B2IRange const*); // Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...) void InvalidatePageWindow(const basegfx::B2DRange& rRange); diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx index c7ab36f9d0d4..039dcd4dc025 100644 --- a/include/svx/svdpagv.hxx +++ b/include/svx/svdpagv.hxx @@ -162,7 +162,8 @@ public: void setPreparedPageWindow(SdrPageWindow* pKnownTarget); void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr, - const Rectangle& rRect = Rectangle()); + const Rectangle& rRect = Rectangle(), + basegfx::B2IRange const* pPageFrame = nullptr); void DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, Color aColor = Color( COL_BLACK ) ); Rectangle GetPageRect() const; |