LCOV - code coverage report
Current view: top level - sw/source/ui/fldui - fldref.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 490 0.0 %
Date: 2014-04-11 Functions: 0 19 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 "swtypes.hxx"
      21             : #include <view.hxx>
      22             : #include <IMark.hxx>
      23             : #include <expfld.hxx>
      24             : #include <swmodule.hxx>
      25             : #include <fldref.hxx>
      26             : #include <reffld.hxx>
      27             : #include <wrtsh.hxx>
      28             : 
      29             : #include <fldui.hrc>
      30             : #include <globals.hrc>
      31             : // #i83479#
      32             : #include <SwNodeNum.hxx>
      33             : #include <IDocumentMarkAccess.hxx>
      34             : #include <ndtxt.hxx>
      35             : 
      36             : #include "svtools/treelistentry.hxx"
      37             : 
      38             : #define REFFLDFLAG          0x4000
      39             : #define REFFLDFLAG_BOOKMARK 0x4800
      40             : #define REFFLDFLAG_FOOTNOTE 0x5000
      41             : #define REFFLDFLAG_ENDNOTE  0x6000
      42             : // #i83479#
      43             : #define REFFLDFLAG_HEADING  0x7100
      44             : #define REFFLDFLAG_NUMITEM  0x7200
      45             : 
      46             : static sal_uInt16 nFldDlgFmtSel = 0;
      47             : 
      48             : #define USER_DATA_VERSION_1 "1"
      49             : #define USER_DATA_VERSION USER_DATA_VERSION_1
      50             : 
      51           0 : SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet )
      52             :     : SwFldPage(pParent, "FldRefPage",
      53             :         "modules/swriter/ui/fldrefpage.ui", rCoreSet)
      54             :     , maOutlineNodes()
      55             :     , maNumItems()
      56             :     , mpSavedSelectedTxtNode(0)
      57           0 :     , mnSavedSelectedPos(0)
      58             : {
      59           0 :     get(m_pTypeLB, "type");
      60           0 :     get(m_pSelection, "selectframe");
      61           0 :     get(m_pSelectionLB, "select");
      62           0 :     m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() | WB_SORT);
      63             :     // #i83479#
      64           0 :     get(m_pSelectionToolTipLB, "selecttip");
      65           0 :     get(m_pFormat, "formatframe");
      66           0 :     get(m_pFormatLB, "format");
      67           0 :     get(m_pNameFT, "nameft");
      68           0 :     get(m_pNameED, "name");
      69           0 :     get(m_pValueED, "value");
      70             : 
      71           0 :     sBookmarkTxt = m_pTypeLB->GetEntry(0);
      72           0 :     sFootnoteTxt = m_pTypeLB->GetEntry(1);
      73           0 :     sEndnoteTxt = m_pTypeLB->GetEntry(2);
      74             :     // #i83479#
      75           0 :     sHeadingTxt = m_pTypeLB->GetEntry(3);
      76           0 :     sNumItemTxt = m_pTypeLB->GetEntry(4);
      77           0 :     m_pTypeLB->Clear();
      78             : 
      79           0 :     long nHeight = m_pTypeLB->GetTextHeight() * 20;
      80           0 :     m_pSelection->set_height_request(nHeight);
      81           0 :     m_pSelectionToolTipLB->set_height_request(nHeight);
      82             : 
      83           0 :     nHeight = m_pTypeLB->GetTextHeight() * 8;
      84           0 :     m_pTypeLB->set_height_request(nHeight);
      85           0 :     m_pFormatLB->set_height_request(nHeight);
      86             : 
      87           0 :     long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width();
      88           0 :     m_pTypeLB->set_width_request(nWidth);
      89           0 :     m_pFormatLB->set_width_request(nWidth);
      90           0 :     m_pSelection->set_width_request(nWidth*2);
      91           0 :     m_pSelectionToolTipLB->set_width_request(nWidth*2);
      92             : 
      93           0 :     m_pNameED->SetModifyHdl(LINK(this, SwFldRefPage, ModifyHdl));
      94             : 
      95           0 :     m_pTypeLB->SetDoubleClickHdl       (LINK(this, SwFldRefPage, InsertHdl));
      96           0 :     m_pTypeLB->SetSelectHdl            (LINK(this, SwFldRefPage, TypeHdl));
      97           0 :     m_pSelectionLB->SetSelectHdl       (LINK(this, SwFldRefPage, SubTypeHdl));
      98           0 :     m_pSelectionLB->SetDoubleClickHdl  (LINK(this, SwFldRefPage, InsertHdl));
      99           0 :     m_pFormatLB->SetDoubleClickHdl     (LINK(this, SwFldRefPage, InsertHdl));
     100             : 
     101             :     // #i83479#
     102           0 :     m_pSelectionToolTipLB->SetSelectHdl( LINK(this, SwFldRefPage, SubTypeHdl) );
     103           0 :     m_pSelectionToolTipLB->SetDoubleClickHdl( LINK(this, SwFldRefPage, InsertHdl) );
     104           0 :     m_pSelectionToolTipLB->SetStyle( m_pSelectionToolTipLB->GetStyle() | WB_HSCROLL );
     105           0 :     m_pSelectionToolTipLB->SetSpaceBetweenEntries(1);
     106           0 :     m_pSelectionToolTipLB->SetHighlightRange();
     107           0 : }
     108             : 
     109           0 : SwFldRefPage::~SwFldRefPage()
     110             : {
     111           0 : }
     112             : 
     113             : // #i83479#
     114           0 : void SwFldRefPage::SaveSelectedTxtNode()
     115             : {
     116           0 :     mpSavedSelectedTxtNode = 0;
     117           0 :     mnSavedSelectedPos = 0;
     118           0 :     if ( m_pSelectionToolTipLB->IsVisible() )
     119             :     {
     120           0 :         SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry();
     121           0 :         if ( pEntry )
     122             :         {
     123           0 :             const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel());
     124             : 
     125           0 :             if ( nTypeId == REFFLDFLAG_HEADING )
     126             :             {
     127           0 :                 mnSavedSelectedPos = static_cast<size_t>(reinterpret_cast<sal_uLong>(pEntry->GetUserData()));
     128           0 :                 if ( mnSavedSelectedPos < maOutlineNodes.size() )
     129             :                 {
     130           0 :                     mpSavedSelectedTxtNode = maOutlineNodes[mnSavedSelectedPos];
     131             :                 }
     132             :             }
     133           0 :             else if ( nTypeId == REFFLDFLAG_NUMITEM )
     134             :             {
     135           0 :                 mnSavedSelectedPos = static_cast<size_t>(reinterpret_cast<sal_uLong>(pEntry->GetUserData()));
     136           0 :                 if ( mnSavedSelectedPos < maNumItems.size() )
     137             :                 {
     138           0 :                     mpSavedSelectedTxtNode = maNumItems[mnSavedSelectedPos]->GetTxtNode();
     139             :                 }
     140             :             }
     141             :         }
     142             :     }
     143           0 : }
     144             : 
     145           0 : void SwFldRefPage::Reset(const SfxItemSet& )
     146             : {
     147           0 :     if (!IsFldEdit())
     148             :     {
     149           0 :         SavePos(m_pTypeLB);
     150             :         // #i83479#
     151           0 :         SaveSelectedTxtNode();
     152             :     }
     153           0 :     SetSelectionSel(LISTBOX_ENTRY_NOTFOUND);
     154           0 :     SetTypeSel(LISTBOX_ENTRY_NOTFOUND);
     155           0 :     Init(); // general initialisation
     156             : 
     157             :     // initialise TypeListBox
     158           0 :     m_pTypeLB->SetUpdateMode(false);
     159           0 :     m_pTypeLB->Clear();
     160             : 
     161             :     // fill Type-Listbox
     162             : 
     163             :     sal_Int32 nPos;
     164             :     // set/insert reference
     165           0 :     const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
     166             : 
     167           0 :     for (short i = rRg.nStart; i < rRg.nEnd; ++i)
     168             :     {
     169           0 :         const sal_uInt16 nTypeId = GetFldMgr().GetTypeId(i);
     170             : 
     171           0 :         if (!IsFldEdit() || nTypeId != TYP_SETREFFLD)
     172             :         {
     173           0 :             nPos = m_pTypeLB->InsertEntry(GetFldMgr().GetTypeStr(i), i - rRg.nStart);
     174           0 :             m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(nTypeId));
     175             :         }
     176             :     }
     177             : 
     178             :     // #i83479#
     179             :     // entries for headings and numbered items
     180           0 :     nPos = m_pTypeLB->InsertEntry(sHeadingTxt);
     181           0 :     m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_HEADING);
     182           0 :     nPos = m_pTypeLB->InsertEntry(sNumItemTxt);
     183           0 :     m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_NUMITEM);
     184             : 
     185             :     // fill up with the sequence types
     186           0 :     SwWrtShell *pSh = GetWrtShell();
     187           0 :     if(!pSh)
     188           0 :         pSh = ::GetActiveWrtShell();
     189             : 
     190           0 :     const sal_uInt16 nFldTypeCnt = pSh->GetFldTypeCount(RES_SETEXPFLD);
     191             : 
     192           0 :     for (sal_uInt16 n = 0; n < nFldTypeCnt; ++n)
     193             :     {
     194           0 :         SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType(n, RES_SETEXPFLD);
     195             : 
     196           0 :         if ((nsSwGetSetExpType::GSE_SEQ & pType->GetType()) && pType->GetDepends() && pSh->IsUsed(*pType))
     197             :         {
     198           0 :             nPos = m_pTypeLB->InsertEntry(pType->GetName());
     199           0 :             m_pTypeLB->SetEntryData(nPos, (void*)(sal_uIntPtr)(REFFLDFLAG | n));
     200             :         }
     201             :     }
     202             : 
     203             :     // text marks - now always (because of globaldocuments)
     204           0 :     nPos = m_pTypeLB->InsertEntry(sBookmarkTxt);
     205           0 :     m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_BOOKMARK);
     206             : 
     207             :     // footnotes:
     208           0 :     if( pSh->HasFtns() )
     209             :     {
     210           0 :         nPos = m_pTypeLB->InsertEntry(sFootnoteTxt);
     211           0 :         m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_FOOTNOTE);
     212             :     }
     213             : 
     214             :     // endnotes:
     215           0 :     if ( pSh->HasFtns(true) )
     216             :     {
     217           0 :         nPos = m_pTypeLB->InsertEntry(sEndnoteTxt);
     218           0 :         m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_ENDNOTE);
     219             :     }
     220             : 
     221             :     // select old Pos
     222           0 :     if (!IsFldEdit())
     223           0 :         RestorePos(m_pTypeLB);
     224             : 
     225           0 :     m_pTypeLB->SetUpdateMode(true);
     226             : 
     227           0 :     nFldDlgFmtSel = 0;
     228             : 
     229           0 :     if( !IsRefresh() )
     230             :     {
     231           0 :         OUString sUserData = GetUserData();
     232           0 :         if(!IsRefresh() && sUserData.getToken(0, ';').
     233           0 :                                 equalsIgnoreAsciiCase(USER_DATA_VERSION_1))
     234             :         {
     235           0 :             OUString sVal = sUserData.getToken(1, ';');
     236           0 :             const sal_uInt16 nVal = static_cast< sal_uInt16 >(sVal.toInt32());
     237           0 :             if(nVal != USHRT_MAX)
     238             :             {
     239           0 :                 for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++)
     240           0 :                     if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i))
     241             :                     {
     242           0 :                         m_pTypeLB->SelectEntryPos(i);
     243           0 :                         break;
     244             :                     }
     245           0 :             }
     246           0 :         }
     247             :     }
     248           0 :     TypeHdl(0);
     249             : 
     250           0 :     if (IsFldEdit())
     251             :     {
     252           0 :         m_pTypeLB->SaveValue();
     253           0 :         m_pSelectionLB->SaveValue();
     254           0 :         m_pFormatLB->SaveValue();
     255           0 :         m_pNameED->SaveValue();
     256           0 :         m_pValueED->SaveValue();
     257             :     }
     258           0 : }
     259             : 
     260           0 : IMPL_LINK_NOARG(SwFldRefPage, TypeHdl)
     261             : {
     262             :     // save old ListBoxPos
     263           0 :     const sal_Int32 nOld = GetTypeSel();
     264             : 
     265             :     // current ListBoxPos
     266           0 :     SetTypeSel(m_pTypeLB->GetSelectEntryPos());
     267             : 
     268           0 :     if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND)
     269             :     {
     270           0 :         if (IsFldEdit())
     271             :         {
     272             :             // select positions
     273           0 :             OUString sName;
     274           0 :             sal_uInt16 nFlag = 0;
     275             : 
     276           0 :             switch( GetCurField()->GetSubType() )
     277             :             {
     278             :                 case REF_BOOKMARK:
     279             :                 {
     280             :                     // #i83479#
     281           0 :                     SwGetRefField* pRefFld = dynamic_cast<SwGetRefField*>(GetCurField());
     282           0 :                     if ( pRefFld &&
     283           0 :                          pRefFld->IsRefToHeadingCrossRefBookmark() )
     284             :                     {
     285           0 :                         sName = sHeadingTxt;
     286           0 :                         nFlag = REFFLDFLAG_HEADING;
     287             :                     }
     288           0 :                     else if ( pRefFld &&
     289           0 :                               pRefFld->IsRefToNumItemCrossRefBookmark() )
     290             :                     {
     291           0 :                         sName = sNumItemTxt;
     292           0 :                         nFlag = REFFLDFLAG_NUMITEM;
     293             :                     }
     294             :                     else
     295             :                     {
     296           0 :                         sName = sBookmarkTxt;
     297           0 :                         nFlag = REFFLDFLAG_BOOKMARK;
     298             :                     }
     299             :                 }
     300           0 :                 break;
     301             : 
     302             :                 case REF_FOOTNOTE:
     303           0 :                     sName = sFootnoteTxt;
     304           0 :                     nFlag = REFFLDFLAG_FOOTNOTE;
     305           0 :                     break;
     306             : 
     307             :                 case REF_ENDNOTE:
     308           0 :                     sName = sEndnoteTxt;
     309           0 :                     nFlag = REFFLDFLAG_ENDNOTE;
     310           0 :                     break;
     311             : 
     312             :                 case REF_SETREFATTR:
     313           0 :                     sName = SW_RESSTR(STR_GETREFFLD);
     314           0 :                     nFlag = REF_SETREFATTR;
     315           0 :                     break;
     316             : 
     317             :                 case REF_SEQUENCEFLD:
     318           0 :                     sName = ((SwGetRefField*)GetCurField())->GetSetRefName();
     319           0 :                     nFlag = REFFLDFLAG;
     320           0 :                     break;
     321             :             }
     322             : 
     323           0 :             if (m_pTypeLB->GetEntryPos(sName) == LISTBOX_ENTRY_NOTFOUND)   // reference to deleted mark
     324             :             {
     325           0 :                 sal_Int32 nPos = m_pTypeLB->InsertEntry(sName);
     326           0 :                 m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(nFlag));
     327             :             }
     328             : 
     329           0 :             m_pTypeLB->SelectEntry(sName);
     330           0 :             SetTypeSel(m_pTypeLB->GetSelectEntryPos());
     331             :         }
     332             :         else
     333             :         {
     334           0 :             SetTypeSel(0);
     335           0 :             m_pTypeLB->SelectEntryPos(0);
     336             :         }
     337             :     }
     338             : 
     339           0 :     if (nOld != GetTypeSel())
     340             :     {
     341           0 :         sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel());
     342             : 
     343             :         // fill selection-ListBox
     344           0 :         UpdateSubType();
     345             : 
     346           0 :         sal_Bool bName = sal_False;
     347           0 :         nFldDlgFmtSel = 0;
     348             : 
     349           0 :         if ( ( !IsFldEdit() || m_pSelectionLB->GetEntryCount() ) &&
     350             :              nOld != LISTBOX_ENTRY_NOTFOUND )
     351             :         {
     352           0 :             m_pNameED->SetText(aEmptyOUStr);
     353           0 :             m_pValueED->SetText(aEmptyOUStr);
     354             :         }
     355             : 
     356           0 :         switch (nTypeId)
     357             :         {
     358             :             case TYP_GETREFFLD:
     359           0 :                 if (REFFLDFLAG & (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(nOld))
     360             :                     // the old one stays
     361           0 :                     nFldDlgFmtSel = m_pFormatLB->GetSelectEntryPos();
     362           0 :                 bName = sal_True;
     363           0 :                 break;
     364             : 
     365             :             case TYP_SETREFFLD:
     366           0 :                 bName = sal_True;
     367           0 :                 break;
     368             : 
     369             :             case REFFLDFLAG_BOOKMARK:
     370           0 :                 bName = sal_True;
     371             :                 // no break!!!
     372             :             default:
     373           0 :                 if( REFFLDFLAG & nTypeId )
     374             :                 {
     375           0 :                     const sal_uInt16 nOldId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(nOld);
     376           0 :                     if( nOldId & REFFLDFLAG || nOldId == TYP_GETREFFLD )
     377             :                         // then the old one stays
     378           0 :                         nFldDlgFmtSel = m_pFormatLB->GetSelectEntryPos();
     379             :                 }
     380           0 :                 break;
     381             :         }
     382             : 
     383           0 :         m_pNameED->Enable(bName);
     384           0 :         m_pNameFT->Enable(bName);
     385             : 
     386             :         // fill Format-Listbox
     387           0 :         sal_Int32 nSize = FillFormatLB(nTypeId);
     388           0 :         bool bFormat = nSize != 0;
     389           0 :         m_pFormat->Enable(bFormat);
     390             : 
     391           0 :         SubTypeHdl();
     392           0 :         ModifyHdl();
     393             :     }
     394             : 
     395           0 :     return 0;
     396             : }
     397             : 
     398           0 : IMPL_LINK_NOARG(SwFldRefPage, SubTypeHdl)
     399             : {
     400           0 :     sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel());
     401             : 
     402           0 :     switch(nTypeId)
     403             :     {
     404             :         case TYP_GETREFFLD:
     405           0 :             if (!IsFldEdit() || m_pSelectionLB->GetSelectEntryCount())
     406             :             {
     407           0 :                 m_pNameED->SetText(m_pSelectionLB->GetSelectEntry());
     408           0 :                 ModifyHdl(m_pNameED);
     409             :             }
     410           0 :             break;
     411             : 
     412             :         case TYP_SETREFFLD:
     413             :         {
     414           0 :             SwWrtShell *pSh = GetWrtShell();
     415           0 :             if(!pSh)
     416           0 :                 pSh = ::GetActiveWrtShell();
     417           0 :             if(pSh)
     418             :             {
     419           0 :                 m_pValueED->SetText(pSh->GetSelTxt());
     420             :             }
     421             : 
     422             :         }
     423           0 :         break;
     424             :         // #i83479#
     425             :         case REFFLDFLAG_HEADING:
     426             :         case REFFLDFLAG_NUMITEM:
     427             :         {
     428           0 :             if ( m_pSelectionToolTipLB->GetCurEntry() )
     429             :             {
     430             :                 m_pNameED->SetText( m_pSelectionToolTipLB->GetEntryText(
     431           0 :                                         m_pSelectionToolTipLB->GetCurEntry() ) );
     432             :             }
     433             :         }
     434           0 :         break;
     435             : 
     436             :         default:
     437           0 :             if (!IsFldEdit() || m_pSelectionLB->GetSelectEntryCount())
     438           0 :                 m_pNameED->SetText(m_pSelectionLB->GetSelectEntry());
     439           0 :             break;
     440             :     }
     441             : 
     442           0 :     return 0;
     443             : }
     444             : 
     445             : /*--------------------------------------------------------------------
     446             :      Description: renew types in SelectionLB
     447             :  --------------------------------------------------------------------*/
     448             : 
     449           0 : void SwFldRefPage::UpdateSubType()
     450             : {
     451           0 :     SwWrtShell *pSh = GetWrtShell();
     452           0 :     if(!pSh)
     453           0 :         pSh = ::GetActiveWrtShell();
     454           0 :     SwGetRefField* pRefFld = (SwGetRefField*)GetCurField();
     455           0 :     const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel());
     456             : 
     457           0 :     OUString sOldSel;
     458             :     // #i83479#
     459           0 :     if ( m_pSelectionLB->IsVisible() )
     460             :     {
     461           0 :         const sal_Int32 nSelectionSel = m_pSelectionLB->GetSelectEntryPos();
     462           0 :         if (nSelectionSel != LISTBOX_ENTRY_NOTFOUND)
     463             :         {
     464           0 :             sOldSel = m_pSelectionLB->GetEntry(nSelectionSel);
     465             :         }
     466             :     }
     467           0 :     if (IsFldEdit() && sOldSel.isEmpty())
     468           0 :         sOldSel = OUString::number( pRefFld->GetSeqNo() + 1 );
     469             : 
     470           0 :     m_pSelectionLB->SetUpdateMode(false);
     471           0 :     m_pSelectionLB->Clear();
     472             :     // #i83479#
     473           0 :     m_pSelectionToolTipLB->SetUpdateMode(false);
     474           0 :     m_pSelectionToolTipLB->Clear();
     475           0 :     bool bShowSelectionToolTipLB( false );
     476             : 
     477           0 :     if( REFFLDFLAG & nTypeId )
     478             :     {
     479           0 :         if (nTypeId == REFFLDFLAG_BOOKMARK)     // text marks!
     480             :         {
     481           0 :             m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle()|WB_SORT);
     482             :             // get all text marks
     483           0 :             IDocumentMarkAccess* const pMarkAccess = pSh->getIDocumentMarkAccess();
     484           0 :             for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin();
     485           0 :                 ppMark != pMarkAccess->getBookmarksEnd();
     486             :                 ++ppMark)
     487             :             {
     488           0 :                 const ::sw::mark::IMark* pBkmk = ppMark->get();
     489           0 :                 if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk))
     490           0 :                     m_pSelectionLB->InsertEntry( pBkmk->GetName() );
     491             :             }
     492           0 :             if (IsFldEdit())
     493           0 :                 sOldSel = pRefFld->GetSetRefName();
     494             :         }
     495           0 :         else if (nTypeId == REFFLDFLAG_FOOTNOTE)
     496             :         {
     497           0 :             m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() & ~WB_SORT);
     498           0 :             SwSeqFldList aArr;
     499           0 :             const sal_uInt16 nCnt = pSh->GetSeqFtnList( aArr );
     500             : 
     501           0 :             for( sal_uInt16 n = 0; n < nCnt; ++n )
     502             :             {
     503           0 :                 m_pSelectionLB->InsertEntry( aArr[ n ]->sDlgEntry );
     504           0 :                 if (IsFldEdit() && pRefFld->GetSeqNo() == aArr[ n ]->nSeqNo)
     505           0 :                     sOldSel = aArr[n]->sDlgEntry;
     506           0 :             }
     507             :         }
     508           0 :         else if (nTypeId == REFFLDFLAG_ENDNOTE)
     509             :         {
     510           0 :             m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() & ~WB_SORT);
     511           0 :             SwSeqFldList aArr;
     512           0 :             const sal_uInt16 nCnt = pSh->GetSeqFtnList( aArr, true );
     513             : 
     514           0 :             for( sal_uInt16 n = 0; n < nCnt; ++n )
     515             :             {
     516           0 :                 m_pSelectionLB->InsertEntry( aArr[ n ]->sDlgEntry );
     517           0 :                 if (IsFldEdit() && pRefFld->GetSeqNo() == aArr[ n ]->nSeqNo)
     518           0 :                     sOldSel = aArr[n]->sDlgEntry;
     519           0 :             }
     520             :         }
     521             :         // #i83479#
     522           0 :         else if ( nTypeId == REFFLDFLAG_HEADING )
     523             :         {
     524           0 :             bShowSelectionToolTipLB = true;
     525             : 
     526           0 :             const IDocumentOutlineNodes* pIDoc( pSh->getIDocumentOutlineNodesAccess() );
     527           0 :             pIDoc->getOutlineNodes( maOutlineNodes );
     528           0 :             bool bCertainTxtNodeSelected( false );
     529           0 :             SvTreeListEntry* pEntry = 0;
     530           0 :             for ( size_t nOutlIdx = 0; nOutlIdx < maOutlineNodes.size(); ++nOutlIdx )
     531             :             {
     532             :                 pEntry = m_pSelectionToolTipLB->InsertEntry(
     533           0 :                                 pIDoc->getOutlineText( nOutlIdx, true, true, false ) );
     534           0 :                 pEntry->SetUserData( reinterpret_cast<void*>(nOutlIdx) );
     535           0 :                 if ( ( IsFldEdit() &&
     536           0 :                        pRefFld->GetReferencedTxtNode() == maOutlineNodes[nOutlIdx] ) ||
     537           0 :                      mpSavedSelectedTxtNode == maOutlineNodes[nOutlIdx] )
     538             :                 {
     539           0 :                     m_pSelectionToolTipLB->Select( pEntry );
     540           0 :                     sOldSel = "";
     541           0 :                     bCertainTxtNodeSelected = true;
     542             :                 }
     543           0 :                 else if ( !bCertainTxtNodeSelected && mnSavedSelectedPos == nOutlIdx )
     544             :                 {
     545           0 :                     m_pSelectionToolTipLB->Select( pEntry );
     546           0 :                     sOldSel = "";
     547             :                 }
     548             :             }
     549             :         }
     550           0 :         else if ( nTypeId == REFFLDFLAG_NUMITEM )
     551             :         {
     552           0 :             bShowSelectionToolTipLB = true;
     553             : 
     554           0 :             const IDocumentListItems* pIDoc( pSh->getIDocumentListItemsAccess() );
     555           0 :             pIDoc->getNumItems( maNumItems );
     556           0 :             bool bCertainTxtNodeSelected( false );
     557           0 :             SvTreeListEntry* pEntry = 0;
     558           0 :             for ( size_t nNumItemIdx = 0; nNumItemIdx < maNumItems.size(); ++nNumItemIdx )
     559             :             {
     560             :                 pEntry = m_pSelectionToolTipLB->InsertEntry(
     561           0 :                             pIDoc->getListItemText( *maNumItems[nNumItemIdx], true, true ) );
     562           0 :                 pEntry->SetUserData( reinterpret_cast<void*>(nNumItemIdx) );
     563           0 :                 if ( ( IsFldEdit() &&
     564           0 :                        pRefFld->GetReferencedTxtNode() == maNumItems[nNumItemIdx]->GetTxtNode() ) ||
     565           0 :                      mpSavedSelectedTxtNode == maNumItems[nNumItemIdx]->GetTxtNode() )
     566             :                 {
     567           0 :                     m_pSelectionToolTipLB->Select( pEntry );
     568           0 :                     sOldSel = "";
     569           0 :                     bCertainTxtNodeSelected = true;
     570             :                 }
     571           0 :                 else if ( !bCertainTxtNodeSelected && mnSavedSelectedPos == nNumItemIdx )
     572             :                 {
     573           0 :                     m_pSelectionToolTipLB->Select( pEntry );
     574           0 :                     sOldSel = "";
     575             :                 }
     576             :             }
     577             :         }
     578             :         else
     579             :         {
     580           0 :             m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle()|WB_SORT);
     581             :             // get the fields to Seq-FieldType:
     582             : 
     583             :             SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType(
     584           0 :                                 nTypeId & ~REFFLDFLAG, RES_SETEXPFLD );
     585           0 :             if( pType )
     586             :             {
     587           0 :                 SwSeqFldList aArr;
     588             :                 // old selection should be kept in non-edit mode
     589           0 :                 if(IsFldEdit())
     590           0 :                     sOldSel = "";
     591             : 
     592           0 :                 const sal_uInt16 nCnt = pType->GetSeqFldList( aArr );
     593           0 :                 for( sal_uInt16 n = 0; n < nCnt; ++n )
     594             :                 {
     595           0 :                     m_pSelectionLB->InsertEntry( aArr[ n ]->sDlgEntry );
     596           0 :                     if (IsFldEdit() && sOldSel.isEmpty() &&
     597           0 :                         aArr[ n ]->nSeqNo == pRefFld->GetSeqNo())
     598           0 :                         sOldSel = aArr[ n ]->sDlgEntry;
     599             :                 }
     600             : 
     601           0 :                 if (IsFldEdit() && sOldSel.isEmpty())
     602           0 :                     sOldSel = OUString::number( pRefFld->GetSeqNo() + 1);
     603             :             }
     604             :         }
     605             :     }
     606             :     else
     607             :     {
     608           0 :         std::vector<OUString> aLst;
     609           0 :         GetFldMgr().GetSubTypes(nTypeId, aLst);
     610           0 :         for(size_t i = 0; i < aLst.size(); ++i)
     611           0 :             m_pSelectionLB->InsertEntry(aLst[i]);
     612             : 
     613           0 :         if (IsFldEdit())
     614           0 :             sOldSel = pRefFld->GetSetRefName();
     615             :     }
     616             : 
     617             :     // #i83479#
     618           0 :     m_pSelectionToolTipLB->Show( bShowSelectionToolTipLB );
     619           0 :     m_pSelectionLB->Show( !bShowSelectionToolTipLB );
     620           0 :     if ( bShowSelectionToolTipLB )
     621             :     {
     622           0 :         m_pSelectionToolTipLB->SetUpdateMode(true);
     623             : 
     624           0 :         bool bEnable = m_pSelectionToolTipLB->GetEntryCount() != 0;
     625           0 :         m_pSelection->Enable( bEnable );
     626             : 
     627           0 :         if ( m_pSelectionToolTipLB->GetCurEntry() != 0 )
     628             :         {
     629           0 :             m_pSelectionToolTipLB->MakeVisible( m_pSelectionToolTipLB->GetCurEntry() );
     630             :         }
     631             : 
     632           0 :         if ( IsFldEdit() && m_pSelectionToolTipLB->GetCurEntry() == 0 )
     633             :         {
     634           0 :             m_pNameED->SetText(sOldSel);
     635             :         }
     636             :     }
     637             :     else
     638             :     {
     639           0 :         m_pSelectionLB->SetUpdateMode(true);
     640             : 
     641             :         // enable or disable
     642           0 :         bool bEnable = m_pSelectionLB->GetEntryCount() != 0;
     643           0 :         m_pSelection->Enable( bEnable );
     644             : 
     645           0 :         if ( bEnable )
     646             :         {
     647           0 :             m_pSelectionLB->SelectEntry(sOldSel);
     648           0 :             if (!m_pSelectionLB->GetSelectEntryCount() && !IsFldEdit())
     649           0 :                 m_pSelectionLB->SelectEntryPos(0);
     650             :         }
     651             : 
     652           0 :         if (IsFldEdit() && !m_pSelectionLB->GetSelectEntryCount()) // in case the reference was already deleted...
     653           0 :             m_pNameED->SetText(sOldSel);
     654           0 :     }
     655           0 : }
     656             : 
     657           0 : sal_Int32 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
     658             : {
     659           0 :     OUString sOldSel;
     660             : 
     661           0 :     sal_Int32 nFormatSel = m_pFormatLB->GetSelectEntryPos();
     662           0 :     if (nFormatSel != LISTBOX_ENTRY_NOTFOUND)
     663           0 :         sOldSel = m_pFormatLB->GetEntry(nFormatSel);
     664             : 
     665             :     // fill Format-Listbox
     666           0 :     m_pFormatLB->Clear();
     667             : 
     668             :     // refernce has less that the annotation
     669           0 :     sal_uInt16 nSize( 0 );
     670           0 :     bool bAddCrossRefFormats( false );
     671           0 :     switch (nTypeId)
     672             :     {
     673             :         // #i83479#
     674             :         case REFFLDFLAG_HEADING:
     675             :         case REFFLDFLAG_NUMITEM:
     676           0 :             bAddCrossRefFormats = true;
     677             :             // intentional no break here
     678             : 
     679             :         case TYP_GETREFFLD:
     680             :         case REFFLDFLAG_BOOKMARK:
     681             :         case REFFLDFLAG_FOOTNOTE:
     682             :         case REFFLDFLAG_ENDNOTE:
     683           0 :             nSize = FMT_REF_PAGE_PGDSC - FMT_REF_BEGIN + 1;
     684           0 :             break;
     685             : 
     686             :         default:
     687             :             // #i83479#
     688             : 
     689           0 :             if ( REFFLDFLAG & nTypeId )
     690             :             {
     691           0 :                 nSize = FMT_REF_ONLYSEQNO - FMT_REF_BEGIN + 1;
     692             :             }
     693             :             else
     694             :             {
     695           0 :                 nSize = GetFldMgr().GetFormatCount( nTypeId, false, IsFldDlgHtmlMode() );
     696             :             }
     697           0 :             break;
     698             :     }
     699             : 
     700           0 :     if (REFFLDFLAG & nTypeId)
     701           0 :         nTypeId = TYP_GETREFFLD;
     702             : 
     703           0 :     for (sal_uInt16 i = 0; i < nSize; i++)
     704             :     {
     705           0 :         sal_Int32 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, i ));
     706           0 :         m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, i )));
     707             :     }
     708             :     // #i83479#
     709           0 :     if ( bAddCrossRefFormats )
     710             :     {
     711           0 :         sal_uInt16 nFormat = FMT_REF_NUMBER - FMT_REF_BEGIN;
     712           0 :         sal_Int32 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat ));
     713           0 :         m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat )));
     714           0 :         nFormat = FMT_REF_NUMBER_NO_CONTEXT - FMT_REF_BEGIN;
     715           0 :         nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat ));
     716           0 :         m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat )));
     717           0 :         nFormat = FMT_REF_NUMBER_FULL_CONTEXT - FMT_REF_BEGIN;
     718           0 :         nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat ));
     719           0 :         m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat )));
     720           0 :         nSize += 3;
     721             :     }
     722             : 
     723             :     // select a certain entry
     724           0 :     if (nSize)
     725             :     {
     726           0 :         if (!IsFldEdit())
     727           0 :             m_pFormatLB->SelectEntry(sOldSel);
     728             :         else
     729           0 :             m_pFormatLB->SelectEntry(SW_RESSTR(FMT_REF_BEGIN + GetCurField()->GetFormat()));
     730             : 
     731           0 :         if (!m_pFormatLB->GetSelectEntryCount())
     732             :         {
     733           0 :             m_pFormatLB->SelectEntryPos(nFldDlgFmtSel);
     734           0 :             if (!m_pFormatLB->GetSelectEntryCount())
     735           0 :                 m_pFormatLB->SelectEntryPos(0);
     736             :         }
     737             :     }
     738             : 
     739           0 :     return nSize;
     740             : }
     741             : 
     742             : /*--------------------------------------------------------------------
     743             :     Description: Modify
     744             :  --------------------------------------------------------------------*/
     745             : 
     746           0 : IMPL_LINK_NOARG(SwFldRefPage, ModifyHdl)
     747             : {
     748           0 :     OUString aName(m_pNameED->GetText());
     749           0 :     const bool bEmptyName = aName.isEmpty();
     750             : 
     751           0 :     sal_Bool bEnable = sal_True;
     752           0 :     sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel());
     753             : 
     754           0 :     if ((nTypeId == TYP_SETREFFLD && !GetFldMgr().CanInsertRefMark(aName)) ||
     755           0 :         (bEmptyName && (nTypeId == TYP_GETREFFLD || nTypeId == TYP_SETREFFLD ||
     756             :                        nTypeId == REFFLDFLAG_BOOKMARK)))
     757           0 :         bEnable = sal_False;
     758             : 
     759           0 :     EnableInsert(bEnable);
     760             : 
     761           0 :     m_pSelectionLB->SelectEntry(aName);
     762             : 
     763           0 :     return 0;
     764             : }
     765             : 
     766           0 : bool SwFldRefPage::FillItemSet(SfxItemSet& )
     767             : {
     768           0 :     sal_Bool bModified = sal_False;
     769           0 :     sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel());
     770             : 
     771           0 :     sal_uInt16 nSubType = 0;
     772           0 :     const sal_Int32 nEntryPos = m_pFormatLB->GetSelectEntryPos();
     773             :     const sal_uLong nFormat = (nEntryPos == LISTBOX_ENTRY_NOTFOUND)
     774           0 :         ? 0 : (sal_uLong)m_pFormatLB->GetEntryData(nEntryPos);
     775             : 
     776           0 :     OUString aVal(m_pValueED->GetText());
     777           0 :     OUString aName(m_pNameED->GetText());
     778             : 
     779           0 :     switch(nTypeId)
     780             :     {
     781             :         case TYP_GETREFFLD:
     782           0 :             nSubType = REF_SETREFATTR;
     783           0 :             break;
     784             : 
     785             :         case TYP_SETREFFLD:
     786             :         {
     787           0 :             SwFieldType* pType = GetFldMgr().GetFldType(RES_SETEXPFLD, aName);
     788             : 
     789           0 :             if(!pType)  // Only insert when the name doesn't exist yet
     790             :             {
     791           0 :                 m_pSelectionLB->InsertEntry(aName);
     792           0 :                 m_pSelection->Enable();
     793             :             }
     794           0 :             break;
     795             :         }
     796             :     }
     797             : 
     798           0 :     SwGetRefField* pRefFld = (SwGetRefField*)GetCurField();
     799             : 
     800           0 :     if (REFFLDFLAG & nTypeId)
     801             :     {
     802           0 :         SwWrtShell *pSh = GetWrtShell();
     803           0 :         if(!pSh)
     804             :         {
     805           0 :             pSh = ::GetActiveWrtShell();
     806             :         }
     807           0 :         if (nTypeId == REFFLDFLAG_BOOKMARK)     // text marks!
     808             :         {
     809           0 :             aName = m_pNameED->GetText();
     810           0 :             nTypeId = TYP_GETREFFLD;
     811           0 :             nSubType = REF_BOOKMARK;
     812             :         }
     813           0 :         else if (REFFLDFLAG_FOOTNOTE == nTypeId)        // footnotes
     814             :         {
     815           0 :             SwSeqFldList aArr;
     816           0 :             _SeqFldLstElem aElem( m_pSelectionLB->GetSelectEntry(), 0 );
     817             : 
     818             :             sal_uInt16 nPos;
     819             : 
     820           0 :             nTypeId = TYP_GETREFFLD;
     821           0 :             nSubType = REF_FOOTNOTE;
     822           0 :             aName = "";
     823             : 
     824           0 :             if (pSh->GetSeqFtnList(aArr) && aArr.SeekEntry(aElem, &nPos))
     825             :             {
     826           0 :                 aVal = OUString::number( aArr[nPos]->nSeqNo );
     827             : 
     828           0 :                 if (IsFldEdit() && aArr[nPos]->nSeqNo == pRefFld->GetSeqNo())
     829           0 :                     bModified = sal_True; // can happen with fields of which the references were deleted
     830             :             }
     831           0 :             else if (IsFldEdit())
     832           0 :                 aVal = OUString::number( pRefFld->GetSeqNo() );
     833             :         }
     834           0 :         else if (REFFLDFLAG_ENDNOTE == nTypeId)         // endnotes
     835             :         {
     836           0 :             SwSeqFldList aArr;
     837           0 :             _SeqFldLstElem aElem( m_pSelectionLB->GetSelectEntry(), 0 );
     838             : 
     839             :             sal_uInt16 nPos;
     840             : 
     841           0 :             nTypeId = TYP_GETREFFLD;
     842           0 :             nSubType = REF_ENDNOTE;
     843           0 :             aName = "";
     844             : 
     845           0 :             if (pSh->GetSeqFtnList(aArr, true) && aArr.SeekEntry(aElem, &nPos))
     846             :             {
     847           0 :                 aVal = OUString::number( aArr[nPos]->nSeqNo );
     848             : 
     849           0 :                 if (IsFldEdit() && aArr[nPos]->nSeqNo == pRefFld->GetSeqNo())
     850           0 :                     bModified = sal_True; // can happen with fields of which the reference was deleted
     851             :             }
     852           0 :             else if (IsFldEdit())
     853           0 :                 aVal = OUString::number( pRefFld->GetSeqNo() );
     854             :         }
     855             :         // #i83479#
     856           0 :         else if ( nTypeId == REFFLDFLAG_HEADING )
     857             :         {
     858           0 :             SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry();
     859             :             OSL_ENSURE( pEntry,
     860             :                     "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" );
     861           0 :             if ( pEntry )
     862             :             {
     863             :                 const size_t nOutlIdx( static_cast<size_t>
     864           0 :                     (reinterpret_cast<sal_uLong>(pEntry->GetUserData())) );
     865           0 :                 pSh->getIDocumentOutlineNodesAccess()->getOutlineNodes( maOutlineNodes );
     866           0 :                 if ( nOutlIdx < maOutlineNodes.size() )
     867             :                 {
     868           0 :                     ::sw::mark::IMark const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTxtNode(
     869           0 :                         *(maOutlineNodes[nOutlIdx]),
     870           0 :                         IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK);
     871           0 :                     aName = pMark->GetName();
     872           0 :                     nTypeId = TYP_GETREFFLD;
     873           0 :                     nSubType = REF_BOOKMARK;
     874             :                 }
     875             :             }
     876             :         }
     877           0 :         else if ( nTypeId == REFFLDFLAG_NUMITEM )
     878             :         {
     879           0 :             SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry();
     880             :             OSL_ENSURE( pEntry,
     881             :                     "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" );
     882           0 :             if ( pEntry )
     883             :             {
     884             :                 const size_t nNumItemIdx( static_cast<size_t>
     885           0 :                     (reinterpret_cast<sal_uLong>(pEntry->GetUserData())) );
     886           0 :                 pSh->getIDocumentListItemsAccess()->getNumItems( maNumItems );
     887           0 :                 if ( nNumItemIdx < maNumItems.size() )
     888             :                 {
     889           0 :                     ::sw::mark::IMark const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTxtNode(
     890           0 :                         *(maNumItems[nNumItemIdx]->GetTxtNode()),
     891           0 :                         IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK);
     892           0 :                     aName = pMark->GetName();
     893           0 :                     nTypeId = TYP_GETREFFLD;
     894           0 :                     nSubType = REF_BOOKMARK;
     895             :                 }
     896             :             }
     897             :         }
     898             :         else                                // SeqenceFields
     899             :         {
     900             :             // get fields for Seq-FeldType:
     901             :             SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType(
     902           0 :                                     nTypeId & ~REFFLDFLAG, RES_SETEXPFLD );
     903           0 :             if( pType )
     904             :             {
     905           0 :                 SwSeqFldList aArr;
     906           0 :                 _SeqFldLstElem aElem( m_pSelectionLB->GetSelectEntry(), 0 );
     907             : 
     908             :                 sal_uInt16 nPos;
     909             : 
     910           0 :                 nTypeId = TYP_GETREFFLD;
     911           0 :                 nSubType = REF_SEQUENCEFLD;
     912           0 :                 aName = pType->GetName();
     913             : 
     914           0 :                 if (pType->GetSeqFldList(aArr) && aArr.SeekEntry(aElem, &nPos))
     915             :                 {
     916           0 :                     aVal = OUString::number( aArr[nPos]->nSeqNo );
     917             : 
     918           0 :                     if (IsFldEdit() && aArr[nPos]->nSeqNo == pRefFld->GetSeqNo())
     919           0 :                         bModified = sal_True; // can happen with fields of which the reference was deleted
     920             :                 }
     921           0 :                 else if (IsFldEdit())
     922           0 :                     aVal = OUString::number( pRefFld->GetSeqNo() );
     923             :             }
     924             :         }
     925             :     }
     926             : 
     927           0 :     if (IsFldEdit() && nTypeId == TYP_GETREFFLD)
     928             :     {
     929           0 :         aVal = OUString::number(nSubType) + "|" + aVal;
     930             :     }
     931             : 
     932           0 :     if (!IsFldEdit() || bModified ||
     933           0 :         m_pNameED->GetSavedValue() != m_pNameED->GetText() ||
     934           0 :         m_pValueED->GetSavedValue() != m_pValueED->GetText() ||
     935           0 :         m_pTypeLB->GetSavedValue() != m_pTypeLB->GetSelectEntryPos() ||
     936           0 :         m_pSelectionLB->GetSavedValue() != m_pSelectionLB->GetSelectEntryPos() ||
     937           0 :         m_pFormatLB->GetSavedValue() != m_pFormatLB->GetSelectEntryPos())
     938             :     {
     939           0 :         InsertFld( nTypeId, nSubType, aName, aVal, nFormat );
     940             :     }
     941             : 
     942           0 :     ModifyHdl();    // enable/disable insert if applicable
     943             : 
     944           0 :     return false;
     945             : }
     946             : 
     947           0 : SfxTabPage* SwFldRefPage::Create(   Window* pParent,
     948             :                         const SfxItemSet& rAttrSet )
     949             : {
     950           0 :     return ( new SwFldRefPage( pParent, rAttrSet ) );
     951             : }
     952             : 
     953           0 : sal_uInt16 SwFldRefPage::GetGroup()
     954             : {
     955           0 :     return GRP_REF;
     956             : }
     957             : 
     958           0 : void    SwFldRefPage::FillUserData()
     959             : {
     960           0 :     const sal_Int32 nEntryPos = m_pTypeLB->GetSelectEntryPos();
     961             :     const sal_uInt16 nTypeSel = ( LISTBOX_ENTRY_NOTFOUND == nEntryPos )
     962             :         ? USHRT_MAX
     963             :         : sal::static_int_cast< sal_uInt16 >
     964           0 :             (reinterpret_cast< sal_uIntPtr >(m_pTypeLB->GetEntryData( nEntryPos )));
     965           0 :     SetUserData( USER_DATA_VERSION ";" + OUString::number( nTypeSel ));
     966           0 : }
     967             : 
     968             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10