diff options
Diffstat (limited to 'sw/source/ui/shells/textfld.cxx')
-rw-r--r-- | sw/source/ui/shells/textfld.cxx | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 37b4529244..ead452771e 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -83,11 +83,11 @@ using namespace nsSwDocInfoSubType; -extern BOOL bNoInterrupt; // in mainwn.cxx +extern sal_Bool bNoInterrupt; // in mainwn.cxx -String& lcl_AppendRedlineStr( String& rStr, USHORT nRedlId ) +String& lcl_AppendRedlineStr( String& rStr, sal_uInt16 nRedlId ) { - USHORT nResId = 0; + sal_uInt16 nResId = 0; switch( nRedlId ) { case nsRedlineType_t::REDLINE_INSERT: nResId = STR_REDLINE_INSERTED; break; @@ -107,17 +107,17 @@ void SwTextShell::ExecField(SfxRequest &rReq) SwWrtShell& rSh = GetShell(); const SfxPoolItem* pItem = 0; - USHORT nSlot = rReq.GetSlot(); + sal_uInt16 nSlot = rReq.GetSlot(); const SfxItemSet* pArgs = rReq.GetArgs(); if(pArgs) - pArgs->GetItemState(GetPool().GetWhich(nSlot), FALSE, &pItem); + pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem); Window *pMDI = &GetView().GetViewFrame()->GetWindow(); - BOOL bMore = FALSE; - BOOL bIsText = TRUE; - USHORT nInsertType = 0; - USHORT nInsertSubType = 0; - ULONG nInsertFormat = 0; + sal_Bool bMore = sal_False; + sal_Bool bIsText = sal_True; + sal_uInt16 nInsertType = 0; + sal_uInt16 nInsertSubType = 0; + sal_uLong nInsertFormat = 0; switch(nSlot) { @@ -135,7 +135,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) if(rLink.IsVisible()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( pMDI, &rSh.GetLinkManager(), FALSE, &rLink ); + SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( pMDI, &rSh.GetLinkManager(), sal_False, &rLink ); if ( pDlg ) { pDlg->Execute(); @@ -165,7 +165,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) { const String& rMacro = ((SwMacroField*)pFld)->GetMacro(); - USHORT nPos = rMacro.Search('.', 0); + sal_uInt16 nPos = rMacro.Search('.', 0); if(nPos != STRING_NOTFOUND) { SvxMacro aMacro( rMacro.Copy(nPos + 1), rMacro.Copy(0,nPos), STARBASIC ); @@ -178,14 +178,14 @@ void SwTextShell::ExecField(SfxRequest &rReq) case FN_GOTO_NEXT_INPUTFLD: case FN_GOTO_PREV_INPUTFLD: { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SwFieldType* pFld = rSh.GetFldType( 0, RES_INPUTFLD ); if( pFld && rSh.MoveFldType( pFld, FN_GOTO_NEXT_INPUTFLD == nSlot )) { rSh.ClearMark(); - rSh.StartInputFldDlg( rSh.GetCurFld(), FALSE ); - bRet = TRUE; + rSh.StartInputFldDlg( rSh.GetCurFld(), sal_False ); + bRet = sal_True; } rReq.SetReturnValue( SfxBoolItem( nSlot, bRet )); @@ -193,7 +193,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) break; default: - bMore = TRUE; + bMore = sal_True; } if(bMore) { @@ -203,40 +203,40 @@ void SwTextShell::ExecField(SfxRequest &rReq) { case FN_INSERT_DBFIELD: { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if( pItem ) { - ULONG nFormat = 0; - USHORT nType = 0; + sal_uLong nFormat = 0; + sal_uInt16 nType = 0; String aPar1 = ((SfxStringItem *)pItem)->GetValue(); String aPar2; sal_Int32 nCommand = 0; if( SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_FIELD_TYPE, - FALSE, &pItem )) + sal_False, &pItem )) nType = ((SfxUInt16Item *)pItem)->GetValue(); aPar1 += DB_DELIM; if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_1, FALSE, &pItem )) + FN_PARAM_1, sal_False, &pItem )) { aPar1 += ((SfxStringItem *)pItem)->GetValue(); } if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_3, FALSE, &pItem )) + FN_PARAM_3, sal_False, &pItem )) nCommand = ((SfxInt32Item*)pItem)->GetValue(); aPar1 += DB_DELIM; aPar1 += String::CreateFromInt32(nCommand); aPar1 += DB_DELIM; if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_2, FALSE, &pItem )) + FN_PARAM_2, sal_False, &pItem )) { aPar1 += ((SfxStringItem *)pItem)->GetValue(); } if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_FIELD_CONTENT, FALSE, &pItem )) + FN_PARAM_FIELD_CONTENT, sal_False, &pItem )) aPar2 = ((SfxStringItem *)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_FIELD_FORMAT, FALSE, &pItem )) + FN_PARAM_FIELD_FORMAT, sal_False, &pItem )) nFormat = ((SfxUInt32Item *)pItem)->GetValue(); OSL_ENSURE(false, "Command is not yet used"); sal_Unicode cSeparator = ' '; @@ -249,30 +249,30 @@ void SwTextShell::ExecField(SfxRequest &rReq) case FN_INSERT_FIELD_CTRL: case FN_INSERT_FIELD: { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if( pItem && nSlot != FN_INSERT_FIELD_CTRL) { - ULONG nFormat = 0; - USHORT nType = 0; - USHORT nSubType = 0; + sal_uLong nFormat = 0; + sal_uInt16 nType = 0; + sal_uInt16 nSubType = 0; String aPar1 = ((SfxStringItem *)pItem)->GetValue(); String aPar2; sal_Unicode cSeparator = ' '; if( SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_FIELD_TYPE, - FALSE, &pItem )) + sal_False, &pItem )) nType = ((SfxUInt16Item *)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_FIELD_SUBTYPE, - FALSE, &pItem )) + sal_False, &pItem )) nSubType = ((SfxUInt16Item *)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_FIELD_CONTENT, FALSE, &pItem )) + FN_PARAM_FIELD_CONTENT, sal_False, &pItem )) aPar2 = ((SfxStringItem *)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_FIELD_FORMAT, FALSE, &pItem )) + FN_PARAM_FIELD_FORMAT, sal_False, &pItem )) nFormat = ((SfxUInt32Item *)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState( - FN_PARAM_3, FALSE, &pItem )) + FN_PARAM_3, sal_False, &pItem )) { String sTmp = ((SfxStringItem *)pItem)->GetValue(); if(sTmp.Len()) @@ -303,14 +303,14 @@ void SwTextShell::ExecField(SfxRequest &rReq) pVFrame->ToggleChildWindow(FN_INSERT_FIELD); // Dialog anzeigen // Flddlg auf neue TabPage umschalten - USHORT nId = SwFldDlgWrapper::GetChildWindowId(); + sal_uInt16 nId = SwFldDlgWrapper::GetChildWindowId(); SwFldDlgWrapper *pWrp = (SwFldDlgWrapper*)pVFrame->GetChildWindow(nId); if (pWrp) pWrp->ShowPage(); rReq.Ignore(); } break; - case FN_DELETE_NOTE: + case FN_DELETE_COMMENT: if ( GetView().GetPostItMgr() && GetView().GetPostItMgr()->HasActiveSidebarWin() ) { @@ -323,7 +323,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) break; case FN_DELETE_NOTE_AUTHOR: { - SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, FALSE); + SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, sal_False); if ( pNoteItem && GetView().GetPostItMgr() ) GetView().GetPostItMgr()->Delete( pNoteItem->GetValue() ); } @@ -341,7 +341,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) break; case FN_HIDE_NOTE_AUTHOR: { - SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, FALSE); + SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, sal_False); if ( pNoteItem && GetView().GetPostItMgr() ) GetView().GetPostItMgr()->Hide( pNoteItem->GetValue() ); } @@ -349,7 +349,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) case FN_POSTIT: { SwPostItField* pPostIt = (SwPostItField*)aFldMgr.GetCurFld(); - BOOL bNew = !(pPostIt && pPostIt->GetTyp()->Which() == RES_POSTITFLD); + sal_Bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == RES_POSTITFLD); if (bNew || GetView().GetPostItMgr()->IsAnswer()) { SvtUserOptions aUserOpt; @@ -366,9 +366,9 @@ void SwTextShell::ExecField(SfxRequest &rReq) SwInsertFld_Data aData(TYP_POSTITFLD, 0, sAuthor, aEmptyStr, 0); aFldMgr.InsertFld(aData); rSh.Push(); - rSh.SwCrsrShell::Left(1, CRSR_SKIP_CHARS, FALSE); + rSh.SwCrsrShell::Left(1, CRSR_SKIP_CHARS, sal_False); pPostIt = (SwPostItField*)aFldMgr.GetCurFld(); - rSh.Pop(FALSE); // Cursorpos restaurieren + rSh.Pop(sal_False); // Cursorpos restaurieren } if (pPostIt) @@ -413,7 +413,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) sComment = pRedline->GetComment(); - BOOL bTravel = FALSE; + sal_Bool bTravel = sal_False; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); @@ -440,8 +440,8 @@ void SwTextShell::ExecField(SfxRequest &rReq) pActRed = rSh.SelPrevRedline(); } - BOOL bPrev = pActRed != 0; - rSh.Pop(FALSE); + sal_Bool bPrev = pActRed != 0; + rSh.Pop(sal_False); rSh.EndAction(); rSh.ClearMark(); @@ -450,8 +450,8 @@ void SwTextShell::ExecField(SfxRequest &rReq) rSh.StartAction(); rSh.Push(); pActRed = rSh.SelNextRedline(); - BOOL bNext = pActRed != 0; - rSh.Pop(FALSE); // Cursorpos restaurieren + sal_Bool bNext = pActRed != 0; + rSh.Pop(sal_False); // Cursorpos restaurieren if( rSh.IsCrsrPtAtEnd() ) rSh.SwapPam(); @@ -462,7 +462,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact2, "Dialogdiet fail!"); - AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, bTravel, TRUE ); + AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, bTravel, sal_True ); OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->HideAuthor(); @@ -479,7 +479,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) } rSh.SetCareWin(pDlg->GetWindow()); - bNoInterrupt = TRUE; + bNoInterrupt = sal_True; if ( pDlg->Execute() == RET_OK ) { @@ -492,7 +492,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) delete pDlg; rSh.SetCareWin(NULL); - bNoInterrupt = FALSE; + bNoInterrupt = sal_False; rSh.ClearMark(); GetView().AttrChangedNotify(GetShellPtr()); } @@ -502,8 +502,8 @@ void SwTextShell::ExecField(SfxRequest &rReq) case FN_JAVAEDIT: { String aType, aText; - BOOL bIsUrl=FALSE; - BOOL bNew=FALSE, bUpdate=FALSE; + sal_Bool bIsUrl=sal_False; + sal_Bool bNew=sal_False, bUpdate=sal_False; SwFldMgr* pMgr = new SwFldMgr; if ( pItem ) { @@ -560,21 +560,21 @@ void SwTextShell::ExecField(SfxRequest &rReq) case FN_INSERT_FLD_DATE : nInsertType = TYP_DATEFLD; - bIsText = FALSE; + bIsText = sal_False; goto FIELD_INSERT; case FN_INSERT_FLD_TIME : nInsertType = TYP_TIMEFLD; - bIsText = FALSE; + bIsText = sal_False; goto FIELD_INSERT; case FN_INSERT_FLD_PGNUMBER: nInsertType = TYP_PAGENUMBERFLD; nInsertFormat = SVX_NUM_PAGEDESC; // wie Seitenvorlage - bIsText = FALSE; + bIsText = sal_False; goto FIELD_INSERT; case FN_INSERT_FLD_PGCOUNT : nInsertType = TYP_DOCSTATFLD; nInsertSubType = 0; - bIsText = FALSE; + bIsText = sal_False; nInsertFormat = SVX_NUM_PAGEDESC; goto FIELD_INSERT; case FN_INSERT_FLD_TOPIC : @@ -612,14 +612,14 @@ void SwTextShell::StateField( SfxItemSet &rSet ) SwWrtShell& rSh = GetShell(); SfxWhichIter aIter( rSet ); const SwField* pField = 0; - int bGetField = FALSE; - USHORT nWhich = aIter.FirstWhich(); + int bGetField = sal_False; + sal_uInt16 nWhich = aIter.FirstWhich(); while (nWhich) { switch (nWhich) { - case FN_DELETE_NOTE: + case FN_DELETE_COMMENT: case FN_DELETE_NOTE_AUTHOR: case FN_DELETE_ALL_NOTES: case FN_HIDE_NOTE: @@ -631,7 +631,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) rSet.InvalidateItem( nWhich ); else if ( !pPostItMgr->HasActiveSidebarWin() ) { - rSet.InvalidateItem( FN_DELETE_NOTE ); + rSet.InvalidateItem( FN_DELETE_COMMENT ); rSet.InvalidateItem( FN_HIDE_NOTE ); } } @@ -642,10 +642,10 @@ void SwTextShell::StateField( SfxItemSet &rSet ) if( !bGetField ) { pField = rSh.GetCurFld(); - bGetField = TRUE; + bGetField = sal_True; } - USHORT nTempWhich = pField ? pField->GetTyp()->Which() : USHRT_MAX; + sal_uInt16 nTempWhich = pField ? pField->GetTyp()->Which() : USHRT_MAX; if( USHRT_MAX == nTempWhich || RES_POSTITFLD == nTempWhich || RES_SCRIPTFLD == nTempWhich || @@ -664,7 +664,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) if(!bGetField) { pField = rSh.GetCurFld(); - bGetField = TRUE; + bGetField = sal_True; } if(!pField || pField->GetTyp()->Which() != RES_MACROFLD) rSet.DisableItem(nWhich); @@ -698,7 +698,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) break; case FN_POSTIT : case FN_JAVAEDIT : - BOOL bCurField = FALSE; + sal_Bool bCurField = sal_False; pField = rSh.GetCurFld(); if(nWhich == FN_POSTIT) bCurField = pField && pField->GetTyp()->Which() == RES_POSTITFLD; @@ -718,7 +718,7 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem) const String& rName = rHlnkItem.GetName(); const String& rURL = rHlnkItem.GetURL(); const String& rTarget = rHlnkItem.GetTargetFrame(); - USHORT nType = (USHORT)rHlnkItem.GetInsertMode(); + sal_uInt16 nType = (sal_uInt16)rHlnkItem.GetInsertMode(); nType &= ~HLINK_HTMLMODE; const SvxMacroTableDtor* pMacroTbl = rHlnkItem.GetMacroTbl(); @@ -731,10 +731,10 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem) rSh.GetCurAttr( aSet ); const SfxPoolItem* pItem; - if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, FALSE, &pItem)) + if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, sal_False, &pItem)) { // Links selektieren - rSh.SwCrsrShell::SelectTxtAttr(RES_TXTATR_INETFMT, FALSE); + rSh.SwCrsrShell::SelectTxtAttr(RES_TXTATR_INETFMT, sal_False); } switch (nType) { @@ -756,13 +756,13 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem) aINetFmt.SetMacro(SFX_EVENT_MOUSEOUT_OBJECT, *pMacro); } rSh.SttSelect(); - rSh.InsertURL( aINetFmt, rName, TRUE ); + rSh.InsertURL( aINetFmt, rName, sal_True ); rSh.EndSelect(); } break; case HLINK_BUTTON: - BOOL bSel = rSh.HasSelection(); + sal_Bool bSel = rSh.HasSelection(); if(bSel) rSh.DelRight(); InsertURLButton( rURL, rTarget, rName ); @@ -795,18 +795,18 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn ) const SwRedline *pActRed = pSh->SelNextRedline(); pSh->Pop(pActRed != 0); - BOOL bEnable = FALSE; + sal_Bool bEnable = sal_False; if (pActRed) { pSh->StartAction(); pSh->Push(); bEnable = pSh->SelNextRedline() != 0; - pSh->Pop(FALSE); + pSh->Pop(sal_False); pSh->EndAction(); } - pDlg->EnableTravel(bEnable, TRUE); + pDlg->EnableTravel(bEnable, sal_True); if( pSh->IsCrsrPtAtEnd() ) pSh->SwapPam(); @@ -847,18 +847,18 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn ) const SwRedline *pActRed = pSh->SelPrevRedline(); pSh->Pop(pActRed != 0); - BOOL bEnable = FALSE; + sal_Bool bEnable = sal_False; if (pActRed) { pSh->StartAction(); pSh->Push(); bEnable = pSh->SelPrevRedline() != 0; - pSh->Pop(FALSE); + pSh->Pop(sal_False); pSh->EndAction(); } - pDlg->EnableTravel(TRUE, bEnable); + pDlg->EnableTravel(sal_True, bEnable); pRedline = pSh->GetCurrRedline(); sComment = pRedline->GetComment(); |