21#include <unordered_set>
23#include <rtl/strbuf.hxx>
37#include <svx/strings.hrc>
53#include <osl/diagnose.h>
114 if (pObjList!=
nullptr) {
136 if (pLst==
nullptr)
return false;
143 if (pPage!=
nullptr) {
151 pObj->SetLayer(nLayer);
152 pObj->NbcSetText(rStr);
161 pObj->SetMergedItemSet(aTempAttr);
163 pObj->FitFrameToTextSize();
164 Size aSiz(pObj->GetLogicRect().GetSize());
175 if (pLst==
nullptr)
return false;
182 if (pPage!=
nullptr) {
190 pObj->SetLayer(nLayer);
199 pObj->SetMergedItemSet(aTempAttr);
201 pObj->NbcSetText(rInput,OUString(),eFormat);
202 pObj->FitFrameToTextSize();
203 Size aSiz(pObj->GetLogicRect().GetSize());
208 if(pObj->GetOutlinerParaObject())
210 SdrOutliner& rOutliner = pObj->getSdrModelFromSdrObject().GetHitTestOutliner();
211 rOutliner.
SetText(*pObj->GetOutlinerParaObject());
219 if(pObj->getSdrModelFromSdrObject().GetStyleSheetPool() == pCandidate->
GetPool())
221 pObj->NbcSetStyleSheet(pCandidate,
true);
269 bool bResize=eSrcUnit!=eDstUnit;
275 aXResize=aResize.
X();
276 aYResize=aResize.
Y();
280 for (nPg=0; nPg<nPgCount; nPg++)
290 Size aSiz(aDist.
X(),aDist.
Y());
291 size_t nCloneErrCnt = 0;
298 std::unordered_set<rtl::OUString> aNameSet;
299 for (
size_t nOb=0; nOb<nObjCount; ++nOb)
305 if (pNewObj!=
nullptr)
309 pNewObj->getSdrModelFromSdrObject().SetPasteResize(
true);
310 pNewObj->NbcResize(aPt0,aXResize,aYResize);
311 pNewObj->getSdrModelFromSdrObject().SetPasteResize(
false);
315 pNewObj->NbcMove(aSiz);
325 if(
dynamic_cast<const FmFormObj*
>( pNewObj.get()) !=
nullptr)
340 pNewObj->SetLayer(nLayer);
351 MarkObj(pNewObj.get(),pMarkPV,
false,
true);
355 aCloneList.
AddPair(pSrcOb, pNewObj.get());
367 if(0 != nCloneErrCnt)
370 OStringBuffer
aStr(
"SdrExchangeView::Paste(): Error when cloning ");
372 if(nCloneErrCnt == 1)
374 aStr.append(
"a drawing object.");
378 aStr.append(OString::number(
static_cast<sal_Int32
>(nCloneErrCnt))
379 +
" drawing objects.");
382 aStr.append(
" Not copying object connectors.");
384 OSL_FAIL(
aStr.getStr());
402 nSizX *= double(aMapFact.
X() * rMap.
GetScaleX());
403 nSizY *= double(aMapFact.
Y() * rMap.
GetScaleY());
408 Point aPos(isLOK ? 0 : rCenter.
X()-xs/2, isLOK ? 0 : rCenter.
Y()-ys/2);
437 if(bNoVDevIfOneBmpMarked)
442 if( pGrafObj && ( pGrafObj->
GetGraphicType() == GraphicType::Bitmap ) )
465 const sal_uInt32
nCount(aSdrObjects.size());
506 std::move(xPrimitives),
508 nMaximumQuadraticPixels,
530 if( bNoVDevIfOneMtfMarked )
547 const Size aDummySize(2, 2);
549 pOut->SetOutputSizePixel(aDummySize);
550 pOut->EnableOutput(
false);
634 const css::uno::Reference<css::graphic::XGraphic>& xGraphic
642 if((GraphicType::NONE == aRet.
GetType()) || (GraphicType::Default == aRet.
GetType()))
649 pOut->EnableOutput(
false);
678 ::std::vector< SdrObject* > aRetval;
680 ::std::vector< ::std::vector< SdrMark* > > aObjVectors( 2 );
681 ::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ];
682 ::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ];
692 rObjVector2.push_back( pMark );
694 rObjVector1.push_back( pMark );
697 for(
const std::vector<SdrMark*> & rObjVector : aObjVectors)
699 for(
SdrMark* pMark : rObjVector)
701 aRetval.push_back(pMark->GetMarkedSdrObj());
713 if(!aSdrObjects.empty())
728 std::unique_ptr<SdrModel> pNewModel(
GetModel().AllocModel());
730 pNewModel->InsertPage(pNewPage.get());
741 if(
nullptr !=
dynamic_cast< const SdrPageObj*
>(pObj))
748 pObj->GetLogicRect());
768 SAL_WARN(
"svx",
"OLE gets cloned Persist, EmbeddedObjectContainer will not be copied" );
772 pNewObj = pObj->CloneSdrObject(*pNewModel);
777 pNewPage->InsertObject(pNewObj.get(), SAL_MAX_SIZE);
780 aCloneList.
AddPair(pObj, pNewObj.get());
void AddPair(const SdrObject *pOriginal, SdrObject *pClone)
void CopyConnections() const
const Fraction & X() const
const Fraction & Y() const
const GDIMetaFile & GetGDIMetaFile() const
GraphicType GetType() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
const Fraction & GetScaleX() const
MapUnit GetMapUnit() const
const Fraction & GetScaleY() const
void SetText(const OutlinerParaObject &)
SfxStyleSheet * GetStyleSheet(sal_Int32 nPara)
sal_Int32 GetParagraphCount() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
bool IsUndoEnabled() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
SdrExchangeView(SdrModel &rSdrModel, OutputDevice *pOut)
void ImpGetPasteObjList(Point &rPos, SdrObjList *&rpLst)
bool ImpGetPasteLayer(const SdrObjList *pObjList, SdrLayerID &rLayer) const
Graphic GetAllMarkedGraphic() const
::std::vector< SdrObject * > GetMarkedObjects() const
GDIMetaFile GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked=false) const
static Graphic GetObjGraphic(const SdrObject &rSdrObject, bool bSVG=false)
Generate a Graphic for the given draw object.
virtual void DrawMarkedObj(OutputDevice &rOut) const
virtual bool Paste(const SdrModel &rMod, const Point &rPos, SdrObjList *pLst, SdrInsertFlags nOptions)
bool ImpLimitToWorkArea(Point &rPt) const
void ImpPasteObject(SdrObject *pObj, SdrObjList &rLst, const Point &rCenter, const Size &rSiz, const MapMode &rMap, SdrInsertFlags nOptions)
virtual std::unique_ptr< SdrModel > CreateMarkedObjModel() const
BitmapEx GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked=false, const sal_uInt32 nMaximumQuadraticPixels=500000, const std::optional< Size > &rTargetDPI=std::nullopt) const
This class represents an embedded or linked bitmap graphic object.
GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const
Graphic GetTransformedGraphic(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
const Graphic & GetGraphic() const
GraphicType GetGraphicType() const
bool isEmbeddedVectorGraphicData() const
const OUString & GetControlLayerName() const
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
tools::Rectangle GetMarkedObjBoundRect() const
bool AreObjectsMarked() const
void SortMarkedObjects() const
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
size_t GetMarkedObjectCount() const
SdrMark * GetSdrMarkByIndex(size_t nNum) const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Everything a View needs to know about a selected object.
SdrObject * GetMarkedSdrObj() const
MapUnit GetScaleUnit() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
const SdrLayerAdmin & GetLayerAdmin() const
sal_uInt16 GetPageCount() const
rtl::Reference< sdr::SelectionController > mxSelectionController
virtual bool IsTextEdit() const final override
void InsertObjectThenMakeNameUnique(SdrObject *pObj)
virtual SdrPage * getSdrPageFromSdrObjList() const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
const tools::Rectangle & GetAllObjSnapRect() const
void SingleObjectPainter(OutputDevice &rOut) const
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrModel & getSdrModelFromSdrObject() const
virtual void SetLogicRect(const tools::Rectangle &rRect)
sdr::contact::ViewContact & GetViewContact() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
virtual SdrLayerID GetLayer() const
const Graphic * GetGraphic() const
const SdrLayerIDSet & GetVisibleLayers() const
SdrObjList * GetObjList() const
Return current List.
const SdrLayerIDSet & GetLockedLayers() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
const SdrLayerAdmin & GetLayerAdmin() const
changing the layers does not set the modified-flag!
SdrModel & getSdrModelFromSdrView() const
tools::Rectangle maMaxWorkArea
SfxStyleSheet * mpDefaultStyleSheet
SdrPageView * GetSdrPageView() const
SdrModel & GetModel() const
Rectangle objects (rectangle, circle, ...)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxStyleSheetBasePool * GetPool()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &aViewInformation) const
OUString SvxResId(TranslateId aId)
#define SAL_WARN(area, stream)
BitmapEx convertPrimitive2DContainerToBitmapEx(primitive2d::Primitive2DContainer &&rSequence, const basegfx::B2DRange &rTargetRange, sal_uInt32 nMaximumQuadraticPixels, const o3tl::Length eTargetUnit, const std::optional< Size > &rTargetDPI)
HashMap_OWString_Interface aMap
@ Text
closed free-hand line
@ OLE2
foreign graphic (StarView Graphic)
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
FrPair GetMapFactor(MapUnit eS, MapUnit eD)
o3tl::strong_int< sal_Int16, struct SdrLayerIDTag > SdrLayerID
constexpr SdrLayerID SDRLAYER_NOTFOUND(-1)