diff options
Diffstat (limited to 'sd/source/ui/view/outlview.cxx')
-rw-r--r-- | sd/source/ui/view/outlview.cxx | 270 |
1 files changed, 137 insertions, 133 deletions
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index d2d180734d86..0bc619036739 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,31 +112,31 @@ 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) ) , mpOldParaOrder(NULL) , mpSelectedParas(NULL) , 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; } @@ -144,7 +144,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 ); @@ -173,8 +173,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); @@ -207,7 +207,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) { @@ -221,8 +221,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() ); @@ -270,7 +270,7 @@ void OutlineView::Paint(const Rectangle& rRect, ::sd::Window* pWin) pOlView->ShowCursor(mbFirstPaint); - mbFirstPaint = FALSE; + mbFirstPaint = sal_False; } } @@ -296,11 +296,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) { @@ -309,7 +309,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) { @@ -319,7 +319,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin) else if (!bValidArea) { aOutputArea = mpOutlinerView[nView]->GetOutputArea(); - bValidArea = TRUE; + bValidArea = sal_True; } nView++; @@ -339,8 +339,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) @@ -354,7 +354,7 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin) mpOutliner->RemoveView( mpOutlinerView[nView] ); delete mpOutlinerView[nView]; mpOutlinerView[nView] = NULL; - bRemoved = TRUE; + bRemoved = sal_True; } } @@ -373,7 +373,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) { @@ -451,7 +451,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 ); @@ -474,8 +474,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); @@ -501,7 +501,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; } @@ -513,13 +513,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)); @@ -540,25 +540,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)); @@ -573,7 +573,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) pExample->GetLwrBorder() ); // create presentation objects - pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), TRUE); + pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), sal_True); mpOutliner->UpdateFields(); @@ -596,7 +596,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); @@ -604,13 +604,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 ) Paragraph* pParagraph = (Paragraph*)pList->First(); while (pParagraph) { - if( !pOutliner->HasParaFlag( pParagraph, PARAFLAG_ISPAGE ) && (pOutliner->GetDepth( (USHORT) pOutliner->GetAbsPos( pParagraph ) ) <= 0) ) + if( !pOutliner->HasParaFlag( pParagraph, PARAFLAG_ISPAGE ) && (pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( pParagraph ) ) <= 0) ) mnPagesToProcess++; pParagraph = (Paragraph*)pList->Next(); } @@ -693,7 +693,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) } else { - mpDocSh->SetWaitCursor( TRUE ); + mpDocSh->SetWaitCursor( sal_True ); } delete pList; } @@ -718,7 +718,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) mpProgress = NULL; } else - mpDocSh->SetWaitCursor( FALSE ); + mpDocSh->SetWaitCursor( sal_False ); mnPagesToProcess = 0; mnPagesProcessed = 0; @@ -730,7 +730,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) { @@ -740,13 +740,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)); @@ -776,7 +776,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; @@ -791,7 +791,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 ); @@ -811,13 +811,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) ) @@ -844,7 +844,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 ); @@ -852,9 +852,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 ); } } } @@ -875,7 +875,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())); @@ -942,8 +942,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; pPara = pOutliner->GetParagraph( 0 ); while(pPara) @@ -952,10 +952,10 @@ IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner ) { mpOldParaOrder->Insert(pPara, LIST_APPEND); SdPage* pPage = mpDoc->GetSdPage(nPos, PK_STANDARD); - pPage->SetSelected(FALSE); + pPage->SetSelected(sal_False); if (mpSelectedParas->Seek(pPara)) // selected? { - pPage->SetSelected(TRUE); + pPage->SetSelected(sal_True); } nPos++; } @@ -983,8 +983,8 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) Paragraph* pSearchIt = (Paragraph*)mpSelectedParas->First(); // 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) @@ -997,26 +997,26 @@ 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 { // look for the predecessor in the old ordering - nPos = (USHORT)mpOldParaOrder->GetPos(pPrev); + nPos = (sal_uInt16)mpOldParaOrder->GetPos(pPrev); DBG_ASSERT(nPos != 0xffff, "Absatz nicht gefunden"); } mpDoc->MovePages(nPos); // deselect the pages again - USHORT nPageCount = (USHORT)mpSelectedParas->Count(); + sal_uInt16 nPageCount = (sal_uInt16)mpSelectedParas->Count(); while (nPageCount) { SdPage* pPage = mpDoc->GetSdPage(nPosNewOrder, PK_STANDARD); - pPage->SetSelected(FALSE); + pPage->SetSelected(sal_False); nPosNewOrder++; nPageCount--; } @@ -1041,11 +1041,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 && @@ -1067,11 +1067,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 && @@ -1140,7 +1140,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) @@ -1152,8 +1152,8 @@ BOOL OutlineView::PrepareClose(BOOL) BegUndo(aUndoStr); UpdateDocument(); EndUndo(); - mpDoc->SetSelected(GetActualPage(), TRUE); - return TRUE; + mpDoc->SetSelected(GetActualPage(), sal_True); + return sal_True; } @@ -1163,16 +1163,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); @@ -1186,29 +1186,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; @@ -1220,8 +1220,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 ); @@ -1234,7 +1234,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 ) ); @@ -1242,9 +1242,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()) @@ -1262,14 +1262,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 ) { @@ -1286,16 +1286,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); } @@ -1308,7 +1308,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) { @@ -1354,7 +1354,7 @@ SdPage* OutlineView::GetActualPage() SdPage* pCurrent = GetPageForParagraph(static_cast<Paragraph*>(pSelList->First()) ); 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?" ); if( pCurrent ) @@ -1377,7 +1377,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) ); else return 0; } @@ -1418,7 +1418,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 ); } } @@ -1464,8 +1464,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; pPara = mpOutliner->GetParagraph( 0 ); while(pPara) @@ -1477,10 +1477,10 @@ void OutlineView::SetSelectedPages() "Trying to select non-existing page OutlineView::SetSelectedPages()"); if (pPage != NULL) { - pPage->SetSelected(FALSE); + pPage->SetSelected(sal_False); if (pSelParas->Seek(pPara)) // selected? - pPage->SetSelected(TRUE); + pPage->SetSelected(sal_True); } nPos++; @@ -1545,7 +1545,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; } @@ -1556,7 +1556,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; } @@ -1673,7 +1673,7 @@ void OutlineView::EndModelChange() { UpdateDocument(); - SfxUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); + ::svl::IUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); bool bHasUndoActions = pDocUndoMgr->GetUndoActionCount() != 0; @@ -1691,6 +1691,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 */ @@ -1701,8 +1704,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 ); @@ -1715,7 +1718,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 ); @@ -1728,7 +1731,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) ); @@ -1736,19 +1739,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; } @@ -1757,10 +1760,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 ) ) { @@ -1768,22 +1771,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 && @@ -1795,15 +1799,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; @@ -1813,21 +1817,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(); @@ -1851,7 +1855,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) ) @@ -1926,7 +1930,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo) // -------------------------------------------------------------------- -void OutlineView::UpdateParagraph( USHORT nPara ) +void OutlineView::UpdateParagraph( sal_uInt16 nPara ) { if( mpOutliner ) { |