Since I haven't had any response to this, I am committing it.

Cheers!


Michael D. Pritchett


On Fri, 12 Oct 2001, Michael D. Pritchett wrote:

> problem:  Open a document and change the zoom.  Document is now marked as
> dirty???
>
> reason:  FV_View constructor calls a setCharFormat to change the language -
> which is a zero length span.  This attempts to update the undo_position, but
> doesn't need to as it append to previous fmt tag.  Unfortunately the
> save_position does get incremented causing a dirty document.
>
> fix:  Either find a better place to do the setCharFormat or handle the case
> that if the undo_position doesn't increment neither should the
> save_position.  The patch below takes the second approach.
>
> I don't think it breaks anything else, but as I don't know this area of code
> that well, I am posting to the list instead of comitting.  If I hear
> nothing, I will commit by default.
>
> Cheers!
>
> Michael D. Pritchett
>
> Here is the patch:
>
> Index: pt_PT_ChangeSpan.cpp
> ===================================================================
> RCS file: /cvsroot/abi/src/text/ptbl/xp/pt_PT_ChangeSpan.cpp,v
> retrieving revision 1.32
> diff -u -r1.32 pt_PT_ChangeSpan.cpp
> --- pt_PT_ChangeSpan.cpp 2001/09/11 04:18:41 1.32
> +++ pt_PT_ChangeSpan.cpp 2001/10/12 18:32:06
> @@ -355,11 +355,13 @@
>   }
>   if (dpos1 == dpos2)   // if length of change is zero, then we have a
> toggle format.
>   {
> +  UT_uint32 startUndoPos = m_history.getUndoPos();
>    bool bRes = _insertFmtMarkFragWithNotify(ptc,dpos1,attributes,lProps);
> +  UT_uint32 endUndoPos = m_history.getUndoPos();
>    // Won't be a persistant change if it's just a toggle
>    PX_ChangeRecord *pcr=0;
>    m_history.getUndo(&pcr);
> -  if (pcr)
> +  if (pcr && (startUndoPos != endUndoPos) )
>    {
>     UT_DEBUGMSG(("Setting persistance of change to false\n"));
>     pcr->setPersistance(false);
>
>
>
>


Reply via email to