summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/text/TextPortion.idl
blob: 6791f0ead82a0be78b05e25c7eadd7a8c3d479b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef __com_sun_star_text_TextPortion_idl__
#define __com_sun_star_text_TextPortion_idl__


#include <com/sun/star/beans/XTolerantMultiPropertySet.idl>
#include <com/sun/star/container/XContentEnumerationAccess.idl>
#include <com/sun/star/text/TextRange.idl>
#include <com/sun/star/text/XTextContent.idl>
#include <com/sun/star/text/XTextField.idl>
#include <com/sun/star/text/XFootnote.idl>


//=============================================================================

module com { module sun { module star { module text {

//=============================================================================
/** A TextPortion is a piece of text within a paragraph that does not
    contain changes of its attributes inside.

    <p>
    It is created by an enumeration implemented in a paragraph service.
    It may be used to export the content of the paragraph to an external
    document format.
    </p>

    @see com::sun::star::text::TextPortionEnumeration
    @see com::sun::star::text::XTextPortionEnumeration
*/
published service TextPortion
{
    service ::com::sun::star::text::TextRange;

    //-------------------------------------------------------------------------
    /** contains text frames, graphic objects, embedded objects or
        shapes that are anchored at or as character.
        @see com.sun.star.text.TextFrame
        @see com.sun.star.text.TextGraphicObject
     */
    [optional]
    interface ::com::sun::star::container::XContentEnumerationAccess;

    //-------------------------------------------------------------------------
    /** gives access to a sequence of properties.
        @since OOo 2.0
     */
    [optional]
    interface ::com::sun::star::beans::XTolerantMultiPropertySet;

    //-------------------------------------------------------------------------
    /** contains the type of the text portion.

    <p> Valid content type names are:</p>
    <dl>
        <dt>Text</dt><dd>string content</dd>
        <dt>TextField</dt><dd>a text field</dd>
        <dt>TextContent</dt><dd>text content - supplied via the
            interface <type scope="com::sun::star::container">
            XContentEnumerationAccess</type></dd>
        <dt>ControlCharacter</dt><dd>a control character</dd>
        <dt>Footnote</dt><dd>a footnote or an endnote</dd>
        <dt>ReferenceMark</dt><dd>a reference mark</dd>
        <dt>DocumentIndexMark</dt><dd>a document index mark</dd>
        <dt>Bookmark</dt><dd>a bookmark</dd>
        <dt>Redline</dt><dd>a redline portion which is a result
            of the change tracking feature</dd>
        <dt>Ruby</dt><dd>a ruby attribute which is used in Asian text</dd>
        <dt>Frame</dt><dd>a frame</dd>
        <dt>SoftPageBreak</dt><dd>a soft page break</dd>
        <dt>InContentMetadata</dt><dd>a text range with attached metadata</dd>
    </dl>
    <p>For Reference marks, document index marks, etc., 2 text portions
       will be generated, one for the start position and one for the
       end position.</p>
     */
    [readonly, property] string TextPortionType;

    //-------------------------------------------------------------------------
    /** contains the control character of a text portion of type
        ControlCharacter.
        @deprecated type ControlCharacter no longer implemented
     */
    [readonly, property] short ControlCharacter;

    //-------------------------------------------------------------------------
    /** contains the bookmark of a text portion of type Bookmark. */
    [optional, readonly, property]
    ::com::sun::star::text::XTextContent Bookmark;

    //-------------------------------------------------------------------------
    /** contains the document index mark of a text portion of type
        DocumentIndexMark. */
    [optional, readonly, property]
    ::com::sun::star::text::XTextContent DocumentIndexMark;

    //-------------------------------------------------------------------------
    /** contains the bookmark of a text portion of type ReferenceMark. */
    [optional, readonly, property]
    ::com::sun::star::text::XTextContent ReferenceMark;

    //-------------------------------------------------------------------------
    /** contains the footnote of a text portion of type Footnote. */
    [optional, readonly, property]
    ::com::sun::star::text::XFootnote Footnote;

    //-------------------------------------------------------------------------
    /** contains the text field of a text portion of type TextField. */
    [optional, readonly, property]
    ::com::sun::star::text::XTextField TextField;

    //-------------------------------------------------------------------------
    /** contains the text range of a text portion of type InContentMetadata.
        @since OOo 3.2
     */
    [optional, readonly, property]
    ::com::sun::star::text::XTextContent InContentMetadata;

    //-------------------------------------------------------------------------
    /** contains whether the portion is a point only. */
    [optional, readonly, property] boolean IsCollapsed;

    //-------------------------------------------------------------------------
    /** contains whether the portion is the start of the portion.

        <p>This is used for portions which are represented by
        2 TextPortion objects (e.g., DocmentIndexMark).</p>
     */
    [optional, readonly, property] boolean IsStart;

};

//=============================================================================

}; }; }; };
#endif
out of range [0.0 .. 1.0] (!)");
@@ -98,7 +98,7 @@ namespace basegfx
// get the polygon vector we want to plant this arrow on
const double fConsumedLength(fArrowYLength * (1.0 - fDockingPosition) - fShift);
- const B2DVector aHead(rCandidate.getB2DPoint((bStart) ? 0L : rCandidate.count() - 1L));
+ const B2DVector aHead(rCandidate.getB2DPoint((bStart) ? 0 : rCandidate.count() - 1L));
const B2DVector aTail(getPositionAbsolute(rCandidate,
(bStart) ? fConsumedLength : fCandidateLength - fConsumedLength, fCandidateLength));
diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx
index fcf6fa00642b..d8123edcd881 100644
--- a/basegfx/source/polygon/b2dpolygonclipper.cxx
+++ b/basegfx/source/polygon/b2dpolygonclipper.cxx
@@ -97,7 +97,7 @@ namespace basegfx
B2DCubicBezier aEdge;
B2DPolygon aRun;
- for(sal_uInt32 a(0L); a < nEdgeCount; a++)
+ for(sal_uInt32 a(0); a < nEdgeCount; a++)
{
aCandidate.getBezierSegment(a, aEdge);
const B2DPoint aTestPoint(aEdge.interpolatePoint(0.5));
@@ -169,7 +169,7 @@ namespace basegfx
const sal_uInt32 nPolygonCount(rCandidate.count());
B2DPolyPolygon aRetval;
- for(sal_uInt32 a(0L); a < nPolygonCount; a++)
+ for(sal_uInt32 a(0); a < nPolygonCount; a++)
{
const B2DPolyPolygon aClippedPolyPolygon(clipPolygonOnParallelAxis(rCandidate.getB2DPolygon(a), bParallelToXAxis, bAboveAxis, fValueOnOtherAxis, bStroke));
@@ -249,7 +249,7 @@ namespace basegfx
// against Y-Axis, lower value
if(1L == aRetval.count())
{
- aRetval = clipPolygonOnParallelAxis(aRetval.getB2DPolygon(0L), false, bInside, rRange.getMinX(), bStroke);
+ aRetval = clipPolygonOnParallelAxis(aRetval.getB2DPolygon(0), false, bInside, rRange.getMinX(), bStroke);
}
else
{
@@ -261,7 +261,7 @@ namespace basegfx
// against X-Axis, higher value
if(1L == aRetval.count())
{
- aRetval = clipPolygonOnParallelAxis(aRetval.getB2DPolygon(0L), true, !bInside, rRange.getMaxY(), bStroke);
+ aRetval = clipPolygonOnParallelAxis(aRetval.getB2DPolygon(0), true, !bInside, rRange.getMaxY(), bStroke);
}
else
{
@@ -273,7 +273,7 @@ namespace basegfx
// against Y-Axis, higher value
if(1L == aRetval.count())
{
- aRetval = clipPolygonOnParallelAxis(aRetval.getB2DPolygon(0L), false, !bInside, rRange.getMaxX(), bStroke);
+ aRetval = clipPolygonOnParallelAxis(aRetval.getB2DPolygon(0), false, !bInside, rRange.getMaxX(), bStroke);
}
else
{
@@ -313,7 +313,7 @@ namespace basegfx
if(bInside)
{
- for(sal_uInt32 a(0L); a < nPolygonCount; a++)
+ for(sal_uInt32 a(0); a < nPolygonCount; a++)
{
const B2DPolyPolygon aClippedPolyPolygon(clipPolygonOnRange(rCandidate.getB2DPolygon(a), rRange, bInside, bStroke));
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 378c8586ed14..1d4405fac5c8 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -101,12 +101,12 @@ namespace basegfx
// prepare loop
B2DCubicBezier aEdge;
- sal_uInt32 nNewInd(0L);
+ sal_uInt32 nNewInd(0);
// add start point
aRetval.append(rCandidate.getB2DPoint(0));
- for(sal_uInt32 a(0L); a < nCount; a++)
+ for(sal_uInt32 a(0); a < nCount; a++)
{
// get edge
rCandidate.getBezierSegment(a, aEdge);
@@ -180,11 +180,11 @@ namespace basegfx
// cut positions in the polygon to relative cut positions on the original bezier
// segment.
const sal_uInt32 nTempPointCount(rPointVector.size());
- const sal_uInt32 nEdgeCount(rPolygon.count() ? rPolygon.count() - 1L : 0L);
+ const sal_uInt32 nEdgeCount(rPolygon.count() ? rPolygon.count() - 1L : 0);
if(nTempPointCount && nEdgeCount)
{
- for(sal_uInt32 a(0L); a < nTempPointCount; a++)
+ for(sal_uInt32 a(0); a < nTempPointCount; a++)
{
const temporaryPoint& rTempPoint = rPointVector[a];
const double fCutPosInPolygon((double)rTempPoint.getIndex() + rTempPoint.getCut());
@@ -283,15 +283,15 @@ namespace basegfx
{
const sal_uInt32 nEdgeCountA(nPointCountA - 1);
const sal_uInt32 nEdgeCountB(nPointCountB - 1);
- B2DPoint aCurrA(rCandidateA.getB2DPoint(0L));
+ B2DPoint aCurrA(rCandidateA.getB2DPoint(0));
- for(sal_uInt32 a(0L); a < nEdgeCountA; a++)
+ for(sal_uInt32 a(0); a < nEdgeCountA; a++)
{
const B2DPoint aNextA(rCandidateA.getB2DPoint(a + 1L));
const B2DRange aRangeA(aCurrA, aNextA);
- B2DPoint aCurrB(rCandidateB.getB2DPoint(0L));
+ B2DPoint aCurrB(rCandidateB.getB2DPoint(0));
- for(sal_uInt32 b(0L); b < nEdgeCountB; b++)
+ for(sal_uInt32 b(0); b < nEdgeCountB; b++)
{
const B2DPoint aNextB(rCandidateB.getB2DPoint(b + 1L));
const B2DRange aRangeB(aCurrB, aNextB);
@@ -412,7 +412,7 @@ namespace basegfx
}
// append remapped tempVector entries for edge to tempPoints for edge
- for(size_t a(0L); a < aTempPointVectorEdge.size(); a++)
+ for(size_t a(0); a < aTempPointVectorEdge.size(); a++)
{
const temporaryPoint& rTempPoint = aTempPointVectorEdge[a];
rTempPointsB.push_back(temporaryPoint(rTempPoint.getPoint(), nIndB, rTempPoint.getCut()));
@@ -508,7 +508,7 @@ namespace basegfx
B2DCubicBezier aCubicA;
B2DCubicBezier aCubicB;
- for(sal_uInt32 a(0L); a < nEdgeCount - 1L; a++)
+ for(sal_uInt32 a(0); a < nEdgeCount - 1L; a++)
{
rCandidate.getBezierSegment(a, aCubicA);
aCubicA.testAndSolveTrivialBezier();
@@ -564,17 +564,17 @@ namespace basegfx
}
else
{
- B2DPoint aCurrA(rCandidate.getB2DPoint(0L));
+ B2DPoint aCurrA(rCandidate.getB2DPoint(0));
- for(sal_uInt32 a(0L); a < nEdgeCount - 1L; a++)
+ for(sal_uInt32 a(0); a < nEdgeCount - 1L; a++)
{
- const B2DPoint aNextA(rCandidate.getB2DPoint(a + 1L == nPointCount ? 0L : a + 1L));
+ const B2DPoint aNextA(rCandidate.getB2DPoint(a + 1L == nPointCount ? 0 : a + 1L));
const B2DRange aRangeA(aCurrA, aNextA);
B2DPoint aCurrB(rCandidate.getB2DPoint(a + 1L));
for(sal_uInt32 b(a + 1L); b < nEdgeCount; b++)
{
- const B2DPoint aNextB(rCandidate.getB2DPoint(b + 1L == nPointCount ? 0L : b + 1L));
+ const B2DPoint aNextB(rCandidate.getB2DPoint(b + 1L == nPointCount ? 0 : b + 1L));
const B2DRange aRangeB(aCurrB, aNextB);
// consecutive segments touch of course
@@ -622,7 +622,7 @@ namespace basegfx
const B2DVector aEdgeVector(rNext - rCurr);
bool bTestUsingX(fabs(aEdgeVector.getX()) > fabs(aEdgeVector.getY()));
- for(sal_uInt32 a(0L); a < nPointCount; a++)
+ for(sal_uInt32 a(0); a < nPointCount; a++)
{
const B2DPoint aTestPoint(rPointPolygon.getB2DPoint(a));
@@ -687,7 +687,7 @@ namespace basegfx
const sal_uInt32 nEdgeCount(rEdgePolygon.isClosed() ? nEdgePointCount : nEdgePointCount - 1L);
B2DPoint aCurr(rEdgePolygon.getB2DPoint(0));
- for(sal_uInt32 a(0L); a < nEdgeCount; a++)
+ for(sal_uInt32 a(0); a < nEdgeCount; a++)
{
const sal_uInt32 nNextIndex((a + 1) % nEdgePointCount);
const B2DPoint aNext(rEdgePolygon.getB2DPoint(nNextIndex));
@@ -751,14 +751,14 @@ namespace basegfx
B2DCubicBezier aCubicA;
B2DCubicBezier aCubicB;
- for(sal_uInt32 a(0L); a < nEdgeCountA; a++)
+ for(sal_uInt32 a(0); a < nEdgeCountA; a++)
{
rCandidateA.getBezierSegment(a, aCubicA);
aCubicA.testAndSolveTrivialBezier();
const bool bEdgeAIsCurve(aCubicA.isBezier());
const B2DRange aRangeA(aCubicA.getRange());
- for(sal_uInt32 b(0L); b < nEdgeCountB; b++)
+ for(sal_uInt32 b(0); b < nEdgeCountB; b++)
{
rCandidateB.getBezierSegment(b, aCubicB);
aCubicB.testAndSolveTrivialBezier();
@@ -800,17 +800,17 @@ namespace basegfx
}
else
{
- B2DPoint aCurrA(rCandidateA.getB2DPoint(0L));
+ B2DPoint aCurrA(rCandidateA.getB2DPoint(0));
- for(sal_uInt32 a(0L); a < nEdgeCountA; a++)
+ for(sal_uInt32 a(0); a < nEdgeCountA; a++)
{
- const B2DPoint aNextA(rCandidateA.getB2DPoint(a + 1L == nPointCountA ? 0L : a + 1L));
+ const B2DPoint aNextA(rCandidateA.getB2DPoint(a + 1L == nPointCountA ? 0 : a + 1L));
const B2DRange aRangeA(aCurrA, aNextA);
- B2DPoint aCurrB(rCandidateB.getB2DPoint(0L));
+ B2DPoint aCurrB(rCandidateB.getB2DPoint(0));
- for(sal_uInt32 b(0L); b < nEdgeCountB; b++)
+ for(sal_uInt32 b(0); b < nEdgeCountB; b++)
{
- const B2DPoint aNextB(rCandidateB.getB2DPoint(b + 1L == nPointCountB ? 0L : b + 1L));
+ const B2DPoint aNextB(rCandidateB.getB2DPoint(b + 1L == nPointCountB ? 0 : b + 1L));
const B2DRange aRangeB(aCurrB, aNextB);
// consecutive segments touch of course
@@ -875,7 +875,7 @@ namespace basegfx
if(bSelfIntersections)
{
// remove self intersections
- aRetval.append(addPointsAtCutsAndTouches(rCandidate.getB2DPolygon(0L)));
+ aRetval.append(addPointsAtCutsAndTouches(rCandidate.getB2DPolygon(0)));
}
else
{
@@ -889,7 +889,7 @@ namespace basegfx
std::unique_ptr<temporaryPolygonData[]> pTempData(new temporaryPolygonData[nCount]);
sal_uInt32 a, b;
- for(a = 0L; a < nCount; a++)
+ for(a = 0; a < nCount; a++)
{
if(bSelfIntersections)
{
@@ -904,9 +904,9 @@ namespace basegfx
}
// now cuts and touches between the polygons
- for(a = 0L; a < nCount; a++)
+ for(a = 0; a < nCount; a++)
{
- for(b = 0L; b < nCount; b++)
+ for(b = 0; b < nCount; b++)
{
if(a != b)
{
@@ -929,7 +929,7 @@ namespace basegfx
}
// consolidate the result
- for(a = 0L; a < nCount; a++)
+ for(a = 0; a < nCount; a++)
{
aRetval.append(mergeTemporaryPointsAndPolygon(pTempData[a].getPolygon(), pTempData[a].getTemporaryPointVector()));
}