Hi Frank,
Giuseppe Castagno wrote:
Hi Frank,
Frank Meies wrote:
Hi Giuseppe,
On 06/05/07 14:25, Giuseppe Castagno wrote:
Frank Meies - Sun Germany - Development - Software Engineer wrote:
in order to fix this issue I guess you have to set the current
cursor position in SwFEShell::InsertLabel() to the end of the
paragraph containing the label text and avoid the call of
SelectFlyFrm(). This should be done depending on a new parameter
which has to be added to the function signature.
that's what I have in mind.
When the program flow is from AutoCaption, instead of selecting the
frame containing the object, go to the end of the only paragraph
inside it.
My problem is this is the first time I look into the guts of Writer
core code, and I have no idea what is the correct way to set the
visual cursor at the end of a paragraph, having available the
internal text node.
Any hint where to look for a similar code sequence? Or more simply
the method(s) that can be used from SwFEShell class to position the
visual cursor. Then with LXR and doxygen I'll look into it myself.
You can try to call the GotoFly() function instead of the
SelectFlyFrm() function. The third parameter should be set to FALSE in
order to set the cursor into the frame. After this a MovePara(
fnParaCurr, fnParaEnd ) call on the pCurrCrsr sets the current cursor
to the end of the caption. It might be necessary to call ShowCrsr()
afterwards.
Hope this helps,
very helpful, thanks !
The chunk of code I added looks as:
Index: sw/source/core/frmedt/fews.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/frmedt/fews.cxx,v
retrieving revision 1.43
diff -u -p --unified -r1.43 fews.cxx
--- sw/source/core/frmedt/fews.cxx 26 Apr 2007 08:30:18 -0000
1.43
+++ sw/source/core/frmedt/fews.cxx 7 Jun 2007 18:07:23 -0000
@@ -622,7 +622,12 @@ void SwFEShell::InsertLabel( const SwLab
SwFlyFrm* pFrm;
const Point aPt( GetCrsrDocPos() );
if( pFlyFmt && 0 != ( pFrm = pFlyFmt->GetFrm( &aPt )))
- SelectFlyFrm( *pFrm, TRUE );
+ {
+// SelectFlyFrm( *pFrm, TRUE );
+ GotoFly(pFlyFmt->GetName(), FLYCNTTYPE_ALL, FALSE);
+ MovePara( fnParaCurr, fnParaEnd );
+ ShowCrsr();
+ }
EndAllActionAndCall();
}
But now, even though the cursor is visible and movable, it's not
possible to write characters at the new cursor position, whereas it's
possible to delete the existent chars (through backspace or del keys).
Is there any functionality I still need to enable?
Through the week-end I did some more test and I found that the problem
seems depending from some kind of difference between 'model' and
'visual' cursor (well, the OOo API dev guide cursor terminology seems to
apply...)
When I tried OOo patched as above, it was ok using the backspace,
delete and arrow keys (they worked in the caption area), whereas when I
tried to paste a chunk of text previously copied from the same document
under test, it was pasted in another area, as if it where using a
different cursor (most of the time the text was pasted at the start of
first paragraph of the document used for testing, but not always...).
May be I'm missing some step to synchronize the 'visual' and the 'model'
cursor?
Or is it just my usual nonsense :-)?
I forgot to mention that I work on a Debian Etch system, but I don't
think this is important ATM.
--
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]