[Libreoffice-commits] .: 2 commits - basctl/inc basctl/sdi basctl/source basctl/uiconfig officecfg/registry sfx2/inc sfx2/sdi starmath/inc starmath/source

Noel Power noelp at kemper.freedesktop.org
Wed Nov 16 06:56:00 PST 2011


 basctl/inc/basidesh.hrc                                               |    6 
 basctl/sdi/baside.sdi                                                 |    6 
 basctl/source/basicide/basides1.cxx                                   |   30 +++
 basctl/source/basicide/basidesh.src                                   |    4 
 basctl/source/basicide/moduldl2.cxx                                   |   35 +++
 basctl/source/basicide/moduldlg.hxx                                   |   12 +
 basctl/source/basicide/moduldlg.src                                   |   38 ++++
 basctl/uiconfig/basicide/menubar/menubar.xml                          |    1 
 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu        |    5 
 officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu |    5 
 sfx2/inc/sfx2/sfxsids.hrc                                             |    3 
 sfx2/sdi/sfx.sdi                                                      |   24 ++
 starmath/inc/caret.hxx                                                |    2 
 starmath/inc/cursor.hxx                                               |    5 
 starmath/inc/node.hxx                                                 |    7 
 starmath/source/cursor.cxx                                            |   89 ++++++++++
 starmath/source/node.cxx                                              |   15 +
 starmath/source/view.cxx                                              |    8 
 18 files changed, 290 insertions(+), 5 deletions(-)

New commits:
commit 73d3c9504a479e62126d1e7a1766173370603aa1
Author: Noel Power <noel.power at novell.com>
Date:   Wed Nov 16 14:53:38 2011 +0000

    add new 'Goto Line' menu item to Basic IDE

diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index f3a1e64..9e5ccb2 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -169,6 +169,12 @@
 #define RID_STR_NORMAL_MODULES          ( RID_BASICIDE_START + 120 )
 #define RID_STR_CLASS_MODULES           ( RID_BASICIDE_START + 121 )
 
+
+#define RID_DLG_GOTOLINE                ( RID_BASICIDE_START + 122 )
+#define RID_FT_LINE                     ( RID_BASICIDE_START + 123 )
+#define RID_ED_LINE                     ( RID_BASICIDE_START + 124 )
+#define RID_STR_GETLINE                 ( RID_BASICIDE_START + 125 )
+
 #endif  // _SVX_NOIDERESIDS
 
 #endif  // _BASIDESH_HRC
diff --git a/basctl/sdi/baside.sdi b/basctl/sdi/baside.sdi
index f40e239..37b2f08 100644
--- a/basctl/sdi/baside.sdi
+++ b/basctl/sdi/baside.sdi
@@ -116,6 +116,12 @@ shell BasicIDEShell
         StateMethod = GetState;
     ]
 
+    SID_GOTOLINE
+    [
+        ExecMethod  = ExecuteCurrent;
+        StateMethod = GetState;
+    ]
+
     FID_SEARCH_NOW
     [
         ExecMethod  = ExecuteCurrent;
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 6a5cd13..234fad7 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -34,6 +34,7 @@
 #include <basic/sbx.hxx>
 #define _SVSTDARR_STRINGS
 #include <svl/svstdarr.hxx>
+#include <svl/visitem.hxx>
 #include <ide_pch.hxx>
 
 #define _SOLAR__PRIVATE 1
@@ -57,6 +58,7 @@
 #include <managelang.hxx>
 #include <localizationmgr.hxx>
 #include <helpid.hrc>
+#include <moduldlg.hxx>
 
 #include <svtools/texteng.hxx>
 #include <svtools/textview.hxx>
@@ -251,6 +253,22 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
             }
         }
         break;
+        case SID_GOTOLINE:
+        {
+            if ( pCurWin && pCurWin->IsA( TYPE( ModulWindow ) ) )
+            {
+                std::auto_ptr< GotoLineDialog > xGotoDlg( new GotoLineDialog( pCurWin ) );
+                if ( xGotoDlg->Execute() )
+                {
+                    rtl::OUString sText =  xGotoDlg->GetText();
+
+                    sal_Int32 nLine = xGotoDlg->GetLineNumber();
+
+                    if ( nLine )
+                        ((ModulWindow*)pCurWin)->GetEditView()->SetSelection( TextSelection( TextPaM( nLine - 1 , 0 ), TextPaM( nLine - 1, 0 ) ) );
+                }
+            }
+        }
         default:
         {
             pCurWin->ExecuteCommand( rReq );
@@ -1017,6 +1035,18 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
                     rSet.DisableItem( nWh );
             }
             break;
