[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/office/flake
From:       Thomas Zander <zander () kde ! org>
Date:       2006-05-07 17:42:08
Message-ID: 1147023728.056864.4729.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 538381 by zander:

selectedObjects(bool) -> selectedObjects(enum)


 M  +3 -2      lib/KoSelection.cpp  
 M  +8 -3      lib/KoSelection.h  
 M  +1 -1      lib/KoShapeMoveStrategy.cpp  
 M  +4 -4      testapp/mainwindow.cpp  


--- trunk/playground/office/flake/lib/KoSelection.cpp #538380:538381
@@ -177,13 +177,14 @@
     m_selectionBox[TopLeft] = QPointF( xOff, yOff );
 }
 
-const KoSelectionSet KoSelection::selectedObjects(bool strip) const {
+const KoSelectionSet KoSelection::selectedObjects(SelectionType strip) const {
     KoSelectionSet answer;
     // strip the child objects when there is also a parent included.
+    bool doStripping = strip == StrippedSelection;
     foreach (KoShape *shape, m_selectedObjects) {
         KoShapeContainer *container = shape->parent();
         bool add = true;
-        while(strip && add && container) {
+        while(doStripping && add && container) {
             if(m_selectedObjects.contains(container))
                 add = false;
             container = container->parent();
--- trunk/playground/office/flake/lib/KoSelection.h #538380:538381
@@ -48,6 +48,11 @@
 
 public:
 
+    enum SelectionType {
+        FullSelection,
+        StrippedSelection
+    };
+
     KoSelection();
     virtual ~KoSelection();
 
@@ -66,10 +71,10 @@
     /**
      * Return the list of selected objects
      * @return the list of selected objects
-     * @param strip if true, the returned list will not include any children of a \
                grouped object
-     *    if the group-parant is itself also in the set.
+     * @param strip if StrippedSelection, the returned list will not include any \
children +     *    of a grouped object if the group-parent is itself also in the \
                set.
      */
-    virtual const KoSelectionSet selectedObjects(bool strip = false) const;
+    virtual const KoSelectionSet selectedObjects(SelectionType strip = \
FullSelection) const;  virtual bool isSelected(const KoShape *object) const;
     virtual int count() const;
 
--- trunk/playground/office/flake/lib/KoShapeMoveStrategy.cpp #538380:538381
@@ -36,7 +36,7 @@
 : KoInteractionStrategy(canvas)
 , m_start(clicked)
 {
-    KoSelectionSet selectedObjects = \
canvas->shapeManager()->selection()->selectedObjects(true); +    KoSelectionSet \
selectedObjects = canvas->shapeManager()->selection()->selectedObjects(KoSelection::StrippedSelection);
  foreach(KoShape *shape, selectedObjects) {
         if(shape->isLocked())
             continue;
--- trunk/playground/office/flake/testapp/mainwindow.cpp #538380:538381
@@ -128,7 +128,7 @@
 {
     double hScale = double(zoom/1000.0);
 
-    foreach ( KoShape * shape, m_shapeManager->selection()->selectedObjects(true) ) \
{ +    foreach ( KoShape * shape, \
m_shapeManager->selection()->selectedObjects(KoSelection::StrippedSelection) ) {  \
shape ->scale(hScale, shape->scaleY());  shape->repaint();
     }
@@ -137,7 +137,7 @@
 void FlakeCanvas::zoomVChanged(int zoom)
 {
     double vScale = double(zoom/1000.0);
-    foreach ( KoShape * shape, m_shapeManager->selection()->selectedObjects(true) ) \
{ +    foreach ( KoShape * shape, \
m_shapeManager->selection()->selectedObjects(KoSelection::StrippedSelection) ) {  \
shape ->scale(shape->scaleX(), vScale);  shape->repaint();
     }
@@ -153,14 +153,14 @@
 
 void FlakeCanvas::rotate(int rotate)
 {
-    foreach ( KoShape * shape, m_shapeManager->selection()->selectedObjects(true) ) \
{ +    foreach ( KoShape * shape, \
m_shapeManager->selection()->selectedObjects(KoSelection::StrippedSelection) ) {  \
shape->rotate(rotate);  shape->repaint();
     }
 }
 
 void FlakeCanvas::zIndexChanged(int newZIndex) {
-    foreach ( KoShape * shape, m_shapeManager->selection()->selectedObjects(true) ) \
{ +    foreach ( KoShape * shape, \
m_shapeManager->selection()->selectedObjects(KoSelection::StrippedSelection) ) {  \
shape ->setZIndex(newZIndex);  shape->repaint();
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic