diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 7 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 7 | ||||
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 38 |
3 files changed, 25 insertions, 27 deletions
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 3c0fb45a0df0..e1cc81e5ad5d 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -1189,10 +1189,9 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj) { - if(nullptr != dynamic_cast< const E3dScene* >(pObj) && static_cast< E3dScene* >(pObj)->getRootE3dSceneFromE3dObject() == pObj) - { - bThereAreRootScenes = true; - } + if( auto pScene = dynamic_cast< const E3dScene* >(pObj) ) + if( pScene->getRootE3dSceneFromE3dObject() == pObj ) + bThereAreRootScenes = true; if(dynamic_cast< const E3dObject* >(pObj) != nullptr) { diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index f266478927b8..f591334dea08 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -506,10 +506,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co tools::Rectangle aBoundRect(pHitObj->GetCurrentBoundRect()); // Force to SnapRect when Fontwork - if( dynamic_cast<const SdrTextObj*>( pHitObj) != nullptr && static_cast<SdrTextObj*>(pHitObj)->IsFontwork()) - { - aBoundRect = pHitObj->GetSnapRect(); - } + if( auto pTextObj = dynamic_cast<const SdrTextObj*>(pHitObj) ) + if( pTextObj->IsFontwork() ) + aBoundRect = pHitObj->GetSnapRect(); sal_Int32 nTolerance(mnHitTolLog); bool bBoundRectHit(false); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 4180b33b0713..87f2e40bfc36 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -817,29 +817,29 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr { if( !bVectorType ) { - SdrObject* pObj = aShapes.front(); - if( dynamic_cast<const SdrGrafObj*>( pObj) && !static_cast<SdrGrafObj*>(pObj)->HasText() ) - { - aGraphic = static_cast<SdrGrafObj*>(pObj)->GetTransformedGraphic(); - if ( aGraphic.GetType() == GraphicType::Bitmap ) + if( auto pGrafObj = dynamic_cast<const SdrGrafObj*>(aShapes.front()) ) + if (pGrafObj->HasText() ) { - Size aSizePixel( aGraphic.GetSizePixel() ); - if( rSettings.mnWidth && rSettings.mnHeight && - ( ( rSettings.mnWidth != aSizePixel.Width() ) || - ( rSettings.mnHeight != aSizePixel.Height() ) ) ) + aGraphic = pGrafObj->GetTransformedGraphic(); + if ( aGraphic.GetType() == GraphicType::Bitmap ) { - BitmapEx aBmpEx( aGraphic.GetBitmapEx() ); - // export: use highest quality - aBmpEx.Scale( Size( rSettings.mnWidth, rSettings.mnHeight ), BmpScaleFlag::Lanczos ); - aGraphic = aBmpEx; + Size aSizePixel( aGraphic.GetSizePixel() ); + if( rSettings.mnWidth && rSettings.mnHeight && + ( ( rSettings.mnWidth != aSizePixel.Width() ) || + ( rSettings.mnHeight != aSizePixel.Height() ) ) ) + { + BitmapEx aBmpEx( aGraphic.GetBitmapEx() ); + // export: use highest quality + aBmpEx.Scale( Size( rSettings.mnWidth, rSettings.mnHeight ), BmpScaleFlag::Lanczos ); + aGraphic = aBmpEx; + } + + // #118804# only accept for bitmap graphics, else the + // conversion to bitmap will happen anywhere without size control + // as evtl. defined in rSettings.mnWidth/mnHeight + bSingleGraphic = true; } - - // #118804# only accept for bitmap graphics, else the - // conversion to bitmap will happen anywhere without size control - // as evtl. defined in rSettings.mnWidth/mnHeight - bSingleGraphic = true; } - } } else if( rSettings.mbScrollText ) { |