Re: uwog - r22323 - in abiword/trunk/src: text/fmt/xp wp/ap/unix

From: J.M. Maurer <uwog_at_uwog.net>
Date: Sat Nov 24 2007 - 20:30:29 CET

I think this was the last change _I_ wanted to make. For all I care,
AbiWord 2.6 is done.

Anyone of the opinion that we should wait releasing 2.6? If not, then
I'd like to push it out asap.

Bye!
  Marc

On Sat, 2007-11-24 at 20:17 +0100, cvs@abisource.com wrote:
> Author: uwog
> Date: 2007-11-24 20:17:01 +0100 (Sat, 24 Nov 2007)
> New Revision: 22323
>
> Modified:
> abiword/trunk/src/text/fmt/xp/fv_View.cpp
> abiword/trunk/src/text/fmt/xp/fv_View.h
> abiword/trunk/src/wp/ap/unix/abiwidget.cpp
> abiword/trunk/src/wp/ap/unix/abiwidget.h
> Log:
> Small AbiWidget API change to allow very nice incremental searching (firefox like)
>
>
>
> Modified: abiword/trunk/src/text/fmt/xp/fv_View.cpp
> ===================================================================
> --- abiword/trunk/src/text/fmt/xp/fv_View.cpp 2007-11-20 15:56:16 UTC (rev 22322)
> +++ abiword/trunk/src/text/fmt/xp/fv_View.cpp 2007-11-24 19:17:01 UTC (rev 22323)
> @@ -7510,6 +7510,18 @@
> return bRes;
> }
>
> +void
> +FV_View::findSetStartAt(PT_DocPosition pos)
> +{
> + PT_DocPosition posEnd;
> + m_pDoc->getBounds(true, posEnd);
> + UT_return_if_fail(pos <= posEnd);
> +
> + m_startPosition = pos;
> + m_wrappedEnd = false;
> + m_doneFind = false;
> +}
> +
> /*!
> Find operation reset
>
>
> Modified: abiword/trunk/src/text/fmt/xp/fv_View.h
> ===================================================================
> --- abiword/trunk/src/text/fmt/xp/fv_View.h 2007-11-20 15:56:16 UTC (rev 22322)
> +++ abiword/trunk/src/text/fmt/xp/fv_View.h 2007-11-24 19:17:01 UTC (rev 22323)
> @@ -603,6 +603,7 @@
>
> bool findAgain(void);
>
> + void findSetStartAt(PT_DocPosition pos);
> void findSetStartAtInsPoint(void);
>
> bool findNext(bool& bDoneEntireDocument);
>
> Modified: abiword/trunk/src/wp/ap/unix/abiwidget.cpp
> ===================================================================
> --- abiword/trunk/src/wp/ap/unix/abiwidget.cpp 2007-11-20 15:56:16 UTC (rev 22322)
> +++ abiword/trunk/src/wp/ap/unix/abiwidget.cpp 2007-11-24 19:17:01 UTC (rev 22323)
> @@ -5,6 +5,7 @@
> * Copyright (C) 2001 AbiSource, Inc.
> * Copyright (C) 2001,2002 Dom Lachowicz <cinamod@hotmail.com>
> * Copyright (C) 2002 Martin Sevior <msevior@physics.unimelb.edu.au>
> + * Copyright (C) 2007 Marc Maurer <uwog@uwog.net>
> * Copyright (C) 2007 One Laptop Per Child
> *
> * This program is free software; you can redistribute it and/or
> @@ -2406,19 +2407,28 @@
> {
> *w->priv->m_sSearchText = UT_UTF8String(search_str).ucs4_str(); // ucs4_str returns object instance
> FV_View* v = _get_fv_view(w);
> - UT_return_if_fail(v!=0);
> - v->findSetStartAtInsPoint();
> + UT_return_if_fail(v);
> v->findSetFindString( w->priv->m_sSearchText->ucs4_str() );
> }
>
> extern "C" gboolean
> -abi_widget_find_next(AbiWidget * w)
> +abi_widget_find_next(AbiWidget * w, gboolean sel_start)
> {
> FV_View* v = _get_fv_view(w);
> - UT_return_val_if_fail(v!=0,false);
> + UT_return_val_if_fail(v, false);
> + if (!sel_start || v->isSelectionEmpty())
> + {
> + v->findSetStartAtInsPoint();
> + }
> + else
> + {
> + PT_DocPosition start = std::min(v->getPoint(), v->getSelectionAnchor());
> + v->cmdUnselectSelection();
> + v->setPoint(start);
> + v->findSetStartAt(start);
> + }
> bool doneWithEntireDoc = false;
> bool res = v->findNext(doneWithEntireDoc);
> - v->findSetStartAtInsPoint();
> return res;
> }
>
> @@ -2426,10 +2436,10 @@
> abi_widget_find_prev(AbiWidget * w)
> {
> FV_View* v = _get_fv_view(w);
> - UT_return_val_if_fail(v!=0,false);
> + UT_return_val_if_fail(v, false);
> bool doneWithEntireDoc = false;
> + v->findSetStartAtInsPoint();
> bool res = v->findPrev(doneWithEntireDoc);
> - v->findSetStartAtInsPoint();
> return res;
> }
>
>
> Modified: abiword/trunk/src/wp/ap/unix/abiwidget.h
> ===================================================================
> --- abiword/trunk/src/wp/ap/unix/abiwidget.h 2007-11-20 15:56:16 UTC (rev 22322)
> +++ abiword/trunk/src/wp/ap/unix/abiwidget.h 2007-11-24 19:17:01 UTC (rev 22323)
> @@ -386,7 +386,7 @@
>
> // search functions
> void abi_widget_set_find_string (AbiWidget * w, gchar * search_str);
> - gboolean abi_widget_find_next (AbiWidget * w);
> + gboolean abi_widget_find_next (AbiWidget * w, gboolean sel_start);
> gboolean abi_widget_find_prev (AbiWidget * w);
>
> // document/page functions
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the word
> unsubscribe in the message body.
Received on Sat Nov 24 20:31:15 2007

This archive was generated by hypermail 2.1.8 : Sat Nov 24 2007 - 20:31:16 CET