diff options
Diffstat (limited to 'sd/source/ui/dlg')
41 files changed, 877 insertions, 937 deletions
diff --git a/sd/source/ui/dlg/AnimationChildWindow.cxx b/sd/source/ui/dlg/AnimationChildWindow.cxx index dff4fcbd48eb..7440e4b66f62 100644 --- a/sd/source/ui/dlg/AnimationChildWindow.cxx +++ b/sd/source/ui/dlg/AnimationChildWindow.cxx @@ -71,7 +71,7 @@ AnimationChildWindow::AnimationChildWindow( pAnimWin->aFltWinSize = pWindow->GetSizePixel(); */ - SetHideNotDelete( sal_True ); + SetHideNotDelete( true ); } } // end of namespace sd diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 1b5436309bb9..6b968b17cfc8 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -108,7 +108,7 @@ void LayerTabBar::Select() void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt) { - sal_Bool bSetPageID=sal_False; + bool bSetPageID=false; if (rMEvt.IsLeft() && !rMEvt.IsMod1() && !rMEvt.IsMod2()) { @@ -120,16 +120,20 @@ void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt) SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher(); pDispatcher->Execute(SID_INSERTLAYER, SFX_CALLMODE_SYNCHRON); - bSetPageID=sal_True; + bSetPageID=true; } else if (rMEvt.IsShift()) { // Toggle zw. Layer sichtbar / unsichtbar String aName(GetPageText(aLayerId)); SdrPageView* pPV = pDrViewSh->GetView()->GetSdrPageView(); - sal_Bool bVisible = pPV->IsLayerVisible(aName); - pPV->SetLayerVisible(aName, !bVisible); - pDrViewSh->ResetActualLayer(); + + if(pPV) + { + bool bVisible = pPV->IsLayerVisible(aName); + pPV->SetLayerVisible(aName, !bVisible); + pDrViewSh->ResetActualLayer(); + } } } @@ -168,11 +172,11 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt ) if( !pDrViewSh->GetDocSh()->IsReadOnly() ) { - sal_uInt16 nPageId = SDRPAGE_NOTFOUND; - Point aPos( PixelToLogic( rEvt.maPosPixel ) ); - sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc()->GetLayerAdmin().GetLayerID( GetPageText( GetPageId( aPos ) ), sal_False ); + const sal_uInt32 nPageId(SDRPAGE_NOTFOUND); + const Point aPos( PixelToLogic( rEvt.maPosPixel ) ); + const SdrLayerID aLayerId(pDrViewSh->GetView()->GetDoc()->GetModelLayerAdmin().GetLayerID( GetPageText( GetPageId( aPos ) ), false )); - nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, nPageId, nLayerId ); + nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, nPageId, aLayerId ); SwitchPage( aPos ); } @@ -188,9 +192,9 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt ) sal_Int8 LayerTabBar::ExecuteDrop( const ExecuteDropEvent& rEvt ) { - sal_uInt16 nPageId = SDRPAGE_NOTFOUND; - sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc()->GetLayerAdmin().GetLayerID( GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ), sal_False ); - sal_Int8 nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, nPageId, nLayerId ); + const sal_uInt32 nPageId(SDRPAGE_NOTFOUND); + const SdrLayerID aLayerId(pDrViewSh->GetView()->GetDoc()->GetModelLayerAdmin().GetLayerID( GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ), false )); + sal_Int8 nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, nPageId, aLayerId ); EndSwitchPage(); @@ -217,7 +221,7 @@ void LayerTabBar::Command(const CommandEvent& rCEvt) \************************************************************************/ long LayerTabBar::StartRenaming() { - sal_Bool bOK = sal_True; + bool bOK = true; String aLayerName = GetPageText( GetEditPageId() ); String aLayoutLayer ( SdResId(STR_LAYER_LAYOUT) ); String aControlsLayer ( SdResId(STR_LAYER_CONTROLS) ); @@ -230,7 +234,7 @@ long LayerTabBar::StartRenaming() aLayerName == aBackgroundLayer || aLayerName == aBackgroundObjLayer ) { // Diese Namen duerfen nicht veraendert werden - bOK = sal_False; + bOK = false; } else { @@ -251,23 +255,23 @@ long LayerTabBar::StartRenaming() long LayerTabBar::AllowRenaming() { - sal_Bool bOK = sal_True; + bool bOK = true; // Ueberpruefung auf schon vorhandene Namen ::sd::View* pView = pDrViewSh->GetView(); SdDrawDocument* pDoc = pView->GetDoc(); String aLayerName = pView->GetActiveLayer(); - SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); + SdrLayerAdmin& rLayerAdmin = pDoc->GetModelLayerAdmin(); String aNewName( GetEditText() ); if ( aNewName.Len() == 0 || - (rLayerAdmin.GetLayer( aNewName, sal_False ) && aLayerName != aNewName) ) + (rLayerAdmin.GetLayer( aNewName, false ) && aLayerName != aNewName) ) { // Name ist schon vorhanden WarningBox aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ), String(SdResId( STR_WARN_NAME_DUPLICATE ) ) ); aWarningBox.Execute(); - bOK = sal_False; + bOK = false; } if (bOK) @@ -283,7 +287,7 @@ long LayerTabBar::AllowRenaming() aNewName == aBackgroundLayer || aNewName == aBackgroundObjLayer ) { // Diese Namen duerfen nicht vergeben werden - bOK = sal_False; + bOK = false; } } @@ -299,12 +303,12 @@ void LayerTabBar::EndRenaming() if( !IsEditModeCanceled() ) { ::sd::View* pView = pDrViewSh->GetView(); - DrawView* pDrView = PTR_CAST( DrawView, pView ); + DrawView* pDrView = dynamic_cast< DrawView* >(pView ); SdDrawDocument* pDoc = pView->GetDoc(); String aLayerName = pView->GetActiveLayer(); - SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); - SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, sal_False); + SdrLayerAdmin& rLayerAdmin = pDoc->GetModelLayerAdmin(); + SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, false); if (pLayer) { @@ -338,7 +342,7 @@ void LayerTabBar::EndRenaming() // schon bekannt sein muss. pView->SetActiveLayer(aNewName); pLayer->SetName(aNewName); - pDoc->SetChanged(sal_True); + pDoc->SetChanged(true); } } } diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index 92067843a1d0..37605f04ec4a 100644 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -74,7 +74,7 @@ PaneChildWindow::PaneChildWindow ( String( SdResId( nTitleBarResId ) ) ); eChildAlignment = eAlignment; static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo); - SetHideNotDelete(sal_True); + SetHideNotDelete(true); ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame()); if (pBase != NULL) diff --git a/sd/source/ui/dlg/PaneShells.cxx b/sd/source/ui/dlg/PaneShells.cxx index 199aa1a4dc83..9eeb75c16018 100644 --- a/sd/source/ui/dlg/PaneShells.cxx +++ b/sd/source/ui/dlg/PaneShells.cxx @@ -49,10 +49,6 @@ SFX_IMPL_INTERFACE(LeftImpressPaneShell, SfxShell, SdResId(STR_LEFT_IMPRESS_PANE ::sd::LeftPaneImpressChildWindow::GetChildWindowId()); } -TYPEINIT1(LeftImpressPaneShell, SfxShell); - - - LeftImpressPaneShell::LeftImpressPaneShell (void) : SfxShell() { @@ -85,10 +81,6 @@ SFX_IMPL_INTERFACE(LeftDrawPaneShell, SfxShell, SdResId(STR_LEFT_DRAW_PANE_SHELL ::sd::LeftPaneDrawChildWindow::GetChildWindowId()); } -TYPEINIT1(LeftDrawPaneShell, SfxShell); - - - LeftDrawPaneShell::LeftDrawPaneShell (void) : SfxShell() { @@ -120,8 +112,6 @@ SFX_IMPL_INTERFACE( ToolPanelPaneShell, SfxShell, SdResId( STR_TOOL_PANEL_SHELL SFX_CHILDWINDOW_REGISTRATION( ::sd::ToolPanelChildWindow::GetChildWindowId() ); } -TYPEINIT1( ToolPanelPaneShell, SfxShell ); - ToolPanelPaneShell::ToolPanelPaneShell() :SfxShell() { diff --git a/sd/source/ui/dlg/SpellDialogChildWindow.cxx b/sd/source/ui/dlg/SpellDialogChildWindow.cxx index 29ef7eca3e5d..6dd724c28272 100644 --- a/sd/source/ui/dlg/SpellDialogChildWindow.cxx +++ b/sd/source/ui/dlg/SpellDialogChildWindow.cxx @@ -106,7 +106,7 @@ void SpellDialogChildWindow::InvalidateSpellDialog (void) // check. if (aResult.empty()) { - SfxBoolItem aItem (SID_SPELL_DIALOG, sal_False); + SfxBoolItem aItem (SID_SPELL_DIALOG, false); GetBindings().GetDispatcher()->Execute( SID_SPELL_DIALOG, SFX_CALLMODE_ASYNCHRON, @@ -157,7 +157,7 @@ void SpellDialogChildWindow::LoseFocus() void SpellDialogChildWindow::ProvideOutliner (void) { - ViewShellBase* pViewShellBase = PTR_CAST (ViewShellBase, SfxViewShell::Current()); + ViewShellBase* pViewShellBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current()); if (pViewShellBase != NULL) { @@ -165,8 +165,8 @@ void SpellDialogChildWindow::ProvideOutliner (void) // If there already exists an outliner that has been created // for another view shell then destroy it first. if (mpSdOutliner != NULL) - if ((pViewShell->ISA(DrawViewShell) && ! mbOwnOutliner) - || (pViewShell->ISA(OutlineViewShell) && mbOwnOutliner)) + if ((dynamic_cast< DrawViewShell* >(pViewShell) && ! mbOwnOutliner) + || (dynamic_cast< OutlineViewShell* >(pViewShell) && mbOwnOutliner)) { mpSdOutliner->EndSpelling(); if (mbOwnOutliner) @@ -177,7 +177,7 @@ void SpellDialogChildWindow::ProvideOutliner (void) // Now create/get an outliner if none is present. if (mpSdOutliner == NULL) { - if (pViewShell->ISA(DrawViewShell)) + if (dynamic_cast< DrawViewShell* >(pViewShell)) { // We need an outliner for the spell check so we have // to create one. @@ -186,7 +186,7 @@ void SpellDialogChildWindow::ProvideOutliner (void) pViewShell->GetDoc(), OUTLINERMODE_TEXTOBJECT); } - else if (pViewShell->ISA(OutlineViewShell)) + else if (dynamic_cast< OutlineViewShell* >(pViewShell)) { // An outline view is already visible. The SdOutliner // will use it instead of creating its own. diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 49d193ff3eba..20035efa7b5d 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -50,13 +50,11 @@ #include "sdpage.hxx" #include "res_bmp.hrc" #include "ViewShell.hxx" - -#ifndef _SV_SVAPP_HXX_ #include <vcl/svapp.hxx> -#endif - #include <string> #include <algorithm> +#include <svx/svdlegacy.hxx> +#include <svx/svdetc.hxx> using namespace ::com::sun::star; @@ -132,8 +130,8 @@ void SdDisplay::DataChanged( const DataChangedEvent& rDCEvt ) const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); SetBackground( Wallpaper( Color( rStyles.GetFieldColor() ) ) ); SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() - ? ViewShell::OUTPUT_DRAWMODE_CONTRAST - : ViewShell::OUTPUT_DRAWMODE_COLOR ); + ? SD_OUTPUT_DRAWMODE_CONTRAST + : SD_OUTPUT_DRAWMODE_COLOR ); } } @@ -170,8 +168,8 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings, pWin ( pParent ), pBitmapEx ( NULL ), - bMovie ( sal_False ), - bAllObjects ( sal_False ), + bMovie ( false ), + bAllObjects ( false ), pBindings ( pInBindings ) { @@ -185,7 +183,7 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings, // neues Dokument mit Seite erzeugen pMyDoc = new SdDrawDocument(DOCUMENT_TYPE_IMPRESS, NULL); - SdPage* pPage = (SdPage*) pMyDoc->AllocPage(sal_False); + SdPage* pPage = (SdPage*) pMyDoc->AllocPage(false); pMyDoc->InsertPage(pPage); pControllerItem = new AnimationControllerItem( SID_ANIMATOR_STATE, this, pBindings ); @@ -265,7 +263,7 @@ IMPL_LINK( AnimationWindow, ClickFirstHdl, void *, EMPTYARG ) IMPL_LINK( AnimationWindow, ClickStopHdl, void *, EMPTYARG ) { - bMovie = sal_False; + bMovie = false; return( 0L ); } @@ -275,15 +273,15 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p ) { ScopeLockGuard aGuard( maPlayLock ); - bMovie = sal_True; - sal_Bool bDisableCtrls = sal_False; + bMovie = true; + bool bDisableCtrls = false; sal_uLong nCount = aBmpExList.Count(); - sal_Bool bReverse = p == &aBtnReverse; + bool bReverse = p == &aBtnReverse; // Kann spaeter schwer ermittelt werden - sal_Bool bRbtGroupEnabled = aRbtGroup.IsEnabled(); - sal_Bool bBtnGetAllObjectsEnabled = aBtnGetAllObjects.IsEnabled(); - sal_Bool bBtnGetOneObjectEnabled = aBtnGetOneObject.IsEnabled(); + bool bRbtGroupEnabled = aRbtGroup.IsEnabled(); + bool bBtnGetAllObjectsEnabled = aBtnGetAllObjects.IsEnabled(); + bool bBtnGetOneObjectEnabled = aBtnGetOneObject.IsEnabled(); // Gesamtzeit ermitteln Time aTime( 0 ); @@ -304,7 +302,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p ) SfxProgress* pProgress = NULL; if( nFullTime >= 1000 ) { - bDisableCtrls = sal_True; + bDisableCtrls = true; aBtnStop.Enable(); aBtnStop.Update(); String aStr( RTL_CONSTASCII_USTRINGPARAM( "Animator:" ) ); // Hier sollte man sich noch etwas gescheites ausdenken! @@ -313,7 +311,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p ) sal_uLong nTmpTime = 0; long i = 0; - sal_Bool bCount = i < (long) nCount; + bool bCount = i < (long) nCount; if( bReverse ) { i = nCount - 1; @@ -368,7 +366,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p ) } // Um die Controls wieder zu enablen - bMovie = sal_False; + bMovie = false; if (nCount > 0) UpdateControl(i); @@ -403,8 +401,8 @@ IMPL_LINK( AnimationWindow, ClickRbtHdl, void *, p ) if( !pBitmapEx || p == &aRbtGroup || aRbtGroup.IsChecked() ) { aTimeField.SetText( String() ); - aTimeField.Enable( sal_False ); - aLbLoopCount.Enable( sal_False ); + aTimeField.Enable( false ); + aLbLoopCount.Enable( false ); } else if( p == &aRbtBitmap || aRbtBitmap.IsChecked() ) { @@ -429,7 +427,7 @@ IMPL_LINK( AnimationWindow, ClickGetObjectHdl, void *, pBtn ) bAllObjects = pBtn == &aBtnGetAllObjects; // Code jetzt in AddObj() - SfxBoolItem aItem( SID_ANIMATOR_ADD, sal_True ); + SfxBoolItem aItem( SID_ANIMATOR_ADD, true ); GetBindings().GetDispatcher()->Execute( SID_ANIMATOR_ADD, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L ); @@ -465,10 +463,9 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn ) // Objekte vorhanden sein. if( pObject ) { - pObject = pPage->RemoveObject(nPos); + pObject = pPage->RemoveObjectFromSdrObjList(nPos); DBG_ASSERT(pObject, "Clone beim Loeschen nicht gefunden"); - SdrObject::Free( pObject ); - pPage->RecalcObjOrdNums(); + deleteSdrObjectSafeAndClearPointer( pObject ); } } @@ -491,10 +488,9 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn ) pObject = pPage->GetObj( i ); if( pObject ) { - pObject = pPage->RemoveObject( i ); + pObject = pPage->RemoveObjectFromSdrObjList( i ); DBG_ASSERT(pObject, "Clone beim Loeschen nicht gefunden"); - SdrObject::Free( pObject ); - //pPage->RecalcObjOrdNums(); + deleteSdrObjectSafeAndClearPointer( pObject ); } } @@ -533,7 +529,7 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn ) IMPL_LINK( AnimationWindow, ClickCreateGroupHdl, void *, EMPTYARG ) { // Code jetzt in CreatePresObj() - SfxBoolItem aItem( SID_ANIMATOR_CREATE, sal_True ); + SfxBoolItem aItem( SID_ANIMATOR_CREATE, true ); GetBindings().GetDispatcher()->Execute( SID_ANIMATOR_CREATE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L ); @@ -575,7 +571,7 @@ IMPL_LINK( AnimationWindow, ModifyTimeHdl, void *, EMPTYARG ) // ----------------------------------------------------------------------- -void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls ) +void AnimationWindow::UpdateControl( sal_uLong nListPos, bool bDisableCtrls ) { String aString; @@ -588,7 +584,7 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls if( pObject ) { VirtualDevice aVD; - Rectangle aObjRect( pObject->GetCurrentBoundRect() ); + Rectangle aObjRect( sdr::legacy::GetBoundRect(*pObject) ); Size aObjSize( aObjRect.GetSize() ); Point aOrigin( Point( -aObjRect.Left(), -aObjRect.Top() ) ); MapMode aMap( aVD.GetMapMode() ); @@ -599,8 +595,8 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); aVD.SetBackground( Wallpaper( rStyles.GetFieldColor() ) ); aVD.SetDrawMode( rStyles.GetHighContrastMode() - ? ViewShell::OUTPUT_DRAWMODE_CONTRAST - : ViewShell::OUTPUT_DRAWMODE_COLOR ); + ? SD_OUTPUT_DRAWMODE_CONTRAST + : SD_OUTPUT_DRAWMODE_COLOR ); aVD.Erase(); pObject->SingleObjectPainter( aVD ); // #110094#-17 aBmp = BitmapEx( aVD.GetBitmap( aObjRect.TopLeft(), aObjSize ) ); @@ -638,15 +634,15 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls //aFiCount.SetText( String( SdResId( STR_NULL ) ) ); // Wenn kein Objekt in der Liste ist - aBtnFirst.Enable( sal_False ); - aBtnReverse.Enable( sal_False ); - aBtnPlay.Enable( sal_False ); - aBtnLast.Enable( sal_False ); - aNumFldBitmap.Enable( sal_False ); - aTimeField.Enable( sal_False ); - aLbLoopCount.Enable( sal_False ); - aBtnRemoveBitmap.Enable( sal_False ); - aBtnRemoveAll.Enable( sal_False ); + aBtnFirst.Enable( false ); + aBtnReverse.Enable( false ); + aBtnPlay.Enable( false ); + aBtnLast.Enable( false ); + aNumFldBitmap.Enable( false ); + aTimeField.Enable( false ); + aLbLoopCount.Enable( false ); + aBtnRemoveBitmap.Enable( false ); + aBtnRemoveAll.Enable( false ); //aFtAdjustment.Enable(); //aLbAdjustment.Enable(); @@ -654,13 +650,13 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls if( bMovie && bDisableCtrls ) { - aBtnGetOneObject.Enable( sal_False ); - aBtnGetAllObjects.Enable( sal_False ); - aRbtGroup.Enable( sal_False ); - aRbtBitmap.Enable( sal_False ); - aBtnCreateGroup.Enable( sal_False ); - aFtAdjustment.Enable( sal_False ); - aLbAdjustment.Enable( sal_False ); + aBtnGetOneObject.Enable( false ); + aBtnGetAllObjects.Enable( false ); + aRbtGroup.Enable( false ); + aRbtBitmap.Enable( false ); + aBtnCreateGroup.Enable( false ); + aFtAdjustment.Enable( false ); + aLbAdjustment.Enable( false ); } else { @@ -670,8 +666,8 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls aRbtBitmap.Enable(); aBtnCreateGroup.Enable(aBmpExList.Count() != 0); - aFtAdjustment.Enable( sal_True ); - aLbAdjustment.Enable( sal_True ); + aFtAdjustment.Enable( true ); + aLbAdjustment.Enable( true ); } ClickRbtHdl( NULL ); @@ -850,18 +846,18 @@ sal_Bool AnimationWindow::Close() { if( maPlayLock.isLocked() ) { - return sal_False; + return false; } else { - SfxBoolItem aItem( SID_ANIMATION_OBJECTS, sal_False ); + SfxBoolItem aItem( SID_ANIMATION_OBJECTS, false ); GetBindings().GetDispatcher()->Execute( SID_ANIMATION_OBJECTS, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L ); SfxDockingWindow::Close(); - return sal_True; + return true; } } @@ -882,29 +878,28 @@ void AnimationWindow::AddObj (::sd::View& rView ) rView.SdrEndTextEdit(); // Objekt(e) clonen und den/die Clone(s) in die Liste stellen - const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView()); SdPage* pPage = pMyDoc->GetSdPage(0, PK_STANDARD); - sal_uLong nCloneCount = pPage->GetObjCount(); - if (nMarkCount > 0) + if (aSelection.size()) { + const sal_uInt32 nCloneCount(pPage->GetObjCount()); // Wenn es sich um EIN Animationsobjekt oder ein Gruppenobjekt // handelt, das 'einzeln uebernommen' wurde, // werden die einzelnen Objekte eingefuegt - sal_Bool bAnimObj = sal_False; - if( nMarkCount == 1 ) + bool bAnimObj = false; + if( 1 == aSelection.size() ) { - SdrMark* pMark = rMarkList.GetMark(0); - SdrObject* pObject = pMark->GetMarkedSdrObj(); + SdrObject* pObject = aSelection[0]; SdAnimationInfo* pAnimInfo = rView.GetDoc()->GetAnimationInfo( pObject ); - sal_uInt32 nInv = pObject->GetObjInventor(); - sal_uInt16 nId = pObject->GetObjIdentifier(); + const sal_uInt32 nInv = pObject->GetObjInventor(); + const sal_uInt16 nId = pObject->GetObjIdentifier(); // Animated Bitmap (GIF) - if( nInv == SdrInventor && nId == OBJ_GRAF && ( (SdrGrafObj*) pObject )->IsAnimated() ) + const SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObject); + + if( pGrafObj && pGrafObj->IsAnimated() ) { - const SdrGrafObj* pGrafObj = (SdrGrafObj*) pObject; Graphic aGraphic( pGrafObj->GetTransformedGraphic() ); sal_uInt16 nCount = 0; @@ -943,37 +938,41 @@ void AnimationWindow::AddObj (::sd::View& rView ) } // Nachdem ein animated GIF uebernommen wurde, kann auch nur ein solches erstellt werden aRbtBitmap.Check(); - aRbtGroup.Enable( sal_False ); - bAnimObj = sal_True; + aRbtGroup.Enable( false ); + bAnimObj = true; } } else if( bAllObjects || ( pAnimInfo && pAnimInfo->mbIsMovie ) ) { // Mehrere Objekte - SdrObjList* pObjList = ((SdrObjGroup*)pObject)->GetSubList(); + SdrObjList* pObjList = pObject->getChildrenOfSdrObject(); - for( sal_uInt16 nObject = 0; nObject < pObjList->GetObjCount(); nObject++ ) + if(pObjList) { - SdrObject* pSnapShot = (SdrObject*) pObjList->GetObj( (sal_uLong) nObject ); + for( sal_uInt32 nObject (0); nObject < pObjList->GetObjCount(); nObject++ ) + { + SdrObject* pSnapShot = (SdrObject*) pObjList->GetObj( nObject ); + OSL_ENSURE(pSnapShot, "zero SdrObject* in SdrObjList (!)"); - pBitmapEx = new BitmapEx( SdrExchangeView::GetObjGraphic( pSnapShot->GetModel(), pSnapShot ).GetBitmapEx() ); - aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 ); + pBitmapEx = new BitmapEx(GetObjGraphic(*pSnapShot).GetBitmapEx()); + aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 ); - // Time - Time* pTime = new Time( aTimeField.GetTime() ); - aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 ); + // Time + Time* pTime = new Time( aTimeField.GetTime() ); + aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 ); - // Clone - pPage->InsertObject( pSnapShot->Clone(), aBmpExList.GetCurPos() + 1 ); + // Clone + pPage->InsertObjectToSdrObjList(*pSnapShot->CloneSdrObject(), aBmpExList.GetCurPos() + 1); - // Weiterschalten der BitmapListe - aBmpExList.Next(); + // Weiterschalten der BitmapListe + aBmpExList.Next(); + } } - bAnimObj = sal_True; + bAnimObj = true; } } // Auch ein einzelnes animiertes Objekt - if( !bAnimObj && !( bAllObjects && nMarkCount > 1 ) ) + if( !bAnimObj && !( bAllObjects && aSelection.size() > 1 ) ) { pBitmapEx = new BitmapEx( rView.GetAllMarkedGraphic().GetBitmapEx() ); aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 ); @@ -985,46 +984,44 @@ void AnimationWindow::AddObj (::sd::View& rView ) } // ein einzelnes Objekt - if( nMarkCount == 1 && !bAnimObj ) + if( 1 == aSelection.size() && !bAnimObj ) { - SdrMark* pMark = rMarkList.GetMark(0); - SdrObject* pObject = pMark->GetMarkedSdrObj(); - SdrObject* pClone = pObject->Clone(); - pPage->InsertObject(pClone, aBmpExList.GetCurPos() + 1); + pPage->InsertObjectToSdrObjList(*aSelection[0]->CloneSdrObject(), aBmpExList.GetCurPos() + 1); } - // mehrere Objekte: die Clones zu einer Gruppe zusammenfassen - else if (nMarkCount > 1) + else if (aSelection.size() > 1) { + // mehrere Objekte: die Clones zu einer Gruppe zusammenfassen // Objekte einzeln uebernehmen if( bAllObjects ) { - for( sal_uLong nObject= 0; nObject < nMarkCount; nObject++ ) + for( sal_uInt32 nObject(0); nObject < aSelection.size(); nObject++ ) { // Clone - SdrObject* pObject = rMarkList.GetMark( nObject )->GetMarkedSdrObj(); + SdrObject* pObject = aSelection[nObject]; - pBitmapEx = new BitmapEx( SdrExchangeView::GetObjGraphic( pObject->GetModel(), pObject ).GetBitmapEx() ); + pBitmapEx = new BitmapEx(GetObjGraphic(*pObject).GetBitmapEx()); aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 ); // Time Time* pTime = new Time( aTimeField.GetTime() ); aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 ); - pPage->InsertObject( pObject->Clone(), aBmpExList.GetCurPos() + 1 ); + pPage->InsertObjectToSdrObjList(*pObject->CloneSdrObject(), aBmpExList.GetCurPos() + 1 ); aBmpExList.Next(); } - bAnimObj = sal_True; // damit nicht nochmal weitergeschaltet wird + bAnimObj = true; // damit nicht nochmal weitergeschaltet wird } else { - SdrObjGroup* pCloneGroup = new SdrObjGroup; - SdrObjList* pObjList = pCloneGroup->GetSubList(); + SdrObjGroup* pCloneGroup = new SdrObjGroup(pPage->getSdrModelFromSdrPage()); - for (sal_uLong nObject= 0; nObject < nMarkCount; nObject++) - pObjList->InsertObject(rMarkList.GetMark(nObject)->GetMarkedSdrObj()->Clone(), LIST_APPEND); + for (sal_uInt32 nObject(0); nObject < aSelection.size(); nObject++) + { + pCloneGroup->InsertObjectToSdrObjList(*aSelection[nObject]->CloneSdrObject()); + } - pPage->InsertObject(pCloneGroup, aBmpExList.GetCurPos() + 1); + pPage->InsertObjectToSdrObjList(*pCloneGroup, aBmpExList.GetCurPos() + 1); } } @@ -1082,8 +1079,6 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) aMaxSizePix.Height() = Max( aMaxSizePix.Height(), aTmpSizePix.Height() ); } - SdrPageView* pPV = rView.GetSdrPageView(); - if( aRbtBitmap.IsChecked() ) { // Bitmapgruppe erzeugen (Animated GIF) @@ -1157,18 +1152,20 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) aAnimBmp.aSizePix = aBitmapSize; aAnimBmp.nWait = nTime; aAnimBmp.eDisposal = DISPOSE_BACK; - aAnimBmp.bUserInput = sal_False; + aAnimBmp.bUserInput = false; aAnimation.Insert( aAnimBmp ); aAnimation.SetDisplaySizePixel( aMaxSizePix ); aAnimation.SetLoopCount( nLoopCount ); } - SdrGrafObj* pGrafObj = new SdrGrafObj( Graphic( aAnimation ) ); + SdrGrafObj* pGrafObj = new SdrGrafObj( + rView.getSdrModelFromSdrView(), + Graphic( aAnimation ) ); const Point aOrg( aWindowCenter.X() - ( aMaxSizeLog.Width() >> 1 ), aWindowCenter.Y() - ( aMaxSizeLog.Height() >> 1 ) ); - pGrafObj->SetLogicRect( Rectangle( aOrg, aMaxSizeLog ) ); - rView.InsertObjectAtView( pGrafObj, *pPV, SDRINSERT_SETDEFLAYER); + sdr::legacy::SetLogicRect(*pGrafObj, Rectangle( aOrg, aMaxSizeLog ) ); + rView.InsertObjectAtView( *pGrafObj, SDRINSERT_SETDEFLAYER); } else { @@ -1180,7 +1177,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) for(i = 0; i < nCount; i++) { pClone = pPage->GetObj(i); - Rectangle aRect( pClone->GetSnapRect() ); + Rectangle aRect( sdr::legacy::GetSnapRect(*pClone) ); switch( eBA ) { @@ -1229,21 +1226,19 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) // SetSnapRect ist fuer Ellipsen leider nicht implementiert !!! Point aMovePt( aWindowCenter + Point( aOffset.Width(), aOffset.Height() ) - aRect.TopLeft() ); Size aMoveSize( aMovePt.X(), aMovePt.Y() ); - pClone->NbcMove( aMoveSize ); + sdr::legacy::MoveSdrObject(*pClone, aMoveSize ); } // Animationsgruppe erzeugen - SdrObjGroup* pGroup = new SdrObjGroup; - SdrObjList* pObjList = pGroup->GetSubList(); + SdrObjGroup* pGroup = new SdrObjGroup(rView.getSdrModelFromSdrView()); for (i = 0; i < nCount; i++) { // der Clone verbleibt im Animator; in die Gruppe kommt ein Clone // des Clones pClone = pPage->GetObj(i); - SdrObject* pCloneOfClone = pClone->Clone(); - //SdrObject* pCloneOfClone = pPage->GetObj(i)->Clone(); - pObjList->InsertObject(pCloneOfClone, LIST_APPEND); + SdrObject* pCloneOfClone = pClone->CloneSdrObject(); + pGroup->InsertObjectToSdrObjList(*pCloneOfClone); } // bis jetzt liegt die linke obere Ecke der Gruppe in der Fenstermitte; @@ -1251,17 +1246,17 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) aTemp = aMaxSizeLog; aTemp.Height() = - aTemp.Height() / 2; aTemp.Width() = - aTemp.Width() / 2; - pGroup->NbcMove(aTemp); + sdr::legacy::MoveSdrObject(*pGroup, aTemp); // Animationsinformation erzeugen SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pGroup,true); pInfo->meEffect = presentation::AnimationEffect_NONE; pInfo->meSpeed = presentation::AnimationSpeed_MEDIUM; - pInfo->mbActive = sal_True; - pInfo->mbIsMovie = sal_True; + pInfo->mbActive = true; + pInfo->mbIsMovie = true; pInfo->maBlueScreen = COL_WHITE; - rView.InsertObjectAtView( pGroup, *pPV, SDRINSERT_SETDEFLAYER); + rView.InsertObjectAtView( *pGroup, SDRINSERT_SETDEFLAYER); } ClickFirstHdl( this ); @@ -1299,7 +1294,7 @@ void AnimationControllerItem::StateChanged( sal_uInt16 nSId, { if( eState >= SFX_ITEM_AVAILABLE && nSId == SID_ANIMATOR_STATE ) { - const SfxUInt16Item* pStateItem = PTR_CAST( SfxUInt16Item, pItem ); + const SfxUInt16Item* pStateItem = dynamic_cast< const SfxUInt16Item* >(pItem ); DBG_ASSERT( pStateItem, "SfxUInt16Item erwartet"); sal_uInt16 nState = pStateItem->GetValue(); diff --git a/sd/source/ui/dlg/assclass.cxx b/sd/source/ui/dlg/assclass.cxx index cc4adb4cb5fa..42f0802c4ecb 100644 --- a/sd/source/ui/dlg/assclass.cxx +++ b/sd/source/ui/dlg/assclass.cxx @@ -45,7 +45,7 @@ Assistent::Assistent(int nNoOfPages) for(sal_uInt8 i=0;i<mnPages;i++) { mpPages[i]=new List(); - mpPageStatus[i] = sal_True; + mpPageStatus[i] = true; } mnCurrentPage=1; } diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx index 7cd7b612ef7f..ee97afeb656f 100644 --- a/sd/source/ui/dlg/brkdlg.cxx +++ b/sd/source/ui/dlg/brkdlg.cxx @@ -78,7 +78,7 @@ BreakDlg::BreakDlg( pProgrInfo->Init( nSumActionCount*3, nObjCount ); pDrView = _pDrView; - bCancel = sal_False; + bCancel = false; FreeResource(); } @@ -95,7 +95,7 @@ BreakDlg::~BreakDlg() // Control-Handler fuer den Abbruch Button IMPL_LINK( BreakDlg, CancelButtonHdl, void *, EMPTYARG ) { - bCancel = sal_True; + bCancel = true; aBtnCancel.Disable(); return( 0L ); } @@ -176,7 +176,7 @@ short BreakDlg::Execute() IMPL_LINK( BreakDlg, InitialUpdate, Timer*, EMPTYARG ) { pDrView->DoImportMarkedMtf(pProgrInfo); - EndDialog(sal_True); + EndDialog(true); return 0L; } diff --git a/sd/source/ui/dlg/celltempl.cxx b/sd/source/ui/dlg/celltempl.cxx index 9405bf7c5b2e..44fa2976ee0a 100644 --- a/sd/source/ui/dlg/celltempl.cxx +++ b/sd/source/ui/dlg/celltempl.cxx @@ -52,7 +52,7 @@ \************************************************************************/ SdPresCellTemplateDlg::SdPresCellTemplateDlg( SdrModel* pModel, Window* pParent, SfxStyleSheetBase& rStyleBase ) -: SfxStyleDialog( pParent, SdResId(TAB_CELL_TEMPLATE), rStyleBase, sal_False ) +: SfxStyleDialog( pParent, SdResId(TAB_CELL_TEMPLATE), rStyleBase, false ) , mpColorTab( pModel->GetColorTable() ) , mpGradientList( pModel->GetGradientList() ) , mpHatchingList( pModel->GetHatchList() ) diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 7605f4f1ed4f..647ffbdcd2da 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -112,10 +112,10 @@ CopyDlg::CopyDlg( FieldUnit eFUnit( SfxModule::GetCurrentFieldUnit() ); - SetFieldUnit( maMtrFldMoveX, eFUnit, sal_True ); - SetFieldUnit( maMtrFldMoveY, eFUnit, sal_True ); - SetFieldUnit( maMtrFldWidth, eFUnit, sal_True ); - SetFieldUnit( maMtrFldHeight, eFUnit, sal_True ); + SetFieldUnit( maMtrFldMoveX, eFUnit, true ); + SetFieldUnit( maMtrFldMoveY, eFUnit, true ); + SetFieldUnit( maMtrFldWidth, eFUnit, true ); + SetFieldUnit( maMtrFldHeight, eFUnit, true ); Reset(0L); } @@ -167,37 +167,37 @@ IMPL_LINK( CopyDlg, Reset, void*, EMPTYARG ) if( aStr.GetTokenCount( TOKEN ) < 8 ) { - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_NUMBER, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_NUMBER, true, &pPoolItem ) ) maNumFldCopies.SetValue( ( ( const SfxUInt16Item* ) pPoolItem )->GetValue() ); else maNumFldCopies.SetValue( 1L ); long nMoveX = 500L; - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) ) nMoveX = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); SetMetricValue( maMtrFldMoveX, Fraction(nMoveX) / maUIScale, SFX_MAPUNIT_100TH_MM); long nMoveY = 500L; - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) ) nMoveY = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); SetMetricValue( maMtrFldMoveY, Fraction(nMoveY) / maUIScale, SFX_MAPUNIT_100TH_MM); - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) ) maMtrFldAngle.SetValue( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); else maMtrFldAngle.SetValue( 0L ); long nWidth = 0L; - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) ) nWidth = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); SetMetricValue( maMtrFldWidth, Fraction(nWidth) / maUIScale, SFX_MAPUNIT_100TH_MM); long nHeight = 0L; - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) ) nHeight = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); SetMetricValue( maMtrFldHeight, Fraction(nHeight) / maUIScale, SFX_MAPUNIT_100TH_MM); - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); maLbStartColor.SelectEntry( aColor ); @@ -302,16 +302,14 @@ IMPL_LINK( CopyDlg, SelectColorHdl, void *, EMPTYARG ) IMPL_LINK( CopyDlg, SetViewData, void*, EMPTYARG ) { - Rectangle aRect = mpView->GetAllMarkedRect(); + const basegfx::B2DRange aAllRange(mpView->getMarkedObjectSnapRange()); - SetMetricValue( maMtrFldMoveX, Fraction( aRect.GetWidth() ) / - maUIScale, SFX_MAPUNIT_100TH_MM); - SetMetricValue( maMtrFldMoveY, Fraction( aRect.GetHeight() ) / - maUIScale, SFX_MAPUNIT_100TH_MM); + SetMetricValue(maMtrFldMoveX, Fraction(aAllRange.getWidth() / double(maUIScale)), SFX_MAPUNIT_100TH_MM); + SetMetricValue(maMtrFldMoveY, Fraction(aAllRange.getHeight() / double(maUIScale)), SFX_MAPUNIT_100TH_MM); // Farb-Attribut setzen const SfxPoolItem* pPoolItem = NULL; - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); maLbStartColor.SelectEntry( aColor ); @@ -339,7 +337,7 @@ IMPL_LINK( CopyDlg, SetDefault, void*, EMPTYARG ) // Farb-Attribut setzen const SfxPoolItem* pPoolItem = NULL; - if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) ) + if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); maLbStartColor.SelectEntry( aColor ); diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 2c1bd1c17950..684fdf52068b 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -66,7 +66,7 @@ SdCustomShowDlg::SdCustomShowDlg( Window* pWindow, rDoc ( rDrawDoc ), pCustomShowList ( NULL ), pCustomShow ( NULL ), - bModified ( sal_False ) + bModified ( false ) { FreeResource(); @@ -115,7 +115,7 @@ void SdCustomShowDlg::CheckState() { sal_uInt16 nPos = aLbCustomShows.GetSelectEntryPos(); - sal_Bool bEnable = nPos != LISTBOX_ENTRY_NOTFOUND; + bool bEnable = nPos != LISTBOX_ENTRY_NOTFOUND; aBtnEdit.Enable( bEnable ); aBtnRemove.Enable( bEnable ); aBtnCopy.Enable( bEnable ); @@ -141,7 +141,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) if( pCustomShow ) { if( !pCustomShowList ) - pCustomShowList = rDoc.GetCustomShowList( sal_True ); + pCustomShowList = rDoc.GetCustomShowList( true ); pCustomShowList->Insert( pCustomShow, LIST_APPEND ); pCustomShowList->Last(); @@ -150,7 +150,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) } if( aDlg.IsModified() ) - bModified = sal_True; + bModified = true; } else if( pCustomShow ) DELETEZ( pCustomShow ); @@ -176,7 +176,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) aLbCustomShows.SelectEntryPos( nPos ); } if( aDlg.IsModified() ) - bModified = sal_True; + bModified = true; } } } @@ -189,7 +189,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) delete (SdCustomShow*) pCustomShowList->Remove( nPos ); aLbCustomShows.RemoveEntry( nPos ); aLbCustomShows.SelectEntryPos( nPos == 0 ? nPos : nPos - 1 ); - bModified = sal_True; + bModified = true; } } // CustomShow kopieren @@ -221,17 +221,17 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) } // Name ueberpruefen... - sal_Bool bDifferent = sal_False; + bool bDifferent = false; //long nPosToSelect = pCustomShowList->GetCurPos(); while( !bDifferent ) { - bDifferent = sal_True; + bDifferent = true; for( pCustomShow = (SdCustomShow*) pCustomShowList->First(); pCustomShow != NULL && bDifferent; pCustomShow = (SdCustomShow*) pCustomShowList->Next() ) { if( aStr == pCustomShow->GetName() ) - bDifferent = sal_False; + bDifferent = false; } if( !bDifferent ) { @@ -253,7 +253,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) aLbCustomShows.SelectEntry( pShow->GetName() ); - bModified = sal_True; + bModified = true; } } else if( p == &aLbCustomShows ) @@ -262,11 +262,11 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) if( nPos != LISTBOX_ENTRY_NOTFOUND ) pCustomShowList->Seek( nPos ); - bModified = sal_True; + bModified = true; } else if( p == &aCbxUseCustomShow ) { - bModified = sal_True; + bModified = true; } CheckState(); @@ -287,7 +287,7 @@ IMPL_LINK( SdCustomShowDlg, StartShowHdl, Button *, EMPTYARG ) /************************************************************************* |* CheckState \************************************************************************/ -sal_Bool SdCustomShowDlg::IsCustomShow() const +bool SdCustomShowDlg::IsCustomShow() const { return( aCbxUseCustomShow.IsEnabled() && aCbxUseCustomShow.IsChecked() ); } @@ -322,7 +322,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( Window* pWindow, rDoc ( rDrawDoc ), rpCustomShow ( rpCS ), - bModified ( sal_False ) + bModified ( false ) { FreeResource(); @@ -337,11 +337,11 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( Window* pWindow, SdPage* pPage; // Listbox mit Seitennamen des Docs fuellen - for( long nPage = 0L; + for( sal_uInt32 nPage = 0; nPage < rDoc.GetSdPageCount( PK_STANDARD ); nPage++ ) { - pPage = rDoc.GetSdPage( (sal_uInt16) nPage, PK_STANDARD ); + pPage = rDoc.GetSdPage( nPage, PK_STANDARD ); String aStr( pPage->GetName() ); aLbPages.InsertEntry( aStr ); } @@ -372,7 +372,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( Window* pWindow, aLbCustomPages.SetDragDropMode( SV_DRAGDROP_CTRL_MOVE ); aLbCustomPages.SetHighlightRange(); - aBtnOK.Enable( sal_False ); + aBtnOK.Enable( false ); CheckState(); } @@ -390,10 +390,10 @@ SdDefineCustomShowDlg::~SdDefineCustomShowDlg() \************************************************************************/ void SdDefineCustomShowDlg::CheckState() { - sal_Bool bPages = aLbPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND; - //sal_Bool bCSPages = aLbCustomPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND; - sal_Bool bCSPages = aLbCustomPages.FirstSelected() != NULL; - sal_Bool bCount = aLbCustomPages.GetEntryCount() > 0; + bool bPages = aLbPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND; + //bool bCSPages = aLbCustomPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND; + bool bCSPages = aLbCustomPages.FirstSelected() != NULL; + bool bCount = aLbCustomPages.GetEntryCount() > 0; aBtnOK.Enable( bCount ); aBtnAdd.Enable( bPages ); @@ -419,17 +419,17 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p ) { String aStr = aLbPages.GetSelectEntry( i ); pEntry = aLbCustomPages.InsertEntry( aStr, - 0, sal_False, nPosCP ); + 0, false, nPosCP ); aLbCustomPages.Select( pEntry ); - SdPage* pPage = rDoc.GetSdPage( (sal_uInt16) aLbPages. + SdPage* pPage = rDoc.GetSdPage( aLbPages. GetSelectEntryPos( i ), PK_STANDARD ); pEntry->SetUserData( pPage ); if( nPosCP != LIST_APPEND ) nPosCP++; } - bModified = sal_True; + bModified = true; } } else if( p == &aBtnRemove ) @@ -443,14 +443,14 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p ) //aLbCustomPages.RemoveEntry( nPos ); aLbCustomPages.GetModel()->Remove( aLbCustomPages.GetModel()->GetEntryAtAbsPos( nPos ) ); - bModified = sal_True; + bModified = true; } } else if( p == &aEdtName ) { //rpCustomShow->SetName( aEdtName.GetText() ); - bModified = sal_True; + bModified = true; } CheckState(); @@ -465,7 +465,7 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p ) \************************************************************************/ void SdDefineCustomShowDlg::CheckCustomShow() { - sal_Bool bDifferent = sal_False; + bool bDifferent = false; SdPage* pPage = NULL; SvLBoxEntry* pEntry = NULL; @@ -473,7 +473,7 @@ void SdDefineCustomShowDlg::CheckCustomShow() if( rpCustomShow->Count() != aLbCustomPages.GetEntryCount() ) { rpCustomShow->Clear(); - bDifferent = sal_True; + bDifferent = true; } // Seiten-Pointer vergleichen @@ -486,7 +486,7 @@ void SdDefineCustomShowDlg::CheckCustomShow() if( pPage != pEntry->GetUserData() ) { rpCustomShow->Clear(); - bDifferent = sal_True; + bDifferent = true; } } } @@ -501,7 +501,7 @@ void SdDefineCustomShowDlg::CheckCustomShow() pPage = (SdPage*) pEntry->GetUserData(); rpCustomShow->Insert( pPage, LIST_APPEND ); } - bModified = sal_True; + bModified = true; } // Name vergleichen und ggfs. setzen @@ -509,7 +509,7 @@ void SdDefineCustomShowDlg::CheckCustomShow() if( rpCustomShow->GetName() != aStr ) { rpCustomShow->SetName( aStr ); - bModified = sal_True; + bModified = true; } } @@ -519,7 +519,7 @@ void SdDefineCustomShowDlg::CheckCustomShow() IMPL_LINK( SdDefineCustomShowDlg, OKHdl, Button *, EMPTYARG ) { // Name ueberpruefen... - sal_Bool bDifferent = sal_True; + bool bDifferent = true; List* pCustomShowList = rDoc.GetCustomShowList(); if( pCustomShowList ) { @@ -532,7 +532,7 @@ IMPL_LINK( SdDefineCustomShowDlg, OKHdl, Button *, EMPTYARG ) pCustomShow = (SdCustomShow*) pCustomShowList->Next() ) { if( aName == pCustomShow->GetName() && aName != aOldName ) - bDifferent = sal_False; + bDifferent = false; } pCustomShowList->Seek( nPosToSelect ); } diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 81904ff0b25e..5abdef6643ea 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -149,7 +149,7 @@ private: class AssistentDlgImpl : public SfxListener { public: - AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot ); + AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, bool bAutoPilot ); ~AssistentDlgImpl(); /// Local mutex used to serialize concurrent method calls. @@ -164,10 +164,10 @@ public: files and insert them into a listbox. */ void ScanDocmenu (void); - /** Flag that is set to sal_True after the recently used files have been + /** Flag that is set to true after the recently used files have been scanned. */ - sal_Bool mbRecentDocumentsReady; + bool mbRecentDocumentsReady; /** When the list of templates has not been scanned already this is done when this method is called. That includes requesting the whole list @@ -180,7 +180,7 @@ public: /** This method transfers the template folders from the template scanner to the internal structures of this class. On termination it sets - the flag <member>mbTemplatesReady</member> to <TRUE/> to indicate + the flag <member>mbTemplatesReady</member> to <true/> to indicate that the templates are available. @param rTemplateFolders This is a list of template folders. This method takes ownership @@ -189,16 +189,16 @@ public: */ void TemplateScanDone (std::vector<TemplateDir*>& rTemplateFolders); - /** Flag that is set to sal_True after the impress templates have been + /** Flag that is set to true after the impress templates have been scanned. */ - sal_Bool mbTemplatesReady; + bool mbTemplatesReady; /** Flag used to prevent nested or concurrent calls to the - <member>UpdatePreview</memember> method. A <TRUE/> value indicates + <member>UpdatePreview</memember> method. A <true/> value indicates that a preview update is currently active. */ - sal_Bool mbPreviewUpdating; + bool mbPreviewUpdating; ::Window* mpWindow; @@ -228,7 +228,7 @@ public: TemplateDir* mpLayoutRegion; // preview - sal_Bool mbUserDataDirty; + bool mbUserDataDirty; Timer maPrevTimer; Timer maEffectPrevTimer; Timer maUpdatePageListTimer; @@ -238,19 +238,19 @@ public: ::std::auto_ptr<WindowUpdater> mpWindowUpdater; - sal_Bool mbPreview; - sal_uInt16 mnShowPage; - sal_Bool mbDocPreview; + bool mbPreview; + sal_uInt32 mnShowPage; + bool mbDocPreview; sal_uLong mnTemplate; String maPageListFile; - void UpdatePreview( sal_Bool bDocPreview ); + void UpdatePreview( bool bDocPreview ); void UpdatePageList(); void UpdateUserData(); - sal_Bool IsOwnFormat( const String& rPath ); + bool IsOwnFormat( const String& rPath ); // dlg status void EndDialog( long nResult = 0 ); @@ -361,15 +361,15 @@ public: // ==================================================================== -AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot ) : +AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, bool bAutoPilot ) : mpTemplateRegion(NULL), mpLayoutRegion(NULL), - mbUserDataDirty(sal_False), + mbUserDataDirty(false), xDocShell (NULL), mpWindowUpdater (new WindowUpdater()), - mbPreview(sal_True), + mbPreview(true), mnShowPage(0), - mbDocPreview(sal_False), + mbDocPreview(false), maAssistentFunc(5), maPreviewFlag(pWindow,SdResId(CB_PREVIEW)), maStartWithFlag(pWindow,SdResId(CB_STARTWITH)), @@ -383,9 +383,9 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, maOpenStr(SdResId(STR_OPEN)) { maPageListFile += sal_Unicode('?'), - mbRecentDocumentsReady = sal_False; - mbTemplatesReady = sal_False; - mbPreviewUpdating = sal_False; + mbRecentDocumentsReady = false; + mbTemplatesReady = false; + mbPreviewUpdating = false; mpWindow = pWindow; @@ -444,8 +444,8 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, mpPage1OpenPB->SetModeImage( GetUiIconForCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open"))), BMP_COLOR_NORMAL); - mpPage1OpenPB->EnableImageDisplay(sal_True); - mpPage1OpenPB->EnableTextDisplay(sal_True); + mpPage1OpenPB->EnableImageDisplay(true); + mpPage1OpenPB->EnableTextDisplay(true); mpPage1OpenPB->SetImageAlign(IMAGEALIGN_LEFT); mpPage1OpenPB->SetStyle(mpPage1OpenPB->GetStyle() | WB_CENTER); } @@ -626,7 +626,7 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, mpWindowUpdater->RegisterWindow (&maPreview); - UpdatePreview( sal_True ); + UpdatePreview( true ); //check wether we should start with a template document initialy and preselect it const ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ); @@ -848,10 +848,10 @@ void AssistentDlgImpl::ScanDocmenu (void) } } } - mbRecentDocumentsReady = sal_True; + mbRecentDocumentsReady = true; try { - UpdatePreview(sal_True); + UpdatePreview(true); } catch (uno::RuntimeException& ) { @@ -871,7 +871,7 @@ void AssistentDlgImpl::ProvideTemplates (void) try { - UpdatePreview(sal_True); + UpdatePreview(true); } catch (uno::RuntimeException& e) { @@ -943,7 +943,7 @@ void AssistentDlgImpl::TemplateScanDone ( SelectLayoutRegion (mpPage2RegionLB->GetSelectEntry()); // Make the changes visible. - mbTemplatesReady = sal_True; + mbTemplatesReady = true; if (mpWindow) UpdatePage(); } @@ -1040,18 +1040,17 @@ String AssistentDlgImpl::GetLayoutFileName() SfxObjectShellLock AssistentDlgImpl::GetDocument() { -// mbPreview = sal_False; // Document nicht anzeigen - UpdatePreview(sal_False); // aber komplett laden + UpdatePreview(false); // aber komplett laden UpdatePageList(); SfxObjectShell* pShell = xDocShell; - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,pShell); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(pShell); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; if(pDoc) { - const sal_uInt16 nPageCount = pDoc->GetSdPageCount(PK_STANDARD); - sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); + const sal_uInt32 nPageCount = pDoc->GetSdPageCount(PK_STANDARD); + bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); sal_uInt32 nNewTime = (sal_uInt32)mpPage3PresTimeTMF->GetTime().GetMSFromTime() / 1000; if(bKiosk) { @@ -1061,8 +1060,8 @@ SfxObjectShellLock AssistentDlgImpl::GetDocument() rSettings.mbShowPauseLogo = mpPage3LogoCB->IsChecked(); } - sal_uInt16 nPgAbsNum = 0; - sal_uInt16 nPgRelNum = 0; + sal_uInt32 nPgAbsNum = 0; + sal_uInt32 nPgRelNum = 0; while( nPgAbsNum < nPageCount ) { SdPage* pPage = pDoc->GetSdPage( nPgRelNum, PK_STANDARD ); @@ -1139,7 +1138,7 @@ void AssistentDlgImpl::UpdatePage() { // Elemente auf der ersten Seite abhaengig vom Starttype Zeigen SetStartType( GetStartType() ); - mpPage1TemplateRB->Enable(sal_True /*mbTemplatesReady*/); + mpPage1TemplateRB->Enable(true /*mbTemplatesReady*/); break; } @@ -1150,11 +1149,11 @@ void AssistentDlgImpl::UpdatePage() if( GetStartType() != ST_EMPTY ) { - mpPage2Medium5RB->Enable( sal_True ); + mpPage2Medium5RB->Enable( true ); } else { - mpPage2Medium5RB->Enable( sal_False ); + mpPage2Medium5RB->Enable( false ); if(mpPage2Medium5RB->IsChecked()) mpPage2Medium1RB->Check(); } @@ -1175,7 +1174,7 @@ void AssistentDlgImpl::UpdatePage() if(GetStartType() != ST_TEMPLATE) maNextPageButton.Enable(false); - sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); + bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); mpPage3PresTimeFT->Enable(bKiosk); mpPage3BreakFT->Enable(bKiosk); mpPage3PresTimeTMF->Enable(bKiosk); @@ -1243,10 +1242,10 @@ IMPL_LINK( AssistentDlgImpl, EffectPreviewHdl, Button *, EMPTYARG ) IMPL_LINK( AssistentDlgImpl, PreviewFlagHdl, CheckBox *, EMPTYARG ) { - if( maPreviewFlag.IsChecked() != mbPreview ) + if( (bool)maPreviewFlag.IsChecked() != mbPreview ) { mbPreview = maPreviewFlag.IsChecked(); - UpdatePreview(sal_True); + UpdatePreview(true); } return 0; } @@ -1275,11 +1274,11 @@ IMPL_LINK( AssistentDlgImpl, SelectFileHdl, ListBox *, EMPTYARG ) IMPL_LINK( AssistentDlgImpl, PageSelectHdl, Control *, EMPTYARG ) { - sal_uInt16 nPage = mpPage5PageListCT->GetSelectedPage(); + sal_uInt32 nPage = mpPage5PageListCT->GetSelectedPage(); if( mnShowPage != nPage ) { mnShowPage = nPage; - UpdatePreview(sal_False); + UpdatePreview(false); } return 0; @@ -1293,7 +1292,7 @@ IMPL_LINK( AssistentDlgImpl, UpdatePageListHdl, void *, EMPTYARG ) IMPL_LINK( AssistentDlgImpl, UpdatePreviewHdl, void *, EMPTYARG ) { - UpdatePreview( sal_True ); + UpdatePreview( true ); return 0; } @@ -1350,7 +1349,7 @@ IMPL_LINK( AssistentDlgImpl, PresTypeHdl, RadioButton*, EMPTYARG ) maNextPageButton.Enable(false); } - sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); + bool bKiosk = mpPage3PresTypeKioskRB->IsChecked(); mpPage3PresTimeFT->Enable(bKiosk); mpPage3BreakFT->Enable(bKiosk); mpPage3PresTimeTMF->Enable(bKiosk); @@ -1361,7 +1360,7 @@ IMPL_LINK( AssistentDlgImpl, PresTypeHdl, RadioButton*, EMPTYARG ) IMPL_LINK( AssistentDlgImpl, UpdateUserDataHdl, Edit*, EMPTYARG ) { - mbUserDataDirty = sal_True; + mbUserDataDirty = true; String aTopic = mpPage4AskTopicEDT->GetText(); String aName = mpPage4AskNameEDT->GetText(); String aInfo = mpPage4AskInfoEDT->GetText(); @@ -1427,14 +1426,14 @@ void AssistentDlgImpl::UpdateUserData() String aInfo = mpPage4AskInfoEDT->GetText(); SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; SdPage* pPage = pDoc?pDoc->GetSdPage(0, PK_STANDARD):NULL; if(pPage && ( aTopic.Len() != 0 || aName.Len() != 0 || aInfo.Len() != 0 ) ) { if( pPage->GetAutoLayout() == AUTOLAYOUT_NONE ) - pPage->SetAutoLayout(AUTOLAYOUT_TITLE, sal_True); + pPage->SetAutoLayout(AUTOLAYOUT_TITLE, true); SdrTextObj* pObj; String aEmptyString; @@ -1445,8 +1444,8 @@ void AssistentDlgImpl::UpdateUserData() if( pObj ) { pPage->SetObjText( pObj, NULL, PRESOBJ_TITLE, aTopic ); - pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ), sal_True ); - pObj->SetEmptyPresObj(sal_False); + pObj->SetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ), true ); + pObj->SetEmptyPresObj(false); } } @@ -1462,8 +1461,8 @@ void AssistentDlgImpl::UpdateUserData() if( pObj ) { pPage->SetObjText( pObj, NULL, PRESOBJ_OUTLINE, aStrTmp ); - pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE ), sal_True ); - pObj->SetEmptyPresObj(sal_False); + pObj->SetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE ), true ); + pObj->SetEmptyPresObj(false); } else { @@ -1471,27 +1470,27 @@ void AssistentDlgImpl::UpdateUserData() if( pObj ) { pPage->SetObjText( pObj, NULL, PRESOBJ_TEXT, aStrTmp ); - pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TEXT ), sal_True ); - pObj->SetEmptyPresObj(sal_False); + pObj->SetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TEXT ), true ); + pObj->SetEmptyPresObj(false); } } } } - mbUserDataDirty = sal_False; + mbUserDataDirty = false; } void AssistentDlgImpl::UpdatePageList() { if(mbDocPreview || !mbPreview) - UpdatePreview(sal_False); + UpdatePreview(false); else if(maPageListFile == maDocFile) return; maPageListFile = maDocFile; SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; mpPage5PageListCT->Clear(); @@ -1500,20 +1499,20 @@ void AssistentDlgImpl::UpdatePageList() mpPage5PageListCT->Fill(pDoc); } -void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) +void AssistentDlgImpl::UpdatePreview( bool bDocPreview ) { // Guard against multiple concurrent execution to this method caused either // by calls from different threads or recursion. ::osl::MutexGuard aGuard (maMutex); if (mbPreviewUpdating) return; - mbPreviewUpdating = sal_True; + mbPreviewUpdating = true; if(!mbPreview && bDocPreview) { maPreview.Invalidate(); maPreview.SetObjectShell(0); - mbPreviewUpdating = sal_False; + mbPreviewUpdating = false; return; } @@ -1523,7 +1522,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) SfxApplication *pSfxApp = SFX_APP(); sal_uLong lErr; - sal_Bool bChangeMaster = aLayoutFile.Len() != 0; + bool bChangeMaster = aLayoutFile.Len() != 0; if( aDocFile.Len() == 0 ) { @@ -1533,15 +1532,15 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) CloseDocShell(); DrawDocShell* pNewDocSh; - xDocShell = pNewDocSh = new DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_False); + xDocShell = pNewDocSh = new DrawDocShell(SFX_CREATE_MODE_STANDARD, false); pNewDocSh->DoInitNew(NULL); SdDrawDocument* pDoc = pNewDocSh->GetDoc(); pDoc->CreateFirstPages(); pDoc->StopWorkStartupDelay(); - mbDocPreview = sal_False; + mbDocPreview = false; maDocFile = aDocFile; - mbUserDataDirty = sal_True; + mbUserDataDirty = true; } else bChangeMaster = (aLayoutFile.Len() != 0) && (maLayoutFile != aLayoutFile); @@ -1551,14 +1550,14 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) if( aLayoutFile != maLayoutFile ) { SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell); ::svl::IUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL; if(pUndoMgr) pUndoMgr->Undo(); - mbUserDataDirty = sal_True; + mbUserDataDirty = true; } else - bChangeMaster = sal_False; + bChangeMaster = false; } else { @@ -1572,11 +1571,11 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) SfxItemSet* pSet = new SfxAllItemSet( pSfxApp->GetPool() ); if(IsOwnFormat(aDocFile)) { - pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) ); + pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) ); if(bDocPreview) - pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) ); + pSet->Put( SfxBoolItem( SID_PREVIEW, true ) ); RestorePassword( pSet, aDocFile ); - if( (lErr = pSfxApp->LoadTemplate( xDocShell, aDocFile, sal_True, pSet )) != 0 ) + if( (lErr = pSfxApp->LoadTemplate( xDocShell, aDocFile, true, pSet )) != 0 ) ErrorHandler::HandleError(lErr); else SavePassword( xDocShell, aDocFile ); @@ -1589,10 +1588,10 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aDocFile )); aReq.AppendItem( SfxStringItem( SID_REFERER, aEmptyStr ) ); aReq.AppendItem( SfxStringItem( SID_TARGETNAME, aTargetStr ) ); - aReq.AppendItem( SfxBoolItem( SID_HIDDEN, sal_True ) ); + aReq.AppendItem( SfxBoolItem( SID_HIDDEN, true ) ); aReq.AppendItem( SfxBoolItem( SID_PREVIEW, bDocPreview ) ); - const SfxViewFrameItem* pRet = PTR_CAST( SfxViewFrameItem, SFX_APP()->ExecuteSlot( aReq ) ); + const SfxViewFrameItem* pRet = dynamic_cast< const SfxViewFrameItem* >(SFX_APP()->ExecuteSlot( aReq ) ); if ( pRet && pRet->GetFrame() && pRet->GetFrame()->GetObjectShell() ) xDocShell = pRet->GetFrame()->GetObjectShell(); @@ -1604,7 +1603,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) mnShowPage = 0; mbDocPreview = bDocPreview; maDocFile = aDocFile; - mbUserDataDirty = sal_True; + mbUserDataDirty = true; } if(bChangeMaster && (aLayoutFile != maDocFile)) @@ -1619,11 +1618,11 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) if(IsOwnFormat(aLayoutFile)) { - pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) ); - pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) ); + pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) ); + pSet->Put( SfxBoolItem( SID_PREVIEW, true ) ); RestorePassword( pSet, aLayoutFile ); - if( (lErr = pSfxApp->LoadTemplate( xLayoutDocShell, aLayoutFile, sal_True, pSet )) != 0 ) + if( (lErr = pSfxApp->LoadTemplate( xLayoutDocShell, aLayoutFile, true, pSet )) != 0 ) ErrorHandler::HandleError(lErr); SavePassword( xLayoutDocShell, aLayoutFile ); } @@ -1632,23 +1631,23 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) // die Implementierung ermitteln SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; pShell = xLayoutDocShell; - pDocShell = PTR_CAST(DrawDocShell,pShell); + pDocShell = dynamic_cast< DrawDocShell* >(pShell); SdDrawDocument* pLayoutDoc = pDocShell?pDocShell->GetDoc():NULL; if( pDoc && pLayoutDoc ) { - pDoc->SetMasterPage(0, aEmptyStr, pLayoutDoc, sal_True, sal_False ); + pDoc->SetMasterPage(0, aEmptyStr, pLayoutDoc, true, false); } else { DBG_ERROR("sd::AssistentDlgImpl::UpdatePreview(), no document for preview?"); } - mbUserDataDirty = sal_True; + mbUserDataDirty = true; } maLayoutFile = aLayoutFile; @@ -1662,7 +1661,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview ) maPreview.SetObjectShell( xDocShell, mnShowPage ); } - mbPreviewUpdating = sal_False; + mbPreviewUpdating = false; } void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPath ) @@ -1674,7 +1673,7 @@ void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPat { SfxItemSet * pSet = pMedium->GetItemSet(); const SfxPoolItem *pItem = 0; - if( pSet->GetItemState(SID_PASSWORD, sal_True, &pItem) == SFX_ITEM_SET ) + if( pSet->GetItemState(SID_PASSWORD, true, &pItem) == SFX_ITEM_SET ) { //TODO/MBA: testing String aPass( ((const SfxStringItem*)pItem)->GetValue()); @@ -1737,7 +1736,7 @@ void AssistentDlgImpl::DeletePassords() } } -sal_Bool AssistentDlgImpl::IsOwnFormat( const String& rPath ) +bool AssistentDlgImpl::IsOwnFormat( const String& rPath ) { INetURLObject aURL( rPath ); String aExt( aURL.GetFileExtension() ); @@ -1869,7 +1868,7 @@ Image AssistentDlgImpl::GetUiIconForCommand (const ::rtl::OUString& sCommandURL) ////////////////////////////////////////////// -AssistentDlg::AssistentDlg(Window* pParent, sal_Bool bAutoPilot) : +AssistentDlg::AssistentDlg(Window* pParent, bool bAutoPilot) : ModalDialog(pParent,SdResId(DLG_ASS)) { Link aFinishLink = LINK(this,AssistentDlg, FinishHdl); @@ -1940,7 +1939,7 @@ OutputType AssistentDlg::GetOutputMedium() const return OUTPUT_ORIGINAL; } -sal_Bool AssistentDlg::IsSummary() const +bool AssistentDlg::IsSummary() const { return mpImpl->mpPage5SummaryCB->IsChecked(); } @@ -1955,12 +1954,12 @@ String AssistentDlg::GetDocPath() const return mpImpl->GetDocFileName(); } -sal_Bool AssistentDlg::GetStartWithFlag() const +bool AssistentDlg::GetStartWithFlag() const { return !mpImpl->maStartWithFlag.IsChecked(); } -sal_Bool AssistentDlg::IsDocEmpty() const +bool AssistentDlg::IsDocEmpty() const { return mpImpl->GetDocFileName().Len() == 0 && mpImpl->GetLayoutFileName().Len() == 0; diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx index 95bcc29faf72..b881977d9ee1 100644 --- a/sd/source/ui/dlg/dlgassim.cxx +++ b/sd/source/ui/dlg/dlgassim.cxx @@ -169,10 +169,10 @@ void SdPageListControl::Fill( SdDrawDocument* pDoc ) pOutliner->Clear(); } -sal_uInt16 SdPageListControl::GetSelectedPage() +sal_uInt32 SdPageListControl::GetSelectedPage() { SvLBoxEntry* pSelEntry = GetCurEntry(); - sal_uInt16 nPage = 0; + sal_uInt32 nPage = 0; if ( pSelEntry ) { @@ -192,10 +192,10 @@ sal_uInt16 SdPageListControl::GetSelectedPage() return nPage; } -sal_Bool SdPageListControl::IsPageChecked( sal_uInt16 nPage ) +bool SdPageListControl::IsPageChecked( sal_uInt32 nPage ) { SvLBoxEntry* pEntry = GetModel()->GetEntry(nPage); - return pEntry?(sal_Bool)(GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED): sal_False; + return pEntry ? (GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED) : false; } void SdPageListControl::DataChanged( const DataChangedEvent& rDCEvt ) diff --git a/sd/source/ui/dlg/dlgassim.hxx b/sd/source/ui/dlg/dlgassim.hxx index 49e90d4a7770..f205b591427e 100644 --- a/sd/source/ui/dlg/dlgassim.hxx +++ b/sd/source/ui/dlg/dlgassim.hxx @@ -43,8 +43,8 @@ public: void Fill( SdDrawDocument* pDoc ); void Clear(); - sal_uInt16 GetSelectedPage(); - sal_Bool IsPageChecked( sal_uInt16 nPage ); + sal_uInt32 GetSelectedPage(); + bool IsPageChecked( sal_uInt32 nPage ); DECL_LINK( CheckButtonClickHdl, SvLBoxButtonData * ); diff --git a/sd/source/ui/dlg/dlgctrls.cxx b/sd/source/ui/dlg/dlgctrls.cxx index 84af83ff748d..181d07c24bfc 100644 --- a/sd/source/ui/dlg/dlgctrls.cxx +++ b/sd/source/ui/dlg/dlgctrls.cxx @@ -77,24 +77,6 @@ void FadeEffectLB::Fill() // ----------------------------------------------------------------------------- -/* -void FadeEffectLB::SelectEffect( presentation::FadeEffect eFE ) -{ - sal_Bool bFound = sal_False; - - for( long i = 0, nCount = sizeof( aEffects ) / sizeof( FadeEffectPair ); ( i < nCount ) && !bFound; i++ ) - { - if( aEffects[ i ].meFE == eFE ) - { - SelectEntryPos( (sal_uInt16) i ); - bFound = sal_True; - } - } -} -*/ - -// ----------------------------------------------------------------------------- - void FadeEffectLB::applySelected( SdPage* pSlide ) const { const sal_uInt16 nPos = GetSelectEntryPos(); diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index 126b3ef0bcfd..a03684d4b663 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -92,9 +92,10 @@ SvxFieldData* SdModifyFieldDlg::GetField() aRbtVar.IsChecked() != aRbtVar.GetSavedValue() || aLbFormat.GetSelectEntryPos() != aLbFormat.GetSavedValue() ) { - if( pField->ISA( SvxDateField ) ) + const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField); + + if( pDateField ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; SvxDateType eType; SvxDateFormat eFormat; @@ -109,71 +110,84 @@ SvxFieldData* SdModifyFieldDlg::GetField() ( (SvxDateField*) pNewField )->SetType( eType ); ( (SvxDateField*) pNewField )->SetFormat( eFormat ); } - else if( pField->ISA( SvxExtTimeField ) ) + else { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; - SvxTimeType eType; - SvxTimeFormat eFormat; + const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField); - if( aRbtFix.IsChecked() ) - eType = SVXTIMETYPE_FIX; - else - eType = SVXTIMETYPE_VAR; + if( pTimeField ) + { + SvxTimeType eType; + SvxTimeFormat eFormat; - eFormat = (SvxTimeFormat) ( aLbFormat.GetSelectEntryPos() + 2 ); + if( aRbtFix.IsChecked() ) + eType = SVXTIMETYPE_FIX; + else + eType = SVXTIMETYPE_VAR; - pNewField = new SvxExtTimeField( *pTimeField ); - ( (SvxExtTimeField*) pNewField )->SetType( eType ); - ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat ); - } - else if( pField->ISA( SvxExtFileField ) ) - { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; - SvxFileType eType; - SvxFileFormat eFormat; + eFormat = (SvxTimeFormat) ( aLbFormat.GetSelectEntryPos() + 2 ); - if( aRbtFix.IsChecked() ) - eType = SVXFILETYPE_FIX; + pNewField = new SvxExtTimeField( *pTimeField ); + ( (SvxExtTimeField*) pNewField )->SetType( eType ); + ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat ); + } else - eType = SVXFILETYPE_VAR; - - eFormat = (SvxFileFormat) ( aLbFormat.GetSelectEntryPos() ); - - ::sd::DrawDocShell* pDocSh = PTR_CAST( ::sd::DrawDocShell, - SfxObjectShell::Current() ); - - if( pDocSh ) { - SvxExtFileField aFileField( *pFileField ); - - String aName; - if( pDocSh->HasName() ) - aName = pDocSh->GetMedium()->GetName(); - - // #91225# Get current filename, not the one stored in the old field - pNewField = new SvxExtFileField( aName ); - ( (SvxExtFileField*) pNewField )->SetType( eType ); - ( (SvxExtFileField*) pNewField )->SetFormat( eFormat ); + const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField); + + if( pFileField ) + { + SvxFileType eType; + SvxFileFormat eFormat; + + if( aRbtFix.IsChecked() ) + eType = SVXFILETYPE_FIX; + else + eType = SVXFILETYPE_VAR; + + eFormat = (SvxFileFormat) ( aLbFormat.GetSelectEntryPos() ); + + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() ); + + if( pDocSh ) + { + SvxExtFileField aFileField( *pFileField ); + + String aName; + if( pDocSh->HasName() ) + aName = pDocSh->GetMedium()->GetName(); + + // #91225# Get current filename, not the one stored in the old field + pNewField = new SvxExtFileField( aName ); + ( (SvxExtFileField*) pNewField )->SetType( eType ); + ( (SvxExtFileField*) pNewField )->SetFormat( eFormat ); + } + } + else + { + const SvxAuthorField* pSvxAuthorField = dynamic_cast< const SvxAuthorField* >(pField); + + if( pSvxAuthorField ) + { + SvxAuthorType eType; + SvxAuthorFormat eFormat; + + if( aRbtFix.IsChecked() ) + eType = SVXAUTHORTYPE_FIX; + else + eType = SVXAUTHORTYPE_VAR; + + eFormat = (SvxAuthorFormat) ( aLbFormat.GetSelectEntryPos() ); + + // #91225# Get current state of address, not the old one + SvtUserOptions aUserOptions; + SvxAuthorField* pNewAuthorField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() ); + pNewAuthorField->SetType( eType ); + pNewAuthorField->SetFormat( eFormat ); + pNewField = pNewAuthorField; + } + } } } - else if( pField->ISA( SvxAuthorField ) ) - { - SvxAuthorType eType; - SvxAuthorFormat eFormat; - - if( aRbtFix.IsChecked() ) - eType = SVXAUTHORTYPE_FIX; - else - eType = SVXAUTHORTYPE_VAR; - - eFormat = (SvxAuthorFormat) ( aLbFormat.GetSelectEntryPos() ); - - // #91225# Get current state of address, not the old one - SvtUserOptions aUserOptions; - pNewField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() ); - ( (SvxAuthorField*) pNewField )->SetType( eType ); - ( (SvxAuthorField*) pNewField )->SetFormat( eFormat ); - } } return( pNewField ); @@ -191,9 +205,10 @@ void SdModifyFieldDlg::FillFormatList() aLbFormat.Clear(); - if( pField->ISA( SvxDateField ) ) + const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField); + + if( pDateField ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; SvxDateField aDateField( *pDateField ); //SVXDATEFORMAT_APPDEFAULT, // Wird nicht benutzt @@ -217,71 +232,82 @@ void SdModifyFieldDlg::FillFormatList() aLbFormat.SelectEntryPos( (sal_uInt16) ( pDateField->GetFormat() - 2 ) ); } - else if( pField->ISA( SvxExtTimeField ) ) + else { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; - SvxExtTimeField aTimeField( *pTimeField ); + const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField); - //SVXTIMEFORMAT_APPDEFAULT, // Wird nicht benutzt - //SVXTIMEFORMAT_SYSTEM, // Wird nicht benutzt - aLbFormat.InsertEntry( String( SdResId( STR_STANDARD_NORMAL ) ) ); - - SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); - aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49 - aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); - aTimeField.SetFormat( SVXTIMEFORMAT_24_HMS ); // 13:49:38 - aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); - aTimeField.SetFormat( SVXTIMEFORMAT_24_HMSH ); // 13:49:38.78 - aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); - aTimeField.SetFormat( SVXTIMEFORMAT_12_HM ); // 01:49 - aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); - aTimeField.SetFormat( SVXTIMEFORMAT_12_HMS ); // 01:49:38 - aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); - aTimeField.SetFormat( SVXTIMEFORMAT_12_HMSH ); // 01:49:38.78 - aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); - //SVXTIMEFORMAT_AM_HM, // 01:49 PM - //SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM - //SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM - - aLbFormat.SelectEntryPos( (sal_uInt16) ( pTimeField->GetFormat() - 2 ) ); - } - else if( pField->ISA( SvxExtFileField ) ) - { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; - SvxExtFileField aFileField( *pFileField ); + if( pTimeField ) + { + SvxExtTimeField aTimeField( *pTimeField ); + + //SVXTIMEFORMAT_APPDEFAULT, // Wird nicht benutzt + //SVXTIMEFORMAT_SYSTEM, // Wird nicht benutzt + aLbFormat.InsertEntry( String( SdResId( STR_STANDARD_NORMAL ) ) ); + + SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); + aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49 + aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); + aTimeField.SetFormat( SVXTIMEFORMAT_24_HMS ); // 13:49:38 + aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); + aTimeField.SetFormat( SVXTIMEFORMAT_24_HMSH ); // 13:49:38.78 + aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); + aTimeField.SetFormat( SVXTIMEFORMAT_12_HM ); // 01:49 + aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); + aTimeField.SetFormat( SVXTIMEFORMAT_12_HMS ); // 01:49:38 + aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); + aTimeField.SetFormat( SVXTIMEFORMAT_12_HMSH ); // 01:49:38.78 + aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); + //SVXTIMEFORMAT_AM_HM, // 01:49 PM + //SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM + //SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM + + aLbFormat.SelectEntryPos( (sal_uInt16) ( pTimeField->GetFormat() - 2 ) ); + } + else + { + const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField); - aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME_EXT ) ) ); - aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_FULLPATH ) ) ); - aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_PATH ) ) ); - aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME ) ) ); + if( pFileField ) + { + SvxExtFileField aFileField( *pFileField ); - aLbFormat.SelectEntryPos( (sal_uInt16) ( pFileField->GetFormat() ) ); - } - else if( pField->ISA( SvxAuthorField ) ) - { - const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField; - SvxAuthorField aAuthorField( *pAuthorField ); + aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME_EXT ) ) ); + aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_FULLPATH ) ) ); + aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_PATH ) ) ); + aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME ) ) ); - for( sal_uInt16 i = 0; i < 4; i++ ) - { - aAuthorField.SetFormat( (SvxAuthorFormat) i ); - aLbFormat.InsertEntry( aAuthorField.GetFormatted() ); - } + aLbFormat.SelectEntryPos( (sal_uInt16) ( pFileField->GetFormat() ) ); + } + else + { + const SvxAuthorField* pAuthorField = dynamic_cast< const SvxAuthorField* >(pField); - aLbFormat.SelectEntryPos( (sal_uInt16) ( pAuthorField->GetFormat() ) ); + if( pAuthorField ) + { + SvxAuthorField aAuthorField( *pAuthorField ); - } + for( sal_uInt16 i = 0; i < 4; i++ ) + { + aAuthorField.SetFormat( (SvxAuthorFormat) i ); + aLbFormat.InsertEntry( aAuthorField.GetFormatted() ); + } + aLbFormat.SelectEntryPos( (sal_uInt16) ( pAuthorField->GetFormat() ) ); + } + } + } + } } void SdModifyFieldDlg::FillControls() { aLbFormat.Clear(); - if( pField->ISA( SvxDateField ) ) + const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField); + + if( pDateField ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; SvxDateField aDateField( *pDateField ); if( pDateField->GetType() == SVXDATETYPE_FIX ) @@ -289,41 +315,54 @@ void SdModifyFieldDlg::FillControls() else aRbtVar.Check(); } - else if( pField->ISA( SvxExtTimeField ) ) + else { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; - SvxExtTimeField aTimeField( *pTimeField ); + const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField); - if( pTimeField->GetType() == SVXTIMETYPE_FIX ) - aRbtFix.Check(); - else - aRbtVar.Check(); - } - else if( pField->ISA( SvxExtFileField ) ) - { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; - SvxExtFileField aFileField( *pFileField ); + if( pTimeField ) + { + SvxExtTimeField aTimeField( *pTimeField ); - if( pFileField->GetType() == SVXFILETYPE_FIX ) - aRbtFix.Check(); + if( pTimeField->GetType() == SVXTIMETYPE_FIX ) + aRbtFix.Check(); + else + aRbtVar.Check(); + } else - aRbtVar.Check(); - } - else if( pField->ISA( SvxAuthorField ) ) - { - const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField; - SvxAuthorField aAuthorField( *pAuthorField ); + { + const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField); - if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX ) - aRbtFix.Check(); - else - aRbtVar.Check(); + if( pFileField ) + { + SvxExtFileField aFileField( *pFileField ); + + if( pFileField->GetType() == SVXFILETYPE_FIX ) + aRbtFix.Check(); + else + aRbtVar.Check(); + } + else + { + const SvxAuthorField* pAuthorField = dynamic_cast< const SvxAuthorField* >(pField); + + if( pAuthorField ) + { + SvxAuthorField aAuthorField( *pAuthorField ); + + if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX ) + aRbtFix.Check(); + else + aRbtVar.Check(); + } + } + } } + aRbtFix.SaveValue(); aRbtVar.SaveValue(); const SfxPoolItem* pItem; - if( SFX_ITEM_SET == maInputSet.GetItemState(EE_CHAR_LANGUAGE, sal_True, &pItem ) ) + if( SFX_ITEM_SET == maInputSet.GetItemState(EE_CHAR_LANGUAGE, true, &pItem ) ) maLbLanguage.SelectLanguage( static_cast<const SvxLanguageItem*>(pItem)->GetLanguage() ); maLbLanguage.SaveValue(); diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index c79b13946387..755b9a81b461 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -42,7 +42,6 @@ #include <svx/dialogs.hrc> #include <svl/intitem.hxx> -#include <svx/svdmark.hxx> #include "View.hxx" #include <svx/svdobj.hxx> #include <svl/style.hxx> @@ -73,7 +72,7 @@ OutlineBulletDlg::OutlineBulletDlg( ::sd::View* pView ) : SfxTabDialog ( pParent, SdResId(TAB_OUTLINEBULLET) ), aInputSet ( *pAttr ), - bTitle ( sal_False ), + bTitle ( false ), pSdView ( pView ) { FreeResource(); @@ -84,26 +83,26 @@ OutlineBulletDlg::OutlineBulletDlg( pOutputSet = new SfxItemSet( *pAttr ); pOutputSet->ClearItem(); - sal_Bool bOutliner = sal_False; + bool bOutliner = false; // Sonderbehandlung wenn eine Title Objekt selektiert wurde if( pView ) { - const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - const sal_uLong nCount = rMarkList.GetMarkCount(); - for(sal_uLong nNum = 0; nNum < nCount; nNum++) + const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView()); + + for(sal_uInt32 nNum(0); nNum < aSelection.size(); nNum++) { - SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj(); + const SdrObject* pObj = aSelection[nNum]; + if( pObj->GetObjInventor() == SdrInventor ) { - switch(pObj->GetObjIdentifier()) { case OBJ_TITLETEXT: - bTitle = sal_True; + bTitle = true; break; case OBJ_OUTLINETEXT: - bOutliner = sal_True; + bOutliner = true; break; } } @@ -120,7 +119,7 @@ OutlineBulletDlg::OutlineBulletDlg( aStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " 1" ) ); SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO); if( pFirstStyleSheet ) - pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, sal_False, (const SfxPoolItem**)&pItem); + pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, (const SfxPoolItem**)&pItem); } if( pItem == NULL ) @@ -131,25 +130,14 @@ OutlineBulletDlg::OutlineBulletDlg( aInputSet.Put(*pItem, EE_PARA_NUMBULLET); } - /* debug - if( SFX_ITEM_SET == aInputSet.GetItemState(EE_PARA_NUMBULLET, sal_False, &pItem )) - { - SvxNumRule& rItem = *((SvxNumBulletItem*)pItem)->GetNumRule(); - for( int i = 0; i < 9; i++ ) - { - SvxNumberFormat aNumberFormat = rItem.GetLevel(i); - } - } - */ - - if(bTitle && aInputSet.GetItemState(EE_PARA_NUMBULLET,sal_True) == SFX_ITEM_ON ) + if(bTitle && aInputSet.GetItemState(EE_PARA_NUMBULLET,true) == SFX_ITEM_ON ) { - SvxNumBulletItem* pItem = (SvxNumBulletItem*)aInputSet.GetItem(EE_PARA_NUMBULLET,sal_True); + SvxNumBulletItem* pItem = (SvxNumBulletItem*)aInputSet.GetItem(EE_PARA_NUMBULLET,true); SvxNumRule* pRule = pItem->GetNumRule(); if(pRule) { SvxNumRule aNewRule( *pRule ); - aNewRule.SetFeatureFlag( NUM_NO_NUMBERS, sal_True ); + aNewRule.SetFeatureFlag( NUM_NO_NUMBERS, true ); SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET ); aInputSet.Put(aNewItem); @@ -210,26 +198,17 @@ const SfxItemSet* OutlineBulletDlg::GetOutputItemSet() const pOutputSet->Put( aSet ); const SfxPoolItem *pItem = NULL; - if( SFX_ITEM_SET == pOutputSet->GetItemState(pOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE), sal_False, &pItem )) + if( SFX_ITEM_SET == pOutputSet->GetItemState(pOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE), false, &pItem )) { SdBulletMapper::MapFontsInNumRule( *((SvxNumBulletItem*)pItem)->GetNumRule(), *pOutputSet ); - -/* #i35937# - SfxUInt16Item aBulletState( EE_PARA_BULLETSTATE, 1 ); - pOutputSet->Put(aBulletState); -*/ } -/* #i35937# - SdBulletMapper::PostMapNumBulletForDialog( *pOutputSet ); -*/ - - if(bTitle && pOutputSet->GetItemState(EE_PARA_NUMBULLET,sal_True) == SFX_ITEM_ON ) + if(bTitle && pOutputSet->GetItemState(EE_PARA_NUMBULLET,true) == SFX_ITEM_ON ) { - SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)pOutputSet->GetItem(EE_PARA_NUMBULLET,sal_True); + SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)pOutputSet->GetItem(EE_PARA_NUMBULLET,true); SvxNumRule* pRule = pBulletItem->GetNumRule(); if(pRule) - pRule->SetFeatureFlag( NUM_NO_NUMBERS, sal_False ); + pRule->SetFeatureFlag( NUM_NO_NUMBERS, false ); } return pOutputSet; diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx index eeb03420c48f..36002862af8b 100644 --- a/sd/source/ui/dlg/dlgpage.cxx +++ b/sd/source/ui/dlg/dlgpage.cxx @@ -51,7 +51,7 @@ |* \************************************************************************/ -SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) : +SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, bool bAreaPage ) : SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ), mrOutAttrs ( *pAttr ), mpDocShell ( pDocSh ) diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx index 105f2ba2f2da..c5f5a541e72e 100644 --- a/sd/source/ui/dlg/dlgsnap.cxx +++ b/sd/source/ui/dlg/dlgsnap.cxx @@ -81,46 +81,45 @@ SdSnapLineDlg::SdSnapLineDlg( aBtnDelete.SetClickHdl(LINK(this, SdSnapLineDlg, ClickHdl)); - SetFieldUnit( aMtrFldX, eUIUnit, sal_True ); - SetFieldUnit( aMtrFldY, eUIUnit, sal_True ); - - // WorkArea holen - Rectangle aWorkArea = pView->GetWorkArea(); + SetFieldUnit( aMtrFldX, eUIUnit, true ); + SetFieldUnit( aMtrFldY, eUIUnit, true ); // PoolUnit ermitteln SfxItemPool* pPool = rInAttrs.GetPool(); DBG_ASSERT( pPool, "Wo ist der Pool?" ); SfxMapUnit ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH ); - // #i48497# Consider page origin + // get WorkArea, consider page origin + basegfx::B2DRange aWorkArea(pView->GetWorkArea()); SdrPageView* pPV = pView->GetSdrPageView(); - Point aLeftTop(aWorkArea.Left()+1, aWorkArea.Top()+1); - pPV->LogicToPagePos(aLeftTop); - Point aRightBottom(aWorkArea.Right()-2, aWorkArea.Bottom()-2); - pPV->LogicToPagePos(aRightBottom); + + if(pPV) + { + aWorkArea.transform(basegfx::tools::createTranslateB2DHomMatrix(pPV->GetPageOrigin())); + } // Hier werden die Max- und MinWerte in Abhaengigkeit von der // WorkArea, PoolUnit und der FieldUnit: - SetMetricValue( aMtrFldX, aLeftTop.X(), ePoolUnit ); + SetMetricValue( aMtrFldX, basegfx::fround(aWorkArea.getMinX()), ePoolUnit ); long nValue = static_cast<long>(aMtrFldX.GetValue()); nValue = Fraction( nValue ) / aUIScale; aMtrFldX.SetMin( nValue ); aMtrFldX.SetFirst( nValue ); - SetMetricValue( aMtrFldX, aRightBottom.X(), ePoolUnit ); + SetMetricValue( aMtrFldX, basegfx::fround(aWorkArea.getMaxX()), ePoolUnit ); nValue = static_cast<long>(aMtrFldX.GetValue()); nValue = Fraction( nValue ) / aUIScale; aMtrFldX.SetMax( nValue ); aMtrFldX.SetLast( nValue ); - SetMetricValue( aMtrFldY, aLeftTop.Y(), ePoolUnit ); + SetMetricValue( aMtrFldY, basegfx::fround(aWorkArea.getMinY()), ePoolUnit ); nValue = static_cast<long>(aMtrFldY.GetValue()); nValue = Fraction( nValue ) / aUIScale; aMtrFldY.SetMin( nValue ); aMtrFldY.SetFirst( nValue ); - SetMetricValue( aMtrFldY, aRightBottom.Y(), ePoolUnit ); + SetMetricValue( aMtrFldY, basegfx::fround(aWorkArea.getMaxY()), ePoolUnit ); nValue = static_cast<long>(aMtrFldY.GetValue()); nValue = Fraction( nValue ) / aUIScale; aMtrFldY.SetMax( nValue ); @@ -145,9 +144,9 @@ SdSnapLineDlg::SdSnapLineDlg( IMPL_LINK( SdSnapLineDlg, ClickHdl, Button *, pBtn ) { - if ( pBtn == &aRbPoint ) SetInputFields(sal_True, sal_True); - else if ( pBtn == &aRbHorz ) SetInputFields(sal_False, sal_True); - else if ( pBtn == &aRbVert ) SetInputFields(sal_True, sal_False); + if ( pBtn == &aRbPoint ) SetInputFields(true, true); + else if ( pBtn == &aRbHorz ) SetInputFields(false, true); + else if ( pBtn == &aRbVert ) SetInputFields(true, false); else if ( pBtn == &aBtnDelete ) EndDialog(RET_SNAP_DELETE); return 0; @@ -195,7 +194,7 @@ void SdSnapLineDlg::HideRadioGroup() |* \************************************************************************/ -void SdSnapLineDlg::SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY) +void SdSnapLineDlg::SetInputFields(bool bEnableX, bool bEnableY) { if ( bEnableX ) { diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index 2c0ac40b0020..015059cf20df 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -55,7 +55,7 @@ using namespace ::com::sun::star::uno; const int SdDocPreviewWin::FRAME = 4; -void SdDocPreviewWin::SetObjectShell( SfxObjectShell* pObj, sal_uInt16 nShowPage ) +void SdDocPreviewWin::SetObjectShell( SfxObjectShell* pObj, sal_uInt32 nShowPage ) { mpObj = pObj; mnShowPage = nShowPage; @@ -68,7 +68,7 @@ void SdDocPreviewWin::SetObjectShell( SfxObjectShell* pObj, sal_uInt16 nShowPage } SdDocPreviewWin::SdDocPreviewWin( Window* pParent, const ResId& rResId ) -: Control(pParent, rResId), pMetaFile( 0 ), bInEffect(sal_False), mpObj(NULL), mnShowPage(0) +: Control(pParent, rResId), pMetaFile( 0 ), bInEffect(false), mpObj(NULL), mnShowPage(0) { SetBorderStyle( WINDOW_BORDER_MONO ); svtools::ColorConfig aColorConfig; @@ -141,8 +141,8 @@ void SdDocPreviewWin::Paint( const Rectangle& rRect ) SvtAccessibilityOptions aAccOptions; bool bUseContrast = aAccOptions.GetIsForPagePreviews() && Application::GetSettings().GetStyleSettings().GetHighContrastMode(); SetDrawMode( bUseContrast - ? ::sd::ViewShell::OUTPUT_DRAWMODE_CONTRAST - : ::sd::ViewShell::OUTPUT_DRAWMODE_COLOR ); + ? SD_OUTPUT_DRAWMODE_CONTRAST + : SD_OUTPUT_DRAWMODE_COLOR ); ImpPaint( pMetaFile, (VirtualDevice*)this ); } @@ -198,7 +198,7 @@ long SdDocPreviewWin::Notify( NotifyEvent& rNEvt ) void SdDocPreviewWin::updateViewSettings() { - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,mpObj); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(mpObj); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; SvtAccessibilityOptions aAccOptions; @@ -228,28 +228,26 @@ void SdDocPreviewWin::updateViewSettings() VirtualDevice aVDev; - const Fraction aFrac( pDoc->GetScaleFraction() ); - const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac ); + const Fraction aFrac( pDoc->GetExchangeObjectScale() ); + const MapMode aMap( pDoc->GetExchangeObjectUnit(), Point(), aFrac, aFrac ); aVDev.SetMapMode( aMap ); // #109058# Disable output, as we only want to record a metafile - aVDev.EnableOutput( sal_False ); + aVDev.EnableOutput( false ); pMtf->Record( &aVDev ); ::sd::DrawView* pView = new ::sd::DrawView(pDocShell, this, NULL); + pView->SetBordVisible( false ); + pView->SetPageVisible( false ); + pView->ShowSdrPage( *pPage ); - const Size aSize( pPage->GetSize() ); - - pView->SetBordVisible( sal_False ); - pView->SetPageVisible( sal_False ); - pView->ShowSdrPage( pPage ); - - const Point aNewOrg( pPage->GetLftBorder(), pPage->GetUppBorder() ); - const Size aNewSize( aSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder(), - aSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder() ); + const Point aNewOrg( pPage->GetLeftPageBorder(), pPage->GetTopPageBorder() ); + const Size aSize(basegfx::fround(pPage->GetPageScale().getX()), basegfx::fround(pPage->GetPageScale().getY())); + const Size aNewSize( aSize.Width() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder(), + aSize.Height() - pPage->GetTopPageBorder() - pPage->GetBottomPageBorder() ); const Rectangle aClipRect( aNewOrg, aNewSize ); MapMode aVMap( aMap ); @@ -285,7 +283,9 @@ void SdDocPreviewWin::updateViewSettings() void SdDocPreviewWin::Notify(SfxBroadcaster&, const SfxHint& rHint) { - if( rHint.ISA( SfxSimpleHint ) && ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_COLORS_CHANGED ) + const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint); + + if( pSfxSimpleHint && SFX_HINT_COLORS_CHANGED == pSfxSimpleHint->GetId() ) { updateViewSettings(); } diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx index 6dadf6484b78..76b818e12633 100644 --- a/sd/source/ui/dlg/filedlg.cxx +++ b/sd/source/ui/dlg/filedlg.cxx @@ -71,8 +71,8 @@ private: css::uno::Reference< css::media::XPlayer > mxPlayer; sal_uLong mnPlaySoundEvent; - sal_Bool mbUsableSelection; - sal_Bool mbLabelPlaying; + bool mbUsableSelection; + bool mbLabelPlaying; void CheckSelectionState(); @@ -135,7 +135,7 @@ IMPL_LINK( SdFileDialog_Imp, PlayMusicHdl, void *, EMPTYARG ) mxControlAccess->setLabel( css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY, String( SdResId( STR_PLAY ) ) ); - mbLabelPlaying = sal_False; + mbLabelPlaying = false; } catch( css::lang::IllegalArgumentException ) { @@ -169,7 +169,7 @@ IMPL_LINK( SdFileDialog_Imp, PlayMusicHdl, void *, EMPTYARG ) mxControlAccess->setLabel( css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY, String( SdResId( STR_STOP ) ) ); - mbLabelPlaying = sal_True; + mbLabelPlaying = true; } catch( css::lang::IllegalArgumentException ) { @@ -205,7 +205,7 @@ IMPL_LINK( SdFileDialog_Imp, IsMusicStoppedHdl, void *, EMPTYARG ) { mxControlAccess->setLabel( css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY, String( SdResId( STR_PLAY ) ) ); - mbLabelPlaying = sal_False; + mbLabelPlaying = false; } catch( css::lang::IllegalArgumentException ) { @@ -228,9 +228,9 @@ void SdFileDialog_Imp::CheckSelectionState() try { if( !aCurrFilter.Len() || ( aCurrFilter == String( SdResId( STR_EXPORT_HTML_NAME ) ) ) ) - mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_False ); + mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, false ); else - mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_True ); + mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, true ); } catch( css::lang::IllegalArgumentException ) { @@ -247,7 +247,7 @@ SdFileDialog_Imp::SdFileDialog_Imp( const short nDialogType, FileDialogHelper( nDialogType, 0 ), mnPlaySoundEvent( 0 ), mbUsableSelection( bUsableSelection ), - mbLabelPlaying(sal_False) + mbLabelPlaying(false) { maUpdateTimer.SetTimeoutHdl(LINK(this, SdFileDialog_Imp, IsMusicStoppedHdl)); @@ -277,7 +277,7 @@ SdFileDialog_Imp::SdFileDialog_Imp( const short nDialogType, { try { - mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_False ); + mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, false ); } catch( css::lang::IllegalArgumentException ) { diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 79de97d740fe..28f8dae4a407 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -86,7 +86,7 @@ class PresLayoutPreview : public Control private: SdPage* mpMaster; HeaderFooterSettings maSettings; - Size maPageSize; + basegfx::B2DVector maPageSize; Rectangle maOutRect; private: @@ -216,12 +216,12 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, ::Window* pParent if( pCurrentPage->GetPageKind() == PK_STANDARD ) { pSlide = pCurrentPage; - pNotes = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNum() + 1 ); + pNotes = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNumber() + 1 ); } else if( pCurrentPage->GetPageKind() == PK_NOTES ) { pNotes = pCurrentPage; - pSlide = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNum() -1 ); + pSlide = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNumber() -1 ); mpCurrentPage = pSlide; } else @@ -300,7 +300,7 @@ IMPL_LINK( HeaderFooterDialog, ActivatePageHdl, TabControl *, pTabCtrl ) IMPL_LINK( HeaderFooterDialog, DeactivatePageHdl, TabControl *, EMPTYARG ) { - return sal_True; + return true; } // ----------------------------------------------------------------------- @@ -358,11 +358,11 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides ) // apply to all slides if( bToAll ) { - int nPageCount = mpDoc->GetSdPageCount( PK_STANDARD ); - int nPage; + sal_uInt32 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD ); + sal_uInt32 nPage; for( nPage = 0; nPage < nPageCount; nPage++ ) { - SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_STANDARD ); + SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD ); change( pUndoGroup, pPage, aNewSettings ); } } @@ -399,11 +399,11 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides ) if( !bForceSlides || !(aNewSettings == maNotesHandoutSettings) ) { // first set to all notes pages - int nPageCount = mpDoc->GetSdPageCount( PK_NOTES ); - int nPage; + sal_uInt32 nPageCount = mpDoc->GetSdPageCount( PK_NOTES ); + sal_uInt32 nPage; for( nPage = 0; nPage < nPageCount; nPage++ ) { - SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_NOTES ); + SdPage* pPage = mpDoc->GetSdPage( nPage, PK_NOTES ); change( pUndoGroup, pPage, aNewSettings ); } @@ -720,8 +720,8 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo // if set, set it on all notes master pages if( bSet ) { - sal_uInt16 nPageCount = mpDoc->GetMasterSdPageCount( PK_NOTES ); - sal_uInt16 nPage; + sal_uInt32 nPageCount = mpDoc->GetMasterSdPageCount( PK_NOTES ); + sal_uInt32 nPage; for( nPage = 0; nPage < nPageCount; nPage++ ) { GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( nPage, PK_NOTES ) ); @@ -736,8 +736,8 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo { // get the language from the first master page // or set it to all master pages - sal_uInt16 nPageCount = bSet ? mpDoc->GetMasterSdPageCount( PK_NOTES ) : 1; - sal_uInt16 nPage; + sal_uInt32 nPageCount = bSet ? mpDoc->GetMasterSdPageCount( PK_NOTES ) : 1; + sal_uInt32 nPage; for( nPage = 0; nPage < nPageCount; nPage++ ) { GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( nPage, PK_STANDARD ) ); @@ -779,8 +779,12 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo if( aFieldInfo.pFieldItem ) { const SvxFieldData* pFieldData = aFieldInfo.pFieldItem->GetField(); -// bug119985 2012.06.14 - if( pFieldData && (pFieldData->ISA( SvxDateTimeField ) || pFieldData->ISA( SvxDateField )) ) + + // bug119985 2012.06.14 + if(pFieldData && (dynamic_cast< const SvxDateTimeField* >(pFieldData) || dynamic_cast< const SvxDateField* >(pFieldData))) + { + break; + } { break; } @@ -826,7 +830,9 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo /////////////////////////////////////////////////////////////////////// PresLayoutPreview::PresLayoutPreview( ::Window* pParent, const ResId& rResId, SdPage* pMaster ) -:Control( pParent, rResId ), mpMaster( pMaster ), maPageSize( pMaster->GetSize() ) +: Control( pParent, rResId ), + mpMaster( pMaster ), + maPageSize( pMaster->GetPageScale() ) { } @@ -849,14 +855,12 @@ void PresLayoutPreview::update( HeaderFooterSettings& rSettings ) void PresLayoutPreview::Paint( OutputDevice& aOut, SdrTextObj* pObj, bool bVisible, bool bDotted /* = false*/ ) { // get object transformation - basegfx::B2DHomMatrix aObjectTransform; - basegfx::B2DPolyPolygon aObjectPolyPolygon; - pObj->TRGetBaseGeometry(aObjectTransform, aObjectPolyPolygon); + basegfx::B2DHomMatrix aObjectTransform(pObj->getSdrObjectTransformation()); // build complete transformation by adding view transformation from // logic page coordinates to local pixel coordinates - const double fScaleX((double)maOutRect.getWidth() / (double)maPageSize.Width()); - const double fScaleY((double)maOutRect.getHeight() / (double)maPageSize.Height()); + const double fScaleX((double)maOutRect.getWidth() / maPageSize.getX()); + const double fScaleY((double)maOutRect.getHeight() / maPageSize.getY()); aObjectTransform.scale(fScaleX, fScaleY); aObjectTransform.translate(maOutRect.TopLeft().X(), maOutRect.TopLeft().Y()); @@ -904,15 +908,15 @@ void PresLayoutPreview::Paint( const Rectangle& ) // calculate page size with correct aspect ratio int nWidth, nHeight; - if( maPageSize.Width() > maPageSize.Height() ) + if( basegfx::fTools::more(maPageSize.getX(), maPageSize.getY()) ) { nWidth = maOutRect.GetWidth(); - nHeight = long( (double)(nWidth * maPageSize.Height()) / (double)maPageSize.Width() ); + nHeight = long( (nWidth * maPageSize.getY()) / maPageSize.getX() ); } else { nHeight = maOutRect.GetHeight(); - nWidth = long( (double)(nHeight * maPageSize.Width()) / (double)maPageSize.Height() ); + nWidth = long( (nHeight * maPageSize.getX()) / maPageSize.getY() ); } maOutRect.nLeft += (maOutRect.GetWidth() - nWidth) >> 1; diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx index 526b1dac4bc4..94bf43b84576 100644 --- a/sd/source/ui/dlg/ins_paste.cxx +++ b/sd/source/ui/dlg/ins_paste.cxx @@ -45,7 +45,7 @@ SdInsertPasteDlg::SdInsertPasteDlg( Window* pWindow ) : aBtnHelp( this, SdResId( BTN_HELP ) ) { FreeResource(); - aRbAfter.Check( sal_True ); + aRbAfter.Check( true ); } // ----------------------------------------------------------------------------- @@ -56,7 +56,7 @@ SdInsertPasteDlg::~SdInsertPasteDlg() // ----------------------------------------------------------------------------- -sal_Bool SdInsertPasteDlg::IsInsertBefore() const +bool SdInsertPasteDlg::IsInsertBefore() const { return( aRbBefore.IsChecked() ); } diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx index 1bc1a95ae219..a462b4abd6a6 100644 --- a/sd/source/ui/dlg/inspagob.cxx +++ b/sd/source/ui/dlg/inspagob.cxx @@ -113,7 +113,7 @@ void SdInsertPagesObjsDlg::Reset() aLbTree.SetCollapsedEntryBmp( pEntry, aImgTextH, BMP_COLOR_HIGHCONTRAST ); } - aCbxMasters.Check( sal_True ); + aCbxMasters.Check( true ); } /************************************************************************* @@ -149,7 +149,7 @@ List* SdInsertPagesObjsDlg::GetList( sal_uInt16 nType ) |* \************************************************************************/ -sal_Bool SdInsertPagesObjsDlg::IsLink() +bool SdInsertPagesObjsDlg::IsLink() { return( aCbxLink.IsChecked() ); } @@ -160,7 +160,7 @@ sal_Bool SdInsertPagesObjsDlg::IsLink() |* \************************************************************************/ -sal_Bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const +bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const { return( aCbxMasters.IsChecked() ); } diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx b/sd/source/ui/dlg/layeroptionsdlg.cxx index 04cabd39cc38..1b4763befe10 100644 --- a/sd/source/ui/dlg/layeroptionsdlg.cxx +++ b/sd/source/ui/dlg/layeroptionsdlg.cxx @@ -56,12 +56,12 @@ SdInsertLayerDlg::SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs, SetText( aStr ); - maEdtName.SetText( ( ( const SdAttrLayerName& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() ); - maEdtTitle.SetText( ( ( const SdAttrLayerTitle& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() ); - maEdtDesc.SetText( ( ( const SdAttrLayerDesc& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() ); - maCbxVisible.Check( ( ( const SdAttrLayerVisible& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() ); - maCbxPrintable.Check( ( ( const SdAttrLayerPrintable& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() ); - maCbxLocked.Check( ( ( const SdAttrLayerLocked& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() ); + maEdtName.SetText( ( ( const SfxStringItem& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() ); + maEdtTitle.SetText( ( ( const SfxStringItem& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() ); + maEdtDesc.SetText( ( ( const SfxStringItem& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() ); + maCbxVisible.Check( ( ( const SfxBoolItem& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() ); + maCbxPrintable.Check( ( ( const SfxBoolItem& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() ); + maCbxLocked.Check( ( ( const SfxBoolItem& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() ); if( !bDeletable ) { @@ -72,10 +72,10 @@ SdInsertLayerDlg::SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs, void SdInsertLayerDlg::GetAttr( SfxItemSet& rAttrs ) { - rAttrs.Put( SdAttrLayerName( maEdtName.GetText() ) ); - rAttrs.Put( SdAttrLayerTitle( maEdtTitle.GetText() ) ); - rAttrs.Put( SdAttrLayerDesc( maEdtDesc.GetText() ) ); - rAttrs.Put( SdAttrLayerVisible( maCbxVisible.IsChecked() ) ); - rAttrs.Put( SdAttrLayerPrintable( maCbxPrintable.IsChecked() ) ); - rAttrs.Put( SdAttrLayerLocked( maCbxLocked.IsChecked() ) ); + rAttrs.Put( SfxStringItem( ATTR_LAYER_NAME, maEdtName.GetText() ) ); + rAttrs.Put( SfxStringItem( ATTR_LAYER_TITLE, maEdtTitle.GetText() ) ); + rAttrs.Put( SfxStringItem( ATTR_LAYER_DESC, maEdtDesc.GetText() ) ); + rAttrs.Put( SfxBoolItem( ATTR_LAYER_VISIBLE, maCbxVisible.IsChecked() ) ); + rAttrs.Put( SfxBoolItem( ATTR_LAYER_PRINTABLE, maCbxPrintable.IsChecked() ) ); + rAttrs.Put( SfxBoolItem( ATTR_LAYER_LOCKED, maCbxLocked.IsChecked() ) ); } diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx index 5fafe9861725..deb37ae36f71 100644 --- a/sd/source/ui/dlg/masterlayoutdlg.cxx +++ b/sd/source/ui/dlg/masterlayoutdlg.cxx @@ -72,7 +72,7 @@ MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, S case PK_STANDARD: { // aTitle = String( SdResId( STR_MASTER_LAYOUT_TITLE ) ); - maCBHeader.Enable( sal_False ); + maCBHeader.Enable( false ); String aSlideNumberStr( SdResId( STR_SLIDE_NUMBER ) ); maCBPageNumber.SetText( aSlideNumberStr ); break; @@ -116,7 +116,7 @@ void MasterLayoutDialog::applyChanges() { mpDoc->BegUndo(GetText()); - if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != maCBHeader.IsChecked() ) ) + if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != (bool)maCBHeader.IsChecked() ) ) { if( mbOldHeader ) remove( PRESOBJ_HEADER ); @@ -124,7 +124,7 @@ void MasterLayoutDialog::applyChanges() create( PRESOBJ_HEADER ); } - if( mbOldFooter != maCBFooter.IsChecked() ) + if( mbOldFooter != (bool)maCBFooter.IsChecked() ) { if( mbOldFooter ) remove( PRESOBJ_FOOTER ); @@ -132,7 +132,7 @@ void MasterLayoutDialog::applyChanges() create( PRESOBJ_FOOTER ); } - if( mbOldDate != maCBDate.IsChecked() ) + if( mbOldDate != (bool)maCBDate.IsChecked() ) { if( mbOldDate ) remove( PRESOBJ_DATETIME ); @@ -140,7 +140,7 @@ void MasterLayoutDialog::applyChanges() create( PRESOBJ_DATETIME ); } - if( mbOldPageNumber != maCBPageNumber.IsChecked() ) + if( mbOldPageNumber != (bool)maCBPageNumber.IsChecked() ) { if( mbOldPageNumber ) remove( PRESOBJ_SLIDENUMBER ); @@ -160,16 +160,17 @@ void MasterLayoutDialog::remove( PresObjKind eKind ) { SdrObject* pObject = mpCurrentPage->GetPresObj( eKind ); - if( pObject ) + if( pObject && pObject->getParentOfSdrObject() ) { const bool bUndo = mpDoc->IsUndoEnabled(); if( bUndo ) mpDoc->AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pObject)); - SdrObjList* pOL =pObject->GetObjList(); - sal_uInt32 nOrdNum=pObject->GetOrdNumDirect(); - pOL->RemoveObject(nOrdNum); + + pObject->getParentOfSdrObject()->RemoveObjectFromSdrObjList(pObject->GetNavigationPosition()); if( !bUndo ) - SdrObject::Free(pObject); + { + deleteSdrObjectSafeAndClearPointer(pObject); + } } } diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index 2733545d50b0..458757755bc5 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -79,12 +79,8 @@ MorphDlg::MorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject* FreeResource(); LoadSettings(); - SfxItemPool* pPool = (SfxItemPool*) pObj1->GetObjectItemPool(); - SfxItemSet aSet1( *pPool ); - SfxItemSet aSet2( *pPool ); - - aSet1.Put(pObj1->GetMergedItemSet()); - aSet2.Put(pObj2->GetMergedItemSet()); + SfxItemSet aSet1( pObj1->GetMergedItemSet() ); + SfxItemSet aSet2( pObj2->GetMergedItemSet() ); const XLineStyle eLineStyle1 = ( (const XLineStyleItem&) aSet1.Get( XATTR_LINESTYLE ) ).GetValue(); const XLineStyle eLineStyle2 = ( (const XLineStyleItem&) aSet2.Get( XATTR_LINESTYLE ) ).GetValue(); @@ -122,18 +118,21 @@ void MorphDlg::LoadSettings() RTL_CONSTASCII_STRINGPARAM( SD_OPTION_MORPHING ) ), SD_OPTION_LOAD ) ); sal_uInt16 nSteps; - sal_Bool bOrient, bAttrib; + bool bOrient, bAttrib; if( xIStm.Is() ) { SdIOCompat aCompat( *xIStm, STREAM_READ ); + sal_Bool bTempBOOL; - *xIStm >> nSteps >> bOrient >> bAttrib; + *xIStm >> nSteps; + *xIStm >> bTempBOOL; bOrient = bTempBOOL; + *xIStm >> bTempBOOL; bAttrib = bTempBOOL; } else { nSteps = 16; - bOrient = bAttrib = sal_True; + bOrient = bAttrib = true; } aMtfSteps.SetValue( nSteps ); @@ -154,8 +153,8 @@ void MorphDlg::SaveSettings() const SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 ); *xOStm << (sal_uInt16) aMtfSteps.GetValue() - << aCbxOrientation.IsChecked() - << aCbxAttributes.IsChecked(); + << (sal_Bool)aCbxOrientation.IsChecked() + << (sal_Bool)aCbxAttributes.IsChecked(); } } diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 32f03af155ed..651074d8942d 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -78,7 +78,7 @@ SdNavigatorWin::SdNavigatorWin( , maTlbObjects( this, SdResId( TLB_OBJECTS ) ) , maLbDocs ( this, SdResId( LB_DOCS ) ) , mpChildWinContext( pChWinCtxt ) -, mbDocImported ( sal_False ) +, mbDocImported ( false ) // Bei Aenderung des DragTypes: SelectionMode der TLB anpassen! , meDragType ( NAVIGATOR_DRAGTYPE_EMBEDDED ) , mpBindings ( pInBindings ) @@ -140,7 +140,7 @@ SdNavigatorWin::SdNavigatorWin( ((SfxDockingWindow*)GetParent())->SetMinOutputSizePixel( maMinSize ); // InitTlb; Wird ueber Slot initiiert - SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True ); + SfxBoolItem aItem( SID_NAVIGATOR_INIT, true ); mpBindings->GetDispatcher()->Execute( SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L ); @@ -182,7 +182,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) // Disable the shape filter drop down menu when there is a running slide // show. if (pViewShell!=NULL && sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() )) - maToolbox.EnableItem(TBI_SHAPE_FILTER, sal_False); + maToolbox.EnableItem(TBI_SHAPE_FILTER, false); else maToolbox.EnableItem(TBI_SHAPE_FILTER); @@ -190,7 +190,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) { String aDocName = pDocShell->GetMedium()->GetName(); maTlbObjects.Clear(); - maTlbObjects.Fill( pDoc, (sal_Bool) sal_False, aDocName ); // Nur normale Seiten + maTlbObjects.Fill( pDoc, false, aDocName ); // Nur normale Seiten RefreshDocumentLB(); maLbDocs.SelectEntry( aDocShName ); @@ -210,7 +210,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) SfxViewFrame* pViewFrame = ( ( pViewShell && pViewShell->GetViewFrame() ) ? pViewShell->GetViewFrame() : SfxViewFrame::Current() ); if( pViewFrame ) - pViewFrame->GetBindings().Invalidate(SID_NAVIGATOR_PAGENAME, sal_True, sal_True); + pViewFrame->GetBindings().Invalidate(SID_NAVIGATOR_PAGENAME, true, true); } /************************************************************************* @@ -252,7 +252,7 @@ IMPL_LINK( SdNavigatorWin, SelectToolboxHdl, void *, EMPTYARG ) if( nSId > 0 ) { - SfxBoolItem aItem( nSId, sal_True ); + SfxBoolItem aItem( nSId, true ); mpBindings->GetDispatcher()->Execute( nSId, SFX_CALLMODE_SLOT |SFX_CALLMODE_RECORD, &aItem, 0L ); } @@ -332,8 +332,8 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox ) if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects.IsLinkableSelected() ) { - pMenu->EnableItem( NAVIGATOR_DRAGTYPE_LINK, sal_False ); - pMenu->EnableItem( NAVIGATOR_DRAGTYPE_URL, sal_False ); + pMenu->EnableItem( NAVIGATOR_DRAGTYPE_LINK, false ); + pMenu->EnableItem( NAVIGATOR_DRAGTYPE_URL, false ); meDragType = NAVIGATOR_DRAGTYPE_EMBEDDED; } @@ -415,7 +415,7 @@ IMPL_LINK( SdNavigatorWin, SelectDocumentHdl, void *, EMPTYARG ) { String aStrLb = maLbDocs.GetSelectEntry(); long nPos = maLbDocs.GetSelectEntryPos(); - sal_Bool bFound = sal_False; + bool bFound = false; ::sd::DrawDocShell* pDocShell = NULL; NavDocInfo* pInfo = GetDocInfo(); @@ -429,7 +429,7 @@ IMPL_LINK( SdNavigatorWin, SelectDocumentHdl, void *, EMPTYARG ) { pDocShell = pInfo->mpDocShell; - bFound = sal_True; + bFound = true; } if( bFound ) @@ -441,7 +441,7 @@ IMPL_LINK( SdNavigatorWin, SelectDocumentHdl, void *, EMPTYARG ) ::sd::DrawDocShell* pNCDocShell = pNonConstDoc->GetDocSh(); String aDocName = pNCDocShell->GetMedium()->GetName(); maTlbObjects.Clear(); - maTlbObjects.Fill( pDoc, (sal_Bool) sal_False, aDocName ); // Nur normale Seiten + maTlbObjects.Fill( pDoc, false, aDocName ); // Nur normale Seiten } } @@ -482,7 +482,7 @@ IMPL_LINK( SdNavigatorWin, MenuSelectHdl, Menu *, pMenu ) { // Fix, um Endlosschleife zu unterbinden if( maTlbObjects.GetSelectionCount() > 1 ) - maTlbObjects.SelectAll( sal_False ); + maTlbObjects.SelectAll( false ); maTlbObjects.SetSelectionMode( SINGLE_SELECTION ); } @@ -583,10 +583,10 @@ void SdNavigatorWin::Resize() // ----------------------------------------------------------------------- -sal_Bool SdNavigatorWin::InsertFile(const String& rFileName) +bool SdNavigatorWin::InsertFile(const String& rFileName) { INetURLObject aURL( rFileName ); - sal_Bool bReturn = sal_True; + bool bReturn = true; if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) { @@ -615,9 +615,9 @@ sal_Bool SdNavigatorWin::InsertFile(const String& rFileName) if (aFileName != maDropFileName) { - SfxMedium aMed(aFileName, (STREAM_READ | STREAM_SHARE_DENYNONE), sal_False); + SfxMedium aMed(aFileName, (STREAM_READ | STREAM_SHARE_DENYNONE), false); SfxFilterMatcher aMatch( String::CreateFromAscii("simpress") ); - aMed.UseInteractionHandler( sal_True ); + aMed.UseInteractionHandler( true ); nErr = aMatch.GuessFilter(aMed, &pFilter); } @@ -627,7 +627,7 @@ sal_Bool SdNavigatorWin::InsertFile(const String& rFileName) // ersteinmal nachgeschaut, ob es einen Storage enthaelt SfxMedium* pMedium = new SfxMedium( aFileName, STREAM_READ | STREAM_NOCREATE, - sal_True); // Download + true); // Download if (pMedium->IsStorage()) { @@ -644,20 +644,20 @@ sal_Bool SdNavigatorWin::InsertFile(const String& rFileName) if( !maTlbObjects.IsEqualToDoc( pDropDoc ) ) { // Nur normale Seiten - maTlbObjects.Fill(pDropDoc, (sal_Bool) sal_False, maDropFileName); + maTlbObjects.Fill(pDropDoc, false, maDropFileName); RefreshDocumentLB( &maDropFileName ); } } } else { - bReturn = sal_False; + bReturn = false; delete pMedium; } } else { - bReturn = sal_False; + bReturn = false; } } @@ -676,7 +676,7 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName ) maLbDocs.RemoveEntry( 0 ); maLbDocs.InsertEntry( *pDocName, 0 ); - mbDocImported = sal_True; + mbDocImported = true; } else { @@ -698,12 +698,11 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName ) if( mbDocImported ) maLbDocs.InsertEntry( aStr, 0 ); - ::sd::DrawDocShell* pCurrentDocShell = - PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); - SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst(0, sal_False); + ::sd::DrawDocShell* pCurrentDocShell = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() ); + SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst(0, false); while( pSfxDocShell ) { - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, pSfxDocShell ); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(pSfxDocShell ); if( pDocShell && !pDocShell->IsInDestruction() && ( pDocShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) ) { NavDocInfo* pInfo = new NavDocInfo(); @@ -713,7 +712,7 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName ) if( aStr.Len() ) pInfo->SetName(); else - pInfo->SetName( sal_False ); + pInfo->SetName( false ); // z.Z. wird wieder der Name der Shell genommen (also ohne Pfad) // da Koose es als Fehler ansieht, wenn er Pfad in URL-Notation // angezeigt wird! @@ -725,11 +724,11 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName ) if( pDocShell == pCurrentDocShell ) pInfo->SetActive(); else - pInfo->SetActive( sal_False ); + pInfo->SetActive( false ); mpDocList->Insert( pInfo, LIST_APPEND ); } - pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, 0 , sal_False ); + pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, 0 , false ); } } maLbDocs.SelectEntryPos( nPos ); @@ -737,7 +736,7 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName ) //------------------------------------------------------------------------ -sal_uInt16 SdNavigatorWin::GetDragTypeSdResId( NavigatorDragType eDT, sal_Bool bImage ) +sal_uInt16 SdNavigatorWin::GetDragTypeSdResId( NavigatorDragType eDT, bool bImage ) { switch( eDT ) { @@ -783,7 +782,7 @@ NavDocInfo* SdNavigatorWin::GetDocInfo() long SdNavigatorWin::Notify(NotifyEvent& rNEvt) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); - long nOK = sal_False; + long nOK = false; if( pKEvt ) { @@ -792,7 +791,7 @@ long SdNavigatorWin::Notify(NotifyEvent& rNEvt) if( SdPageObjsTLB::IsInDrag() ) { // during drag'n'drop we just stop the drag but do not close the navigator - nOK = sal_True; + nOK = true; } else { @@ -804,7 +803,7 @@ long SdNavigatorWin::Notify(NotifyEvent& rNEvt) // deletion of the navigator window. Calling the // parents Notify after this is unsafe. Therefore we // return now. - return sal_True; + return true; } } } @@ -825,14 +824,14 @@ long SdNavigatorWin::Notify(NotifyEvent& rNEvt) void SdNavigatorWin::KeyInput( const KeyEvent& rKEvt ) { - long nOK = sal_False; + long nOK = false; if (rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE) { if( SdPageObjsTLB::IsInDrag() ) { // during drag'n'drop we just stop the drag but do not close the navigator - nOK = sal_True; + nOK = true; } else { @@ -860,7 +859,7 @@ void SdNavigatorWin::DataChanged( const DataChangedEvent& rDCEvt ) void SdNavigatorWin::SetDragImage() { - maToolbox.SetItemImage( TBI_DRAGTYPE, maToolbox.GetImageList().GetImage( GetDragTypeSdResId( meDragType, sal_True ) ) ); + maToolbox.SetItemImage( TBI_DRAGTYPE, maToolbox.GetImageList().GetImage( GetDragTypeSdResId( meDragType, true ) ) ); } void SdNavigatorWin::ApplyImageList() @@ -897,7 +896,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, { if( eState >= SFX_ITEM_AVAILABLE && nSId == SID_NAVIGATOR_STATE ) { - const SfxUInt32Item* pStateItem = PTR_CAST( SfxUInt32Item, pItem ); + const SfxUInt32Item* pStateItem = dynamic_cast< const SfxUInt32Item* >(pItem ); DBG_ASSERT( pStateItem, "SfxUInt16Item erwartet"); sal_uInt32 nState = pStateItem->GetValue(); @@ -907,13 +906,13 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, pNavigatorWin->maToolbox.EnableItem( TBI_PEN ); if( nState & NAVBTN_PEN_DISABLED && pNavigatorWin->maToolbox.IsItemEnabled( TBI_PEN ) ) - pNavigatorWin->maToolbox.EnableItem( TBI_PEN, sal_False ); + pNavigatorWin->maToolbox.EnableItem( TBI_PEN, false ); if( nState & NAVBTN_PEN_CHECKED && !pNavigatorWin->maToolbox.IsItemChecked( TBI_PEN ) ) pNavigatorWin->maToolbox.CheckItem( TBI_PEN ); if( nState & NAVBTN_PEN_UNCHECKED && pNavigatorWin->maToolbox.IsItemChecked( TBI_PEN ) ) - pNavigatorWin->maToolbox.CheckItem( TBI_PEN, sal_False ); + pNavigatorWin->maToolbox.CheckItem( TBI_PEN, false ); // Nur wenn Doc in LB das Aktive ist NavDocInfo* pInfo = pNavigatorWin->GetDocInfo(); @@ -925,7 +924,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, pNavigatorWin->maToolbox.EnableItem( TBI_FIRST ); if( nState & NAVBTN_FIRST_DISABLED && pNavigatorWin->maToolbox.IsItemEnabled( TBI_FIRST ) ) - pNavigatorWin->maToolbox.EnableItem( TBI_FIRST, sal_False ); + pNavigatorWin->maToolbox.EnableItem( TBI_FIRST, false ); // Prev if( nState & NAVBTN_PREV_ENABLED && @@ -933,7 +932,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS ); if( nState & NAVBTN_PREV_DISABLED && pNavigatorWin->maToolbox.IsItemEnabled( TBI_PREVIOUS ) ) - pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS, sal_False ); + pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS, false ); // Last if( nState & NAVBTN_LAST_ENABLED && @@ -941,7 +940,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, pNavigatorWin->maToolbox.EnableItem( TBI_LAST ); if( nState & NAVBTN_LAST_DISABLED && pNavigatorWin->maToolbox.IsItemEnabled( TBI_LAST ) ) - pNavigatorWin->maToolbox.EnableItem( TBI_LAST, sal_False ); + pNavigatorWin->maToolbox.EnableItem( TBI_LAST, false ); // Next if( nState & NAVBTN_NEXT_ENABLED && @@ -949,12 +948,12 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, pNavigatorWin->maToolbox.EnableItem( TBI_NEXT ); if( nState & NAVBTN_NEXT_DISABLED && pNavigatorWin->maToolbox.IsItemEnabled( TBI_NEXT ) ) - pNavigatorWin->maToolbox.EnableItem( TBI_NEXT, sal_False ); + pNavigatorWin->maToolbox.EnableItem( TBI_NEXT, false ); if( nState & NAVTLB_UPDATE ) { // InitTlb; Wird ueber Slot initiiert - SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True ); + SfxBoolItem aItem( SID_NAVIGATOR_INIT, true ); GetBindings().GetDispatcher()->Execute( SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L ); } @@ -987,7 +986,7 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId, NavDocInfo* pInfo = pNavigatorWin->GetDocInfo(); if( pInfo && pInfo->IsActive() ) { - const SfxStringItem* pStateItem = PTR_CAST( SfxStringItem, pItem ); + const SfxStringItem* pStateItem = dynamic_cast< const SfxStringItem* >(pItem ); DBG_ASSERT( pStateItem, "SfxStringItem erwartet"); String aPageName = pStateItem->GetValue(); @@ -996,7 +995,7 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId, if( pNavigatorWin->maTlbObjects.GetSelectionMode() == MULTIPLE_SELECTION ) { // Weil sonst immer dazuselektiert wird - pNavigatorWin->maTlbObjects.SelectAll( sal_False ); + pNavigatorWin->maTlbObjects.SelectAll( false ); } pNavigatorWin->maTlbObjects.SelectEntry( aPageName ); } diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index 11b2d1d8376e..87d94a02253d 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -106,8 +106,8 @@ sal_Bool SdParagraphNumTabPage::FillItemSet( SfxItemSet& rSet ) maNewStartNF.GetText() != maNewStartNF.GetSavedValue()) { mbModified = true; - sal_Bool bNewStartChecked = STATE_CHECK == maNewStartCB.GetState(); - sal_Bool bNumberNewStartChecked = STATE_CHECK == maNewStartNumberCB.GetState(); + bool bNewStartChecked = STATE_CHECK == maNewStartCB.GetState(); + bool bNumberNewStartChecked = STATE_CHECK == maNewStartNumberCB.GetState(); rSet.Put(SfxBoolItem(ATTR_NUMBER_NEWSTART, bNewStartChecked)); const sal_Int16 nStartAt = (sal_Int16)maNewStartNF.GetValue(); @@ -124,7 +124,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet& rSet ) { const SfxBoolItem& rStart = (const SfxBoolItem&)rSet.Get(ATTR_NUMBER_NEWSTART); maNewStartCB.SetState( rStart.GetValue() ? STATE_CHECK : STATE_NOCHECK ); - maNewStartCB.EnableTriState(sal_False); + maNewStartCB.EnableTriState(false); } else { @@ -142,7 +142,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet& rSet ) nNewStart = 1; maNewStartNF.SetValue(nNewStart); - maNewStartNumberCB.EnableTriState(sal_False); + maNewStartNumberCB.EnableTriState(false); } else { @@ -151,12 +151,12 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet& rSet ) ImplNewStartHdl(&maNewStartCB); maNewStartNF.SaveValue(); maNewStartNumberCB.SaveValue(); - mbModified = sal_False; + mbModified = false; } IMPL_LINK( SdParagraphNumTabPage, ImplNewStartHdl, CheckBox*, EMPTYARG ) { - sal_Bool bEnable = maNewStartCB.IsChecked(); + bool bEnable = maNewStartCB.IsChecked(); maNewStartNumberCB.Enable(bEnable); maNewStartNF.Enable(bEnable && maNewStartNumberCB.IsChecked()); return 0; @@ -178,7 +178,7 @@ SdParagraphDlg::SdParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH ); - static const sal_Bool bShowParaNumbering = ( getenv( "SD_SHOW_NUMBERING_PAGE" ) != NULL ); + static const bool bShowParaNumbering = ( getenv( "SD_SHOW_NUMBERING_PAGE" ) != NULL ); if( bShowParaNumbering ) AddTabPage( RID_TABPAGE_PARA_NUMBERING, SdParagraphNumTabPage::Create, SdParagraphNumTabPage::GetRanges ); else diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index b9dd8eeff0ef..c31da4e59f85 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -156,8 +156,8 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow, aCbxChangePage.Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_CHANGE_PAGE ) ).GetValue() ); aCbxAlwaysOnTop.Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ALWAYS_ON_TOP ) ).GetValue() ); - const sal_Bool bEndless = ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue(); - const sal_Bool bWindow = !( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue(); + const bool bEndless = ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue(); + const bool bWindow = !( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue(); const long nPause = ( ( const SfxUInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue(); aTmfPause.SetTime( Time( 0, 0, nPause ) ); @@ -169,11 +169,11 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow, aCbxAutoLogo.Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_SHOW_PAUSELOGO ) ).GetValue() ); if( bWindow ) - aRbtWindow.Check( sal_True ); + aRbtWindow.Check( true ); else if( bEndless ) - aRbtAuto.Check( sal_True ); + aRbtAuto.Check( true ); else - aRbtStandard.Check( sal_True ); + aRbtStandard.Check( true ); InitMonitorSettings(); @@ -324,8 +324,8 @@ IMPL_LINK( SdStartPresentationDlg, ClickWindowPresentationHdl, void *, EMPTYARG if( bWindow ) { - aCbxAlwaysOnTop.Enable( sal_False ); - aCbxAlwaysOnTop.Check( sal_False ); + aCbxAlwaysOnTop.Enable( false ); + aCbxAlwaysOnTop.Check( false ); } else aCbxAlwaysOnTop.Enable(); diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx index 9be3c131cce3..95ac3a5de16d 100644 --- a/sd/source/ui/dlg/prltempl.cxx +++ b/sd/source/ui/dlg/prltempl.cxx @@ -111,14 +111,14 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, // Fals in diesem Stylesheet kein Bullet Item ist, holen wir uns // das aus dem 'Outline 1' Stylesheet. - if( SFX_ITEM_SET != aInputSet.GetItemState(EE_PARA_NUMBULLET, sal_False, &pItem )) + if( SFX_ITEM_SET != aInputSet.GetItemState(EE_PARA_NUMBULLET, false, &pItem )) { String aStyleName((SdResId(STR_PSEUDOSHEET_OUTLINE))); aStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " 1" ) ); SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO); if(pFirstStyleSheet) - if( SFX_ITEM_SET == pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, sal_False, &pItem) ) + if( SFX_ITEM_SET == pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, &pItem) ) aInputSet.Put( *pItem ); } @@ -320,7 +320,7 @@ const SfxItemSet* SdPresLayoutTemplateDlg::GetOutputItemSet() const pOutSet->Put( *SfxTabDialog::GetOutputItemSet() ); const SvxNumBulletItem *pSvxNumBulletItem = NULL; - if( SFX_ITEM_SET == pOutSet->GetItemState(EE_PARA_NUMBULLET, sal_False, (const SfxPoolItem**)&pSvxNumBulletItem )) + if( SFX_ITEM_SET == pOutSet->GetItemState(EE_PARA_NUMBULLET, false, (const SfxPoolItem**)&pSvxNumBulletItem )) SdBulletMapper::MapFontsInNumRule( *pSvxNumBulletItem->GetNumRule(), *pOutSet ); return pOutSet; } @@ -344,7 +344,7 @@ sal_uInt16 SdPresLayoutTemplateDlg::GetOutlineLevel() const case PO_OUTLINE_8: return 7; case PO_OUTLINE_9: return 8; default: - DBG_ASSERT( sal_False, "Falscher Po! [CL]"); + DBG_ASSERT( false, "Falscher Po! [CL]"); } return 0; } diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx index 48e77fb1a587..62b33f9d75ad 100644 --- a/sd/source/ui/dlg/prntopts.cxx +++ b/sd/source/ui/dlg/prntopts.cxx @@ -154,9 +154,9 @@ sal_Bool SdPrintOptions::FillItemSet( SfxItemSet& rAttrs ) rAttrs.Put( aOptions ); - return( sal_True ); + return( true ); } - return( sal_False ); + return( false ); } // ----------------------------------------------------------------------- @@ -164,8 +164,7 @@ sal_Bool SdPrintOptions::FillItemSet( SfxItemSet& rAttrs ) void SdPrintOptions::Reset( const SfxItemSet& rAttrs ) { const SdOptionsPrintItem* pPrintOpts = NULL; - if( SFX_ITEM_SET == rAttrs.GetItemState( ATTR_OPTIONS_PRINT, sal_False, - (const SfxPoolItem**) &pPrintOpts ) ) + if( SFX_ITEM_SET == rAttrs.GetItemState( ATTR_OPTIONS_PRINT, false, (const SfxPoolItem**) &pPrintOpts ) ) { aCbxDraw.Check( pPrintOpts->GetOptionsPrint().IsDraw() ); aCbxNotes.Check( pPrintOpts->GetOptionsPrint().IsNotes() ); @@ -296,7 +295,7 @@ void SdPrintOptions::PageCreated (SfxAllItemSet ) { #ifdef QUARTZ - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG,sal_False); + SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG); if (pFlagItem) { sal_uInt32 nFlags=pFlagItem->GetValue(); diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index be71806bbb38..a31e63bb11e8 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -86,11 +86,11 @@ void AbstractCopyDlg_Impl::GetAttr( SfxItemSet& rOutAttrs ) // AbstractCopyDlg_Impl end //AbstractSdCustomShowDlg_Impl begin -sal_Bool AbstractSdCustomShowDlg_Impl::IsModified() const +bool AbstractSdCustomShowDlg_Impl::IsModified() const { return pDlg->IsModified(); } -sal_Bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const +bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const { return pDlg->IsCustomShow(); } @@ -197,7 +197,7 @@ OutputType AbstractAssistentDlg_Impl::GetOutputMedium() const { return pDlg->GetOutputMedium(); } -sal_Bool AbstractAssistentDlg_Impl::IsSummary() const +bool AbstractAssistentDlg_Impl::IsSummary() const { return pDlg->IsSummary(); } @@ -209,11 +209,11 @@ String AbstractAssistentDlg_Impl::GetDocPath() const { return pDlg->GetDocPath(); } -sal_Bool AbstractAssistentDlg_Impl::GetStartWithFlag() const +bool AbstractAssistentDlg_Impl::GetStartWithFlag() const { return pDlg->GetStartWithFlag(); } -sal_Bool AbstractAssistentDlg_Impl::IsDocEmpty() const +bool AbstractAssistentDlg_Impl::IsDocEmpty() const { return pDlg->IsDocEmpty(); } @@ -247,7 +247,7 @@ void AbstractSdSnapLineDlg_Impl::HideDeleteBtn() { pDlg->HideDeleteBtn(); } -void AbstractSdSnapLineDlg_Impl::SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY) +void AbstractSdSnapLineDlg_Impl::SetInputFields(bool bEnableX, bool bEnableY) { pDlg->SetInputFields(bEnableX, bEnableY); } @@ -269,7 +269,7 @@ void AbstractSdInsertLayerDlg_Impl::SetHelpId( const rtl::OString& rHelpId ) // AbstractSdInsertLayerDlg_Impl end //AbstractSdInsertPasteDlg_Impl begin -sal_Bool AbstractSdInsertPasteDlg_Impl::IsInsertBefore() const +bool AbstractSdInsertPasteDlg_Impl::IsInsertBefore() const { return pDlg->IsInsertBefore(); } @@ -284,11 +284,11 @@ List* AbstractSdInsertPagesObjsDlg_Impl::GetList( sal_uInt16 nType ) { return pDlg->GetList( nType ); } -sal_Bool AbstractSdInsertPagesObjsDlg_Impl::IsLink() +bool AbstractSdInsertPagesObjsDlg_Impl::IsLink() { return pDlg->IsLink(); } -sal_Bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const +bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const { return pDlg->IsRemoveUnnessesaryMasterPages(); } @@ -303,11 +303,11 @@ sal_uInt16 AbstractMorphDlg_Impl::GetFadeSteps() const { return pDlg->GetFadeSteps(); } -sal_Bool AbstractMorphDlg_Impl::IsAttributeFade() const +bool AbstractMorphDlg_Impl::IsAttributeFade() const { return pDlg->IsAttributeFade(); } -sal_Bool AbstractMorphDlg_Impl::IsOrientationFade() const +bool AbstractMorphDlg_Impl::IsOrientationFade() const { return pDlg->IsOrientationFade(); } @@ -411,14 +411,14 @@ SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabCharDialog( ::W } -SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, sal_Bool bAreaPage ) +SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage ) { return new AbstractTabDialog_Impl( new SdPageDlg( pDocShell, pParent, pAttr, bAreaPage ) ); } // add for SdCharDlg end //add for AssistentDlg begin -AbstractAssistentDlg * SdAbstractDialogFactory_Impl::CreateAssistentDlg( ::Window* pParent, sal_Bool bAutoPilot) +AbstractAssistentDlg * SdAbstractDialogFactory_Impl::CreateAssistentDlg( ::Window* pParent, bool bAutoPilot) { return new AbstractAssistentDlg_Impl( new AssistentDlg( pParent, bAutoPilot ) ); } diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 71ca7de2a0ca..f9e1881b739b 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -73,8 +73,8 @@ class SdCustomShowDlg; class AbstractSdCustomShowDlg_Impl : public AbstractSdCustomShowDlg { DECL_ABSTDLG_BASE(AbstractSdCustomShowDlg_Impl,SdCustomShowDlg) - virtual sal_Bool IsModified() const ; - virtual sal_Bool IsCustomShow() const ; + virtual bool IsModified() const ; + virtual bool IsCustomShow() const ; }; //add for SdCharDlg begin @@ -128,11 +128,11 @@ class AbstractAssistentDlg_Impl : public AbstractAssistentDlg DECL_ABSTDLG_BASE(AbstractAssistentDlg_Impl,AssistentDlg) virtual SfxObjectShellLock GetDocument(); virtual OutputType GetOutputMedium() const; - virtual sal_Bool IsSummary() const; + virtual bool IsSummary() const; virtual StartType GetStartType() const; virtual String GetDocPath() const; - virtual sal_Bool GetStartWithFlag() const; - virtual sal_Bool IsDocEmpty() const; + virtual bool GetStartWithFlag() const; + virtual bool IsDocEmpty() const; virtual String GetPassword(); }; @@ -153,7 +153,7 @@ class AbstractSdSnapLineDlg_Impl : public AbstractSdSnapLineDlg virtual void GetAttr(SfxItemSet& rOutAttrs); virtual void HideRadioGroup(); virtual void HideDeleteBtn(); - virtual void SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY); + virtual void SetInputFields(bool bEnableX, bool bEnableY); //from class Window virtual void SetText( const XubString& rStr ); }; @@ -173,7 +173,7 @@ class SdInsertPasteDlg; class AbstractSdInsertPasteDlg_Impl : public AbstractSdInsertPasteDlg { DECL_ABSTDLG_BASE(AbstractSdInsertPasteDlg_Impl,SdInsertPasteDlg) - virtual sal_Bool IsInsertBefore() const; + virtual bool IsInsertBefore() const; }; // add for SdInsertPagesObjsDlg @@ -183,8 +183,8 @@ class AbstractSdInsertPagesObjsDlg_Impl : public AbstractSdInsertPagesObjsDlg DECL_ABSTDLG_BASE(AbstractSdInsertPagesObjsDlg_Impl,SdInsertPagesObjsDlg) virtual ::Window * GetWindow(); //this method is added for return a Window type pointer virtual List* GetList( sal_uInt16 nType ); - virtual sal_Bool IsLink(); - virtual sal_Bool IsRemoveUnnessesaryMasterPages() const; + virtual bool IsLink(); + virtual bool IsRemoveUnnessesaryMasterPages() const; }; // add for MorphDlg @@ -193,8 +193,8 @@ class AbstractMorphDlg_Impl : public AbstractMorphDlg DECL_ABSTDLG_BASE(AbstractMorphDlg_Impl,::sd::MorphDlg) virtual void SaveSettings() const; virtual sal_uInt16 GetFadeSteps() const; - virtual sal_Bool IsAttributeFade() const ; - virtual sal_Bool IsOrientationFade() const ; + virtual bool IsAttributeFade() const ; + virtual bool IsOrientationFade() const ; }; // add for SdStartPresentationDlg @@ -258,8 +258,8 @@ public: virtual AbstractCopyDlg* CreateCopyDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, XColorTable* pColTab, ::sd::View* pView ); virtual AbstractSdCustomShowDlg* CreateSdCustomShowDlg( ::Window* pWindow, SdDrawDocument& rDrawDoc ); virtual SfxAbstractTabDialog* CreateSdTabCharDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell ); - virtual SfxAbstractTabDialog* CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, sal_Bool bAreaPage = sal_True ); - virtual AbstractAssistentDlg* CreateAssistentDlg( ::Window* pParent, sal_Bool bAutoPilot); + virtual SfxAbstractTabDialog* CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage = true ); + virtual AbstractAssistentDlg* CreateAssistentDlg( ::Window* pParent, bool bAutoPilot); virtual AbstractSdModifyFieldDlg* CreateSdModifyFieldDlg( ::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet ); virtual AbstractSdSnapLineDlg* CreateSdSnapLineDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView); virtual AbstractSdInsertLayerDlg* CreateSdInsertLayerDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, String aStr ); diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 95b20c490edd..e578aa38277f 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -111,17 +111,17 @@ void SdPresLayoutDlg::Reset() long nName; // MasterPage austauschen - if( mrOutAttrs.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE, sal_False, &pPoolItem ) == SFX_ITEM_SET ) + if( mrOutAttrs.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE, false, &pPoolItem ) == SFX_ITEM_SET ) { - sal_Bool bMasterPage = ( (const SfxBoolItem*) pPoolItem)->GetValue(); + bool bMasterPage = ( (const SfxBoolItem*) pPoolItem)->GetValue(); maCbxMasterPage.Enable( !bMasterPage ); maCbxMasterPage.Check( bMasterPage ); } // Nicht verwendete MasterPages entfernen - maCbxCheckMasters.Check(sal_False); + maCbxCheckMasters.Check(false); - if(mrOutAttrs.GetItemState(ATTR_PRESLAYOUT_NAME, sal_True, &pPoolItem) == SFX_ITEM_SET) + if(mrOutAttrs.GetItemState(ATTR_PRESLAYOUT_NAME, true, &pPoolItem) == SFX_ITEM_SET) maName = ((const SfxStringItem*)pPoolItem)->GetValue(); else maName.Erase(); @@ -149,7 +149,7 @@ void SdPresLayoutDlg::Reset() void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs) { short nId = maVS.GetSelectItemId(); - sal_Bool bLoad = nId > mnLayoutCount; + bool bLoad = nId > mnLayoutCount; rOutAttrs.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad ) ); String aLayoutName; @@ -244,7 +244,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) Update(); String aFile; - sal_Bool bCancel = sal_False; + bool bCancel = false; switch (nResult) { @@ -263,7 +263,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) break; default: - bCancel = sal_True; + bCancel = true; } delete pDlg; @@ -273,7 +273,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) if( !bCancel ) { // Pruefen, ob Vorlage schon vorhanden - sal_Bool bExists = sal_False; + bool bExists = false; String* pName = (String*)mpLayoutNames->First(); String aCompareStr( maName ); if( maName.Len() == 0 ) @@ -283,7 +283,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) { if( aCompareStr == *pName ) { - bExists = sal_True; + bExists = true; // Vorlage selektieren sal_uInt16 nId = (sal_uInt16) mpLayoutNames->GetCurPos() + 1; maVS.SelectItem( nId ); @@ -328,7 +328,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) } else { - bCancel = sal_True; + bCancel = true; } pDoc->CloseBookmarkDoc(); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 8f63e5b82f75..51fa3f567f4a 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -35,8 +35,8 @@ #include <vcl/svapp.hxx> #include "cusshow.hxx" #include <sfx2/childwin.hxx> - #include <sfx2/viewfrm.hxx> +#include <comphelper/processfactory.hxx> #include "strmname.h" #include "sdtreelb.hxx" @@ -49,16 +49,15 @@ #include "strings.hrc" #endif #include "res_bmp.hrc" -#include "ViewShell.hxx" #include "DrawController.hxx" #include "ViewShellBase.hxx" #include <com/sun/star/embed/XEmbedPersist.hpp> #include <com/sun/star/frame/XDesktop.hpp> -#include <com/sun/star/frame/XFramesSupplier.hpp> #include <svtools/embedtransfer.hxx> -#include <comphelper/processfactory.hxx> #include <tools/diagnose_ex.h> +#include <ViewShell.hxx> +#include <svx/svdlegacy.hxx> using namespace com::sun::star; @@ -85,9 +84,9 @@ public: }; -sal_Bool SD_DLLPRIVATE SdPageObjsTLB::bIsInDrag = sal_False; +bool SD_DLLPRIVATE SdPageObjsTLB::bIsInDrag = false; -sal_Bool SdPageObjsTLB::IsInDrag() +bool SdPageObjsTLB::IsInDrag() { return bIsInDrag; } @@ -104,7 +103,7 @@ SdPageObjsTLB::SdPageObjsTransferable::SdPageObjsTransferable( ::sd::DrawDocShell& rDocShell, NavigatorDragType eDragType, const ::com::sun::star::uno::Any& rTreeListBoxData ) - : SdTransferable(rDocShell.GetDoc(), NULL, sal_True), + : SdTransferable(rDocShell.GetDoc(), NULL, true), mrParent( rParent ), maBookmark( rBookmark ), mrDocShell( rDocShell ), @@ -154,7 +153,6 @@ sal_Bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star: void SdPageObjsTLB::SdPageObjsTransferable::DragFinished( sal_Int8 nDropAction ) { mrParent.OnDragFinished( nDropAction ); - SdTransferable::DragFinished(nDropAction); } // ----------------------------------------------------------------------------- @@ -236,9 +234,6 @@ sal_uInt32 SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId (void) return mnListBoxDropFormatId; } - - - /************************************************************************* |* |* Ctor1 SdPageObjsTLB @@ -256,7 +251,7 @@ SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId ) , maImgGraphic ( BitmapEx( SdResId( BMP_GRAPHIC ) ) ) , maImgOleH ( BitmapEx( SdResId( BMP_OLE_H ) ) ) , maImgGraphicH ( BitmapEx( SdResId( BMP_GRAPHIC_H ) ) ) -, mbLinkableSelected ( sal_False ) +, mbLinkableSelected ( false ) , mpDropNavWin ( NULL ) , mbShowAllShapes ( false ) , mbShowAllPages ( false ) @@ -311,8 +306,15 @@ String SdPageObjsTLB::GetObjectName( { aRet = pObject->GetName(); - if( !aRet.Len() && pObject->ISA( SdrOle2Obj ) ) - aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName(); + if( !aRet.Len() ) + { + const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObject); + + if(pSdrOle2Obj) + { + aRet = pSdrOle2Obj->GetPersistName(); + } + } } if (bCreate @@ -321,7 +323,7 @@ String SdPageObjsTLB::GetObjectName( && pObject!=NULL) { aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME); - aRet.SearchAndReplaceAscii("%1", String::CreateFromInt32(pObject->GetOrdNum() + 1)); + aRet.SearchAndReplaceAscii("%1", String::CreateFromInt32(pObject->GetNavigationPosition() + 1)); } return aRet; @@ -333,9 +335,9 @@ String SdPageObjsTLB::GetObjectName( |* \************************************************************************/ -sal_Bool SdPageObjsTLB::SelectEntry( const String& rName ) +bool SdPageObjsTLB::SelectEntry( const String& rName ) { - sal_Bool bFound = sal_False; + bool bFound = false; if( rName.Len() ) { @@ -347,7 +349,7 @@ sal_Bool SdPageObjsTLB::SelectEntry( const String& rName ) aTmp = GetEntryText( pEntry ); if( aTmp == rName ) { - bFound = sal_True; + bFound = true; SetCurEntry( pEntry ); } } @@ -361,10 +363,10 @@ sal_Bool SdPageObjsTLB::SelectEntry( const String& rName ) |* \************************************************************************/ -sal_Bool SdPageObjsTLB::HasSelectedChilds( const String& rName ) +bool SdPageObjsTLB::HasSelectedChilds( const String& rName ) { - sal_Bool bFound = sal_False; - sal_Bool bChilds = sal_False; + bool bFound = false; + bool bChilds = false; if( rName.Len() ) { @@ -376,11 +378,11 @@ sal_Bool SdPageObjsTLB::HasSelectedChilds( const String& rName ) aTmp = GetEntryText( pEntry ); if( aTmp == rName ) { - bFound = sal_True; - sal_Bool bExpanded = IsExpanded( pEntry ); + bFound = true; + bool bExpanded = IsExpanded( pEntry ); long nCount = GetChildSelectionCount( pEntry ); if( bExpanded && nCount > 0 ) - bChilds = sal_True; + bChilds = true; } } } @@ -394,8 +396,7 @@ sal_Bool SdPageObjsTLB::HasSelectedChilds( const String& rName ) |* \************************************************************************/ -void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, sal_Bool bAllPages, - const String& rDocName) +void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, const String& rDocName) { String aSelection; if( GetSelectionCount() > 0 ) @@ -406,7 +407,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, sal_Bool bAllPages, mpDoc = pInDoc; maDocName = rDocName; - mbShowAllPages = (bAllPages == sal_True); + mbShowAllPages = bAllPages; mpMedium = NULL; SdPage* pPage = NULL; @@ -423,8 +424,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, sal_Bool bAllPages, if( (mbShowAllPages || pPage->GetPageKind() == PK_STANDARD) && !(pPage->GetPageKind()==PK_HANDOUT) ) //#94954# never list the normal handout page ( handout-masterpage is used instead ) { - sal_Bool bPageExluded = pPage->IsExcluded(); - + bool bPageExluded = pPage->IsExcluded(); bool bPageBelongsToShow = PageBelongsToCurrentShow (pPage); bPageExluded |= !bPageBelongsToShow; @@ -475,7 +475,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, SfxMedium* pInMedium, aImgDocOpen, aImgDocClosed, NULL, - sal_True, + true, LIST_APPEND, reinterpret_cast< void* >( 1 ) ); @@ -509,7 +509,7 @@ void SdPageObjsTLB::AddShapeList ( aIcon, aIcon, pParentEntry, - sal_False, + false, LIST_APPEND, pUserData); @@ -524,9 +524,8 @@ void SdPageObjsTLB::AddShapeList ( SdrObjListIter aIter( rList, - !rList.HasObjectNavigationOrder() /* use navigation order, if available */, IM_FLAT, - sal_False /*not reverse*/); + false /*not reverse*/); while( aIter.IsMore() ) { @@ -541,7 +540,7 @@ void SdPageObjsTLB::AddShapeList ( if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2 ) { SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgOle, maImgOle, pEntry, - sal_False, LIST_APPEND, pObj); + false, LIST_APPEND, pObj); SetExpandedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST ); SetCollapsedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST ); @@ -549,15 +548,15 @@ void SdPageObjsTLB::AddShapeList ( else if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF ) { SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgGraphic, maImgGraphic, pEntry, - sal_False, LIST_APPEND, pObj ); + false, LIST_APPEND, pObj ); SetExpandedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST ); SetCollapsedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST ); } - else if (pObj->IsGroupObject()) + else if (pObj->getChildrenOfSdrObject()) { AddShapeList( - *pObj->GetSubList(), + *pObj->getChildrenOfSdrObject(), pObj, aStr, false, @@ -567,7 +566,7 @@ void SdPageObjsTLB::AddShapeList ( else { SvLBoxEntry* pNewEntry = InsertEntry( aStr, rIconProvider.maImgObjects, rIconProvider.maImgObjects, pEntry, - sal_False, LIST_APPEND, pObj ); + false, LIST_APPEND, pObj ); SetExpandedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST ); SetCollapsedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST ); @@ -631,13 +630,13 @@ bool SdPageObjsTLB::GetShowAllShapes (void) const |* \************************************************************************/ -sal_Bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) +bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) { if( pInDoc ) mpDoc = pInDoc; if( !mpDoc ) - return( sal_False ); + return( false ); SdrObject* pObj = NULL; SdPage* pPage = NULL; @@ -654,17 +653,16 @@ sal_Bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) if( pPage->GetPageKind() == PK_STANDARD ) { if( !pEntry ) - return( sal_False ); + return( false ); aName = GetEntryText( pEntry ); if( pPage->GetName() != aName ) - return( sal_False ); + return( false ); pEntry = Next( pEntry ); SdrObjListIter aIter( *pPage, - !pPage->HasObjectNavigationOrder() /* use navigation order, if available */, IM_DEEPWITHGROUPS ); while( aIter.IsMore() ) @@ -676,12 +674,12 @@ sal_Bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) if( aObjectName.Len() ) { if( !pEntry ) - return( sal_False ); + return( false ); aName = GetEntryText( pEntry ); if( aObjectName != aName ) - return( sal_False ); + return( false ); pEntry = Next( pEntry ); } @@ -773,7 +771,7 @@ void SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry ) aImgPage, aImgPage, pFileEntry, - sal_False, + false, LIST_APPEND, reinterpret_cast< void* >( 1 ) ); @@ -864,7 +862,7 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed) if( pMed ) { // in this mode the document is also owned and controlled by this instance - mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_True); + mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, true); if (mxBookmarkDocShRef->DoLoad(pMed)) mpBookmarkDoc = mxBookmarkDocShRef->GetDoc(); else @@ -933,12 +931,12 @@ void SdPageObjsTLB::SelectHdl() { SvLBoxEntry* pEntry = FirstSelected(); - mbLinkableSelected = sal_True; + mbLinkableSelected = true; while( pEntry && mbLinkableSelected ) { if( NULL == pEntry->GetUserData() ) - mbLinkableSelected = sal_False; + mbLinkableSelected = false; pEntry = NextSelected( pEntry ); } @@ -999,26 +997,24 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel) // Select all entries and disable them as drop targets. SetSelectionMode(MULTIPLE_SELECTION); - SetCursor(NULL, sal_False); - SelectAll(sal_True, sal_False); - EnableSelectionAsDropTarget(sal_False, sal_True); + SetCursor(NULL, false); + SelectAll(true, false); + EnableSelectionAsDropTarget(false, true); // Enable only the entries as drop targets that are children of the // page under the mouse. SvLBoxEntry* pParent = GetRootLevelParent(pEntry); if (pParent != NULL) { - SelectAll(sal_False, sal_False); - Select(pParent, sal_True); - // for (SvLBoxEntry*pChild=FirstChild(pParent); pChild!=NULL; pChild=NextSibling(pChild)) - // Select(pChild, sal_True); - EnableSelectionAsDropTarget(sal_True, sal_True);//sal_False); + SelectAll(false, false); + Select(pParent, true); + EnableSelectionAsDropTarget(true, true);//false); } // Set selection back to the entry under the mouse. - SelectAll(sal_False,sal_False); + SelectAll(false,false); SetSelectionMode(SINGLE_SELECTION); - Select(pEntry, sal_True); + Select(pEntry, true); // Aus dem ExecuteDrag heraus kann der Navigator geloescht werden // (beim Umschalten auf einen anderen Dokument-Typ), das wuerde aber @@ -1054,15 +1050,10 @@ void SdPageObjsTLB::DoDrag() if( eDragType == NAVIGATOR_DRAGTYPE_LINK ) nDNDActions = DND_ACTION_LINK; // #93240# Either COPY *or* LINK, never both! - else if (mpDoc->GetSdPageCount(PK_STANDARD) == 1) - { - // Can not move away the last slide in a document. - nDNDActions = DND_ACTION_COPY; - } SvTreeListBox::ReleaseMouse(); - bIsInDrag = sal_True; + bIsInDrag = true; SvLBoxDDInfo aDDInfo; memset(&aDDInfo,0,sizeof(SvLBoxDDInfo)); @@ -1076,15 +1067,16 @@ void SdPageObjsTLB::DoDrag() // object is destroyed by internal reference mechanism SdTransferable* pTransferable = new SdPageObjsTLB::SdPageObjsTransferable( *this, aBookmark, *pDocShell, eDragType, aTreeListBoxData); + OSL_TRACE("created new SdPageObjsTransferable at %x", pTransferable); // Get the view. - ::sd::ViewShell* pViewShell = GetViewShellForDocShell(*pDocShell); - if (pViewShell == NULL) + sd::View* pView = NULL; + if (pDocShell != NULL) { - OSL_ASSERT(pViewShell!=NULL); - return; + ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); + if (pViewShell != NULL) + pView = pViewShell->GetView(); } - sd::View* pView = pViewShell->GetView(); if (pView == NULL) { OSL_ASSERT(pView!=NULL); @@ -1095,32 +1087,26 @@ void SdPageObjsTLB::DoDrag() void* pUserData = GetCurEntry()->GetUserData(); if (pUserData != NULL && pUserData != (void*)1) pObject = reinterpret_cast<SdrObject*>(pUserData); - if (pObject != NULL) - { - // For shapes without a user supplied name (the automatically - // created name does not count), a different drag and drop technique - // is used. - if (GetObjectName(pObject, false).Len() == 0) - { - AddShapeToTransferable(*pTransferable, *pObject); - pTransferable->SetView(pView); - SD_MOD()->pTransferDrag = pTransferable; - } + if (pObject == NULL) + return; - // Unnamed shapes have to be selected to be recognized by the - // current drop implementation. In order to have a consistent - // behaviour for all shapes, every shape that is to be dragged is - // selected first. - SdrPageView* pPageView = pView->GetSdrPageView(); - pView->UnmarkAllObj(pPageView); - pView->MarkObj(pObject, pPageView); - } - else + // For shapes without a user supplied name (the automatically + // created name does not count), a different drag and drop technique + // is used. + if (GetObjectName(pObject, false).Len() == 0) { + AddShapeToTransferable(*pTransferable, *pObject); pTransferable->SetView(pView); SD_MOD()->pTransferDrag = pTransferable; } + // Unnamed shapes have to be selected to be recognized by the + // current drop implementation. In order to have a consistent + // behaviour for all shapes, every shape that is to be dragged is + // selected first. + pView->UnmarkAllObj(); + pView->MarkObj(*pObject); + pTransferable->StartDrag( this, nDNDActions ); } } @@ -1145,7 +1131,7 @@ void SdPageObjsTLB::OnDragFinished( sal_uInt8 ) } mpDropNavWin = NULL; - bIsInDrag = sal_False; + bIsInDrag = false; } /************************************************************************* @@ -1167,7 +1153,7 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent) SvLBoxEntry* pEntry = GetDropTarget(rEvent.maPosPixel); if (rEvent.mbLeaving || !CheckDragAndDropMode( this, rEvent.mnAction )) { - ImplShowTargetEmphasis( pTargetEntry, sal_False ); + ImplShowTargetEmphasis( pTargetEntry, false ); } else if( !nDragDropMode ) { @@ -1180,16 +1166,16 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent) // Draw emphasis. if (pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS)) { - ImplShowTargetEmphasis( pTargetEntry, sal_False ); + ImplShowTargetEmphasis( pTargetEntry, false ); pTargetEntry = pEntry; - ImplShowTargetEmphasis( pTargetEntry, sal_True ); + ImplShowTargetEmphasis( pTargetEntry, true ); } } } // Hide emphasis when there is no valid drop action. if (nResult == DND_ACTION_NONE) - ImplShowTargetEmphasis(pTargetEntry, sal_False); + ImplShowTargetEmphasis(pTargetEntry, false); return nResult; } @@ -1256,7 +1242,7 @@ IMPL_STATIC_LINK(SdPageObjsTLB, ExecDragHdl, void*, EMPTYARG) bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const { - // Return <TRUE/> as default when there is no custom show or when none + // Return <true/> as default when there is no custom show or when none // is used. The page does then belong to the standard show. bool bBelongsToShow = true; @@ -1304,27 +1290,27 @@ sal_Bool SdPageObjsTLB::NotifyMoving( if (pSourceObject == reinterpret_cast<SdrObject*>(1)) pSourceObject = NULL; - if (pTargetObject != NULL && pSourceObject != NULL) + if (pTargetObject && pSourceObject ) { - SdrPage* pObjectList = pSourceObject->GetPage(); - if (pObjectList != NULL) + SdrPage* pObjectList = pSourceObject->getSdrPageFromSdrObject(); + if (pObjectList ) { sal_uInt32 nNewPosition; if (pTargetObject == reinterpret_cast<SdrObject*>(1)) nNewPosition = 0; else nNewPosition = pTargetObject->GetNavigationPosition() + 1; - pObjectList->SetObjectNavigationPosition(*pSourceObject, nNewPosition); + pObjectList->SetUserNavigationPosition(*pSourceObject, nNewPosition); } // Update the tree list. - if (pTarget == NULL) + if (!pTarget) { rpNewParent = 0; rNewChildPos = 0; - return sal_True; + return true; } - else if (GetParent(pDestination) == NULL) + else if ( !GetParent(pDestination) ) { rpNewParent = pDestination; rNewChildPos = 0; @@ -1336,10 +1322,10 @@ sal_Bool SdPageObjsTLB::NotifyMoving( rNewChildPos += nCurEntrySelPos; nCurEntrySelPos++; } - return sal_True; + return true; } else - return sal_False; + return false; } @@ -1351,6 +1337,8 @@ SvLBoxEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation) if (pEntry == NULL) return NULL; + OSL_TRACE("entry is %s", + ::rtl::OUStringToOString(GetEntryText(pEntry), RTL_TEXTENCODING_UTF8).getStr()); if (GetParent(pEntry) == NULL) { // Use page entry as insertion position. @@ -1373,6 +1361,8 @@ SvLBoxEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation) else break; } + OSL_TRACE("returning %s", + ::rtl::OUStringToOString(GetEntryText(pEntry), RTL_TEXTENCODING_UTF8).getStr()); } return pEntry; @@ -1434,15 +1424,14 @@ void SdPageObjsTLB::AddShapeToTransferable ( pDocShell->FillTransferableObjectDescriptor(aObjectDescriptor); } - Point aDragPos (rObject.GetCurrentBoundRect().Center()); - //Point aDragPos (0,0); - aObjectDescriptor.maDragStartPos = aDragPos; - // aObjectDescriptor.maSize = GetAllMarkedRect().GetSize(); + const basegfx::B2DPoint aDragPos(rObject.getObjectRange(0).getCenter()); + aObjectDescriptor.maDragStartPos = Point(basegfx::fround(aDragPos.getX()), basegfx::fround(aDragPos.getY())); + if (pDocShell != NULL) aObjectDescriptor.maDisplayName = pDocShell->GetMedium()->GetURLObject().GetURLNoPass(); else aObjectDescriptor.maDisplayName = String(); - aObjectDescriptor.mbCanLink = sal_False; + aObjectDescriptor.mbCanLink = false; rTransferable.SetStartPos(aDragPos); rTransferable.SetObjectDescriptor( aObjectDescriptor ); diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx index 113f361248a8..ac7cdd15cefa 100644 --- a/sd/source/ui/dlg/tabtempl.cxx +++ b/sd/source/ui/dlg/tabtempl.cxx @@ -66,7 +66,7 @@ SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) : - SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, sal_False ), + SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, false ), rDocShell ( *pDocShell ), pSdrView ( pView ), pColorTab ( pModel->GetColorTable() ), diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 18879cf715e0..876200b1b5e0 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -53,6 +53,7 @@ #include <svl/aeitem.hxx> #include <editeng/colritem.hxx> #include <svx/svdoole2.hxx> +#include <svx/svdograf.hxx> #include <sfx2/docfile.hxx> #include <sot/storage.hxx> #include <basic/sbmeth.hxx> @@ -138,7 +139,7 @@ SdTPAction::SdTPAction( Window* pWindow, const SfxItemSet& rInAttrs ) : rOutAttrs ( rInAttrs ), mpView ( NULL ), mpDoc ( NULL ), - bTreeUpdated ( sal_False ) + bTreeUpdated ( false ) { aEdtSound.SetAccessibleName(String(SdResId(STR_PATHNAME))); aBtnSeek.SetAccessibleRelationMemberOf( &aFlSeparator ); @@ -200,41 +201,13 @@ void SdTPAction::SetView( const ::sd::View* pSdView ) void SdTPAction::Construct() { // OLE-Actionlistbox auffuellen - SdrOle2Obj* pOleObj = NULL; - SdrGrafObj* pGrafObj = NULL; - sal_Bool bOLEAction = sal_False; + SdrOle2Obj* pOleObj = dynamic_cast< SdrOle2Obj* >(mpView->getSelectedIfSingle()); + SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(mpView->getSelectedIfSingle()); + bool bOLEAction = false; - if ( mpView->AreObjectsMarked() ) - { - const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - SdrObject* pObj; - - if (rMarkList.GetMarkCount() == 1) - { - SdrMark* pMark = rMarkList.GetMark(0); - pObj = pMark->GetMarkedSdrObj(); - - sal_uInt32 nInv = pObj->GetObjInventor(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); - - if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2) - { - pOleObj = (SdrOle2Obj*) pObj; - } - else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRAF) - { - pGrafObj = (SdrGrafObj*) pObj; - } -// // VCXControl ? -// else if( pObj->IsA( TYPE( VCSbxDrawObject ) ) ) -// { -// bDisableAll = sal_True; -// } - } - } if( pGrafObj ) { - bOLEAction = sal_True; + bOLEAction = true; aVerbVector.push_back( 0 ); aLbOLEAction.InsertEntry( MnemonicGenerator::EraseAllMnemonicChars( String( SdResId( STR_EDIT_OBJ ) ) ) ); @@ -244,7 +217,7 @@ void SdTPAction::Construct() uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef(); if ( xObj.is() ) { - bOLEAction = sal_True; + bOLEAction = true; uno::Sequence < embed::VerbDescriptor > aVerbs; try { @@ -297,7 +270,7 @@ void SdTPAction::Construct() sal_Bool SdTPAction::FillItemSet( SfxItemSet& rAttrs ) { - sal_Bool bModified = sal_False; + bool bModified = false; presentation::ClickAction eCA = presentation::ClickAction_NONE; if( aLbAction.GetSelectEntryCount() ) @@ -306,12 +279,12 @@ sal_Bool SdTPAction::FillItemSet( SfxItemSet& rAttrs ) if( aLbAction.GetSavedValue() != aLbAction.GetSelectEntryPos() ) { rAttrs.Put( SfxAllEnumItem( ATTR_ACTION, (sal_uInt16)eCA ) ); - bModified = sal_True; + bModified = true; } else rAttrs.InvalidateItem( ATTR_ACTION ); - String aFileName = GetEditText( sal_True ); + String aFileName = GetEditText( true ); if( aFileName.Len() == 0 ) rAttrs.InvalidateItem( ATTR_ACTION_FILENAME ); else @@ -327,7 +300,7 @@ sal_Bool SdTPAction::FillItemSet( SfxItemSet& rAttrs ) INetURLObject::DECODE_UNAMBIGUOUS ); rAttrs.Put( SfxStringItem( ATTR_ACTION_FILENAME, aFileName ) ); - bModified = sal_True; + bModified = true; } else { @@ -367,7 +340,7 @@ void SdTPAction::Reset( const SfxItemSet& rAttrs ) case presentation::ClickAction_BOOKMARK: { if( !aLbTree.SelectEntry( aFileName ) ) - aLbTree.SelectAll( sal_False ); + aLbTree.SelectAll( false ); } break; @@ -418,8 +391,8 @@ void SdTPAction::UpdateTree() if( !bTreeUpdated && mpDoc && mpDoc->GetDocSh() && mpDoc->GetDocSh()->GetMedium() ) { //aLbTree.Clear(); - aLbTree.Fill( mpDoc, sal_True, mpDoc->GetDocSh()->GetMedium()->GetName() ); - bTreeUpdated = sal_True; + aLbTree.Fill( mpDoc, true, mpDoc->GetDocSh()->GetMedium()->GetName() ); + bTreeUpdated = true; } } @@ -429,11 +402,10 @@ void SdTPAction::OpenFileDialog() { // Soundpreview nur fuer Interaktionen mit Sound presentation::ClickAction eCA = GetActualClickAction(); - sal_Bool bSound = ( eCA == presentation::ClickAction_SOUND ); - sal_Bool bPage = ( eCA == presentation::ClickAction_BOOKMARK ); - sal_Bool bDocument = ( eCA == presentation::ClickAction_DOCUMENT || - eCA == presentation::ClickAction_PROGRAM ); - sal_Bool bMacro = ( eCA == presentation::ClickAction_MACRO ); + bool bSound = ( eCA == presentation::ClickAction_SOUND ); + bool bPage = ( eCA == presentation::ClickAction_BOOKMARK ); + bool bDocument = ( eCA == presentation::ClickAction_DOCUMENT || eCA == presentation::ClickAction_PROGRAM ); + bool bMacro = ( eCA == presentation::ClickAction_MACRO ); if( bPage ) { @@ -708,7 +680,7 @@ IMPL_LINK( SdTPAction, CheckFileHdl, void *, EMPTYARG ) // Ueberpruefen, ob es eine gueltige Draw-Datei ist SfxMedium aMedium( aFile, STREAM_READ | STREAM_NOCREATE, - sal_True ); // Download + true ); // Download if( aMedium.IsStorage() ) { @@ -730,7 +702,7 @@ IMPL_LINK( SdTPAction, CheckFileHdl, void *, EMPTYARG ) aLastFile = aFile; aLbTreeDocument.Clear(); - aLbTreeDocument.Fill( pBookmarkDoc, sal_True, aFile ); + aLbTreeDocument.Fill( pBookmarkDoc, true, aFile ); mpDoc->CloseBookmarkDoc(); aLbTreeDocument.Show(); } @@ -834,7 +806,7 @@ void SdTPAction::SetEditText( String const & rStr ) //------------------------------------------------------------------------ -String SdTPAction::GetEditText( sal_Bool bFullDocDestination ) +String SdTPAction::GetEditText( bool bFullDocDestination ) { String aStr; presentation::ClickAction eCA = GetActualClickAction(); diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 527fcb8a3724..f5c8bd743615 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -96,9 +96,6 @@ sal_Bool SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs ) { SvxGridTabPage::FillItemSet(rAttrs); SdOptionsSnapItem* pOptsItem = NULL; -// if(SFX_ITEM_SET != rAttrs.GetItemState( ATTR_OPTIONS_SNAP, sal_False, (const SfxPoolItem**)&pOptsItem )) -// pExampleSet->GetItemState( ATTR_OPTIONS_SNAP, sal_False, (const SfxPoolItem**)&pOptsItem ); - SdOptionsSnapItem aOptsItem( ATTR_OPTIONS_SNAP ); aOptsItem.GetOptionsSnap().SetSnapHelplines( aCbxSnapHelplines.IsChecked() ); @@ -117,7 +114,7 @@ sal_Bool SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs ) // Evtl. vorhandenes GridItem wird geholt, um nicht versehentlich // irgendwelche Standardwerte einzustellen - return( sal_True ); + return( true ); } // ----------------------------------------------------------------------- @@ -178,7 +175,7 @@ SdTpOptionsContents::~SdTpOptionsContents() sal_Bool SdTpOptionsContents::FillItemSet( SfxItemSet& rAttrs ) { - sal_Bool bModified = sal_False; + bool bModified = false; if( aCbxRuler.GetSavedValue() != aCbxRuler.IsChecked() || aCbxMoveOutline.GetSavedValue() != aCbxMoveOutline.IsChecked() || @@ -195,7 +192,7 @@ sal_Bool SdTpOptionsContents::FillItemSet( SfxItemSet& rAttrs ) //aOptsItem.GetOptionsLayout().SetHelplines( aCbxHelplines.IsChecked() ); rAttrs.Put( aOptsItem ); - bModified = sal_True; + bModified = true; } return( bModified ); } @@ -353,8 +350,7 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet ) // Metrik ggfs. aendern (da TabPage im Dialog liegt, // wo die Metrik eingestellt werden kann const SfxPoolItem* pAttr = NULL; - if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC , sal_False, - (const SfxPoolItem**)&pAttr )) + if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC , false, (const SfxPoolItem**)&pAttr )) { const SfxUInt16Item* pItem = (SfxUInt16Item*) pAttr; @@ -364,11 +360,11 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet ) { // Metriken einstellen sal_Int64 nVal = aMtrFldOriginalWidth.Denormalize( aMtrFldOriginalWidth.GetValue( FUNIT_TWIP ) ); - SetFieldUnit( aMtrFldOriginalWidth, eFUnit, sal_True ); + SetFieldUnit( aMtrFldOriginalWidth, eFUnit, true ); aMtrFldOriginalWidth.SetValue( aMtrFldOriginalWidth.Normalize( nVal ), FUNIT_TWIP ); nVal = aMtrFldOriginalHeight.Denormalize( aMtrFldOriginalHeight.GetValue( FUNIT_TWIP ) ); - SetFieldUnit( aMtrFldOriginalHeight, eFUnit, sal_True ); + SetFieldUnit( aMtrFldOriginalHeight, eFUnit, true ); aMtrFldOriginalHeight.SetValue( aMtrFldOriginalHeight.Normalize( nVal ), FUNIT_TWIP ); @@ -417,7 +413,7 @@ int SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet ) sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs ) { - sal_Bool bModified = sal_False; + bool bModified = false; if( aCbxStartWithTemplate.GetSavedValue() != aCbxStartWithTemplate.IsChecked() || aCbxMarkedHitMovesAlways.GetSavedValue()!= aCbxMarkedHitMovesAlways.IsChecked() || @@ -447,7 +443,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs ) : ::com::sun::star::document::PrinterIndependentLayout::ENABLED); rAttrs.Put( aOptsItem ); - bModified = sal_True; + bModified = true; } // Metrik @@ -455,9 +451,8 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs ) if ( nMPos != aLbMetric.GetSavedValue() ) { sal_uInt16 nFieldUnit = (sal_uInt16)(long)aLbMetric.GetEntryData( nMPos ); - rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ), - (sal_uInt16)nFieldUnit ) ); - bModified |= sal_True; + rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ), (sal_uInt16)nFieldUnit ) ); + bModified = true; } // Tabulatorabstand @@ -467,7 +462,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs ) SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWh ); SfxUInt16Item aDef( nWh,(sal_uInt16)GetCoreValue( aMtrFldTabstop, eUnit ) ); rAttrs.Put( aDef ); - bModified |= sal_True; + bModified = true; } sal_Int32 nX, nY; @@ -476,7 +471,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs ) rAttrs.Put( SfxInt32Item( ATTR_OPTIONS_SCALE_X, nX ) ); rAttrs.Put( SfxInt32Item( ATTR_OPTIONS_SCALE_Y, nY ) ); - bModified = sal_True; + bModified = true; } return( bModified ); @@ -756,28 +751,28 @@ String SdTpOptionsMisc::GetScale( sal_Int32 nX, sal_Int32 nY ) // ----------------------------------------------------------------------- -sal_Bool SdTpOptionsMisc::SetScale( const String& aScale, sal_Int32& rX, sal_Int32& rY ) +bool SdTpOptionsMisc::SetScale( const String& aScale, sal_Int32& rX, sal_Int32& rY ) { if( aScale.GetTokenCount( TOKEN ) != 2 ) - return( sal_False ); + return( false ); ByteString aTmp( aScale.GetToken( 0, TOKEN ), RTL_TEXTENCODING_ASCII_US ); if( !aTmp.IsNumericAscii() ) - return( sal_False ); + return( false ); rX = (long) aTmp.ToInt32(); if( rX == 0 ) - return( sal_False ); + return( false ); aTmp = ByteString( aScale.GetToken( 1, TOKEN ), RTL_TEXTENCODING_ASCII_US ); if( !aTmp.IsNumericAscii() ) - return( sal_False ); + return( false ); rY = (long) aTmp.ToInt32(); if( rY == 0 ) - return( sal_False ); + return( false ); - return( sal_True ); + return( true ); } @@ -841,7 +836,7 @@ void SdTpOptionsMisc::UpdateCompatibilityControls (void) void SdTpOptionsMisc::PageCreated (SfxAllItemSet aSet) { - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG,sal_False); + SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG); if (pFlagItem) { sal_uInt32 nFlags=pFlagItem->GetValue(); diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx index a58b47b599e2..04161778847c 100644 --- a/sd/source/ui/dlg/unchss.cxx +++ b/sd/source/ui/dlg/unchss.cxx @@ -29,6 +29,7 @@ #include <svl/style.hxx> #include <svl/smplhint.hxx> #include <svx/svdobj.hxx> +#include <svx/globaldrawitempool.hxx> #include "unchss.hxx" @@ -40,34 +41,23 @@ #include "glob.hrc" -TYPEINIT1(StyleSheetUndoAction, SdUndoAction); - - - /************************************************************************* |* |* Konstruktor |* \************************************************************************/ -StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, - SfxStyleSheet* pTheStyleSheet, - const SfxItemSet* pTheNewItemSet) : - SdUndoAction(pTheDoc) +StyleSheetUndoAction::StyleSheetUndoAction( + SdDrawDocument& rTheDoc, + SfxStyleSheet& rTheStyleSheet, + const SfxItemSet& rTheNewItemSet) +: SdUndoAction(&rTheDoc), + mrStyleSheet(rTheStyleSheet), + maNewSet(rTheNewItemSet), + maOldSet(mrStyleSheet.GetItemSet()) { - DBG_ASSERT(pTheStyleSheet, "Undo ohne StyleSheet ???"); - pStyleSheet = pTheStyleSheet; - - // ItemSets anlegen; Vorsicht, das neue koennte aus einem anderen Pool - // stammen, also mitsamt seinen Items clonen - pNewSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(), pTheNewItemSet->GetRanges()); - pTheDoc->MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc ); - - pOldSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(),pStyleSheet->GetItemSet().GetRanges()); - pTheDoc->MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc ); - aComment = String(SdResId(STR_UNDO_CHANGE_PRES_OBJECT)); - String aName(pStyleSheet->GetName()); + String aName(mrStyleSheet.GetName()); // Layoutnamen und Separator loeschen String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ) ); @@ -122,14 +112,16 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, void StyleSheetUndoAction::Undo() { - SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); - mpDoc->MigrateItemSet( pOldSet, &aNewSet, mpDoc ); + mrStyleSheet.GetItemSet().Set(maOldSet); - pStyleSheet->GetItemSet().Set(aNewSet); - if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) - ( (SdStyleSheet*)pStyleSheet )->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + if(SD_STYLE_FAMILY_PSEUDO == mrStyleSheet.GetFamily()) + { + static_cast< SdStyleSheet& >(mrStyleSheet).GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + } else - pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + { + mrStyleSheet.Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + } } /************************************************************************* @@ -140,14 +132,16 @@ void StyleSheetUndoAction::Undo() void StyleSheetUndoAction::Redo() { - SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); - mpDoc->MigrateItemSet( pNewSet, &aNewSet, mpDoc ); + mrStyleSheet.GetItemSet().Set(maNewSet); - pStyleSheet->GetItemSet().Set(aNewSet); - if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) - ( (SdStyleSheet*)pStyleSheet )->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + if(SD_STYLE_FAMILY_PSEUDO == mrStyleSheet.GetFamily()) + { + static_cast< SdStyleSheet& >(mrStyleSheet).GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + } else - pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + { + mrStyleSheet.Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + } } /************************************************************************* @@ -158,8 +152,6 @@ void StyleSheetUndoAction::Redo() StyleSheetUndoAction::~StyleSheetUndoAction() { - delete pNewSet; - delete pOldSet; } /************************************************************************* @@ -172,3 +164,5 @@ String StyleSheetUndoAction::GetComment() const { return aComment; } + +// eof diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 454accb9fe27..5f85ce4b7efe 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -168,7 +168,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale ) void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) { - mpDocSh->SetWaitCursor( sal_True ); + mpDocSh->SetWaitCursor( true ); aPrgs.SetValue( 0 ); Fraction aScale; @@ -236,7 +236,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) } aPrgs.SetValue( 0 ); - mpDocSh->SetWaitCursor( sal_False ); + mpDocSh->SetWaitCursor( false ); } // ----------------------------------------------------------------------------- @@ -276,8 +276,8 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf, if( aRect.Bottom() > ( rMaxSize.Height() - 1L ) ) aRect.Bottom() = rMaxSize.Height() - 1L; - rMtf.AddAction( new MetaLineColorAction( aColor, sal_True ) ); - rMtf.AddAction( new MetaFillColorAction( aColor, sal_True ) ); + rMtf.AddAction( new MetaLineColorAction( aColor, true ) ); + rMtf.AddAction( new MetaFillColorAction( aColor, true ) ); rMtf.AddAction( new MetaRectAction( aRect ) ); } @@ -352,19 +352,22 @@ void SdVectorizeDlg::LoadSettings() sal_uInt16 nLayers; sal_uInt16 nReduce; sal_uInt16 nFillHoles; - sal_Bool bFillHoles; + bool bFillHoles; if( xIStm.Is() ) { SdIOCompat aCompat( *xIStm, STREAM_READ ); - *xIStm >> nLayers >> nReduce >> nFillHoles >> bFillHoles; + sal_Bool bTempBOOL; + + *xIStm >> nLayers >> nReduce >> nFillHoles; + *xIStm >> bTempBOOL; bFillHoles = bTempBOOL; } else { nLayers = 8; nReduce = 0; nFillHoles = 32; - bFillHoles = sal_False; + bFillHoles = false; } aNmLayers.SetValue( nLayers ); @@ -388,6 +391,6 @@ void SdVectorizeDlg::SaveSettings() const { SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 ); *xOStm << (sal_uInt16) aNmLayers.GetValue() << (sal_uInt16) aMtReduce.GetValue(); - *xOStm << (sal_uInt16) aMtFillHoles.GetValue() << aCbFillHoles.IsChecked(); + *xOStm << (sal_uInt16) aMtFillHoles.GetValue() << (sal_Bool)aCbFillHoles.IsChecked(); } } |