diff options
Diffstat (limited to 'sd/source/ui/view/drviews2.cxx')
-rwxr-xr-x | sd/source/ui/view/drviews2.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 732abf866dec..ba0afc2b0b57 100755 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -627,7 +627,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) else { if( mpDrawView->IsVectorizeAllowed() ) + { SetCurrentFunction( FuVectorize::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); + } else { WaitObject aWait( (Window*)GetActiveWindow() ); @@ -709,8 +711,31 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) break; case SID_CONVERT_TO_BITMAP: { - Bitmap aBitmap (mpDrawView->GetAllMarkedBitmap ()); - aGraphic = Graphic(aBitmap); + bool bDone(false); + + // I have to get the image here directly since GetAllMarkedBitmap works + // based on Bitmaps, but not on BitmapEx, thus throwing away the alpha + // channel. Argh! GetAllMarkedBitmap itself is too widely used to safely + // change that, e.g. in the exchange formats. For now I can only add this + // exception to get good results for Svgs. This is how the code gets more + // and more crowded, at last I made a remark for myself to change this + // as one of the next tasks. + if(1 == mpDrawView->GetMarkedObjectCount()) + { + const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->GetMarkedObjectByIndex(0)); + + if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg()) + { + aGraphic = Graphic(pSdrGrafObj->GetGraphic().getSvgData()->getReplacement()); + bDone = true; + } + } + + if(!bDone) + { + Bitmap aBitmap (mpDrawView->GetAllMarkedBitmap ()); + aGraphic = Graphic(aBitmap); + } } break; } |