+            case SID_GOTOLINE:
+            {
+                // if this is not a module window hide the
+                // setting, doesn't make sense for example if the
+                // dialog editor is open
+                if( pCurWin && !pCurWin->IsA( TYPE( ModulWindow ) ) )
+                {
+                    rSet.DisableItem( nWh );
+                    rSet.Put(SfxVisibilityItem(nWh, sal_False));
+                }
+                break;
+            }
         }
     }
     if ( pCurWin )
diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src
index 368bad4..c0ca7b4 100644
--- a/basctl/source/basicide/basidesh.src
+++ b/basctl/source/basicide/basidesh.src
@@ -615,6 +615,10 @@ String RID_STR_DLGIMP_MISMATCH_TEXT
     Text [ en-US ] = "The dialog to be imported supports other languages than the target library.\n\nAdd these languages to the library to keep additional language resources provided by the dialog or omit them to stay with the current library languages.\n\nNote: For languages not supported by the dialog the resources of the dialog's default language will be used.\n " ;
 };
 
+String RID_STR_GETLINE
+{
+    Text [ en-US ] = "Goto Line";
+};
 
 #define MN_EDIT       20
 #define MN_VIEW 21
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 81413a8..0e5b380 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -439,6 +439,41 @@ NewObjectDialog::~NewObjectDialog()
 {
 }
 
+
+//----------------------------------------------------------------------------
+// GotoLineDialog
+//----------------------------------------------------------------------------
+
+GotoLineDialog::GotoLineDialog(Window * pParent )
+    : ModalDialog( pParent, IDEResId( RID_DLG_GOTOLINE ) ),
+        aText( this, IDEResId( RID_FT_LINE ) ),
+        aEdit( this, IDEResId( RID_ED_LINE ) ),
+        aOKButton( this, IDEResId( RID_PB_OK ) ),
+        aCancelButton( this, IDEResId( RID_PB_CANCEL ) )
+{
+    FreeResource();
+    aEdit.GrabFocus();
+
+    SetText( String( IDEResId( RID_STR_GETLINE ) ) );
+    aOKButton.SetClickHdl(LINK(this, GotoLineDialog, OkButtonHandler));
+
+}
+
+sal_Int32 GotoLineDialog::GetLineNumber()
+{
+    return rtl::OUString( aEdit.GetText() ).toInt32();
+}
+
+IMPL_LINK(GotoLineDialog, OkButtonHandler, Button *, EMPTYARG)
+{
+    if ( GetLineNumber() )
+        EndDialog(1);
+    else
+        aEdit.SetText( aEdit.GetText(), Selection(0, aEdit.GetText().Len() ));
+    return 0;
+}
+
+
 //----------------------------------------------------------------------------
 // ExportDialog
 //----------------------------------------------------------------------------
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index b75e88a..f61f64c 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -70,6 +70,18 @@ public:
     void        SetObjectName( const String& rName ) { aEdit.SetText( rName ); aEdit.SetSelection( Selection( 0, rName.Len() ) );}
 };
 
+class GotoLineDialog : public ModalDialog
+{
+    FixedText       aText;
+    Edit            aEdit;
+    OKButton        aOKButton;
+    CancelButton    aCancelButton;
+    DECL_LINK(OkButtonHandler, Button *);
+public:
+    GotoLineDialog( Window * pParent );
+    sal_Int32   GetLineNumber();
+};
+
 class ExportDialog : public ModalDialog
 {
 private:
diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src
index e2e6690..fa80b0f 100644
--- a/basctl/source/basicide/moduldlg.src
+++ b/basctl/source/basicide/moduldlg.src
@@ -331,6 +331,44 @@ ModalDialog RID_DLG_LIBS
         Text [ en-US ] = "Replace existing libraries" ;
     };
 };
