diff options
Diffstat (limited to 'sw/source/ui/utlui/glbltree.cxx')
-rw-r--r-- | sw/source/ui/utlui/glbltree.cxx | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index 8319f8cf83fc..1855d9f23277 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -108,7 +108,7 @@ using ::rtl::OUString; #define GLBL_TABPOS_SUB 5 const SfxObjectShell* SwGlobalTree::pShowShell = 0; -static const USHORT aHelpForMenu[] = +static const char* aHelpForMenu[] = { 0, // HID_GLBLTREE_UPDATE, //CTX_UPDATE @@ -138,24 +138,24 @@ static const USHORT aHelpForMenu[] = class SwGlobalFrameListener_Impl : public SfxListener { - BOOL bValid; + sal_Bool bValid; public: SwGlobalFrameListener_Impl(SfxViewFrame& rFrame) : - bValid(TRUE) + bValid(sal_True) { StartListening(rFrame); } virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - BOOL IsValid() const {return bValid;} + sal_Bool IsValid() const {return bValid;} }; void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { if( rHint.ISA(SfxSimpleHint) && (((SfxSimpleHint&) rHint).GetId() == SFX_HINT_DYING)) - bValid = FALSE; + bValid = sal_False; } SwGlobalTree::SwGlobalTree(Window* pParent, const ResId& rResId) : @@ -170,9 +170,9 @@ SwGlobalTree::SwGlobalTree(Window* pParent, const ResId& rResId) : pDocContent ( NULL ), pDocInserter ( NULL ), - bIsInternalDrag ( FALSE ), - bLastEntryEmphasis ( FALSE ), - bIsImageListInitialized ( FALSE ) + bIsInternalDrag ( sal_False ), + bLastEntryEmphasis ( sal_False ), + bIsImageListInitialized ( sal_False ) { SetDragDropMode(SV_DRAGDROP_APP_COPY | @@ -182,7 +182,7 @@ SwGlobalTree::SwGlobalTree(Window* pParent, const ResId& rResId) : aUpdateTimer.SetTimeout(GLOBAL_UPDATE_TIMEOUT); aUpdateTimer.SetTimeoutHdl(LINK(this, SwGlobalTree, Timeout)); aUpdateTimer.Start(); - for(USHORT i = 0; i < GLOBAL_CONTEXT_COUNT; i++) + for(sal_uInt16 i = 0; i < GLOBAL_CONTEXT_COUNT; i++) { aContextStrings[i] = SW_RESSTR(i+ ST_GLOBAL_CONTEXT_FIRST); } @@ -204,19 +204,19 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) SvLBoxEntry* pLast = (SvLBoxEntry*)LastVisible(); if(pEmphasisEntry) { - ImplShowTargetEmphasis( Prev(pEmphasisEntry), FALSE ); + ImplShowTargetEmphasis( Prev(pEmphasisEntry), sal_False ); pEmphasisEntry = 0; } else if(bLastEntryEmphasis && pLast) { - ImplShowTargetEmphasis( pLast, FALSE); + ImplShowTargetEmphasis( pLast, sal_False); } SvLBoxEntry* pDropEntry = bLastEntryEmphasis ? 0 : GetEntry(rEvt.maPosPixel); if( bIsInternalDrag ) { SvLBoxEntry* pDummy = 0; - ULONG nInsertionPos = LIST_APPEND; + sal_uLong nInsertionPos = LIST_APPEND; NotifyMoving( pDropEntry, pDDSource, pDummy, nInsertionPos ); } else @@ -234,12 +234,12 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) int nAbsContPos = pDropEntry ? (int) GetModel()->GetAbsPos(pDropEntry): - 1; - USHORT nEntryCount = (USHORT)GetEntryCount(); + sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); // Daten holen FileList aFileList; aData.GetFileList( FORMAT_FILE_LIST, aFileList ); - for ( USHORT n = (USHORT)aFileList.Count(); n--; ) + for ( sal_uInt16 n = (sal_uInt16)aFileList.Count(); n--; ) { sFileName = aFileList.GetFile(n); InsertRegion(pCnt, &sFileName); @@ -255,7 +255,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { nEntryCount++; nAbsContPos++; - pCnt = pTempContents->GetObject( static_cast< USHORT >(nAbsContPos) ); + pCnt = pTempContents->GetObject( static_cast< sal_uInt16 >(nAbsContPos) ); } } } @@ -273,7 +273,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) } } } - bLastEntryEmphasis = FALSE; + bLastEntryEmphasis = sal_False; return nRet; } @@ -289,14 +289,14 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) { if( pEmphasisEntry ) { - ImplShowTargetEmphasis( Prev(pEmphasisEntry), FALSE ); + ImplShowTargetEmphasis( Prev(pEmphasisEntry), sal_False ); pEmphasisEntry = 0; } else if(bLastEntryEmphasis && pLast) { - ImplShowTargetEmphasis( pLast, FALSE); + ImplShowTargetEmphasis( pLast, sal_False); } - bLastEntryEmphasis = FALSE; + bLastEntryEmphasis = sal_False; } else { @@ -318,11 +318,11 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) nRet = DND_ACTION_LINK; if(pEmphasisEntry && pEmphasisEntry != pDropEntry) - ImplShowTargetEmphasis( Prev(pEmphasisEntry), FALSE ); + ImplShowTargetEmphasis( Prev(pEmphasisEntry), sal_False ); else if(pLast && bLastEntryEmphasis && pDropEntry) { - ImplShowTargetEmphasis( pLast, FALSE); - bLastEntryEmphasis = FALSE; + ImplShowTargetEmphasis( pLast, sal_False); + bLastEntryEmphasis = sal_False; } if(pDropEntry) @@ -330,7 +330,7 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) else if(pLast) { ImplShowTargetEmphasis( pLast, DND_ACTION_NONE != nRet ); - bLastEntryEmphasis = TRUE; + bLastEntryEmphasis = sal_True; } pEmphasisEntry = pDropEntry; } @@ -343,12 +343,12 @@ PopupMenu* SwGlobalTree::CreateContextMenu() if(pActiveShell && !pActiveShell->GetView().GetDocShell()->IsReadOnly()) { - USHORT nEnableFlags = GetEnableFlags(); + sal_uInt16 nEnableFlags = GetEnableFlags(); pPop = new PopupMenu; PopupMenu* pSubPop1 = new PopupMenu; PopupMenu* pSubPop2 = new PopupMenu; - for (USHORT i = CTX_UPDATE_SEL; i <= CTX_UPDATE_ALL; i++) + for (sal_uInt16 i = CTX_UPDATE_SEL; i <= CTX_UPDATE_ALL; i++) { pSubPop2->InsertItem( i, aContextStrings[ST_UPDATE_SEL - ST_GLOBAL_CONTEXT_FIRST - CTX_UPDATE_SEL+ i] ); pSubPop2->SetHelpId(i, aHelpForMenu[i]); @@ -398,13 +398,13 @@ PopupMenu* SwGlobalTree::CreateContextMenu() return pPop; } -void SwGlobalTree::TbxMenuHdl(USHORT nTbxId, ToolBox* pBox) +void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) { - USHORT nEnableFlags = GetEnableFlags(); + sal_uInt16 nEnableFlags = GetEnableFlags(); if(FN_GLOBAL_OPEN == nTbxId) { PopupMenu *pMenu = new PopupMenu; - for (USHORT i = CTX_INSERT_ANY_INDEX; i <= CTX_INSERT_TEXT; i++) + for (sal_uInt16 i = CTX_INSERT_ANY_INDEX; i <= CTX_INSERT_TEXT; i++) { pMenu->InsertItem( i, aContextStrings[ST_INDEX - ST_GLOBAL_CONTEXT_FIRST - CTX_INSERT_ANY_INDEX + i] ); pMenu->SetHelpId(i, aHelpForMenu[i] ); @@ -422,7 +422,7 @@ void SwGlobalTree::TbxMenuHdl(USHORT nTbxId, ToolBox* pBox) else if(FN_GLOBAL_UPDATE == nTbxId) { PopupMenu *pMenu = new PopupMenu; - for (USHORT i = CTX_UPDATE_SEL; i <= CTX_UPDATE_ALL; i++) + for (sal_uInt16 i = CTX_UPDATE_SEL; i <= CTX_UPDATE_ALL; i++) { pMenu->InsertItem( i, aContextStrings[ST_UPDATE_SEL - ST_GLOBAL_CONTEXT_FIRST - CTX_UPDATE_SEL+ i] ); pMenu->SetHelpId(i, aHelpForMenu[i] ); @@ -436,14 +436,14 @@ void SwGlobalTree::TbxMenuHdl(USHORT nTbxId, ToolBox* pBox) } } -USHORT SwGlobalTree::GetEnableFlags() const +sal_uInt16 SwGlobalTree::GetEnableFlags() const { SvLBoxEntry* pEntry = FirstSelected(); - USHORT nSelCount = (USHORT)GetSelectionCount(); - USHORT nEntryCount = (USHORT)GetEntryCount(); + sal_uInt16 nSelCount = (sal_uInt16)GetSelectionCount(); + sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); SvLBoxEntry* pPrevEntry = pEntry ? Prev(pEntry) : 0; - USHORT nRet = 0; + sal_uInt16 nRet = 0; if(nSelCount == 1 || !nEntryCount) nRet |= ENABLE_INSERT_IDX|ENABLE_INSERT_FILE; if(nSelCount == 1) @@ -468,9 +468,9 @@ USHORT SwGlobalTree::GetEnableFlags() const void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) { - BOOL bParent = TRUE; - Update(TRUE); - Display(TRUE); + sal_Bool bParent = sal_True; + Update(sal_True); + Display(sal_True); if( rHEvt.GetMode() & HELPMODE_QUICK ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); @@ -479,7 +479,7 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) (const SwGlblDocContent*)pEntry->GetUserData() : 0; if( pCont && GLBLDOC_SECTION == pCont->GetType()) { - bParent = FALSE; + bParent = sal_False; SvLBoxTab* pTab; SvLBoxItem* pItem = GetItem( pEntry, aPos.X(), &pTab ); if(pItem && SV_ITEM_ID_LBOXSTRING == pItem->IsA()) @@ -517,11 +517,11 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) void SwGlobalTree::SelectHdl() { - USHORT nSelCount = (USHORT)GetSelectionCount(); + sal_uInt16 nSelCount = (sal_uInt16)GetSelectionCount(); SvLBoxEntry* pSel = FirstSelected(); - USHORT nAbsPos = pSel ? (USHORT)GetModel()->GetAbsPos(pSel) : 0; + sal_uInt16 nAbsPos = pSel ? (sal_uInt16)GetModel()->GetAbsPos(pSel) : 0; SwNavigationPI* pNavi = GetParentWindow(); - BOOL bReadonly = !pActiveShell || + sal_Bool bReadonly = !pActiveShell || pActiveShell->GetView().GetDocShell()->IsReadOnly(); pNavi->aGlobalToolBox.EnableItem(FN_GLOBAL_EDIT, nSelCount == 1 && !bReadonly); pNavi->aGlobalToolBox.EnableItem(FN_GLOBAL_OPEN, nSelCount <= 1 && !bReadonly); @@ -529,7 +529,7 @@ void SwGlobalTree::SelectHdl() pNavi->aGlobalToolBox.EnableItem(FN_ITEM_UP, nSelCount == 1 && nAbsPos && !bReadonly); pNavi->aGlobalToolBox.EnableItem(FN_ITEM_DOWN, - nSelCount == 1 && nAbsPos < ((USHORT)GetEntryCount()) - 1 && !bReadonly); + nSelCount == 1 && nAbsPos < ((sal_uInt16)GetEntryCount()) - 1 && !bReadonly); } @@ -541,7 +541,7 @@ void SwGlobalTree::DeselectHdl() DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& , SvLBoxEntry* pEntry ) { - bIsInternalDrag = TRUE; + bIsInternalDrag = sal_True; pDDSource = pEntry; return SV_DRAGDROP_CTRL_MOVE; } @@ -551,33 +551,33 @@ long SwGlobalTree::GetTabPos( SvLBoxEntry*, SvLBoxTab* pTab) return pTab->GetPos() - GLBL_TABPOS_SUB; } -BOOL SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget, +sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pSource, SvLBoxEntry*&, - ULONG& + sal_uLong& ) { SvTreeList* _pModel = GetModel(); - USHORT nSource = (USHORT) _pModel->GetAbsPos(pSource); - USHORT nDest = pTarget ? (USHORT) _pModel->GetAbsPos(pTarget) : pSwGlblDocContents->Count(); + sal_uInt16 nSource = (sal_uInt16) _pModel->GetAbsPos(pSource); + sal_uInt16 nDest = pTarget ? (sal_uInt16) _pModel->GetAbsPos(pTarget) : pSwGlblDocContents->Count(); if( pActiveShell->MoveGlobalDocContent( *pSwGlblDocContents, nSource, nSource + 1, nDest ) && - Update( FALSE )) + Update( sal_False )) Display(); - return FALSE; + return sal_False; } -BOOL SwGlobalTree::NotifyCopying( SvLBoxEntry* /*pTarget*/, +sal_Bool SwGlobalTree::NotifyCopying( SvLBoxEntry* /*pTarget*/, SvLBoxEntry* /*pEntry*/, SvLBoxEntry*& /*rpNewParent*/, - ULONG& /*rNewChildPos*/ + sal_uLong& /*rNewChildPos*/ ) { - return FALSE; + return sal_False; } -BOOL SwGlobalTree::NotifyAcceptDrop( SvLBoxEntry* pEntry) +sal_Bool SwGlobalTree::NotifyAcceptDrop( SvLBoxEntry* pEntry) { return pEntry != 0; } @@ -591,7 +591,7 @@ void SwGlobalTree::StartDrag( sal_Int8 nAction, const Point& rPt ) void SwGlobalTree::DragFinished( sal_Int8 nAction ) { SvTreeListBox::DragFinished( nAction ); - bIsInternalDrag = FALSE; + bIsInternalDrag = sal_False; } /*************************************************************************** @@ -601,7 +601,7 @@ void SwGlobalTree::DragFinished( sal_Int8 nAction ) void SwGlobalTree::MouseButtonDown( const MouseEvent& rMEvt ) { Point aPos( rMEvt.GetPosPixel()); - SvLBoxEntry* pEntry = GetEntry( aPos, TRUE ); + SvLBoxEntry* pEntry = GetEntry( aPos, sal_True ); if( !pEntry && rMEvt.IsLeft() && rMEvt.IsMod1() && (rMEvt.GetClicks() % 2) == 0) Control::MouseButtonDown( rMEvt ); else @@ -610,7 +610,7 @@ void SwGlobalTree::MouseButtonDown( const MouseEvent& rMEvt ) void SwGlobalTree::GetFocus() { - if(Update( FALSE )) + if(Update( sal_False )) Display(); SvTreeListBox::GetFocus(); } @@ -638,18 +638,18 @@ void SwGlobalTree::Clear() SvTreeListBox::Clear(); } -void SwGlobalTree::Display(BOOL bOnlyUpdateUserData) +void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData) { if(!bIsImageListInitialized) { aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP)); - bIsImageListInitialized = TRUE; + bIsImageListInitialized = sal_True; } - USHORT nCount = pSwGlblDocContents->Count(); + sal_uInt16 nCount = pSwGlblDocContents->Count(); if(bOnlyUpdateUserData && GetEntryCount() == pSwGlblDocContents->Count()) { SvLBoxEntry* pEntry = First(); - for( USHORT i = 0; i < nCount; i++) + for( sal_uInt16 i = 0; i < nCount; i++) { SwGlblDocContentPtr pCont = pSwGlblDocContents->GetObject(i); pEntry->SetUserData(pCont); @@ -658,21 +658,21 @@ void SwGlobalTree::Display(BOOL bOnlyUpdateUserData) } else { - SetUpdateMode( FALSE ); + SetUpdateMode( sal_False ); SvLBoxEntry* pOldSelEntry = FirstSelected(); String sEntryName; // Name des Eintrags - USHORT nSelPos = USHRT_MAX; + sal_uInt16 nSelPos = USHRT_MAX; if(pOldSelEntry) { sEntryName = GetEntryText(pOldSelEntry); - nSelPos = (USHORT)GetModel()->GetAbsPos(pOldSelEntry); + nSelPos = (sal_uInt16)GetModel()->GetAbsPos(pOldSelEntry); } Clear(); if(!pSwGlblDocContents) - Update( FALSE ); + Update( sal_False ); SvLBoxEntry* pSelEntry = 0; - for( USHORT i = 0; i < nCount; i++) + for( sal_uInt16 i = 0; i < nCount; i++) { SwGlblDocContentPtr pCont = pSwGlblDocContents->GetObject(i); String sEntry; @@ -701,7 +701,7 @@ void SwGlobalTree::Display(BOOL bOnlyUpdateUserData) break; } SvLBoxEntry* pEntry = InsertEntry(sEntry, aImage, aImage, - 0, FALSE, LIST_APPEND, pCont); + 0, sal_False, LIST_APPEND, pCont); if(sEntry == sEntryName) { pSelEntry = pEntry; @@ -719,7 +719,7 @@ void SwGlobalTree::Display(BOOL bOnlyUpdateUserData) Select(First()); else SelectHdl(); - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } } @@ -747,7 +747,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const String* pF void SwGlobalTree::EditContent(const SwGlblDocContent* pCont ) { - USHORT nSlot = 0; + sal_uInt16 nSlot = 0; switch( pCont->GetType() ) { case GLBLDOC_UNKNOWN: @@ -774,7 +774,7 @@ void SwGlobalTree::EditContent(const SwGlblDocContent* pCont ) if(nSlot) { pActiveShell->GetView().GetViewFrame()->GetDispatcher()->Execute(nSlot); - if(Update( FALSE )) + if(Update( sal_False )) Display(); } } @@ -782,10 +782,10 @@ void SwGlobalTree::EditContent(const SwGlblDocContent* pCont ) IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu) { ExcecuteContextMenuAction( pMenu->GetCurItemId()); - return TRUE; + return sal_True; } -void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) +void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { SvLBoxEntry* pEntry = FirstSelected(); SwGlblDocContent* pCont = pEntry ? (SwGlblDocContent*)pEntry->GetUserData() : 0; @@ -796,7 +796,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) if(pCont) pContCopy = new SwGlblDocContent(pCont->GetDocPos()); SfxDispatcher& rDispatch = *pActiveShell->GetView().GetViewFrame()->GetDispatcher(); - USHORT nSlot = 0; + sal_uInt16 nSlot = 0; bool bDeleteContentCopy = true; switch( nSelectedPopupEntry ) { @@ -835,7 +835,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) case CTX_UPDATE_LINK: case CTX_UPDATE_ALL: { - pActiveShell->GetLinkManager().UpdateAllLinks(TRUE); + pActiveShell->GetLinkManager().UpdateAllLinks(sal_True); if(CTX_UPDATE_ALL == nSelectedPopupEntry) nSlot = FN_UPDATE_TOX; pCont = 0; @@ -867,7 +867,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) { pActiveShell->DeleteGlobalDocContent( pTempContents ? *pTempContents : *pSwGlblDocContents, - (USHORT)GetModel()->GetAbsPos(pSelEntry)); + (sal_uInt16)GetModel()->GetAbsPos(pSelEntry)); pSelEntry = PrevSelected(pSelEntry); if(pSelEntry) { @@ -900,7 +900,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) *pActiveShell, 0, USHRT_MAX, - TRUE); + sal_True); OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { @@ -929,7 +929,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) SfxViewFrame* pGlobFrm = pActiveShell->GetView().GetViewFrame(); SwGlobalFrameListener_Impl aFrmListener(*pGlobFrm); - ULONG nEntryPos = pEntry ? GetModel()->GetAbsPos(pEntry) : (ULONG)-1; + sal_uLong nEntryPos = pEntry ? GetModel()->GetAbsPos(pEntry) : (sal_uLong)-1; // neues Dok anlegen SfxStringItem aFactory(SID_NEWDOCDIRECT, SwDocShell::Factory().GetFilterContainer()->GetName()); @@ -956,9 +956,9 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) { pGlobFrm->ToTop(); // durch das Update sind die Eintraege invalid - if(nEntryPos != (ULONG)-1) + if(nEntryPos != (sal_uLong)-1) { - Update( FALSE ); + Update( sal_False ); Display(); Select(GetModel()->GetEntryAtAbsPos(nEntryPos)); pEntry = FirstSelected(); @@ -993,7 +993,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) else { pActiveShell->SplitNode(); // leeres Dokument - pActiveShell->Up( FALSE, 1 ); + pActiveShell->Up( sal_False, 1 ); } pActiveShell->GetView().GetEditWin().GrabFocus(); } @@ -1008,7 +1008,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) GotoContent(pCont); if(nSlot) rDispatch.Execute(nSlot); - if(Update( FALSE )) + if(Update( sal_False )) Display(); if ( bDeleteContentCopy ) delete pContCopy; @@ -1018,7 +1018,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) IMPL_LINK( SwGlobalTree, Timeout, Timer*, EMPTYARG ) { - if(!HasFocus() && Update( FALSE )) + if(!HasFocus() && Update( sal_False )) Display(); return 0; } @@ -1057,7 +1057,7 @@ void SwGlobalTree::HideTree() SvTreeListBox::Hide(); } -void SwGlobalTree::ExecCommand(USHORT nCmd) +void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) { SvLBoxEntry* pEntry = FirstSelected(); OSL_ENSURE(pEntry, "gleich knallt's"); @@ -1071,14 +1071,14 @@ void SwGlobalTree::ExecCommand(USHORT nCmd) { if(GetSelectionCount() == 1) { - BOOL bMove = FALSE; - USHORT nSource = (USHORT)GetModel()->GetAbsPos(pEntry); - USHORT nDest = nSource; + sal_Bool bMove = sal_False; + sal_uInt16 nSource = (sal_uInt16)GetModel()->GetAbsPos(pEntry); + sal_uInt16 nDest = nSource; switch(nCmd) { case FN_ITEM_DOWN: { - USHORT nEntryCount = (USHORT)GetEntryCount(); + sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); bMove = nEntryCount > nSource + 1; nDest+= 2; } @@ -1093,16 +1093,16 @@ void SwGlobalTree::ExecCommand(USHORT nCmd) } if( bMove && pActiveShell->MoveGlobalDocContent( *pSwGlblDocContents, nSource, nSource + 1, nDest ) && - Update( FALSE )) + Update( sal_False )) Display(); } } } -BOOL SwGlobalTree::Update(BOOL bHard) +sal_Bool SwGlobalTree::Update(sal_Bool bHard) { SwView* pActView = GetParentWindow()->GetCreateView(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if(pActView && pActView->GetWrtShellPtr()) { const SwWrtShell* pOldShell = pActiveShell; @@ -1115,23 +1115,23 @@ BOOL SwGlobalTree::Update(BOOL bHard) if(!pSwGlblDocContents) { pSwGlblDocContents = new SwGlblDocContents; - bRet = TRUE; + bRet = sal_True; pActiveShell->GetGlobalDocContent(*pSwGlblDocContents); } else { - BOOL bCopy = FALSE; + sal_Bool bCopy = sal_False; SwGlblDocContents* pTempContents = new SwGlblDocContents; pActiveShell->GetGlobalDocContent(*pTempContents); if(pTempContents->Count() != pSwGlblDocContents->Count() || pTempContents->Count() != GetEntryCount()) { - bRet = TRUE; - bCopy = TRUE; + bRet = sal_True; + bCopy = sal_True; } else { - for(USHORT i = 0; i < pTempContents->Count() && !bCopy; i++) + for(sal_uInt16 i = 0; i < pTempContents->Count() && !bCopy; i++) { SwGlblDocContent* pLeft = pTempContents->GetObject(i); SwGlblDocContent* pRight = pSwGlblDocContents->GetObject(i); @@ -1150,13 +1150,13 @@ BOOL SwGlobalTree::Update(BOOL bHard) ) ) { - bCopy = bRet = TRUE; + bCopy = bRet = sal_True; } } } if(bCopy || bHard) { - USHORT i; + sal_uInt16 i; pSwGlblDocContents->DeleteAndDestroy(0, pSwGlblDocContents->Count()); for( i = 0; i < pTempContents->Count(); i++) @@ -1185,14 +1185,14 @@ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont) { String sFileName(pCont->GetSection()->GetLinkFileName().GetToken(0, sfx2::cTokenSeperator)); - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; const SfxObjectShell* pCurr = SfxObjectShell::GetFirst(); while( !bFound && pCurr ) { if(pCurr->GetMedium() && String(pCurr->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI)) == sFileName) { - bFound = TRUE; + bFound = sal_True; SwGlobalTree::SetShowShell(pCurr); Application::PostUserEvent( STATIC_LINK( this, SwGlobalTree, ShowFrameHdl ) ); @@ -1205,7 +1205,7 @@ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont) { SfxStringItem aURL(SID_FILE_NAME, sFileName); - SfxBoolItem aReadOnly(SID_DOC_READONLY, FALSE); + SfxBoolItem aReadOnly(SID_DOC_READONLY, sal_False); SfxStringItem aTargetFrameName( SID_TARGETNAME, String::CreateFromAscii("_blank") ); SfxStringItem aReferer(SID_REFERER, pActiveShell->GetView().GetDocShell()->GetTitle()); pActiveShell->GetView().GetViewFrame()->GetDispatcher()-> @@ -1240,14 +1240,14 @@ void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry, const XubString& rStr ,const Image& rImg1,const Image& rImg2, SvLBoxButtonKind eButtonKind) { - USHORT nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" + sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); SwLBoxString* pStr = new SwLBoxString( pEntry, 0, pCol->GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } -void SwLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, +void SwLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ) { SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData(); @@ -1282,24 +1282,24 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen sal_Int32 nFiles = _rFiles.getLength(); if ( nFiles ) { - BOOL bMove = FALSE; + sal_Bool bMove = sal_False; if ( !_pContent ) { SvLBoxEntry* pLast = (SvLBoxEntry*)LastVisible(); _pContent = (SwGlblDocContent*)pLast->GetUserData(); - bMove = TRUE; + bMove = sal_True; } String sFilePassword; - USHORT nEntryCount = (USHORT)GetEntryCount(); + sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); const OUString* pFileNames = _rFiles.getConstArray(); SwWrtShell& rSh = GetParentWindow()->GetCreateView()->GetWrtShell(); rSh.StartAction(); // after insertion of the first new content the 'pCont' parameter becomes invalid // find the index of the 'anchor' content to always use a current anchor content - USHORT nAnchorContent = pSwGlblDocContents->Count() - 1; + sal_uInt16 nAnchorContent = pSwGlblDocContents->Count() - 1; if ( !bMove ) { - for( USHORT nContent = 0; nContent < pSwGlblDocContents->Count(); ++nContent ) + for( sal_uInt16 nContent = 0; nContent < pSwGlblDocContents->Count(); ++nContent ) { if( *_pContent == *pSwGlblDocContents->GetObject( nContent ) ) { @@ -1316,7 +1316,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen SwGlblDocContent* pAnchorContent = 0; OSL_ENSURE(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed"); if ( aTempContents.Count() > (nAnchorContent + nFile) ) - pAnchorContent = aTempContents.GetObject(nAnchorContent + (USHORT)nFile); + pAnchorContent = aTempContents.GetObject(nAnchorContent + (sal_uInt16)nFile); else pAnchorContent = aTempContents.GetObject(aTempContents.Count() - 1); String sFileName(pFileNames[nFile]); @@ -1325,10 +1325,10 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen String sSectionName(String(aFileUrl.GetLastName( INetURLObject::DECODE_UNAMBIGUOUS)).GetToken(0, sfx2::cTokenSeperator)); - USHORT nSectCount = rSh.GetSectionFmtCount(); + sal_uInt16 nSectCount = rSh.GetSectionFmtCount(); String sTempSectionName(sSectionName); - USHORT nAddNumber = 0; - USHORT nCount = 0; + sal_uInt16 nAddNumber = 0; + sal_uInt16 nCount = 0; // evtl : und Index anhaengen, wenn der Bereichsname schon vergeben ist while ( nCount < nSectCount ) { @@ -1361,12 +1361,12 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen } if ( bMove ) { - Update( FALSE ); + Update( sal_False ); rSh.MoveGlobalDocContent( - *pSwGlblDocContents, nEntryCount, nEntryCount + (USHORT)nFiles, nEntryCount - (USHORT)nFiles ); + *pSwGlblDocContents, nEntryCount, nEntryCount + (sal_uInt16)nFiles, nEntryCount - (sal_uInt16)nFiles ); } rSh.EndAction(); - Update( FALSE ); + Update( sal_False ); Display(); } } |