diff options
Diffstat (limited to 'sd/source/ui/view/outlview.cxx')
-rw-r--r-- | sd/source/ui/view/outlview.cxx | 262 |
1 files changed, 133 insertions, 129 deletions
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 9d9e8c5f190b..683476117eb5 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -98,7 +98,7 @@ namespace sd { struct SdParaAndPos { Paragraph* pPara; - USHORT nPos; + sal_uInt16 nPos; }; TYPEINIT1( OutlineView, ::sd::View ); @@ -112,29 +112,29 @@ TYPEINIT1( OutlineView, ::sd::View ); OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewShell* pOutlineViewSh) : ::sd::View(pDocSh->GetDoc(), pWindow, pOutlineViewSh) , mpOutlineViewShell(pOutlineViewSh) -, mpOutliner( mpDoc->GetOutliner(TRUE) ) +, mpOutliner( mpDoc->GetOutliner(sal_True) ) , mnPagesToProcess(0) , mnPagesProcessed(0) -, mbFirstPaint(TRUE) +, mbFirstPaint(sal_True) , mpProgress(NULL) , maDocColor( COL_WHITE ) , mnPageNumberWidthPixel( 0 ) , maLRSpaceItem( 0, 0, 2000, 0, EE_PARA_OUTLLRSPACE ) { - BOOL bInitOutliner = FALSE; + sal_Bool bInitOutliner = sal_False; if (mpOutliner->GetViewCount() == 0) { // initialize Outliner: set Reference Device - bInitOutliner = TRUE; + bInitOutliner = sal_True; mpOutliner->Init( OUTLINERMODE_OUTLINEVIEW ); mpOutliner->SetRefDevice( SD_MOD()->GetRefDevice( *pDocSh ) ); - ULONG nWidth = OUTLINE_PAPERWIDTH; + sal_uLong nWidth = OUTLINE_PAPERWIDTH; mpOutliner->SetPaperSize(Size(nWidth, 400000000)); } // insert View into Outliner - for (USHORT nView = 0; nView < MAX_OUTLINERVIEWS; nView++) + for (sal_uInt16 nView = 0; nView < MAX_OUTLINERVIEWS; nView++) { mpOutlinerView[nView] = NULL; } @@ -142,7 +142,7 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh mpOutlinerView[0] = new OutlinerView(mpOutliner, pWindow); Rectangle aNullRect; mpOutlinerView[0]->SetOutputArea(aNullRect); - mpOutliner->SetUpdateMode(FALSE); + mpOutliner->SetUpdateMode(sal_False); mpOutliner->InsertView(mpOutlinerView[0], LIST_APPEND); onUpdateStyleSettings( true ); @@ -171,8 +171,8 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh maBulletFont.SetUnderline(UNDERLINE_NONE); maBulletFont.SetStrikeout(STRIKEOUT_NONE); maBulletFont.SetItalic(ITALIC_NONE); - maBulletFont.SetOutline(FALSE); - maBulletFont.SetShadow(FALSE); + maBulletFont.SetOutline(sal_False); + maBulletFont.SetShadow(sal_False); Reference<XFrame> xFrame (mpOutlineViewShell->GetViewShellBase().GetFrame()->GetTopFrame().GetFrameInterface(), UNO_QUERY); @@ -205,7 +205,7 @@ OutlineView::~OutlineView() delete mpProgress; // unregister OutlinerViews and destroy them - for (USHORT nView = 0; nView < MAX_OUTLINERVIEWS; nView++) + for (sal_uInt16 nView = 0; nView < MAX_OUTLINERVIEWS; nView++) { if (mpOutlinerView[nView] != NULL) { @@ -219,8 +219,8 @@ OutlineView::~OutlineView() { // uninitialize Outliner: enable color display ResetLinks(); - ULONG nCntrl = mpOutliner->GetControlWord(); - mpOutliner->SetUpdateMode(FALSE); // otherwise there will be drawn on SetControlWord + sal_uLong nCntrl = mpOutliner->GetControlWord(); + mpOutliner->SetUpdateMode(sal_False); // otherwise there will be drawn on SetControlWord mpOutliner->SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS); SvtAccessibilityOptions aOptions; mpOutliner->ForceAutoColor( aOptions.GetIsAutomaticFontColor() ); @@ -265,7 +265,7 @@ void OutlineView::Paint(const Rectangle& rRect, ::sd::Window* pWin) pOlView->ShowCursor(mbFirstPaint); - mbFirstPaint = FALSE; + mbFirstPaint = sal_False; } } @@ -291,11 +291,11 @@ void OutlineView::AdjustPosSizePixel(const Point &,const Size &,::sd::Window*) void OutlineView::AddWindowToPaintView(OutputDevice* pWin) { - BOOL bAdded = FALSE; - BOOL bValidArea = FALSE; + sal_Bool bAdded = sal_False; + sal_Bool bValidArea = sal_False; Rectangle aOutputArea; const Color aWhiteColor( COL_WHITE ); - USHORT nView = 0; + sal_uInt16 nView = 0; while (nView < MAX_OUTLINERVIEWS && !bAdded) { @@ -304,7 +304,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin) mpOutlinerView[nView] = new OutlinerView(mpOutliner, dynamic_cast< ::sd::Window* >(pWin)); mpOutlinerView[nView]->SetBackgroundColor( aWhiteColor ); mpOutliner->InsertView(mpOutlinerView[nView], LIST_APPEND); - bAdded = TRUE; + bAdded = sal_True; if (bValidArea) { @@ -314,7 +314,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin) else if (!bValidArea) { aOutputArea = mpOutlinerView[nView]->GetOutputArea(); - bValidArea = TRUE; + bValidArea = sal_True; } nView++; @@ -334,8 +334,8 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin) void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin) { - BOOL bRemoved = FALSE; - USHORT nView = 0; + sal_Bool bRemoved = sal_False; + sal_uInt16 nView = 0; ::Window* pWindow; while (nView < MAX_OUTLINERVIEWS && !bRemoved) @@ -349,7 +349,7 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin) mpOutliner->RemoveView( mpOutlinerView[nView] ); delete mpOutlinerView[nView]; mpOutlinerView[nView] = NULL; - bRemoved = TRUE; + bRemoved = sal_True; } } @@ -368,7 +368,7 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin) OutlinerView* OutlineView::GetViewByWindow (::Window* pWin) const { OutlinerView* pOlView = NULL; - for (USHORT nView = 0; nView < MAX_OUTLINERVIEWS; nView++) + for (sal_uInt16 nView = 0; nView < MAX_OUTLINERVIEWS; nView++) { if (mpOutlinerView[nView] != NULL) { @@ -446,7 +446,7 @@ IMPL_LINK( OutlineView, ParagraphInsertedHdl, ::Outliner *, pOutliner ) Paragraph* pPara = pOutliner->GetHdlParagraph(); - USHORT nAbsPos = (USHORT)mpOutliner->GetAbsPos( pPara ); + sal_uInt16 nAbsPos = (sal_uInt16)mpOutliner->GetAbsPos( pPara ); UpdateParagraph( nAbsPos ); @@ -469,8 +469,8 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) mpOutliner->SetParaFlag( pPara, PARAFLAG_ISPAGE ); // how many titles are there before the new title paragraph? - ULONG nExample = 0L; // position of the "example" page - ULONG nTarget = 0L; // position of insertion + sal_uLong nExample = 0L; // position of the "example" page + sal_uLong nTarget = 0L; // position of insertion while(pPara) { pPara = GetPrevTitle(pPara); @@ -496,7 +496,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) { nExample = nTarget - 1; - USHORT nPageCount = mpDoc->GetSdPageCount( PK_STANDARD ); + sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD ); if( nExample >= nPageCount ) nExample = nPageCount - 1; } @@ -508,13 +508,13 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) **********************************************************************/ // this page is exemplary - SdPage* pExample = (SdPage*)mpDoc->GetSdPage((USHORT)nExample, PK_STANDARD); - SdPage* pPage = (SdPage*)mpDoc->AllocPage(FALSE); + SdPage* pExample = (SdPage*)mpDoc->GetSdPage((sal_uInt16)nExample, PK_STANDARD); + SdPage* pPage = (SdPage*)mpDoc->AllocPage(sal_False); pPage->SetLayoutName(pExample->GetLayoutName()); // insert (page) - mpDoc->InsertPage(pPage, (USHORT)(nTarget) * 2 + 1); + mpDoc->InsertPage(pPage, (sal_uInt16)(nTarget) * 2 + 1); if( isRecordingUndo() ) AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewPage(*pPage)); @@ -535,25 +535,25 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) if (eAutoLayout == AUTOLAYOUT_TITLE || eAutoLayout == AUTOLAYOUT_ONLY_TITLE) { - pPage->SetAutoLayout(AUTOLAYOUT_ENUM, TRUE); + pPage->SetAutoLayout(AUTOLAYOUT_ENUM, sal_True); } else { - pPage->SetAutoLayout(pExample->GetAutoLayout(), TRUE); + pPage->SetAutoLayout(pExample->GetAutoLayout(), sal_True); } /********************************************************************** |* now the notes page \*********************************************************************/ - pExample = (SdPage*)mpDoc->GetSdPage((USHORT)nExample, PK_NOTES); - SdPage* pNotesPage = (SdPage*)mpDoc->AllocPage(FALSE); + pExample = (SdPage*)mpDoc->GetSdPage((sal_uInt16)nExample, PK_NOTES); + SdPage* pNotesPage = (SdPage*)mpDoc->AllocPage(sal_False); pNotesPage->SetLayoutName(pExample->GetLayoutName()); pNotesPage->SetPageKind(PK_NOTES); // insert (notes page) - mpDoc->InsertPage(pNotesPage, (USHORT)(nTarget) * 2 + 2); + mpDoc->InsertPage(pNotesPage, (sal_uInt16)(nTarget) * 2 + 2); if( isRecordingUndo() ) AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewPage(*pNotesPage)); @@ -568,7 +568,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) pExample->GetLwrBorder() ); // create presentation objects - pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), TRUE); + pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), sal_True); mpOutliner->UpdateFields(); @@ -591,7 +591,7 @@ IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner ) if( pOutliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) { // how many titles are in front of the title paragraph in question? - ULONG nPos = 0L; + sal_uLong nPos = 0L; while(pPara) { pPara = GetPrevTitle(pPara); @@ -599,13 +599,13 @@ IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner ) } // delete page and notes page - USHORT nAbsPos = (USHORT)nPos * 2 + 1; + sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1; SdrPage* pPage = mpDoc->GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); mpDoc->RemovePage(nAbsPos); - nAbsPos = (USHORT)nPos * 2 + 1; + nAbsPos = (sal_uInt16)nPos * 2 + 1; pPage = mpDoc->GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); @@ -674,7 +674,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) pParagraph = *iter; if( !pOutliner->HasParaFlag( pParagraph, PARAFLAG_ISPAGE ) && - (pOutliner->GetDepth( (USHORT) pOutliner->GetAbsPos( pParagraph ) ) <= 0) ) + (pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( pParagraph ) ) <= 0) ) mnPagesToProcess++; } @@ -692,7 +692,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) } else { - mpDocSh->SetWaitCursor( TRUE ); + mpDocSh->SetWaitCursor( sal_True ); } } @@ -716,7 +716,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) mpProgress = NULL; } else - mpDocSh->SetWaitCursor( FALSE ); + mpDocSh->SetWaitCursor( sal_False ); mnPagesToProcess = 0; mnPagesProcessed = 0; @@ -728,7 +728,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) // the paragraph was a page but now becomes a normal paragraph // how many titles are before the title paragraph in question? - ULONG nPos = 0L; + sal_uLong nPos = 0L; Paragraph* pParagraph = pPara; while(pParagraph) { @@ -738,13 +738,13 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) } // delete page and notes page - USHORT nAbsPos = (USHORT)nPos * 2 + 1; + sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1; SdrPage* pPage = mpDoc->GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); mpDoc->RemovePage(nAbsPos); - nAbsPos = (USHORT)nPos * 2 + 1; + nAbsPos = (sal_uInt16)nPos * 2 + 1; pPage = mpDoc->GetPage(nAbsPos); if( isRecordingUndo() ) AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage)); @@ -774,7 +774,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) } pOutliner->UpdateFields(); } - else if ( (pOutliner->GetPrevDepth() == 1) && ( pOutliner->GetDepth( (USHORT) pOutliner->GetAbsPos( pPara ) ) == 2 ) ) + else if ( (pOutliner->GetPrevDepth() == 1) && ( pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( pPara ) ) == 2 ) ) { // how many titles are in front of the title paragraph in question? sal_Int32 nPos = -1L; @@ -789,7 +789,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) if(nPos >= 0) { - SdPage*pPage = (SdPage*)mpDoc->GetSdPage( (USHORT) nPos, PK_STANDARD); + SdPage*pPage = (SdPage*)mpDoc->GetSdPage( (sal_uInt16) nPos, PK_STANDARD); if(pPage && pPage->GetPresObj(PRESOBJ_TEXT)) pOutliner->SetDepth( pPara, 0 ); @@ -809,13 +809,13 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) if( nPos >= 0 ) { - SdPage* pPage = (SdPage*) mpDoc->GetSdPage( (USHORT) nPos, PK_STANDARD ); + SdPage* pPage = (SdPage*) mpDoc->GetSdPage( (sal_uInt16) nPos, PK_STANDARD ); if( pPage ) { SfxStyleSheet* pStyleSheet = NULL; - ULONG nPara = pOutliner->GetAbsPos( pPara ); - sal_Int16 nDepth = pOutliner->GetDepth( (USHORT) nPara ); + sal_uLong nPara = pOutliner->GetAbsPos( pPara ); + sal_Int16 nDepth = pOutliner->GetDepth( (sal_uInt16) nPara ); bool bSubTitle = pPage->GetPresObj(PRESOBJ_TEXT) != NULL; if( pOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) ) @@ -842,7 +842,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) // before we set the style sheet we need to preserve the bullet item // since all items will be deleted while setting a new style sheet - SfxItemSet aOldAttrs( pOutliner->GetParaAttribs( (USHORT)nPara ) ); + SfxItemSet aOldAttrs( pOutliner->GetParaAttribs( (sal_uInt16)nPara ) ); pOutliner->SetStyleSheet( nPara, pStyleSheet ); @@ -850,9 +850,9 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) if ( pOutliner->GetPrevDepth() != -1 && nDepth != -1 && aOldAttrs.GetItemState( EE_PARA_NUMBULLET ) == SFX_ITEM_ON ) { - SfxItemSet aAttrs( pOutliner->GetParaAttribs( (USHORT)nPara ) ); + SfxItemSet aAttrs( pOutliner->GetParaAttribs( (sal_uInt16)nPara ) ); aAttrs.Put( *aOldAttrs.GetItem( EE_PARA_NUMBULLET ) ); - pOutliner->SetParaAttribs( (USHORT)nPara, aAttrs ); + pOutliner->SetParaAttribs( (sal_uInt16)nPara, aAttrs ); } } } @@ -873,7 +873,7 @@ IMPL_LINK( OutlineView, StatusEventHdl, EditStatus *, EMPTYARG ) ::sd::Window* pWin = mpOutlineViewShell->GetActiveWindow(); OutlinerView* pOutlinerView = GetViewByWindow(pWin); Rectangle aVis = pOutlinerView->GetVisArea(); - ULONG nWidth = OUTLINE_PAPERWIDTH; + sal_uLong nWidth = OUTLINE_PAPERWIDTH; Rectangle aText = Rectangle(Point(0,0), Size(nWidth, mpOutliner->GetTextHeight())); @@ -930,8 +930,8 @@ IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner ) } // select the pages belonging to the paragraphs on level 0 to select - USHORT nPos = 0; - ULONG nParaPos = 0; + sal_uInt16 nPos = 0; + sal_uLong nParaPos = 0; Paragraph* pPara = pOutliner->GetParagraph( 0 ); std::vector<Paragraph*>::const_iterator fiter; @@ -970,8 +970,8 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) Paragraph* pSearchIt = maSelectedParas.empty() ? NULL : *(maSelectedParas.begin()); // look for the first of the selected paragraphs in the new ordering - USHORT nPosNewOrder = 0; - ULONG nParaPos = 0; + sal_uInt16 nPosNewOrder = 0; + sal_uLong nParaPos = 0; Paragraph* pPara = pOutliner->GetParagraph( 0 ); Paragraph* pPrev = NULL; while (pPara && pPara != pSearchIt) @@ -984,10 +984,10 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) pPara = pOutliner->GetParagraph( ++nParaPos ); } - USHORT nPos = nPosNewOrder; // don't change nPosNewOrder + sal_uInt16 nPos = nPosNewOrder; // don't change nPosNewOrder if (nPos == 0) { - nPos = (USHORT)-1; // insert before the first page + nPos = (sal_uInt16)-1; // insert before the first page } else { @@ -997,7 +997,7 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) pPrev); if (it != maOldParaOrder.end()) - nPos = static_cast<USHORT>(it-maOldParaOrder.begin()); + nPos = static_cast<sal_uInt16>(it-maOldParaOrder.begin()); else nPos = 0xffff; @@ -1007,11 +1007,11 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) mpDoc->MovePages(nPos); // deselect the pages again - USHORT nPageCount = (USHORT)maSelectedParas.size(); + sal_uInt16 nPageCount = (sal_uInt16)maSelectedParas.size(); while (nPageCount) { SdPage* pPage = mpDoc->GetSdPage(nPosNewOrder, PK_STANDARD); - pPage->SetSelected(FALSE); + pPage->SetSelected(sal_False); nPosNewOrder++; nPageCount--; } @@ -1034,11 +1034,11 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) SdrTextObj* OutlineView::GetTitleTextObject(SdrPage* pPage) { - ULONG nObjectCount = pPage->GetObjCount(); + sal_uLong nObjectCount = pPage->GetObjCount(); SdrObject* pObject = NULL; SdrTextObj* pResult = NULL; - for (ULONG nObject = 0; nObject < nObjectCount; nObject++) + for (sal_uLong nObject = 0; nObject < nObjectCount; nObject++) { pObject = pPage->GetObj(nObject); if (pObject->GetObjInventor() == SdrInventor && @@ -1060,11 +1060,11 @@ SdrTextObj* OutlineView::GetTitleTextObject(SdrPage* pPage) SdrTextObj* OutlineView::GetOutlineTextObject(SdrPage* pPage) { - ULONG nObjectCount = pPage->GetObjCount(); + sal_uLong nObjectCount = pPage->GetObjCount(); SdrObject* pObject = NULL; SdrTextObj* pResult = NULL; - for (ULONG nObject = 0; nObject < nObjectCount; nObject++) + for (sal_uLong nObject = 0; nObject < nObjectCount; nObject++) { pObject = pPage->GetObj(nObject); if (pObject->GetObjInventor() == SdrInventor && @@ -1133,7 +1133,7 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage) } /** updates draw model with all changes from outliner model */ -BOOL OutlineView::PrepareClose(BOOL) +sal_Bool OutlineView::PrepareClose(sal_Bool) { ::sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager()); if (pDocUndoMgr != NULL) @@ -1145,8 +1145,8 @@ BOOL OutlineView::PrepareClose(BOOL) BegUndo(aUndoStr); UpdateDocument(); EndUndo(); - mpDoc->SetSelected(GetActualPage(), TRUE); - return TRUE; + mpDoc->SetSelected(GetActualPage(), sal_True); + return sal_True; } @@ -1156,16 +1156,16 @@ BOOL OutlineView::PrepareClose(BOOL) |* \************************************************************************/ -BOOL OutlineView::SetAttributes(const SfxItemSet& rSet, BOOL ) +sal_Bool OutlineView::SetAttributes(const SfxItemSet& rSet, sal_Bool ) { - BOOL bOk = FALSE; + sal_Bool bOk = sal_False; OutlinerView* pOlView = GetViewByWindow(mpOutlineViewShell->GetActiveWindow()); if (pOlView) { pOlView->SetAttribs(rSet); - bOk = TRUE; + bOk = sal_True; } mpOutlineViewShell->Invalidate (SID_PREVIEW_STATE); @@ -1179,29 +1179,29 @@ BOOL OutlineView::SetAttributes(const SfxItemSet& rSet, BOOL ) |* \************************************************************************/ -BOOL OutlineView::GetAttributes( SfxItemSet& rTargetSet, BOOL ) const +sal_Bool OutlineView::GetAttributes( SfxItemSet& rTargetSet, sal_Bool ) const { OutlinerView* pOlView = GetViewByWindow( mpOutlineViewShell->GetActiveWindow()); DBG_ASSERT(pOlView, "keine OutlinerView gefunden"); - rTargetSet.Put( pOlView->GetAttribs(), FALSE ); - return TRUE; + rTargetSet.Put( pOlView->GetAttribs(), sal_False ); + return sal_True; } /** creates outliner model from draw model */ void OutlineView::FillOutliner() { mpOutliner->GetUndoManager().Clear(); - mpOutliner->EnableUndo(FALSE); + mpOutliner->EnableUndo(sal_False); ResetLinks(); mpOutliner->SetUpdateMode(false); Paragraph* pTitleToSelect = NULL; - ULONG nPageCount = mpDoc->GetSdPageCount(PK_STANDARD); + sal_uLong nPageCount = mpDoc->GetSdPageCount(PK_STANDARD); // fill outliner with paragraphs from slides title & (outlines|subtitles) - for (USHORT nPage = 0; nPage < nPageCount; nPage++) + for (sal_uInt16 nPage = 0; nPage < nPageCount; nPage++) { SdPage* pPage = (SdPage*)mpDoc->GetSdPage(nPage, PK_STANDARD); Paragraph * pPara = NULL; @@ -1213,8 +1213,8 @@ void OutlineView::FillOutliner() OutlinerParaObject* pOPO = pTO->GetOutlinerParaObject(); if (pOPO) { - BOOL bVertical = pOPO->IsVertical(); - pOPO->SetVertical( FALSE ); + sal_Bool bVertical = pOPO->IsVertical(); + pOPO->SetVertical( sal_False ); mpOutliner->AddText(*pOPO); pOPO->SetVertical( bVertical ); pPara = mpOutliner->GetParagraph( mpOutliner->GetParagraphCount()-1 ); @@ -1227,7 +1227,7 @@ void OutlineView::FillOutliner() mpOutliner->SetDepth(pPara, -1); // do not apply hard attributes from the previous paragraph - mpOutliner->SetParaAttribs( (USHORT)mpOutliner->GetAbsPos(pPara), + mpOutliner->SetParaAttribs( (sal_uInt16)mpOutliner->GetAbsPos(pPara), mpOutliner->GetEmptyItemSet() ); mpOutliner->SetStyleSheet( mpOutliner->GetAbsPos( pPara ), pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ) ); @@ -1235,9 +1235,9 @@ void OutlineView::FillOutliner() mpOutliner->SetParaFlag( pPara, PARAFLAG_ISPAGE ); - ULONG nPara = mpOutliner->GetAbsPos( pPara ); + sal_uLong nPara = mpOutliner->GetAbsPos( pPara ); - UpdateParagraph( (USHORT)nPara ); + UpdateParagraph( (sal_uInt16)nPara ); // remember paragraph of currently selected page if (pPage->IsSelected()) @@ -1255,14 +1255,14 @@ void OutlineView::FillOutliner() OutlinerParaObject* pOPO = pTO->GetOutlinerParaObject(); if (pOPO) { - USHORT nParaCount1 = (USHORT)mpOutliner->GetParagraphCount(); - BOOL bVertical = pOPO->IsVertical(); - pOPO->SetVertical( FALSE ); + sal_uInt16 nParaCount1 = (sal_uInt16)mpOutliner->GetParagraphCount(); + sal_Bool bVertical = pOPO->IsVertical(); + pOPO->SetVertical( sal_False ); mpOutliner->AddText(*pOPO); pOPO->SetVertical( bVertical ); - USHORT nParaCount2 = (USHORT)mpOutliner->GetParagraphCount(); - for (USHORT n = nParaCount1; n < nParaCount2; n++) + sal_uInt16 nParaCount2 = (sal_uInt16)mpOutliner->GetParagraphCount(); + for (sal_uInt16 n = nParaCount1; n < nParaCount2; n++) { if( bSubTitle ) { @@ -1279,16 +1279,16 @@ void OutlineView::FillOutliner() // place cursor at the start Paragraph* pFirstPara = mpOutliner->GetParagraph( 0 ); - mpOutlinerView[0]->Select( pFirstPara, TRUE, FALSE ); - mpOutlinerView[0]->Select( pFirstPara, FALSE, FALSE ); + mpOutlinerView[0]->Select( pFirstPara, sal_True, sal_False ); + mpOutlinerView[0]->Select( pFirstPara, sal_False, sal_False ); // select title of slide that was selected if (pTitleToSelect) - mpOutlinerView[0]->Select(pTitleToSelect, TRUE, FALSE); + mpOutlinerView[0]->Select(pTitleToSelect, sal_True, sal_False); SetLinks(); - mpOutliner->EnableUndo(TRUE); + mpOutliner->EnableUndo(sal_True); mpOutliner->SetUpdateMode(true); } @@ -1301,7 +1301,7 @@ void OutlineView::FillOutliner() IMPL_LINK( OutlineView, RemovingPagesHdl, OutlinerView *, EMPTYARG ) { - USHORT nNumOfPages = mpOutliner->GetSelPageCount(); + sal_uInt16 nNumOfPages = mpOutliner->GetSelPageCount(); if (nNumOfPages > PROCESS_WITH_PROGRESS_THRESHOLD) { @@ -1351,7 +1351,7 @@ SdPage* OutlineView::GetActualPage() SdPage* pCurrent = GetPageForParagraph(pPar); DBG_ASSERT( pCurrent || - (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->isInUndo()) || + (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->IsDoing()) || maDragAndDropModelGuard.get(), "sd::OutlineView::GetActualPage(), no current page?" ); @@ -1375,7 +1375,7 @@ SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara ) } if( nPageToSelect < (sal_uInt32)mpDoc->GetSdPageCount( PK_STANDARD ) ) - return static_cast< SdPage* >( mpDoc->GetSdPage( (USHORT)nPageToSelect, PK_STANDARD) ); + return static_cast< SdPage* >( mpDoc->GetSdPage( (sal_uInt16)nPageToSelect, PK_STANDARD) ); return 0; } @@ -1416,7 +1416,7 @@ void OutlineView::SetActualPage( SdPage* pActual ) // if we found a paragraph, select its text at the outliner view Paragraph* pPara = GetParagraphForPage( mpOutliner, pActual ); if( pPara ) - mpOutlinerView[0]->Select( pPara, TRUE, FALSE ); + mpOutlinerView[0]->Select( pPara, sal_True, sal_False ); } } @@ -1457,8 +1457,8 @@ void OutlineView::SetSelectedPages() } // select the pages belonging to the paragraphs on level 0 to select - USHORT nPos = 0; - ULONG nParaPos = 0; + sal_uInt16 nPos = 0; + sal_uLong nParaPos = 0; Paragraph *pPara = mpOutliner->GetParagraph( 0 ); std::vector<Paragraph*>::const_iterator fiter; @@ -1538,7 +1538,7 @@ void OutlineView::ResetLinks() const |* \************************************************************************/ -sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, USHORT, USHORT) +sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, sal_uInt16) { return DND_ACTION_NONE; } @@ -1549,7 +1549,7 @@ sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::s |* \************************************************************************/ -sal_Int8 OutlineView::ExecuteDrop( const ExecuteDropEvent&, DropTargetHelper&, ::sd::Window*, USHORT, USHORT) +sal_Int8 OutlineView::ExecuteDrop( const ExecuteDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, sal_uInt16) { return DND_ACTION_NONE; } @@ -1666,7 +1666,7 @@ void OutlineView::EndModelChange() { UpdateDocument(); - SfxUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); + ::svl::IUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); bool bHasUndoActions = pDocUndoMgr->GetUndoActionCount() != 0; @@ -1684,6 +1684,9 @@ void OutlineView::EndModelChange() if( bHasUndoActions && mpOutliner->GetEditEngine().HasTriedMergeOnLastAddUndo() ) TryToMergeUndoActions(); + + mpOutlineViewShell->Invalidate( SID_UNDO ); + mpOutlineViewShell->Invalidate( SID_REDO ); } /** updates all changes in the outliner model to the draw model */ @@ -1694,8 +1697,8 @@ void OutlineView::UpdateDocument() sal_uInt32 nPage; for (nPage = 0; nPage < nPageCount; nPage++) { - SdPage* pPage = mpDoc->GetSdPage( (USHORT)nPage, PK_STANDARD); - mpDoc->SetSelected(pPage, FALSE); + SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_STANDARD); + mpDoc->SetSelected(pPage, sal_False); mpOutlineViewShell->UpdateTitleObject( pPage, pPara ); mpOutlineViewShell->UpdateOutlineObject( pPage, pPara ); @@ -1708,7 +1711,7 @@ void OutlineView::UpdateDocument() while( pPara ) { SdPage* pPage = InsertSlideForParagraph( pPara ); - mpDoc->SetSelected(pPage, FALSE); + mpDoc->SetSelected(pPage, sal_False); mpOutlineViewShell->UpdateTitleObject( pPage, pPara ); mpOutlineViewShell->UpdateOutlineObject( pPage, pPara ); @@ -1721,7 +1724,7 @@ void OutlineView::UpdateDocument() /** merge edit engine undo actions if possible */ void OutlineView::TryToMergeUndoActions() { - SfxUndoManager& rOutlineUndo = mpOutliner->GetUndoManager(); + ::svl::IUndoManager& rOutlineUndo = mpOutliner->GetUndoManager(); if( rOutlineUndo.GetUndoActionCount() > 1 ) { SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction* >( rOutlineUndo.GetUndoAction(0) ); @@ -1729,19 +1732,19 @@ void OutlineView::TryToMergeUndoActions() if( pListAction && pPrevListAction ) { // find the top EditUndo action in the top undo action list - USHORT nAction = pListAction->aUndoActions.Count(); + size_t nAction = pListAction->aUndoActions.size(); EditUndo* pEditUndo = 0; while( !pEditUndo && nAction ) { - pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction]); + pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction].pAction); } - USHORT nEditPos = nAction; // we need this later to remove the merged undo actions + sal_uInt16 nEditPos = nAction; // we need this later to remove the merged undo actions // make sure it is the only EditUndo action in the top undo list while( pEditUndo && nAction ) { - if( dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction]) ) + if( dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction].pAction) ) pEditUndo = 0; } @@ -1750,10 +1753,10 @@ void OutlineView::TryToMergeUndoActions() { // yes, see if we can merge it with the prev undo list - nAction = pPrevListAction->aUndoActions.Count(); + nAction = pPrevListAction->aUndoActions.size(); EditUndo* pPrevEditUndo = 0; while( !pPrevEditUndo && nAction ) - pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->aUndoActions[--nAction]); + pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->aUndoActions[--nAction].pAction); if( pPrevEditUndo && pPrevEditUndo->Merge( pEditUndo ) ) { @@ -1761,22 +1764,23 @@ void OutlineView::TryToMergeUndoActions() // the top EditUndo of the previous undo list // first remove the merged undo action - DBG_ASSERT( pListAction->aUndoActions[nEditPos] == pEditUndo, "sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" ); + DBG_ASSERT( pListAction->aUndoActions[nEditPos].pAction == pEditUndo, + "sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" ); pListAction->aUndoActions.Remove(nEditPos); delete pEditUndo; // now check if we also can merge the draw undo actions - SfxUndoManager* pDocUndoManager = mpDocSh->GetUndoManager(); - if( pDocUndoManager && ( pListAction->aUndoActions.Count() == 1 )) + ::svl::IUndoManager* pDocUndoManager = mpDocSh->GetUndoManager(); + if( pDocUndoManager && ( pListAction->aUndoActions.size() == 1 )) { - SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions[0] ); + SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions[0].pAction ); SfxLinkUndoAction* pPrevLinkAction = 0; if( pLinkAction ) { - nAction = pPrevListAction->aUndoActions.Count(); + nAction = pPrevListAction->aUndoActions.size(); while( !pPrevLinkAction && nAction ) - pPrevLinkAction = dynamic_cast< SfxLinkUndoAction* >(pPrevListAction->aUndoActions[--nAction]); + pPrevLinkAction = dynamic_cast< SfxLinkUndoAction* >(pPrevListAction->aUndoActions[--nAction].pAction); } if( pLinkAction && pPrevLinkAction && @@ -1788,15 +1792,15 @@ void OutlineView::TryToMergeUndoActions() if( pSourceList && pDestinationList ) { - USHORT nCount = pSourceList->aUndoActions.Count(); - USHORT nDestAction = pDestinationList->aUndoActions.Count(); + sal_uInt16 nCount = pSourceList->aUndoActions.size(); + sal_uInt16 nDestAction = pDestinationList->aUndoActions.size(); while( nCount-- ) { - const SfxUndoAction* pTemp = pSourceList->aUndoActions.GetObject(0); + SfxUndoAction* pTemp = pSourceList->aUndoActions[0].pAction; pSourceList->aUndoActions.Remove(0); pDestinationList->aUndoActions.Insert( pTemp, nDestAction++ ); } - pDestinationList->nCurUndoAction = pDestinationList->aUndoActions.Count(); + pDestinationList->nCurUndoAction = pDestinationList->aUndoActions.size(); pListAction->aUndoActions.Remove(0); delete pLinkAction; @@ -1806,21 +1810,21 @@ void OutlineView::TryToMergeUndoActions() } } - if( pListAction->aUndoActions.Count() ) + if ( !pListAction->aUndoActions.empty() ) { // now we have to move all remaining doc undo actions from the top undo // list to the previous undo list and remove the top undo list - USHORT nCount = pListAction->aUndoActions.Count(); - USHORT nDestAction = pPrevListAction->aUndoActions.Count(); + size_t nCount = pListAction->aUndoActions.size(); + size_t nDestAction = pPrevListAction->aUndoActions.size(); while( nCount-- ) { - const SfxUndoAction* pTemp = pListAction->aUndoActions.GetObject(0); + SfxUndoAction* pTemp = pListAction->aUndoActions[0].pAction; pListAction->aUndoActions.Remove(0); if( pTemp ) pPrevListAction->aUndoActions.Insert( pTemp, nDestAction++ ); } - pPrevListAction->nCurUndoAction = pPrevListAction->aUndoActions.Count(); + pPrevListAction->nCurUndoAction = pPrevListAction->aUndoActions.size(); } rOutlineUndo.RemoveLastUndoAction(); @@ -1844,7 +1848,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo) if( pPara && mpOutliner->HasParaFlag(pPara,PARAFLAG_ISPAGE) ) { long nPage = 0; // todo, printing?? - for ( USHORT n = 0; n <= pInfo->mnPara; n++ ) + for ( sal_uInt16 n = 0; n <= pInfo->mnPara; n++ ) { Paragraph* p = mpOutliner->GetParagraph( n ); if ( mpOutliner->HasParaFlag(p,PARAFLAG_ISPAGE) ) @@ -1919,7 +1923,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo) // -------------------------------------------------------------------- -void OutlineView::UpdateParagraph( USHORT nPara ) +void OutlineView::UpdateParagraph( sal_uInt16 nPara ) { if( mpOutliner ) { |