+
+ModalDialog RID_DLG_GOTOLINE
+{
+    HelpID = "basctl:ModalDialog:RID_DLG_GOTOLINE";
+    OutputSize = TRUE ;
+    SVLook = TRUE ;
+    Size = MAP_APPFONT ( 160 , 55 ) ;
+    Moveable = TRUE ;
+    Closeable = TRUE ;
+    OKButton RID_PB_OK
+    {
+        Pos = MAP_APPFONT ( 104 , 6 ) ;
+        Size = MAP_APPFONT ( 50 , 14 ) ;
+        TabStop = TRUE ;
+        DefButton = TRUE ;
+    };
+    CancelButton RID_PB_CANCEL
+    {
+        Pos = MAP_APPFONT ( 104 , 23 ) ;
+        Size = MAP_APPFONT ( 50 , 14 ) ;
+        TabStop = TRUE ;
+    };
+    FixedText RID_FT_LINE
+    {
+        Pos = MAP_APPFONT ( 6 , 6 ) ;
+        Size = MAP_APPFONT ( 96 , 10 ) ;
+        Text [ en-US ] = "~Line Number:" ;
+    };
+    Edit RID_ED_LINE
+    {
+        HelpID = "basctl:Edit:RID_DLG_GOTOLINE:RID_ED_LINE";
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 6 , 19 ) ;
+        Size = MAP_APPFONT ( 62 , 12 ) ;
+        TabStop = TRUE ;
+    };
+};
+
 ModalDialog RID_DLG_NEWLIB
 {
     HelpID = "basctl:ModalDialog:RID_DLG_NEWLIB";
diff --git a/basctl/uiconfig/basicide/menubar/menubar.xml b/basctl/uiconfig/basicide/menubar/menubar.xml
index 4583ca2..d9174bf 100644
--- a/basctl/uiconfig/basicide/menubar/menubar.xml
+++ b/basctl/uiconfig/basicide/menubar/menubar.xml
@@ -48,6 +48,7 @@
             <menu:menuitem menu:id=".uno:AvailableToolbars"/>
             <menu:menuitem menu:id=".uno:StatusBarVisible"/>
             <menu:menuitem menu:id=".uno:ShowImeStatusWindow"/>
+            <menu:menuitem menu:id=".uno:GotoLine"/>
             <menu:menuseparator/>
             <menu:menuitem menu:id=".uno:FullScreen"/>
         </menu:menupopup>
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index fc6edaf..507cf5c 100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -198,6 +198,11 @@
       <value xml:lang="en-US">.uno:ToggleBreakPointEnabled</value>
      </prop>
     </node>
+    <node oor:name="L_MOD1" oor:op="replace">
+     <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+      <value xml:lang="en-US">.uno:GotoLine</value>
+     </prop>
+    </node>
    </node>
    <node oor:name="com.sun.star.frame.StartModule" oor:op="replace">
     <node oor:name="A_MOD1" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu
index 6750028..e512d3c 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu
@@ -3,6 +3,11 @@
 <oor:component-data oor:name="BasicIDECommands" oor:package="org.openoffice.Office.UI" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <node oor:name="UserInterface">
         <node oor:name="Commands">
+             <node oor:name=".uno:GotoLine" oor:op="replace">
+                 <prop oor:name="Label" oor:type="xs:string">
+                     <value xml:lang="en-US">Goto Line Number...</value>
+                 </prop>
+            </node>
         </node>
         <node oor:name="Popups">
         </node>
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index baf4b56..568b21b 100755
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -314,7 +314,8 @@
 #define SID_SUGGESTEDSAVEASNAME             (SID_SFX_START + 1721)
 #define SID_ENCRYPTIONDATA                  (SID_SFX_START + 1722)
 #define SID_PASSWORDINTERACTION             (SID_SFX_START + 1723)
-#define SID_SFX_free_START                  (SID_SFX_START + 1724)
+#define SID_GOTOLINE                        (SID_SFX_START + 1724)
+#define SID_SFX_free_START                  (SID_SFX_START + 1725)
 #define SID_SFX_free_END                    (SID_SFX_START + 3999)
 
 #define SID_OPEN_NEW_VIEW                   (SID_SFX_START + 520)
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index b5b432f..b73f17a 100755
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3619,6 +3619,30 @@ SfxVoidItem RunMacro SID_RUNMACRO
     GroupId = GID_MACRO;
 ]
 
+SfxVoidItem GotoLine SID_GOTOLINE
+
+[
+    /* flags: */
+    AutoUpdate = TRUE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = TRUE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    /* config: */
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_MACRO;
+]
+
 //--------------------------------------------------------------------------
 SfxVoidItem MacroDialog SID_BASICCHOOSER
 ()
