svdmrkv.cxx (d8a41635) svdmrkv.cxx (2376739d)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 41 unchanged lines hidden (view full) ---

50#include <svx/scene3d.hxx>
51#include <svx/svdovirt.hxx>
52#include <svx/sdr/overlay/overlayrollingrectangle.hxx>
53#include <svx/sdr/overlay/overlaymanager.hxx>
54#include <svx/sdrpaintwindow.hxx>
55#include <svx/sdrpagewindow.hxx>
56#include <svx/sdrhittesthelper.hxx>
57#include <svx/svdocapt.hxx>
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 41 unchanged lines hidden (view full) ---

50#include <svx/scene3d.hxx>
51#include <svx/svdovirt.hxx>
52#include <svx/sdr/overlay/overlayrollingrectangle.hxx>
53#include <svx/sdr/overlay/overlaymanager.hxx>
54#include <svx/sdrpaintwindow.hxx>
55#include <svx/sdrpagewindow.hxx>
56#include <svx/sdrhittesthelper.hxx>
57#include <svx/svdocapt.hxx>
58#include <svx/svdograf.hxx>
58
59////////////////////////////////////////////////////////////////////////////////////////////////////
60// predefines
61
62class SdrUnoControlList;
63
64////////////////////////////////////////////////////////////////////////////////////////////////////
65// #114409#-3 Migrate Marking of Objects, Points and GluePoints

--- 690 unchanged lines hidden (view full) ---

756 SdrHdl* pHdl=aHdl.GetHdl(i);
757 pHdl->SetObj(pMarkedObj);
758 pHdl->SetPageView(pMarkedPV);
759 pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
760 }
761 }
762 else if( eDragMode==SDRDRAG_CROP )
763 {
59
60////////////////////////////////////////////////////////////////////////////////////////////////////
61// predefines
62
63class SdrUnoControlList;
64
65////////////////////////////////////////////////////////////////////////////////////////////////////
66// #114409#-3 Migrate Marking of Objects, Points and GluePoints

--- 690 unchanged lines hidden (view full) ---

757 SdrHdl* pHdl=aHdl.GetHdl(i);
758 pHdl->SetObj(pMarkedObj);
759 pHdl->SetPageView(pMarkedPV);
760 pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
761 }
762 }
763 else if( eDragMode==SDRDRAG_CROP )
764 {
765 const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pMarkedObj);
766
767 if(pSdrGrafObj)
768 {
769 const SdrGrafCropItem& rCrop = static_cast< const SdrGrafCropItem& >(pSdrGrafObj->GetMergedItem(SDRATTR_GRAFCROP));
770
771 if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom())
772 {
773 basegfx::B2DHomMatrix aMatrix;
774 basegfx::B2DPolyPolygon aPolyPolygon;
775
776 pSdrGrafObj->TRGetBaseGeometry(aMatrix, aPolyPolygon);
777
778 // decompose to have current translate and scale
779 basegfx::B2DVector aScale, aTranslate;
780 double fRotate, fShearX;
781
782 aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
783
784 if(!aScale.equalZero())
785 {
786 // get crop scale
787 const basegfx::B2DVector aCropScaleFactor(
788 pSdrGrafObj->GetGraphicObject().calculateCropScaling(
789 aScale.getX(),
790 aScale.getY(),
791 rCrop.GetLeft(),
792 rCrop.GetTop(),
793 rCrop.GetRight(),
794 rCrop.GetBottom()));
795
796 // apply crop scale
797 const double fCropLeft(rCrop.GetLeft() * aCropScaleFactor.getX());
798 const double fCropTop(rCrop.GetTop() * aCropScaleFactor.getY());
799 const double fCropRight(rCrop.GetRight() * aCropScaleFactor.getX());
800 const double fCropBottom(rCrop.GetBottom() * aCropScaleFactor.getY());
801
802 aHdl.AddHdl(
803 new SdrCropViewHdl(
804 aMatrix,
805 pSdrGrafObj->GetGraphicObject().GetGraphic(),
806 fCropLeft,
807 fCropTop,
808 fCropRight,
809 fCropBottom,
810 pSdrGrafObj->IsMirrored()));
811 }
812 }
813 }
814
764 aHdl.AddHdl(new SdrCropHdl(aRect.TopLeft() ,HDL_UPLFT));
765 aHdl.AddHdl(new SdrCropHdl(aRect.TopCenter() ,HDL_UPPER));
766 aHdl.AddHdl(new SdrCropHdl(aRect.TopRight() ,HDL_UPRGT));
767 aHdl.AddHdl(new SdrCropHdl(aRect.LeftCenter() ,HDL_LEFT ));
768 aHdl.AddHdl(new SdrCropHdl(aRect.RightCenter() ,HDL_RIGHT));
769 aHdl.AddHdl(new SdrCropHdl(aRect.BottomLeft() ,HDL_LWLFT));
770 aHdl.AddHdl(new SdrCropHdl(aRect.BottomCenter(),HDL_LOWER));
771 aHdl.AddHdl(new SdrCropHdl(aRect.BottomRight() ,HDL_LWRGT));

--- 1419 unchanged lines hidden ---
815 aHdl.AddHdl(new SdrCropHdl(aRect.TopLeft() ,HDL_UPLFT));
816 aHdl.AddHdl(new SdrCropHdl(aRect.TopCenter() ,HDL_UPPER));
817 aHdl.AddHdl(new SdrCropHdl(aRect.TopRight() ,HDL_UPRGT));
818 aHdl.AddHdl(new SdrCropHdl(aRect.LeftCenter() ,HDL_LEFT ));
819 aHdl.AddHdl(new SdrCropHdl(aRect.RightCenter() ,HDL_RIGHT));
820 aHdl.AddHdl(new SdrCropHdl(aRect.BottomLeft() ,HDL_LWLFT));
821 aHdl.AddHdl(new SdrCropHdl(aRect.BottomCenter(),HDL_LOWER));
822 aHdl.AddHdl(new SdrCropHdl(aRect.BottomRight() ,HDL_LWRGT));

--- 1419 unchanged lines hidden ---