License Statement
Hi Everyone, I've received approval from my employer to contribute to Libreoffice. I was student contributor in last year's GSOC 2011. All of my code/patch contributions towards Libreoffice will be under MPL/LGPLv3+ dual license. Regards, -- Anurag Jain ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Build fails for Tail_build
Hello there, I've been building LO and it seems build is failing for me in tail_build for one of the unit test. I asked about if there is any work around other than cleaning and rebuilding this big chunk in the main channel. Didn't get reply there so I'm posting it to the list here. It failed with following message while partial building. [ build CHK ] sfx2 R=/home/anurag/libo S=$R/core O=$S/solver/unxlngx6.pro W=$S/workdir/unxlngx6.pro mkdir -p $W/Module/check/ touch $W/Module/check/sfx2 [ build CHK ] slideshow R=/home/anurag/libo S=$R/core O=$S/solver/unxlngx6.pro W=$S/workdir/unxlngx6.pro mkdir -p $W/Module/check/ touch $W/Module/check/slideshow [ build CHK ] starmath R=/home/anurag/libo S=$R/core O=$S/solver/unxlngx6.pro W=$S/workdir/unxlngx6.pro mkdir -p $W/Module/check/ touch $W/Module/check/starmath [ build LNK ] CppunitTest/libtest_svtools_filters_test.so R=/home/anurag/libo S=$R/core O=$S/solver/unxlngx6.pro W=$S/workdir/unxlngx6.pro mkdir -p $W/LinkTarget/CppunitTest/ g++ -shared -Wl,-z,noexecstack -Wl,-z,defs -Wl,-rpath-link,/lib:/usr/lib -Wl,-z,combreloc -L$S/solenv/unxlngx6/lib -L$O/lib -L$S/solenv/unxlngx6/lib -Wl,--hash-style=gnu -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo -Wl,-Bsymbolic-functions -Wl,--strip-all $W/CxxObject/svtools/qa/cppunit/filters-test.o -Wl,--start-group -Wl,--end-group -lcppunit -lcomphelpgcc3 -luno_cppu -luno_cppuhelpergcc3 -luno_sal -lsvtlo -ltest -ltllo -lunotest -lvcllo -o $W/LinkTarget/CppunitTest/libtest_svtools_filters_test.so TEMPFILE=/tmp/gbuild.ZTBqok mv ${TEMPFILE} /home/anurag/libo/core/workdir/ unxlngx6.pro/LinkTarget/CppunitTest/libtest_svtools_filters_test.so.objectlist [ build CUT ] svtools_filters_test R=/home/anurag/libo S=$R/core O=$S/solver/unxlngx6.pro W=$S/workdir/unxlngx6.pro mkdir -p $W/CppunitTest/ (LD_LIBRARY_PATH=$O/lib:$O/lib/sqlite DBGSV_ERROR_OUT=shell STAR_RESOURCEPATH=$O/bin/ $O/bin/cppunit/cppunittester $W/LinkTarget/CppunitTest/libtest_svtools_filters_test.so --headless --protector unoexceptionprotector.so unoexceptionprotector -env:CONFIGURATION_LAYERS=xcsxcu:file://$O/xml/registry -env:UNO_TYPES= file://$O/bin/udkapi.rdb file://$O/bin/types.rdb -env:UNO_SERVICES=file://$O/xml/ure/services.rdb file://$O/xml/component/configmgr/source/configmgr.component -env:URE_INTERNAL_LIB_DIR=file://$O/lib -env:LO_LIB_DIR=file://$O/lib $W/CppunitTest/svtools_filters_test.test.log 21 || (cat $W/CppunitTest/svtools_filters_test.test.log echo; echo Error: a unit test failed, please do one of:; echo; echo export DEBUGCPPUNIT=TRUE # for exception catching; echo export GDBCPPUNITTRACE=\gdb --args\ # for interactive debugging; echo export VALGRIND=memcheck# for memory checking ; echo and retry. false)) File tested,Test Result,Execution Time (ms) file:///home/anurag/libo/core/svtools/qa/cppunit/data/wmf/pass/CVE-2006-4071-1.wmf,filters-test.cxx:123:Assertion Test name: SvtoolsFiltersTest::testCVEs assertion failed - Expression: osl::FileBase::E_None == osl::File::remove(sTmpFile) Failures !!! Run: 1 Failure total: 1 Failures: 1 Errors: 0 Error: a unit test failed, please do one of: export DEBUGCPPUNIT=TRUE# for exception catching export GDBCPPUNITTRACE=gdb --args # for interactive debugging export VALGRIND=memcheck# for memory checking and retry. make: *** [/home/anurag/libo/core/workdir/ unxlngx6.pro/CppunitTest/svtools_filters_test.test] Error 1 Awaiting a response .. Thanks and regards. -- Anurag Jain ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Build fails in moz module
Hi there, I came across http://www.mail-archive.com/libreoffice@lists.freedesktop.org/msg16120.htmland it seems the problem was solved for them. Let me try this and will give update if this solved my problem. Thanks and regards On Sat, Nov 12, 2011 at 11:23 PM, Anurag Jain anuragjain...@gmail.comwrote: Hi there, My build is failing in the moz module. I tried building the moz individually after doing the clean up but could not figure out the problem. Here is the build log http://pastebin.com/XwrWqgMJ Please help me figure out what might be causing the problem. Thanks and regards -- Anurag Jain -- Anurag Jain ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Build fails in moz module
Hi there, My build is failing in the moz module. I tried building the moz individually after doing the clean up but could not figure out the problem. Here is the build log http://pastebin.com/XwrWqgMJ Please help me figure out what might be causing the problem. Thanks and regards -- Anurag Jain ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Licensing for my work
Hello there, Yeah, I'd like add to what Thorsten said. My work(Including GSOC works and apart from that) can be submitted to LGPLv3+/MPL dual license and its future versions also. Regards On Wed, Aug 24, 2011 at 2:57 PM, Thorsten Behrens t...@documentfoundation.org wrote: Anurag Jain wrote: I'd like to say that all my contribution towards Libre office suite codebase can be licensed under LGPSv3/MPL dual license. My work will includes all the patches which I've submitted under GSOC program and apart from that , and LGPLv3/MPL can be applied to all of them. Hi Anurag, please, could you confirm that your work is submitted under LGPLv3+? With the + being the option to change to any later version of the LGPL. Thanks, -- Thorsten -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][patch] Multiline inputbar
Hello Kohei, This is a fix to some of the things you mentioned in last patch. Setting the paper size inside the Resize() of ScMultiTextWnd solves two issues 1: Prevents premature wrapping which was happening before. 2: The paperSize is recalculated as per the window size. Regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 From 14b16dbef8b57c87ec7e077c27ae5f74a26ed449 Mon Sep 17 00:00:00 2001 From: Anurag Jain anuragjain...@gmail.com Date: Tue, 23 Aug 2011 20:19:39 +0530 Subject: [PATCH] Fixed premature wrapping, black spot in A1 and scrollbar and button position. --- sc/source/ui/app/inputwin.cxx | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index bff10cb..9c1879f 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -835,8 +835,8 @@ void ScInputBarGroup::Resize() } SetSizePixel(aSize); -aButton.SetPosPixel(Point(aSize.Width()-4*LEFT_OFFSET,0)); -aScrollBar.SetPosPixel(Point(aSize.Width()-2*LEFT_OFFSET,0)); +aScrollBar.SetPosPixel(Point(aSize.Width()-4*LEFT_OFFSET,0)); +aButton.SetPosPixel(Point(aSize.Width()-2*LEFT_OFFSET,0)); Invalidate(); aMultiTextWnd.Resize(); @@ -902,7 +902,7 @@ IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, pBtn ) pParent-SetMultiLineStatus(false); } pParent-Resize(); -pParent-CalcWindowSizePixel(); // TODO: changed from RecalcItems(). check if this does the same thing. +//pParent-CalcWindowSizePixel(); // TODO: changed from RecalcItems(). check if this does the same thing. return 0; } @@ -934,8 +934,8 @@ void ScMultiTextWnd::Paint( const Rectangle rRec ) { // We always use edit engine to draw text at all times. if (!pEditEngine) -//InitEditEngine(SfxObjectShell::Current()); -StartEditEngine(); +InitEditEngine(SfxObjectShell::Current()); +//StartEditEngine(); if (pEditView) { @@ -979,6 +979,8 @@ void ScMultiTextWnd::Resize() pEditView-SetOutputArea( PixelToLogic(Rectangle(aPos1, aPos2))); + pEditEngine-SetPaperSize( PixelToLogic(Size(aOutputSize.Width() - 2*LEFT_OFFSET, 1 ) )); + } } @@ -998,6 +1000,8 @@ void ScMultiTextWnd::Resize() pEditView-SetOutputArea( PixelToLogic(Rectangle(aPos1, aPos2))); + +pEditEngine-SetPaperSize( PixelToLogic(Size(aOutputSize.Width() - 2*LEFT_OFFSET, 1 ) )); } } SetSizePixel(aTextBoxSize); @@ -1084,9 +1088,9 @@ void ScMultiTextWnd::InitEditEngine(SfxObjectShell* pObjSh) Size barSize=GetSizePixel(); barSize.Width() -= (2*nTextStartPos-4); -printf(bar size width %ld,barSize.Width()); +printf(bar size width %ld\n,barSize.Width()); pEditEngine-SetUpdateMode( false ); -pEditEngine-SetPaperSize( PixelToLogic(Size(994-4*LEFT_OFFSET,1)) ); +pEditEngine-SetPaperSize( PixelToLogic(Size(barSize.Width(),1)) ); pEditEngine-SetWordDelimiters( ScEditUtil::ModifyDelimiters( pEditEngine-GetWordDelimiters() ) ); -- 1.7.0.4 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Licensing for my work
Hello everyone, I'd like to say that all my contribution towards Libre office suite codebase can be licensed under LGPSv3/MPL dual license. My work will includes all the patches which I've submitted under GSOC program and apart from that , and LGPLv3/MPL can be applied to all of them. Thanks and regards, -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][patch] Multiline inputbar
Hello Kohei, I've Worked around ScrollBar and Made it appear. But still not able to get the event handling thing working. Also I've improved some previous code which handles sizing and positioning of button and other controls. Also in order to delay the call to InitEditEngine, I think we can make use of the GainFocus() method. The call should be made only after the textbox has got focus. Firstly, I want you to guide me in syncing the ScrollBar event with the textbox and after that I'll go for fixing the EditEngine thing. I've attached the patch over here, awaiting your suggestions. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 From e65f6a604ee51e9feb01cbf39d72217255d629c4 Mon Sep 17 00:00:00 2001 From: Anurag Jain anuragjain...@gmail.com Date: Sat, 20 Aug 2011 23:09:40 +0530 Subject: [PATCH] Made Scrollbar to appear and resize improved. --- sc/source/ui/app/inputwin.cxx | 64 +++- sc/source/ui/inc/inputwin.hxx |3 ++ 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 3130d54..bff10cb 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -512,10 +512,10 @@ void ScInputWindow::Resize() } else { -aSize.Height()=33; +aSize.Height()=38; } SetSizePixel(aSize); -//Invalidate(); +Invalidate(); aTextWindow.Resize(); } else @@ -759,15 +759,24 @@ void ScInputWindow::SetMultiLineStatus(bool bMode) ScInputBarGroup::ScInputBarGroup(Window* pParent) : ScTextWndBase( pParent, WinBits(WB_HIDE) ), aMultiTextWnd( this ), -aButton ( this) +aButton ( this ), +aScrollBar ( this, WB_VERT ) { aMultiTextWnd.Show(); aMultiTextWnd.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); aMultiTextWnd.SetHelpId ( HID_INSWIN_INPUT ); aButton.SetClickHdl ( LINK( this, ScInputBarGroup, ClickHdl ) ); - aButton.Show(); + aButton.SetSizePixel(Size(0.5*TBX_WINDOW_HEIGHT,TBX_WINDOW_HEIGHT)); aButton.Enable(); + aButton.Show(); + + aScrollBar.SetSizePixel( Size(0.5*TBX_WINDOW_HEIGHT,TBX_WINDOW_HEIGHT) ); + + aScrollBar.SetPageSize( 1 ); + aScrollBar.SetVisibleSize( 1 ); + aScrollBar.SetLineSize( 1 ); + aScrollBar.Show(); } ScInputBarGroup::~ScInputBarGroup() @@ -811,9 +820,10 @@ void ScInputBarGroup::Resize() } long nWidth = pParent-GetSizePixel().Width(); -Point aPos = GetPosPixel(); +long nLeft = GetPosPixel().X(); + Size aSize = GetSizePixel(); -aSize.Width() = Max( ((long)(nWidth - aPos.X() - LEFT_OFFSET)), (long)0 ); +aSize.Width() = Max( ((long)(nWidth - nLeft - LEFT_OFFSET)), (long)0 ); if(pParent-GetMultiLineStatus()) { @@ -823,11 +833,12 @@ void ScInputBarGroup::Resize() { aSize.Height()=TBX_WINDOW_HEIGHT; } -SetPosSizePixel(aPos,aSize); -Invalidate(); +SetSizePixel(aSize); -aButton.SetPosSizePixel(Point(aSize.Width()-3*LEFT_OFFSET,0),Size(0.5*TBX_WINDOW_HEIGHT,TBX_WINDOW_HEIGHT)); +aButton.SetPosPixel(Point(aSize.Width()-4*LEFT_OFFSET,0)); +aScrollBar.SetPosPixel(Point(aSize.Width()-2*LEFT_OFFSET,0)); +Invalidate(); aMultiTextWnd.Resize(); } @@ -895,6 +906,12 @@ IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, pBtn ) return 0; } +IMPL_LINK( ScInputBarGroup, Impl_ScrollHdl, ScrollBar*, EMPTYARG ) +{ + +} + + // // ScMultiTextWnd // @@ -917,7 +934,8 @@ void ScMultiTextWnd::Paint( const Rectangle rRec ) { // We always use edit engine to draw text at all times. if (!pEditEngine) -InitEditEngine(SfxObjectShell::Current()); +//InitEditEngine(SfxObjectShell::Current()); +StartEditEngine(); if (pEditView) { @@ -939,9 +957,10 @@ void ScMultiTextWnd::Resize() long nWidth = GetParent()-GetSizePixel().Width(); -Point aPos=GetPosPixel(); +long nLeft = GetPosPixel().X(); + Size aTextBoxSize = GetSizePixel(); -aTextBoxSize.Width() = Max( ((long)(nWidth - aPos.X() - 3*LEFT_OFFSET)), (long)0 ); +aTextBoxSize.Width() = Max( ((long)(nWidth - nLeft - 4*LEFT_OFFSET)), (long)0 ); if(pParent-GetMultiLineStatus()) { @@ -966,7 +985,6 @@ void ScMultiTextWnd::Resize() else { - aTextBoxSize.Height()=TBX_WINDOW_HEIGHT; if(pEditView) { @@ -977,17 +995,14 @@ void ScMultiTextWnd::Resize() Point aPos1(TEXT_STARTPOS,nDiff); Point aPos2(aOutputSize.Width()-5,(aOutputSize.Height() - nDiff)); + pEditView-SetOutputArea( PixelToLogic
[Libreoffice] [GSOC][patch] Multiline inputbar
Hello Kohei, I've implemented new logic for the resize of the textbox. Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 From 45fcb8cde31971cfba4354be5e98553930054c60 Mon Sep 17 00:00:00 2001 From: Anurag Jain anuragjain...@gmail.com Date: Mon, 15 Aug 2011 19:14:14 +0530 Subject: [PATCH] Implemented new resize logic for textbox. Looks more clean. --- sc/source/ui/app/inputwin.cxx | 62 +++-- 1 files changed, 35 insertions(+), 27 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index f1c2598..418d7d8 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -814,9 +814,9 @@ void ScInputBarGroup::Resize() } long nWidth = pParent-GetSizePixel().Width(); -long nLeft = GetPosPixel().X(); +Point aPos = GetPosPixel(); Size aSize = GetSizePixel(); -aSize.Width() = Max( ((long)(nWidth - nLeft - LEFT_OFFSET)), (long)0 ); +aSize.Width() = Max( ((long)(nWidth - aPos.X() - LEFT_OFFSET)), (long)0 ); if(pParent-GetMultiLineStatus()) { @@ -826,7 +826,7 @@ void ScInputBarGroup::Resize() { aSize.Height()=TBX_WINDOW_HEIGHT; } -SetSizePixel(aSize); +SetPosSizePixel(aPos,aSize); Invalidate(); aButton.SetPosSizePixel(Point(aSize.Width()-3*LEFT_OFFSET,0),Size(0.5*TBX_WINDOW_HEIGHT,TBX_WINDOW_HEIGHT)); @@ -940,45 +940,53 @@ void ScMultiTextWnd::Resize() return; } + long nWidth = GetParent()-GetSizePixel().Width(); -long nLeft = GetPosPixel().X(); -Size cSize = GetSizePixel(); -cSize.Width() = Max( ((long)(nWidth - nLeft - 3*LEFT_OFFSET)), (long)0 ); +Point aPos=GetPosPixel(); +Size aTextBoxSize = GetSizePixel(); +aTextBoxSize.Width() = Max( ((long)(nWidth - aPos.X() - 3*LEFT_OFFSET)), (long)0 ); if(pParent-GetMultiLineStatus()) { -cSize.Height()=3*TBX_WINDOW_HEIGHT; +aTextBoxSize.Height()=3*LogicToPixel(Size(0,GetTextHeight())).Height()+8; -if (pEditView) +if(pEditView) { - -Size aSize = GetOutputSizePixel(); -Size bSize = LogicToPixel(Size(0,pEditEngine-GetLineHeight(0,0))); -int nDiff=(aSize.Height()-bSize.Height())/2; -Point aPos(TEXT_STARTPOS,4); -Point aPos2(aSize.Width()-5,50); -pEditView-SetOutputArea( -PixelToLogic(Rectangle(aPos, aPos2))); +Size aOutputSize=GetOutputSizePixel(); +Size aLineSize = LogicToPixel(Size(0,pEditEngine-GetLineHeight(0,0))); + +int nDiff = (aOutputSize.Height() - 3*aLineSize.Height())/2; + +Point aPos1(TEXT_STARTPOS,nDiff); +Point aPos2(aOutputSize.Width()-5,aOutputSize.Height()-2); + +pEditView-SetOutputArea( +PixelToLogic(Rectangle(aPos1, aPos2))); + } + } + else { -cSize.Height()=TBX_WINDOW_HEIGHT; -if (pEditView) +aTextBoxSize.Height()=TBX_WINDOW_HEIGHT; +if(pEditView) { -Size aSize = GetOutputSizePixel(); -Size bSize = LogicToPixel(Size(0,pEditEngine-GetLineHeight(0,0))); -int nDiff=(aSize.Height()-bSize.Height())/2; -Point aPos(TEXT_STARTPOS,nDiff*aSize.Height()/aSize.Height()); -Point aPos2(aSize.Width()-5,(aSize.Height()-nDiff)*aSize.Height()/aSize.Height()); +Size aOutputSize=GetOutputSizePixel(); +Size aLineSize = LogicToPixel(Size(0,pEditEngine-GetLineHeight(0,0))); + +int nDiff = (aOutputSize.Height() - aLineSize.Height())/2; + +Point aPos1(TEXT_STARTPOS,nDiff); +Point aPos2(aOutputSize.Width()-5,(aOutputSize.Height() - nDiff)); pEditView-SetOutputArea( -PixelToLogic(Rectangle(aPos, aPos2))); -} +PixelToLogic(Rectangle(aPos1, aPos2))); +} + } -SetSizePixel(cSize); - +SetPosSizePixel(aPos,aTextBoxSize); } -- 1.7.0.4 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][patch] Multiline inputbar
Hello Kohei, I prepared the patch and then realized that you have pushed the recalculating change, it was taking longer to pull because of some problem. Also wanted to inform that I've to leave for college as I've got convocation on 6th Aug. I'll be back on 7th evening and finish things up. Also after doing resize of output are I realized following things. 1: I was setting the height to 3*TBX_WINDOW_HEIGHT thinking to accommodate 3 lines in the text box. But on resize I got 4 and half line getting there. So I've decided to change the logic of the resizing. and I guess this calculation will be proper. single line mode: Get the width from parent window and minus some offset from that. height will be TBX_WINDOW_HEIGHT(22) here. the line height comes out to be 14 so we calculate the nDiff which works as up and down offset as nDiff=( TBX_WINDOW_HEIGHT - LineHeight)/2 which comes out to be 4. output area is set accordingly as done in commit 34c374a69dcce7fe669dedec7eaa36b6c2db4ca5 Multi Line mode: Now here what I'm trying to do is the height will be calculated as textbox Height= 3* LineHeight + 2* nDiff // here we increase the size by amount that of 3 lines plus the up and down padding which remains same. And the output area will be set accordingly with a similar logic as in single line mode. I'll implement these things after returning from college. Also I'd like to know how to go about the next step.? Is it going to be scrollbar implementation or working on refreshing the windows ? Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 From 447a2feb3ce54e49a7b19fd2eebb42aba136fcd3 Mon Sep 17 00:00:00 2001 From: ANURAG JAIN anuragjain...@gmail.com Date: Thu, 4 Aug 2011 13:38:26 +0530 Subject: [PATCH] Implemented the resizing of output are in multi-line mode and added a NULL pointer check with a FAIL message. Still there are improvements to be done in the resizinf of the text box. --- sc/source/ui/app/inputwin.cxx | 83 +++- 1 files changed, 56 insertions(+), 27 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 8566bf9..f1c2598 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -510,12 +510,10 @@ void ScInputWindow::Resize() //aTextWindow.SetSizePixel( aSize ); if( bIsMultiLine ) { -printf(increased\n); aSize.Height()=77; } else { -printf(reduced\n); aSize.Height()=33; } SetSizePixel(aSize); @@ -718,7 +716,6 @@ void ScInputWindow::EnableButtons( sal_Bool bEnable ) void ScInputWindow::StateChanged( StateChangedType nType ) { ToolBox::StateChanged( nType ); -printf(here\n); if ( nType == STATE_CHANGE_INITSHOW ) Resize(); } @@ -807,15 +804,21 @@ void ScInputBarGroup::SetTextString( const String rString ) void ScInputBarGroup::Resize() { Window *w=GetParent(); -ScInputWindow *sw; -sw=dynamic_castScInputWindow*(w); +ScInputWindow *pParent; +pParent=dynamic_castScInputWindow*(w); -long nWidth = sw-GetSizePixel().Width(); +if(pParent==NULL) +{ +OSL_FAIL(The parent window pointer pParent is null); +return; +} + +long nWidth = pParent-GetSizePixel().Width(); long nLeft = GetPosPixel().X(); Size aSize = GetSizePixel(); aSize.Width() = Max( ((long)(nWidth - nLeft - LEFT_OFFSET)), (long)0 ); -if(sw-GetMultiLineStatus()) +if(pParent-GetMultiLineStatus()) { aSize.Height()=3*TBX_WINDOW_HEIGHT; } @@ -873,19 +876,25 @@ void ScInputBarGroup::SetFormulaMode(sal_Bool bSet) IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, pBtn ) { Window *w=GetParent(); -ScInputWindow *sw; -sw=dynamic_castScInputWindow*(w); +ScInputWindow *pParent; +pParent=dynamic_castScInputWindow*(w); + +if(pParent==NULL) +{ +OSL_FAIL(The parent window pointer pParent is null); +return 1; +} -if(!sw-GetMultiLineStatus()) +if(!pParent-GetMultiLineStatus()) { -sw-SetMultiLineStatus(true); +pParent-SetMultiLineStatus(true); } else { -sw-SetMultiLineStatus(false); +pParent-SetMultiLineStatus(false); } -sw-Resize(); -sw-RecalcItems(); +pParent-Resize(); +pParent-RecalcItems(); return 0; } @@ -922,34 +931,54 @@ void ScMultiTextWnd::Paint( const Rectangle rRec ) void ScMultiTextWnd::Resize() { Window *w=GetParent()-GetParent(); -ScInputWindow *sw; -sw=dynamic_castScInputWindow*(w); +ScInputWindow *pParent; +pParent=dynamic_castScInputWindow*(w); + +if(pParent==NULL) +{ +OSL_FAIL(The parent window pointer pParent is null); +return
[Libreoffice] [GSOC][PATCH] Multiline inputbar
Hello Kohei, Please find the patch for resizing the ScInputWindow. I've tried doing it the way you suggested; using proper typecasting I've moved the bIsMultiLine to the ScInputWindow and able to access the status in other classes too. Still this patch needs lots of improvement as the transition is not smooth. On first click the textbox resizes outwards which used to resize in hidden manner previously. But when the textbox is given focus in multiline mode, the whole toolbar resizes to the desired state. Similar is the case for reverse process. As of now I do not know why is it becoming a two state process. Please review this patch and please 1: Make me figure out where the mistake might be. I guess there are some more functions in ScInputWindow I'd need to touch into and also some methods from Window.hxx. 2: Check the order in which various resize are getting called. I guess there are various do's and undo's happening under the hood. 3: Still I'm not able to figure out what Invalidate() is for and when it should be used and when not. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 From c43c07532edc3f1f1c70f20deebc86e563eadcb5 Mon Sep 17 00:00:00 2001 From: ANURAG JAIN anuragjain...@gmail.com Date: Mon, 25 Jul 2011 00:07:42 +0530 Subject: [PATCH] Made the tool bar to resize. But still the transition is not smooth. --- sc/source/ui/app/inputwin.cxx | 76 +++-- sc/source/ui/inc/inputwin.hxx | 11 +++--- 2 files changed, 55 insertions(+), 32 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 943eb82..58d9af8 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -161,7 +161,8 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : aTextCancel ( ScResId( SCSTR_QHELP_BTNCANCEL ) ), aTextSum ( ScResId( SCSTR_QHELP_BTNSUM ) ), aTextEqual ( ScResId( SCSTR_QHELP_BTNEQUAL ) ), -bIsOkCancelMode ( false ) +bIsOkCancelMode ( false ), +bIsMultiLine( false ) { ScModule* pScMod = SC_MOD(); SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod ); @@ -505,8 +506,20 @@ void ScInputWindow::Resize() if ( lcl_isExperimentalMode() ) { -//aSize.Height()= TBX_WINDOW_HEIGHT; +Size aSize = GetSizePixel(); //aTextWindow.SetSizePixel( aSize ); +if( bIsMultiLine ) +{ +printf(increased\n); +aSize.Height()=77; +} +else +{ +printf(reduced\n); +aSize.Height()=33; +} +SetSizePixel(aSize); +//Invalidate(); aTextWindow.Resize(); } else @@ -705,7 +718,7 @@ void ScInputWindow::EnableButtons( sal_Bool bEnable ) void ScInputWindow::StateChanged( StateChangedType nType ) { ToolBox::StateChanged( nType ); - +printf(here\n); if ( nType == STATE_CHANGE_INITSHOW ) Resize(); } @@ -734,6 +747,17 @@ void ScInputWindow::DataChanged( const DataChangedEvent rDCEvt ) ToolBox::DataChanged( rDCEvt ); } +bool ScInputWindow::GetMultiLineStatus() +{ +return bIsMultiLine; +} + +void ScInputWindow::SetMultiLineStatus(bool bMode) +{ +bIsMultiLine=bMode; +} + + // // ScInputBarGroup // @@ -741,8 +765,7 @@ void ScInputWindow::DataChanged( const DataChangedEvent rDCEvt ) ScInputBarGroup::ScInputBarGroup(Window* pParent) : ScTextWndBase( pParent, WinBits(WB_HIDE) ), aMultiTextWnd( this ), -aButton ( this), -bIsMultiLine ( false ) +aButton ( this) { aMultiTextWnd.Show(); aMultiTextWnd.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); @@ -783,11 +806,16 @@ void ScInputBarGroup::SetTextString( const String rString ) void ScInputBarGroup::Resize() { -long nWidth = GetParent()-GetSizePixel().Width(); +Window *w=GetParent(); +ScInputWindow *sw; +sw=dynamic_castScInputWindow*(w); + +long nWidth = sw-GetSizePixel().Width(); long nLeft = GetPosPixel().X(); Size aSize = GetSizePixel(); -aSize.Width() = Max( ((long)(nWidth - nLeft - 2*LEFT_OFFSET)), (long)0 ); -if(bIsMultiLine) +aSize.Width() = Max( ((long)(nWidth - nLeft - LEFT_OFFSET)), (long)0 ); + +if(sw-GetMultiLineStatus()) { aSize.Height()=3*TBX_WINDOW_HEIGHT; } @@ -844,16 +872,19 @@ void ScInputBarGroup::SetFormulaMode(sal_Bool bSet) IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, pBtn ) { -if(!bIsMultiLine) +Window *w=GetParent(); +ScInputWindow *sw; +sw=dynamic_castScInputWindow*(w); + +if(!sw-GetMultiLineStatus()) { -bIsMultiLine=true; +sw-SetMultiLineStatus(true); } else
[Libreoffice] [GSOC][patch] Multiline inputbar
Hello Kohei, As said I've modified the codebase over Noel's patch and worked on showing the button up and basic toggling working. So far the text window and the container class resizes well base on the button click. But currently I'd need to work on following things also 1: Setting the proper output area when the toggling happens. I've tried working on it but was not able to get vertical offset proper when in multiline mode. So need to look more into its mathematics. 2: As Noel mentioned in, his last mail that I'm setting the height to TBX_WINDOW_HEIGHT instead it can be more than that. I tried fetching the current height in ScMultiTextWnd::Resize() and setting the correct height but I did some wrong implementation and LO was crashing because of that. So I'd need to look into that too. 3: The third thing is, when the resize happens, the ScInputWindow i.e toolbox doesn't resize. The overflow of the child window is hidden inside ScInputWindow. So this patch contains a basic button implementations and toggling of the textbox (resizing it) based on the click. I took time because it took some time to understand the new codebase which makes this feature runtime switchable. Please review it as soon as possible and help me work on the above mentioned things. Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 2d7a748..1fb7c6b 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -51,6 +51,7 @@ #include vcl/cursor.hxx #include vcl/help.hxx #include svl/stritem.hxx +#include stdio.h #include inputwin.hxx #include scmod.hxx @@ -81,6 +82,7 @@ #define TEXT_MULTI_STARTPOS 5 #define THESIZE100 //!!! langt... :-) #define TBX_WINDOW_HEIGHT 22 // in Pixeln - fuer alle Systeme gleich? +#define LEFT_OFFSET 5 enum ScNameInputType { @@ -176,7 +178,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : } DBG_ASSERT( pViewSh, no view shell for input window ); -// Positionsfenster, 3 Buttons, Eingabefenster +// Position window, 3 buttons, input window InsertWindow( 1, aWndPos, 0, 0 ); InsertSeparator ( 1 ); InsertItem ( SID_INPUT_FUNCTION, IMAGE( SID_INPUT_FUNCTION ), 0, 2 ); @@ -187,9 +189,12 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : aWndPos .SetQuickHelpText( ScResId( SCSTR_QHELP_POSWND ) ); aWndPos.SetHelpId ( HID_INSWIN_POS ); -aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); -aTextWindow.SetHelpId ( HID_INSWIN_INPUT ); - + +if ( !lcl_isExperimentalMode() ) +{ +aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); +aTextWindow.SetHelpId ( HID_INSWIN_INPUT ); +} // kein SetHelpText, die Hilfetexte kommen aus der Hilfe SetItemText ( SID_INPUT_FUNCTION, ScResId( SCSTR_QHELP_BTNCALC ) ); @@ -477,7 +482,7 @@ void ScInputWindow::Select() aTextWindow.StartEditEngine(); if ( pScMod-IsEditMode() ) // nicht, wenn z.B. geschuetzt { -aTextWindow.GrabFocus(); +aTextWindow.StartEditEngine(); aTextWindow.SetTextString( '=' ); EditView* pView = aTextWindow.GetEditView(); @@ -497,20 +502,24 @@ void ScInputWindow::Select() void ScInputWindow::Resize() { ToolBox::Resize(); - -long nWidth = GetSizePixel().Width(); -long nLeft = aTextWindow.GetPosPixel().X(); -Size aSize = aTextWindow.GetSizePixel(); - -aSize.Width() = Max( ((long)(nWidth - nLeft - 5)), (long)0 ); + if ( lcl_isExperimentalMode() ) { -aSize.Height()= TBX_WINDOW_HEIGHT; -aTextWindow.SetSizePixel( aSize ); +//aSize.Height()= TBX_WINDOW_HEIGHT; +//aTextWindow.SetSizePixel( aSize ); aTextWindow.Resize(); } -aTextWindow.SetSizePixel( aSize ); -aTextWindow.Invalidate(); +else +{ +long nWidth = GetSizePixel().Width(); +long nLeft = aTextWindow.GetPosPixel().X(); +Size aSize = aTextWindow.GetSizePixel(); + +aSize.Width() = Max( ((long)(nWidth - nLeft - 5)), (long)0 ); + +aTextWindow.SetSizePixel( aSize ); +aTextWindow.Invalidate(); +} } void ScInputWindow::SetFuncString( const String rString, sal_Bool bDoEdit ) @@ -518,8 +527,10 @@ void ScInputWindow::SetFuncString( const String rString, sal_Bool bDoEdit ) //! new method at ScModule to query if function autopilot is open SfxViewFrame* pViewFrm = SfxViewFrame::Current(); EnableButtons( pViewFrm !pViewFrm-GetChildWindow( SID_OPENDLG_FUNCTION ) ); -aTextWindow.StartEditEngine(); - +if ( !lcl_isExperimentalMode() ) +aTextWindow.StartEditEngine(); +else +aTextWindow.StartEditEngine(); ScModule* pScMod = SC_MOD
Re: [Libreoffice] [GSOC][PATCH] Multiline inputbar
Hello Noel, Yes I have made some changes as you mentioned this weekend. There are certain thing I'm not getting properly. 1: I'm able to toggle the height of ScMultiBar and ScInputBarGroup on button click. But the increment happens inside the ScInputWindow i.e. the excess window size do not appear. It toggles inside the ScInputWindow. To make it look the height of complete panel should be varied.So in order to do that will it be a good idea to add a ScInputWindow object in ScInputBarGroup and use it to vary the whole panel's height ? 2: Also one more thing, when button is clicked twice , the position window, and other formula images all disappears leaving a blank on left side of panel. I guess the ScInputBarGroup changes its vertical position. I tried resetting it always to (nLeft,0) but the LO did not start for some reason. As of now I'm trying to fix that. I'll discuss about these problems today in IRC and things required to be improved a little bit before putting it in master branch. On Mon, Jul 4, 2011 at 3:29 PM, Noel Power nopo...@novell.com wrote: Hi Anurag, As discussed on IRC I had hoped to see the patch you promised to send. The one that rename's your class, restores ScTextWnd and removes the unnecessary changes and does some cleanup of the existing code, is there some problem? everything ok? I need those changes to integrate your code into master. On 26/06/11 18:23, Anurag Jain wrote: yes as soon as I get things placed in right place I'll be working on switching from single line to multiline mode on the button click. Is there any update regarding with size switching, any chance of a patch for the above?, it would be great to get those changes in addition to the work above into master ( would give people a better idea and feel for what you are doing, without the resize changes the visual difference with the work sofar isn't so obvious ) So, time is fast running out on this, I need the patches already promised asap, if you can provide the extra parts that's even better. Thanks Noel Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [GSOC][PATCH] Multiline inputbar
Hello Noel, As you asked I'm sending a patch here with most of the changes incorporated. I've done total rework again and made a bit more modular, removed unnecessary things and now it look way better than what i was getting yesterday. Please have a look before you make changes on you end and if you think this is good enough to be pushed into Master please do so. I guess I'd be better if you make the runtime decision thing above this patch. As of now there are might be some printf's lying around so ignore them as of now. Awaiting your feedback on this. Thanks and regards On Mon, Jul 4, 2011 at 9:09 PM, Noel Power nopo...@novell.com wrote: On 04/07/11 11:29, Anurag Jain wrote: Hello Noel, I'm sending the inputwin.cxx with the changes I've made in ScInputBargroup. Do not push it as of now. I'd be making some more changes as mentioned in above mail before it can be pushed. I guess it really isn't usable without a header file :-( I really was looking for a patch that addressed the issues we talked about previously that would allow me to at least start to try and integrate your work. On Mon, Jul 4, 2011 at 3:53 PM, Anurag Jainanuragjain...@gmail.com wrote: Hello Noel, Yes I have made some changes as you mentioned this weekend. There are certain thing I'm not getting properly. 1: I'm able to toggle the height of ScMultiBar and ScInputBarGroup on button click. But the increment happens inside the ScInputWindow i.e. the excess window size do not appear. It toggles inside the ScInputWindow. To make it look the height of complete panel should be varied.So in order to do that will it be a good idea to add a ScInputWindow object in ScInputBarGroup and use it to vary the whole panel's height ? hmm, it seems that somehow the toolbar doesn't resize as expected, don't know why, might be worth doing some debugging in vcl/source/window/toolbox.cxx 2: Also one more thing, when button is clicked twice , the position window, and other formula images all disappears leaving a blank on left side of panel. I guess the ScInputBarGroup changes its vertical position. I tried resetting it always to (nLeft,0) but the LO did not start for some reason. As of now I'm trying to fix that. I'll discuss about these problems today in IRC and things required to be improved a little bit before putting it in master branch. no idea at all about that, it sounds like either a paint problem ( but that's easy to check by forcing repaint but moving the window offscreen and back ) or the controls have been repositioned somehow, again some debugging of the size and position attributes of the toolbar items should give you an idea I am going to try to integrate the code as it was before whatever new work you have done because I there is little time left, it is better to have some code integrated rather than none :-). I didn't look at the inputwin.cxx that you attached in any great detail but I don't like the name of the new textbox ScMultiBar, it is I think misleading, I liked some of the other alternatives you suggested better ( e.g. ScMultiText ). I know I suggested that you rename the class to something new but I thought maybe you could reuse the old one ( e.g. inherit from it ) to avoid duplicating *all* the code there. My main concern was to separate the new from old code ( without excessive logic ( if/then ) branches in the code especially with the requirement of having some code in master )... I will try to fix that when integrating the code Noel -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index dc12376..ede8585 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -172,12 +172,10 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : InsertItem ( SID_INPUT_EQUAL, IMAGE( SID_INPUT_EQUAL ), 0,4 ); InsertSeparator ( 5 ); InsertWindow( 7, aBarGroup, 0, 6 ); -// InsertWindow( 8, maScrollBar, 0, 8 ); +printf(Ctor ScInputWindow\n); aWndPos .SetQuickHelpText( ScResId( SCSTR_QHELP_POSWND ) ); aWndPos.SetHelpId ( HID_INSWIN_POS ); -//aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); -//aTextWindow.SetHelpId ( HID_INSWIN_INPUT ); // kein SetHelpText, die Hilfetexte kommen aus der Hilfe @@ -193,8 +191,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : SetHelpId( HID_SC_INPUTWIN ); // fuer die ganze Eingabezeile aWndPos .Show(); -// maScrollBar .Show(); -aBarGroup .Show(); +//aBarGroup .Show(); pInputHdl = SC_MOD()-GetInputHdl( pViewSh, false );// use own handler even if ref-handler is set if (pInputHdl) @@ -487,15 +484,22 @@ void ScInputWindow::Select() void ScInputWindow::Resize() { ToolBox::Resize
[Libreoffice] [GSOC] Multiline inputbar
Hello Noel, Here I got some chance to play with MS Excel 2010 and I analyzed the behavior of inputbar. I'm sending an image here showing the desire behavior. The first figure in the image shows the normal behavior showing only a single line and keep on wrapping the content text on overflows.This is what has already been done in single line mode. 2: Second thing is to enable the button press. On button press as you can see, only two lines are shown and scrollbar shifts its position below the button (that is probably to make the UI consistent adjusting the button and scrollbar in double the height of the line. This actually does not affect the text output area, just makes things consistent).Scrollbar works same way scrolling single line at a time.This can be said as multiline mode. 3: The third thing is to make the inputbar re-sizable on the mouse drag. On hovering the down edge of the inputbar here the cursor changes and can be dragged to show the hidden contents (this also happens in units of single line height. Also here the scrollbar's thumb size changes depending on the height of the inputbar.) So if this is implemented in similar way it can be good UI enhancement to LO. As of now I'm trying to set the position of the scrollbar and button, making them appear at the right place i.e. after the inputbar. Also as of now I do not have any idea about the implementing the resizing of inputbar. As I've already sent the patch for fixing the width, height and border of the InputBarGroup and after i get the positions correctly we can start working on these improvements. Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 attachment: 1.JPG___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [GSOC][PATCH] Multiline inputbar
Hello Noel, On Fri, Jun 24, 2011 at 7:53 PM, Noel Power nopo...@novell.com wrote: Hi Anurag On 22/06/11 15:51, Anurag Jain wrote: Hi Noel, Resending the patch again along with the source files here. as mentioned on Wed on iRC I pushed the patch to the feature branch. I had hoped to see the latest changes you made to correct the control size problem that I identified that was preventing your new control from being displayed before reviewing the patch further, I am not *that* familiar with libreoffice ui bits and pieces and was hoping to have something to run to test. Additionally on IRC it wasn't clear how you now were calcuating the the ScInputBarGroup width, I'd like to have seen the code for that I'm sending the fix patch here which calculates the height and width of the ScInputbarGroup and makes the border invisible. Anyway some comments on what is there so far, I think the ScInputBarGroup is taking shape, clearly it's very rough at this stage ( understandable since you had problems getting it to show ). One thing I would suggest here to a) change the name of ScTextWindow to something like ScMultiLineTxtWin ( or any other suitable name ) b) restore the orig ScTextWindow class There is no class named as ScTextWindow and never was. It has always been ScTextWnd--ScInputWindow and now it has become like ScTextWnd--ScInputBarGroup--ScInputWidow I suggest this because it is intended when the gsoc code is initially integrated that it be configurable and for this reason it probably makes sense to preserve the original ScTextWindow class and distinguish it from your new implementation. This will make maintenance easier. So I guess there should not be any problem with the maintenance of code as I've not renamed any pre existing class and just inserted a new class i.e ScInputBarGroup. Then next thing to concentrate on is getting the multi-line textbox functionality to work and to make that behaviour switchable. I believe Kohei suggested adding a button to the ScInputBarGroup window. So, you need to be able to detect the button click and switch the state of the bIsMultiLine flag that you have already added ( presumably for this purpose ) please do a grep for PushButton SetClickHdl in sc for sample code for handling the button. Next hurdle which I'm trying to get through is getting the Scrollbar and Button at the right position after the Textbar ends. Does the function SetPosSizePixel() or SetPosPixel() in window.hxx can be used for getting them at the desired position. Or is there any other more modular way to decide the ordering of these items similar to InsertWindow() and InsetItem() methods used in ScInputWindow ? When you get a button click you will need to resize your InputBarGroupbox window based on the new state of the bIsMultiLine flag and of course increase the height in multiples of the calculated height of a single line. e.g. in Multiline mode the ScInputGroupBox height should be some multiple of the calculated singleline height ( maybe 10 as a default ? ) Of course the size of the ScMultiLineTxtWin (let's call it that for now but please rename it as you wish ) window needs to also be adjusted and everything resized. I would do this first before worrying about scrollbar behaviour. yes as soon as I get things placed in right place I'll be working on switching from single line to multiline mode on the button click. regards Noel Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index c3d0ffc..dc12376 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -140,7 +140,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : ToolBox ( pParent, WinBits(WB_BORDER|WB_3DLOOK|WB_CLIPCHILDREN) ), aWndPos ( this ), // maScrollBar ( this, WB_VERT | WB_DRAG ), -aBarGroup ( this ), +aBarGroup ( this), pInputHdl ( NULL ), pBindings ( pBind ), aTextOk ( ScResId( SCSTR_QHELP_BTNOK ) ), // not always new from Resource @@ -179,14 +179,6 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : //aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); //aTextWindow.SetHelpId ( HID_INSWIN_INPUT ); -/* -maScrollBar.SetPageSize( 1 ); -maScrollBar.SetVisibleSize( 1 ); -maScrollBar.SetLineSize( 1 ); -maScrollBar.SetRange( Range( 0, 1 ) ); -maScrollBar.SetThumbPos( 10 ); -*/ - // kein SetHelpText, die Hilfetexte kommen aus der Hilfe SetItemText ( SID_INPUT_FUNCTION, ScResId( SCSTR_QHELP_BTNCALC ) ); @@ -496,6 +488,15 @@ void ScInputWindow::Resize() { ToolBox::Resize(); +long nWidth = GetSizePixel().Width(); +long nLeft = aBarGroup.GetPosPixel().X(); +Size aSize = aBarGroup.GetSizePixel(); + +aSize.Width
[Libreoffice] [GSOC][PATCH] Multiline inputbar
Hi Noel, Please review the patch I'm sending here. I did not have luck getting the control shown up. Please guide me what I'm missing ? Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --cc sc/source/ui/app/inputwin.cxx index 0fed037,edffb0a..000 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@@ -140,7 -140,7 +140,7 @@@ ScInputWindow::ScInputWindow( Window* p ToolBox ( pParent, WinBits(WB_BORDER|WB_3DLOOK|WB_CLIPCHILDREN) ), aWndPos ( this ), // maScrollBar ( this, WB_VERT | WB_DRAG ), --aTextWindow ( this ), ++aBarGroup ( this ), pInputHdl ( NULL ), pBindings ( pBind ), aTextOk ( ScResId( SCSTR_QHELP_BTNOK ) ), // not always new from Resource @@@ -171,13 -171,13 +171,13 @@@ InsertItem ( SID_INPUT_SUM, IMAGE( SID_INPUT_SUM ), 0, 3 ); InsertItem ( SID_INPUT_EQUAL, IMAGE( SID_INPUT_EQUAL ), 0,4 ); InsertSeparator ( 5 ); --InsertWindow( 7, aTextWindow, 0, 6 ); ++InsertWindow( 7, aBarGroup, 0, 6 ); // InsertWindow( 8, maScrollBar, 0, 8 ); aWndPos .SetQuickHelpText( ScResId( SCSTR_QHELP_POSWND ) ); aWndPos.SetHelpId ( HID_INSWIN_POS ); --aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); --aTextWindow.SetHelpId ( HID_INSWIN_INPUT ); ++//aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); ++//aTextWindow.SetHelpId ( HID_INSWIN_INPUT ); /* maScrollBar.SetPageSize( 1 ); @@@ -202,7 -202,7 +202,7 @@@ aWndPos .Show(); // maScrollBar .Show(); --aTextWindow .Show(); ++aBarGroup .Show(); pInputHdl = SC_MOD()-GetInputHdl( pViewSh, false );// use own handler even if ref-handler is set if (pInputHdl) @@@ -214,7 -214,7 +214,7 @@@ // - Inhalt des Funktionsautopiloten wieder anzeigen //! auch Selektion (am InputHdl gemerkt) wieder anzeigen --aTextWindow.SetTextString( pInputHdl-GetFormString() ); ++aBarGroup.SetTextString( pInputHdl-GetFormString() ); } else if ( pInputHdl pInputHdl-IsInputMode() ) { @@@ -222,7 -222,7 +222,7 @@@ // (Editieren einer Formel, dann umschalten zu fremdem Dokument/Hilfe), // wieder den gerade editierten Text aus dem InputHandler anzeigen --aTextWindow.SetTextString( pInputHdl-GetEditString() ); // Text anzeigen ++aBarGroup.SetTextString( pInputHdl-GetEditString() ); // Text anzeigen if ( pInputHdl-IsTopMode() ) pInputHdl-SetMode( SC_INPUT_TABLE ); // Focus kommt eh nach unten } @@@ -365,7 -365,7 +365,7 @@@ void ScInputWindow::Select( case SID_INPUT_OK: pScMod-InputEnterHandler(); SetSumAssignMode(); --aTextWindow.Invalidate(); // sonst bleibt Selektion stehen ++aBarGroup.Invalidate(); // sonst bleibt Selektion stehen break; case SID_INPUT_SUM: @@@ -472,13 -472,13 +472,13 @@@ case SID_INPUT_EQUAL: { --aTextWindow.StartEditEngine(); ++aBarGroup.StartEditEngine(); if ( pScMod-IsEditMode() ) // nicht, wenn z.B. geschuetzt { --aTextWindow.GrabFocus(); --aTextWindow.SetTextString( '=' ); ++aBarGroup.GainFocus(); ++aBarGroup.SetTextString( '=' ); --EditView* pView = aTextWindow.GetEditView(); ++EditView* pView = aBarGroup.GetEditView(); if (pView) { pView-SetSelection( ESelection(0,1, 0,1) ); @@@ -496,17 -496,17 +496,7 @@@ void ScInputWindow::Resize( { ToolBox::Resize(); --long nWidth = GetSizePixel().Width(); --long nLeft = aTextWindow.GetPosPixel().X(); --Size aSize = aTextWindow.GetSizePixel(); -- --aSize.Width() = Max( ((long)(nWidth - nLeft - 40)), (long)0 ); -- --//printf(Inside ScInputWindow:Resize()\n); --//printf(nWidth %ld nLeft %ld aSize.Width%ld \n,nWidth, nLeft, aSize.Width()); -- --aTextWindow.SetSizePixel( aSize ); --aTextWindow.Invalidate(); ++aBarGroup.Resize(); } void ScInputWindow::SetFuncString( const String rString, sal_Bool bDoEdit ) @@@ -514,15 -514,15 +504,15 @@@ //! new method at ScModule to query if function autopilot is open SfxViewFrame* pViewFrm = SfxViewFrame::Current(); EnableButtons( pViewFrm !pViewFrm-GetChildWindow( SID_OPENDLG_FUNCTION ) ); --aTextWindow.StartEditEngine(); ++aBarGroup.StartEditEngine(); ScModule* pScMod = SC_MOD(); if ( pScMod-IsEditMode() ) { if ( bDoEdit ) --aTextWindow.GrabFocus
Re: [Libreoffice] [GSOC][PATCH] Multiline inputbar
Hi Noel, Actually the problem started from not doing a git pull on my end after Kohei pushing my patch (created using git diff) as I went on making changes. In order to resolve this I ran git stash; git pull; and then git stash pop; And I made some more changes and sent you the same patch generated by git diff. Where things would have gone wrong ? Anyways since I'm not a git expert as you said to checkout a fresh SC; can you send me the git command which need to be run on my side. Or will a git reset Hard followed by pull will do the trick ? On Wed, Jun 22, 2011 at 12:57 AM, Noel Power nopo...@novell.com wrote: Hi Anurag On 21/06/11 18:59, Anurag Jain wrote: Hi Noel, Please review the patch I'm sending here. I did not have luck getting the control shown up. Please guide me what I'm missing ? Thanks and regards Sorry I think you need to redo the patch, it doesn't apply for me ( or at least the hunks to inputwin.hxx don't ) And looking at it it's clear the diff is not against the feature branch but some local version that you have :-( for instance have a look at the final hunk and you can see there is a ScInputBarGroup in the context ( but of course that doesn't exist yet ) @@ -230,7 +229,6 @@ protected: private: ScPosWnd aWndPos; -// ScTextWnd aTextWindow; ScInputBarGroup aBarGroup; ScInputHandler* pInputHdl; SfxBindings* pBindings; If I was you I would check out a fresh sc ( from the branch ) and do a diff against your local files ( there are only 2 ) or alternatively send me the inputwin.[ch]xx files thanks, Noel Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][Report] MultiLine InputBar
Hello Kohei, Noel This is the brief of my work for this week. As I was supposed to create a new container class which will contain ScTextWnd obejct + ScrollBar + Button object, I've done so. Also I've tunneled the calls to ScTextWnd from ScInputWindow via the new methods created into the ScInputBarGroup(new class which I've created). But the problem I'm facing is now when I removed the aTextWnd.Show() from constructor of ScInputWindow and added it into the ScInputBarGroup's constructor the inputbar will not appear. I've passed the ScInputBarGroup's object in InsertWindow() function though. But Still not able to figure out what might be the problem. I'm working on it. Hope I'll figure it out soon and I'm not able to come online because of the internet connection problem; but it will be resolved soon. Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC] Multiline Inputbar
Hi Kohei, Here I'm drafting the basic flow work for implementing my task. As of now this mainly focus on Scrollbar but I'll be expanding on it for the button also. 1:Creating a contain class inheriting Window class with the objects ScinputWnd, ScrollBar and PushButton. 2: Now the ScInputWnd which used to contain the object or ScTextWnd i.e. aTextWnd will now have the object of this new class and all the functions of ScInputWindow which used to use aTextWnd to call the ScTextWnd function, will now call the similar functions defined in this new class which again will call the underlying ScTextWnd functions. So the hierarchy can be ScInputWindow---NewClass---ScTextwnd 3: Now in the constructor I'd initialize attributes of ScrollBar like Start position, Thumb pixel size, Thumb pixel range, Thumb pixel position, Page Size, Line Size and Visible Size (What is it actually ?). 4: Embed this object of new class into the InsertWindow() function of ScInputWindow. This is my outline so far as I've understood the track. Please correct me if there is anything which I'm missing. I'm going through the scrollbar code as of now. @Kohei Can you point me to some code where scrollbar has got similar implementation ? Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][patch] Multiline inputbar
Hello Kohei, I was able to figure out how to make the text appear properly in the inputbar when in single line mode. I'm sending my patch over here. Please have a look into it and let me know about further improvements that can be done. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index db934bd..044fcb7 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -787,19 +787,29 @@ void ScTextWnd::Paint( const Rectangle rRec ) InitEditEngine(SfxObjectShell::Current()); if (pEditView) +{ + pEditView-Paint(rRec); + +} } + + void ScTextWnd::Resize() { if (pEditView) { Size aSize = GetOutputSizePixel(); -Point aPos(0, 0); +int count = pEditEngine-GetLineCount(0); +printf(%d %d\n, aSize.Height() , count); +//Point aPos(0,(count-1)*aSize.Height()); +Point aPos(TEXT_STARTPOS,aSize.Height()/4); +Point aPos2(aSize.Width()-5,3*aSize.Height()/4); // TODO : When in single line mode, set the height to the height of a // single line, and set the position so that the text look centered. pEditView-SetOutputArea( -PixelToLogic(Rectangle(aPos, aSize))); +PixelToLogic(Rectangle(aPos, aPos2))); } } ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [GSOC][patch] Multiline inputbar
Hi Kohei, Have a look into this. I've fixed the display problem with the j and g letters. On Tue, Jun 7, 2011 at 12:57 AM, Kohei Yoshida kyosh...@novell.com wrote: Hi Anurag, On Tue, 2011-06-07 at 00:15 +0530, Anurag Jain wrote: Hello Kohei, I was able to figure out how to make the text appear properly in the inputbar when in single line mode. I'm sending my patch over here. Please have a look into it and let me know about further improvements that can be done. We talked a bit in IRC but just to let the list know... This change looks great! The text gets wrapped and the cursor moves to the next line as the line reaches the full width of the input bar. And the up/down arrow keys shifts the cursor to the previous/next line as you would expect. Good work! :-) Thanks Kohei for the feedback and the motivation. ;) Now, a minor nit pick is that, the very lower portion of the text appears to be cut off. For instance, when you type 'j', the lower portion of the letter is not displayed and it looks like 'i'. Have you tried EditEngine::GetTextHeight() ? That may give you a more appropriate height to use rather than hard-coding it to the 1/4 of the height of the input box. Yeah this patch will fix the j and g thing. Also I'll remove the hard coding once you let me know about this patch. I've checked in this change to your feature branch, though I didn't check in those extra blank lines. Yeah I'll take care of such things. Kohei -- Kohei Yoshida, LibreOffice hacker, Calc kyosh...@novell.com Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index db934bd..b77d7c4 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -787,19 +787,29 @@ void ScTextWnd::Paint( const Rectangle rRec ) InitEditEngine(SfxObjectShell::Current()); if (pEditView) +{ + pEditView-Paint(rRec); + +} } + + void ScTextWnd::Resize() { if (pEditView) { Size aSize = GetOutputSizePixel(); -Point aPos(0, 0); +int count = pEditEngine-GetLineCount(0); +printf(%d %d\n, aSize.Height() , count); +//Point aPos(0,(count-1)*aSize.Height()); +Point aPos(TEXT_STARTPOS,4*aSize.Height()/22); +Point aPos2(aSize.Width()-5,18*aSize.Height()/22); // TODO : When in single line mode, set the height to the height of a // single line, and set the position so that the text look centered. pEditView-SetOutputArea( -PixelToLogic(Rectangle(aPos, aSize))); +PixelToLogic(Rectangle(aPos, aPos2))); } } ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][patch] Multiline inputbar
Hello Kohei, In this patch I've removed the hard coded values for the height Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index db934bd..130ea63 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -795,11 +795,16 @@ void ScTextWnd::Resize() if (pEditView) { Size aSize = GetOutputSizePixel(); -Point aPos(0, 0); +Size bSize = LogicToPixel(Size(0,pEditEngine-GetLineHeight(0,0))); +int nDiff=(aSize.Height()-bSize.Height())/2; +printf(here %d %d %d\n, nDiff , bSize.Height(), aSize.Height()); +//Point aPos(0,(count-1)*aSize.Height()); +Point aPos(TEXT_STARTPOS,nDiff*aSize.Height()/aSize.Height()); +Point aPos2(aSize.Width()-5,(aSize.Height()-nDiff)*aSize.Height()/aSize.Height()); // TODO : When in single line mode, set the height to the height of a // single line, and set the position so that the text look centered. pEditView-SetOutputArea( -PixelToLogic(Rectangle(aPos, aSize))); +PixelToLogic(Rectangle(aPos, aPos2))); } } ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC] make install fails
Hello there, I guess after a lot of changes LO build system, make install fails for me. Here is the output http://pastebin.com/nNNyiV86 . Also previously for me while doing a make here used to be 163 module (i.e. smoketestoo_native was not executed) and I was able to install it using make dev-install in /libo/install/program/ directory. But now make dev-install starts the build again with 165 modules along with the smoketest00_native which eventually freezes after opening and closing some calc, write windows (with smoketestdoc.sxw as the one persistently open) with the last message as [Java framework] The JRE specified by the bootstrap variable UNO_JAVA_JFW_JREHOME or UNO_JAVA_JFW_ENV_JREHOME could not be recognized. Check the values and make sure that you use a plug-in library that can recognize that JRE. I'm using Ubuntu10.04 as my platform. So how to go with the developer install now ? or is there a way how can we skip the smoke test and run the install as it used to be before ? Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC] build fails for chart2 module
Hello Kohei, After make clean build seems to fail again here for chart2 module while compiling chart2/source/controller/mainShapeController.cxx . This is the output. http://pastebin.com/AYj1Bbf0 Its the same error which I mentioned over IRC today. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [GOSC][Patch] multi line input bar
Hello kohei, Sorry for the mistake. This is the updated patch. On Sun, May 22, 2011 at 4:50 PM, Anurag Jain anuragjain...@gmail.com wrote: Hello Kohei, Please find the patch below and let me know your feedback. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 8019fee..4f9abfa 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -78,7 +78,7 @@ #include AccessibleEditObject.hxx #include AccessibleText.hxx -#define TEXT_STARTPOS 3 +#define TEXT_STARTPOS 5 #define THESIZE100 //!!! langt... :-) #define TBX_WINDOW_HEIGHT 22 // in Pixeln - fuer alle Systeme gleich? @@ -504,8 +504,8 @@ void ScInputWindow::Resize() aSize.Width() = Max( ((long)(nWidth - nLeft - 40)), (long)0 ); -printf(Inside ScInputWindow:Resize()\n); -printf(nWidth %ld nLeft %ld aSize.Width%ld \n,nWidth, nLeft, aSize.Width()); +//printf(Inside ScInputWindow:Resize()\n); +//printf(nWidth %ld nLeft %ld aSize.Width%ld \n,nWidth, nLeft, aSize.Width()); aTextWindow.SetSizePixel( aSize ); aTextWindow.Invalidate(); @@ -555,11 +555,11 @@ void ScInputWindow::SetTextString( const String rString ) if (rString.Len() = 32767) { aTextWindow.SetTextString(rString); -printf(%d ScInputWnd:SetTextString(), if \n,i); +//printf(%d ScInputWnd:SetTextString(), if \n,i); } else { -printf(%d ScInputWnd:SetTextString(), else \n,i); +//printf(%d ScInputWnd:SetTextString(), else \n,i); String aNew = rString; aNew.Erase(32767); aTextWindow.SetTextString(aNew); @@ -761,13 +761,16 @@ ScTextWnd::ScTextWnd( Window* pParent ) Size aSize(1,TBX_WINDOW_HEIGHT); Size aMinEditSize( Edit::GetMinimumEditSize() ); +printf(construstor of ScTextWnd edit height %ld edit width%ld\n,aMinEditSize.Height() , aMinEditSize.Width() ); if( aMinEditSize.Height() aSize.Height() ) aSize.Height() = aMinEditSize.Height(); +printf(So aSize is %ld %ld \n,aSize.Width(), aSize.Height()); SetSizePixel ( aSize ); SetBackground ( aBgColor ); SetLineColor ( COL_BLACK ); SetMapMode ( MAP_TWIP ); SetPointer ( POINTER_TEXT ); +//StartEditEngine(); } ScTextWnd::~ScTextWnd() @@ -781,17 +784,30 @@ ScTextWnd::~ScTextWnd() void ScTextWnd::Paint( const Rectangle rRec ) { -if (pEditView) -pEditView-Paint( rRec ); + if (pEditView) +{ + long x =GetOutputSizePixel().Width(); + long hHeight=LogicToPixel(Size(0,pEditEngine-GetLineHeight(0,0))).Height(); + long lCount=pEditEngine-GetLineCount(0); + + pEditEngine-Draw(this, rRec, Point(TEXT_STARTPOS, (lCount-1)*hHeight), true); +//pEditView-Paint(rRec); + printf(rectangle drawn height %ld count %ld\n,hHeight,lCount); +//pEditEngine-SetPaperSize(PixelToLogic(Size(x,lCount1?(lCount)*hHeight:hHeight))); +} else { SetFont( aTextFont ); - +long a =GetOutputSizePixel().Height(); +long b =GetOutputSizePixel().Width(); +long c =LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); +long d =LogicToPixel( Size( 0, GetTextHeight() ) ).Width(); long nDiff = GetOutputSizePixel().Height() - LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); // if (nDiff2) nDiff=2; // mind. 1 Pixel long nStartPos = TEXT_STARTPOS; +printf(ScTextWnd::Paint() nDiff: %ld GOSPH %ld GOSPW %ld\n,nDiff,a,b); if ( bIsRTL ) { // right-align @@ -801,9 +817,10 @@ void ScTextWnd::Paint( const Rectangle rRec ) // LayoutMode isn't changed as long as ModifyRTLDefaults doesn't include SvxFrameDirectionItem } -printf(ScTextWnd::Paint() nDiff: %ld GOSP height %ld text height \n,nDiff, GetOutputSizePixel().Height(), LogicToPixel( Size( 0, GetTextHeight() ) ).Height()); +printf(ScTextWnd::Paint() text Height %ld text width %ld \n,c,d); DrawText( PixelToLogic( Point( nStartPos, nDiff/2 ) ), aString ); +//pEditEngine-Draw(this, rRec, Point( nStartPos, nDiff/2 ) ,false); } } @@ -812,12 +829,17 @@ void ScTextWnd::Resize() if (pEditView) { Size aSize = GetOutputSizePixel(); +long a =aSize.Height(); +long b =aSize.Width(); +long c =LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); +long d =LogicToPixel( Size( 0, GetTextHeight() ) ).Width(); + long nDiff = aSize.Height() - LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); aSize.Width() -= 2 * TEXT_STARTPOS - 1; -printf(ScTextWnd:Resize() width %ld \n,aSize.Width
[Libreoffice] [GSOC] Multi line input bar
Hello there, I've been trying to work on getting the word wrap work in the input bar of ScTextWnd and come up with following inferences. In the Paint() function the 'if' part is executed when we the focus is on input bar after mouse button down event, which invokes the StartEditEngine() function creating objects necessary for making use of the EditEngine class. EditEngine stops as the focus shifts from the input bar to spreadsheet cells. Incase if we click on the cell and type the string the else part is executed where the OutputDevice's DrawText() method is called and EditEngine will not be used. Since the logic for wrapping the text is to set the paper size using the function SetPaperSize() in EditEngine which takes width and height parameters. I tried passing the width and height of the inputbar but I'm not able to get the proper scroll height offered by it, i.e. after wrapping the cursor shifts a bit down showing the lower portion of the upper line and hiding that of the current line. That's what I've modified, but Couldn't get the desired result. Size barSize=GetOutputSizePixel(); Size pSize =LogicToPixel(pEditEngine-GetPaperSize()); long barHeight=barSize.Height(); long textHeight=LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); long nDiff = (barHeight - textHeight)/2; barSize.Height()+=2*nDiff + barHeight; barSize.Width() -= 2*TEXT_STARTPOS-4; pEditEngine-SetUpdateMode( false ); pEditEngine-SetPaperSize( PixelToLogic(Size(barSize)) ); @Kohei as you suggested to use the upper corner of the input bar to draw the string, which I guess is the same as set by the DrawText in Paint itself. Also I tried going for using the EditEngine completely so I replaced everything inside Paint() with this code. void ScTextWnd::Paint( const Rectangle rRec ) { SetFont( aTextFont ); long a =GetOutputSizePixel().Height(); long b =GetOutputSizePixel().Width(); long c =LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); long d =LogicToPixel( Size( 0, GetTextHeight() ) ).Width(); long nDiff = GetOutputSizePixel().Height() - LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); long nStartPos = TEXT_STARTPOS; if ( bIsRTL ) { // right-align nStartPos += GetOutputSizePixel().Width() - 2*TEXT_STARTPOS - LogicToPixel( Size( GetTextWidth( aString ), 0 ) ).Width(); } StartEditEngine(); //starting edit engine pEditEngine-Draw(this, rRec, Point( nStartPos, nDiff/2 ),false); } After doing so, the wrap happens for the first line only without scroll and things turned messy afterwards I think I'm missing something here, may be I need to work on some more methods and manipulate them accordingly. I'd like to have suggestions about this thing, so that I can improvise more and more. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][PATCH] Multiline inputbar
} +printf(ScTextWnd::Paint() nDiff: %ld GOSP height %ld text height \n,nDiff, GetOutputSizePixel().Height(), LogicToPixel( Size( 0, GetTextHeight() ) ).Height()); + DrawText( PixelToLogic( Point( nStartPos, nDiff/2 ) ), aString ); } } @@ -793,6 +817,8 @@ void ScTextWnd::Resize() aSize.Width() -= 2 * TEXT_STARTPOS - 1; +printf(ScTextWnd:Resize() width %ld \n,aSize.Width()); + pEditView-SetOutputArea( PixelToLogic( Rectangle( Point( TEXT_STARTPOS, (nDiff 0) ? nDiff/2 : 1 ), aSize ) ) ); @@ -1036,8 +1062,16 @@ void ScTextWnd::StartEditEngine() pNew-SetExecuteURL( false ); pEditEngine = pNew; +Size barSize=GetOutputSizePixel(); + +long barHeight=barSize.Height(); +long textHeight=LogicToPixel( Size( 0, GetTextHeight() ) ).Height(); +long nDiff = barHeight - textHeight; + +barSize.Height()=nDiff+barHeight; +barSize.Width() -= 2*TEXT_STARTPOS-4; pEditEngine-SetUpdateMode( false ); -pEditEngine-SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) ); +pEditEngine-SetPaperSize( PixelToLogic(barSize) ); pEditEngine-SetWordDelimiters( ScEditUtil::ModifyDelimiters( pEditEngine-GetWordDelimiters() ) ); diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index 6c3785d..338020a 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -34,6 +34,7 @@ #include sfx2/childwin.hxx #include svl/lstner.hxx #include vcl/combobox.hxx +#include vcl/scrbar.hxx #include vcl/window.hxx #include svtools/transfer.hxx @@ -115,7 +116,7 @@ private: // -class ScPosWnd : public ComboBox, public SfxListener // Positionsanzeige +class ScPosWnd : public ComboBox, public SfxListener // Position window { private: String aPosStr; @@ -199,6 +200,7 @@ protected: private: ScPosWnd aWndPos; +// ScrollBar maScrollBar; ScTextWnd aTextWindow; ScInputHandler*pInputHdl; SfxBindings*pBindings; Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC] Regarding ./g pull -r
Hello there, I've been trying to pull the changes using ./g pull -r and got this output. Seems there are conflicts in sw module. I guess it is because of the patch I submitted earlier. Have a look at the output here http://pastebin.com/zdtYtuir And this is the output of git diff in sw module http://pastebin.com/VUUk15gp. Please help me out with how to resolve these conflicts. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSOC][Urgent] Build fails
Hello there I tried to update my Lo clone and ended up with failed build for vcl and odx modules. Here are the partial build outputs. http://pastebin.com/WmFK1Ykf Please let me know of the solution, so that I can start working on my project after ASAP. Awaiting reply Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [GSoc] Project progress.
Hello there, My project named Implementing multi-line input bar in LO Calc is aimed at making the editing in input bar of calc more easier by making it multi-line with word-wrap and scrolling feature. Long before the GSoC I've been under continuous contact and guidance by Kohei Yoshida, my mentor; whom I'm very thankful. I've been talking to him over IRC and been learning lot of things from him. So here I'll point down the work which I've done so far. 1: My main work is related to the inputwin.hxx and inputwin.cxx in sc module and more specifically to ScTextWnd and ScInputWnd classes. I'm learning the code and trying to understand it. 2: Since my task required implementation of scrollbar (I've also read scrollbar class in vcl/scrbar.hxx) and push button, I've reduced the size of the inputbar in order to accommodate these two components. 3: After that I've to implement the word-wrap in the content text. In this I've set the page size of the the textbar using the functions in EditEngine which I'm still working on. As of now I've got a basic word wrap working equally to the size of input bar. I've still to work on the text scroll height which it (Edit Engine) offers. 4: Then I'll go for synchronizing the scrollbar with the text wrap and using push button to show the contents fully. Apart from this I'd like to know what all patches I can send ? Like I've been playing with the code, here and there putting printf's to know the values of the variables, have been converting german comments with the help of Google translator. Should I send those patches directly, or I should clean those unnecessary codes before sending the patch ? Also I'd like to know at least how may patches does the community expects in order to get a direct commit access to LO repository. Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Staroffice module build fail
Hello there, After ./g pull -r and doing make clean make build failed for dbaccess and starmath modules. I referred the wiki and did a prtial build for dbacess which came out clean. But still I've got build issue with starmath module related to some JUnit test. please have a look here http://pastebin.com/7XPGxB3B Thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] GSOC 2011 regarding - Project Idea.
Hello there, This time I'm planning to take part in Google Summer of code 2011 and I saw the LO was mentioned in the participating organisation. So I'd like to work on some of the ideas proposed on the LO's GSOC wikihttp://wiki.documentfoundation.org/Development/Gsoc/Ideas but before that I came across one problem with Calc. One of my friend is working on neural network project which had training data in excel and csv format which had some 7000 columns. When we tried opening that in LO it showed only 1024 columns. To cross check this point I manually checked the column limit of LO calc and it was found to be 1024. But such was not the case with MS Excel 2007. I was able to copy the whole 1024 long column and paste it again making it of double and triple column length. So is there anyway this idea of increasing the column limit while maintaining the memory optimizations and compatibility with larger documents can be proposed as project idea for my GSOC application? To add to my this I've already been active in the IRC #libreoffice channel and talked to other senior developers over there. Also I've got the initial build of LO and trying my hands on learning git and trying easy hacks. Please let me know if this idea has the potential of being a GSOC proposal and guide me through so that I can do something worthy this summer. thanks and regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Help regarding build from source
Hello there, I'm a computer science student and want to get into the libre office development. I went on to IRC # libre office channel for sometime and got help regarding the git repository cloning and have fetched the source code. I already have Libreoffice installed on my ubuntu 10.04 system using PPA; so if I try to buld it libre office from the source which I just fetched will it affect the existing installation of libre office. Do I need to remove the pre exesting libre office before I start building from source ? Please help me out with this and suggest mehow to move ahead on the path of contributing to libre office . Thanks and regards. -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice