diff options
-rw-r--r-- | include/vcl/outdev.hxx | 1 | ||||
-rw-r--r-- | include/vcl/window.hxx | 1 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/clipping.cxx | 8 |
4 files changed, 17 insertions, 3 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 744f0b0b1f54..f2e19567150e 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -674,6 +674,7 @@ public: void IntersectClipRegion( const vcl::Region& rRegion ); virtual vcl::Region GetActiveClipRegion() const; + virtual vcl::Region GetOutputBoundsClipRegion() const; protected: diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 1e5487f3779e..4b1f1ad93b97 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -729,6 +729,7 @@ private: public: virtual vcl::Region GetActiveClipRegion() const override; + virtual vcl::Region GetOutputBoundsClipRegion() const override; protected: // Single argument ctors shall be explicit. diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index fa0c7b128dab..34db8e6299c1 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -779,6 +779,11 @@ void OutputDevice::SetTextAlign( TextAlign eAlign ) mpAlphaVDev->SetTextAlign( eAlign ); } +vcl::Region OutputDevice::GetOutputBoundsClipRegion() const +{ + return GetClipRegion(); +} + void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen, MetricVector* pVector, OUString* pDisplayText, @@ -806,9 +811,8 @@ void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr, mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) ); if( pVector ) { - vcl::Region aClip( GetClipRegion() ); - if( meOutDevType == OUTDEV_WINDOW ) - aClip.Intersect( tools::Rectangle( Point(), GetOutputSize() ) ); + vcl::Region aClip(GetOutputBoundsClipRegion()); + if (mpOutDevData->mpRecordLayout) { mpOutDevData->mpRecordLayout->m_aLineIndices.push_back( mpOutDevData->mpRecordLayout->m_aDisplayText.getLength() ); diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx index 6889ee7c63e2..e2c3a37c8ccf 100644 --- a/vcl/source/window/clipping.cxx +++ b/vcl/source/window/clipping.cxx @@ -27,6 +27,14 @@ namespace vcl { +vcl::Region Window::GetOutputBoundsClipRegion() const +{ + vcl::Region aClip(GetClipRegion()); + aClip.Intersect(tools::Rectangle(Point(), GetOutputSize())); + + return aClip; +} + void Window::InitClipRegion() { DBG_TESTSOLARMUTEX(); |