Attached Files |
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;
}
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;
}
|
---|