<br><br><div class="gmail_quote">On Tue, Sep 29, 2009 at 11:51 AM, Thomas Zander <span dir="ltr"><<a href="mailto:zander@kde.org" target="_blank">zander@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
SVN commit 1029197 by zander:<br>
<br>
Inline the KoDocument::undoLastCommand, no need for a virtual method.<br>
<br>
M +1 -1 krita/image/kis_undo_adapter.cc<br>
M +0 -5 libs/main/KoDocument.cpp<br>
M +0 -5 libs/main/KoDocument.h<br>
<br>
<br>
--- trunk/koffice/krita/image/kis_undo_adapter.cc #1029196:1029197<br>
@@ -78,7 +78,7 @@<br>
* command->undo() and remove the cache without committing it<br>
* to the undoStack<br>
*/<br>
- m_doc->undoLastCommand();<br>
+ m_doc->undoStack()->undo();<br>
}<br></blockquote><div><br>Argh! =(<br>You are beaking encapsulation! Isn't this a basic principle of object-oriented programming?<br>There is an object (doc), and there is it's interface (undoLastCommand). And no calls to private members! (undo stack is private, right?) Why do you use private members?<br>
<br>These calls to privates are curse of our code... They make it simply unmaintainable... Just remember zooming subsys and PixelAspect button case...<br><br>I'm insisting on reverting this. I admit that this function may be 'non-virtual', i simply didn't manage to compile this as non-virtual. =(<br>
<br></div><div><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
void KisUndoAdapter::setUndo(bool undo)<br>
--- trunk/koffice/libs/main/KoDocument.cpp #1029196:1029197<br>
@@ -2381,11 +2381,6 @@<br>
d->undoStack->push(command);<br>
}<br>
<br>
-void KoDocument::undoLastCommand()<br>
-{<br>
- d->undoStack->undo();<br>
-}<br>
-<br>
void KoDocument::beginMacro(const QString & text)<br>
{<br>
d->undoStack->beginMacro(text);<br>
--- trunk/koffice/libs/main/KoDocument.h #1029196:1029197<br>
@@ -790,11 +790,6 @@<br>
virtual void addCommand(QUndoCommand* command);<br>
<br>
/**<br>
- * Undo the command that is stored at the top of the stack<br>
- */<br>
- virtual void undoLastCommand();<br>
-<br>
- /**<br>
* Begins recording of a macro command. At the end endMacro needs to be called.<br>
* @param text command description<br>
*/<br>
</blockquote></div><br><br clear="all"><br>-- <br>Dmitry Kazakov<br>