summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdotextdecomposition.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/svdotextdecomposition.cxx')
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx114
1 files changed, 55 insertions, 59 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 8f93463672c3..3675c7becac4 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -2,14 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: svdotextdecomposition.cxx,v $
- *
- * $Revision: 1.2.18.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -94,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* );
@@ -119,12 +115,12 @@ namespace
public:
impTextBreakupHandler(SdrOutliner& rOutliner)
: maTextPortionPrimitives(),
- maLinePrimitives(),
- maParagraphPrimitives(),
- mrOutliner(rOutliner),
- maNewTransformA(),
- maNewTransformB(),
- maScale(),
+ maLinePrimitives(),
+ maParagraphPrimitives(),
+ mrOutliner(rOutliner),
+ maNewTransformA(),
+ maNewTransformB(),
+ maScale(),
maClipRange()
{
}
@@ -577,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);
}
@@ -922,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.