~ubuntu-branches/debian/sid/librecad/sid

« back to all changes in this revision

Viewing changes to src/lib/modification/rs_modification.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2011-12-17 20:08:57 UTC
  • mfrom: (0.2.4)
  • Revision ID: package-import@ubuntu.com-20111217200857-r9wmynaloj230qm1
Tags: 1.0.0+nolibs-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1862
1862
        RS_DEBUG->print(RS_Debug::D_WARNING,
1863
1863
                        "RS_Modification::trim: limitEntity is not atomic");
1864
1864
    }
 
1865
    if(trimEntity->isLocked()|| !trimEntity->isVisible()) return false;
1865
1866
 
1866
1867
    RS_VectorSolutions sol;
1867
1868
    if (limitEntity->isAtomic()) {
1923
1924
    }
1924
1925
 
1925
1926
    // remove limit entity from view:
1926
 
    if (both) {
 
1927
    bool trimBoth= both && !limitEntity->isLocked() && limitEntity->isVisible();
 
1928
    if (trimBoth) {
1927
1929
        trimmed2 = (RS_AtomicEntity*)limitEntity->clone();
1928
1930
        trimmed2->setHighlighted(false);
1929
1931
        if (graphicView!=NULL) {
2013
2015
    }
2014
2016
 
2015
2017
    // trim limit entity:
2016
 
    if (both) {
 
2018
    if (trimBoth) {
2017
2019
        RS_Vector is = sol.getClosest(limitCoord);
2018
2020
 
2019
2021
        RS2::Ending ending = trimmed2->getTrimPoint(limitCoord, is);
2037
2039
    }
2038
2040
 
2039
2041
    // add new trimmed limit entity:
2040
 
    if (both) {
 
2042
    if (trimBoth) {
2041
2043
        container->addEntity(trimmed2);
2042
2044
        if (graphicView!=NULL) {
2043
2045
            graphicView->drawEntity(trimmed2);
2049
2051
        document->addUndoable(trimmed1);
2050
2052
        trimEntity->setUndoState(true);
2051
2053
        document->addUndoable(trimEntity);
2052
 
        if (both) {
 
2054
        if (trimBoth) {
2053
2055
            document->addUndoable(trimmed2);
2054
2056
            limitEntity->setUndoState(true);
2055
2057
            document->addUndoable(limitEntity);
2079
2081
                        "RS_Modification::trimAmount: Entity is NULL");
2080
2082
        return false;
2081
2083
    }
 
2084
    if(trimEntity->isLocked() || ! trimEntity->isVisible()) return false;
2082
2085
 
2083
2086
    RS_AtomicEntity* trimmed = NULL;
2084
2087
 
2128
2131
                        "RS_Modification::cut: Entity is NULL");
2129
2132
        return false;
2130
2133
    }
 
2134
    if(cutEntity->isLocked() || ! cutEntity->isVisible()) return false;
2131
2135
 
2132
2136
    if (!cutCoord.valid) {
2133
2137
        RS_DEBUG->print(RS_Debug::D_WARNING,
2274
2278
                        "RS_Modification::bevel: At least one entity is NULL");
2275
2279
        return false;
2276
2280
    }
 
2281
    if(entity1->isLocked() || ! entity1->isVisible()) return false;
 
2282
    if(entity2->isLocked() || ! entity2->isVisible()) return false;
2277
2283
 
2278
2284
    RS_EntityContainer* baseContainer = container;
2279
2285
    bool isPolyline = false;
2533
2539
                        "RS_Modification::round: At least one entity is NULL");
2534
2540
        return false;
2535
2541
    }
 
2542
    if(entity1->isLocked() || ! entity1->isVisible()) return false;
 
2543
    if(entity2->isLocked() || ! entity2->isVisible()) return false;
2536
2544
 
2537
2545
    RS_EntityContainer* baseContainer = container;
2538
2546
    bool isPolyline = false;
2765
2773
                        RS_Debug::D_WARNING);
2766
2774
        return false;
2767
2775
    }
 
2776
    if(container->isLocked() || ! container->isVisible()) return false;
2768
2777
 
2769
2778
    QList<RS_Entity*> addList;
2770
2779
 
2875
2884
                        RS_Debug::D_WARNING);
2876
2885
        return false;
2877
2886
    }
 
2887
    if(container->isLocked() || ! container->isVisible()) return false;
2878
2888
 
2879
2889
    QList<RS_Entity*> addList;
2880
2890
 
2918
2928
        return false;
2919
2929
    }
2920
2930
 
 
2931
    if(text->isLocked() || ! text->isVisible()) return false;
 
2932
 
2921
2933
    // iterate though lines:
2922
2934
    for (RS_Entity* e2 = text->firstEntity(); e2!=NULL;
2923
2935
            e2 = text->nextEntity()) {
2987
2999
                        RS_Debug::D_WARNING);
2988
3000
        return false;
2989
3001
    }
 
3002
    if(container->isLocked() || ! container->isVisible()) return false;
2990
3003
 
2991
3004
    QList<RS_Entity*> addList;
2992
3005