Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Ok, I've adjusted the patch to include the fix you provided
(thanks!!). I only have two more stumbling blocks at this point.
First, I don't have a account to commit with; would you mind creating
a branch for this in the meantime? Also, is there a consensus on how
the option to hide/display line numbers should be added? Currently I'm
trying to add a page to the options dialog in cui but I suppose it
will really only have one option for now, is that ok?

August Sodora
augsod@gmail.com
(201) 280-8138



On Fri, Nov 11, 2011 at 12:01 PM, Noel Power <nopower@suse.com> wrote:
On 11/11/11 16:50, Noel Power wrote:

On 11/11/11 16:30, August Sodora wrote:
I'd love to but I'm not exactly sure how. Currently I have it as a local
branch.

haha, yes, well not being much of a git guru myself I can't recall offhand
what the command are for that, let me try and find out what they are and get
back to you. Anyway, no problem with it being a local branch for the moment

thanks,
Noel

see below for some steps that kendy sent to the list at some stage, note the
instructions are based on the old multi-repo setup so I guess one just needs
to substitute 'git' for 'g' in the instructions below

So the example workflow might look like the following:

# create the branch locally
g checkout -b mybranch
# develop something
...
g commit -a
...
g commit

# find out that it might be useful as a feature branch
g -f push origin mybranch:feature/some-comprehensible-name
# continue development and pushing
...
g commit -a
g push
# hmm, a conflict, somebody pushed to our
# feature/some-comprehensible-name branch, we want to get newest stuff
# from there.  In this case, we want the 'rebasing' pull.
g pull -r
g push

# at some stage you might find out that you actually want to merge newer
# stuff from some other branch, eg. master
g merge master

# finally you want to get it all back to master
g checkout master
g merge mybranch
g push
# if it failed, we need to get the newest stuff from the remote repo
# BUT WITHOUT REBASING
g pull --no-rebase
g push

# everything finished, kill the remote branch
g -f push origin :feature/some-comphrehensible-name

thanks again

Noel


From 2a08f10d45446176e0d8b4b29863650b594f2bd2 Mon Sep 17 00:00:00 2001
From: August Sodora <augsod@gmail.com>
Date: Fri, 11 Nov 2011 14:22:11 -0500
Subject: [PATCH] Add line numbers to basic ide

---
 basctl/Library_basctl.mk            |    1 +
 basctl/source/basicide/baside2.hxx  |    6 ++++++
 basctl/source/basicide/baside2b.cxx |   29 +++++++++++++++++++++--------
 3 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/basctl/Library_basctl.mk b/basctl/Library_basctl.mk
