--=[]=-- 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); 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 --=[]=-- ------------------------------------------------------------------------------- ap_EditMethods.cpp ...\abi\src\wp\ap\xp\ ------------------------------------------------------------------------------- Added Editmethods: scriptingFind scriptingFindReverse scriptingReplace scriptingReplaceAll These Editmethods use their CallData as follows: m_pData = (char) string to find m_xPos = match case (0=false, 1=true) m_yPos = whole word (0=false, 1=true) getScriptName = (char) replacement string --=[]=--