Ticket #6244: alignWith.patch

File alignWith.patch, 820 bytes (added by yourpalal, 10 years ago)

Patch to fix segfault, also replaces an old style cast with a static_cast.

  • src/kits/interface/TwoDimensionalLayout.cpp

     
    539539        return;
    540540
    541541    int32 count = other->fLocalLayouters.CountItems();
    542     for (int32 i = 0; i < count; i++) {
     542    for (int32 i = count - 1; i >= 0; i--) {
    543543        LocalLayouter* layouter
    544544            = (LocalLayouter*)other->fLocalLayouters.ItemAt(i);
    545545        AddLocalLayouter(layouter);
     
    11691169        fHLayouter = compoundLayouter;
    11701170    } else {
    11711171        oldCompoundLayouter = fVLayouter;
    1172         fVLayouter = (VerticalCompoundLayouter*)compoundLayouter;
     1172        fVLayouter = static_cast<VerticalCompoundLayouter*>(compoundLayouter);
    11731173    }
    11741174
    11751175    if (compoundLayouter == oldCompoundLayouter)