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?

--
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]

Reply via email to