index c806980..b1badf4 100644
--- a/basctl/Library_basctl.mk
+++ b/basctl/Library_basctl.mk
@@ -94,6 +94,7 @@ $(eval $(call gb_Library_add_exception_objects,basctl,\
        basctl/source/basicide/docsignature \
        basctl/source/basicide/documentenumeration \
        basctl/source/basicide/iderdll \
+       basctl/source/basicide/linenumberwindow \
        basctl/source/basicide/localizationmgr \
        basctl/source/basicide/macrodlg \
        basctl/source/basicide/moduldl2 \
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 6af6c06..1de34d7 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -42,6 +42,7 @@ class SvxSearchItem;
 #include <svtools/headbar.hxx>
 
 #include <vcl/button.hxx>
+#include <basic/sbstar.hxx>
 #include <basic/sbmod.hxx>
 #include <vcl/split.hxx>
 #include "svl/lstner.hxx"
@@ -50,6 +51,8 @@ class SvxSearchItem;
 #include <sfx2/progress.hxx>
 #include <svtools/syntaxhighlight.hxx>
 
+#include "linenumberwindow.hxx"
+
 DBG_NAMEEX( ModulWindow )
 
 #define MARKER_NOMARKER 0xFFFF
@@ -284,6 +287,7 @@ class ComplexEditorWindow : public Window
 {
 private:
     BreakPointWindow    aBrkWindow;
+    LineNumberWindow    aLineNumberWindow;
     EditorWindow        aEdtWindow;
     ScrollBar           aEWVScrollBar;
 
@@ -297,6 +301,7 @@ public:
                         ComplexEditorWindow( ModulWindow* pParent );
 
     BreakPointWindow&   GetBrkWindow()      { return aBrkWindow; }
+    LineNumberWindow&   GetLineNumberWindow() { return aLineNumberWindow; }
     EditorWindow&       GetEdtWindow()      { return aEdtWindow; }
     ScrollBar&          GetEWVScrollBar()   { return aEWVScrollBar; }
 };
@@ -402,6 +407,7 @@ public:
 
     EditorWindow&       GetEditorWindow()       { return aXEditorWindow.GetEdtWindow(); }
     BreakPointWindow&   GetBreakPointWindow()   { return aXEditorWindow.GetBrkWindow(); }
+    LineNumberWindow&   GetLineNumberWindow()   { return aXEditorWindow.GetLineNumberWindow(); }
     ScrollBar&          GetEditVScrollBar()     { return aXEditorWindow.GetEWVScrollBar(); }
     ExtTextEngine*      GetEditEngine()         { return GetEditorWindow().GetEditEngine(); }
     ExtTextView*        GetEditView()           { return GetEditorWindow().GetEditView(); }
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 8f348d2..be08268 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -580,6 +580,7 @@ void EditorWindow::CreateEditEngine()
     pModulWindow->GetLayout()->GetWatchWindow().Update();
     pModulWindow->GetLayout()->GetStackWindow().Update();
     pModulWindow->GetBreakPointWindow().Update();
+    pModulWindow->GetLineNumberWindow().Update();
 
     pEditView->ShowCursor( sal_True, sal_True );
 
@@ -660,6 +661,7 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
             pModulWindow->GetEditVScrollBar().SetThumbPos( pEditView->GetStartDocPos().Y() );
             pModulWindow->GetBreakPointWindow().DoScroll
                 ( 0, pModulWindow->GetBreakPointWindow().GetCurYOffset() - 
pEditView->GetStartDocPos().Y() );
+            pModulWindow->GetLineNumberWindow().Invalidate();
         }
         else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
         {
@@ -669,6 +671,8 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                 long nTextHeight = pEditEngine->GetTextHeight();
                 if ( nTextHeight < nOutHeight )
                     pEditView->Scroll( 0, pEditView->GetStartDocPos().Y() );
+
+                pModulWindow->GetLineNumberWindow().Invalidate();
             }
 
             SetScrollBarRanges();
@@ -792,7 +796,10 @@ void EditorWindow::ImplSetFont()
         aFont = GetFont();
 
         if ( pModulWindow )
+        {
             pModulWindow->GetBreakPointWindow().SetFont( aFont );
+            pModulWindow->GetLineNumberWindow().SetFont( aFont );
+        }
 
         if ( pEditEngine )
         {
@@ -873,6 +880,7 @@ void EditorWindow::ParagraphInsertedDeleted( sal_uLong nPara, sal_Bool bInserted
     {
         pModulWindow->GetBreakPoints().reset();
         pModulWindow->GetBreakPointWindow().Invalidate();
+        pModulWindow->GetLineNumberWindow().Invalidate();
         aHighlighter.initialize( HIGHLIGHT_BASIC );
     }
     else
@@ -886,6 +894,11 @@ void EditorWindow::ParagraphInsertedDeleted( sal_uLong nPara, sal_Bool 
bInserted
         aInvRec.Top() = nY;
         pModulWindow->GetBreakPointWindow().Invalidate( aInvRec );
 
+        Size aLnSz(pModulWindow->GetLineNumberWindow().GetWidth(),
+                   GetOutputSizePixel().Height() - 2 * DWBORDER);
+        pModulWindow->GetLineNumberWindow().SetPosSizePixel(Point(DWBORDER + 19, DWBORDER), aLnSz);
+        pModulWindow->GetLineNumberWindow().Invalidate();
+
         if ( bDoSyntaxHighlight )
         {
             String aDummy;
@@ -1612,12 +1625,10 @@ void StackWindow::UpdateCalls()
     aTreeListBox.SetUpdateMode( sal_True );
 }
 
-
-
-
 ComplexEditorWindow::ComplexEditorWindow( ModulWindow* pParent ) :
     Window( pParent, WB_3DLOOK | WB_CLIPCHILDREN ),
     aBrkWindow( this ),
+    aLineNumberWindow( this, pParent ),
     aEdtWindow( this ),
     aEWVScrollBar( this, WB_VSCROLL | WB_DRAG )
 {
@@ -1625,6 +1636,7 @@ ComplexEditorWindow::ComplexEditorWindow( ModulWindow* pParent ) :
     aBrkWindow.SetModulWindow( pParent );
     aEdtWindow.Show();
     aBrkWindow.Show();
+    aLineNumberWindow.Show();
 
     aEWVScrollBar.SetLineSize( SCROLL_LINE );
     aEWVScrollBar.SetPageSize( SCROLL_PAGE );
@@ -1632,8 +1644,6 @@ ComplexEditorWindow::ComplexEditorWindow( ModulWindow* pParent ) :
     aEWVScrollBar.Show();
 }
 
-
-
 void ComplexEditorWindow::Resize()
 {
     Size aOutSz = GetOutputSizePixel();
@@ -1643,11 +1653,14 @@ void ComplexEditorWindow::Resize()
     long nBrkWidth = 20;
     long nSBWidth = aEWVScrollBar.GetSizePixel().Width();
 
-    Size aBrkSz( Size( nBrkWidth, aSz.Height() ) );
+    Size aBrkSz(nBrkWidth, aSz.Height());
     aBrkWindow.SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
 
-    Size aEWSz( Size( aSz.Width() - nBrkWidth - nSBWidth + 2, aSz.Height() ) );
-    aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width()-1, DWBORDER ), aEWSz );
+    Size aLnSz(aLineNumberWindow.GetWidth(), aSz.Height());
+    aLineNumberWindow.SetPosSizePixel(Point(DWBORDER+aBrkSz.Width() - 1, DWBORDER), aLnSz);
+
+    Size aEWSz(aSz.Width() - nBrkWidth - aLineNumberWindow.GetWidth() - nSBWidth + 2, 
aSz.Height());
+    aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width()+aLnSz.Width()-1, DWBORDER ), aEWSz 
);
 
     aEWVScrollBar.SetPosSizePixel( Point( aOutSz.Width()-DWBORDER-nSBWidth, DWBORDER ), Size( 
nSBWidth, aSz.Height() ) );
 }
-- 
1.7.4.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.