sd/source/ui/view/sdview.cxx | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-)
New commits: commit f1693c5387833a6fc6ad87dedb3ebb5d3d8de852 Author: Noel Grandin <n...@peralex.com> Date: Tue Oct 18 16:25:23 2016 +0200 use early returns in View::OnEndPasteOrDrop Change-Id: I37afbd64c4f4887aa6a0262ffc362ec8714cbf91 diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index a4ed147..014a67d 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1207,24 +1207,25 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfo ) /* Style Sheet handling */ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( GetTextEditObject() ); SdrOutliner* pOutliner = GetTextEditOutliner(); - if( pOutliner && pTextObj && pTextObj->GetPage() ) + if( !pOutliner || !pTextObj || !pTextObj->GetPage() ) + return; + + SdPage* pPage = static_cast< SdPage* >( pTextObj->GetPage() ); + const PresObjKind eKind = pPage->GetPresObjKind(pTextObj); + + // outline kinds are taken care of in Outliner::ImplSetLevelDependendStyleSheet + if( eKind == PRESOBJ_OUTLINE ) + return; + + SfxStyleSheet* pStyleSheet = nullptr; + if( eKind != PRESOBJ_NONE ) + pStyleSheet = pPage->GetStyleSheetForPresObj(eKind); + else + pStyleSheet = pTextObj->GetStyleSheet(); + // just put the object style on each new paragraph + for ( sal_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; nPara++ ) { - SdPage* pPage = static_cast< SdPage* >( pTextObj->GetPage() ); - const PresObjKind eKind = pPage->GetPresObjKind(pTextObj); - // outline kinds are taken care of in Outliner::ImplSetLevelDependendStyleSheet - if( eKind != PRESOBJ_OUTLINE ) - { - SfxStyleSheet* pStyleSheet = nullptr; - if( eKind != PRESOBJ_NONE ) - pStyleSheet = pPage->GetStyleSheetForPresObj(eKind); - else - pStyleSheet = pTextObj->GetStyleSheet(); - // just put the object style on each new paragraph - for ( sal_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; nPara++ ) - { - pOutliner->SetStyleSheet( nPara, pStyleSheet ); - } - } + pOutliner->SetStyleSheet( nPara, pStyleSheet ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits