View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001612 | Scribus | Scripter | public | 2005-02-01 15:03 | 2005-02-04 18:30 |
Reporter | Assigned To | subik | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86 Linux | OS | Fedora Core | OS Version | 1 |
Product Version | 1.3.0cvs | ||||
Fixed in Version | 1.2.2cvs | ||||
Summary | 0001612: PATCH: fix moveObject and moveObjectAbs for groups | ||||
Description | The attached patch causes moveObject and moveObjectAbs to behave correctly when moving groups that are not currently selected when they're called. Patches for both 1.2.2cvs and 1.3cvs included. | ||||
Tags | No tags attached. | ||||
Patch | |||||
child of | 0003812 | acknowledged | Metabug: Grouped objects |
2005-02-01 15:03
|
scripter_move_fixes13.diff (2,625 bytes)
Index: cmdmani.cpp =================================================================== RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp,v retrieving revision 1.7.2.16 diff -u -r1.7.2.16 cmdmani.cpp --- cmdmani.cpp 1 Feb 2005 10:41:40 -0000 1.7.2.16 +++ cmdmani.cpp 1 Feb 2005 16:01:37 -0000 @@ -57,10 +57,23 @@ PageItem *item = GetUniqueItem(QString::fromUtf8(Name)); if (item==NULL) return NULL; - if (Carrier->view->GroupSel) + // Grab the old selection + QPtrList<PageItem> oldSelection = Carrier->view->SelItem; + // Clear the selection + Carrier->view->Deselect(); + // Select the item, which will also select its group if + // there is one. + Carrier->view->SelectItemNr(item->ItemNr); + // Move the item, or items + if (Carrier->view->SelItem.count() > 1) Carrier->view->moveGroup(ValueToPoint(x), ValueToPoint(y)); else Carrier->view->MoveItem(ValueToPoint(x), ValueToPoint(y), item); + // Now restore the selection. We just have to go through and select + // each and every item, unfortunately. + Carrier->view->Deselect(); + for ( oldSelection.first(); oldSelection.current(); oldSelection.next() ) + Carrier->view->SelectItemNr(oldSelection.current()->ItemNr); Py_INCREF(Py_None); return Py_None; } @@ -76,19 +89,27 @@ PageItem *item = GetUniqueItem(QString::fromUtf8(Name)); if (item == NULL) return NULL; - if (Carrier->view->GroupSel) + // Grab the old selection + QPtrList<PageItem> oldSelection = Carrier->view->SelItem; + // Clear the selection + Carrier->view->Deselect(); + // Select the item, which will also select its group if + // there is one. + Carrier->view->SelectItemNr(item->ItemNr); + // Move the item, or items + if (Carrier->view->SelItem.count() > 1) { - if (Carrier->view->GroupSel) - { - double x2, y2, w, h; - Carrier->view->getGroupRect(&x2, &y2, &w, &h); - Carrier->view->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2); - } - else - Carrier->view->MoveItem(pageUnitXToDocX(x) - item->Xpos, pageUnitYToDocY(y) - item->Ypos, item); + double x2, y2, w, h; + Carrier->view->getGroupRect(&x2, &y2, &w, &h); + Carrier->view->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2); } else Carrier->view->MoveItem(pageUnitXToDocX(x) - item->Xpos, pageUnitYToDocY(y) - item->Ypos, item); + // Now restore the selection. We just have to go through and select + // each and every item, unfortunately. + Carrier->view->Deselect(); + for ( oldSelection.first(); oldSelection.current(); oldSelection.next() ) + Carrier->view->SelectItemNr(oldSelection.current()->ItemNr); Py_INCREF(Py_None); return Py_None; } |
|
Tsoots needed these, so assigning to him. |
|
Sorry Petr, I shouldn't have changed the assignment on this to Riku. I wrote these as a fix for a problem Riku was having and thought he was going to apply them. I didn't notice you'd already taken ownership of the bug. |
|
OK |
|
Proving my idiocy, the 1.2 patch was actually just the 1.3 patch again. Real 1.2 patch coming when I find it. |
2005-02-04 18:11
|
scripter_move_fixes12.diff (2,351 bytes)
Index: cmdmani.cpp =================================================================== RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp,v retrieving revision 1.18 diff -u -r1.18 cmdmani.cpp --- cmdmani.cpp 2 Feb 2005 15:13:05 -0000 1.18 +++ cmdmani.cpp 4 Feb 2005 19:11:01 -0000 @@ -57,10 +57,23 @@ PageItem *item = GetUniqueItem(QString::fromUtf8(Name)); if (item == NULL) return NULL; - if (item->OwnPage->GroupSel) + // Grab the old selection + QPtrList<PageItem> oldSelection = item->OwnPage->SelItem; + // Clear the selection + item->OwnPage->Deselect(); + // Select the item, which will also select its group if + // there is one. + item->OwnPage->SelectItemNr(item->ItemNr); + // Move the item, or items + if (item->OwnPage->SelItem.count() > 1) item->OwnPage->moveGroup(ValueToPoint(x), ValueToPoint(y)); else item->OwnPage->MoveItem(ValueToPoint(x), ValueToPoint(y), item); + // Now restore the selection. We just have to go through and select + // each and every item, unfortunately. + item->OwnPage->Deselect(); + for ( oldSelection.first(); oldSelection.current(); oldSelection.next() ) + item->OwnPage->SelectItemNr(oldSelection.current()->ItemNr); Py_INCREF(Py_None); return Py_None; } @@ -76,15 +89,27 @@ PageItem *item = GetUniqueItem(QString::fromUtf8(Name)); if (item == NULL) return NULL; - if (item->OwnPage->GroupSel) + // Grab the old selection + QPtrList<PageItem> oldSelection = item->OwnPage->SelItem; + // Clear the selection + item->OwnPage->Deselect(); + // Select the item, which will also select its group if + // there is one. + item->OwnPage->SelectItemNr(item->ItemNr); + // Move the item, or items + if (item->OwnPage->SelItem.count() > 1) { double x2, y2, w, h; item->OwnPage->getGroupRect(&x2, &y2, &w, &h); item->OwnPage->moveGroup(ValueToPoint(x) - x2, ValueToPoint(y) - y2); } else - //PageItem *b = Carrier->doc->ActPage->Items.at(i); item->OwnPage->MoveItem(ValueToPoint(x) - item->Xpos, ValueToPoint(y) - item->Ypos, item); + // Now restore the selection. We just have to go through and select + // each and every item, unfortunately. + item->OwnPage->Deselect(); + for ( oldSelection.first(); oldSelection.current(); oldSelection.next() ) + item->OwnPage->SelectItemNr(oldSelection.current()->ItemNr); Py_INCREF(Py_None); return Py_None; } |
|
Correct 1.2 patch attached. |
|
Thanks very much for that Petr (and for putting up with the stuff-ups!). |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-02-01 15:03 |
|
New Issue | |
2005-02-01 15:03 |
|
File Added: scripter_move_fixes13.diff | |
2005-02-01 15:47 |
|
File Added: scripter_move_fixes12.diff | |
2005-02-01 15:48 |
|
Description Updated | |
2005-02-01 16:54 | subik | Status | new => assigned |
2005-02-01 16:54 | subik | Assigned To | => subik |
2005-02-02 09:21 |
|
Assigned To | subik => Tsoots |
2005-02-02 09:21 |
|
Note Added: 0003585 | |
2005-02-04 04:54 |
|
Assigned To | Tsoots => subik |
2005-02-04 04:56 |
|
Note Added: 0003610 | |
2005-02-04 06:18 | subik | Note Added: 0003613 | |
2005-02-04 18:00 |
|
File Deleted: scripter_move_fixes12.diff | |
2005-02-04 18:01 |
|
Note Added: 0003627 | |
2005-02-04 18:11 |
|
File Added: scripter_move_fixes12.diff | |
2005-02-04 18:12 |
|
Note Added: 0003628 | |
2005-02-04 18:20 | subik | Status | assigned => resolved |
2005-02-04 18:20 | subik | Fixed in Version | => 1.2.2cvs |
2005-02-04 18:20 | subik | Resolution | open => fixed |
2005-02-04 18:30 |
|
Status | resolved => closed |
2005-02-04 18:30 |
|
Note Added: 0003629 | |
2006-05-13 17:17 | christoph_s | Relationship added | child of 0003812 |