-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Since my previous fix for bug 10 aroused some hostility, I have here a new
one. This one divided the logic used in selecting a word, and moving to
the next word, so that the goals of these two operations no longer
conflict. While this patch does not address the larger issues of making
selection work like other word procesors, it does fix the bug at hand. I
think this is likely to be important for people.
sam th
[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE4oMYbt+kM0Mq9M/wRAvG0AJ9LEbnYXd4AcIUPIXxCAGAoP9Hx+gCfd1nM
u0MeEQJLr3AC2ZVHy1JE8SI=
=40k2
-----END PGP SIGNATURE-----
diff -ru -x CVS abi/src/text/fmt/xp/fv_View.cpp abi-mod/src/text/fmt/xp/fv_View.cpp
--- abi/src/text/fmt/xp/fv_View.cpp Tue Feb 1 04:51:30 2000
+++ abi-mod/src/text/fmt/xp/fv_View.cpp Tue Feb 8 16:46:07 2000
@@ -727,7 +727,7 @@
}
break;
- case FV_DOCPOS_EOW:
+ case FV_DOCPOS_EOW_MOVE:
{
UT_GrowBuf pgb(1024);
@@ -769,18 +769,21 @@
UT_Bool bBetween = UT_isWordDelimiter(pSpan[offset]);
// Needed so ctrl-right arrow will work
+ // This is the code that was causing bug 10
+ // There is still some weird behavior that should be
+investigated
+
for (; offset < pgb.getLength(); offset++)
{
- if (!UT_isWordDelimiter(pSpan[offset]))
+ if (!UT_isWordDelimiter(pSpan[offset]))
break;
}
for (; offset < pgb.getLength(); offset++)
{
if (!UT_isWordDelimiter(pSpan[offset]))
- {
- if (bBetween)
- break;
+ {
+ if (bBetween)
+ break;
}
else if (pSpan[offset] != ' ')
break;
@@ -788,10 +791,79 @@
bBetween = UT_TRUE;
}
- iPos = offset + pBlock->getPosition();
+ iPos = offset + pBlock->getPosition();
+ }
+ break;
+
+ case FV_DOCPOS_EOW_SELECT:
+ {
+ UT_GrowBuf pgb(1024);
+
+ UT_Bool bRes = pBlock->getBlockBuf(&pgb);
+ UT_ASSERT(bRes);
+
+ const UT_UCSChar* pSpan = pgb.getPointer(0);
+
+ UT_ASSERT(iPos >= pBlock->getPosition());
+ UT_uint32 offset = iPos - pBlock->getPosition();
+ UT_ASSERT(offset <= pgb.getLength());
+
+ if (offset == pgb.getLength())
+ {
+ if (!bKeepLooking)
+ break;
+
+ // is there a next block?
+ pBlock = pBlock->getNextBlockInDocument();
+
+ if (!pBlock)
+ break;
+
+ // yep. look there instead
+ pgb.truncate(0);
+ bRes = pBlock->getBlockBuf(&pgb);
+ UT_ASSERT(bRes);
+
+ pSpan = pgb.getPointer(0);
+ offset = 0;
+
+ if (pgb.getLength() == 0)
+ {
+ iPos = pBlock->getPosition();
+ break;
+ }
+ }
+
+ UT_Bool bBetween = UT_isWordDelimiter(pSpan[offset]);
+
+ // Needed so ctrl-right arrow will work
+ // This is the code that was causing bug 10
+ // There is still some weird behavior that should be
+investigated
+ /*
+ for (; offset < pgb.getLength(); offset++)
+ {
+ if (!UT_isWordDelimiter(pSpan[offset]))
+ break;
+ }
+ */
+ for (; offset < pgb.getLength(); offset++)
+ {
+ if (UT_isWordDelimiter(pSpan[offset]))
+ {
+ if (bBetween)
+ break;
+ }
+ else if (pSpan[offset] == ' ')
+ break;
+ else
+ bBetween = UT_TRUE;
+ }
+
+ iPos = offset + pBlock->getPosition();
}
break;
+
case FV_DOCPOS_BOP:
{
fp_Container* pContainer = pLine->getContainer();
@@ -2439,7 +2511,7 @@
PT_DocPosition iNewPointWord;
if (iNewPoint > m_iSelectionAnchor)
- iNewPointWord = _getDocPosFromPoint(iNewPoint,FV_DOCPOS_EOW,UT_FALSE);
+ iNewPointWord =
+_getDocPosFromPoint(iNewPoint,FV_DOCPOS_EOW_SELECT,UT_FALSE);
else
iNewPointWord = _getDocPosFromPoint(iNewPoint,FV_DOCPOS_BOW,UT_FALSE);
diff -ru -x CVS abi/src/text/fmt/xp/fv_View.h abi-mod/src/text/fmt/xp/fv_View.h
--- abi/src/text/fmt/xp/fv_View.h Tue Feb 1 04:51:30 2000
+++ abi-mod/src/text/fmt/xp/fv_View.h Tue Feb 8 15:57:36 2000
@@ -61,7 +61,7 @@
FV_DOCPOS_BOP, FV_DOCPOS_EOP, // page
FV_DOCPOS_BOL, FV_DOCPOS_EOL, // line
FV_DOCPOS_BOS, FV_DOCPOS_EOS, // sentence
- FV_DOCPOS_BOW, FV_DOCPOS_EOW // word
+ FV_DOCPOS_BOW, FV_DOCPOS_EOW_MOVE, FV_DOCPOS_EOW_SELECT // word
} FV_DocPos;
typedef enum _FVJumpTarget
diff -ru -x CVS abi/src/wp/ap/xp/ap_EditMethods.cpp
abi-mod/src/wp/ap/xp/ap_EditMethods.cpp
--- abi/src/wp/ap/xp/ap_EditMethods.cpp Tue Feb 8 10:48:51 2000
+++ abi-mod/src/wp/ap/xp/ap_EditMethods.cpp Tue Feb 8 16:01:25 2000
@@ -1933,7 +1933,7 @@
Defun1(warpInsPtEOW)
{
ABIWORD_VIEW;
- pView->moveInsPtTo(FV_DOCPOS_EOW);
+ pView->moveInsPtTo(FV_DOCPOS_EOW_MOVE);
return UT_TRUE;
}
@@ -2239,7 +2239,7 @@
Defun1(extSelEOW)
{
ABIWORD_VIEW;
- pView->extSelTo(FV_DOCPOS_EOW);
+ pView->extSelTo(FV_DOCPOS_EOW_SELECT);
return UT_TRUE;
}
@@ -2315,7 +2315,7 @@
Defun(selectWord)
{
ABIWORD_VIEW;
- pView->cmdSelect(pCallData->m_xPos, pCallData->m_yPos, FV_DOCPOS_BOW,
FV_DOCPOS_EOW);
+ pView->cmdSelect(pCallData->m_xPos, pCallData->m_yPos, FV_DOCPOS_BOW,
+FV_DOCPOS_EOW_SELECT);
return UT_TRUE;
}
@@ -2371,7 +2371,7 @@
Defun1(delEOW)
{
ABIWORD_VIEW;
- pView->delTo(FV_DOCPOS_EOW);
+ pView->delTo(FV_DOCPOS_EOW_SELECT);
return UT_TRUE;
}