From: Dom Lachowicz (domlachowicz@yahoo.com)
Date: Mon May 26 2003 - 16:18:08 EDT
Hi Deje,
1) Please remove all of the //FIX comments and code
2) Please do the equivalent of 'cvs diff -u >
file.diff' from the abi directory. Many of your
patches are 'malformed' and don't apply to the cvs
branch.
Other than that, it looks great.
Thanks,
Dom
--- "D. Elbers" <deje_auto@hotmail.com> wrote:
> Hi Dom,
>
> In response of your mail, I changed some more things
> in the functions for
> 'find' and 'replace'.
> So hereby a new set of diff files. These include the
> complete changes, not
> the changes since my last mail.... :-)
>
> 1.) FV_View::GetDocPosition() is now renamed to
> mapDocPosition()
> 2.) variable naming is now according to the naming
> convention.....
> 3.) function returning old values now changed to
> void's().....
> 4.) Editmethods not included this time.... leave it
> as it is.
> I'll start working on the CSS-like param
> strings some time later....
> :-)
>
> For a more precise description of the changes, see
> the attached file 'abi
> search changes.txt'.
>
> Greetz,
>
> DeJe
>
>
_________________________________________________________________
> The new MSN 8: smart spam protection and 2 months
> FREE*
> http://join.msn.com/?page=features/junkmail
> > Index: abi/src/text/fmt/xp/fv_View.h
>
===================================================================
> RCS file: /cvsroot/abi/src/text/fmt/xp/fv_View.h,v
> retrieving revision 1.278
> diff -u -r1.278 fv_View.h
> --- abi/src/text/fmt/xp/fv_View.h 23 Apr 2003
> 14:36:35 -0000 1.278
> +++ abi/src/text/fmt/xp/fv_View.h 26 May 2003
> 12:13:15 -0000
> @@ -226,7 +226,7 @@
> virtual bool isSelectionEmpty(void) const;
> virtual void cmdUnselectSelection(void);
> void
> getDocumentRangeOfCurrentSelection(PD_DocumentRange
> * pdr);
> -
> + PT_DocPosition mapDocPos( FV_DocPos dp );
> PT_DocPosition saveSelectedImage (const char *
> toFile );
> PT_DocPosition saveSelectedImage (const UT_ByteBuf
> ** outByteBuf);
>
> @@ -401,33 +401,47 @@
>
> // find and replace
>
> - bool findSetNextString(UT_UCSChar* string, bool
> bMatchCase);
> + void findSetFindString (const UT_UCSChar*
> string);
> + void findSetReplaceString(const UT_UCSChar*
> string);
> + void findSetReverseFind (bool newValue);
> + void findSetMatchCase (bool newValue);
> + void findSetWholeWord (bool newValue);
> + UT_UCSChar * findGetFindString (void);
> + UT_UCSChar * findGetReplaceString(void);
> + bool findGetReverseFind ();
> + bool findGetMatchCase ();
> + bool findGetWholeWord ();
> +
> bool findAgain(void);
>
> void findSetStartAtInsPoint(void);
>
> - bool findNext(const UT_UCSChar* pFind, bool
> bMatchCase,
> + bool findNext(bool& bDoneEntireDocument);
> + bool findNext(const UT_UCSChar* pFind, bool&
> bDoneEntireDocument);
> +
> + UT_uint32* _computeFindPrefix(const UT_UCSChar*
> pFind);
> +
> + bool _findNext(UT_uint32* pPrefix,
> bool& bDoneEntireDocument);
> - UT_uint32* _computeFindPrefix(const UT_UCSChar*
> pFind,
> - bool bMatchCase);
> - bool _findNext(const UT_UCSChar* pFind,
> - UT_uint32* pPrefix,
> - bool bMatchCase,
> +
> + bool findPrev(bool& bDoneEntireDocument);
> + bool findPrev(const UT_UCSChar* pFind, bool&
> bDoneEntireDocument);
> +
> + bool _findPrev(UT_uint32* pPrefix,
> bool& bDoneEntireDocument);
>
> - bool _findReplace(const UT_UCSChar* pFind,
> - const UT_UCSChar* pReplace,
> - UT_uint32* pPrefix,
> - bool bMatchCase,
> + bool findReplaceReverse(bool&
> bDoneEntireDocument);
> +
> + bool _findReplaceReverse(UT_uint32* pPrefix,
> bool& bDoneEntireDocument);
> - bool findReplace(const UT_UCSChar* pFind,
> - const UT_UCSChar* pReplace,
> - bool bMatchCase,
> +
> + bool _findReplace(UT_uint32* pPrefix,
> bool& bDoneEntireDocument);
>
> - UT_uint32 findReplaceAll(const UT_UCSChar* pFind,
> - const UT_UCSChar* pReplace,
> - bool bMatchCase);
> +
> + bool findReplace(bool& bDoneEntireDocument);
> +
> + UT_uint32 findReplaceAll();
>
> // ----------------------
>
> @@ -707,9 +721,13 @@
> fl_BlockLayout * _findGetCurrentBlock(void);
> PT_DocPosition _findGetCurrentOffset(void);
> UT_UCSChar *
> _findGetNextBlockBuffer(fl_BlockLayout ** block,
> PT_DocPosition *offset);
> + UT_UCSChar *
> _findGetPrevBlockBuffer(fl_BlockLayout ** block,
> PT_DocPosition *offset);
>
> - bool _m_matchCase;
> - UT_UCSChar * _m_findNextString;
> + bool m_bReverseFind;
> + bool m_bWholeWord;
> + bool m_bMatchCase;
> + UT_UCSChar * m_sFind;
> + UT_UCSChar * m_sReplace;
>
> UT_sint32 _findBlockSearchRegexp(const UT_UCSChar
> * haystack, const
> UT_UCSChar * needle);
>
>
> > Index: abi/src/text/fmt/xp/fv_View.cpp
>
===================================================================
> RCS file: /cvsroot/abi/src/text/fmt/xp/fv_View.cpp,v
> retrieving revision 1.796
> diff -u -r1.796 fv_View.cpp
> --- abi/src/text/fmt/xp/fv_View.cpp 17 May 2003
> 20:15:15 -0000 1.796
> +++ abi/src/text/fmt/xp/fv_View.cpp 26 May 2003
> 12:13:21 -0000
> @@ -159,8 +159,11 @@
> m_pEditShadow(NULL),
> m_iSavedPosition(0),
> m_bNeedSavedPosition(false),
> - _m_matchCase(false),
> - _m_findNextString(0),
> + m_bMatchCase(false),
> + m_bReverseFind(false),
> + m_bWholeWord(false),
> + m_sFind(0),
> + m_sReplace(0),
> m_bShowPara(false),
> m_viewMode(VIEW_PRINT),
> m_previewMode(PREVIEW_NONE),
> @@ -422,7 +425,8 @@
> DELETEP(m_caretListener);
> }
>
> - FREEP(_m_findNextString);
> + FREEP(m_sFind);
> + FREEP(m_sReplace);
>
> FREEP(m_chg.propsChar);
> FREEP(m_chg.propsBlock);
> @@ -1280,6 +1284,10 @@
> return dPos ;
> }
>
> +PT_DocPosition FV_View::mapDocPos( FV_DocPos dp ) {
> + return ( _getDocPos( dp ));
> + }
> +
> PT_DocPosition FV_View::saveSelectedImage (const
> UT_ByteBuf ** pBytes)
> {
> const char * dataId = NULL;
> @@ -4710,16 +4718,28 @@
> \return True if string was found, false otherwise
> */
> bool
> -FV_View::findNext(const UT_UCSChar* pFind, bool
> bMatchCase,
> - bool& bDoneEntireDocument)
> +FV_View::findNext(const UT_UCSChar* pFind, bool&
> bDoneEntireDocument)
> +
> +{
> + findSetFindString(pFind);
> + return findNext(bDoneEntireDocument);
> +}
> +
> +bool
> +FV_View::findNext(bool& bDoneEntireDocument)
> {
> + if ((m_startPosition >=0) && (m_startPosition <2))
> {
> + m_startPosition = 2;
> + setPoint(m_startPosition);
> + }
> +
> if (!isSelectionEmpty())
> {
> _clearSelection();
> }
>
> - UT_uint32* pPrefix = _computeFindPrefix(pFind,
> bMatchCase);
> - bool bRes = _findNext(pFind, pPrefix, bMatchCase,
> bDoneEntireDocument);
> + UT_uint32* pPrefix = _computeFindPrefix(m_sFind);
> + bool bRes = _findNext(pPrefix,
> bDoneEntireDocument);
> FREEP(pPrefix);
>
> if (isSelectionEmpty())
> @@ -4738,6 +4758,39 @@
> }
>
>
> +bool
> +FV_View::findPrev(const UT_UCSChar* pFind, bool&
> bDoneEntireDocument)
> +{
> + findSetFindString(pFind);
> + return findPrev(bDoneEntireDocument);
> +}
> +
> +bool
> +FV_View::findPrev(bool& bDoneEntireDocument)
> +{
> + if (!isSelectionEmpty())
> + {
> + _clearSelection();
> + }
> +
> + UT_uint32* pPrefix = _computeFindPrefix(m_sFind);
> + bool bRes = _findPrev(pPrefix,
> bDoneEntireDocument);
> + FREEP(pPrefix);
> +
> + if (isSelectionEmpty())
> + {
> + _updateInsertionPoint();
> + }
> + else
> + {
> + _ensureInsertionPointOnScreen();
> + _drawSelection();
> + }
> +
> + notifyListeners(AV_CHG_MOTION);
> + return bRes;
> +}
> +
> /*!
> Find operation reset
>
> @@ -4753,24 +4806,91 @@
> }
>
>
> -/*!
> - Set find-next string
> - \param pFind String to find
> - \param bMatchCase True to match case, false to
> ignore case
> - \return True if there was enough memory to clone
> the string
> - This function is used for non-dialog search
> operations.
> -*/
> +
> +void
> +FV_View::findSetFindString(const UT_UCSChar* pFind)
> +{
> + FREEP(m_sFind);
> + UT_UCS4_cloneString(&m_sFind, pFind);
> +}
> +
> +UT_UCSChar *
> +FV_View::findGetFindString(void)
> +{
> + UT_UCSChar * string = NULL;
> + if (m_sFind)
> + {
> + if (UT_UCS4_cloneString(&string, m_sFind))
> + return string;
> + }
> + else
> + {
> + if (UT_UCS4_cloneString_char(&string, ""))
> + return string;
> + }
> +
> + return NULL;
> +}
> +
> +void
> +FV_View::findSetReplaceString(const UT_UCSChar*
> pReplace)
> +{
> + FREEP(m_sReplace);
> + UT_UCS4_cloneString(&m_sReplace, pReplace);
> +}
> +
> +UT_UCSChar *
> +FV_View::findGetReplaceString(void)
> +{
> + UT_UCSChar * string = NULL;
> + if (m_sReplace)
> + {
> + if (UT_UCS4_cloneString(&string, m_sReplace))
> + return string;
> + }
> + else
> + {
> + if (UT_UCS4_cloneString_char(&string, ""))
> + return string;
> + }
> +
> + return NULL;
> +}
> +
> +void
> +FV_View::findSetReverseFind (bool newValue)
> +{
> + m_bReverseFind = newValue;
> +}
> +
> +bool
> +FV_View::findGetReverseFind ()
> +{
>
=== message truncated ===> Index:
abi/src/text/fmt/xp/fv_View_protected.cpp
>
===================================================================
> RCS file:
> /cvsroot/abi/src/text/fmt/xp/fv_View_protected.cpp,v
> retrieving revision 1.91
> diff -u -r1.91 fv_View_protected.cpp
> --- abi/src/text/fmt/xp/fv_View_protected.cpp 21 May
> 2003 07:53:10
> -0000 1.91
> +++ abi/src/text/fmt/xp/fv_View_protected.cpp 26 May
> 2003 12:13:25 -0000
> @@ -31,7 +31,7 @@
> #include "ut_string.h"
> #include "ut_bytebuf.h"
> #include "ut_timer.h"
> -
> +#include "ut_types.h"
> #include "xav_View.h"
> #include "fv_View.h"
> #include "fl_DocLayout.h"
> @@ -2013,16 +2013,16 @@
> \param bMatchCase True to match case, false to
> ignore case
> */
> UT_uint32*
> -FV_View::_computeFindPrefix(const UT_UCSChar*
> pFind, bool bMatchCase)
> +FV_View::_computeFindPrefix(const UT_UCSChar*
> pFind)
> {
> UT_uint32 m = UT_UCS4_strlen(pFind);
> UT_uint32 k = 0, q = 1;
> - UT_uint32 *pPrefix =
> static_cast<UT_uint32*>(UT_calloc(m,
> sizeof(UT_uint32)));
> + UT_uint32 *pPrefix = (UT_uint32*) UT_calloc(m,
> sizeof(UT_uint32));
> UT_ASSERT(pPrefix);
>
> pPrefix[0] = 0; // Must be this regardless of the
> string
>
> - if (bMatchCase)
> + if (m_bMatchCase)
> {
> for (q = 1; q < m; q++)
> {
> @@ -2061,32 +2061,32 @@
> function - it is presently done lot's of places in
> the code.
> */
> bool
> -FV_View::_findNext(const UT_UCSChar* pFind,
> UT_uint32* pPrefix,
> - bool bMatchCase, bool& bDoneEntireDocument)
> +FV_View::_findNext(UT_uint32* pPrefix,
> + bool& bDoneEntireDocument)
> {
> - UT_ASSERT(pFind);
> + UT_ASSERT(m_sFind);
>
> fl_BlockLayout* block = _findGetCurrentBlock();
> PT_DocPosition offset = _findGetCurrentOffset();
> UT_UCSChar* buffer = NULL;
> - UT_uint32 m = UT_UCS4_strlen(pFind);
> + UT_uint32 m = UT_UCS4_strlen(m_sFind);
>
> // Clone the search string, converting it to
> lowercase is search
> // should ignore case.
> - UT_UCSChar* pFindStr =
> static_cast<UT_UCSChar*>(UT_calloc(m,
> sizeof(UT_UCSChar)));
> + UT_UCSChar* pFindStr = (UT_UCSChar*) UT_calloc(m,
> sizeof(UT_UCSChar));
> UT_ASSERT(pFindStr);
> if (!pFindStr)
> return false;
> UT_uint32 j;
> - if (bMatchCase)
> + if (m_bMatchCase)
> {
> for (j = 0; j < m; j++)
> - pFindStr[j] = pFind[j];
> + pFindStr[j] = m_sFind[j];
> }
> else
> {
> for (j = 0; j < m; j++)
> - pFindStr[j] = UT_UCS4_tolower(pFind[j]);
> + pFindStr[j] = UT_UCS4_tolower(m_sFind[j]);
> }
>
> // Now we use the prefix function (stored as an
> array) to search
> @@ -2096,7 +2096,7 @@
> UT_sint32 foundAt = -1;
> UT_uint32 i = 0, t = 0;
>
> - if (bMatchCase)
> + if (m_bMatchCase)
> {
> UT_UCSChar currentChar;
>
> @@ -2113,8 +2113,21 @@
> i++;
> if (t == m)
> {
> - foundAt = i - m;
> - break;
> + if (m_bWholeWord)
> + {
> + bool start =
> UT_isWordDelimiter(buffer[i-m-1], UCS_UNKPUNK,
> UCS_UNKPUNK);
> + bool end = UT_isWordDelimiter(buffer[i],
> UCS_UNKPUNK, UCS_UNKPUNK);
> + if (start && end)
> + {
> + foundAt = i - m;
> + break;
> + }
> + }
> + else
> + {
> + foundAt = i - m;
> + break;
> + }
> }
> }
> }
> @@ -2132,13 +2145,27 @@
>
> while (t > 0 && pFindStr[t] != currentChar)
> t = pPrefix[t-1];
> +
> if (pFindStr[t] == currentChar)
> t++;
> i++;
> if (t == m)
> {
> - foundAt = i - m;
> - break;
> + if (m_bWholeWord)
> + {
> + bool start =
> UT_isWordDelimiter(buffer[i-m-1], UCS_UNKPUNK,
> UCS_UNKPUNK);
> + bool end = UT_isWordDelimiter(buffer[i],
> UCS_UNKPUNK, UCS_UNKPUNK);
> + if (start && end)
> + {
> + foundAt = i - m;
> + break;
> + }
> + }
> + else
> + {
> + foundAt = i - m;
> + break;
> + }
> }
> }
> }
> @@ -2176,7 +2203,218 @@
> return false;
> }
>
> +bool
> +FV_View::_findPrev(UT_uint32* pPrefix,
> + bool& bDoneEntireDocument)
> +{
> + UT_ASSERT(m_sFind);
> +
> + fl_BlockLayout* block = _findGetCurrentBlock();
> + PT_DocPosition offset = _findGetCurrentOffset();
> + UT_UCSChar* buffer = NULL;
> + UT_uint32 m = UT_UCS4_strlen(m_sFind);
> +
> + // Clone the search string, converting it to
> lowercase is search
> + // should ignore case.
> + UT_UCSChar* pFindStr = (UT_UCSChar*) UT_calloc(m,
> sizeof(UT_UCSChar));
> + UT_ASSERT(pFindStr);
> + if (!pFindStr)
> + return false;
> + UT_uint32 j;
> + if (m_bMatchCase)
> + {
> + for (j = 0; j < m; j++)
> + pFindStr[j] = m_sFind[j];
> + }
> + else
> + {
> + for (j = 0; j < m; j++)
> + pFindStr[j] = UT_UCS4_tolower(m_sFind[j]);
> + }
> +
> + // Now we use the prefix function (stored as an
> array) to search
>
=== message truncated ===> Index:
abi/src/text/fmt/xp/fl_DocLayout.h
>
===================================================================
> RCS file:
> /cvsroot/abi/src/text/fmt/xp/fl_DocLayout.h,v
> retrieving revision 1.95
> diff -u -r1.95 fl_DocLayout.h
> --- abi/src/text/fmt/xp/fl_DocLayout.h 3 May 2003
> 12:20:22 -0000 1.95
> +++ abi/src/text/fmt/xp/fl_DocLayout.h 26 May 2003
> 12:13:42 -0000
> @@ -133,6 +133,7 @@
> void setLayoutIsFilling(bool bisFill) {
> m_bisLayoutFilling =
> bisFill;}
> bool isLayoutFilling(void) const { return
> m_bisLayoutFilling;}
> fl_BlockLayout* findBlockAtPosition(PT_DocPosition
> pos) const;
> + fl_BlockLayout*
> findBlockAtPositionReverse(PT_DocPosition pos);
> void deletePage(fp_Page* pPage, bool bDontNotify);
>
> void formatAll();
>
> > Index: abi/src/text/fmt/xp/fl_DocLayout.cpp
>
===================================================================
> RCS file:
> /cvsroot/abi/src/text/fmt/xp/fl_DocLayout.cpp,v
> retrieving revision 1.217
> diff -u -r1.217 fl_DocLayout.cpp
> --- abi/src/text/fmt/xp/fl_DocLayout.cpp 3 May 2003
> 12:20:22 -0000 1.217
> +++ abi/src/text/fmt/xp/fl_DocLayout.cpp 26 May 2003
> 12:13:45 -0000
> @@ -1354,6 +1354,114 @@
> return pBL;
> }
>
> +fl_BlockLayout*
>
FL_DocLayout::findBlockAtPositionReverse(PT_DocPosition
>
> pos)
> +{
> + fl_BlockLayout* pBL = NULL;
> + PL_StruxFmtHandle sfh = 0;
> +
> + PT_DocPosition posBOD;
> + bool bRes;
> +
> + bRes = m_pDoc->getBounds(false, posBOD);
> + UT_ASSERT(bRes);
> + if(m_pDoc->isEndFootnoteAtPos(pos))
> + {
> + xxx_UT_DEBUGMSG(("End footnote found at %d
> \n",pos));
> + pos--;
> + }
> + if(m_pDoc->isFootnoteAtPos(pos))
> + {
> + xxx_UT_DEBUGMSG(("Start footnote found at %d
> \n",pos));
> + pos+=2;
> + }
> + bRes = m_pDoc->getStruxOfTypeFromPosition(m_lid,
> pos, PTX_Block, &sfh);
> + // If block wasn't found at position, try finding
> it to the right,
> + // limited only by the EOD.
> + while(!bRes && (pos > posBOD))
> + {
> + pos--;
> + bRes = m_pDoc->getStruxOfTypeFromPosition(m_lid,
> pos, PTX_Block, &sfh);
> + }
> +
> + if (bRes)
> + {
> + fl_Layout * pL = (fl_Layout *)sfh;
> + if(!pL)
> + return NULL;
> +
> + switch (pL->getType())
> + {
> + case PTX_Block:
> + pBL = static_cast<fl_BlockLayout *>(pL);
> + break;
> +
> + case PTX_Section:
> + default:
> + UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
> + // We asked for a block, and we got a section.
> Bad
> + return NULL;
> + }
> + }
> + else
> + {
> + UT_ASSERT(0);
> + return NULL;
> + }
> +
> + if(pBL->getSectionLayout()->getType() ==
> FL_SECTION_HDRFTR)
> + {
> + fl_HdrFtrShadow * pShadow = NULL;
> + FV_View * pView = getView();
> + if(pView && pView->isHdrFtrEdit())
> + {
> + pShadow = pView->getEditShadow();
> +//
> +// We might actually be in the other HdrFtr is the
> point got here from an
> undo!
> +// Check for this.
> +//
> +
>
if(!pShadow->getHdrFtrSectionLayout()->isPointInHere(pos))
> + {
> + fl_HdrFtrSectionLayout * pHF =
> (fl_HdrFtrSectionLayout *)
> pBL->getSectionLayout();
> + if(pHF->isPointInHere(pos))
> + {
> + pShadow = pHF->getFirstShadow();
> + pView->clearHdrFtrEdit();
> + pView->setHdrFtrEdit(pShadow);
> + pBL = (fl_BlockLayout *)
> pShadow->findBlockAtPosition(pos);
> + return pBL;
> + }
> + // Ok, we're really confused now, point is
> nowhere to be found.
> + // It might be OK if pos-1 is in here,
> though...
> + if
>
(!pShadow->getHdrFtrSectionLayout()->isPointInHere(pos-1))
> + {
> + UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
> + }
> + }
> +
> + }
> + else
> + {
> + pShadow = ((fl_HdrFtrSectionLayout *)
> pBL->getSectionLayout())->getFirstShadow();
> + }
> + fl_BlockLayout * ppBL = NULL;
> + if(pShadow != NULL)
> + ppBL = (fl_BlockLayout *)
> pShadow->findMatchingContainer(pBL);
> + else
> + {
> + if(!isLayoutFilling())
> + {
> + UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
> + }
> + }
> +
> + if(ppBL) {
> + pBL = ppBL;
> + }
> + }
> + UT_ASSERT(pBL);
> + return pBL;
> +}
> +
> void FL_DocLayout::deleteEmptyColumnsAndPages(void)
> {
> fl_DocSectionLayout* pSL = m_pFirstSection;
>
> > Index: abi/src/wp/ap/xp/ap_Dialog_Replace.h
>
===================================================================
> RCS file:
> /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Replace.h,v
> retrieving revision 1.17
> diff -u -r1.17 ap_Dialog_Replace.h
> --- abi/src/wp/ap/xp/ap_Dialog_Replace.h 6 May 2003
> 22:57:48 -0000 1.17
> +++ abi/src/wp/ap/xp/ap_Dialog_Replace.h 26 May 2003
> 12:13:28 -0000
> @@ -57,30 +57,31 @@
> AV_View * getView(void);
> FV_View * getFvView(void);
>
> - bool setFindString(const UT_UCSChar *
> string);
> + void setFindString(const UT_UCSChar *
> string);
> UT_UCSChar * getFindString(void);
>
> - bool setReplaceString(const UT_UCSChar *
> string);
> + void setReplaceString(const UT_UCSChar *
> string);
> UT_UCSChar * getReplaceString(void);
>
> - bool setMatchCase(bool match);
> + void setMatchCase(bool match);
> bool getMatchCase(void);
>
> + void setReverseFind( bool newValue);
> + bool getReverseFind(void);
> +
> + void setWholeWord( bool newValue);
> + bool getWholeWord(void);
> +
> // Action functions... set data using the accessors
> // above and call one of these.
> bool findNext(void);
> + bool findPrev(void);
> + bool findReplaceReverse(void);
> bool findReplace(void);
> bool findReplaceAll(void);
>
> protected:
>
> - // These are the persistent dialog data items,
> - // which are carefully read and set by useStart()
> - // and useEnd(), and not by the accessors.
> - UT_UCSChar * persist_findString;
> - UT_UCSChar * persist_replaceString;
> - bool persist_matchCase;
> -
> // These are the "current use" dialog data items,
> // which are liberally read and set by the
> // accessor methods above. Note that the buffers
> @@ -89,13 +90,6 @@
> FV_View * m_pView;
> UT_UCSChar * m_findString;
> UT_UCSChar * m_replaceString;
> - bool m_matchCase;
> -
> - // These are also "current use" dialog data item,
> - // but they're not user-settable; they are set
> - // on conditions that action functions or other
> - // non-accessor methods are invoked.
> - bool m_didSomething;
>
> // Message boxes for events during search
> XAP_Frame * m_pFrame;
>
> > Index: abi/src/wp/ap/xp/ap_Dialog_Replace.cpp
>
===================================================================
> RCS file:
> /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Replace.cpp,v
> retrieving revision 1.42
> diff -u -r1.42 ap_Dialog_Replace.cpp
> --- abi/src/wp/ap/xp/ap_Dialog_Replace.cpp 6 May
> 2003 22:57:48 -0000 1.42
> +++ abi/src/wp/ap/xp/ap_Dialog_Replace.cpp 26 May
> 2003 12:13:31 -0000
> @@ -40,18 +40,9 @@
>
AP_Dialog_Replace::AP_Dialog_Replace(XAP_DialogFactory
> * pDlgFactory,
> XAP_Dialog_Id id)
> : XAP_Dialog_Modeless(pDlgFactory,id,
> "interface/dialogreplace")
> {
> - persist_findString = NULL;
> - persist_replaceString = NULL;
> - persist_matchCase = true;
> -
> m_pView = NULL;
> m_pFrame = NULL;
>
> - m_findString = NULL;
> - m_replaceString = NULL;
> - m_matchCase = false;
> -
> - m_didSomething = false;
>
> // is this used?
> m_answer = a_VOID;
> @@ -61,13 +52,6 @@
>
> AP_Dialog_Replace::~AP_Dialog_Replace(void)
> {
> - // UT_ASSERT(!m_bInUse);
> -
> - FREEP(m_findString);
> - FREEP(m_replaceString);
> -
> - FREEP(persist_findString);
> - FREEP(persist_replaceString);
>
> // clean up memory
> UT_uint32 i;
> @@ -89,13 +73,12 @@
> {
> UT_DEBUGMSG(("AP_Dialog_Replace::useStart(void)
> I've been called\n"));
>
> - // restore from persistent storage
> - if (persist_findString)
> - UT_UCS4_cloneString(&m_findString,
> persist_findString);
> - if (persist_replaceString)
> - UT_UCS4_cloneString(&m_replaceString,
> persist_replaceString);
> + // restore from view
> + if (getFvView()->findGetFindString())
> + UT_UCS4_cloneString(&m_findString,
> getFvView()->findGetFindString());
>
> - m_matchCase = persist_matchCase;
> + if (getFvView()->findGetReplaceString())
> + UT_UCS4_cloneString(&m_replaceString,
> getFvView()->findGetReplaceString());
>
> }
>
> @@ -104,19 +87,6 @@
>
> UT_DEBUGMSG(("AP_Dialog_Replace::useEnd(void) I've
> been called\n"));
>
> - // persistent dialogs don't destroy this data
> - if (m_didSomething)
> - {
> - FREEP(persist_findString);
> - if (m_findString)
> - UT_UCS4_cloneString(&persist_findString,
> m_findString);
> -
> - FREEP(persist_replaceString);
> - if (m_replaceString)
> - UT_UCS4_cloneString(&persist_replaceString,
> m_replaceString);
> -
> - persist_matchCase = m_matchCase;
> - }
> }
>
> AP_Dialog_Replace::tAnswer
> AP_Dialog_Replace::getAnswer(void) const
> @@ -181,25 +151,26 @@
> return static_cast<FV_View *>(getView());
> }
>
> -bool AP_Dialog_Replace::setFindString(const
> UT_UCSChar * string)
> +void AP_Dialog_Replace::setFindString(const
> UT_UCSChar * string)
> {
> - if (string && m_findString &&
> UT_UCS4_strcmp(string, m_findString) != 0)
> +
> + if (string && getFvView()->findGetFindString() &&
> UT_UCS4_strcmp(string,
> getFvView()->findGetFindString()) != 0)
> {
> // When search parameters change, clear any
> existing selection to
> // avoid replacement of the previous search
> string.
> getFvView()->cmdUnselectSelection();
> }
>
> - FREEP(m_findString);
> - return UT_UCS4_cloneString(&m_findString, string);
> +
> + getFvView()->findSetFindString(string);
> }
>
> UT_UCSChar * AP_Dialog_Replace::getFindString(void)
> {
> UT_UCSChar * string = NULL;
> - if (m_findString)
> + if (getFvView()->findGetFindString())
> {
> - if (UT_UCS4_cloneString(&string, m_findString))
> + if (UT_UCS4_cloneString(&string,
> getFvView()->findGetFindString()))
> return string;
> }
> else
> @@ -210,18 +181,20 @@
> return NULL;
> }
>
> -bool AP_Dialog_Replace::setReplaceString(const
> UT_UCSChar * string)
> +void AP_Dialog_Replace::setReplaceString(const
> UT_UCSChar * string)
> {
> - FREEP(m_replaceString);
> - return UT_UCS4_cloneString(&m_replaceString,
> string);
> +
>
UT_DEBUGMSG(("AP_dlg_replace::setReplaceString()\n"));
> +
> + getFvView()->findSetReplaceString(string);
> }
>
> UT_UCSChar *
> AP_Dialog_Replace::getReplaceString(void)
> {
> UT_UCSChar * string = NULL;
> - if (m_replaceString)
> +
> + if (getFvView()->findGetReplaceString())
> {
> - if (UT_UCS4_cloneString(&string,
> m_replaceString))
> + if (UT_UCS4_cloneString(&string,
> getFvView()->findGetReplaceString()))
> return string;
> }
> else
> @@ -233,9 +206,11 @@
> return NULL;
> }
>
> -bool AP_Dialog_Replace::setMatchCase(bool match)
> +void AP_Dialog_Replace::setMatchCase(bool match)
> {
> - if (match != m_matchCase)
> + UT_DEBUGMSG(("AP_dlg_replace::setMatchCase(%d)\n",
> match));
> +
> + if (match != getFvView()->findGetMatchCase())
> {
> // When search parameters change, clear any
> existing selection to
> // avoid replacement of the previous search
> string.
> @@ -243,39 +218,87 @@
> getFvView()->cmdUnselectSelection();
> }
>
> - m_matchCase = match;
> - return true;
> + getFvView()->findSetMatchCase(match);
> }
>
> bool AP_Dialog_Replace::getMatchCase(void)
> {
> - return m_matchCase;
> + UT_DEBUGMSG(("AP_dlg_replace::getMatchCase()\n"));
> + return getFvView()->findGetMatchCase();
> +}
> +
>
=== message truncated ===> Index:
abi/src/wp/ap/win/ap_Win32Dialog_Replace.cpp
>
===================================================================
> RCS file:
>
/cvsroot/abi/src/wp/ap/win/ap_Win32Dialog_Replace.cpp,v
> retrieving revision 1.23
> diff -u -r1.23 ap_Win32Dialog_Replace.cpp
> --- abi/src/wp/ap/win/ap_Win32Dialog_Replace.cpp 7
> May 2003 07:13:07
> -0000 1.23
> +++ abi/src/wp/ap/win/ap_Win32Dialog_Replace.cpp 26
> May 2003 12:13:34 -0000
> @@ -49,9 +49,6 @@
> XAP_Dialog_Id id)
> : AP_Dialog_Replace(pDlgFactory,id)
> {
> - m_findString = NULL;
> - m_replaceString = NULL;
> - m_matchCase = true;
> m_hWnd = 0;
> }
>
> @@ -74,6 +71,34 @@
> iResult = BringWindowToTop( m_hWnd );
>
> UT_ASSERT((iResult != 0));
> +
> + {
> + UT_UCSChar * bufferUnicode = getFindString();
> + UT_uint32 lenUnicode =
> UT_UCS4_strlen(bufferUnicode);
> + if (lenUnicode)
> + {
> + char * bufferNormal = new char [lenUnicode + 1];
> + UT_UCS4_strcpy_to_char(bufferNormal,
> bufferUnicode);
> +
>
SetDlgItemText(m_hWnd,AP_RID_DIALOG_REPLACE_EDIT_FIND,bufferNormal);
> + DELETEP(bufferNormal);
> + }
> + FREEP(bufferUnicode);
> + }
> +
> + if (m_id == AP_DIALOG_ID_REPLACE)
> + {
> +
> + UT_UCSChar * bufferUnicode = getReplaceString();
> + UT_uint32 lenUnicode =
> UT_UCS4_strlen(bufferUnicode);
> + if (lenUnicode)
> + {
> + char * bufferNormal = new char [lenUnicode + 1];
> + UT_UCS4_strcpy_to_char(bufferNormal,
> bufferUnicode);
> +
>
SetDlgItemText(m_hWnd,AP_RID_DIALOG_REPLACE_EDIT_REPLACE,bufferNormal);
> + DELETEP(bufferNormal);
> + }
> + FREEP(bufferUnicode);
> + }
> }
>
>
> @@ -191,13 +216,24 @@
> BOOL bEnableFind = (lenFind > 0);
>
>
EnableWindow(GetDlgItem(hWnd,AP_RID_DIALOG_REPLACE_BTN_FINDNEXT),bEnableFind);
>
> +
> if (m_id == AP_DIALOG_ID_REPLACE)
> {
> +
> BOOL bEnableReplace = bEnableFind;
>
>
EnableWindow(GetDlgItem(hWnd,AP_RID_DIALOG_REPLACE_BTN_REPLACE),bEnableReplace);
>
>
EnableWindow(GetDlgItem(hWnd,AP_RID_DIALOG_REPLACE_BTN_REPLACEALL),bEnableReplace);
> }
>
> +
>
CheckDlgButton(hWnd,AP_RID_DIALOG_REPLACE_CHECK_MATCHCASE,
> + ((getMatchCase()) ? BST_CHECKED :
> BST_UNCHECKED));
> +
> +
>
CheckDlgButton(hWnd,AP_RID_DIALOG_REPLACE_CHECK_WHOLEWORD,
> + ((getWholeWord()) ? BST_CHECKED :
> BST_UNCHECKED));
> +
> +
>
CheckDlgButton(hWnd,AP_RID_DIALOG_REPLACE_CHECK_REVERSEFIND,
> + ((getReverseFind()) ? BST_CHECKED :
> BST_UNCHECKED));
> +
> return;
> }
>
> @@ -220,31 +256,9 @@
>
> _DSX(REPLACE_BTN_CLOSE, DLG_Cancel);
>
> - {
> - UT_UCSChar * bufferUnicode = getFindString();
> - UT_uint32 lenUnicode =
> UT_UCS4_strlen(bufferUnicode);
> - if (lenUnicode)
> - {
> - char * bufferNormal = new char [lenUnicode + 1];
> - UT_UCS4_strcpy_to_char(bufferNormal,
> bufferUnicode);
> -
>
SetDlgItemText(hWnd,AP_RID_DIALOG_REPLACE_EDIT_FIND,bufferNormal);
> - DELETEP(bufferNormal);
> - }
> - FREEP(bufferUnicode);
> - }
>
> if (m_id == AP_DIALOG_ID_REPLACE)
> {
> - UT_UCSChar * bufferUnicode = getReplaceString();
> - UT_uint32 lenUnicode =
> UT_UCS4_strlen(bufferUnicode);
> - if (lenUnicode)
> - {
> - char * bufferNormal = new char [lenUnicode + 1];
> - UT_UCS4_strcpy_to_char(bufferNormal,
> bufferUnicode);
> -
>
SetDlgItemText(hWnd,AP_RID_DIALOG_REPLACE_EDIT_REPLACE,bufferNormal);
> - DELETEP(bufferNormal);
> - }
> - FREEP(bufferUnicode);
>
> // localize replace-specific controls
> _DS(REPLACE_BTN_REPLACE, DLG_FR_ReplaceButton);
> @@ -252,9 +266,6 @@
> _DS(REPLACE_TEXT_REPLACE,
> DLG_FR_ReplaceWithLabel);
> }
>
> -
>
CheckDlgButton(hWnd,AP_RID_DIALOG_REPLACE_CHECK_MATCHCASE,
> - ((getMatchCase()) ? BST_CHECKED :
> BST_UNCHECKED));
> -
> _initButtons(hWnd);
>
> SetFocus(
> GetDlgItem(hWnd,AP_RID_DIALOG_REPLACE_EDIT_FIND) );
> @@ -287,6 +298,38 @@
>
>
setMatchCase((IsDlgButtonChecked(hWnd,AP_RID_DIALOG_REPLACE_CHECK_MATCHCASE)==BST_CHECKED));
> return 1;
>
> + case AP_RID_DIALOG_REPLACE_CHECK_WHOLEWORD:
> +
>
setWholeWord((IsDlgButtonChecked(hWnd,AP_RID_DIALOG_REPLACE_CHECK_WHOLEWORD)==BST_CHECKED));
> + return 1;
> +
> + case AP_RID_DIALOG_REPLACE_CHECK_REVERSEFIND:
> + {
> + bool currentVal =
>
(IsDlgButtonChecked(hWnd,AP_RID_DIALOG_REPLACE_CHECK_REVERSEFIND)==BST_CHECKED);
> + setReverseFind(currentVal);
> +
> + if (!m_pView->isSelectionEmpty())
> + {
> + // if there's a selection, clear it
> + if (m_pView->getSelectionText() != NULL)
> + {
> + PT_DocPosition pt =
> m_pView->getSelectionAnchor();
> + PT_DocPosition ln = UT_UCS4_strlen
> (m_pView->getSelectionText());
> + if (currentVal)
> + {
> + m_pView->moveInsPtTo(pt);
> + }
> + else
> + {
> + m_pView->moveInsPtTo(pt+ln);
> + }
> + m_pView->cmdUnselectSelection();
> + }
> + }
> +
> + m_pView->findSetStartAtInsPoint();
> +
> + return 1;
> + }
> case AP_RID_DIALOG_REPLACE_BTN_FINDNEXT:
> return _onBtn_FindNext(hWnd);
>
> @@ -328,7 +371,12 @@
> goto FreeMemory;
>
> setFindString(pUCSFind);
> - findNext();
> + if (!getReverseFind()) {
> + findNext();
> + }
> + else {
>
=== message truncated ===> Index:
>
abi/src/wp/ap/win/ap_Win32Resources_DialogReplace.rc2
>
===================================================================
> RCS file:
>
/cvsroot/abi/src/wp/ap/win/ap_Win32Resources_DialogReplace.rc2,v
> retrieving revision 1.7
> diff -u -r1.7 ap_Win32Resources_DialogReplace.rc2
> ---
>
abi/src/wp/ap/win/ap_Win32Resources_DialogReplace.rc2
> 15 Apr 2002
> 17:40:56 -0000 1.7
> +++
>
abi/src/wp/ap/win/ap_Win32Resources_DialogReplace.rc2
> 26 May 2003
> 12:13:36 -0000
> @@ -37,38 +37,48 @@
> #define AP_RID_DIALOG_REPLACE_CHECK_MATCHCASE 1006
> #define AP_RID_DIALOG_REPLACE_TEXT_FIND 1007
> #define AP_RID_DIALOG_REPLACE_TEXT_REPLACE 1008
> +#define AP_RID_DIALOG_REPLACE_CHECK_WHOLEWORD
> 1009
> +#define AP_RID_DIALOG_REPLACE_CHECK_REVERSEFIND
> 1010
>
> #ifdef RC_INVOKED
> // NOTE -- these placeholder strings get overridden
> at runtime
> // NOTE -- they're just here to make sizing easier
>
> -AP_RID_DIALOG_REPLACE DIALOG DISCARDABLE 0, 0,
> 254, 82
> +AP_RID_DIALOG_REPLACE DIALOG DISCARDABLE 0, 0,
> 254, 92
> STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION |
> WS_SYSMENU
> CAPTION "Replace"
> FONT 8, "MS Sans Serif"
> BEGIN
> - LTEXT
> "&Find:", AP_RID_DIALOG_REPLACE_TEXT_FIND,
> 7,7,46,14,SS_CENTERIMAGE
> + LTEXT
> "F&ind:", AP_RID_DIALOG_REPLACE_TEXT_FIND,
> 7,7,46,14,SS_CENTERIMAGE
>
> EDITTEXT AP_RID_DIALOG_REPLACE_EDIT_FIND,
> 55,7,129,14,ES_AUTOHSCROLL
> LTEXT
> "&Replace:", AP_RID_DIALOG_REPLACE_TEXT_REPLACE,
> 7,25,46,14,SS_CENTERIMAGE
>
> EDITTEXT AP_RID_DIALOG_REPLACE_EDIT_REPLACE,
> 55,25,129,14,ES_AUTOHSCROLL
> CONTROL "&Match Case",
> AP_RID_DIALOG_REPLACE_CHECK_MATCHCASE,
> - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,
> 7,52,150,10
> - DEFPUSHBUTTON "Find
> &Next", AP_RID_DIALOG_REPLACE_BTN_FINDNEXT,
> 195,7,55,14
> + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,
> 7,49,150,10
> + CONTROL "&Whole word",
> AP_RID_DIALOG_REPLACE_CHECK_WHOLEWORD,
> + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,
> 7,61,150,10
> + CONTROL "R&everse
> find", AP_RID_DIALOG_REPLACE_CHECK_REVERSEFIND,
> + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,
> 7,73,150,10
> + DEFPUSHBUTTON "&Find",
> AP_RID_DIALOG_REPLACE_BTN_FINDNEXT, 195,7,55,14
>
> PUSHBUTTON "Re&place",
> AP_RID_DIALOG_REPLACE_BTN_REPLACE, 195,25,55,14
> PUSHBUTTON "Replace
> &All", AP_RID_DIALOG_REPLACE_BTN_REPLACEALL,
> 195,43,55,14
> PUSHBUTTON
> "&Close", AP_RID_DIALOG_REPLACE_BTN_CLOSE,
> 195,61,55,14
> END
>
> -AP_RID_DIALOG_FIND DIALOG DISCARDABLE 0, 0, 254,
> 49
> +AP_RID_DIALOG_FIND DIALOG DISCARDABLE 0, 0, 254,
> 70
> STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION |
> WS_SYSMENU
> CAPTION "Find"
> FONT 8, "MS Sans Serif"
> BEGIN
> - LTEXT
> "&Find:", AP_RID_DIALOG_REPLACE_TEXT_FIND,
> 7,7,46,14,SS_CENTERIMAGE
> + LTEXT
> "F&ind:", AP_RID_DIALOG_REPLACE_TEXT_FIND,
> 7,7,46,14,SS_CENTERIMAGE
>
> EDITTEXT AP_RID_DIALOG_REPLACE_EDIT_FIND,
> 55,7,129,14,ES_AUTOHSCROLL
> CONTROL "&Match Case",
> AP_RID_DIALOG_REPLACE_CHECK_MATCHCASE,
> "Button",BS_AUTOCHECKBOX | WS_TABSTOP,
> 7,31,150,10
> - DEFPUSHBUTTON "Find
> &Next", AP_RID_DIALOG_REPLACE_BTN_FINDNEXT,
> 195,7,55,14
> + DEFPUSHBUTTON "&Find",
> AP_RID_DIALOG_REPLACE_BTN_FINDNEXT, 195,7,55,14
> + CONTROL "&Whole word",
> AP_RID_DIALOG_REPLACE_CHECK_WHOLEWORD,
> + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,
> 7,43,150,10
> + CONTROL "R&everse
> find", AP_RID_DIALOG_REPLACE_CHECK_REVERSEFIND,
> + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,
> 7,55,150,10
> PUSHBUTTON
> "&Close", AP_RID_DIALOG_REPLACE_BTN_CLOSE,
> 195,25,55,14
> END
> #endif /* RC_INVOKED */
>
> > Index: abi/src/./../CREDITS.TXT
>
===================================================================
> RCS file: /cvsroot/abi/CREDITS.TXT,v
> retrieving revision 1.215
> diff -u -r1.215 CREDITS.TXT
> --- abi/src/./../CREDITS.TXT 5 May 2003 22:43:45
> -0000 1.215
> +++ abi/src/./../CREDITS.TXT 22 May 2003 09:46:51
> -0000
> @@ -71,6 +71,7 @@
> encoding stuff
> Ryan Dooley <ryan@coe.missouri.edu> started IRIX
> port
> Paul Egli <pegli@sourcegear.com>
> +Dennis Elbers <deje_auto@hotmail.com> Win32
> Find/Replace dialog additions
> Uri Elias <elias@techunix.technion.ac.il> testing
> of bidi
> Mike Fabian <mfabian@suse.de> XIM fix for Gnome.
> Danny Faught <faught@rstcorp.com>
>
>
> ATTACHMENT part 12 image/x-png name=find.png
> ATTACHMENT part 13 image/x-png name=replace.png
> --=[]=--
>
> Changes by DeJe for
> reverse find,
> match whole word and
> editmethods for scripting.
>
> --=[]=--
>
> Since multiple variables were passed from the find
> dialog to the search and
> replace functions in the view, I decided to move
> those variables from the
> dialog to the View.
> Therefore I added multiple functions to set and
> retreive these variables.
> Also by moving these variables function calls have
> been changed because
> these
> variables don't need to be passed anymore.
>
>
-------------------------------------------------------------------------------
> fv_View.h ...\abi\src\text\fmt\xp\
>
-------------------------------------------------------------------------------
> Added funtions:
> UT_UCSChar * findGetFindString (void);
> UT_UCSChar * findGetReplaceString (void);
> bool findGetReverseFind ();
> bool findGetMatchCase ();
> bool findGetWholeWord ();
> bool findSetFindString (const UT_UCSChar* string);
> bool findSetReplaceString (const UT_UCSChar*
> string);
> bool findSetReverseFind (bool newValue);
> bool findSetMatchCase (bool newValue);
> bool findSetWholeWord (bool newValue);
> bool findReplaceReverse (bool&
> bDoneEntireDocument);
> bool _findReplaceReverse (UT_uint32* pPrefix, bool
> & bDoneEntireDocument);
> PT_DocPosition mapDocPos (FV_DocPos dp);
>
> Changed functions:
> //old: UT_uint32* _computeFindPrefix (const
> UT_UCSChar* pFind, bool
> bMatchCase);
> UT_uint32* _computeFindPrefix (const UT_UCSChar*
> pFind);
>
> //old: bool findNext (const UT_UCSChar* pFind,
> bool bMatchCase, bool&
> bDoneEntireDocument);
> bool findNext (bool& bDoneEntireDocument);
> bool findNext (const UT_UCSChar* pFind, bool&
> bDoneEntireDocument);
>
> //old: bool _findNext(const UT_UCSChar* pFind,
> UT_uint32* pPrefix, bool
> bMatchCase, bool& bDoneEntireDocument);
> bool _findNext (UT_uint32* pPrefix, bool &
> bDoneEntireDocument);
>
> //old: bool findPrev(const UT_UCSChar* pFind,
> bool bMatchCase, bool&
> bDoneEntireDocument);
> bool findPrev (bool& bDoneEntireDocument);
> bool findPrev (const UT_UCSChar* pFind, bool&
> bDoneEntireDocument);
>
> //old: bool _findPrev(const UT_UCSChar* pFind,
> UT_uint32* pPrefix, bool
> bMatchCase, bool& bDoneEntireDocument);
> bool _findPrev (UT_uint32* pPrefix, bool&
> bDoneEntireDocument);
>
> //old: bool _findReplace(const UT_UCSChar* pFind,
> const UT_UCSChar*
> pReplace, UT_uint32* pPrefix, bool bMatchCase, bool&
> bDoneEntireDocument);
> bool _findReplace (UT_uint32* pPrefix, bool &
> bDoneEntireDocument);
>
> //old: bool findReplace(const UT_UCSChar* pFind,
> const UT_UCSChar*
> pReplace, bool bMatchCase, bool &
> bDoneEntireDocument);
> bool findReplace (bool& bDoneEntireDocument);
>
> //old: UT_uint32 findReplaceAll(const UT_UCSChar*
> pFind, const
> UT_UCSChar* pReplace, bool bMatchCase);
> UT_uint32 findReplaceAll();
>
> Added and changed variables:
> bool _m_bReverseFind;
> bool _m_bWholeWord;
> bool _m_bMatchCase;
> //removed: UT_UCSChar * _m_findNextString;
> UT_UCSChar * _m_sFind;
> UT_UCSChar * _m_sReplace;
>
>
-------------------------------------------------------------------------------
> fv_View.cpp ...\abi\src\text\fmt\xp\
>
-------------------------------------------------------------------------------
> Constructor:
> //removed: _m_matchCase(false),
> _m_bReverseFind(false),
> _m_bWholeWord(false),
> //removed: _m_findNextString(0),
> _m_sFind(0),
>
> Destructor:
> //removed: FREEP(_m_findNextString);
> FREEP(_m_sFind);
> FREEP(_m_sReplace);
>
>
-------------------------------------------------------------------------------
> fv_View_protected.cpp ...\abi\src\text\fmt\xp\
>
-------------------------------------------------------------------------------
> Changed functions: (see comments on fv_View.h)
> UT_uint32* _computeFindPrefix (const UT_UCSChar*
> pFind)
> bool _findNext (UT_uint32* pPrefix, bool&
> bDoneEntireDocument)
> bool _findPrev (UT_uint32* pPrefix, bool&
> bDoneEntireDocument)
> UT_UCSChar* _findGetPrevBlockBuffer
> (fl_BlockLayout** pBlock,
> PT_DocPosition* pOffset)
> applied same changes as to
> _findGetNextBlockBuffer()
> bool _findReplaceReverse (UT_uint32* pPrefix,
> bool& bDoneEntireDocument)
> bool _findReplace (UT_uint32* pPrefix, bool&
> bDoneEntireDocument)
>
>
-------------------------------------------------------------------------------
> fl_DocLayout.h
>
-------------------------------------------------------------------------------
> Added function:
> fl_BlockLayout*
> findBlockAtPositionReverse(PT_DocPosition pos);
>
>
-------------------------------------------------------------------------------
> fl_DocLayout.cpp
>
-------------------------------------------------------------------------------
> see comments on fl_DocLayout.h.
>
>
-------------------------------------------------------------------------------
> ap_Dialog_Replace.h ...\abi\src\wp\ap\xp\
>
-------------------------------------------------------------------------------
> Added functions:
> bool setReverseFind (bool newValue);
> bool getReverseFind (void);
> bool setWholeWord (bool newValue);
> bool getWholeWord (void);
> bool findPrev (void);
> bool findReplaceReverse (void);
>
> Changed functions:
> bool findNext (void);
>
> Added and changed variables:
> bool persist_reverseFind;
> bool persist_wholeWord;
>
>
-------------------------------------------------------------------------------
> ap_Dialog_Replace.cpp ...\abi\src\wp\ap\xp\
>
-------------------------------------------------------------------------------
> see comments on ap_Dialog_Replace.h.
>
>
-------------------------------------------------------------------------------
> ap_Win32Dialog_Replace.cpp
>
-------------------------------------------------------------------------------
> in _onCommand: added handling of clicking the
> checkboxes for
> match whole word
> reverse find
>
>
-------------------------------------------------------------------------------
> ap_Win32Resources_DialogReplace.rc2
> ...\abi\src\wp\ap\win\
>
-------------------------------------------------------------------------------
> added two checkboxes:
> match whole word
> reverse find
>
>
> --=[]=--
>
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
This archive was generated by hypermail 2.1.4 : Mon May 26 2003 - 16:33:07 EDT