LCOV - code coverage report
Current view: top level - sw/source/ui/utlui - gloslst.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 214 0.0 %
Date: 2012-08-25 Functions: 0 25 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 416 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <tools/urlobj.hxx>
      30                 :            : #include <vcl/dialog.hxx>
      31                 :            : #include <vcl/msgbox.hxx>
      32                 :            : #include <vcl/button.hxx>
      33                 :            : #include <vcl/fixed.hxx>
      34                 :            : #include <vcl/lstbox.hxx>
      35                 :            : #include <svl/fstathelper.hxx>
      36                 :            : #include <unotools/pathoptions.hxx>
      37                 :            : #include <unotools/transliterationwrapper.hxx>
      38                 :            : #include <swtypes.hxx>
      39                 :            : #include <swmodule.hxx>
      40                 :            : #include <shellio.hxx>
      41                 :            : #include <initui.hxx>
      42                 :            : #include <glosdoc.hxx>
      43                 :            : #include <gloslst.hxx>
      44                 :            : #include <swunohelper.hxx>
      45                 :            : 
      46                 :            : #include <vector>
      47                 :            : 
      48                 :            : #include <utlui.hrc>
      49                 :            : #include <gloslst.hrc>
      50                 :            : 
      51                 :            : 
      52                 :            : #define STRING_DELIM (char)0x0A
      53                 :            : #define GLOS_TIMEOUT 30000   // alle 30 s updaten
      54                 :            : #define FIND_MAX_GLOS 20
      55                 :            : 
      56                 :            : 
      57 [ #  # ][ #  # ]:          0 : struct TripleString
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      58                 :            : {
      59                 :            :     String sGroup;
      60                 :            :     String sBlock;
      61                 :            :     String sShort;
      62                 :            : };
      63                 :            : 
      64 [ #  # ][ #  # ]:          0 : class SwGlossDecideDlg : public ModalDialog
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      65                 :            : {
      66                 :            :     OKButton        aOk;
      67                 :            :     CancelButton    aCancel;
      68                 :            :     HelpButton      aHelp;
      69                 :            :     ListBox         aListLB;
      70                 :            :     FixedLine       aFL;
      71                 :            : 
      72                 :            :     DECL_LINK(DoubleClickHdl, void*);
      73                 :            :     DECL_LINK(SelectHdl, void*);
      74                 :            : 
      75                 :            :     public:
      76                 :            :         SwGlossDecideDlg(Window* pParent);
      77                 :          0 :     ListBox&    GetListBox() {return aListLB;}
      78                 :            : };
      79                 :            : 
      80                 :          0 : SwGlossDecideDlg::SwGlossDecideDlg(Window* pParent) :
      81                 :            :     ModalDialog(pParent, SW_RES(DLG_GLOSSARY_DECIDE_DLG)),
      82                 :            :     aOk(this,       SW_RES(PB_OK)),
      83                 :            :     aCancel(this,   SW_RES(PB_CANCEL)),
      84                 :            :     aHelp(this,     SW_RES(PB_HELP)),
      85                 :            :     aListLB(this,   SW_RES(LB_LIST)),
      86 [ #  # ][ #  # ]:          0 :     aFL(this,    SW_RES(FL_GLOSS))
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      87                 :            : {
      88         [ #  # ]:          0 :     FreeResource();
      89         [ #  # ]:          0 :     aListLB.SetDoubleClickHdl(LINK(this, SwGlossDecideDlg, DoubleClickHdl));
      90         [ #  # ]:          0 :     aListLB.SetSelectHdl(LINK(this, SwGlossDecideDlg, SelectHdl));
      91                 :          0 : }
      92                 :            : 
      93                 :          0 : IMPL_LINK_NOARG(SwGlossDecideDlg, DoubleClickHdl)
      94                 :            : {
      95                 :          0 :     EndDialog(RET_OK);
      96                 :          0 :     return 0;
      97                 :            : }
      98                 :            : 
      99                 :          0 : IMPL_LINK_NOARG(SwGlossDecideDlg, SelectHdl)
     100                 :            : {
     101                 :          0 :     aOk.Enable(LISTBOX_ENTRY_NOTFOUND != aListLB.GetSelectEntryPos());
     102                 :          0 :     return 0;
     103                 :            : }
     104                 :            : 
     105                 :          0 : SwGlossaryList::SwGlossaryList() :
     106 [ #  # ][ #  # ]:          0 :     bFilled(sal_False)
     107                 :            : {
     108         [ #  # ]:          0 :     SvtPathOptions aPathOpt;
     109 [ #  # ][ #  # ]:          0 :     sPath = aPathOpt.GetAutoTextPath();
     110 [ #  # ][ #  # ]:          0 :     SetTimeout(GLOS_TIMEOUT);
     111                 :          0 : }
     112                 :            : 
     113         [ #  # ]:          0 : SwGlossaryList::~SwGlossaryList()
     114                 :            : {
     115         [ #  # ]:          0 :     ClearGroups();
     116         [ #  # ]:          0 : }
     117                 :            : 
     118                 :            : /********************************************************************
     119                 :            :  * Wenn der GroupName bereits bekannt ist, dann wird nur
     120                 :            :  * rShortName gefuellt, sonst wird rGroupName ebenfals gesetzt und
     121                 :            :  * bei Bedarf nach der richtigen Gruppe gefragt
     122                 :            : ********************************************************************/
     123                 :            : 
     124                 :          0 : sal_Bool SwGlossaryList::GetShortName(const String& rLongName,
     125                 :            :                                 String& rShortName, String& rGroupName )
     126                 :            : {
     127         [ #  # ]:          0 :     if(!bFilled)
     128         [ #  # ]:          0 :         Update();
     129                 :            : 
     130         [ #  # ]:          0 :     std::vector<TripleString> aTripleStrings;
     131                 :            : 
     132                 :          0 :     sal_uInt16 nCount = aGroupArr.size();
     133                 :          0 :     sal_uInt16 nFound = 0;
     134         [ #  # ]:          0 :     for(sal_uInt16 i = 0; i < nCount; i++ )
     135                 :            :     {
     136                 :          0 :         AutoTextGroup* pGroup = aGroupArr[i];
     137 [ #  # ][ #  # ]:          0 :         if(rGroupName.Len() && rGroupName != pGroup->sName)
         [ #  # ][ #  # ]
     138                 :          0 :             continue;
     139                 :            : 
     140         [ #  # ]:          0 :         for(sal_uInt16 j = 0; j < pGroup->nCount; j++)
     141                 :            :         {
     142         [ #  # ]:          0 :             String sLong = pGroup->sLongNames.GetToken(j, STRING_DELIM);
     143 [ #  # ][ #  # ]:          0 :             if(rLongName != sLong)
     144                 :          0 :                 continue;
     145                 :            : 
     146         [ #  # ]:          0 :             TripleString pTriple;
     147         [ #  # ]:          0 :             pTriple.sGroup = pGroup->sName;
     148         [ #  # ]:          0 :             pTriple.sBlock = sLong;
     149 [ #  # ][ #  # ]:          0 :             pTriple.sShort = pGroup->sShortNames.GetToken(j, STRING_DELIM);
                 [ #  # ]
     150         [ #  # ]:          0 :             aTripleStrings.push_back(pTriple);
     151                 :          0 :             ++nFound;
     152 [ #  # ][ #  # ]:          0 :         }
                 [ #  # ]
     153                 :            :     }
     154                 :            : 
     155                 :          0 :     sal_Bool bRet = sal_False;
     156                 :          0 :     nCount = aTripleStrings.size();
     157         [ #  # ]:          0 :     if(1 == nCount)
     158                 :            :     {
     159         [ #  # ]:          0 :         const TripleString& pTriple(aTripleStrings.front());
     160         [ #  # ]:          0 :         rShortName = pTriple.sShort;
     161         [ #  # ]:          0 :         rGroupName = pTriple.sGroup;
     162                 :          0 :         bRet = sal_True;
     163                 :            :     }
     164         [ #  # ]:          0 :     else if(1 < nCount)
     165                 :            :     {
     166         [ #  # ]:          0 :         SwGlossDecideDlg aDlg(0);
     167         [ #  # ]:          0 :         String sTitle = aDlg.GetText();
     168         [ #  # ]:          0 :         sTitle += ' ';
     169 [ #  # ][ #  # ]:          0 :         sTitle += aTripleStrings.front().sBlock;
     170         [ #  # ]:          0 :         aDlg.SetText(sTitle);
     171                 :            : 
     172                 :          0 :         ListBox& rLB = aDlg.GetListBox();
     173 [ #  # ][ #  # ]:          0 :         for(std::vector<TripleString>::const_iterator i = aTripleStrings.begin(); i != aTripleStrings.end(); ++i)
                 [ #  # ]
     174 [ #  # ][ #  # ]:          0 :             rLB.InsertEntry(i->sGroup.GetToken(0, GLOS_DELIM));
                 [ #  # ]
     175                 :            : 
     176         [ #  # ]:          0 :         rLB.SelectEntryPos(0);
     177 [ #  # ][ #  # ]:          0 :         if(RET_OK == aDlg.Execute() &&
         [ #  # ][ #  # ]
     178         [ #  # ]:          0 :             LISTBOX_ENTRY_NOTFOUND != rLB.GetSelectEntryPos())
     179                 :            :         {
     180         [ #  # ]:          0 :             const TripleString& pTriple(aTripleStrings[rLB.GetSelectEntryPos()]);
     181         [ #  # ]:          0 :             rShortName = pTriple.sShort;
     182         [ #  # ]:          0 :             rGroupName = pTriple.sGroup;
     183                 :          0 :             bRet = sal_True;
     184                 :            :         }
     185                 :            :         else
     186 [ #  # ][ #  # ]:          0 :             bRet = sal_False;
     187                 :            :     }
     188                 :          0 :     return bRet;
     189                 :            : }
     190                 :            : 
     191                 :          0 : sal_uInt16  SwGlossaryList::GetGroupCount()
     192                 :            : {
     193         [ #  # ]:          0 :     if(!bFilled)
     194                 :          0 :         Update();
     195                 :          0 :     return aGroupArr.size();
     196                 :            : }
     197                 :            : 
     198                 :          0 : String SwGlossaryList::GetGroupName(sal_uInt16 nPos, sal_Bool bNoPath, String* pTitle)
     199                 :            : {
     200                 :            :     OSL_ENSURE(aGroupArr.size() > nPos, "group not available");
     201                 :          0 :     String sRet(aEmptyStr);
     202         [ #  # ]:          0 :     if(nPos < aGroupArr.size())
     203                 :            :     {
     204                 :          0 :         AutoTextGroup* pGroup = aGroupArr[nPos];
     205         [ #  # ]:          0 :         sRet = pGroup->sName;
     206         [ #  # ]:          0 :         if(bNoPath)
     207 [ #  # ][ #  # ]:          0 :             sRet = sRet.GetToken(0, GLOS_DELIM);
                 [ #  # ]
     208         [ #  # ]:          0 :         if(pTitle)
     209         [ #  # ]:          0 :             *pTitle = pGroup->sTitle;
     210                 :            :     }
     211                 :          0 :     return sRet;
     212                 :            : 
     213                 :            : }
     214                 :            : 
     215                 :          0 : sal_uInt16  SwGlossaryList::GetBlockCount(sal_uInt16 nGroup)
     216                 :            : {
     217                 :            :     OSL_ENSURE(aGroupArr.size() > nGroup, "group not available");
     218         [ #  # ]:          0 :     if(nGroup < aGroupArr.size())
     219                 :            :     {
     220                 :          0 :         AutoTextGroup* pGroup = aGroupArr[nGroup];
     221                 :          0 :         return pGroup->nCount;
     222                 :            :     }
     223                 :          0 :     return 0;
     224                 :            : }
     225                 :            : 
     226                 :          0 : String  SwGlossaryList::GetBlockName(sal_uInt16 nGroup, sal_uInt16 nBlock, String& rShortName)
     227                 :            : {
     228                 :            :     OSL_ENSURE(aGroupArr.size() > nGroup, "group not available");
     229         [ #  # ]:          0 :     if(nGroup < aGroupArr.size())
     230                 :            :     {
     231                 :          0 :         AutoTextGroup* pGroup = aGroupArr[nGroup];
     232         [ #  # ]:          0 :         rShortName = pGroup->sShortNames.GetToken(nBlock, STRING_DELIM);
     233                 :          0 :         return pGroup->sLongNames.GetToken(nBlock, STRING_DELIM);
     234                 :            :     }
     235                 :          0 :     return aEmptyStr;
     236                 :            : }
     237                 :            : 
     238                 :          0 : void SwGlossaryList::Update()
     239                 :            : {
     240         [ #  # ]:          0 :     if(!IsActive())
     241         [ #  # ]:          0 :         Start();
     242                 :            : 
     243         [ #  # ]:          0 :     SvtPathOptions aPathOpt;
     244 [ #  # ][ #  # ]:          0 :     String sTemp( aPathOpt.GetAutoTextPath() );
     245 [ #  # ][ #  # ]:          0 :     if(sTemp != sPath)
     246                 :            :     {
     247         [ #  # ]:          0 :         sPath = sTemp;
     248                 :          0 :         bFilled = sal_False;
     249         [ #  # ]:          0 :         ClearGroups();
     250                 :            :     }
     251         [ #  # ]:          0 :     SwGlossaries* pGlossaries = ::GetGlossaries();
     252                 :          0 :     const std::vector<String> & rPathArr = pGlossaries->GetPathArray();
     253         [ #  # ]:          0 :     String sExt( SwGlossaries::GetExtension() );
     254         [ #  # ]:          0 :     if(!bFilled)
     255                 :            :     {
     256         [ #  # ]:          0 :         sal_uInt16 nGroupCount = pGlossaries->GetGroupCnt();
     257         [ #  # ]:          0 :         for(sal_uInt16 i = 0; i < nGroupCount; i++)
     258                 :            :         {
     259         [ #  # ]:          0 :             String sGrpName = pGlossaries->GetGroupName(i);
     260 [ #  # ][ #  # ]:          0 :             sal_uInt16 nPath = (sal_uInt16)sGrpName.GetToken(1, GLOS_DELIM).ToInt32();
                 [ #  # ]
     261         [ #  # ]:          0 :             if( static_cast<size_t>(nPath) < rPathArr.size() )
     262                 :            :             {
     263 [ #  # ][ #  # ]:          0 :                 AutoTextGroup* pGroup = new AutoTextGroup;
     264         [ #  # ]:          0 :                 pGroup->sName = sGrpName;
     265                 :            : 
     266         [ #  # ]:          0 :                 FillGroup(pGroup, pGlossaries);
     267 [ #  # ][ #  # ]:          0 :                 String sName = rPathArr[nPath];
     268         [ #  # ]:          0 :                 sName += INET_PATH_TOKEN;
     269 [ #  # ][ #  # ]:          0 :                 sName += pGroup->sName.GetToken(0, GLOS_DELIM);
                 [ #  # ]
     270         [ #  # ]:          0 :                 sName += sExt;
     271                 :            : 
     272                 :            :                 FStatHelper::GetModifiedDateTimeOfFile( sName,
     273                 :            :                                                 &pGroup->aDateModified,
     274 [ #  # ][ #  # ]:          0 :                                                 &pGroup->aDateModified );
     275                 :            : 
     276 [ #  # ][ #  # ]:          0 :                 aGroupArr.insert( aGroupArr.begin(), pGroup );
     277                 :            :             }
     278         [ #  # ]:          0 :         }
     279                 :          0 :         bFilled = sal_True;
     280                 :            :     }
     281                 :            :     else
     282                 :            :     {
     283         [ #  # ]:          0 :         for( size_t nPath = 0; nPath < rPathArr.size(); nPath++ )
     284                 :            :         {
     285         [ #  # ]:          0 :             std::vector<String> aFoundGroupNames;
     286         [ #  # ]:          0 :             std::vector<String*> aFiles;
     287         [ #  # ]:          0 :             std::vector<DateTime*> aDateTimeArr;
     288                 :            : 
     289         [ #  # ]:          0 :             SWUnoHelper::UCB_GetFileListOfFolder( rPathArr[nPath], aFiles,
     290         [ #  # ]:          0 :                                                     &sExt, &aDateTimeArr );
     291         [ #  # ]:          0 :             for( size_t nFiles = 0; nFiles < aFiles.size(); ++nFiles )
     292                 :            :             {
     293         [ #  # ]:          0 :                 String* pTitle = aFiles[ nFiles ];
     294         [ #  # ]:          0 :                 ::DateTime* pDT = (::DateTime*) aDateTimeArr[ static_cast<sal_uInt16>(nFiles) ];
     295                 :            : 
     296         [ #  # ]:          0 :                 String sName( pTitle->Copy( 0, pTitle->Len() - sExt.Len() ));
     297                 :            : 
     298         [ #  # ]:          0 :                 aFoundGroupNames.push_back(sName);
     299         [ #  # ]:          0 :                 sName += GLOS_DELIM;
     300 [ #  # ][ #  # ]:          0 :                 sName += String::CreateFromInt32( static_cast<sal_uInt16>(nPath) );
                 [ #  # ]
     301         [ #  # ]:          0 :                 AutoTextGroup* pFound = FindGroup( sName );
     302         [ #  # ]:          0 :                 if( !pFound )
     303                 :            :                 {
     304 [ #  # ][ #  # ]:          0 :                     pFound = new AutoTextGroup;
     305         [ #  # ]:          0 :                     pFound->sName = sName;
     306         [ #  # ]:          0 :                     FillGroup( pFound, pGlossaries );
     307         [ #  # ]:          0 :                     pFound->aDateModified = *pDT;
     308                 :            : 
     309         [ #  # ]:          0 :                     aGroupArr.push_back(pFound);
     310                 :            :                 }
     311 [ #  # ][ #  # ]:          0 :                 else if( pFound->aDateModified < *pDT )
     312                 :            :                 {
     313         [ #  # ]:          0 :                     FillGroup(pFound, pGlossaries);
     314         [ #  # ]:          0 :                     pFound->aDateModified = *pDT;
     315                 :            :                 }
     316                 :            : 
     317                 :            :                 // don't need any more these pointers
     318 [ #  # ][ #  # ]:          0 :                 delete pTitle;
     319                 :          0 :                 delete pDT;
     320         [ #  # ]:          0 :             }
     321                 :            : 
     322                 :          0 :             sal_uInt16 nArrCount = aGroupArr.size();
     323         [ #  # ]:          0 :             for( sal_uInt16 i = nArrCount; i; --i)
     324                 :            :             {
     325                 :            :                 // evtl. geloeschte Gruppen entfernen
     326                 :          0 :                 AutoTextGroup* pGroup = aGroupArr[i - 1];
     327                 :            :                 sal_uInt16 nGroupPath = (sal_uInt16)pGroup->sName.GetToken( 1,
     328 [ #  # ][ #  # ]:          0 :                                                         GLOS_DELIM).ToInt32();
                 [ #  # ]
     329                 :            :                 // nur die Gruppen werden geprueft, die fuer den
     330                 :            :                 // aktuellen Teilpfad registriert sind
     331         [ #  # ]:          0 :                 if( nGroupPath == static_cast<sal_uInt16>(nPath) )
     332                 :            :                 {
     333                 :          0 :                     sal_Bool bFound = sal_False;
     334         [ #  # ]:          0 :                     String sCompareGroup = pGroup->sName.GetToken(0, GLOS_DELIM);
     335 [ #  # ][ #  # ]:          0 :                     for(std::vector<String>::const_iterator j = aFoundGroupNames.begin(); j != aFoundGroupNames.end() && !bFound; ++j)
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
           [ #  #  #  # ]
     336 [ #  # ][ #  # ]:          0 :                         bFound = (sCompareGroup == *j);
     337                 :            : 
     338         [ #  # ]:          0 :                     if(!bFound)
     339                 :            :                     {
     340 [ #  # ][ #  # ]:          0 :                         aGroupArr.erase(aGroupArr.begin() + i - 1);
                 [ #  # ]
     341 [ #  # ][ #  # ]:          0 :                         delete pGroup;
     342         [ #  # ]:          0 :                     }
     343                 :            :                 }
     344                 :            :             }
     345                 :          0 :         }
     346 [ #  # ][ #  # ]:          0 :     }
                 [ #  # ]
     347                 :          0 : }
     348                 :            : 
     349                 :          0 : void SwGlossaryList::Timeout()
     350                 :            : {
     351                 :            :     // nur, wenn eine SwView den Fokus hat, wird automatisch upgedated
     352         [ #  # ]:          0 :     if(::GetActiveView())
     353                 :          0 :         Update();
     354                 :          0 : }
     355                 :            : 
     356                 :          0 : AutoTextGroup*  SwGlossaryList::FindGroup(const String& rGroupName)
     357                 :            : {
     358         [ #  # ]:          0 :     for(sal_uInt16 i = 0; i < aGroupArr.size(); i++)
     359                 :            :     {
     360                 :          0 :         AutoTextGroup* pRet = aGroupArr[i];
     361         [ #  # ]:          0 :         if(pRet->sName == rGroupName)
     362                 :          0 :             return pRet;
     363                 :            :     }
     364                 :          0 :     return 0;
     365                 :            : }
     366                 :            : 
     367                 :          0 : void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries)
     368                 :            : {
     369                 :          0 :     SwTextBlocks*   pBlock = pGlossaries->GetGroupDoc(pGroup->sName);
     370         [ #  # ]:          0 :     pGroup->nCount = pBlock ? pBlock->GetCount() : 0;
     371                 :          0 :     pGroup->sLongNames = pGroup->sShortNames = aEmptyStr;
     372         [ #  # ]:          0 :     if(pBlock)
     373                 :          0 :         pGroup->sTitle = pBlock->GetName();
     374                 :            : 
     375         [ #  # ]:          0 :     for(sal_uInt16 j = 0; j < pGroup->nCount; j++)
     376                 :            :     {
     377                 :          0 :         pGroup->sLongNames  += pBlock->GetLongName(j);
     378                 :          0 :         pGroup->sLongNames  += STRING_DELIM;
     379                 :          0 :         pGroup->sShortNames += pBlock->GetShortName(j);
     380                 :          0 :         pGroup->sShortNames += STRING_DELIM;
     381                 :            :     }
     382                 :          0 :     pGlossaries->PutGroupDoc(pBlock);
     383                 :          0 : }
     384                 :            : 
     385                 :            : /********************************************************************
     386                 :            :     Alle (nicht mehr als FIND_MAX_GLOS) gefunden Bausteine mit
     387                 :            :     passendem Anfang zurueckgeben
     388                 :            : ********************************************************************/
     389                 :            : 
     390                 :          0 : bool SwGlossaryList::HasLongName(const String& rBegin, std::vector<String> *pLongNames)
     391                 :            : {
     392         [ #  # ]:          0 :     if(!bFilled)
     393                 :          0 :         Update();
     394                 :          0 :     sal_uInt16 nFound = 0;
     395                 :          0 :     sal_uInt16 nCount = aGroupArr.size();
     396                 :          0 :     sal_uInt16 nBeginLen = rBegin.Len();
     397                 :          0 :     const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
     398                 :            : 
     399         [ #  # ]:          0 :     for(sal_uInt16 i = 0; i < nCount; i++ )
     400                 :            :     {
     401                 :          0 :         AutoTextGroup* pGroup = aGroupArr[i];
     402         [ #  # ]:          0 :         for(sal_uInt16 j = 0; j < pGroup->nCount; j++)
     403                 :            :         {
     404         [ #  # ]:          0 :             String sBlock = pGroup->sLongNames.GetToken(j, STRING_DELIM);
     405 [ #  # ][ #  # ]:          0 :             if( rSCmp.isEqual( sBlock.Copy(0, nBeginLen), rBegin ) &&
           [ #  #  #  # ]
         [ #  # ][ #  # ]
           [ #  #  #  # ]
     406                 :          0 :                 nBeginLen + 1 < sBlock.Len())
     407                 :            :             {
     408         [ #  # ]:          0 :                 pLongNames->push_back( sBlock );
     409                 :          0 :                 nFound++;
     410         [ #  # ]:          0 :                 if(FIND_MAX_GLOS == nFound)
     411                 :            :                     break;
     412                 :            :             }
     413 [ #  # ][ #  # ]:          0 :         }
     414                 :            :     }
     415                 :          0 :     return nFound > 0;
     416                 :            : }
     417                 :            : 
     418                 :          0 : void    SwGlossaryList::ClearGroups()
     419                 :            : {
     420                 :          0 :     sal_uInt16 nCount = aGroupArr.size();
     421         [ #  # ]:          0 :     for( sal_uInt16 i = 0; i < nCount; ++i )
     422         [ #  # ]:          0 :         delete aGroupArr[ i ];
     423                 :            : 
     424                 :          0 :     aGroupArr.clear();
     425                 :          0 :     bFilled = sal_False;
     426                 :          0 : }
     427                 :            : 
     428                 :            : 
     429                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10