diff options
Diffstat (limited to 'sw/source/ui/misc/docfnote.cxx')
-rw-r--r-- | sw/source/ui/misc/docfnote.cxx | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 909d1a4380eb..990152ab3def 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -69,7 +69,7 @@ SwFootNoteOptionDlg::SwFootNoteOptionDlg( Window *pParent, SwWrtShell &rS ) : AddTabPage( TP_ENDNOTEOPTION, SwEndNoteOptionPage::Create, 0 ); } -void SwFootNoteOptionDlg::PageCreated( USHORT /*nId*/, SfxTabPage &rPage ) +void SwFootNoteOptionDlg::PageCreated( sal_uInt16 /*nId*/, SfxTabPage &rPage ) { ((SwEndNoteOptionPage&)rPage).SetShell( rSh ); } @@ -95,9 +95,11 @@ IMPL_LINK( SwFootNoteOptionDlg, OkHdl, Button *, pBtn ) //---------------------------------------------------------------------- -SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, BOOL bEN, +SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN, const SfxItemSet &rSet ) : SfxTabPage( pParent, SW_RES(bEN ? TP_ENDNOTEOPTION : TP_FOOTNOTEOPTION), rSet ), + aNumFL (this, SW_RES( FL_NUM )), + aNumTypeFT (this, SW_RES( FT_NUMTYPE )), aNumViewBox (this, SW_RES( LB_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES), aOffsetLbl (this, SW_RES( FT_OFFSET )), @@ -111,31 +113,30 @@ SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, BOOL bEN, aPosFT (this, SW_RES( FT_POS )), aPosPageBox (this, SW_RES( RB_POS_PAGE )), aPosChapterBox (this, SW_RES( RB_POS_CHAPTER)), - aNumFL (this, SW_RES( FL_NUM )), + aTemplFL (this, SW_RES( FL_TEMPL )), aParaTemplLbl (this, SW_RES( FT_PARA_TEMPL)), aParaTemplBox (this, SW_RES( LB_PARA_TEMPL)), aPageTemplLbl (this, SW_RES( FT_PAGE_TEMPL)), aPageTemplBox (this, SW_RES( LB_PAGE_TEMPL)), - aTemplFL (this, SW_RES( FL_TEMPL )), + aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)), aFtnCharAnchorTemplLbl( this, SW_RES( FT_ANCHR_CHARFMT)), aFtnCharAnchorTemplBox( this, SW_RES( LB_ANCHR_CHARFMT)), aFtnCharTextTemplLbl( this, SW_RES( FT_TEXT_CHARFMT)), aFtnCharTextTemplBox( this, SW_RES( LB_TEXT_CHARFMT)), - aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)), + aContFL (this, SW_RES( FL_CONT )), aContLbl (this, SW_RES( FT_CONT )), aContEdit (this, SW_RES( ED_CONT )), aContFromLbl (this, SW_RES( FT_CONT_FROM )), aContFromEdit (this, SW_RES( ED_CONT_FROM )), - aContFL (this, SW_RES( FL_CONT )), aNumDoc(aNumCountBox.GetEntry(FTNNUM_DOC)), aNumPage(aNumCountBox.GetEntry(FTNNUM_PAGE)), aNumChapter(aNumCountBox.GetEntry(FTNNUM_CHAPTER)), pSh( 0 ), - bPosDoc(FALSE), + bPosDoc(sal_False), bEndNote( bEN ) { FreeResource(); @@ -144,6 +145,8 @@ SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, BOOL bEN, aPosChapterBox.SetClickHdl(LINK(this, SwEndNoteOptionPage, PosChapterHdl)); aNumCountBox.SetSelectHdl(LINK(this, SwEndNoteOptionPage, NumCountHdl)); + aPosPageBox.SetAccessibleRelationMemberOf(&aPosFT); + aPosChapterBox.SetAccessibleRelationMemberOf(&aPosFT); } void SwEndNoteOptionPage::Reset( const SfxItemSet& ) @@ -151,7 +154,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) SwEndNoteInfo *pInf = bEndNote ? new SwEndNoteInfo( pSh->GetEndNoteInfo() ) : new SwFtnInfo( pSh->GetFtnInfo() ); SfxObjectShell * pDocSh = SfxObjectShell::Current(); - USHORT i; + sal_uInt16 i; if(PTR_CAST(SwWebDocShell, pDocSh)) { @@ -176,7 +179,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) aContFromLbl.Hide(); aContFromEdit.Hide(); aContFL.Hide(); - bPosDoc = TRUE; + bPosDoc = sal_True; } else { @@ -185,15 +188,15 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) if ( rInf.ePos == FTNPOS_PAGE ) { aPosPageBox.Check(); - aPageTemplLbl.Enable(FALSE); - aPageTemplBox.Enable(FALSE); + aPageTemplLbl.Enable(sal_False); + aPageTemplBox.Enable(sal_False); } else { aPosChapterBox.Check(); aNumCountBox.RemoveEntry(aNumPage); aNumCountBox.RemoveEntry(aNumChapter); - bPosDoc = TRUE; + bPosDoc = sal_True; } // Verweistexte aContEdit.SetText(rInf.aQuoVadis); @@ -242,7 +245,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) else { OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong"); - const USHORT nPos = aParaTemplBox.GetEntryPos(pColl->GetName()); + const sal_uInt16 nPos = aParaTemplBox.GetEntryPos(pColl->GetName()); if( LISTBOX_ENTRY_NOTFOUND != nPos ) aParaTemplBox.SelectEntryPos( nPos ); else @@ -253,10 +256,10 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) } // Seite - for( i = RES_POOLPAGE_BEGIN; i <= RES_POOLPAGE_LANDSCAPE; ++i ) + for( i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i ) aPageTemplBox.InsertEntry(SwStyleNameMapper::GetUIName( i, aEmptyStr )); - USHORT nCount = pSh->GetPageDescCnt(); + sal_uInt16 nCount = pSh->GetPageDescCnt(); for(i = 0; i < nCount; ++i) { const SwPageDesc &rPageDesc = pSh->GetPageDesc(i); @@ -274,7 +277,7 @@ SwEndNoteOptionPage::~SwEndNoteOptionPage() SfxTabPage *SwEndNoteOptionPage::Create( Window *pParent, const SfxItemSet &rSet ) { - return new SwEndNoteOptionPage( pParent, TRUE, rSet ); + return new SwEndNoteOptionPage( pParent, sal_True, rSet ); } /*------------------------------------------------------------------------ @@ -310,7 +313,7 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) int SwEndNoteOptionPage::GetNumbering() const { - const USHORT nPos = aNumCountBox.GetSelectEntryPos(); + const sal_uInt16 nPos = aNumCountBox.GetSelectEntryPos(); return (int) bPosDoc? nPos + 1: nPos; } @@ -338,25 +341,25 @@ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell ) IMPL_LINK( SwEndNoteOptionPage, PosPageHdl, Button *, EMPTYARG ) { const SwFtnNum eNum = (const SwFtnNum)GetNumbering(); - bPosDoc = FALSE; + bPosDoc = sal_False; if(LISTBOX_ENTRY_NOTFOUND == aNumCountBox.GetEntryPos(aNumPage)) { aNumCountBox.InsertEntry(aNumPage, FTNNUM_PAGE); aNumCountBox.InsertEntry(aNumChapter, FTNNUM_CHAPTER); SelectNumbering(eNum); } - aPageTemplLbl.Enable(FALSE); - aPageTemplBox.Enable(FALSE); + aPageTemplLbl.Enable(sal_False); + aPageTemplBox.Enable(sal_False); return 0; } IMPL_LINK( SwEndNoteOptionPage, NumCountHdl, ListBox*, EMPTYARG ) { - BOOL bEnable = TRUE; + sal_Bool bEnable = sal_True; if( aNumCountBox.GetEntryCount() - 1 != aNumCountBox.GetSelectEntryPos() ) { - bEnable = FALSE; + bEnable = sal_False; aOffsetFld.SetValue(1); } aOffsetLbl.Enable(bEnable); @@ -377,7 +380,7 @@ IMPL_LINK_INLINE_START( SwEndNoteOptionPage, PosChapterHdl, Button *, EMPTYARG ) if ( !bPosDoc ) SelectNumbering(FTNNUM_DOC); - bPosDoc = TRUE; + bPosDoc = sal_True; aNumCountBox.RemoveEntry(aNumPage); aNumCountBox.RemoveEntry(aNumChapter); aPageTemplLbl.Enable(); @@ -389,8 +392,8 @@ IMPL_LINK_INLINE_END( SwEndNoteOptionPage, PosChapterHdl, Button *, EMPTYARG ) SwCharFmt* lcl_GetCharFormat( SwWrtShell* pSh, const String& rCharFmtName ) { SwCharFmt* pFmt = 0; - USHORT nChCount = pSh->GetCharFmtCount(); - for(USHORT i = 0; i< nChCount; i++) + sal_uInt16 nChCount = pSh->GetCharFmtCount(); + for(sal_uInt16 i = 0; i< nChCount; i++) { SwCharFmt& rChFmt = pSh->GetCharFmt(i); if(rChFmt.GetName() == rCharFmtName ) @@ -411,11 +414,11 @@ SwCharFmt* lcl_GetCharFormat( SwWrtShell* pSh, const String& rCharFmtName ) return pFmt; } -BOOL SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) +sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) { SwEndNoteInfo *pInf = bEndNote ? new SwEndNoteInfo() : new SwFtnInfo(); - pInf->nFtnOffset = static_cast< USHORT >(aOffsetFld.GetValue() -1); + pInf->nFtnOffset = static_cast< sal_uInt16 >(aOffsetFld.GetValue() -1); pInf->aFmt.SetNumberingType(aNumViewBox.GetSelectedNumberingType() ); pInf->SetPrefix(aPrefixED.GetText()); pInf->SetSuffix(aSuffixED.GetText()); @@ -426,7 +429,7 @@ BOOL SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) aFtnCharAnchorTemplBox.GetSelectEntry() ) ); // Absatzvorlage - USHORT nPos = aParaTemplBox.GetSelectEntryPos(); + sal_uInt16 nPos = aParaTemplBox.GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { const String aFmtName( aParaTemplBox.GetSelectEntry() ); @@ -437,7 +440,7 @@ BOOL SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) // Seitenvorlage pInf->ChgPageDesc( pSh->FindPageDescByName( - aPageTemplBox.GetSelectEntry(), TRUE ) ); + aPageTemplBox.GetSelectEntry(), sal_True ) ); if ( bEndNote ) { @@ -455,11 +458,11 @@ BOOL SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) pSh->SetFtnInfo( *pI ); } delete pInf; - return TRUE; + return sal_True; } SwFootNoteOptionPage::SwFootNoteOptionPage( Window *pParent, const SfxItemSet &rSet ) : - SwEndNoteOptionPage( pParent, FALSE, rSet ) + SwEndNoteOptionPage( pParent, sal_False, rSet ) { } |