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


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
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 8019fee..c209a4f 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 THESIZE                                1000000 //!!! 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,lCount>1?(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 (nDiff<2) 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,13 @@ void ScTextWnd::Resize()
     if (pEditView)
     {
         Size aSize = GetOutputSizePixel();
+
         long nDiff =  aSize.Height()
                     - LogicToPixel( Size( 0, GetTextHeight() ) ).Height();
 
         aSize.Width() -= 2 * TEXT_STARTPOS - 1;
 
-        printf("ScTextWnd:Resize() width %ld \n",aSize.Width());
+        printf("ScTextWnd:Resize() gosph %ld gosphw %ld texth %ld textw %ld aSize.width() 
%ld\n",a,b,c,d,aSize.Width() );
 
         pEditView->SetOutputArea(
             PixelToLogic( Rectangle( Point( TEXT_STARTPOS, (nDiff > 0) ? nDiff/2 : 1 ),
@@ -966,7 +984,7 @@ void ScTextWnd::LoseFocus()
 String ScTextWnd::GetText() const
 {
     // ueberladen, um per Testtool an den Text heranzukommen
-
+printf("ScTextWnd::GetText()\n");
     if ( pEditEngine )
         return pEditEngine->GetText();
     else
@@ -1044,12 +1062,14 @@ void lcl_ModifyRTLVisArea( EditView* pEditView )
 void ScTextWnd::StartEditEngine()
 {
     // Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
+
     SfxObjectShell* pObjSh = SfxObjectShell::Current();
     if ( pObjSh && pObjSh->IsInModalMode() )
         return;
 
     if ( !pEditView || !pEditEngine )
     {
+        printf("Starting EditEngine\n");
         ScFieldEditEngine* pNew;
         ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
         if ( pViewSh )
@@ -1071,7 +1091,7 @@ void ScTextWnd::StartEditEngine()
         barSize.Height()=nDiff+barHeight;
         barSize.Width() -= 2*TEXT_STARTPOS-4;
         pEditEngine->SetUpdateMode( false );
-        pEditEngine->SetPaperSize( PixelToLogic(barSize) );
+        pEditEngine->SetPaperSize( PixelToLogic(Size(barSize.Width(),10000)) );
         pEditEngine->SetWordDelimiters(
                         ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
 
@@ -1160,6 +1180,7 @@ IMPL_LINK(ScTextWnd, NotifyHdl, EENotify*, EMPTYARG)
 
 void ScTextWnd::StopEditEngine( sal_Bool bAll )
 {
+    printf("stopping editEngine\n");
     if (pEditView)
     {
         if (!maAccTextDatas.empty())

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.