commit 20dde3737f250ab48b80a28c9c03d348e486dd8b
Author: Daisuke Nishino <niboshi000 at gmail.com>
Date:   Tue Nov 15 19:42:35 2011 +0900

    Move cursor to the right of brace when the closing brace is typed.

diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index cec8bd7..76e2527 100644
--- a/starmath/inc/caret.hxx
+++ b/starmath/inc/caret.hxx
@@ -50,7 +50,7 @@ struct SmCaretPos{
     //TODO: Consider forgetting about the todo above... As it's really unpleasent.
     int Index;
     /** True, if this is a valid caret position */
-    bool IsValid() { return pSelectedNode != NULL; }
+    bool IsValid() const { return pSelectedNode != NULL; }
     bool operator!=(SmCaretPos pos) const {
         return pos.pSelectedNode != pSelectedNode || Index != pos.Index;
     }
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 6b6e716..dcfea88 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -118,7 +118,7 @@ public:
     SmCaretPos GetAnchor(){ return anchor->CaretPos; }
 
     /** Get position */
-    SmCaretPos GetPosition() { return position->CaretPos; }
+    SmCaretPos GetPosition() const { return position->CaretPos; }
 
     /** True, if the cursor has a selection */
     bool HasSelection() { return anchor != position; }
@@ -236,6 +236,9 @@ public:
     /** Draw the caret */
     void Draw(OutputDevice& pDev, Point Offset, bool isCaretVisible);
 
+    bool IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBraceNode = NULL) const;
+    void MoveAfterBracket(SmBraceNode* pBraceNode, bool bMoveAnchor = true);
+
 private:
     friend class SmDocShell;
 
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 07aca32..1ecde44 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -119,13 +119,13 @@ public:
     virtual SmNode *    GetSubNode(sal_uInt16 nIndex);
             const SmNode * GetSubNode(sal_uInt16 nIndex) const
             {
-                return ((SmNode *) this)->GetSubNode(nIndex);
+                return const_cast<SmNode *>(this)->GetSubNode(nIndex);
             }
 
     virtual SmNode *       GetLeftMost();
             const SmNode * GetLeftMost() const
             {
-                return ((SmNode *) this)->GetLeftMost();
+                return const_cast<SmNode *>(this)->GetLeftMost();
             }
 
             sal_uInt16 &    Flags() { return nFlags; }
@@ -149,6 +149,8 @@ public:
     virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
     virtual void PrepareAttributes();
 
+    sal_uInt16 FindIndex() const;
+
 #if OSL_DEBUG_LEVEL
             void ToggleDebug() const;
 #endif
@@ -206,6 +208,7 @@ public:
 
     /** Get the parent node of this node */
     SmStructureNode* GetParent(){ return aParentNode; }
+    const SmStructureNode* GetParent() const { return aParentNode; }
     /** Set the parent node */
     void SetParent(SmStructureNode* parent){
         aParentNode = parent;
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 5d92d44..ab4094a 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1474,6 +1474,95 @@ void SmCursor::RequestRepaint(){
     }
 }
 
