LCOV - code coverage report
Current view: top level - libreoffice/sw/source/ui/index - swuiidxmrk.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 943 0.0 %
Date: 2012-12-27 Functions: 0 87 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 "swuiidxmrk.hxx"
      21             : #include <hintids.hxx>
      22             : #include <helpid.h>
      23             : #include <comphelper/processfactory.hxx>
      24             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      25             : #include <com/sun/star/beans/PropertyValue.hpp>
      26             : #include <com/sun/star/beans/XPropertySet.hpp>
      27             : #include <com/sun/star/util/SearchOptions.hpp>
      28             : #include <com/sun/star/util/SearchFlags.hpp>
      29             : #include <com/sun/star/i18n/TransliterationModules.hpp>
      30             : #include <svl/stritem.hxx>
      31             : #include <vcl/msgbox.hxx>
      32             : #include <sfx2/dispatch.hxx>
      33             : #include <svl/eitem.hxx>
      34             : #include <svtools/txtcmp.hxx>
      35             : #include <editeng/scripttypeitem.hxx>
      36             : #include <svl/itemset.hxx>
      37             : #include <editeng/langitem.hxx>
      38             : #include "editeng/unolingu.hxx"
      39             : #include <swtypes.hxx>
      40             : #include <idxmrk.hxx>
      41             : #include <txttxmrk.hxx>
      42             : #include <wrtsh.hxx>
      43             : #include <view.hxx>
      44             : #include <multmrk.hxx>
      45             : #include <swundo.hxx>                   // for Undo-Ids
      46             : #include <cmdid.h>
      47             : #include <app.hrc>
      48             : #include <index.hrc>
      49             : #include <idxmrk.hrc>
      50             : #include <swmodule.hxx>
      51             : #include <fldmgr.hxx>
      52             : #include <fldbas.hxx>
      53             : #include <utlui.hrc>
      54             : #include <swcont.hxx>
      55             : #include <svl/cjkoptions.hxx>
      56             : #include <ndtxt.hxx>
      57             : #include <breakit.hxx>
      58             : #include <SwRewriter.hxx>
      59             : 
      60             : #include <unomid.h>
      61             : 
      62             : 
      63             : #define POS_CONTENT 0
      64             : #define POS_INDEX   1
      65             : #define POS_USER    2
      66             : 
      67             : static sal_uInt16 nTypePos = 1; // TOX_INDEX as standard
      68             : static sal_uInt16 nKey1Pos = USHRT_MAX;
      69             : 
      70             : static sal_uInt16 nKey2Pos = USHRT_MAX;
      71             : 
      72             : using namespace com::sun::star;
      73             : using namespace com::sun::star::i18n;
      74             : using namespace com::sun::star::lang;
      75             : using namespace com::sun::star::util;
      76             : using namespace com::sun::star::i18n;
      77             : using ::rtl::OUString;
      78             : using namespace ::comphelper;
      79             : using namespace ::com::sun::star;
      80             : 
      81             : /*--------------------------------------------------------------------
      82             :      Description:   dialog to insert a directory selection
      83             :  --------------------------------------------------------------------*/
      84           0 : SwIndexMarkPane::SwIndexMarkPane(Dialog &rDialog, sal_Bool bNewDlg,
      85             :     SwWrtShell& rWrtShell)
      86             :     : m_rDialog(rDialog)
      87             :     , bNewMark(bNewDlg)
      88             :     , bSelected(sal_False)
      89             :     , bPhoneticED0_ChangedByUser(sal_False)
      90             :     , bPhoneticED1_ChangedByUser(sal_False)
      91             :     , bPhoneticED2_ChangedByUser(sal_False)
      92             :     , nLangForPhoneticReading(LANGUAGE_CHINESE_SIMPLIFIED)
      93             :     , bIsPhoneticReadingEnabled(sal_False)
      94             :     , xExtendedIndexEntrySupplier(NULL)
      95             :     , pTOXMgr(0)
      96           0 :     , pSh(&rWrtShell)
      97             : {
      98           0 :     rDialog.get(m_pFrame, "frame");
      99           0 :     rDialog.get(m_pTypeFT, "typeft");
     100           0 :     rDialog.get(m_pTypeDCB, "typecb");
     101           0 :     rDialog.get(m_pNewBT, "new");
     102           0 :     m_pNewBT->SetAccessibleRelationMemberOf(m_pFrame->get_label_widget());
     103           0 :     rDialog.get(m_pEntryED, "entryed");
     104           0 :     rDialog.get(m_pPhoneticFT0, "phonetic0ft");
     105           0 :     rDialog.get(m_pPhoneticED0, "phonetic0ed");
     106           0 :     rDialog.get(m_pKey1FT, "key1ft");
     107           0 :     rDialog.get(m_pKey1DCB, "key1cb");
     108           0 :     rDialog.get(m_pPhoneticFT1, "phonetic1ft");
     109           0 :     rDialog.get(m_pPhoneticED1, "phonetic1ed");
     110           0 :     rDialog.get(m_pKey2FT, "key2ft");
     111           0 :     rDialog.get(m_pKey2DCB, "key2cb");
     112           0 :     rDialog.get(m_pPhoneticFT2, "phonetic2ft");
     113           0 :     rDialog.get(m_pPhoneticED2, "phonetic2ed");
     114           0 :     rDialog.get(m_pLevelFT, "levelft");
     115           0 :     rDialog.get(m_pLevelNF, "levelnf");
     116           0 :     rDialog.get(m_pMainEntryCB, "mainentrycb");
     117           0 :     rDialog.get(m_pApplyToAllCB, "applytoallcb");
     118           0 :     rDialog.get(m_pSearchCaseSensitiveCB, "searchcasesensitivecb");
     119           0 :     rDialog.get(m_pSearchCaseWordOnlyCB, "searchcasewordonlycb");
     120           0 :     rDialog.get(m_pCloseBT, "close");
     121           0 :     rDialog.get(m_pDelBT, "delete");
     122           0 :     rDialog.get(m_pPrevSameBT, "first");
     123           0 :     rDialog.get(m_pNextSameBT, "last");
     124           0 :     rDialog.get(m_pPrevBT, "previous");
     125           0 :     rDialog.get(m_pNextBT, "next");
     126             : 
     127           0 :     if (SvtCJKOptions().IsCJKFontEnabled())
     128             :     {
     129           0 :         uno::Reference< lang::XMultiServiceFactory > xMSF = getProcessServiceFactory();
     130             : 
     131             :         xExtendedIndexEntrySupplier =
     132             :             uno::Reference< i18n::XExtendedIndexEntrySupplier > (
     133           0 :                     xMSF->createInstance( "com.sun.star.i18n.IndexEntrySupplier"),
     134           0 :                                                                         uno::UNO_QUERY );
     135             : 
     136           0 :         m_pPhoneticFT0->Show();
     137           0 :         m_pPhoneticED0->Show();
     138           0 :         m_pPhoneticFT1->Show();
     139           0 :         m_pPhoneticED1->Show();
     140           0 :         m_pPhoneticFT2->Show();
     141           0 :         m_pPhoneticED2->Show();
     142             :     }
     143             : 
     144           0 :     rDialog.SetText( SW_RESSTR( bNewMark ? STR_IDXMRK_INSERT : STR_IDXMRK_EDIT));
     145             : 
     146           0 :     m_pDelBT->SetClickHdl(LINK(this,SwIndexMarkPane,        DelHdl));
     147           0 :     m_pPrevBT->SetClickHdl(LINK(this,SwIndexMarkPane,       PrevHdl));
     148           0 :     m_pPrevSameBT->SetClickHdl(LINK(this,SwIndexMarkPane,   PrevSameHdl));
     149           0 :     m_pNextBT->SetClickHdl(LINK(this,SwIndexMarkPane,       NextHdl));
     150           0 :     m_pNextSameBT->SetClickHdl(LINK(this,SwIndexMarkPane,   NextSameHdl));
     151           0 :     m_pTypeDCB->SetSelectHdl(LINK(this,SwIndexMarkPane,     ModifyHdl));
     152           0 :     m_pKey1DCB->SetModifyHdl(LINK(this,SwIndexMarkPane,      KeyDCBModifyHdl));
     153           0 :     m_pKey2DCB->SetModifyHdl(LINK(this,SwIndexMarkPane,     KeyDCBModifyHdl));
     154           0 :     m_pCloseBT->SetClickHdl(LINK(this,SwIndexMarkPane,     CloseHdl));
     155           0 :     m_pEntryED->SetModifyHdl(LINK(this,SwIndexMarkPane,     ModifyHdl));
     156           0 :     m_pNewBT->SetClickHdl(LINK(this, SwIndexMarkPane,       NewUserIdxHdl));
     157           0 :     m_pApplyToAllCB->SetClickHdl(LINK(this, SwIndexMarkPane, SearchTypeHdl));
     158           0 :     m_pPhoneticED0->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl));
     159           0 :     m_pPhoneticED1->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl));
     160           0 :     m_pPhoneticED2->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl));
     161             : 
     162           0 :     if(bNewMark)
     163             :     {
     164           0 :         m_pDelBT->Hide();
     165           0 :         rDialog.get(m_pOKBT, "insert");
     166             :     }
     167             :     else
     168             :     {
     169           0 :         m_pNewBT->Hide();
     170           0 :         rDialog.get(m_pOKBT, "ok");
     171             :     }
     172           0 :     m_pOKBT->Show();
     173           0 :     m_pOKBT->SetClickHdl(LINK(this, SwIndexMarkPane, InsertHdl));
     174             : 
     175           0 :     m_pEntryED->GrabFocus();
     176           0 : }
     177             : 
     178             : /*--------------------------------------------------------------------
     179             :      Description: Newly initialise controls with the new selection
     180             :  --------------------------------------------------------------------*/
     181           0 : void SwIndexMarkPane::InitControls()
     182             : {
     183             :     OSL_ENSURE(pSh && pTOXMgr, "no shell?");
     184             :     // contents index
     185           0 :     const SwTOXType* pType = pTOXMgr->GetTOXType(TOX_CONTENT, 0);
     186             :     OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
     187           0 :     String sTmpTypeSelection;
     188           0 :     if(m_pTypeDCB->GetSelectEntryCount())
     189           0 :         sTmpTypeSelection = m_pTypeDCB->GetSelectEntry();
     190           0 :     m_pTypeDCB->Clear();
     191           0 :     m_pTypeDCB->InsertEntry(pType->GetTypeName());
     192             : 
     193             :     // keyword index
     194           0 :     pType = pTOXMgr->GetTOXType(TOX_INDEX, 0);
     195             :     OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
     196           0 :     m_pTypeDCB->InsertEntry(pType->GetTypeName());
     197             : 
     198             :     // user index
     199           0 :     sal_uInt16 nCount = pSh->GetTOXTypeCount(TOX_USER);
     200             :     sal_uInt16 i;
     201           0 :     for( i = 0; i < nCount; ++i )
     202           0 :         m_pTypeDCB->InsertEntry( pSh->GetTOXType(TOX_USER, i)->GetTypeName() );
     203             : 
     204             :     // read keywords primary
     205           0 :     std::vector<String> aArr;
     206           0 :     nCount = pSh->GetTOIKeys( TOI_PRIMARY, aArr );
     207           0 :     std::sort(aArr.begin(), aArr.end());
     208           0 :     for (std::vector<String>::iterator it = aArr.begin(); it != aArr.end(); ++it)
     209           0 :         m_pKey1DCB->InsertEntry( *it );
     210             : 
     211             :     // read keywords secondary
     212           0 :     nCount = pSh->GetTOIKeys( TOI_SECONDARY, aArr );
     213           0 :     std::sort(aArr.begin(), aArr.end());
     214           0 :     for (std::vector<String>::iterator it = aArr.begin(); it != aArr.end(); ++it)
     215           0 :         m_pKey2DCB->InsertEntry( *it );
     216             : 
     217           0 :     UpdateLanguageDependenciesForPhoneticReading();
     218             : 
     219             :     // current entry
     220           0 :     const SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
     221           0 :     if( pMark && !bNewMark)
     222             :     {
     223             :         // Controls-Handling
     224             : 
     225             :         // onyl if there are more than one
     226             :         // if equal it lands at the same entry
     227           0 :         pSh->SttCrsrMove();
     228             : 
     229             :         const SwTOXMark* pMoveMark;
     230           0 :         sal_Bool bShow = sal_False;
     231             : 
     232           0 :         pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_PRV );
     233           0 :         if( pMoveMark != pMark )
     234           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_NXT ), bShow = sal_True;
     235           0 :         m_pPrevBT->Enable( pMoveMark != pMark );
     236           0 :         pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_NXT );
     237           0 :         if( pMoveMark != pMark )
     238           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_PRV ), bShow = sal_True;
     239           0 :         m_pNextBT->Enable( pMoveMark != pMark );
     240           0 :         if( bShow )
     241             :         {
     242           0 :             m_pPrevBT->Show();
     243           0 :             m_pNextBT->Show();
     244           0 :             bShow = sal_False;
     245             :         }
     246             : 
     247           0 :         pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_PRV );
     248           0 :         if( pMoveMark != pMark )
     249           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT ), bShow = sal_True;
     250           0 :         m_pPrevSameBT->Enable( pMoveMark != pMark );
     251           0 :         pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_NXT );
     252           0 :         if( pMoveMark != pMark )
     253           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV ), bShow = sal_True;
     254           0 :         m_pNextSameBT->Enable( pMoveMark != pMark );
     255           0 :         if( bShow )
     256             :         {
     257           0 :             m_pNextSameBT->Show();
     258           0 :             m_pPrevSameBT->Show();
     259             :         }
     260           0 :         pSh->EndCrsrMove();
     261             : 
     262           0 :         m_pTypeFT->Show();
     263             : 
     264           0 :         m_pTypeDCB->Enable(sal_False);
     265           0 :         m_pTypeFT->Enable(sal_False);
     266             : 
     267           0 :         UpdateDialog();
     268             :     }
     269             :     else
     270             :     {   // display current selection (first element) ????
     271           0 :         sal_uInt16 nCnt = pSh->GetCrsrCnt();
     272           0 :         if (nCnt < 2)
     273             :         {
     274           0 :             bSelected = !pSh->HasSelection();
     275           0 :             aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
     276           0 :             m_pEntryED->SetText(aOrgStr);
     277             : 
     278             :             //to include all equal entries may only be allowed in the body and even there
     279             :             //only when a simple selection exists
     280           0 :             const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True);
     281           0 :             m_pApplyToAllCB->Show();
     282           0 :             m_pSearchCaseSensitiveCB->Show();
     283           0 :             m_pSearchCaseWordOnlyCB->Show();
     284           0 :             m_pApplyToAllCB->Enable(0 != aOrgStr.Len() &&
     285           0 :                 0 == (nFrmType & ( FRMTYPE_HEADER | FRMTYPE_FOOTER | FRMTYPE_FLY_ANY )));
     286           0 :             SearchTypeHdl(m_pApplyToAllCB);
     287             :         }
     288             : 
     289             :         // index type is default
     290           0 :         if( sTmpTypeSelection.Len() &&
     291           0 :             LISTBOX_ENTRY_NOTFOUND != m_pTypeDCB->GetEntryPos( sTmpTypeSelection ) )
     292           0 :             m_pTypeDCB->SelectEntry(sTmpTypeSelection);
     293             :         else
     294           0 :             m_pTypeDCB->SelectEntry(m_pTypeDCB->GetEntry(nTypePos));
     295           0 :         ModifyHdl(m_pTypeDCB);
     296           0 :     }
     297           0 : }
     298             : 
     299           0 : void    SwIndexMarkPane::UpdateLanguageDependenciesForPhoneticReading()
     300             : {
     301             :     //no phonetic reading if no global cjk support
     302           0 :     if( !xExtendedIndexEntrySupplier.is() )
     303             :     {
     304           0 :         bIsPhoneticReadingEnabled = sal_False;
     305           0 :         return;
     306             :     }
     307           0 :     bIsPhoneticReadingEnabled = sal_True;
     308             : 
     309             :     //get the current language
     310           0 :     if(!bNewMark) //if dialog is opened to iterate existing marks
     311             :     {
     312             :         OSL_ENSURE(pTOXMgr, "need TOXMgr");
     313           0 :         if(!pTOXMgr)
     314           0 :             return;
     315           0 :         SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
     316             :         OSL_ENSURE(pMark, "need current SwTOXMark");
     317           0 :         if(!pMark)
     318           0 :             return;
     319           0 :         SwTxtTOXMark* pTxtTOXMark = pMark->GetTxtTOXMark();
     320             :         OSL_ENSURE(pTxtTOXMark, "need current SwTxtTOXMark");
     321           0 :         if(!pTxtTOXMark)
     322           0 :             return;
     323           0 :         const SwTxtNode* pTxtNode = pTxtTOXMark->GetpTxtNd();
     324             :         OSL_ENSURE(pTxtNode, "need current SwTxtNode");
     325           0 :         if(!pTxtNode)
     326           0 :             return;
     327           0 :         xub_StrLen nTextIndex = *pTxtTOXMark->GetStart();
     328           0 :         nLangForPhoneticReading = pTxtNode->GetLang( nTextIndex );
     329             :     }
     330             :     else //if dialog is opened to create a new mark
     331             :     {
     332           0 :         sal_uInt16 nScriptType = pSh->GetScriptType();
     333             :         sal_uInt16 nWhich;
     334           0 :         switch(nScriptType)
     335             :         {
     336           0 :             case SCRIPTTYPE_ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
     337           0 :             case SCRIPTTYPE_COMPLEX:nWhich = RES_CHRATR_CTL_LANGUAGE; break;
     338           0 :             default:nWhich = RES_CHRATR_LANGUAGE; break;
     339             :         }
     340           0 :         SfxItemSet aLangSet(pSh->GetAttrPool(), nWhich, nWhich);
     341           0 :         pSh->GetCurAttr(aLangSet);
     342           0 :         nLangForPhoneticReading = ((const SvxLanguageItem&)aLangSet.Get(nWhich)).GetLanguage();
     343             :     }
     344             : 
     345             : }
     346             : 
     347           0 : String  SwIndexMarkPane::GetDefaultPhoneticReading( const String& rText )
     348             : {
     349           0 :     if( !bIsPhoneticReadingEnabled )
     350           0 :         return aEmptyStr;
     351             : 
     352           0 :     return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, LanguageTag( nLangForPhoneticReading ).getLocale());
     353             : }
     354             : 
     355             : /* --------------------------------------------------
     356             :     Change the content of m_pEntryED if text is selected
     357             :  --------------------------------------------------*/
     358           0 : void    SwIndexMarkPane::Activate()
     359             : {
     360             :     // display current selection (first element) ????
     361           0 :     if(bNewMark)
     362             :     {
     363           0 :         sal_uInt16 nCnt = pSh->GetCrsrCnt();
     364           0 :         if (nCnt < 2)
     365             :         {
     366           0 :             bSelected = !pSh->HasSelection();
     367           0 :             aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
     368           0 :             m_pEntryED->SetText(aOrgStr);
     369             : 
     370             :             //to include all equal entries may only be allowed in the body and even there
     371             :             //only when a simple selection exists
     372           0 :             const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True);
     373           0 :             m_pApplyToAllCB->Show();
     374           0 :             m_pSearchCaseSensitiveCB->Show();
     375           0 :             m_pSearchCaseWordOnlyCB->Show();
     376           0 :             m_pApplyToAllCB->Enable(0 != aOrgStr.Len() &&
     377           0 :                 0 == (nFrmType & ( FRMTYPE_HEADER | FRMTYPE_FOOTER | FRMTYPE_FLY_ANY )));
     378           0 :             SearchTypeHdl(m_pApplyToAllCB);
     379             :         }
     380           0 :         ModifyHdl(m_pTypeDCB);
     381             :     }
     382           0 : }
     383             : 
     384             : /*--------------------------------------------------------------------
     385             :      Description:   evaluate Ok-Button
     386             :  --------------------------------------------------------------------*/
     387           0 : void SwIndexMarkPane::Apply()
     388             : {
     389           0 :     InsertUpdate();
     390           0 :     if(bSelected)
     391           0 :         pSh->ResetSelect(0, sal_False);
     392           0 : }
     393             : 
     394             : /*--------------------------------------------------------------------
     395             :     Description: apply changes
     396             :  --------------------------------------------------------------------*/
     397           0 : void SwIndexMarkPane::InsertUpdate()
     398             : {
     399           0 :     pSh->StartUndo(bDel ? UNDO_INDEX_ENTRY_DELETE : UNDO_INDEX_ENTRY_INSERT);
     400           0 :     pSh->StartAllAction();
     401             : 
     402           0 :     SwRewriter aRewriter;
     403             : 
     404           0 :     if( bNewMark )
     405             :     {
     406           0 :         InsertMark();
     407             : 
     408           0 :         if ( pTOXMgr->GetCurTOXMark())
     409           0 :             aRewriter.AddRule(UndoArg1, pTOXMgr->GetCurTOXMark()->GetText());
     410             :     }
     411           0 :     else if( !pSh->HasReadonlySel() )
     412             :     {
     413           0 :         if ( pTOXMgr->GetCurTOXMark())
     414             :             aRewriter.AddRule(UndoArg1,
     415           0 :                               pTOXMgr->GetCurTOXMark()->GetText());
     416             : 
     417           0 :         if( bDel )
     418           0 :             pTOXMgr->DeleteTOXMark();
     419           0 :         else if( pTOXMgr->GetCurTOXMark() )
     420           0 :             UpdateMark();
     421             :     }
     422             : 
     423           0 :     pSh->EndAllAction();
     424           0 :     pSh->EndUndo(bDel ? UNDO_INDEX_ENTRY_DELETE : UNDO_INDEX_ENTRY_INSERT);
     425             : 
     426           0 :     if((nTypePos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry())) == LISTBOX_ENTRY_NOTFOUND)
     427           0 :         nTypePos = 0;
     428             : 
     429           0 :     nKey1Pos = m_pKey1DCB->GetEntryPos(m_pKey1DCB->GetText());
     430           0 :     nKey2Pos = m_pKey2DCB->GetEntryPos(m_pKey2DCB->GetText());
     431           0 : }
     432             : 
     433             : /*--------------------------------------------------------------------
     434             :      Description:   insert mark
     435             :  --------------------------------------------------------------------*/
     436           0 : static void lcl_SelectSameStrings(SwWrtShell& rSh, sal_Bool bWordOnly, sal_Bool bCaseSensitive)
     437             : {
     438           0 :     rSh.Push();
     439             : 
     440             :     SearchOptions aSearchOpt(
     441             :                         SearchAlgorithms_ABSOLUTE,
     442             :                         ( bWordOnly ? SearchFlags::NORM_WORD_ONLY : 0 ),
     443             :                         rSh.GetSelTxt(), OUString(),
     444           0 :                         GetAppLanguageTag().getLocale(),
     445             :                         0, 0, 0,
     446             :                         (bCaseSensitive
     447             :                             ? 0
     448           0 :                             : TransliterationModules_IGNORE_CASE) );
     449             : 
     450           0 :     rSh.ClearMark();
     451             :     sal_Bool bCancel;
     452             : 
     453             :     //todo/mba: assuming that notes should not be searched
     454           0 :     sal_Bool bSearchInNotes = sal_False;
     455             :     rSh.Find( aSearchOpt,  bSearchInNotes, DOCPOS_START, DOCPOS_END, bCancel,
     456           0 :                         (FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY), sal_False );
     457           0 : }
     458             : 
     459             : 
     460           0 : void SwIndexMarkPane::InsertMark()
     461             : {
     462           0 :     sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry());
     463             :     TOXTypes eType = nPos == POS_CONTENT ? TOX_CONTENT :
     464           0 :                         nPos == POS_INDEX ? TOX_INDEX : TOX_USER;
     465             : 
     466           0 :     SwTOXMarkDescription aDesc(eType);
     467             : 
     468           0 :     sal_uInt16 nLevel = (sal_uInt16)m_pLevelNF->Denormalize(m_pLevelNF->GetValue());
     469           0 :     switch(nPos)
     470             :     {
     471           0 :         case POS_CONTENT : break;
     472             :         case POS_INDEX:     // keyword index mark
     473             :         {
     474           0 :             UpdateKeyBoxes();
     475           0 :             String  aPrim(m_pKey1DCB->GetText());
     476           0 :             String  aSec(m_pKey2DCB->GetText());
     477           0 :             aDesc.SetPrimKey(aPrim);
     478           0 :             aDesc.SetSecKey(aSec);
     479           0 :             aDesc.SetMainEntry(m_pMainEntryCB->IsChecked());
     480           0 :             aDesc.SetPhoneticReadingOfAltStr(m_pPhoneticED0->GetText());
     481           0 :             aDesc.SetPhoneticReadingOfPrimKey(m_pPhoneticED1->GetText());
     482           0 :             aDesc.SetPhoneticReadingOfSecKey(m_pPhoneticED2->GetText());
     483             :         }
     484           0 :         break;
     485             :         default:            // Userdefined index mark
     486             :         {
     487           0 :             String aName(m_pTypeDCB->GetSelectEntry());
     488           0 :             aDesc.SetTOUName(aName);
     489             :         }
     490             :     }
     491           0 :     if (aOrgStr != m_pEntryED->GetText())
     492           0 :         aDesc.SetAltStr(m_pEntryED->GetText());
     493           0 :     sal_Bool bApplyAll = m_pApplyToAllCB->IsChecked();
     494           0 :     sal_Bool bWordOnly = m_pSearchCaseWordOnlyCB->IsChecked();
     495           0 :     sal_Bool bCaseSensitive = m_pSearchCaseSensitiveCB->IsChecked();
     496             : 
     497           0 :     pSh->StartAllAction();
     498             :     // all equal strings have to be selected here so that the
     499             :     // entry is apllied to all equal strings
     500           0 :     if(bApplyAll)
     501             :     {
     502           0 :         lcl_SelectSameStrings(*pSh, bWordOnly, bCaseSensitive);
     503             :     }
     504           0 :     aDesc.SetLevel(nLevel);
     505           0 :     SwTOXMgr aMgr(pSh);
     506           0 :     aMgr.InsertTOXMark(aDesc);
     507           0 :     if(bApplyAll)
     508           0 :         pSh->Pop(sal_False);
     509             : 
     510           0 :     pSh->EndAllAction();
     511           0 : }
     512             : 
     513             : /*--------------------------------------------------------------------
     514             :      Description:   update mark
     515             :  --------------------------------------------------------------------*/
     516           0 : void SwIndexMarkPane::UpdateMark()
     517             : {
     518           0 :     String  aAltText(m_pEntryED->GetText());
     519           0 :     String* pAltText = aOrgStr != m_pEntryED->GetText() ? &aAltText : 0;
     520             :     //empty alternative texts are not allowed
     521           0 :     if(pAltText && !pAltText->Len())
     522           0 :         return;
     523             : 
     524           0 :     UpdateKeyBoxes();
     525             : 
     526           0 :     sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry());
     527           0 :     TOXTypes eType = TOX_USER;
     528           0 :     if(POS_CONTENT == nPos)
     529           0 :         eType = TOX_CONTENT;
     530           0 :     else if(POS_INDEX == nPos)
     531           0 :         eType = TOX_INDEX;
     532             : 
     533           0 :     SwTOXMarkDescription aDesc(eType);
     534           0 :     aDesc.SetLevel( static_cast< int >(m_pLevelNF->GetValue()) );
     535           0 :     if(pAltText)
     536           0 :         aDesc.SetAltStr(*pAltText);
     537             : 
     538           0 :     String  aPrim(m_pKey1DCB->GetText());
     539           0 :     if(aPrim.Len())
     540           0 :         aDesc.SetPrimKey(aPrim);
     541           0 :     String  aSec(m_pKey2DCB->GetText());
     542           0 :     if(aSec.Len())
     543           0 :         aDesc.SetSecKey(aSec);
     544             : 
     545           0 :     if(eType == TOX_INDEX)
     546             :     {
     547           0 :         aDesc.SetPhoneticReadingOfAltStr(m_pPhoneticED0->GetText());
     548           0 :         aDesc.SetPhoneticReadingOfPrimKey(m_pPhoneticED1->GetText());
     549           0 :         aDesc.SetPhoneticReadingOfSecKey(m_pPhoneticED2->GetText());
     550             :     }
     551           0 :     aDesc.SetMainEntry(m_pMainEntryCB->IsVisible() && m_pMainEntryCB->IsChecked());
     552           0 :     pTOXMgr->UpdateTOXMark(aDesc);
     553             : }
     554             : 
     555             : /*--------------------------------------------------------------------
     556             :     Description: insert new keys
     557             :  --------------------------------------------------------------------*/
     558           0 : void SwIndexMarkPane::UpdateKeyBoxes()
     559             : {
     560           0 :     String aKey(m_pKey1DCB->GetText());
     561           0 :     sal_uInt16 nPos = m_pKey1DCB->GetEntryPos(aKey);
     562             : 
     563           0 :     if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0)
     564             :     {   // create new key
     565           0 :         m_pKey1DCB->InsertEntry(aKey);
     566             :     }
     567             : 
     568           0 :     aKey = m_pKey2DCB->GetText();
     569           0 :     nPos = m_pKey2DCB->GetEntryPos(aKey);
     570             : 
     571           0 :     if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0)
     572             :     {   // create new key
     573           0 :         m_pKey2DCB->InsertEntry(aKey);
     574           0 :     }
     575           0 : }
     576             : 
     577           0 : class SwNewUserIdxDlg : public ModalDialog
     578             : {
     579             :     OKButton        aOKPB;
     580             :     CancelButton    aCancelPB;
     581             :     HelpButton      aHelpPB;
     582             :     FixedLine       aNameFL;
     583             :     FixedText       aNameFT;
     584             :     Edit            aNameED;
     585             : 
     586             :     SwIndexMarkPane* pDlg;
     587             : 
     588             :     DECL_LINK( ModifyHdl, Edit*);
     589             : 
     590             :     public:
     591           0 :         SwNewUserIdxDlg(SwIndexMarkPane* pPane) :
     592           0 :             ModalDialog(&(pPane->GetDialog()), SW_RES(DLG_NEW_USER_IDX)),
     593             :             aOKPB(this, SW_RES(     PB_OK       )),
     594             :             aCancelPB(this, SW_RES( PB_CANCEL   )),
     595             :             aHelpPB(this, SW_RES(   PB_HELP     )),
     596             :             aNameFL(this, SW_RES(    FL_NAME     )),
     597             :             aNameFT(this, SW_RES(   FT_NAME     )),
     598             :             aNameED(this, SW_RES(    ED_NAME     )),
     599           0 :             pDlg(pPane)
     600             :             {
     601           0 :                 FreeResource();
     602           0 :                 aNameED.SetModifyHdl(LINK(this, SwNewUserIdxDlg, ModifyHdl));
     603           0 :                 aOKPB.Enable(sal_False);
     604           0 :                 aNameED.GrabFocus();
     605           0 :             }
     606             : 
     607             :     virtual void    Apply();
     608           0 :     String  GetName(){return aNameED.GetText();}
     609             : };
     610           0 : void SwNewUserIdxDlg::Apply()
     611             : {
     612           0 : }
     613             : 
     614           0 : IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, Edit*, pEdit)
     615             : {
     616           0 :     aOKPB.Enable(pEdit->GetText().Len() && !pDlg->IsTOXType(pEdit->GetText()));
     617           0 :     return 0;
     618             : }
     619             : 
     620           0 : IMPL_LINK_NOARG(SwIndexMarkPane, NewUserIdxHdl)
     621             : {
     622           0 :     SwNewUserIdxDlg* pDlg = new SwNewUserIdxDlg(this);
     623           0 :     if(RET_OK == pDlg->Execute())
     624             :     {
     625           0 :         String sNewName(pDlg->GetName());
     626           0 :         m_pTypeDCB->InsertEntry(sNewName);
     627           0 :         m_pTypeDCB->SelectEntry(sNewName);
     628             :     }
     629           0 :     delete pDlg;
     630           0 :     return 0;
     631             : }
     632             : 
     633           0 : IMPL_LINK( SwIndexMarkPane, SearchTypeHdl, CheckBox*, pBox)
     634             : {
     635           0 :     sal_Bool bEnable = pBox->IsChecked() && pBox->IsEnabled();
     636           0 :     m_pSearchCaseWordOnlyCB->Enable(bEnable);
     637           0 :     m_pSearchCaseSensitiveCB->Enable(bEnable);
     638           0 :     return 0;
     639             : }
     640             : 
     641           0 : IMPL_LINK( SwIndexMarkPane, InsertHdl, Button *, pButton )
     642             : {
     643           0 :     Apply();
     644             :     //close the dialog if only one entry is available
     645           0 :     if(!bNewMark && !m_pPrevBT->IsVisible() && !m_pNextBT->IsVisible())
     646           0 :         CloseHdl(pButton);
     647           0 :     return 0;
     648             : }
     649             : 
     650           0 : IMPL_LINK_NOARG(SwIndexMarkPane, CloseHdl)
     651             : {
     652           0 :     if(bNewMark)
     653             :     {
     654           0 :         sal_uInt16 nSlot = FN_INSERT_IDX_ENTRY_DLG;
     655             :         SfxViewFrame::Current()->GetDispatcher()->Execute(nSlot,
     656           0 :                     SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD);
     657             :     }
     658             :     else
     659             :     {
     660           0 :         m_rDialog.EndDialog(RET_CANCEL);
     661             :     }
     662           0 :     return 0;
     663             : }
     664             : 
     665             : /*--------------------------------------------------------------------
     666             :      Description:   select index type only when inserting
     667             :  --------------------------------------------------------------------*/
     668           0 : IMPL_LINK( SwIndexMarkPane, ModifyHdl, ListBox *, pBox )
     669             : {
     670           0 :     if (m_pTypeDCB == pBox)
     671             :     {
     672             :         // set index type
     673           0 :         sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry());
     674           0 :         sal_Bool bLevelEnable = sal_False,
     675           0 :              bKeyEnable   = sal_False,
     676           0 :              bSetKey2     = sal_False,
     677           0 :              bKey2Enable  = sal_False,
     678           0 :             bEntryHasText   = sal_False,
     679           0 :             bKey1HasText    = sal_False,
     680           0 :             bKey2HasText    = sal_False;
     681           0 :         if(nPos == POS_INDEX)
     682             :         {
     683           0 :             if(m_pEntryED->GetText().Len())
     684           0 :                 bEntryHasText = sal_True;
     685           0 :             m_pPhoneticED0->SetText(GetDefaultPhoneticReading(m_pEntryED->GetText()));
     686             : 
     687           0 :             bKeyEnable = sal_True;
     688           0 :             m_pKey1DCB->SetText(m_pKey1DCB->GetEntry(nKey1Pos));
     689           0 :             m_pPhoneticED1->SetText(GetDefaultPhoneticReading(m_pKey1DCB->GetText()));
     690           0 :             if(m_pKey1DCB->GetText().Len() > 0)
     691             :             {
     692           0 :                 bKey1HasText = bSetKey2 = bKey2Enable = sal_True;
     693           0 :                 m_pKey2DCB->SetText(m_pKey2DCB->GetEntry(nKey2Pos));
     694           0 :                 m_pPhoneticED2->SetText(GetDefaultPhoneticReading(m_pKey2DCB->GetText()));
     695           0 :                 if(m_pKey2DCB->GetText().Len())
     696           0 :                     bKey2HasText = sal_True;
     697             :             }
     698             :         }
     699             :         else
     700             :         {
     701           0 :             bLevelEnable = sal_True;
     702           0 :             m_pLevelNF->SetMax(MAXLEVEL);
     703           0 :             m_pLevelNF->SetValue(m_pLevelNF->Normalize(0));
     704           0 :             bSetKey2 = sal_True;
     705             :         }
     706           0 :         m_pLevelFT->Show(bLevelEnable);
     707           0 :         m_pLevelNF->Show(bLevelEnable);
     708           0 :         m_pMainEntryCB->Show(nPos == POS_INDEX);
     709             : 
     710           0 :         m_pKey1FT->Enable(bKeyEnable);
     711           0 :         m_pKey1DCB->Enable(bKeyEnable);
     712           0 :         if ( bSetKey2 )
     713             :         {
     714           0 :             m_pKey2DCB->Enable(bKey2Enable);
     715           0 :             m_pKey2FT->Enable(bKey2Enable);
     716             :         }
     717           0 :         m_pPhoneticFT0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled);
     718           0 :         m_pPhoneticED0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled);
     719           0 :         m_pPhoneticFT1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled);
     720           0 :         m_pPhoneticED1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled);
     721           0 :         m_pPhoneticFT2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
     722           0 :         m_pPhoneticED2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
     723             :     }
     724             :     else //m_pEntryED  !!m_pEntryED is not a ListBox but a Edit
     725             :     {
     726           0 :         sal_Bool bHasText = (m_pEntryED->GetText().Len()>0);
     727           0 :         if(!bHasText)
     728             :         {
     729           0 :             m_pPhoneticED0->SetText(aEmptyStr);
     730           0 :             bPhoneticED0_ChangedByUser = sal_False;
     731             :         }
     732           0 :         else if(!bPhoneticED0_ChangedByUser)
     733           0 :             m_pPhoneticED0->SetText(GetDefaultPhoneticReading(m_pEntryED->GetText()));
     734             : 
     735           0 :         m_pPhoneticFT0->Enable(bHasText&&bIsPhoneticReadingEnabled);
     736           0 :         m_pPhoneticED0->Enable(bHasText&&bIsPhoneticReadingEnabled);
     737             :     }
     738           0 :     m_pOKBT->Enable(!pSh->HasReadonlySel() &&
     739           0 :         (m_pEntryED->GetText().Len() || pSh->GetCrsrCnt(sal_False)));
     740           0 :     return 0;
     741             : }
     742             : 
     743           0 : IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, NextHdl)
     744             : {
     745           0 :     InsertUpdate();
     746           0 :     pTOXMgr->NextTOXMark();
     747           0 :     UpdateDialog();
     748           0 :     return 0;
     749             : }
     750           0 : IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, NextHdl)
     751             : 
     752           0 : IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, NextSameHdl)
     753             : {
     754           0 :     InsertUpdate();
     755           0 :     pTOXMgr->NextTOXMark(sal_True);
     756           0 :     UpdateDialog();
     757           0 :     return 0;
     758             : }
     759           0 : IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, NextSameHdl)
     760             : 
     761           0 : IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, PrevHdl)
     762             : {
     763           0 :     InsertUpdate();
     764           0 :     pTOXMgr->PrevTOXMark();
     765           0 :     UpdateDialog();
     766           0 :     return 0;
     767             : }
     768           0 : IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, PrevHdl)
     769             : 
     770           0 : IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, PrevSameHdl)
     771             : {
     772           0 :     InsertUpdate();
     773           0 :     pTOXMgr->PrevTOXMark(sal_True);
     774           0 :     UpdateDialog();
     775             : 
     776           0 :     return 0;
     777             : }
     778           0 : IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, PrevSameHdl)
     779             : 
     780           0 : IMPL_LINK_NOARG(SwIndexMarkPane, DelHdl)
     781             : {
     782           0 :     bDel = sal_True;
     783           0 :     InsertUpdate();
     784           0 :     bDel = sal_False;
     785             : 
     786           0 :     if(pTOXMgr->GetCurTOXMark())
     787           0 :         UpdateDialog();
     788             :     else
     789             :     {
     790           0 :         CloseHdl(m_pCloseBT);
     791           0 :         SfxViewFrame::Current()->GetBindings().Invalidate(FN_EDIT_IDX_ENTRY_DLG);
     792             :     }
     793           0 :     return 0;
     794             : }
     795             : 
     796             : /*--------------------------------------------------------------------
     797             :      Description: renew dialog view
     798             :  --------------------------------------------------------------------*/
     799           0 : void SwIndexMarkPane::UpdateDialog()
     800             : {
     801             :     OSL_ENSURE(pSh && pTOXMgr, "no shell?");
     802           0 :     SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
     803             :     OSL_ENSURE(pMark, "no current marker");
     804           0 :     if(!pMark)
     805           0 :         return;
     806             : 
     807           0 :     ViewShell::SetCareWin(&m_rDialog);
     808             : 
     809           0 :     aOrgStr = pMark->GetText();
     810           0 :     m_pEntryED->SetText(aOrgStr);
     811             : 
     812             :     // set index type
     813           0 :     sal_Bool bLevelEnable = sal_True,
     814           0 :          bKeyEnable   = sal_False,
     815           0 :          bKey2Enable  = sal_False,
     816           0 :          bEntryHasText  = sal_False,
     817           0 :          bKey1HasText   = sal_False,
     818           0 :          bKey2HasText   = sal_False;
     819             : 
     820           0 :     TOXTypes eCurType = pMark->GetTOXType()->GetType();
     821           0 :     if(TOX_INDEX == eCurType)
     822             :     {
     823           0 :         bLevelEnable = sal_False;
     824           0 :         bKeyEnable = sal_True;
     825           0 :         bKey1HasText = bKey2Enable = 0 != pMark->GetPrimaryKey().Len();
     826           0 :         bKey2HasText = 0 != pMark->GetSecondaryKey().Len();
     827           0 :         bEntryHasText = 0 != pMark->GetText().Len();
     828           0 :         m_pKey1DCB->SetText( pMark->GetPrimaryKey() );
     829           0 :         m_pKey2DCB->SetText( pMark->GetSecondaryKey() );
     830           0 :         m_pPhoneticED0->SetText( pMark->GetTextReading() );
     831           0 :         m_pPhoneticED1->SetText( pMark->GetPrimaryKeyReading() );
     832           0 :         m_pPhoneticED2->SetText( pMark->GetSecondaryKeyReading() );
     833           0 :         m_pMainEntryCB->Check(pMark->IsMainEntry());
     834             :     }
     835           0 :     else if(TOX_CONTENT == eCurType || TOX_USER == eCurType)
     836             :     {
     837           0 :         m_pLevelNF->SetValue(m_pLevelNF->Normalize(pMark->GetLevel()));
     838             :     }
     839           0 :     m_pKey1FT->Enable(bKeyEnable);
     840           0 :     m_pKey1DCB->Enable(bKeyEnable);
     841           0 :     m_pLevelNF->SetMax(MAXLEVEL);
     842           0 :     m_pLevelFT->Show(bLevelEnable);
     843           0 :     m_pLevelNF->Show(bLevelEnable);
     844           0 :     m_pMainEntryCB->Show(!bLevelEnable);
     845           0 :     m_pKey2FT->Enable(bKey2Enable);
     846           0 :     m_pKey2DCB->Enable(bKey2Enable);
     847             : 
     848           0 :     UpdateLanguageDependenciesForPhoneticReading();
     849           0 :     m_pPhoneticFT0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled);
     850           0 :     m_pPhoneticED0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled);
     851           0 :     m_pPhoneticFT1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled);
     852           0 :     m_pPhoneticED1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled);
     853           0 :     m_pPhoneticFT2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
     854           0 :     m_pPhoneticED2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
     855             : 
     856             :     // set index type
     857           0 :     m_pTypeDCB->SelectEntry(pMark->GetTOXType()->GetTypeName());
     858             : 
     859             :     // set Next - Prev - Buttons
     860           0 :     pSh->SttCrsrMove();
     861           0 :     if( m_pPrevBT->IsVisible() )
     862             :     {
     863           0 :         const SwTOXMark* pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_PRV );
     864           0 :         if( pMoveMark != pMark )
     865           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_NXT );
     866           0 :         m_pPrevBT->Enable( pMoveMark != pMark );
     867           0 :         pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_NXT );
     868           0 :         if( pMoveMark != pMark )
     869           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_PRV );
     870           0 :         m_pNextBT->Enable( pMoveMark != pMark );
     871             :     }
     872             : 
     873           0 :     if( m_pPrevSameBT->IsVisible() )
     874             :     {
     875           0 :         const SwTOXMark* pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_PRV );
     876           0 :         if( pMoveMark != pMark )
     877           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT );
     878           0 :         m_pPrevSameBT->Enable( pMoveMark != pMark );
     879           0 :         pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_NXT );
     880           0 :         if( pMoveMark != pMark )
     881           0 :             pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV );
     882           0 :         m_pNextSameBT->Enable( pMoveMark != pMark );
     883             :     }
     884             : 
     885           0 :     sal_Bool bEnable = !pSh->HasReadonlySel();
     886           0 :     m_pOKBT->Enable( bEnable );
     887           0 :     m_pDelBT->Enable( bEnable );
     888           0 :     m_pEntryED->SetReadOnly( !bEnable );
     889           0 :     m_pLevelNF->SetReadOnly( !bEnable );
     890           0 :     m_pKey1DCB->SetReadOnly( !bEnable );
     891           0 :     m_pKey2DCB->SetReadOnly( !bEnable );
     892             : 
     893           0 :     pSh->SelectTxtAttr( RES_TXTATR_TOXMARK, pMark->GetTxtTOXMark() );
     894             :     // we need the point at the start of the attribut
     895           0 :     pSh->SwapPam();
     896             : 
     897           0 :     pSh->EndCrsrMove();
     898             : }
     899             : 
     900             : /*--------------------------------------------------------------------
     901             :      Remind whether the edit boxes for Phonetic reading are changed manually
     902             :  --------------------------------------------------------------------*/
     903           0 : IMPL_LINK( SwIndexMarkPane, PhoneticEDModifyHdl, Edit *, pEdit )
     904             : {
     905           0 :     if (m_pPhoneticED0 == pEdit)
     906             :     {
     907           0 :         bPhoneticED0_ChangedByUser = pEdit->GetText().Len()>0;
     908             :     }
     909           0 :     else if (m_pPhoneticED1 == pEdit)
     910             :     {
     911           0 :         bPhoneticED1_ChangedByUser = pEdit->GetText().Len()>0;
     912             :     }
     913           0 :     else if (m_pPhoneticED2 == pEdit)
     914             :     {
     915           0 :         bPhoneticED2_ChangedByUser = pEdit->GetText().Len()>0;
     916             :     }
     917           0 :     return 0;
     918             : }
     919             : 
     920             : /*--------------------------------------------------------------------
     921             :      Description: Enable Disable of the 2nd key
     922             :  --------------------------------------------------------------------*/
     923           0 : IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox )
     924             : {
     925           0 :     if (m_pKey1DCB == pBox)
     926             :     {
     927           0 :         sal_Bool bEnable = pBox->GetText().Len() > 0;
     928           0 :         if(!bEnable)
     929             :         {
     930           0 :             m_pKey2DCB->SetText(aEmptyStr);
     931           0 :             m_pPhoneticED1->SetText(aEmptyStr);
     932           0 :             m_pPhoneticED2->SetText(aEmptyStr);
     933           0 :             bPhoneticED1_ChangedByUser = sal_False;
     934           0 :             bPhoneticED2_ChangedByUser = sal_False;
     935             :         }
     936             :         else
     937             :         {
     938           0 :             if(pBox->IsInDropDown())
     939             :             {
     940             :                 //reset bPhoneticED1_ChangedByUser if a completly new string is selected
     941           0 :                 bPhoneticED1_ChangedByUser = sal_False;
     942             :             }
     943           0 :             if(!bPhoneticED1_ChangedByUser)
     944           0 :                 m_pPhoneticED1->SetText(GetDefaultPhoneticReading(pBox->GetText()));
     945             :         }
     946           0 :         m_pKey2DCB->Enable(bEnable);
     947           0 :         m_pKey2FT->Enable(bEnable);
     948             :     }
     949           0 :     else if (m_pKey2DCB == pBox)
     950             :     {
     951           0 :         if(!(pBox->GetText().Len()>0))
     952             :         {
     953           0 :             m_pPhoneticED2->SetText(aEmptyStr);
     954           0 :             bPhoneticED2_ChangedByUser = sal_False;
     955             :         }
     956             :         else
     957             :         {
     958           0 :             if(pBox->IsInDropDown())
     959             :             {
     960             :                 //reset bPhoneticED1_ChangedByUser if a completly new string is selected
     961           0 :                 bPhoneticED2_ChangedByUser = sal_False;
     962             :             }
     963           0 :             if(!bPhoneticED2_ChangedByUser)
     964           0 :                 m_pPhoneticED2->SetText(GetDefaultPhoneticReading(pBox->GetText()));
     965             :         }
     966             :     }
     967           0 :     sal_Bool    bKey1HasText    = (0 != m_pKey1DCB->GetText().Len());
     968           0 :     sal_Bool    bKey2HasText    = (0 != m_pKey2DCB->GetText().Len());
     969             : 
     970           0 :     m_pPhoneticFT1->Enable(bKey1HasText&&bIsPhoneticReadingEnabled);
     971           0 :     m_pPhoneticED1->Enable(bKey1HasText&bIsPhoneticReadingEnabled);
     972           0 :     m_pPhoneticFT2->Enable(bKey2HasText&bIsPhoneticReadingEnabled);
     973           0 :     m_pPhoneticED2->Enable(bKey2HasText&bIsPhoneticReadingEnabled);
     974             : 
     975           0 :     return 0;
     976             : }
     977             : 
     978             : /*--------------------------------------------------
     979             :  overload dtor
     980             : --------------------------------------------------*/
     981           0 : SwIndexMarkPane::~SwIndexMarkPane()
     982             : {
     983           0 :     delete pTOXMgr;
     984           0 :     ViewShell::SetCareWin( 0 );
     985           0 : }
     986             : 
     987           0 : void    SwIndexMarkPane::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark)
     988             : {
     989           0 :     pSh = &rWrtShell;
     990           0 :     delete pTOXMgr;
     991           0 :     pTOXMgr = new SwTOXMgr(pSh);
     992           0 :     if(pCurTOXMark)
     993             :     {
     994           0 :         for(sal_uInt16 i = 0; i < pTOXMgr->GetTOXMarkCount(); i++)
     995           0 :             if(pTOXMgr->GetTOXMark(i) == pCurTOXMark)
     996             :             {
     997           0 :                 pTOXMgr->SetCurTOXMark(i);
     998           0 :                 break;
     999             :             }
    1000             :     }
    1001           0 :     InitControls();
    1002           0 : }
    1003             : 
    1004           0 : SwIndexMarkFloatDlg::SwIndexMarkFloatDlg(SfxBindings* _pBindings,
    1005             :     SfxChildWindow* pChild, Window *pParent,
    1006             :     SfxChildWinInfo* pInfo, sal_Bool bNew)
    1007             :     : SfxModelessDialog(_pBindings, pChild, pParent, "IndexEntryDialog", "modules/swriter/ui/indexentry.ui")
    1008           0 :     , m_aContent(*this, bNew, *::GetActiveWrtShell())
    1009             : {
    1010           0 :     m_aContent.ReInitDlg(*::GetActiveWrtShell());
    1011           0 :     Initialize(pInfo);
    1012           0 : }
    1013             : 
    1014           0 : void SwIndexMarkFloatDlg::Activate()
    1015             : {
    1016           0 :     SfxModelessDialog::Activate();
    1017           0 :     m_aContent.Activate();
    1018           0 : }
    1019             : 
    1020           0 : void SwIndexMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell)
    1021             : {
    1022           0 :     m_aContent.ReInitDlg( rWrtShell );
    1023           0 : }
    1024             : 
    1025           0 : SwIndexMarkModalDlg::SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark)
    1026             :     : SvxStandardDialog(pParent, "IndexEntryDialog", "modules/swriter/ui/indexentry.ui")
    1027           0 :     , m_aContent(*this, sal_False, rSh)
    1028             : {
    1029           0 :     m_aContent.ReInitDlg(rSh, pCurTOXMark);
    1030           0 : }
    1031             : 
    1032           0 : void SwIndexMarkModalDlg::Apply()
    1033             : {
    1034           0 :     m_aContent.Apply();
    1035           0 : }
    1036             : 
    1037             : class SwCreateAuthEntryDlg_Impl : public ModalDialog
    1038             : {
    1039             :     FixedLine       aEntriesFL;
    1040             : 
    1041             :     FixedText*      pFixedTexts[AUTH_FIELD_END];
    1042             :     ListBox*        pTypeListBox;
    1043             :     ComboBox*       pIdentifierBox;
    1044             :     Edit*           pEdits[AUTH_FIELD_END];
    1045             : 
    1046             :     OKButton        aOKBT;
    1047             :     CancelButton    aCancelBT;
    1048             :     HelpButton      aHelpBT;
    1049             : 
    1050             :     Link            aShortNameCheckLink;
    1051             : 
    1052             :     SwWrtShell&     rWrtSh;
    1053             : 
    1054             :     sal_Bool            m_bNewEntryMode;
    1055             :     sal_Bool            m_bNameAllowed;
    1056             : 
    1057             :     DECL_LINK(IdentifierHdl, ComboBox*);
    1058             :     DECL_LINK(ShortNameHdl, Edit*);
    1059             :     DECL_LINK(EnableHdl, ListBox* pBox);
    1060             : 
    1061             : public:
    1062             :     SwCreateAuthEntryDlg_Impl(Window* pParent,
    1063             :                             const String pFields[],
    1064             :                             SwWrtShell& rSh,
    1065             :                             sal_Bool bNewEntry,
    1066             :                             sal_Bool bCreate);
    1067             :     ~SwCreateAuthEntryDlg_Impl();
    1068             : 
    1069             :     String          GetEntryText(ToxAuthorityField eField) const;
    1070             : 
    1071           0 :     void            SetCheckNameHdl(const Link& rLink) {aShortNameCheckLink = rLink;}
    1072             : 
    1073             : };
    1074             : 
    1075             : struct TextInfo
    1076             : {
    1077             :     ToxAuthorityField nToxField;
    1078             :     const char* pHelpId;
    1079             : };
    1080             : 
    1081             : static const TextInfo aTextInfoArr[] =
    1082             : {
    1083             :     {AUTH_FIELD_IDENTIFIER,      HID_AUTH_FIELD_IDENTIFIER      },
    1084             :     {AUTH_FIELD_AUTHORITY_TYPE,  HID_AUTH_FIELD_AUTHORITY_TYPE  },
    1085             :     {AUTH_FIELD_AUTHOR,          HID_AUTH_FIELD_AUTHOR          },
    1086             :     {AUTH_FIELD_TITLE,           HID_AUTH_FIELD_TITLE           },
    1087             :     {AUTH_FIELD_YEAR,            HID_AUTH_FIELD_YEAR            },
    1088             :     {AUTH_FIELD_PUBLISHER,       HID_AUTH_FIELD_PUBLISHER       },
    1089             :     {AUTH_FIELD_ADDRESS,         HID_AUTH_FIELD_ADDRESS         },
    1090             :     {AUTH_FIELD_ISBN,            HID_AUTH_FIELD_ISBN            },
    1091             :     {AUTH_FIELD_CHAPTER,         HID_AUTH_FIELD_CHAPTER         },
    1092             :     {AUTH_FIELD_PAGES,           HID_AUTH_FIELD_PAGES           },
    1093             :     {AUTH_FIELD_EDITOR,          HID_AUTH_FIELD_EDITOR          },
    1094             :     {AUTH_FIELD_EDITION,         HID_AUTH_FIELD_EDITION         },
    1095             :     {AUTH_FIELD_BOOKTITLE,       HID_AUTH_FIELD_BOOKTITLE       },
    1096             :     {AUTH_FIELD_VOLUME,          HID_AUTH_FIELD_VOLUME          },
    1097             :     {AUTH_FIELD_HOWPUBLISHED,    HID_AUTH_FIELD_HOWPUBLISHED    },
    1098             :     {AUTH_FIELD_ORGANIZATIONS,   HID_AUTH_FIELD_ORGANIZATIONS   },
    1099             :     {AUTH_FIELD_INSTITUTION,     HID_AUTH_FIELD_INSTITUTION     },
    1100             :     {AUTH_FIELD_SCHOOL,          HID_AUTH_FIELD_SCHOOL          },
    1101             :     {AUTH_FIELD_REPORT_TYPE,     HID_AUTH_FIELD_REPORT_TYPE     },
    1102             :     {AUTH_FIELD_MONTH,           HID_AUTH_FIELD_MONTH           },
    1103             :     {AUTH_FIELD_JOURNAL,         HID_AUTH_FIELD_JOURNAL         },
    1104             :     {AUTH_FIELD_NUMBER,          HID_AUTH_FIELD_NUMBER          },
    1105             :     {AUTH_FIELD_SERIES,          HID_AUTH_FIELD_SERIES          },
    1106             :     {AUTH_FIELD_ANNOTE,          HID_AUTH_FIELD_ANNOTE          },
    1107             :     {AUTH_FIELD_NOTE,            HID_AUTH_FIELD_NOTE            },
    1108             :     {AUTH_FIELD_URL,             HID_AUTH_FIELD_URL             },
    1109             :     {AUTH_FIELD_CUSTOM1,         HID_AUTH_FIELD_CUSTOM1         },
    1110             :     {AUTH_FIELD_CUSTOM2,         HID_AUTH_FIELD_CUSTOM2         },
    1111             :     {AUTH_FIELD_CUSTOM3,         HID_AUTH_FIELD_CUSTOM3         },
    1112             :     {AUTH_FIELD_CUSTOM4,         HID_AUTH_FIELD_CUSTOM4         },
    1113             :     {AUTH_FIELD_CUSTOM5,         HID_AUTH_FIELD_CUSTOM5         }
    1114             : };
    1115             : 
    1116             : sal_Bool SwAuthorMarkPane::bIsFromComponent = sal_True;
    1117             : 
    1118           0 : SwAuthorMarkPane::SwAuthorMarkPane(Dialog &rDialog, sal_Bool bNewDlg)
    1119             :     : m_rDialog(rDialog)
    1120             :     , bNewEntry(bNewDlg)
    1121             :     , bBibAccessInitialized(sal_False)
    1122           0 :     , pSh(0)
    1123             : {
    1124           0 :     m_rDialog.get(m_pFromComponentRB, "frombibliography");
    1125           0 :     m_rDialog.get(m_pFromDocContentRB, "fromdocument");
    1126           0 :     m_rDialog.get(m_pAuthorFI, "author");
    1127           0 :     m_rDialog.get(m_pTitleFI, "title");
    1128           0 :     m_rDialog.get(m_pEntryED, "entryed");
    1129           0 :     m_rDialog.get(m_pEntryLB, "entrylb");
    1130             :     m_rDialog.get(m_pActionBT,
    1131           0 :         bNewEntry ? OString("insert") : OString("modify"));
    1132           0 :     m_pActionBT->Show(true);
    1133           0 :     m_rDialog.get(m_pCloseBT, "close");
    1134           0 :     m_rDialog.get(m_pCreateEntryPB, "new");
    1135           0 :     m_rDialog.get(m_pEditEntryPB, "edit");
    1136             : 
    1137           0 :     m_pFromComponentRB->Show(bNewEntry);
    1138           0 :     m_pFromDocContentRB->Show(bNewEntry);
    1139           0 :     m_pFromComponentRB->Check(bIsFromComponent);
    1140           0 :     m_pFromDocContentRB->Check(!bIsFromComponent);
    1141             : 
    1142           0 :     m_pActionBT->SetClickHdl(LINK(this,SwAuthorMarkPane, InsertHdl));
    1143           0 :     m_pCloseBT->SetClickHdl(LINK(this,SwAuthorMarkPane, CloseHdl));
    1144           0 :     m_pCreateEntryPB->SetClickHdl(LINK(this,SwAuthorMarkPane, CreateEntryHdl));
    1145           0 :     m_pEditEntryPB->SetClickHdl(LINK(this,SwAuthorMarkPane, CreateEntryHdl));
    1146           0 :     m_pFromComponentRB->SetClickHdl(LINK(this,SwAuthorMarkPane, ChangeSourceHdl));
    1147           0 :     m_pFromDocContentRB->SetClickHdl(LINK(this,SwAuthorMarkPane, ChangeSourceHdl));
    1148           0 :     m_pEntryED->SetModifyHdl(LINK(this,SwAuthorMarkPane, EditModifyHdl));
    1149             : 
    1150             :     m_rDialog.SetText(SW_RESSTR(
    1151           0 :                     bNewEntry ? STR_AUTHMRK_INSERT : STR_AUTHMRK_EDIT));
    1152             : 
    1153           0 :     m_pEntryED->Show(!bNewEntry);
    1154           0 :     m_pEntryLB->Show(bNewEntry);
    1155           0 :     if(bNewEntry)
    1156             :     {
    1157           0 :         m_pEntryLB->SetSelectHdl(LINK(this, SwAuthorMarkPane, CompEntryHdl));
    1158             :     }
    1159           0 : }
    1160             : 
    1161           0 : void    SwAuthorMarkPane::ReInitDlg(SwWrtShell& rWrtShell)
    1162             : {
    1163           0 :     pSh = &rWrtShell;
    1164           0 :     InitControls();
    1165           0 : }
    1166             : 
    1167           0 : IMPL_LINK_NOARG(SwAuthorMarkPane, CloseHdl)
    1168             : {
    1169           0 :     if(bNewEntry)
    1170             :     {
    1171           0 :         sal_uInt16 nSlot = FN_INSERT_AUTH_ENTRY_DLG;
    1172             :         SfxViewFrame::Current()->GetDispatcher()->Execute(nSlot,
    1173           0 :                     SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD);
    1174             :     }
    1175             :     else
    1176             :     {
    1177           0 :         m_rDialog.EndDialog(RET_CANCEL);
    1178             :     }
    1179           0 :     return 0;
    1180             : }
    1181             : 
    1182           0 : static String lcl_FindColumnEntry(const beans::PropertyValue* pFields, sal_Int32 nLen, const String& rColumnTitle)
    1183             : {
    1184           0 :     String sRet;
    1185           0 :     OUString uColumnTitle = rColumnTitle;
    1186           0 :     for(sal_uInt16 i = 0; i < nLen; i++)
    1187             :     {
    1188           0 :         OUString uTmp;
    1189           0 :         if(pFields[i].Name == uColumnTitle &&
    1190           0 :             (pFields[i].Value >>= uTmp))
    1191             :         {
    1192           0 :             sRet = String(uTmp);
    1193             :             break;
    1194             :         }
    1195           0 :     }
    1196           0 :     return sRet;
    1197             : }
    1198             : 
    1199           0 : IMPL_LINK( SwAuthorMarkPane, CompEntryHdl, ListBox*, pBox)
    1200             : {
    1201           0 :     String sEntry(pBox->GetSelectEntry());
    1202           0 :     if(bIsFromComponent)
    1203             :     {
    1204           0 :         if(xBibAccess.is() && sEntry.Len())
    1205             :         {
    1206           0 :             OUString uEntry(sEntry);
    1207           0 :             if(xBibAccess->hasByName(uEntry))
    1208             :             {
    1209           0 :                 uno::Any aEntry(xBibAccess->getByName(uEntry));
    1210           0 :                 uno::Sequence<beans::PropertyValue> aFieldProps;
    1211           0 :                 if(aEntry >>= aFieldProps)
    1212             :                 {
    1213           0 :                     const beans::PropertyValue* pProps = aFieldProps.getConstArray();
    1214           0 :                     for(sal_uInt16 i = 0; i < AUTH_FIELD_END && i < aFieldProps.getLength(); i++)
    1215             :                     {
    1216           0 :                         m_sFields[i] = lcl_FindColumnEntry(
    1217           0 :                                 pProps, aFieldProps.getLength(), m_sColumnTitles[i]);
    1218             :                     }
    1219           0 :                 }
    1220           0 :             }
    1221             :         }
    1222             :     }
    1223             :     else
    1224             :     {
    1225           0 :         if(sEntry.Len())
    1226             :         {
    1227             :             const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
    1228           0 :                                         pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
    1229           0 :             const SwAuthEntry*  pEntry = pFType ? pFType->GetEntryByIdentifier(sEntry) : 0;
    1230           0 :             for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1231           0 :                 m_sFields[i] = pEntry ?
    1232           0 :                             pEntry->GetAuthorField((ToxAuthorityField)i) : aEmptyStr;
    1233             :         }
    1234             :     }
    1235           0 :     if(!pBox->GetSelectEntry().Len())
    1236             :     {
    1237           0 :         for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1238           0 :             m_sFields[i] = aEmptyStr;
    1239             :     }
    1240           0 :     m_pAuthorFI->SetText(m_sFields[AUTH_FIELD_AUTHOR]);
    1241           0 :     m_pTitleFI->SetText(m_sFields[AUTH_FIELD_TITLE]);
    1242           0 :     return 0;
    1243             : }
    1244             : 
    1245           0 : IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl)
    1246             : {
    1247             :     //insert or update the SwAuthorityField...
    1248           0 :     if(pSh)
    1249             :     {
    1250           0 :         sal_Bool bDifferent = sal_False;
    1251             :         OSL_ENSURE(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!");
    1252             :         OSL_ENSURE(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!");
    1253             :         //check if the entry already exists with different content
    1254             :         const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
    1255           0 :                                         pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
    1256             :         const SwAuthEntry*  pEntry = pFType ?
    1257           0 :                 pFType->GetEntryByIdentifier( m_sFields[AUTH_FIELD_IDENTIFIER])
    1258           0 :                 : 0;
    1259           0 :         if(pEntry)
    1260             :         {
    1261           0 :             for(sal_uInt16 i = 0; i < AUTH_FIELD_END && !bDifferent; i++)
    1262           0 :                 bDifferent |= m_sFields[i] != pEntry->GetAuthorField((ToxAuthorityField)i);
    1263           0 :             if(bDifferent)
    1264             :             {
    1265           0 :                 QueryBox aQuery(&m_rDialog, SW_RES(DLG_CHANGE_AUTH_ENTRY));
    1266           0 :                 if(RET_YES != aQuery.Execute())
    1267           0 :                     return 0;
    1268             :             }
    1269             :         }
    1270             : 
    1271           0 :         SwFldMgr aMgr(pSh);
    1272           0 :         String sFields;
    1273           0 :         for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1274             :         {
    1275           0 :             sFields += m_sFields[i];
    1276           0 :             sFields += TOX_STYLE_DELIMITER;
    1277             :         }
    1278           0 :         if(bNewEntry)
    1279             :         {
    1280           0 :             if(bDifferent)
    1281             :             {
    1282           0 :                 SwAuthEntry aNewData;
    1283           0 :                 for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1284           0 :                     aNewData.SetAuthorField((ToxAuthorityField)i, m_sFields[i]);
    1285           0 :                 pSh->ChangeAuthorityData(&aNewData);
    1286             :             }
    1287           0 :             SwInsertFld_Data aData(TYP_AUTHORITY, 0, sFields, aEmptyStr, 0 );
    1288           0 :             aMgr.InsertFld( aData );
    1289             :         }
    1290           0 :         else if(aMgr.GetCurFld())
    1291             :         {
    1292           0 :             aMgr.UpdateCurFld(0, sFields, aEmptyStr);
    1293           0 :         }
    1294             :     }
    1295           0 :     if(!bNewEntry)
    1296           0 :         CloseHdl(0);
    1297           0 :     return 0;
    1298             : }
    1299             : 
    1300           0 : IMPL_LINK(SwAuthorMarkPane, CreateEntryHdl, PushButton*, pButton)
    1301             : {
    1302           0 :     sal_Bool bCreate = pButton == m_pCreateEntryPB;
    1303           0 :     String sOldId = m_sCreatedEntry[0];
    1304           0 :     for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1305           0 :         m_sCreatedEntry[i] = bCreate ? aEmptyStr : m_sFields[i];
    1306             :     SwCreateAuthEntryDlg_Impl aDlg(pButton,
    1307             :                 bCreate ? m_sCreatedEntry : m_sFields,
    1308           0 :                 *pSh, bNewEntry, bCreate);
    1309           0 :     if(bNewEntry)
    1310             :     {
    1311           0 :         aDlg.SetCheckNameHdl(LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl));
    1312             :     }
    1313           0 :     if(RET_OK == aDlg.Execute())
    1314             :     {
    1315           0 :         if(bCreate && sOldId.Len())
    1316             :         {
    1317           0 :             m_pEntryLB->RemoveEntry(sOldId);
    1318             :         }
    1319           0 :         for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1320             :         {
    1321           0 :             m_sFields[i] = aDlg.GetEntryText((ToxAuthorityField)i);
    1322           0 :             m_sCreatedEntry[i] = m_sFields[i];
    1323             :         }
    1324           0 :         if(bNewEntry && !m_pFromDocContentRB->IsChecked())
    1325             :         {
    1326           0 :             m_pFromDocContentRB->Check(sal_True);
    1327           0 :             ChangeSourceHdl(m_pFromDocContentRB);
    1328             :         }
    1329           0 :         if(bCreate)
    1330             :         {
    1331             :             OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND ==
    1332             :                         m_pEntryLB->GetEntryPos(m_sFields[AUTH_FIELD_IDENTIFIER]),
    1333             :                         "entry exists!");
    1334           0 :             m_pEntryLB->InsertEntry(m_sFields[AUTH_FIELD_IDENTIFIER]);
    1335           0 :             m_pEntryLB->SelectEntry(m_sFields[AUTH_FIELD_IDENTIFIER]);
    1336             :         }
    1337           0 :         m_pEntryED->SetText(m_sFields[AUTH_FIELD_IDENTIFIER]);
    1338           0 :         m_pAuthorFI->SetText(m_sFields[AUTH_FIELD_AUTHOR]);
    1339           0 :         m_pTitleFI->SetText(m_sFields[AUTH_FIELD_TITLE]);
    1340           0 :         m_pActionBT->Enable();
    1341             :     }
    1342           0 :     return 0;
    1343             : }
    1344             : 
    1345           0 : IMPL_LINK(SwAuthorMarkPane, ChangeSourceHdl, RadioButton*, pButton)
    1346             : {
    1347           0 :     sal_Bool bFromComp = (pButton == m_pFromComponentRB);
    1348           0 :     bIsFromComponent = bFromComp;
    1349           0 :     m_pCreateEntryPB->Enable(!bIsFromComponent);
    1350           0 :     m_pEntryLB->Clear();
    1351           0 :     if(bIsFromComponent)
    1352             :     {
    1353           0 :         if(!bBibAccessInitialized)
    1354             :         {
    1355           0 :              uno::Reference< lang::XMultiServiceFactory > xMSF = getProcessServiceFactory();
    1356           0 :             xBibAccess = uno::Reference< container::XNameAccess > (xMSF->createInstance( "com.sun.star.frame.Bibliography"), uno::UNO_QUERY );
    1357           0 :             uno::Reference< beans::XPropertySet >  xPropSet(xBibAccess, uno::UNO_QUERY);
    1358           0 :             OUString uPropName("BibliographyDataFieldNames");
    1359           0 :             if(xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName(uPropName))
    1360             :             {
    1361           0 :                 uno::Any aNames = xPropSet->getPropertyValue(uPropName);
    1362           0 :                 uno::Sequence<beans::PropertyValue> aSeq;
    1363           0 :                 if( aNames >>= aSeq)
    1364             :                 {
    1365           0 :                     const beans::PropertyValue* pArr = aSeq.getConstArray();
    1366           0 :                     for(sal_uInt16 i = 0; i < aSeq.getLength(); i++)
    1367             :                     {
    1368           0 :                         String sTitle = pArr[i].Name;
    1369           0 :                         sal_Int16 nField = 0;
    1370           0 :                         pArr[i].Value >>= nField;
    1371           0 :                         if(nField >= 0 && nField < AUTH_FIELD_END)
    1372           0 :                             m_sColumnTitles[nField] = sTitle;
    1373           0 :                     }
    1374           0 :                 }
    1375             :             }
    1376           0 :             bBibAccessInitialized = sal_True;
    1377             :         }
    1378           0 :         if(xBibAccess.is())
    1379             :         {
    1380           0 :             uno::Sequence<OUString> aIdentifiers = xBibAccess->getElementNames();
    1381           0 :             const OUString* pNames = aIdentifiers.getConstArray();
    1382           0 :             for(sal_uInt16 i = 0; i < aIdentifiers.getLength(); i++)
    1383             :             {
    1384           0 :                 m_pEntryLB->InsertEntry(pNames[i]);
    1385           0 :             }
    1386             :         }
    1387             :     }
    1388             :     else
    1389             :     {
    1390             :         const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
    1391           0 :                                     pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
    1392           0 :         if(pFType)
    1393             :         {
    1394           0 :             std::vector<String> aIds;
    1395           0 :             pFType->GetAllEntryIdentifiers( aIds );
    1396           0 :             for(size_t n = 0; n < aIds.size(); ++n)
    1397           0 :                 m_pEntryLB->InsertEntry(aIds[n]);
    1398             :         }
    1399           0 :         if(m_sCreatedEntry[AUTH_FIELD_IDENTIFIER].Len())
    1400           0 :             m_pEntryLB->InsertEntry(m_sCreatedEntry[AUTH_FIELD_IDENTIFIER]);
    1401             :     }
    1402           0 :     m_pEntryLB->SelectEntryPos(0);
    1403           0 :     CompEntryHdl(m_pEntryLB);
    1404           0 :     return 0;
    1405             : }
    1406             : 
    1407           0 : IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit)
    1408             : {
    1409           0 :     Link aAllowed = LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl);
    1410           0 :     long nResult = aAllowed.Call(pEdit);
    1411           0 :     m_pActionBT->Enable(nResult > 0);
    1412           0 :     if(nResult)
    1413             :     {
    1414           0 :         String sEntry(pEdit->GetText());
    1415           0 :         m_sFields[AUTH_FIELD_IDENTIFIER] = sEntry;
    1416           0 :         m_sCreatedEntry[AUTH_FIELD_IDENTIFIER] = sEntry;
    1417             :     }
    1418           0 :     return 0;
    1419             : };
    1420             : 
    1421           0 : IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit)
    1422             : {
    1423           0 :     String sEntry = pEdit->GetText();
    1424           0 :     sal_Bool bAllowed = sal_False;
    1425           0 :     if(sEntry.Len())
    1426             :     {
    1427           0 :         if(m_pEntryLB->GetEntryPos(sEntry) != LISTBOX_ENTRY_NOTFOUND)
    1428           0 :             return 0;
    1429           0 :         else if(bIsFromComponent)
    1430             :         {
    1431             :             const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
    1432           0 :                                         pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
    1433           0 :             bAllowed = !pFType || !pFType->GetEntryByIdentifier(sEntry);
    1434             :         }
    1435             :         else
    1436             :         {
    1437           0 :             bAllowed = !xBibAccess.is() || !xBibAccess->hasByName(sEntry);
    1438             :         }
    1439             :     }
    1440           0 :     return bAllowed;
    1441             : }
    1442             : 
    1443           0 : void SwAuthorMarkPane::InitControls()
    1444             : {
    1445             :     OSL_ENSURE(pSh, "no shell?");
    1446           0 :     SwField* pField = pSh->GetCurFld();
    1447             :     OSL_ENSURE(bNewEntry || pField, "no current marker");
    1448           0 :     if(bNewEntry)
    1449             :     {
    1450           0 :         ChangeSourceHdl(m_pFromComponentRB->IsChecked() ? m_pFromComponentRB : m_pFromDocContentRB);
    1451           0 :         m_pCreateEntryPB->Enable(!m_pFromComponentRB->IsChecked());
    1452           0 :         if(!m_pFromComponentRB->IsChecked() && m_sCreatedEntry[0].Len())
    1453           0 :             for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1454           0 :                 m_sFields[i] = m_sCreatedEntry[i];
    1455             :     }
    1456           0 :     if(bNewEntry || !pField || pField->GetTyp()->Which() != RES_AUTHORITY)
    1457           0 :         return;
    1458             : 
    1459           0 :     const SwAuthEntry* pEntry = ((SwAuthorityFieldType*)pField->GetTyp())->
    1460           0 :             GetEntryByHandle(((SwAuthorityField*)pField)->GetHandle());
    1461             : 
    1462             :     OSL_ENSURE(pEntry, "No authority entry found");
    1463           0 :     if(!pEntry)
    1464           0 :         return;
    1465           0 :     for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1466           0 :         m_sFields[i] = pEntry->GetAuthorField((ToxAuthorityField)i);
    1467             : 
    1468           0 :     m_pEntryED->SetText(pEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER));
    1469           0 :     m_pAuthorFI->SetText(pEntry->GetAuthorField(AUTH_FIELD_AUTHOR));
    1470           0 :     m_pTitleFI->SetText(pEntry->GetAuthorField(AUTH_FIELD_TITLE));
    1471             : }
    1472             : 
    1473           0 : void SwAuthorMarkPane::Activate()
    1474             : {
    1475           0 :     m_pActionBT->Enable(!pSh->HasReadonlySel());
    1476           0 : }
    1477             : 
    1478           0 : SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent,
    1479             :         const String pFields[],
    1480             :         SwWrtShell& rSh,
    1481             :         sal_Bool bNewEntry,
    1482             :         sal_Bool bCreate) :
    1483             :     ModalDialog(pParent, SW_RES(DLG_CREATE_AUTH_ENTRY)),
    1484             :     aEntriesFL(this,    SW_RES(FL_ENTRIES    )),
    1485             :     pTypeListBox(0),
    1486             :     pIdentifierBox(0),
    1487             :     aOKBT(this,         SW_RES(PB_OK         )),
    1488             :     aCancelBT(this,     SW_RES(PB_CANCEL        )),
    1489             :     aHelpBT(this,       SW_RES(PB_HELP      )),
    1490             :     rWrtSh(rSh),
    1491             :     m_bNewEntryMode(bNewEntry),
    1492           0 :     m_bNameAllowed(sal_True)
    1493             : {
    1494           0 :     FreeResource();
    1495           0 :     Point aFLPos(aEntriesFL.GetPosPixel());
    1496           0 :     Point aTL1(aFLPos);
    1497           0 :     Size aFLSz(aEntriesFL.GetSizePixel().Width(), GetSizePixel().Height());
    1498           0 :     long nControlSpace = aFLSz.Width() / 4;
    1499           0 :     long nControlWidth = nControlSpace - 2 * aTL1.X();
    1500           0 :     aTL1.X() *= 2;
    1501           0 :     aTL1.Y() *= 5;
    1502           0 :     Point aTR1(aTL1);
    1503           0 :     aTR1.X() += nControlSpace;
    1504           0 :     Point aTL2(aTR1);
    1505           0 :     aTL2.X() += nControlSpace;
    1506           0 :     Point aTR2(aTL2);
    1507           0 :     aTR2.X() += nControlSpace;
    1508           0 :     Size aFixedTextSize(aFLSz);
    1509           0 :     Size aTmpSz(8,10);
    1510           0 :     aTmpSz = LogicToPixel(aTmpSz, MAP_APPFONT);
    1511           0 :     aFixedTextSize.Height() = aTmpSz.Width();
    1512           0 :     Size aEditSize(aFixedTextSize);
    1513           0 :     aFixedTextSize.Width() = nControlWidth + aFLPos.X();
    1514           0 :     aEditSize.Height() = aTmpSz.Height();
    1515           0 :     aEditSize.Width() = nControlWidth;
    1516             : 
    1517           0 :     sal_uInt16 nOffset = static_cast< sal_uInt16 >(aTmpSz.Width() * 3 / 2);
    1518           0 :     sal_Bool bLeft = sal_True;
    1519           0 :     Window* pRefWindow = 0;
    1520           0 :     for(sal_uInt16 nIndex = 0; nIndex < AUTH_FIELD_END; nIndex++)
    1521             :     {
    1522           0 :         const TextInfo aCurInfo = aTextInfoArr[nIndex];
    1523             : 
    1524           0 :         pFixedTexts[nIndex] = new FixedText(this);
    1525           0 :         if(nIndex)
    1526           0 :             pFixedTexts[nIndex]->SetZOrder( pRefWindow, WINDOW_ZORDER_BEHIND );
    1527             :         else
    1528           0 :             pFixedTexts[nIndex]->SetZOrder( 0, WINDOW_ZORDER_FIRST );
    1529             : 
    1530           0 :         pRefWindow = pFixedTexts[nIndex];
    1531             : 
    1532           0 :         pFixedTexts[nIndex]->SetSizePixel(aFixedTextSize);
    1533           0 :         pFixedTexts[nIndex]->SetPosPixel(bLeft ? aTL1 : aTL2);
    1534           0 :         pFixedTexts[nIndex]->SetText(SW_RES(STR_AUTH_FIELD_START + aCurInfo.nToxField));
    1535           0 :         pFixedTexts[nIndex]->Show();
    1536           0 :         pEdits[nIndex] = 0;
    1537           0 :         if( AUTH_FIELD_AUTHORITY_TYPE == aCurInfo.nToxField )
    1538             :         {
    1539           0 :             pTypeListBox = new ListBox(this, WB_DROPDOWN|WB_BORDER);
    1540           0 :             pTypeListBox->SetZOrder( pRefWindow, WINDOW_ZORDER_BEHIND );
    1541           0 :             pRefWindow = pTypeListBox;
    1542           0 :             for(sal_uInt16 j = 0; j < AUTH_TYPE_END; j++)
    1543           0 :                 pTypeListBox->InsertEntry(String(SW_RES(STR_AUTH_TYPE_START + j)));
    1544           0 :             if(pFields[aCurInfo.nToxField].Len())
    1545             :             {
    1546           0 :                 sal_uInt16 nIndexPos = static_cast< sal_uInt16 >(pFields[aCurInfo.nToxField].ToInt32());
    1547           0 :                 pTypeListBox->SelectEntryPos(nIndexPos);
    1548             :             }
    1549           0 :             Size aTmp(aEditSize);
    1550           0 :             aTmp.Height() *= 4;
    1551           0 :             pTypeListBox->SetSizePixel(aTmp);
    1552           0 :             pTypeListBox->SetPosPixel(bLeft ? aTR1 : aTR2);
    1553           0 :             pTypeListBox->Show();
    1554           0 :             pTypeListBox->SetSelectHdl(LINK(this, SwCreateAuthEntryDlg_Impl, EnableHdl));
    1555           0 :             pTypeListBox->SetHelpId(aCurInfo.pHelpId);
    1556             : 
    1557             :         }
    1558           0 :         else if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField && !m_bNewEntryMode)
    1559             :         {
    1560           0 :             pIdentifierBox = new ComboBox(this, WB_BORDER|WB_DROPDOWN);
    1561           0 :             pIdentifierBox->SetZOrder( pRefWindow, WINDOW_ZORDER_BEHIND );
    1562           0 :             pRefWindow = pIdentifierBox;
    1563             : 
    1564             :             pIdentifierBox->SetSelectHdl(LINK(this,
    1565           0 :                                     SwCreateAuthEntryDlg_Impl, IdentifierHdl));
    1566             : 
    1567             : 
    1568             :             const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
    1569           0 :                                         rSh.GetFldType(RES_AUTHORITY, aEmptyStr);
    1570           0 :             if(pFType)
    1571             :             {
    1572           0 :                 std::vector<String> aIds;
    1573           0 :                 pFType->GetAllEntryIdentifiers( aIds );
    1574           0 :                 for(size_t n = 0; n < aIds.size(); ++n)
    1575           0 :                     pIdentifierBox->InsertEntry(aIds[n]);
    1576             :             }
    1577           0 :             pIdentifierBox->SetText(pFields[aCurInfo.nToxField]);
    1578           0 :             Size aTmp(aEditSize);
    1579           0 :             aTmp.Height() *= 4;
    1580           0 :             pIdentifierBox->SetSizePixel(aTmp);
    1581           0 :             pIdentifierBox->SetPosPixel(bLeft ? aTR1 : aTR2);
    1582           0 :             pIdentifierBox->Show();
    1583           0 :             pIdentifierBox->SetHelpId(aCurInfo.pHelpId);
    1584             :         }
    1585             :         else
    1586             :         {
    1587           0 :             pEdits[nIndex] = new Edit(this, WB_BORDER);
    1588           0 :             pEdits[nIndex]->SetZOrder( pRefWindow, WINDOW_ZORDER_BEHIND );
    1589           0 :             pRefWindow = pEdits[nIndex];
    1590           0 :             pEdits[nIndex]->SetSizePixel(aEditSize);
    1591           0 :             pEdits[nIndex]->SetPosPixel(bLeft ? aTR1 : aTR2);
    1592           0 :             pEdits[nIndex]->SetText(pFields[aCurInfo.nToxField]);
    1593           0 :             pEdits[nIndex]->Show();
    1594           0 :             pEdits[nIndex]->SetHelpId(aCurInfo.pHelpId);
    1595           0 :             if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField)
    1596             :             {
    1597           0 :                 pEdits[nIndex]->SetModifyHdl(LINK(this, SwCreateAuthEntryDlg_Impl, ShortNameHdl));
    1598           0 :                 m_bNameAllowed = pFields[nIndex].Len() > 0;
    1599           0 :                 if(!bCreate)
    1600             :                 {
    1601           0 :                     pFixedTexts[nIndex]->Enable(sal_False);
    1602           0 :                     pEdits[nIndex]->Enable(sal_False);
    1603             :                 }
    1604             :             }
    1605             :         }
    1606           0 :         if(bLeft)
    1607             :         {
    1608           0 :             aTL1.Y() += nOffset;
    1609           0 :             aTR1.Y() += nOffset;
    1610             :         }
    1611             :         else
    1612             :         {
    1613           0 :             aTL2.Y() += nOffset;
    1614           0 :             aTR2.Y() += nOffset;
    1615             :         }
    1616           0 :         bLeft = !bLeft;
    1617             :     }
    1618           0 :     EnableHdl(pTypeListBox);
    1619             : 
    1620           0 :     long nHeightDiff = - aFLSz.Height();
    1621           0 :     aFLSz.Height() = aTL1.Y();
    1622           0 :     nHeightDiff += aFLSz.Height();
    1623           0 :     Size aDlgSize(GetSizePixel());
    1624           0 :     aDlgSize.Height() += nHeightDiff;
    1625           0 :     SetSizePixel(aDlgSize);
    1626             : 
    1627           0 : }
    1628             : 
    1629           0 : SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl()
    1630             : {
    1631           0 :     for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1632             :     {
    1633           0 :         delete pFixedTexts[i];
    1634           0 :         delete pEdits[i];
    1635             :     }
    1636           0 :     delete pTypeListBox;
    1637           0 :     delete pIdentifierBox;
    1638           0 : }
    1639             : 
    1640           0 : String  SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const
    1641             : {
    1642           0 :     String sRet;
    1643           0 :     if( AUTH_FIELD_AUTHORITY_TYPE == eField )
    1644             :     {
    1645             :         OSL_ENSURE(pTypeListBox, "No ListBox");
    1646           0 :         sRet = String::CreateFromInt32(pTypeListBox->GetSelectEntryPos());
    1647             :     }
    1648           0 :     else if( AUTH_FIELD_IDENTIFIER == eField && !m_bNewEntryMode)
    1649             :     {
    1650             :         OSL_ENSURE(pIdentifierBox, "No ComboBox");
    1651           0 :         sRet = pIdentifierBox->GetText();
    1652             :     }
    1653             :     else
    1654             :     {
    1655           0 :         for(sal_uInt16 nIndex = 0; nIndex < AUTH_FIELD_END; nIndex++)
    1656             :         {
    1657           0 :             const TextInfo aCurInfo = aTextInfoArr[nIndex];
    1658           0 :             if(aCurInfo.nToxField == eField)
    1659             :             {
    1660           0 :                 sRet = pEdits[nIndex]->GetText();
    1661             :                 break;
    1662             :             }
    1663             :         }
    1664             :     }
    1665           0 :     return sRet;
    1666             : }
    1667             : 
    1668           0 : IMPL_LINK(SwCreateAuthEntryDlg_Impl, IdentifierHdl, ComboBox*, pBox)
    1669             : {
    1670             :     const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
    1671           0 :                                 rWrtSh.GetFldType(RES_AUTHORITY, aEmptyStr);
    1672           0 :     if(pFType)
    1673             :     {
    1674             :         const SwAuthEntry* pEntry = pFType->GetEntryByIdentifier(
    1675           0 :                                                         pBox->GetText());
    1676           0 :         if(pEntry)
    1677             :         {
    1678           0 :             for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
    1679             :             {
    1680           0 :                 const TextInfo aCurInfo = aTextInfoArr[i];
    1681           0 :                 if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField)
    1682           0 :                     continue;
    1683           0 :                 if(AUTH_FIELD_AUTHORITY_TYPE == aCurInfo.nToxField)
    1684             :                     pTypeListBox->SelectEntry(
    1685           0 :                                 pEntry->GetAuthorField(aCurInfo.nToxField));
    1686             :                 else
    1687           0 :                     pEdits[i]->SetText(
    1688           0 :                                 pEntry->GetAuthorField(aCurInfo.nToxField));
    1689             :             }
    1690             :         }
    1691             :     }
    1692           0 :     return 0;
    1693             : }
    1694             : 
    1695           0 : IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit)
    1696             : {
    1697           0 :     if(aShortNameCheckLink.IsSet())
    1698             :     {
    1699           0 :         sal_Bool bEnable = 0 != aShortNameCheckLink.Call(pEdit);
    1700           0 :         m_bNameAllowed |= bEnable;
    1701           0 :         aOKBT.Enable(pTypeListBox->GetSelectEntryCount() && bEnable);
    1702             :     }
    1703           0 :     return 0;
    1704             : }
    1705             : 
    1706           0 : IMPL_LINK(SwCreateAuthEntryDlg_Impl, EnableHdl, ListBox*, pBox)
    1707             : {
    1708           0 :     aOKBT.Enable(m_bNameAllowed && pBox->GetSelectEntryCount());
    1709           0 :     return 0;
    1710             : };
    1711             : 
    1712           0 : SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings,
    1713             :                                    SfxChildWindow* pChild,
    1714             :                                    Window *pParent,
    1715             :                                 SfxChildWinInfo* pInfo,
    1716             :                                    sal_Bool bNew)
    1717             :     : SfxModelessDialog(_pBindings, pChild, pParent,
    1718             :         "BibliographyEntryDialog", "modules/swriter/ui/bibliographyentry.ui")
    1719           0 :     , m_aContent(*this, bNew)
    1720             : {
    1721           0 :     Initialize(pInfo);
    1722           0 :     SwWrtShell* pWrtShell = ::GetActiveWrtShell();
    1723             :     OSL_ENSURE(pWrtShell, "No shell?");
    1724           0 :     m_aContent.ReInitDlg(*pWrtShell);
    1725           0 : }
    1726             : 
    1727           0 : void SwAuthMarkFloatDlg::Activate()
    1728             : {
    1729           0 :     SfxModelessDialog::Activate();
    1730           0 :     m_aContent.Activate();
    1731           0 : }
    1732             : 
    1733           0 : void SwAuthMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell)
    1734             : {
    1735           0 :     m_aContent.ReInitDlg( rWrtShell );
    1736           0 : }
    1737             : 
    1738           0 : SwAuthMarkModalDlg::SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh)
    1739             :     : SvxStandardDialog(pParent, "BibliographyEntryDialog",
    1740             :         "modules/swriter/ui/bibliographyentry.ui")
    1741           0 :     , m_aContent(*this, sal_False)
    1742             : {
    1743           0 :     m_aContent.ReInitDlg(rSh);
    1744           0 : }
    1745             : 
    1746           0 : void SwAuthMarkModalDlg::Apply()
    1747             : {
    1748           0 :     m_aContent.InsertHdl(0);
    1749           0 : }
    1750             : 
    1751             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10