LCOV - code coverage report
Current view: top level - sw/source/ui/misc - srtdlg.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 264 0.0 %
Date: 2014-04-11 Functions: 0 17 0.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             : #include "srtdlg.hxx"
      21             : 
      22             : #include <vcl/msgbox.hxx>
      23             : #include <svl/intitem.hxx>
      24             : #include <svl/eitem.hxx>
      25             : #include <sfx2/dispatch.hxx>
      26             : #include <svx/svxids.hrc>
      27             : #include <editeng/unolingu.hxx>
      28             : #include <svx/svxdlg.hxx>
      29             : #include <svx/dialogs.hrc>
      30             : #include <unotools/collatorwrapper.hxx>
      31             : #include <svtools/collatorres.hxx>
      32             : #include <swwait.hxx>
      33             : #include <view.hxx>
      34             : #include <cmdid.h>
      35             : #include <wrtsh.hxx>
      36             : #include <misc.hrc>
      37             : #include <app.hrc>
      38             : #include <swtable.hxx>
      39             : #include <node.hxx>
      40             : #include <tblsel.hxx>
      41             : #include <sfx2/request.hxx>
      42             : 
      43             : static sal_Bool bCheck1 = sal_True;
      44             : static sal_Bool bCheck2 = sal_False;
      45             : static sal_Bool bCheck3 = sal_False;
      46             : 
      47             : static sal_uInt16 nCol1 = 1;
      48             : static sal_uInt16 nCol2 = 1;
      49             : static sal_uInt16 nCol3 = 1;
      50             : 
      51             : static sal_uInt16 nType1 = 0;
      52             : static sal_uInt16 nType2 = 0;
      53             : static sal_uInt16 nType3 = 0;
      54             : 
      55             : static sal_uInt16 nLang = LANGUAGE_NONE;
      56             : 
      57             : static sal_Bool   bAsc1  = sal_True;
      58             : static sal_Bool   bAsc2  = sal_True;
      59             : static sal_Bool   bAsc3  = sal_True;
      60             : static sal_Bool   bCol   = sal_False;
      61             : static sal_Bool   bCsSens= sal_False;
      62             : 
      63             : static sal_Unicode    cDeli  = '\t';
      64             : 
      65             : using namespace ::com::sun::star::lang;
      66             : using namespace ::com::sun::star::uno;
      67             : using namespace ::com::sun::star;
      68             : 
      69           0 : static void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox )
      70             : {
      71           0 :     const sal_Int32 nEnd = rLstBox.GetEntryCount();
      72           0 :     for( sal_Int32 n = 0; n < nEnd; ++n )
      73             :     {
      74           0 :         delete reinterpret_cast<OUString *>(rLstBox.GetEntryData( n ));
      75             :     }
      76           0 :     rLstBox.Clear();
      77           0 : }
      78             : 
      79             : /*--------------------------------------------------------------------
      80             :      Description: determine lines and columns for table selection
      81             :  --------------------------------------------------------------------*/
      82           0 : static bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
      83             : {
      84           0 :     const SwTableNode* pTblNd = rSh.IsCrsrInTbl();
      85           0 :     if( !pTblNd )
      86           0 :         return false;
      87             : 
      88           0 :     _FndBox aFndBox( 0, 0 );
      89             : 
      90             :     // look for all boxes / lines
      91             :     {
      92           0 :         SwSelBoxes aSelBoxes;
      93           0 :         ::GetTblSel( rSh, aSelBoxes );
      94           0 :         _FndPara aPara( aSelBoxes, &aFndBox );
      95           0 :         const SwTable& rTbl = pTblNd->GetTable();
      96           0 :         ForEach_FndLineCopyCol( (SwTableLines&)rTbl.GetTabLines(), &aPara );
      97             :     }
      98           0 :     rX = aFndBox.GetLines().size();
      99           0 :     if( !rX )
     100           0 :         return false;
     101             : 
     102           0 :     rY = aFndBox.GetLines().front().GetBoxes().size();
     103           0 :     return true;
     104             : }
     105             : 
     106             : /*--------------------------------------------------------------------
     107             :      Description: init list
     108             :  --------------------------------------------------------------------*/
     109           0 : SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell)
     110             :     : SvxStandardDialog(pParent, "SortDialog", "modules/swriter/ui/sortdialog.ui")
     111             :     , aColTxt(SW_RES(STR_COL))
     112             :     , aRowTxt(SW_RES(STR_ROW))
     113             :     , aNumericTxt(SW_RES(STR_NUMERIC))
     114             :     , rSh(rShell)
     115             :     , pColRes(0)
     116             :     , nX(99)
     117           0 :     , nY(99)
     118             : {
     119           0 :     get(m_pColLbl, "column");
     120           0 :     get(m_pTypLbl, "keytype");
     121             : 
     122           0 :     get(m_pKeyCB1, "key1");
     123           0 :     get(m_pColEdt1, "colsb1");
     124           0 :     get(m_pTypDLB1, "typelb1");
     125           0 :     get(m_pSortUp1RB, "up1");
     126           0 :     get(m_pSortDn1RB, "down1");
     127             : 
     128           0 :     get(m_pKeyCB2, "key2");
     129           0 :     get(m_pColEdt2, "colsb2");
     130           0 :     get(m_pTypDLB2, "typelb2");
     131           0 :     get(m_pSortUp2RB, "up2");
     132           0 :     get(m_pSortDn2RB, "down2");
     133             : 
     134           0 :     get(m_pKeyCB3, "key3");
     135           0 :     get(m_pColEdt3, "colsb3");
     136           0 :     get(m_pTypDLB3, "typelb3");
     137           0 :     get(m_pSortUp3RB, "up3");
     138           0 :     get(m_pSortDn3RB, "down3");
     139             : 
     140           0 :     get(m_pColumnRB, "columns");
     141           0 :     get(m_pRowRB, "rows");
     142             : 
     143           0 :     get(m_pDelimTabRB, "tabs");
     144           0 :     get(m_pDelimFreeRB, "character");
     145           0 :     get(m_pDelimEdt, "separator");
     146           0 :     get(m_pDelimPB, "delimpb");
     147             : 
     148           0 :     get(m_pLangLB, "langlb");
     149           0 :     get(m_pCaseCB, "matchcase");
     150             : 
     151           0 :     m_pColEdt1->SetAccessibleName(m_pColLbl->GetText());
     152           0 :     m_pColEdt2->SetAccessibleName(m_pColLbl->GetText());
     153           0 :     m_pColEdt3->SetAccessibleName(m_pColLbl->GetText());
     154           0 :     m_pTypDLB1->SetAccessibleName(m_pTypLbl->GetText());
     155           0 :     m_pTypDLB2->SetAccessibleName(m_pTypLbl->GetText());
     156           0 :     m_pTypDLB3->SetAccessibleName(m_pTypLbl->GetText());
     157           0 :     m_pSortUp1RB->SetAccessibleRelationMemberOf(m_pKeyCB1);
     158           0 :     m_pSortDn1RB->SetAccessibleRelationMemberOf(m_pKeyCB1);
     159           0 :     m_pSortUp2RB->SetAccessibleRelationMemberOf(m_pKeyCB2);
     160           0 :     m_pSortDn2RB->SetAccessibleRelationMemberOf(m_pKeyCB2);
     161           0 :     m_pSortUp3RB->SetAccessibleRelationMemberOf(m_pKeyCB3);
     162           0 :     m_pSortDn3RB->SetAccessibleRelationMemberOf(m_pKeyCB3);
     163             : 
     164           0 :     m_pDelimEdt->SetMaxTextLen( 1 );
     165           0 :     if(rSh.GetSelectionType() &
     166             :             (nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) )
     167             :     {
     168           0 :         m_pColumnRB->Check(bCol);
     169           0 :         m_pColLbl->SetText(bCol ? aRowTxt : aColTxt);
     170           0 :         m_pRowRB->Check(!bCol);
     171           0 :         m_pDelimTabRB->Enable(false);
     172           0 :         m_pDelimFreeRB->Enable(false);
     173           0 :         m_pDelimEdt->Enable(false);
     174             :     }
     175             :     else
     176             :     {
     177           0 :         m_pColumnRB->Enable(false);
     178           0 :         m_pRowRB->Check(true);
     179           0 :         m_pColLbl->SetText(aColTxt);
     180             :     }
     181             : 
     182             :     // initialise
     183           0 :     Link aLk = LINK(this,SwSortDlg, CheckHdl);
     184           0 :     m_pKeyCB1->SetClickHdl( aLk );
     185           0 :     m_pKeyCB2->SetClickHdl( aLk );
     186           0 :     m_pKeyCB3->SetClickHdl( aLk );
     187           0 :     m_pColumnRB->SetClickHdl( aLk );
     188           0 :     m_pRowRB->SetClickHdl( aLk );
     189             : 
     190           0 :     aLk = LINK(this,SwSortDlg, DelimHdl);
     191           0 :     m_pDelimFreeRB->SetClickHdl(aLk);
     192           0 :     m_pDelimTabRB->SetClickHdl(aLk);
     193             : 
     194           0 :     m_pDelimPB->SetClickHdl( LINK( this, SwSortDlg, DelimCharHdl ));
     195             : 
     196           0 :     m_pKeyCB1->Check(bCheck1);
     197           0 :     m_pKeyCB2->Check(bCheck2);
     198           0 :     m_pKeyCB3->Check(bCheck3);
     199             : 
     200           0 :     m_pColEdt1->SetValue(nCol1);
     201           0 :     m_pColEdt2->SetValue(nCol2);
     202           0 :     m_pColEdt3->SetValue(nCol3);
     203             : 
     204             :     // first initialise the language, then select the
     205           0 :     if( LANGUAGE_NONE == nLang || LANGUAGE_DONTKNOW == nLang )
     206           0 :         nLang = (sal_uInt16)GetAppLanguage();
     207             : 
     208           0 :     m_pLangLB->SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, true, false);
     209           0 :     m_pLangLB->SelectLanguage( nLang );
     210             : 
     211           0 :     LanguageHdl( 0 );
     212           0 :     m_pLangLB->SetSelectHdl( LINK( this, SwSortDlg, LanguageHdl ));
     213             : 
     214           0 :     m_pSortUp1RB->Check(bAsc1);
     215           0 :     m_pSortDn1RB->Check(!bAsc1);
     216           0 :     m_pSortUp2RB->Check(bAsc2);
     217           0 :     m_pSortDn2RB->Check(!bAsc2);
     218           0 :     m_pSortUp3RB->Check(bAsc3);
     219           0 :     m_pSortDn3RB->Check(!bAsc3);
     220             : 
     221           0 :     m_pCaseCB->Check( bCsSens );
     222             : 
     223           0 :     m_pDelimTabRB->Check(cDeli == '\t');
     224           0 :     if(!m_pDelimTabRB->IsChecked())
     225             :     {
     226           0 :         m_pDelimEdt->SetText(OUString(cDeli));
     227           0 :         m_pDelimFreeRB->Check(true);
     228           0 :         DelimHdl(m_pDelimFreeRB);
     229             :     }
     230             :     else
     231           0 :         DelimHdl(m_pDelimTabRB);
     232             : 
     233           0 :     if( ::lcl_GetSelTbl( rSh, nX, nY) )
     234             :     {
     235           0 :         sal_uInt16 nMax = m_pRowRB->IsChecked()? nY : nX;
     236           0 :         m_pColEdt1->SetMax(nMax);
     237           0 :         m_pColEdt2->SetMax(nMax);
     238           0 :         m_pColEdt3->SetMax(nMax);
     239             :     }
     240             : 
     241           0 :     m_pDelimPB->SetAccessibleRelationMemberOf(m_pDelimFreeRB);
     242             : 
     243           0 :     m_pColEdt1->SetAccessibleRelationMemberOf(m_pKeyCB1);
     244           0 :     m_pTypDLB1->SetAccessibleRelationMemberOf(m_pKeyCB1);
     245             : 
     246           0 :     m_pColEdt2->SetAccessibleRelationMemberOf(m_pKeyCB2);
     247           0 :     m_pTypDLB2->SetAccessibleRelationMemberOf(m_pKeyCB2);
     248             : 
     249           0 :     m_pColEdt3->SetAccessibleRelationMemberOf(m_pKeyCB3);
     250           0 :     m_pTypDLB3->SetAccessibleRelationMemberOf(m_pKeyCB3);
     251           0 : }
     252             : 
     253           0 : SwSortDlg::~SwSortDlg()
     254             : {
     255           0 :     ::lcl_ClearLstBoxAndDelUserData(*m_pTypDLB1);
     256           0 :     ::lcl_ClearLstBoxAndDelUserData(*m_pTypDLB2);
     257           0 :     ::lcl_ClearLstBoxAndDelUserData(*m_pTypDLB3);
     258           0 :     delete pColRes;
     259           0 : }
     260             : 
     261           0 : sal_Unicode SwSortDlg::GetDelimChar() const
     262             : {
     263           0 :     sal_Unicode cRet = '\t';
     264           0 :     if( !m_pDelimTabRB->IsChecked() )
     265             :     {
     266           0 :         OUString aTmp( m_pDelimEdt->GetText() );
     267           0 :         if( !aTmp.isEmpty() )
     268           0 :             cRet = aTmp[0];
     269             :     }
     270           0 :     return cRet;
     271             : }
     272             : 
     273             : /*--------------------------------------------------------------------
     274             :     Description: pass on to the Core
     275             :  --------------------------------------------------------------------*/
     276           0 : void SwSortDlg::Apply()
     277             : {
     278             :     // save all settings
     279           0 :     bCheck1 = m_pKeyCB1->IsChecked();
     280           0 :     bCheck2 = m_pKeyCB2->IsChecked();
     281           0 :     bCheck3 = m_pKeyCB3->IsChecked();
     282             : 
     283           0 :     nCol1 = (sal_uInt16)m_pColEdt1->GetValue();
     284           0 :     nCol2 = (sal_uInt16)m_pColEdt2->GetValue();
     285           0 :     nCol3 = (sal_uInt16)m_pColEdt3->GetValue();
     286             : 
     287           0 :     nType1 = m_pTypDLB1->GetSelectEntryPos();
     288           0 :     nType2 = m_pTypDLB2->GetSelectEntryPos();
     289           0 :     nType3 = m_pTypDLB3->GetSelectEntryPos();
     290             : 
     291           0 :     bAsc1 = m_pSortUp1RB->IsChecked();
     292           0 :     bAsc2 = m_pSortUp2RB->IsChecked();
     293           0 :     bAsc3 = m_pSortUp3RB->IsChecked();
     294           0 :     bCol = m_pColumnRB->IsChecked();
     295           0 :     nLang = m_pLangLB->GetSelectLanguage();
     296           0 :     cDeli = GetDelimChar();
     297           0 :     bCsSens = m_pCaseCB->IsChecked();
     298             : 
     299             :     void* pUserData;
     300           0 :     SwSortOptions aOptions;
     301           0 :     if( bCheck1 )
     302             :     {
     303           0 :         OUString sEntry( m_pTypDLB1->GetSelectEntry() );
     304           0 :         if( sEntry == aNumericTxt )
     305           0 :             sEntry = "";
     306           0 :         else if( 0 != (pUserData = m_pTypDLB1->GetEntryData(
     307           0 :                                             m_pTypDLB1->GetSelectEntryPos())) )
     308           0 :             sEntry = *(OUString*)pUserData;
     309             : 
     310             :         SwSortKey *pKey = new SwSortKey( nCol1, sEntry,
     311           0 :                                     bAsc1 ? SRT_ASCENDING : SRT_DESCENDING );
     312           0 :         aOptions.aKeys.push_back( pKey );
     313             :     }
     314             : 
     315           0 :     if( bCheck2 )
     316             :     {
     317           0 :         OUString sEntry( m_pTypDLB2->GetSelectEntry() );
     318           0 :         if( sEntry == aNumericTxt )
     319           0 :             sEntry = "";
     320           0 :         else if( 0 != (pUserData = m_pTypDLB2->GetEntryData(
     321           0 :                                             m_pTypDLB2->GetSelectEntryPos())) )
     322           0 :             sEntry = *(OUString*)pUserData;
     323             : 
     324             :         SwSortKey *pKey = new SwSortKey( nCol2, sEntry,
     325           0 :                                     bAsc2 ? SRT_ASCENDING : SRT_DESCENDING );
     326           0 :         aOptions.aKeys.push_back( pKey );
     327             :     }
     328             : 
     329           0 :     if( bCheck3 )
     330             :     {
     331           0 :         OUString sEntry( m_pTypDLB3->GetSelectEntry() );
     332           0 :         if( sEntry == aNumericTxt )
     333           0 :             sEntry = "";
     334           0 :         else if( 0 != (pUserData = m_pTypDLB3->GetEntryData(
     335           0 :                                             m_pTypDLB3->GetSelectEntryPos())) )
     336           0 :             sEntry = *(OUString*)pUserData;
     337             : 
     338             :         SwSortKey *pKey = new SwSortKey( nCol3, sEntry,
     339           0 :                                     bAsc3 ? SRT_ASCENDING : SRT_DESCENDING );
     340           0 :         aOptions.aKeys.push_back( pKey );
     341             :     }
     342             : 
     343           0 :     aOptions.eDirection =  bCol ? SRT_COLUMNS : SRT_ROWS;
     344           0 :     aOptions.cDeli = cDeli;
     345           0 :     aOptions.nLanguage = nLang;
     346           0 :     aOptions.bTable = rSh.IsTableMode();
     347           0 :     aOptions.bIgnoreCase = !bCsSens;
     348             : 
     349             :     sal_Bool bRet;
     350             :     {
     351           0 :         SwWait aWait( *rSh.GetView().GetDocShell(), true );
     352           0 :         rSh.StartAllAction();
     353           0 :         if( 0 != (bRet = rSh.Sort( aOptions )))
     354           0 :             rSh.SetModified();
     355           0 :         rSh.EndAllAction();
     356             :     }
     357             : 
     358           0 :     if( !bRet )
     359           0 :         InfoBox( this->GetParent(), SW_RES(MSG_SRTERR)).Execute();
     360           0 : }
     361             : 
     362           0 : IMPL_LINK( SwSortDlg, DelimHdl, RadioButton*, pButton )
     363             : {
     364           0 :     sal_Bool bEnable = pButton == m_pDelimFreeRB && m_pDelimFreeRB->IsEnabled();
     365           0 :     m_pDelimEdt->Enable( bEnable );
     366           0 :     m_pDelimPB->Enable( bEnable );
     367           0 :     return 0;
     368             : }
     369             : 
     370           0 : IMPL_LINK_NOARG(SwSortDlg, DelimCharHdl)
     371             : {
     372           0 :     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     373           0 :     if(pFact)
     374             :     {
     375           0 :         SfxAllItemSet aSet( rSh.GetAttrPool() );
     376           0 :         aSet.Put( SfxInt32Item( SID_ATTR_CHAR, GetDelimChar() ) );
     377             :         SfxAbstractDialog* pMap = pFact->CreateSfxDialog( m_pDelimPB, aSet,
     378           0 :             rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
     379           0 :         if( RET_OK == pMap->Execute() )
     380             :         {
     381           0 :             SFX_ITEMSET_ARG( pMap->GetOutputItemSet(), pItem, SfxInt32Item, SID_ATTR_CHAR, false );
     382           0 :             if ( pItem )
     383           0 :                 m_pDelimEdt->SetText( OUString(pItem->GetValue()) );
     384             :         }
     385             : 
     386           0 :         delete pMap;
     387             :     }
     388           0 :     return 0;
     389             : }
     390             : 
     391           0 : IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck )
     392             : {
     393           0 :     if( pCheck == ( CheckBox* ) m_pRowRB)
     394             :     {
     395           0 :         m_pColLbl->SetText(aColTxt);
     396           0 :         m_pColEdt1->SetMax(nY);
     397           0 :         m_pColEdt2->SetMax(nY);
     398           0 :         m_pColEdt3->SetMax(nY);
     399             : 
     400           0 :         m_pColEdt1->SetAccessibleName(aColTxt);
     401           0 :         m_pColEdt2->SetAccessibleName(aColTxt);
     402           0 :         m_pColEdt3->SetAccessibleName(aColTxt);
     403             :     }
     404           0 :     else if( pCheck == ( CheckBox* ) m_pColumnRB)
     405             :     {
     406           0 :         m_pColLbl->SetText(aRowTxt);
     407           0 :         m_pColEdt1->SetMax(nX);
     408           0 :         m_pColEdt2->SetMax(nX);
     409           0 :         m_pColEdt3->SetMax(nX);
     410             : 
     411           0 :         m_pColEdt1->SetAccessibleName(aRowTxt);
     412           0 :         m_pColEdt2->SetAccessibleName(aRowTxt);
     413           0 :         m_pColEdt3->SetAccessibleName(aRowTxt);
     414             :     }
     415           0 :     else if(!m_pKeyCB1->IsChecked() &&
     416           0 :                 !m_pKeyCB2->IsChecked() &&
     417           0 :                     !m_pKeyCB3->IsChecked())
     418           0 :         pCheck->Check(true);
     419           0 :     return 0;
     420             : }
     421             : 
     422           0 : IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox )
     423             : {
     424           0 :     Sequence < OUString > aSeq( GetAppCollator().listCollatorAlgorithms(
     425           0 :                 LanguageTag( m_pLangLB->GetSelectLanguage()).getLocale() ));
     426             : 
     427           0 :     if( !pColRes )
     428           0 :         pColRes = new CollatorResource();
     429             : 
     430           0 :     const int nLstBoxCnt = 3;
     431           0 :     ListBox* aLstArr[ nLstBoxCnt ] = { m_pTypDLB1, m_pTypDLB2, m_pTypDLB3 };
     432           0 :     sal_uInt16* aTypeArr[ nLstBoxCnt ] = { &nType1, &nType2, &nType3 };
     433           0 :     OUString aOldStrArr[ nLstBoxCnt ];
     434             : 
     435           0 :     for( int n = 0; n < nLstBoxCnt; ++n )
     436             :     {
     437           0 :         ListBox* pL = aLstArr[ n ];
     438           0 :         void* pUserData = pL->GetEntryData( pL->GetSelectEntryPos() );
     439           0 :         if (pUserData)
     440           0 :             aOldStrArr[ n ] = *(OUString*)pUserData;
     441           0 :         ::lcl_ClearLstBoxAndDelUserData( *pL );
     442             :     }
     443             : 
     444           0 :     OUString sAlg, sUINm;
     445           0 :     const sal_Int32 nEnd = aSeq.getLength();
     446           0 :     for( sal_Int32 nCnt = 0; nCnt <= nEnd; ++nCnt )
     447             :     {
     448           0 :         if( nCnt < nEnd )
     449           0 :             sUINm = pColRes->GetTranslation( sAlg = aSeq[ nCnt ] );
     450             :         else
     451           0 :             sUINm = sAlg = aNumericTxt;
     452             : 
     453           0 :         for( int n = 0; n < nLstBoxCnt; ++n )
     454             :         {
     455           0 :             ListBox* pL = aLstArr[ n ];
     456           0 :             const sal_Int32 nInsPos = pL->InsertEntry( sUINm );
     457           0 :             pL->SetEntryData( nInsPos, new OUString( sAlg ));
     458           0 :             if( pLBox && sAlg == aOldStrArr[ n ] )
     459           0 :                 pL->SelectEntryPos( nInsPos );
     460             :         }
     461             :     }
     462             : 
     463           0 :     for( int n = 0; n < nLstBoxCnt; ++n )
     464             :     {
     465           0 :         ListBox* pL = aLstArr[ n ];
     466           0 :         if( !pLBox )
     467           0 :             pL->SelectEntryPos( *aTypeArr[n] );
     468           0 :         else if( LISTBOX_ENTRY_NOTFOUND == pL->GetSelectEntryPos() )
     469           0 :             pL->SelectEntryPos( 0 );
     470             :     }
     471           0 :     return 0;
     472           0 : }
     473             : 
     474             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10