Kaydet (Commit) 56734a70 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

sd: consistent code formatting

Align statements, redux of vertical space footprint.

Change-Id: I00bcdb7dacffba944bbc26c7e9abf75e505bf21b
üst e4e5cfb2
...@@ -288,9 +288,7 @@ void ViewShell::Exit() ...@@ -288,9 +288,7 @@ void ViewShell::Exit()
Deactivate (true); Deactivate (true);
if (IsMainViewShell()) if (IsMainViewShell())
{
GetDocSh()->Disconnect(this); GetDocSh()->Disconnect(this);
}
SetIsMainViewShell(false); SetIsMainViewShell(false);
} }
...@@ -330,17 +328,13 @@ void ViewShell::Activate(bool bIsMDIActivate) ...@@ -330,17 +328,13 @@ void ViewShell::Activate(bool bIsMDIActivate)
rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) ); rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );
if(xSlideShow.is() && xSlideShow->isRunning() ) if(xSlideShow.is() && xSlideShow->isRunning() )
{
xSlideShow->activate(GetViewShellBase()); xSlideShow->activate(GetViewShellBase());
}
if(HasCurrentFunction()) if(HasCurrentFunction())
{
GetCurrentFunction()->Activate(); GetCurrentFunction()->Activate();
}
if(!GetDocSh()->IsUIActive()) if(!GetDocSh()->IsUIActive())
UpdatePreview( GetActualPage(), true ); UpdatePreview( GetActualPage(), true );
} }
ReadFrameViewData( mpFrameView ); ReadFrameViewData( mpFrameView );
...@@ -383,14 +377,11 @@ void ViewShell::Deactivate(bool bIsMDIActivate) ...@@ -383,14 +377,11 @@ void ViewShell::Deactivate(bool bIsMDIActivate)
{ {
rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) ); rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );
if(xSlideShow.is() && xSlideShow->isRunning() ) if(xSlideShow.is() && xSlideShow->isRunning() )
{
xSlideShow->deactivate(GetViewShellBase()); xSlideShow->deactivate(GetViewShellBase());
}
if(HasCurrentFunction()) if(HasCurrentFunction())
{
GetCurrentFunction()->Deactivate(); GetCurrentFunction()->Deactivate();
} }
}
if (mpHorizontalRuler.get() != NULL) if (mpHorizontalRuler.get() != NULL)
mpHorizontalRuler->SetActive(false); mpHorizontalRuler->SetActive(false);
...@@ -410,9 +401,7 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) ...@@ -410,9 +401,7 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
bool bReturn(false); bool bReturn(false);
if(pWin) if(pWin)
{
SetActiveWindow(pWin); SetActiveWindow(pWin);
}
if(!bReturn) if(!bReturn)
{ {
...@@ -454,9 +443,7 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) ...@@ -454,9 +443,7 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
const size_t EndCount = GetView()->GetMarkedObjectList().GetMarkCount(); const size_t EndCount = GetView()->GetMarkedObjectList().GetMarkCount();
// Here, oriCount or endCount must have one value=0, another value > 0, then to switch focus between Document and shape objects // Here, oriCount or endCount must have one value=0, another value > 0, then to switch focus between Document and shape objects
if(bReturn && (OriCount + EndCount > 0) && (OriCount * EndCount == 0)) if(bReturn && (OriCount + EndCount > 0) && (OriCount * EndCount == 0))
{
SwitchActiveViewFireFocus(); SwitchActiveViewFireFocus();
}
if(!bReturn && GetActiveWindow()) if(!bReturn && GetActiveWindow())
{ {
...@@ -505,11 +492,9 @@ void ViewShell::MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin) ...@@ -505,11 +492,9 @@ void ViewShell::MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin)
if( !xSelectionController.is() || !xSelectionController->onMouseButtonDown( rMEvt, pWin ) ) if( !xSelectionController.is() || !xSelectionController->onMouseButtonDown( rMEvt, pWin ) )
{ {
if(HasCurrentFunction()) if(HasCurrentFunction())
{
GetCurrentFunction()->MouseButtonDown(rMEvt); GetCurrentFunction()->MouseButtonDown(rMEvt);
} }
} }
}
} }
void ViewShell::LogicMouseButtonDown(const MouseEvent& rMouseEvent) void ViewShell::LogicMouseButtonDown(const MouseEvent& rMouseEvent)
...@@ -608,9 +593,7 @@ void ViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) ...@@ -608,9 +593,7 @@ void ViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
void ViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) void ViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
{ {
if ( pWin ) if ( pWin )
{
SetActiveWindow(pWin); SetActiveWindow(pWin);
}
// insert MouseEvent into E3dView // insert MouseEvent into E3dView
if (GetView() != NULL) if (GetView() != NULL)
...@@ -651,16 +634,12 @@ void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) ...@@ -651,16 +634,12 @@ void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
{ {
bool bConsumed = false; bool bConsumed = false;
if( GetView() ) if( GetView() )
{
bConsumed = GetView()->getSmartTags().Command(rCEvt); bConsumed = GetView()->getSmartTags().Command(rCEvt);
}
if( !bConsumed && HasCurrentFunction()) if( !bConsumed && HasCurrentFunction())
{
GetCurrentFunction()->Command(rCEvt); GetCurrentFunction()->Command(rCEvt);
} }
} }
}
} }
bool ViewShell::Notify(NotifyEvent& rNEvt, ::sd::Window* pWin) bool ViewShell::Notify(NotifyEvent& rNEvt, ::sd::Window* pWin)
...@@ -714,14 +693,10 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi ...@@ -714,14 +693,10 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi
{ {
long nDelta = pData->GetDelta(); long nDelta = pData->GetDelta();
if( nDelta > 0 ) if( nDelta > 0 )
{
xSlideShowController->gotoPreviousSlide(); xSlideShowController->gotoPreviousSlide();
}
else if( nDelta < 0 ) else if( nDelta < 0 )
{
xSlideShowController->gotoNextEffect(); xSlideShowController->gotoNextEffect();
} }
}
break; break;
} }
} }
...@@ -916,9 +891,7 @@ void ViewShell::Resize() ...@@ -916,9 +891,7 @@ void ViewShell::Resize()
::sd::View* pView = GetView(); ::sd::View* pView = GetView();
if (pView) if (pView)
{
pView->VisAreaChanged(GetActiveWindow()); pView->VisAreaChanged(GetActiveWindow());
}
} }
SvBorder ViewShell::GetBorder (bool ) SvBorder ViewShell::GetBorder (bool )
...@@ -1047,9 +1020,7 @@ void ViewShell::ArrangeGUIElements() ...@@ -1047,9 +1020,7 @@ void ViewShell::ArrangeGUIElements()
maViewSize.Height()-maScrBarWH.Height())); maViewSize.Height()-maScrBarWH.Height()));
if (mpContentWindow.get() != NULL) if (mpContentWindow.get() != NULL)
{
mpContentWindow->UpdateMapOrigin(); mpContentWindow->UpdateMapOrigin();
}
UpdateScrollBars(); UpdateScrollBars();
...@@ -1171,10 +1142,8 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const ...@@ -1171,10 +1142,8 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
sal_uInt16 a; sal_uInt16 a;
for( a = 0; a < nCount; a++) for( a = 0; a < nCount; a++)
{
// generate one String in list per undo step // generate one String in list per undo step
aStringList.push_back( pUndoManager->GetRedoActionComment(a) ); aStringList.push_back( pUndoManager->GetRedoActionComment(a) );
}
// set item // set item
rSet.Put(SfxStringListItem(SID_GETREDOSTRINGS, &aStringList)); rSet.Put(SfxStringListItem(SID_GETREDOSTRINGS, &aStringList));
...@@ -1208,10 +1177,8 @@ void ViewShell::ImpSidUndo(bool, SfxRequest& rReq) ...@@ -1208,10 +1177,8 @@ void ViewShell::ImpSidUndo(bool, SfxRequest& rReq)
// when UndoStack is cleared by ModifyPageUndoAction // when UndoStack is cleared by ModifyPageUndoAction
// the nCount may have changed, so test GetUndoActionCount() // the nCount may have changed, so test GetUndoActionCount()
while(nNumber-- && pUndoManager->GetUndoActionCount()) while(nNumber-- && pUndoManager->GetUndoActionCount())
{
pUndoManager->Undo(); pUndoManager->Undo();
} }
}
catch( const Exception& ) catch( const Exception& )
{ {
// no need to handle. By definition, the UndoManager handled this by clearing the // no need to handle. By definition, the UndoManager handled this by clearing the
...@@ -1221,10 +1188,8 @@ void ViewShell::ImpSidUndo(bool, SfxRequest& rReq) ...@@ -1221,10 +1188,8 @@ void ViewShell::ImpSidUndo(bool, SfxRequest& rReq)
// refresh rulers, maybe UNDO was move of TAB marker in ruler // refresh rulers, maybe UNDO was move of TAB marker in ruler
if (mbHasRulers) if (mbHasRulers)
{
Invalidate(SID_ATTR_TABSTOP); Invalidate(SID_ATTR_TABSTOP);
} }
}
// This one is corresponding to the default handling // This one is corresponding to the default handling
// of SID_UNDO in sfx2 // of SID_UNDO in sfx2
...@@ -1255,10 +1220,8 @@ void ViewShell::ImpSidRedo(bool, SfxRequest& rReq) ...@@ -1255,10 +1220,8 @@ void ViewShell::ImpSidRedo(bool, SfxRequest& rReq)
// when UndoStack is cleared by ModifyPageRedoAction // when UndoStack is cleared by ModifyPageRedoAction
// the nCount may have changed, so test GetRedoActionCount() // the nCount may have changed, so test GetRedoActionCount()
while(nNumber-- && pUndoManager->GetRedoActionCount()) while(nNumber-- && pUndoManager->GetRedoActionCount())
{
pUndoManager->Redo(); pUndoManager->Redo();
} }
}
catch( const Exception& ) catch( const Exception& )
{ {
// no need to handle. By definition, the UndoManager handled this by clearing the // no need to handle. By definition, the UndoManager handled this by clearing the
...@@ -1447,14 +1410,10 @@ void ViewShell::SetIsMainViewShell (bool bIsMainViewShell) ...@@ -1447,14 +1410,10 @@ void ViewShell::SetIsMainViewShell (bool bIsMainViewShell)
{ {
mpImpl->mbIsMainViewShell = bIsMainViewShell; mpImpl->mbIsMainViewShell = bIsMainViewShell;
if (bIsMainViewShell) if (bIsMainViewShell)
{
GetDocSh()->Connect (this); GetDocSh()->Connect (this);
}
else else
{
GetDocSh()->Disconnect (this); GetDocSh()->Disconnect (this);
} }
}
} }
void ViewShell::PrePaint() void ViewShell::PrePaint()
...@@ -1517,10 +1476,8 @@ void ViewShell::SwitchViewFireFocus(::com::sun::star::uno::Reference< ::com::sun ...@@ -1517,10 +1476,8 @@ void ViewShell::SwitchViewFireFocus(::com::sun::star::uno::Reference< ::com::sun
{ {
::accessibility::AccessibleDocumentViewBase* pBase = static_cast< ::accessibility::AccessibleDocumentViewBase* >(xAcc.get()); ::accessibility::AccessibleDocumentViewBase* pBase = static_cast< ::accessibility::AccessibleDocumentViewBase* >(xAcc.get());
if (pBase) if (pBase)
{
pBase->SwitchViewActivated(); pBase->SwitchViewActivated();
} }
}
} }
void ViewShell::SwitchActiveViewFireFocus() void ViewShell::SwitchActiveViewFireFocus()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment