diff options
Diffstat (limited to 'svx/source/svdraw/svdotextdecomposition.cxx')
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index cc8a269ff2..1401be1059 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -90,10 +90,10 @@ namespace // the visible area for contour text decomposition basegfx::B2DVector maScale; - // #SJ# ClipRange for BlockText decomposition; only text portions completely
- // inside are to be accepted, so this is different from geometric clipping
- // (which would allow e.g. upper parts of portions to remain). Only used for
- // BlockText (see there)
+ // #SJ# ClipRange for BlockText decomposition; only text portions completely + // inside are to be accepted, so this is different from geometric clipping + // (which would allow e.g. upper parts of portions to remain). Only used for + // BlockText (see there) basegfx::B2DRange maClipRange; DECL_LINK(decomposeContourTextPrimitive, DrawPortionInfo* ); @@ -115,12 +115,12 @@ namespace public: impTextBreakupHandler(SdrOutliner& rOutliner) : maTextPortionPrimitives(), - maLinePrimitives(),
- maParagraphPrimitives(),
- mrOutliner(rOutliner),
- maNewTransformA(),
- maNewTransformB(),
- maScale(),
+ maLinePrimitives(), + maParagraphPrimitives(), + mrOutliner(rOutliner), + maNewTransformA(), + maNewTransformB(), + maScale(), maClipRange() { } @@ -573,43 +573,43 @@ namespace { if(pInfo) { - // #SJ# Is clipping wanted? This is text clipping; only accept a portion
- // if it's completely in the range
- if(!maClipRange.isEmpty())
- {
- // Test start position first; this allows to not get the text range at
- // all if text is far outside
- const basegfx::B2DPoint aStartPosition(pInfo->mrStartPos.X(), pInfo->mrStartPos.Y());
-
- if(!maClipRange.isInside(aStartPosition))
- {
- return 0;
- }
-
- // Start position is inside. Get TextBoundRect and TopLeft next
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
- aTextLayouterDevice.setFont(pInfo->mrFont);
-
- const basegfx::B2DRange aTextBoundRect(
- aTextLayouterDevice.getTextBoundRect(
- pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextLen));
- const basegfx::B2DPoint aTopLeft(aTextBoundRect.getMinimum() + aStartPosition);
-
- if(!maClipRange.isInside(aTopLeft))
- {
- return 0;
- }
-
- // TopLeft is inside. Get BottomRight and check
- const basegfx::B2DPoint aBottomRight(aTextBoundRect.getMaximum() + aStartPosition);
-
- if(!maClipRange.isInside(aBottomRight))
- {
- return 0;
- }
-
- // all inside, clip was successful
- }
+ // #SJ# Is clipping wanted? This is text clipping; only accept a portion + // if it's completely in the range + if(!maClipRange.isEmpty()) + { + // Test start position first; this allows to not get the text range at + // all if text is far outside + const basegfx::B2DPoint aStartPosition(pInfo->mrStartPos.X(), pInfo->mrStartPos.Y()); + + if(!maClipRange.isInside(aStartPosition)) + { + return 0; + } + + // Start position is inside. Get TextBoundRect and TopLeft next + drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice; + aTextLayouterDevice.setFont(pInfo->mrFont); + + const basegfx::B2DRange aTextBoundRect( + aTextLayouterDevice.getTextBoundRect( + pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextLen)); + const basegfx::B2DPoint aTopLeft(aTextBoundRect.getMinimum() + aStartPosition); + + if(!maClipRange.isInside(aTopLeft)) + { + return 0; + } + + // TopLeft is inside. Get BottomRight and check + const basegfx::B2DPoint aBottomRight(aTextBoundRect.getMaximum() + aStartPosition); + + if(!maClipRange.isInside(aBottomRight)) + { + return 0; + } + + // all inside, clip was successful + } impHandleDrawPortionInfo(*pInfo); } @@ -918,13 +918,13 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0, fShearX, fRotate, aTranslate.getX(), aTranslate.getY())); - // #SJ# create ClipRange (if needed)
- basegfx::B2DRange aClipRange;
-
- if(rSdrBlockTextPrimitive.getClipOnBounds())
- {
- aClipRange.expand(-aAdjOffset);
- aClipRange.expand(basegfx::B2DTuple(aAnchorTextSize.Width(), aAnchorTextSize.Height()) - aAdjOffset);
+ // #SJ# create ClipRange (if needed) + basegfx::B2DRange aClipRange; + + if(rSdrBlockTextPrimitive.getClipOnBounds()) + { + aClipRange.expand(-aAdjOffset); + aClipRange.expand(basegfx::B2DTuple(aAnchorTextSize.Width(), aAnchorTextSize.Height()) - aAdjOffset); } // now break up text primitives. |