+bool SmCursor::IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBraceNode) const {
+    const SmCaretPos pos = GetPosition();
+    if (!pos.IsValid()) {
+        return false;
+    }
+
+    SmNode* pNode = pos.pSelectedNode;
+
+    if (pNode->GetType() == NTEXT) {
+        SmTextNode* pTextNode = static_cast<SmTextNode*>(pNode);
+        if (pos.Index < pTextNode->GetText().Len()) {
+            // The cursor is on a text node and at the middle of it.
+            return false;
+        }
+    } else {
+        if (pos.Index < 1) {
+            return false;
+        }
+    }
+
+    while (true) {
+        SmStructureNode* pParentNode = pNode->GetParent();
+        if (!pParentNode) {
+            // There's no brace body node in the ancestors.
+            return false;
+        }
+
+        sal_uInt16 index = pNode->FindIndex();
+        if (index + 1 != pParentNode->GetNumSubNodes()) {
+            // The cursor is not at the tail at one of ancestor nodes.
+            return false;
+        }
+
+        pNode = pParentNode;
+        if (pNode->GetType() == NBRACEBODY) {
+            // Found the brace body node.
+            break;
+        }
+    }
+
+    SmStructureNode* pBraceNodeTmp = pNode->GetParent();
+    if (!pBraceNodeTmp || pBraceNodeTmp->GetType() != NBRACE) {
+        // Brace node is invalid.
+        return false;
+    }
+
+    SmBraceNode* pBraceNode = static_cast<SmBraceNode*>(pBraceNodeTmp);
+    SmMathSymbolNode* pClosingNode = pBraceNode->ClosingBrace();
+    if (!pClosingNode) {
+        // Couldn't get closing symbol node.
+        return false;
+    }
+
+    // Check if the closing brace matches eBracketType.
+    SmTokenType eClosingTokenType = pClosingNode->GetToken().eType;
+    switch (eBracketType) {
+    case NoneBrackets:         if (eClosingTokenType != TNONE)      { return false; } break;
+    case RoundBrackets:        if (eClosingTokenType != TRPARENT)   { return false; } break;
+    case SquareBrackets:       if (eClosingTokenType != TRBRACKET)  { return false; } break;
+    case DoubleSquareBrackets: if (eClosingTokenType != TRDBRACKET) { return false; } break;
+    case LineBrackets:         if (eClosingTokenType != TRLINE)     { return false; } break;
+    case DoubleLineBrackets:   if (eClosingTokenType != TRDLINE)    { return false; } break;
+    case CurlyBrackets:        if (eClosingTokenType != TRBRACE)    { return false; } break;
+    case AngleBrackets:        if (eClosingTokenType != TRANGLE)    { return false; } break;
+    case CeilBrackets:         if (eClosingTokenType != TRCEIL)     { return false; } break;
+    case FloorBrackets:        if (eClosingTokenType != TRFLOOR)    { return false; } break;
+    default:
+        return false;
+    }
+
+    if (ppBraceNode) {
+        *ppBraceNode = static_cast<SmBraceNode*>(pBraceNode);
+    }
+
+    return true;
+}
+
+void SmCursor::MoveAfterBracket(SmBraceNode* pBraceNode, bool bMoveAnchor)
+{
+    position->CaretPos.pSelectedNode = pBraceNode;
+    position->CaretPos.Index = 1;
+    if (bMoveAnchor) {
+        anchor->CaretPos.pSelectedNode = pBraceNode;
+        anchor->CaretPos.Index = 1;
+    }
+    RequestRepaint();
+}
+
+
 /////////////////////////////////////// SmNodeListParser ///////////////////////////////////////
 
 SmNode* SmNodeListParser::Parse(SmNodeList* list, bool bDeleteErrorNodes){
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 93dbedf..29ed283 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -381,6 +381,21 @@ void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
             pNode->Prepare(rFormat, rDocShell);
 }
 
+sal_uInt16 SmNode::FindIndex() const
+{
+    const SmStructureNode* pParent = GetParent();
+    if (!pParent) { return 0; }
+
+    for (sal_uInt16 i = 0; i < pParent->GetNumSubNodes(); ++i) {
+        if (pParent->GetSubNode(i) == this) {
+            return i;
+        }
+    }
+
+    DBG_ASSERT(false, "Connection between parent and child is inconsistent.");
+    return 0;
+}
+
 
 #if OSL_DEBUG_LEVEL > 1
 void  SmNode::ToggleDebug() const
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 0dec05a..a77a32a 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -504,6 +504,8 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt)
         default:
         {
             sal_Unicode code = rKEvt.GetCharCode();
+            SmBraceNode* pBraceNode = NULL;
+
             if(code == ' ') {
                 rCursor.InsertElement(BlankElement);
             }else if(code == 'c' && rKEvt.GetKeyCode().IsMod1()) {
@@ -524,6 +526,12 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt)
                 rCursor.InsertElement(FactorialElement);
             }else if(code == '%') {
                 rCursor.InsertElement(PercentElement);
+            }else if(code == ')' && rCursor.IsAtTailOfBracket(RoundBrackets, &pBraceNode)) {
+                rCursor.MoveAfterBracket(pBraceNode);
+            }else if(code == ']' && rCursor.IsAtTailOfBracket(SquareBrackets, &pBraceNode)) {
+                rCursor.MoveAfterBracket(pBraceNode);
+            }else if(code == '}' && rCursor.IsAtTailOfBracket(CurlyBrackets, &pBraceNode)) {
+                rCursor.MoveAfterBracket(pBraceNode);
             }else{
                 if(code != 0){
                     rCursor.InsertText(code);


More information about the Libreoffice-commits mailing list