LCOV - code coverage report
Current view: top level - libreoffice/sc/source/ui/formdlg - dwfunctr.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 434 0.5 %
Date: 2012-12-17 Functions: 4 40 10.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include <comphelper/string.hxx>
      22             : #include <editeng/editview.hxx>
      23             : #include <sfx2/bindings.hxx>
      24             : #include <sfx2/dispatch.hxx>
      25             : #include <sfx2/objsh.hxx>
      26             : #include <sfx2/viewsh.hxx>
      27             : 
      28             : #include "sc.hrc"
      29             : #include "global.hxx"       // ScAddress
      30             : #include "scresid.hxx"
      31             : #include "reffact.hxx"
      32             : #include "document.hxx"
      33             : #include "cell.hxx"
      34             : #include "scmod.hxx"
      35             : #include "inputhdl.hxx"
      36             : #include "tabvwsh.hxx"
      37             : #include "appoptio.hxx"
      38             : #include "compiler.hxx"
      39             : 
      40             : #include "dwfunctr.hrc"
      41             : #include "dwfunctr.hxx"
      42             : 
      43             : // -----------------------------------------------------------------------
      44             : 
      45          68 : SFX_IMPL_DOCKINGWINDOW_WITHID( ScFunctionChildWindow, FID_FUNCTION_BOX )
      46             : 
      47             : /*************************************************************************
      48             : #*  Member:     ScFunctionChildWindow
      49             : #*------------------------------------------------------------------------
      50             : #*
      51             : #*  Klasse:     ScFunctionChildWindow
      52             : #*
      53             : #*  Funktion:   Konstruktor der Klasse ScFunctionChildWindow
      54             : #*              Ableitung vom SfxChildWindow als "Behaelter" fuer
      55             : #*              Funktions- Fenster in Clac
      56             : #*
      57             : #*  Input:      ---
      58             : #*
      59             : #*  Output:     ---
      60             : #*
      61             : #************************************************************************/
      62             : 
      63           0 : ScFunctionChildWindow::ScFunctionChildWindow( Window* pParentP,
      64             :                                     sal_uInt16 nId,
      65             :                                     SfxBindings* pBindings,
      66             :                                     SfxChildWinInfo* pInfo ) :
      67           0 :     SfxChildWindow( pParentP, nId )
      68             : {
      69             :     ScFunctionDockWin* pWin = new ScFunctionDockWin( pBindings, this,
      70           0 :                                         pParentP, ScResId( FID_FUNCTION_BOX ) );
      71           0 :     pWindow = pWin;
      72             : 
      73           0 :     eChildAlignment = SFX_ALIGN_RIGHT;
      74             : 
      75           0 :     pWin->Initialize( pInfo );
      76           0 : }
      77             : 
      78             : /*************************************************************************
      79             : #*  Member:     ScFunctionDockWin
      80             : #*------------------------------------------------------------------------
      81             : #*
      82             : #*  Klasse:     ScFunctionDockWin
      83             : #*
      84             : #*  Funktion:   Konstruktor der Klasse ScFunctionDockWin
      85             : #*
      86             : #*  Input:      Sfx- Verknuepfungen, Fenster, Resource
      87             : #*
      88             : #*  Output:     ---
      89             : #*
      90             : #************************************************************************/
      91             : 
      92           0 : ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
      93             :                 SfxChildWindow *pCW, Window* pParent, const ResId& rResId ) :
      94             : 
      95             :     SfxDockingWindow( pBindingsP, pCW, pParent, rResId ),
      96           0 :     aPrivatSplit    ( this, ResId( FT_SPLIT, *rResId.GetResMgr()  ),SC_SPLIT_VERT),
      97           0 :     aCatBox         ( this, ResId( CB_CAT, *rResId.GetResMgr()  ) ),
      98           0 :     aFuncList       ( this, ResId( LB_FUNC, *rResId.GetResMgr()  ) ),
      99           0 :     aDDFuncList     ( this, ResId( DDLB_FUNC, *rResId.GetResMgr()  ) ),
     100           0 :     aInsertButton   ( this, ResId( IMB_INSERT, *rResId.GetResMgr()  ) ),
     101           0 :     aFiFuncDesc     ( this, ResId( FI_FUNCDESC, *rResId.GetResMgr()  ) ),
     102           0 :     aOldSize        (0,0)
     103             : {
     104           0 :     FreeResource();
     105           0 :     InitLRUList();
     106           0 :     SetStyle(GetStyle()|WB_CLIPCHILDREN);
     107             : 
     108           0 :     aTimer.SetTimeout(200);
     109           0 :     aTimer.SetTimeoutHdl(LINK( this, ScFunctionDockWin, TimerHdl));
     110             : 
     111           0 :     eSfxNewAlignment=GetAlignment();
     112           0 :     eSfxOldAlignment=eSfxNewAlignment;
     113           0 :     aFiFuncDesc.SetUpdateMode(sal_True);
     114           0 :     pAllFuncList=&aFuncList;
     115           0 :     aDDFuncList.Disable();
     116           0 :     aDDFuncList.Hide();
     117           0 :     nArgs=0;
     118           0 :     nDockMode=0;
     119           0 :     bSizeFlag=false;
     120           0 :     aCatBox.SetDropDownLineCount(9);
     121           0 :     Font aFont=aFiFuncDesc.GetFont();
     122           0 :     aFont.SetColor(Color(COL_BLACK));
     123           0 :     aFiFuncDesc.SetFont(aFont);
     124           0 :     aFiFuncDesc.SetBackground( GetBackground() );       //! never transparent?
     125             : 
     126           0 :     Link aLink=LINK( this, ScFunctionDockWin, SelHdl);
     127           0 :     aCatBox.SetSelectHdl(aLink);
     128           0 :     aFuncList.SetSelectHdl(aLink);
     129           0 :     aDDFuncList.SetSelectHdl(aLink);
     130             : 
     131           0 :     Link a2Link=LINK( this, ScFunctionDockWin, SetSelectionHdl);
     132           0 :     aFuncList.SetDoubleClickHdl(a2Link);
     133           0 :     aDDFuncList.SetSelectHdl(aLink);
     134           0 :     aInsertButton.SetClickHdl(a2Link);
     135             : 
     136           0 :     Link a3Link=LINK( this, ScFunctionDockWin, SetSplitHdl);
     137           0 :     aPrivatSplit.SetCtrModifiedHdl(a3Link);
     138           0 :     StartListening( *pBindingsP, sal_True );
     139             : 
     140           0 :     Point aTopLeft=aCatBox.GetPosPixel();
     141           0 :     rtl::OUString aString("ww");
     142           0 :     Size aTxtSize( aFiFuncDesc.GetTextWidth(aString), aFiFuncDesc.GetTextHeight() );
     143           0 :     nMinWidth=aTxtSize.Width()+aTopLeft.X()
     144           0 :             +2*aFuncList.GetPosPixel().X();
     145           0 :     nMinHeight=19*aTxtSize.Height();
     146           0 :     aCatBox.SelectEntryPos(0);
     147             : 
     148           0 :     Range aYRange(3*aTxtSize.Height()+aFuncList.GetPosPixel().Y(),
     149           0 :                 GetOutputSizePixel().Height()-2*aTxtSize.Height());
     150           0 :     aPrivatSplit.SetYRange(aYRange);
     151           0 :     SelHdl(&aCatBox);
     152           0 :     bInit=sal_True;
     153           0 : }
     154             : 
     155             : /*************************************************************************
     156             : #*  Member:     ScFunctionDockWin
     157             : #*------------------------------------------------------------------------
     158             : #*
     159             : #*  Klasse:     ScFunctionDockWin
     160             : #*
     161             : #*  Funktion:   Destruktor der Klasse ScFunctionDockWin
     162             : #*
     163             : #*  Input:      ---
     164             : #*
     165             : #*  Output:     ---
     166             : #*
     167             : #************************************************************************/
     168             : 
     169           0 : ScFunctionDockWin::~ScFunctionDockWin()
     170             : {
     171           0 :     EndListening( GetBindings() );
     172           0 : }
     173             : 
     174             : /*************************************************************************
     175             : #*  Member:     UpdateFunctionList
     176             : #*------------------------------------------------------------------------
     177             : #*
     178             : #*  Klasse:     ScFunctionDockWin
     179             : #*
     180             : #*  Funktion:   Aktualisiert die Liste der Funktionen ab-
     181             : #*              haengig von der eingestellten Kategorie.
     182             : #*
     183             : #*  Input:      ---
     184             : #*
     185             : #*  Output:     ---
     186             : #*
     187             : #************************************************************************/
     188             : 
     189           0 : void ScFunctionDockWin::InitLRUList()
     190             : {
     191           0 :     ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
     192           0 :     pFuncMgr->fillLastRecentlyUsedFunctions(aLRUList);
     193             : 
     194             : 
     195           0 :     sal_uInt16  nSelPos   = aCatBox.GetSelectEntryPos();
     196             : 
     197           0 :     if(nSelPos == 0)
     198           0 :         UpdateFunctionList();
     199           0 : }
     200             : 
     201             : /*************************************************************************
     202             : #*  Member:     UpdateFunctionList
     203             : #*------------------------------------------------------------------------
     204             : #*
     205             : #*  Klasse:     ScFunctionDockWin
     206             : #*
     207             : #*  Funktion:   Aktualisiert die Liste der zuletzt verwendeten Funktionen.
     208             : #*
     209             : #*  Input:      ---
     210             : #*
     211             : #*  Output:     ---
     212             : #*
     213             : #************************************************************************/
     214             : 
     215           0 : void ScFunctionDockWin::UpdateLRUList()
     216             : {
     217           0 :     if (pFuncDesc && pFuncDesc->nFIndex!=0)
     218             :     {
     219           0 :         ScModule* pScMod = SC_MOD();
     220           0 :         pScMod->InsertEntryToLRUList(pFuncDesc->nFIndex);
     221             :     }
     222           0 : }
     223             : 
     224             : 
     225             : /*************************************************************************
     226             : #*  Member:     SetSize
     227             : #*------------------------------------------------------------------------
     228             : #*
     229             : #*  Klasse:     ScFunctionDockWin
     230             : #*
     231             : #*  Funktion:   Groesse fuer die einzelnen Controls einzustellen.
     232             : #*
     233             : #*  Input:      ---
     234             : #*
     235             : #*  Output:     ---
     236             : #*
     237             : #************************************************************************/
     238             : 
     239           0 : void ScFunctionDockWin::SetSize()
     240             : {
     241           0 :     sal_uInt16 nSelEntry=0;
     242           0 :     SfxChildAlignment  aChildAlign=eSfxOldAlignment;//GetAlignment();
     243             :     short nNewDockMode;
     244           0 :     switch(aChildAlign)
     245             :     {
     246             :         case SFX_ALIGN_HIGHESTTOP:
     247             :         case SFX_ALIGN_TOP:
     248             :         case SFX_ALIGN_LOWESTTOP:
     249             :         case SFX_ALIGN_LOWESTBOTTOM:
     250             :         case SFX_ALIGN_BOTTOM:
     251             :         case SFX_ALIGN_TOOLBOXTOP:
     252             :         case SFX_ALIGN_TOOLBOXBOTTOM:
     253             : 
     254             : 
     255           0 :                         nNewDockMode=1;
     256           0 :                         if(nDockMode!=nNewDockMode)
     257             :                         {
     258           0 :                             nDockMode=nNewDockMode;
     259           0 :                             nSelEntry=aFuncList.GetSelectEntryPos();
     260           0 :                             aFuncList.Clear();
     261           0 :                             aFiFuncDesc.SetPosPixel(aFuncList.GetPosPixel());
     262           0 :                             aDDFuncList.Enable();
     263           0 :                             aDDFuncList.Show();
     264           0 :                             aPrivatSplit.Disable();
     265           0 :                             aPrivatSplit.Hide();
     266           0 :                             aFuncList.Disable();
     267           0 :                             aFuncList.Hide();
     268           0 :                             pAllFuncList=&aDDFuncList;
     269           0 :                             SelHdl(&aCatBox);
     270           0 :                             aDDFuncList.SelectEntryPos(nSelEntry);
     271             :                         }
     272           0 :                         break;
     273             : 
     274           0 :         default:        nNewDockMode=0;
     275           0 :                         if(nDockMode!=nNewDockMode)
     276             :                         {
     277           0 :                             nDockMode=nNewDockMode;
     278           0 :                             nSelEntry=aDDFuncList.GetSelectEntryPos();
     279           0 :                             aDDFuncList.Clear();
     280           0 :                             aDDFuncList.Disable();
     281           0 :                             aDDFuncList.Hide();
     282           0 :                             aPrivatSplit.Enable();
     283           0 :                             aPrivatSplit.Show();
     284           0 :                             aFuncList.Enable();
     285           0 :                             aFuncList.Show();
     286           0 :                             pAllFuncList=&aFuncList;
     287           0 :                             SelHdl(&aCatBox);
     288           0 :                             aFuncList.SelectEntryPos(nSelEntry);
     289             :                         }
     290           0 :                         break;
     291             :     }
     292             : 
     293           0 :     if(nDockMode==0)
     294             :     {
     295           0 :         SetLeftRightSize();
     296             :     }
     297             :     else
     298             :     {
     299           0 :         SetTopBottonSize();
     300             :     }
     301           0 : }
     302             : /*************************************************************************
     303             : #*  Member:     SetLeftRightSize
     304             : #*------------------------------------------------------------------------
     305             : #*
     306             : #*  Klasse:     ScFunctionDockWin
     307             : #*
     308             : #*  Funktion:   Groesse fuer die einzelnen Controls einstellen,
     309             : #*              wenn Links oder Rechts angedockt wird.
     310             : #*
     311             : #*  Input:      ---
     312             : #*
     313             : #*  Output:     ---
     314             : #*
     315             : #************************************************************************/
     316             : 
     317           0 : void ScFunctionDockWin::SetLeftRightSize()
     318             : {
     319           0 :     if(bSizeFlag==false)
     320             :     {
     321           0 :         bSizeFlag=sal_True;
     322             : 
     323           0 :         Size aDiffSize=GetSizePixel();
     324           0 :         Size aNewSize=GetOutputSizePixel();
     325           0 :         aDiffSize.Width()-=aNewSize.Width();
     326           0 :         aDiffSize.Height()-=aNewSize.Height();
     327             : 
     328           0 :         rtl::OUString aString("ww");
     329           0 :         Size aTxtSize( aFuncList.GetTextWidth(aString), aFuncList.GetTextHeight() );
     330             : 
     331           0 :         Range aYRange(3*aTxtSize.Height()+aFuncList.GetPosPixel().Y(),
     332           0 :                     GetOutputSizePixel().Height()-2*aTxtSize.Height());
     333           0 :         aPrivatSplit.SetYRange(aYRange);
     334             : 
     335             : 
     336           0 :         if(aOldSize.Width()!=aNewSize.Width())
     337           0 :             SetMyWidthLeRi(aNewSize);
     338             : 
     339           0 :         if(aOldSize.Height()!=aNewSize.Height())
     340           0 :             SetMyHeightLeRi(aNewSize);
     341             : 
     342           0 :         aOldSize=aNewSize;
     343           0 :         aNewSize.Width()+=aDiffSize.Width();
     344           0 :         aNewSize.Height()+=aDiffSize.Height();
     345           0 :         bSizeFlag=false;
     346             :     }
     347             : 
     348           0 : }
     349             : /*************************************************************************
     350             : #*  Member:     SetTopBottonSize
     351             : #*------------------------------------------------------------------------
     352             : #*
     353             : #*  Klasse:     ScFunctionDockWin
     354             : #*
     355             : #*  Funktion:   Groesse fuer die einzelnen Controls einzustellen.
     356             : #*              wenn oben oder unten angedockt wird.
     357             : #*
     358             : #*  Input:      ---
     359             : #*
     360             : #*  Output:     ---
     361             : #*
     362             : #************************************************************************/
     363             : 
     364           0 : void ScFunctionDockWin::SetTopBottonSize()
     365             : {
     366           0 :     if(bSizeFlag==false)
     367             :     {
     368           0 :         bSizeFlag=sal_True;
     369           0 :         Size aDiffSize=GetSizePixel();
     370           0 :         Size aNewSize=GetOutputSizePixel();
     371           0 :         aDiffSize.Width()-=aNewSize.Width();
     372           0 :         aDiffSize.Height()-=aNewSize.Height();
     373             : 
     374           0 :         SetMyWidthToBo(aNewSize);
     375           0 :         SetMyHeightToBo(aNewSize);
     376             : 
     377           0 :         aNewSize.Width()+=aDiffSize.Width();
     378           0 :         aNewSize.Height()+=aDiffSize.Height();
     379           0 :         bSizeFlag=false;
     380             :     }
     381           0 : }
     382             : 
     383             : /*************************************************************************
     384             : #*  Member:     SetMyWidthLeRi
     385             : #*------------------------------------------------------------------------
     386             : #*
     387             : #*  Klasse:     ScFunctionDockWin
     388             : #*
     389             : #*  Funktion:   Breite fuer die einzelnen Controls und
     390             : #*              das Fenster einstellen,wenn Li oder Re
     391             : #*
     392             : #*  Input:      neue Fenstergroesse
     393             : #*
     394             : #*  Output:     ---
     395             : #*
     396             : #************************************************************************/
     397             : 
     398           0 : void ScFunctionDockWin::SetMyWidthLeRi(Size &aNewSize)
     399             : {
     400           0 :     if((sal_uLong)aNewSize.Width()<nMinWidth)   aNewSize.Width()=nMinWidth;
     401             : 
     402           0 :     Size aCDSize=aCatBox.GetSizePixel();
     403           0 :     Size aFLSize=aFuncList.GetSizePixel();
     404           0 :     Size aSplitterSize=aPrivatSplit.GetSizePixel();
     405           0 :     Size aFDSize=aFiFuncDesc.GetSizePixel();
     406             : 
     407           0 :     Point aCDTopLeft=aCatBox.GetPosPixel();
     408           0 :     Point aFLTopLeft=aFuncList.GetPosPixel();
     409             : 
     410           0 :     aCDSize.Width()=aNewSize.Width()-aCDTopLeft.X()-aFLTopLeft.X();
     411           0 :     aFLSize.Width()=aNewSize.Width()-2*aFLTopLeft.X();
     412           0 :     aFDSize.Width()=aFLSize.Width();
     413           0 :     aSplitterSize.Width()=aFLSize.Width();
     414             : 
     415           0 :     aCatBox.SetSizePixel(aCDSize);
     416           0 :     aFuncList.SetSizePixel(aFLSize);
     417           0 :     aPrivatSplit.SetSizePixel(aSplitterSize);
     418           0 :     aFiFuncDesc.SetSizePixel(aFDSize);
     419           0 : }
     420             : 
     421             : /*************************************************************************
     422             : #*  Member:     SetHeight
     423             : #*------------------------------------------------------------------------
     424             : #*
     425             : #*  Klasse:     ScFunctionDockWin
     426             : #*
     427             : #*  Funktion:   Hoehe fuer die einzelnen Controls und
     428             : #*              das Fenster einstellen bei Li oder Re
     429             : #*
     430             : #*  Input:      neue Fenstergroesse
     431             : #*
     432             : #*  Output:     ---
     433             : #*
     434             : #************************************************************************/
     435             : 
     436           0 : void ScFunctionDockWin::SetMyHeightLeRi(Size &aNewSize)
     437             : {
     438           0 :     if((sal_uLong)aNewSize.Height()<nMinHeight) aNewSize.Height()=nMinHeight;
     439             : 
     440           0 :     Size aFLSize=aFuncList.GetSizePixel();
     441           0 :     Size aSplitterSize=aPrivatSplit.GetSizePixel();
     442           0 :     Size aFDSize=aFiFuncDesc.GetSizePixel();
     443             : 
     444           0 :     Point aFLTopLeft=aFuncList.GetPosPixel();
     445           0 :     Point aSplitterTopLeft=aPrivatSplit.GetPosPixel();
     446           0 :     Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
     447             : 
     448           0 :     long nTxtHeight = aFuncList.GetTextHeight();
     449             : 
     450             :     short nY=(short)(3*nTxtHeight+
     451           0 :         aFuncList.GetPosPixel().Y()+aSplitterSize.Height());
     452             : 
     453           0 :     aFDTopLeft.Y()=aNewSize.Height()-aFDSize.Height()-4;
     454           0 :     if(nY>aFDTopLeft.Y())
     455             :     {
     456           0 :         aFDSize.Height()-=nY-aFDTopLeft.Y();
     457           0 :         aFDTopLeft.Y()=nY;
     458             :     }
     459           0 :     aSplitterTopLeft.Y()=aFDTopLeft.Y()-aSplitterSize.Height()-1;
     460           0 :     aFLSize.Height()=aSplitterTopLeft.Y()-aFLTopLeft.Y()-1;
     461             : 
     462           0 :     aFuncList.SetSizePixel(aFLSize);
     463           0 :     aPrivatSplit.SetPosPixel(aSplitterTopLeft);
     464           0 :     aFiFuncDesc.SetPosPixel(aFDTopLeft);
     465           0 :     aFiFuncDesc.SetSizePixel(aFDSize);
     466             : 
     467           0 : }
     468             : 
     469             : /*************************************************************************
     470             : #*  Member:     SetMyWidthToBo
     471             : #*------------------------------------------------------------------------
     472             : #*
     473             : #*  Klasse:     ScFunctionDockWin
     474             : #*
     475             : #*  Funktion:   Breite fuer die einzelnen Controls und
     476             : #*              das Fenster einstellen, wenn oben oder
     477             : #*              unten angedockt werden soll.
     478             : #*
     479             : #*  Input:      neue Fenstergroesse
     480             : #*
     481             : #*  Output:     ---
     482             : #*
     483             : #************************************************************************/
     484             : 
     485           0 : void ScFunctionDockWin::SetMyWidthToBo(Size &aNewSize)
     486             : {
     487           0 :     if((sal_uLong)aNewSize.Width()<nMinWidth)   aNewSize.Width()=nMinWidth;
     488             : 
     489           0 :     Size aCDSize=aCatBox.GetSizePixel();
     490           0 :     Size aDdFLSize=aDDFuncList.GetSizePixel();
     491           0 :     Size aFDSize=aFiFuncDesc.GetSizePixel();
     492             : 
     493           0 :     Point aCDTopLeft=aCatBox.GetPosPixel();
     494           0 :     Point aDdFLTopLeft=aDDFuncList.GetPosPixel();
     495           0 :     Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
     496             : 
     497           0 :     aCDSize.Width()=aDdFLTopLeft.X()-aFDTopLeft.X()-aCDTopLeft.X();
     498           0 :     aDdFLTopLeft.X()=aCDSize.Width()+aCDTopLeft.X()+aFDTopLeft.X();
     499             : 
     500           0 :     aDdFLSize.Width()=aNewSize.Width()-aDdFLTopLeft.X()-aFDTopLeft.X();
     501             : 
     502           0 :     aFDSize.Width()=aNewSize.Width()-2*aFDTopLeft.X();
     503             : 
     504           0 :     aDDFuncList.SetPosPixel(aDdFLTopLeft);
     505           0 :     aDDFuncList.SetSizePixel(aDdFLSize);
     506           0 :     aCatBox.SetSizePixel(aCDSize);
     507           0 :     aFiFuncDesc.SetSizePixel(aFDSize);
     508           0 : }
     509             : 
     510             : /*************************************************************************
     511             : #*  Member:     SetHeight
     512             : #*------------------------------------------------------------------------
     513             : #*
     514             : #*  Klasse:     ScFunctionDockWin
     515             : #*
     516             : #*  Funktion:   Hoehe fuer die einzelnen Controls und
     517             : #*              das Fenster einstellen, wenn oben oder
     518             : #*              unten angedockt werden soll.
     519             : #*
     520             : #*  Input:      neue Fenstergroesse
     521             : #*
     522             : #*  Output:     ---
     523             : #*
     524             : #************************************************************************/
     525             : 
     526           0 : void ScFunctionDockWin::SetMyHeightToBo(Size &aNewSize)
     527             : {
     528           0 :     if((sal_uLong)aNewSize.Height()<nMinHeight) aNewSize.Height()=nMinHeight;
     529             : 
     530           0 :     Size aFDSize=aFiFuncDesc.GetSizePixel();
     531             : 
     532           0 :     Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
     533           0 :     Point aCBTopLeft=aCatBox.GetPosPixel();
     534           0 :     aFDSize.Height()=aNewSize.Height()-aFDTopLeft.Y()-aCBTopLeft.Y();
     535           0 :     aFiFuncDesc.SetSizePixel(aFDSize);
     536             : 
     537           0 : }
     538             : 
     539             : /*************************************************************************
     540             : #*  Member:     SetDescription
     541             : #*------------------------------------------------------------------------
     542             : #*
     543             : #*  Klasse:     ScFunctionDockWin
     544             : #*
     545             : #*  Funktion:   Erklaerungstext fuer die Funktion einstellen.
     546             : #*
     547             : #*  Input:      ---
     548             : #*
     549             : #*  Output:     ---
     550             : #*
     551             : #************************************************************************/
     552             : 
     553           0 : void ScFunctionDockWin::SetDescription()
     554             : {
     555           0 :     aFiFuncDesc.SetText( EMPTY_STRING );
     556             :     const ScFuncDesc* pDesc =
     557             :              (const ScFuncDesc*)pAllFuncList->GetEntryData(
     558           0 :                     pAllFuncList->GetSelectEntryPos() );
     559           0 :     if (pDesc)
     560             :     {
     561           0 :         pDesc->initArgumentInfo();      // full argument info is needed
     562             : 
     563           0 :         ::rtl::OUStringBuffer aBuf(pAllFuncList->GetSelectEntry());
     564           0 :         if(nDockMode==0)
     565             :         {
     566           0 :             aBuf.appendAscii(":\n\n");
     567             :         }
     568             :         else
     569             :         {
     570           0 :             aBuf.appendAscii(":   ");
     571             :         }
     572             : 
     573           0 :         aBuf.append(pDesc->GetParamList());
     574             : 
     575           0 :         if(nDockMode==0)
     576             :         {
     577           0 :             aBuf.appendAscii("\n\n");
     578             :         }
     579             :         else
     580             :         {
     581           0 :             aBuf.appendAscii("\n");
     582             :         }
     583             : 
     584           0 :         aBuf.append(*pDesc->pFuncDesc);
     585             : 
     586           0 :         aFiFuncDesc.SetText(aBuf.makeStringAndClear());
     587           0 :         aFiFuncDesc.StateChanged(STATE_CHANGE_TEXT);
     588           0 :         aFiFuncDesc.Invalidate();
     589           0 :         aFiFuncDesc.Update();
     590             : 
     591             :     }
     592           0 :  }
     593             : 
     594             : /*************************************************************************
     595             : #*  Member:     Resizing
     596             : #*------------------------------------------------------------------------
     597             : #*
     598             : #*  Klasse:     ScFunctionDockWin
     599             : #*
     600             : #*  Funktion:   Ueberladene Funktion um die Groesse der
     601             : #*              einzelnen Controls einzustellen.
     602             : #*
     603             : #*  Input:      neue Groesse
     604             : #*
     605             : #*  Output:     ---
     606             : #*
     607             : #************************************************************************/
     608             : 
     609           0 : void ScFunctionDockWin::Resizing( Size& rNewSize )
     610             : {
     611           0 :     if((sal_uLong)rNewSize.Width()<nMinWidth) rNewSize.Width()=nMinWidth;
     612           0 :     if((sal_uLong)rNewSize.Height()<nMinHeight) rNewSize.Height()=nMinHeight;
     613             : 
     614           0 : }
     615             : 
     616             : /*************************************************************************
     617             : #*  Member:     Close
     618             : #*------------------------------------------------------------------------
     619             : #*
     620             : #*  Klasse:     ScFunctionDockWin
     621             : #*
     622             : #*  Funktion:   Schliessen des Fensters
     623             : #*
     624             : #*  Input:      ---
     625             : #*
     626             : #*  Output:     TRUE
     627             : #*
     628             : #************************************************************************/
     629             : 
     630           0 : sal_Bool ScFunctionDockWin::Close()
     631             : {
     632           0 :     SfxBoolItem aItem( FID_FUNCTION_BOX, false );
     633             : 
     634           0 :     GetBindings().GetDispatcher()->Execute( FID_FUNCTION_BOX,
     635             :                                 SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
     636           0 :                                 &aItem, 0L );
     637             : 
     638           0 :     SfxDockingWindow::Close();
     639             : 
     640           0 :     return( sal_True );
     641             : }
     642             : 
     643             : 
     644             : /*************************************************************************
     645             : #*  Member:     CheckAlignment
     646             : #*------------------------------------------------------------------------
     647             : #*
     648             : #*  Klasse:     ScFunctionDockWin
     649             : #*
     650             : #*  Funktion:   Ueberprueft den Andockmodus und stellt die
     651             : #*              Groessen dementsprechend ein.
     652             : #*
     653             : #*  Input:      Das neue Alignment
     654             : #*
     655             : #*  Output:     Das uebergebene Alignment
     656             : #*
     657             : #************************************************************************/
     658           0 : SfxChildAlignment ScFunctionDockWin::CheckAlignment(SfxChildAlignment /* abla */,
     659             :                                 SfxChildAlignment aChildAlign)
     660             : {
     661           0 :     String aString = rtl::OUString("ww");
     662           0 :     Size aTxtSize( aFiFuncDesc.GetTextWidth(aString), aFiFuncDesc.GetTextHeight() );
     663           0 :     if(!bInit)
     664             :     {
     665           0 :         eSfxOldAlignment=eSfxNewAlignment;
     666           0 :         eSfxNewAlignment=aChildAlign;
     667             :     }
     668             :     else
     669             :     {
     670           0 :         bInit=false;
     671           0 :         eSfxOldAlignment=aChildAlign;
     672           0 :         eSfxNewAlignment=aChildAlign;
     673             :     }
     674             : 
     675           0 :     switch(eSfxOldAlignment)
     676             :     {
     677             :         case SFX_ALIGN_HIGHESTTOP:
     678             :         case SFX_ALIGN_TOP:
     679             :         case SFX_ALIGN_LOWESTTOP:
     680             :         case SFX_ALIGN_LOWESTBOTTOM:
     681             :         case SFX_ALIGN_BOTTOM:
     682             :         case SFX_ALIGN_TOOLBOXTOP:
     683             :         case SFX_ALIGN_TOOLBOXBOTTOM:
     684             : 
     685           0 :                         nMinWidth= 0;
     686           0 :                         nMinHeight=0;
     687             : 
     688             :                         break;
     689             : 
     690             :         case SFX_ALIGN_NOALIGNMENT:
     691             : 
     692           0 :                         aString = aCatBox.GetEntry(0);
     693           0 :                         aString.AppendAscii(RTL_CONSTASCII_STRINGPARAM("www"));
     694             :                         aTxtSize = Size( aFiFuncDesc.GetTextWidth(aString),
     695           0 :                                             aFiFuncDesc.GetTextHeight() );
     696             : 
     697           0 :         default:        Point aTopLeft=aCatBox.GetPosPixel();
     698           0 :                         nMinWidth=aTxtSize.Width()+aTopLeft.X()
     699           0 :                                 +2*aFuncList.GetPosPixel().X();
     700           0 :                         nMinHeight=19*aTxtSize.Height();
     701             : 
     702             :                         break;
     703             :     }
     704             : 
     705           0 :     return aChildAlign;
     706             : }
     707             : /*************************************************************************
     708             : #*  Member:     Close
     709             : #*------------------------------------------------------------------------
     710             : #*
     711             : #*  Klasse:     ScFunctionDockWin
     712             : #*
     713             : #*  Funktion:   Aenderungen erkennen
     714             : #*
     715             : #*  Input:      ---
     716             : #*
     717             : #*  Output:     TRUE
     718             : #*
     719             : #************************************************************************/
     720           0 : void ScFunctionDockWin::Notify( SfxBroadcaster&, const SfxHint& /* rHint */ )
     721             : {
     722           0 : }
     723             : 
     724             : 
     725             : /*************************************************************************
     726             : #*  Member:     Resize
     727             : #*------------------------------------------------------------------------
     728             : #*
     729             : #*  Klasse:     ScFunctionDockWin
     730             : #*
     731             : #*  Funktion:   Ueberladene Funktion um die Groesse der
     732             : #*              einzelnen Controls einzustellen.
     733             : #*
     734             : #*  Input:      neue Groesse
     735             : #*
     736             : #*  Output:     ---
     737             : #*
     738             : #************************************************************************/
     739             : 
     740           0 : void ScFunctionDockWin::Resize()
     741             : {
     742           0 :     if ( !IsFloatingMode() ||
     743           0 :          !GetFloatingWindow()->IsRollUp() )
     744             :     {
     745           0 :         Size aQSize=GetOutputSizePixel();
     746           0 :         Resizing( aQSize);
     747           0 :         SetSize();
     748             :     }
     749           0 :     SfxDockingWindow::Resize();
     750           0 : }
     751             : 
     752             : /*************************************************************************
     753             : #*  Member:     UpdateFunctionList
     754             : #*------------------------------------------------------------------------
     755             : #*
     756             : #*  Klasse:     ScFunctionDockWin
     757             : #*
     758             : #*  Funktion:   Aktualisiert die Liste der Funktionen ab-
     759             : #*              haengig von der eingestellten Kategorie.
     760             : #*
     761             : #*  Input:      ---
     762             : #*
     763             : #*  Output:     ---
     764             : #*
     765             : #************************************************************************/
     766             : 
     767           0 : void ScFunctionDockWin::UpdateFunctionList()
     768             : {
     769           0 :     sal_uInt16  nSelPos   = aCatBox.GetSelectEntryPos();
     770             :     sal_uInt16  nCategory = ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
     771           0 :                             ? (nSelPos-1) : 0;
     772             : 
     773           0 :     pAllFuncList->Clear();
     774           0 :     pAllFuncList->SetUpdateMode( false );
     775             : 
     776           0 :     if ( nSelPos > 0 )
     777             :     {
     778           0 :         ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
     779             : 
     780           0 :         const ScFuncDesc* pDesc = pFuncMgr->First( nCategory );
     781           0 :         while ( pDesc )
     782             :         {
     783             :             pAllFuncList->SetEntryData(
     784           0 :                 pAllFuncList->InsertEntry( *(pDesc->pFuncName) ),
     785           0 :                 (void*)pDesc );
     786           0 :             pDesc = pFuncMgr->Next();
     787             :         }
     788             :     }
     789             :     else // LRU-Liste
     790             :     {
     791           0 :         for(::std::vector<const formula::IFunctionDescription*>::iterator iter=aLRUList.begin();iter!=aLRUList.end();++iter)
     792             :         {
     793           0 :             const formula::IFunctionDescription* pDesc = *iter;
     794             :             pAllFuncList->SetEntryData(
     795           0 :                     pAllFuncList->InsertEntry(pDesc->getFunctionName()),
     796           0 :                     (void*)pDesc );
     797             :         }
     798             :     }
     799             : 
     800             : 
     801             :     //------------------------------------------------------
     802           0 :     pAllFuncList->SetUpdateMode( sal_True );
     803             : 
     804           0 :     if ( pAllFuncList->GetEntryCount() > 0 )
     805             :     {
     806           0 :         pAllFuncList->Enable();
     807           0 :         pAllFuncList->SelectEntryPos( 0 );
     808             :     }
     809             :     else
     810             :     {
     811           0 :         pAllFuncList->Disable();
     812             :     }
     813           0 : }
     814             : 
     815             : /*************************************************************************
     816             : #*  Member:     DoEnter
     817             : #*------------------------------------------------------------------------
     818             : #*
     819             : #*  Klasse:     ScFunctionDockWin
     820             : #*
     821             : #*  Funktion:   Eingabe ins Dokument uebernehmen. Wird aufgerufen
     822             : #*              nach betaetigen der Uebernehmen- Schaltflaeche
     823             : #*              oder einem Doppelklick in die Funktionsliste.
     824             : #*
     825             : #*  Input:      ---
     826             : #*
     827             : #*  Output:     ---
     828             : #*
     829             : #************************************************************************/
     830             : 
     831           0 : void ScFunctionDockWin::DoEnter(sal_Bool /* bOk */) //@@ ???
     832             : {
     833           0 :     String aFirstArgStr;
     834           0 :     String aParaStr;
     835           0 :     String aArgStr;
     836           0 :     String aString=pAllFuncList->GetSelectEntry();
     837           0 :     SfxViewShell* pCurSh = SfxViewShell::Current();
     838           0 :     nArgs=0;
     839             : 
     840           0 :     if(aString.Len()>0)
     841             :     {
     842             : 
     843           0 :         ScModule* pScMod = SC_MOD();
     844           0 :         ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pCurSh);
     845           0 :         ScInputHandler* pHdl = pScMod->GetInputHdl( pViewSh );
     846           0 :         if(!pScMod->IsEditMode())
     847             :         {
     848           0 :             pScMod->SetInputMode(SC_INPUT_TABLE);
     849           0 :             aString = '=';
     850           0 :             aString += pAllFuncList->GetSelectEntry();
     851           0 :             if (pHdl)
     852           0 :                 pHdl->ClearText();
     853             :         }
     854             :         const ScFuncDesc* pDesc =
     855             :              (const ScFuncDesc*)pAllFuncList->GetEntryData(
     856           0 :                     pAllFuncList->GetSelectEntryPos() );
     857           0 :         if (pDesc)
     858             :         {
     859           0 :             pFuncDesc=pDesc;
     860           0 :             UpdateLRUList();
     861           0 :             nArgs = pDesc->nArgCount;
     862           0 :             if(nArgs>0)
     863             :             {
     864             :                 // NOTE: Theoretically the first parameter could have the
     865             :                 // suppress flag as well, but practically it doesn't.
     866           0 :                 aFirstArgStr = *(pDesc->ppDefArgNames[0]);
     867           0 :                 aFirstArgStr = comphelper::string::strip(aFirstArgStr, ' ');
     868           0 :                 aFirstArgStr.SearchAndReplaceAll(' ', '_');
     869           0 :                 aArgStr = aFirstArgStr;
     870           0 :                 if ( nArgs != VAR_ARGS )
     871             :                 {   // no VarArgs or Fix plus VarArgs, but not VarArgs only
     872           0 :                     rtl::OUString aArgSep("; ");
     873           0 :                     sal_uInt16 nFix = ( nArgs < VAR_ARGS ? nArgs : nArgs - VAR_ARGS + 1 );
     874           0 :                     for ( sal_uInt16 nArg = 1;
     875           0 :                             nArg < nFix && !pDesc->pDefArgFlags[nArg].bOptional; nArg++ )
     876             :                     {
     877           0 :                         if (!pDesc->pDefArgFlags[nArg].bSuppress)
     878             :                         {
     879           0 :                             aArgStr += aArgSep;
     880           0 :                             String sTmp(*(pDesc->ppDefArgNames[nArg]));
     881           0 :                             sTmp = comphelper::string::strip(sTmp, ' ');
     882           0 :                             sTmp.SearchAndReplaceAll(' ', '_');
     883           0 :                             aArgStr += sTmp;
     884             :                         }
     885           0 :                     }
     886             :                 }
     887             :             }
     888             :         }
     889           0 :         if (pHdl)
     890             :         {
     891           0 :             if (pHdl->GetEditString().isEmpty())
     892             :             {
     893           0 :                 aString = '=';
     894           0 :                 aString += pAllFuncList->GetSelectEntry();
     895             :             }
     896           0 :             EditView *pEdView=pHdl->GetActiveView();
     897           0 :             if(pEdView!=NULL) // @ Wegen Absturz bei Namen festlegen
     898             :             {
     899           0 :                 if(nArgs>0)
     900             :                 {
     901           0 :                     pHdl->InsertFunction(aString);
     902           0 :                     pEdView->InsertText(aArgStr,sal_True);
     903           0 :                     ESelection  aESel=pEdView->GetSelection();
     904           0 :                     aESel.nEndPos=aESel.nStartPos+aFirstArgStr.Len();
     905           0 :                     pEdView->SetSelection(aESel);
     906           0 :                     pHdl->DataChanged();
     907             :                 }
     908             :                 else
     909             :                 {
     910           0 :                     aString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "()" ));
     911           0 :                     pEdView->InsertText(aString,false);
     912           0 :                     pHdl->DataChanged();
     913             :                 }
     914             :             }
     915             :         }
     916           0 :         InitLRUList();
     917             :     }
     918           0 :     if ( pCurSh )
     919             :     {
     920           0 :         Window* pShellWnd = pCurSh->GetWindow();
     921             : 
     922           0 :         if ( pShellWnd )
     923           0 :             pShellWnd->GrabFocus();
     924           0 :     }
     925             : 
     926             : 
     927           0 : }
     928             : 
     929             : 
     930             : 
     931             : /*************************************************************************
     932             : #*  Handle:     SelHdl
     933             : #*------------------------------------------------------------------------
     934             : #*
     935             : #*  Klasse:     ScFunctionDockWin
     936             : #*
     937             : #*  Funktion:   Bei einer Aenderung der Kategorie wird die
     938             : #*              die Liste der Funktionen aktualisiert.
     939             : #*
     940             : #*  Input:      ---
     941             : #*
     942             : #*  Output:     ---
     943             : #*
     944             : #************************************************************************/
     945             : 
     946           0 : IMPL_LINK( ScFunctionDockWin, SelHdl, ListBox*, pLb )
     947             : {
     948           0 :     if ( pLb == &aCatBox)
     949             :     {
     950           0 :         UpdateFunctionList();
     951           0 :         SetDescription();
     952             :     }
     953             : 
     954           0 :     if ( pLb == &aFuncList||pLb == &aDDFuncList)
     955             :     {
     956           0 :         SetDescription();
     957             :     }
     958             : 
     959             : 
     960             :     //SetSize();
     961           0 :     return 0;
     962             : }
     963             : 
     964             : /*************************************************************************
     965             : #*  Handle:     SelHdl
     966             : #*------------------------------------------------------------------------
     967             : #*
     968             : #*  Klasse:     ScFunctionDockWin
     969             : #*
     970             : #*  Funktion:   Bei einer Aenderung der Kategorie wird die
     971             : #*              die Liste der Funktionen aktualisiert.
     972             : #*
     973             : #*  Input:      ---
     974             : #*
     975             : #*  Output:     ---
     976             : #*
     977             : #************************************************************************/
     978             : 
     979           0 : IMPL_LINK( ScFunctionDockWin, SetSelectionHdl, void*, pCtrl )
     980             : {
     981           0 :     if ((ImageButton *)pCtrl == &aInsertButton ||
     982             :         (ListBox *)pCtrl == &aFuncList)
     983             :     {
     984           0 :         DoEnter(sal_True);          // Uebernimmt die Eingabe
     985             :     }
     986             :     //...
     987             : 
     988           0 :     return 0;
     989             : }
     990             : 
     991             : /*************************************************************************
     992             : #*  Handle:     SetSplitHdl
     993             : #*------------------------------------------------------------------------
     994             : #*
     995             : #*  Klasse:     ScFunctionDockWin
     996             : #*
     997             : #*  Funktion:   Bei einer Aenderung des Split- Controls werden die
     998             : #*              einzelnen Controls an die neue Groesse angepasst.
     999             : #*
    1000             : #*  Input:      Zeiger auf Control
    1001             : #*
    1002             : #*  Output:     ---
    1003             : #*
    1004             : #************************************************************************/
    1005             : 
    1006           0 : IMPL_LINK( ScFunctionDockWin, SetSplitHdl, ScPrivatSplit*, pCtrl )
    1007             : {
    1008           0 :     if (pCtrl == &aPrivatSplit)
    1009             :     {
    1010           0 :         short nDeltaY=aPrivatSplit.GetDeltaY();
    1011           0 :         Size aFLSize=aFuncList.GetSizePixel();
    1012           0 :         Size aFDSize=aFiFuncDesc.GetSizePixel();
    1013           0 :         Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
    1014             : 
    1015           0 :         aFLSize.Height()+=nDeltaY;
    1016           0 :         aFDSize.Height()-=nDeltaY;
    1017           0 :         aFDTopLeft.Y()+=nDeltaY;
    1018           0 :         aFuncList.SetSizePixel(aFLSize);
    1019           0 :         aFiFuncDesc.SetPosPixel(aFDTopLeft);
    1020           0 :         aFiFuncDesc.SetSizePixel(aFDSize);
    1021             :     }
    1022             :     //...
    1023             : 
    1024           0 :     return 0;
    1025             : }
    1026             : 
    1027           0 : void ScFunctionDockWin::ToggleFloatingMode()
    1028             : {
    1029           0 :     aSplitterInitPos = Point();
    1030           0 :     SfxDockingWindow::ToggleFloatingMode();
    1031             : 
    1032           0 :     eSfxNewAlignment=GetAlignment();
    1033           0 :     eSfxOldAlignment=eSfxNewAlignment;
    1034             : 
    1035           0 :     aOldSize.Height()=0;
    1036           0 :     aOldSize.Width()=0;
    1037           0 :     aTimer.Start();
    1038           0 : }
    1039             : 
    1040           0 : IMPL_LINK_NOARG(ScFunctionDockWin, TimerHdl)
    1041             : {
    1042           0 :     CheckAlignment(eSfxOldAlignment,eSfxNewAlignment);
    1043           0 :     SetSize();
    1044           0 :     return 0;
    1045             : }
    1046             : 
    1047           0 : void ScFunctionDockWin::Initialize(SfxChildWinInfo *pInfo)
    1048             : {
    1049           0 :     String aStr;
    1050           0 :     if(pInfo!=NULL)
    1051             :     {
    1052           0 :         if ( pInfo->aExtraString.Len() )
    1053             :         {
    1054             :             xub_StrLen nPos = pInfo->aExtraString.Search(
    1055           0 :                 rtl::OUString("ScFuncList:"));
    1056             : 
    1057             :             // Versuche, den Alignment-String "ALIGN:(...)" einzulesen; wenn
    1058             :             // er nicht vorhanden ist, liegt eine "altere Version vor
    1059           0 :             if ( nPos != STRING_NOTFOUND )
    1060             :             {
    1061           0 :                 xub_StrLen n1 = pInfo->aExtraString.Search('(', nPos);
    1062           0 :                 if ( n1 != STRING_NOTFOUND )
    1063             :                 {
    1064           0 :                     xub_StrLen n2 = pInfo->aExtraString.Search(')', n1);
    1065           0 :                     if ( n2 != STRING_NOTFOUND )
    1066             :                     {
    1067             :                         // Alignment-String herausschneiden
    1068           0 :                         aStr = pInfo->aExtraString.Copy(nPos, n2 - nPos + 1);
    1069           0 :                         pInfo->aExtraString.Erase(nPos, n2 - nPos + 1);
    1070           0 :                         aStr.Erase(0, n1-nPos+1);
    1071             :                     }
    1072             :                 }
    1073             :             }
    1074             :         }
    1075             :     }
    1076           0 :     SfxDockingWindow::Initialize(pInfo);
    1077             : 
    1078           0 :     if ( aStr.Len())
    1079             :     {
    1080           0 :         aSplitterInitPos=aPrivatSplit.GetPosPixel();
    1081           0 :         aSplitterInitPos.Y()=(sal_uInt16) aStr.ToInt32();
    1082           0 :         xub_StrLen n1 = aStr.Search(';');
    1083           0 :         aStr.Erase(0, n1+1);
    1084           0 :         sal_uInt16 nSelPos=sal::static_int_cast<sal_uInt16>( aStr.ToInt32() );
    1085           0 :         aCatBox.SelectEntryPos(nSelPos);
    1086           0 :         SelHdl(&aCatBox);
    1087             : 
    1088             :         //  if the window has already been shown (from SfxDockingWindow::Initialize if docked),
    1089             :         //  set the splitter position now, otherwise it is set in StateChanged with type INITSHOW
    1090             : 
    1091           0 :         UseSplitterInitPos();
    1092           0 :     }
    1093           0 : }
    1094             : 
    1095             : //-------------------------------------------------------------------------
    1096             : 
    1097           0 : void ScFunctionDockWin::FillInfo(SfxChildWinInfo& rInfo) const
    1098             : {
    1099           0 :     SfxDockingWindow::FillInfo(rInfo);
    1100           0 :     Point aPoint=aPrivatSplit.GetPosPixel();
    1101           0 :     rInfo.aExtraString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "ScFuncList:(" ));
    1102           0 :     rInfo.aExtraString += String::CreateFromInt32(aPoint.Y());
    1103           0 :     rInfo.aExtraString += ';';
    1104           0 :     rInfo.aExtraString += String::CreateFromInt32(aCatBox.GetSelectEntryPos());
    1105           0 :     rInfo.aExtraString += ')';
    1106           0 : }
    1107             : 
    1108           0 : void ScFunctionDockWin::UseSplitterInitPos()
    1109             : {
    1110           0 :     if ( IsVisible() && aPrivatSplit.IsEnabled() && aSplitterInitPos != Point() )
    1111             :     {
    1112           0 :         aPrivatSplit.MoveSplitTo(aSplitterInitPos);
    1113           0 :         aSplitterInitPos = Point();     // use only once
    1114             :     }
    1115           0 : }
    1116             : 
    1117           0 : void ScFunctionDockWin::StateChanged( StateChangedType nStateChange )
    1118             : {
    1119           0 :     SfxDockingWindow::StateChanged( nStateChange );
    1120             : 
    1121           0 :     if (nStateChange == STATE_CHANGE_INITSHOW)
    1122             :     {
    1123           0 :         UseSplitterInitPos();           //  set initial splitter position if necessary
    1124             :     }
    1125         102 : }
    1126             : 
    1127             : 
    1128             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10