To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=114888
                 Issue #|114888
                 Summary|simplify Undo by using an UndoSuppressor class
               Component|Word processor
                 Version|current
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|b_michaelsen
             Reported by|b_michaelsen





------- Additional comments from [email protected] Fri Oct  1 
13:02:28 +0000 2010 -------
There is the idea:

namespace sw { namespace undo {

class UndoSuppresor
{
    public:
        UndoSuppresor(IDocumentUndoRedo* io_pUndoRedo)
            : m_pUndoRedo(io_pUndoRedo)
            , m_bOldState(io_pUndoRedo->DoesUndo())
        {
            m_pUndoRedo->DoUndo(false);
        };
        ~UndoSuppresor()
            { m_pUndoRedo->DoUndo(m_bOldState); };
    private:
        IDocumentUndoRedo* const m_pUndoRedo;
        const bool m_bOldState;
}

instead of writing:

BOOL bUndo = pDoc->DoesUndo();
pDoc->DoUndo(false);
... something ...
pDoc->DoUndo(bUndo);

one would write:
{
    UndoSuppresor(p_Doc);
    ... something ...
}

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to