~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to libs/flake/commands/KoPathPointMergeCommand.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
    Q_ASSERT(d->pathShape);
112
112
    Q_ASSERT(!d->pathShape->isClosedSubpath(d->endPoint.first));
113
113
    Q_ASSERT(d->endPoint.second == 0 ||
114
 
             d->endPoint.second == d->pathShape->pointCountSubpath(d->endPoint.first) - 1);
 
114
             d->endPoint.second == d->pathShape->subpathPointCount(d->endPoint.first) - 1);
115
115
    Q_ASSERT(!d->pathShape->isClosedSubpath(d->startPoint.first));
116
116
    Q_ASSERT(d->startPoint.second == 0 ||
117
 
             d->startPoint.second == d->pathShape->pointCountSubpath(d->startPoint.first) - 1);
 
117
             d->startPoint.second == d->pathShape->subpathPointCount(d->startPoint.first) - 1);
118
118
 
119
119
    // if we have two different subpaths we might need to reverse them
120
120
    if (d->endPoint.first != d->startPoint.first) {
122
122
        if (d->startPoint < d->endPoint)
123
123
            qSwap(d->endPoint, d->startPoint);
124
124
        // mark first subpath to be reversed if first point starts a subpath with more than one point
125
 
        if (d->endPoint.second == 0 && d->pathShape->pointCountSubpath(d->endPoint.first) > 1)
 
125
        if (d->endPoint.second == 0 && d->pathShape->subpathPointCount(d->endPoint.first) > 1)
126
126
            d->reverse |= Private::ReverseFirst;
127
127
        // mark second subpath to be reversed if second point does not start a subpath with more than one point
128
 
        if (d->startPoint.second != 0 && d->pathShape->pointCountSubpath(d->startPoint.first) > 1)
 
128
        if (d->startPoint.second != 0 && d->pathShape->subpathPointCount(d->startPoint.first) > 1)
129
129
            d->reverse |= Private::ReverseSecond;
130
130
    } else {
131
131
        Q_ASSERT(d->endPoint.second != d->startPoint.second);
179
179
        KoPathPointIndex newStartIndex(d->startPoint.first,0);
180
180
        d->pathShape->pointByIndex(newStartIndex)->setProperty(KoPathPoint::CloseSubpath);
181
181
    } else {
182
 
        // first revert subpathes if needed
 
182
        // first revert subpaths if needed
183
183
        if (d->reverse & Private::ReverseFirst) {
184
184
            d->pathShape->reverseSubpath(d->endPoint.first);
185
185
        }
189
189
        // move the subpaths so the second is directly after the first
190
190
        d->pathShape->moveSubpath(d->startPoint.first, d->endPoint.first + 1);
191
191
        d->splitIndex = d->pathShape->pathPointIndex(endPoint);
192
 
        // join both subpathes
 
192
        // join both subpaths
193
193
        d->pathShape->join(d->endPoint.first);
194
194
        // change the first point of the points to merge
195
195
        d->removedPoint = d->mergePoints(endPoint, startPoint);
217
217
        // reposition the points
218
218
        d->resetPoints(d->endPoint, d->startPoint);
219
219
    } else {
220
 
        // break merged subpathes apart
 
220
        // break merged subpaths apart
221
221
        d->pathShape->breakAfter(d->splitIndex);
222
222
        // reinsert the old second point
223
223
        d->pathShape->insertPoint(d->removedPoint, KoPathPointIndex(d->splitIndex.first+1,0));